all files / pivotview/actions/ excel-export-helper.js

100% Statements 26/26
87.5% Branches 7/8
100% Functions 8/8
100% Lines 26/26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40   35×   115×   10× 10×   20× 20×   85× 85×                  
define(["require", "exports", "@syncfusion/ej2-base"], function (require, exports, ej2_base_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var ExcelExportHelper = (function () {
        function ExcelExportHelper(parent) {
            this.parent = parent;
        }
        ExcelExportHelper.prototype.updateThemeStyle = function (themestyle, style) {
            return ej2_base_1.extend(style, themestyle);
        };
        ExcelExportHelper.prototype.getCaptionThemeStyle = function (theme, styles) {
            var style = this.updateThemeStyle(theme.caption, styles);
            return style;
        };
        ExcelExportHelper.prototype.getHeaderThemeStyle = function (theme, styles) {
            var style = this.updateThemeStyle(theme.header, styles);
            return style;
        };
        ExcelExportHelper.prototype.getRecordThemeStyle = function (theme, styles) {
            var style = this.updateThemeStyle(theme.record, styles);
            return style;
        };
        ExcelExportHelper.prototype.setImage = function (args, colIndex, rowIndex, rowHeight) {
            var excelImage = {
                image: args.image.base64, row: rowIndex, column: colIndex + 1,
                lastRow: rowIndex, lastColumn: colIndex + 1
            };
            if (args.image.width && args.image.height) {
                excelImage.width = args.image.width;
                excelImage.height = args.image.height;
            }
            this.parent.excelExportModule.images.push(excelImage);
            var height = rowHeight > args.image.height ? rowHeight : args.image.height;
            return height || 50;
        };
        return ExcelExportHelper;
    }());
    exports.ExcelExportHelper = ExcelExportHelper;
});