all files / spreadsheet/actions/ cell-format.js

92.75% Statements 256/276
88.45% Branches 268/303
100% Functions 18/18
92.73% Lines 255/275
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412   885× 885× 885×   121130× 1334× 1334×   1334× 1334×   119796× 119796× 119796× 75703×   44093× 44093× 31190× 31190×   31190× 3038× 11583× 3038×           3038× 2803× 2803×   3038× 2850× 2850×   3038× 2673× 2644×   2673×       28152× 86×   28152× 28152× 28152× 38× 38×       31190× 31190× 31137× 28761× 18132× 5662×   18132× 558× 558× 142×         10629× 3764×   10629× 21×   10629× 10629×   10629× 64×         53× 10× 10×           12903×     25068× 9388× 9388× 9388× 9284× 9284×   9284× 9284×         9284× 9284× 94×   9284× 9284× 7950× 7950× 21× 21×     9284× 2389× 2389× 2389× 2389× 1780×           31190× 31190× 31190× 31190× 27× 27× 13×     31190× 34× 34× 13×       2850×     2850× 2850×   2850× 2670× 2670× 73× 73× 73× 73× 69×               2597×     2597×       180×     2803×     2803× 2803× 2803×           2803× 2803× 2717× 2717× 80× 80× 80× 80× 79×               2637×       2637×     2637× 2637×       86×     5367× 5367× 5367× 79× 79× 29×   79×                     5367×   123× 95×   123×     5332× 5332×     49× 49× 49×   49×     49× 49× 49× 49× 49× 49× 49× 49× 49× 49×   49× 49× 27×     49× 49× 27× 27× 19×   27×     49× 49×                   47× 47× 36× 36× 36× 36× 21× 21×     36× 188× 188× 188× 370× 370× 370× 356×   356×   356×               47×   47× 47× 47× 47× 43×   47× 47×     885× 885×   885× 13× 13×     885× 885× 885×   126650×        
define(["require", "exports", "../../spreadsheet/index", "../common/index", "../common/index", "../../workbook/index", "../../workbook/index", "../../workbook/index", "../../workbook/index", "../../workbook/index", "@syncfusion/ej2-base", "../common/index"], function (require, exports, index_1, index_2, index_3, index_4, index_5, index_6, index_7, index_8, ej2_base_1, index_9) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var CellFormat = (function () {
        function CellFormat(parent) {
            this.checkHeight = false;
            this.parent = parent;
            this.addEventListener();
        }
        CellFormat.prototype.applyCellFormat = function (args) {
            if (args.checkHeight) {
                Eif (!this.checkHeight) {
                    this.checkHeight = true;
                }
                this.updateRowHeight(args.rowIdx, args.colIdx, args.lastCell, args.onActionUpdate, args.outsideViewport);
                return;
            }
            var keys = Object.keys(args.style);
            var sheet = this.parent.getActiveSheet();
            if (args.lastCell && index_3.getMaxHgt(sheet, args.rowIdx) <= 20 && !keys.length) {
                return;
            }
            var cell = args.td || this.parent.getCell(args.rowIdx, args.colIdx);
            if (cell) {
                this.updateMergeBorder(args, sheet);
                if (args.formatColor && cell.style.color === args.formatColor) {
                    delete args.style.color;
                }
                if (args.style.border !== undefined || args.style.borderTop !== undefined || args.style.borderLeft !== undefined) {
                    var curStyle_1 = {};
                    Object.keys(args.style).forEach(function (key) { curStyle_1["" + key] = args.style["" + key]; });
                    Iif (curStyle_1.border !== undefined) {
                        Object.assign(cell.style, { borderRight: args.style.border, borderBottom: args.style.border });
                        this.setLeftBorder(args.style.border, cell, args.rowIdx, args.colIdx, args.row, args.onActionUpdate, args.first, sheet);
                        this.setTopBorder(args.style.border, cell, args.rowIdx, args.colIdx, args.pRow, args.pHRow, args.onActionUpdate, args.first, args.lastCell, args.manualUpdate, sheet);
                        delete curStyle_1.border;
                    }
                    if (curStyle_1.borderTop !== undefined) {
                        this.setTopBorder(args.style.borderTop, cell, args.rowIdx, args.colIdx, args.pRow, args.pHRow, args.onActionUpdate, args.first, args.lastCell, args.manualUpdate, sheet);
                        delete curStyle_1.borderTop;
                    }
                    if (curStyle_1.borderLeft !== undefined) {
                        this.setLeftBorder(args.style.borderLeft, cell, args.rowIdx, args.colIdx, args.row, args.onActionUpdate, args.first, sheet);
                        delete curStyle_1.borderLeft;
                    }
                    if (Object.keys(curStyle_1).length) {
                        if (curStyle_1.borderBottom !== undefined) {
                            this.setThickBorderHeight(curStyle_1.borderBottom, args.rowIdx, args.colIdx, cell, args.row, args.hRow, args.onActionUpdate, args.lastCell, args.manualUpdate);
                        }
                        Object.assign(cell.style, curStyle_1);
                    }
                }
                else {
                    if (args.style.borderBottom !== undefined) {
                        this.setThickBorderHeight(args.style.borderBottom, args.rowIdx, args.colIdx, cell, args.row, args.hRow, args.onActionUpdate, args.lastCell, args.manualUpdate);
                    }
                    Object.assign(cell.style, args.style);
                    var CellElem = index_5.getCell(args.rowIdx, args.colIdx, sheet);
                    if (CellElem && (CellElem.rowSpan || CellElem.colSpan) && cell.offsetHeight > 0) {
                        var height = index_3.getTextHeight(this.parent, CellElem.style || this.parent.cellStyle);
                        if (height > cell.offsetHeight) {
                            index_3.setRowEleHeight(this.parent, sheet, cell.offsetHeight, args.rowIdx);
                        }
                    }
                }
                var cellModel = index_5.getCell(args.rowIdx, args.colIdx, sheet, null, true);
                if (!sheet.rows[args.rowIdx] || !sheet.rows[args.rowIdx].customHeight) {
                    if (args.isHeightCheckNeeded) {
                        if (!args.manualUpdate) {
                            if (!cellModel.wrap && index_7.isHeightCheckNeeded(args.style)) {
                                index_3.setMaxHgt(sheet, args.rowIdx, args.colIdx, index_1.getTextHeightWithBorder(this.parent, args.rowIdx, args.colIdx, sheet, args.style));
                            }
                            if (args.lastCell) {
                                var height = index_3.getMaxHgt(sheet, args.rowIdx);
                                if (height > 20 && height > index_4.getRowHeight(sheet, args.rowIdx)) {
                                    index_3.setRowEleHeight(this.parent, sheet, height, args.rowIdx, args.row, args.hRow, this.parent.scrollSettings.isFinite);
                                }
                            }
                        }
                        else {
                            if (!this.checkHeight) {
                                this.checkHeight = index_7.isHeightCheckNeeded(args.style, args.onActionUpdate);
                            }
                            if (cell && cell.children[0] && cell.children[0].className === 'e-cf-databar' && args.style.fontSize) {
                                cell.children[0].querySelector('.e-databar-value').style.fontSize = args.style.fontSize;
                            }
                            Eif (!args.isFromAutoFillOption) {
                                this.updateRowHeight(args.rowIdx, args.colIdx, args.lastCell, args.onActionUpdate);
                            }
                            if (cellModel.wrap && (args.style.fontSize || args.style.fontFamily)) {
                                cell.style.lineHeight = (parseFloat((cellModel.style && cellModel.style.fontSize) || this.parent.cellStyle.fontSize) * index_2.getLineHeight(cellModel.style && cellModel.style.fontFamily ? cellModel.style : this.parent.cellStyle)) + 'pt';
                            }
                        }
                    }
                }
                else if (!cellModel.wrap && (args.style.fontSize || args.style.fontFamily)) {
                    var hgt = index_4.getRowHeight(sheet, args.rowIdx, true) - index_2.getBorderHeight(args.rowIdx, args.colIdx, sheet);
                    if (hgt < index_3.getTextHeight(this.parent, cellModel.style)) {
                        cell.style.lineHeight = hgt + "px";
                    }
                    else Eif (cell.style.lineHeight) {
                        cell.style.lineHeight = '';
                    }
                }
            }
            else {
                this.updateRowHeight(args.rowIdx, args.colIdx, true, args.onActionUpdate);
            }
        };
        CellFormat.prototype.updateRowHeight = function (rowIdx, colIdx, isLastCell, onActionUpdate, outsideViewport) {
            if (this.checkHeight) {
                var sheet = this.parent.getActiveSheet();
                var cell = index_5.getCell(rowIdx, colIdx, sheet, null, true);
                if (!cell.rowSpan) {
                    var hgt = 0;
                    hgt = index_1.getTextHeightWithBorder(this.parent, rowIdx, colIdx, sheet, cell.style || this.parent.cellStyle, cell.wrap && !cell.colSpan ? index_3.getLines(this.parent.getDisplayText(cell), index_2.getExcludedColumnWidth(sheet, rowIdx, colIdx), cell.style, this.parent.cellStyle)
                        : 1);
                    var val = cell.value && cell.value.toString();
                    if (val && val.indexOf('\n') > -1) {
                        var i = void 0;
                        var splitVal = val.split('\n');
                        var n = 0;
                        var valLength = splitVal.length;
                        for (i = 0; i < valLength; i++) {
                            var lines = index_3.getLines(splitVal[i], index_2.getExcludedColumnWidth(sheet, rowIdx, colIdx), cell.style, this.parent.cellStyle);
                            Iif (lines === 0) {
                                lines = 1;
                            }
                            n = n + lines;
                        }
                        hgt = index_1.getTextHeightWithBorder(this.parent, rowIdx, colIdx, sheet, cell.style || this.parent.cellStyle, n);
                    }
                    var defaultHeight = sheet.standardHeight ? sheet.standardHeight : 20;
                    if (hgt < defaultHeight) {
                        hgt = defaultHeight;
                    }
                    index_3.setMaxHgt(sheet, rowIdx, colIdx, hgt);
                    if (!outsideViewport) {
                        var td = this.parent.getCell(rowIdx, colIdx);
                        if (td && td.children[0] && td.children[0].className === 'e-cf-databar') {
                            td.children[0].style.height = '100%';
                            td.children[0].firstElementChild.nextElementSibling.style.height = '100%';
                        }
                    }
                    if (isLastCell) {
                        this.checkHeight = false;
                        var maxHgt = index_3.getMaxHgt(sheet, rowIdx);
                        var prevHgt = index_4.getRowHeight(sheet, rowIdx);
                        if (onActionUpdate ? maxHgt !== prevHgt : maxHgt > prevHgt) {
                            index_3.setRowEleHeight(this.parent, sheet, maxHgt, rowIdx, null, null, true, outsideViewport);
                        }
                    }
                }
            }
        };
        CellFormat.prototype.updateMergeBorder = function (args, sheet) {
            var cellModel = index_5.getCell(args.rowIdx, args.colIdx, sheet, null, true);
            var mergeArgs = { range: [args.rowIdx, args.colIdx, args.rowIdx, args.colIdx] };
            this.parent.notify(index_6.activeCellMergedRange, mergeArgs);
            if (cellModel.rowSpan > 1 && !args.style.borderBottom) {
                var bottomCell = index_5.getCell(mergeArgs.range[2], mergeArgs.range[1], sheet, null, true);
                if (bottomCell.style && bottomCell.style.borderBottom) {
                    args.style.borderBottom = bottomCell.style.borderBottom;
                }
            }
            if (cellModel.colSpan > 1 && !args.style.borderRight) {
                var rightCell = index_5.getCell(mergeArgs.range[0], mergeArgs.range[3], sheet, null, true);
                if (rightCell.style && rightCell.style.borderRight) {
                    args.style.borderRight = rightCell.style.borderRight;
                }
            }
        };
        CellFormat.prototype.setLeftBorder = function (border, cell, rowIdx, colIdx, row, actionUpdate, first, sheet) {
            Iif (first && first.includes('Column')) {
                return;
            }
            var isRtl = this.parent.enableRtl;
            var prevCell = isRtl ? this.parent.getCell(rowIdx, colIdx + 1, row) :
                this.parent.getCell(rowIdx, colIdx - 1, row);
            if (prevCell) {
                var model = index_5.getCell(rowIdx, colIdx - 1, sheet, false, true);
                if ((!!model.rowSpan && model.rowSpan !== 1) || (!!model.colSpan && model.colSpan !== 1)) {
                    var mergeArgs = { range: [rowIdx, colIdx - 1, rowIdx, colIdx - 1] };
                    this.parent.notify(index_6.activeCellMergedRange, mergeArgs);
                    model = index_5.getCell(mergeArgs.range[0], mergeArgs.range[1], sheet, false, true);
                    if (model.style && model.style.borderRight && model.style.borderRight !== 'none') {
                        return;
                    }
                    else {
                        model = index_5.getCell(mergeArgs.range[0], mergeArgs.range[3], sheet, null, true);
                        Iif (model.style && model.style.borderRight && model.style.borderRight !== 'none') {
                            return;
                        }
                        cell.style.borderLeft = border;
                    }
                }
                else {
                    Iif (actionUpdate && border !== '' && colIdx === this.parent.viewport.leftIndex) {
                        this.parent.getMainContent().scrollLeft -= this.getBorderSize(border);
                    }
                    prevCell.style.borderRight = (border === 'none') ? prevCell.style.borderRight : border;
                }
            }
            else {
                cell.style.borderLeft = border;
            }
        };
        CellFormat.prototype.setTopBorder = function (border, cell, rowIdx, colIdx, pRow, pHRow, actionUpdate, first, lastCell, manualUpdate, sheet) {
            Iif (first && first.includes('Row')) {
                return;
            }
            var col = colIdx;
            var model = index_5.getCell(rowIdx, colIdx, sheet, false, true);
            Iif (model.colSpan > 1 && index_8.isHiddenCol(sheet, colIdx)) {
                col = index_8.skipHiddenIdx(sheet, colIdx, true, 'columns');
                if (col > colIdx + model.colSpan - 1) {
                    col = colIdx;
                }
            }
            var prevCell = this.parent.getCell(rowIdx - 1, col, pRow);
            if (prevCell) {
                model = index_5.getCell(rowIdx - 1, colIdx, sheet, false, true);
                if ((!!model.rowSpan && model.rowSpan !== 1) || (!!model.colSpan && model.colSpan !== 1)) {
                    var mergeArgs = { range: [rowIdx - 1, colIdx, rowIdx - 1, colIdx] };
                    this.parent.notify(index_6.activeCellMergedRange, mergeArgs);
                    model = index_5.getCell(mergeArgs.range[0], mergeArgs.range[1], sheet, false, true);
                    if (model.style && model.style.borderBottom && model.style.borderBottom !== 'none') {
                        return;
                    }
                    else {
                        model = index_5.getCell(mergeArgs.range[2], mergeArgs.range[1], sheet, null, true);
                        Iif (model.style && model.style.borderBottom && model.style.borderBottom !== 'none') {
                            return;
                        }
                        cell.style.borderTop = border;
                    }
                }
                else {
                    if (index_5.isHiddenRow(sheet, rowIdx - 1)) {
                        var index = [Number(prevCell.parentElement.getAttribute('aria-rowindex')) - 1, colIdx];
                        Iif (this.parent.getCellStyleValue(['bottomPriority'], index).bottomPriority) {
                            return;
                        }
                    }
                    Iif (actionUpdate && border !== '' && sheet.topLeftCell.includes("" + (rowIdx + 1))) {
                        this.parent.getMainContent().parentElement.scrollTop -= this.getBorderSize(border);
                    }
                    this.setThickBorderHeight(border, rowIdx - 1, colIdx, prevCell, pRow, pHRow, actionUpdate, lastCell, manualUpdate);
                    prevCell.style.borderBottom = (border === 'none') ? prevCell.style.borderBottom : border;
                }
            }
            else {
                cell.style.borderTop = border;
            }
        };
        CellFormat.prototype.setThickBorderHeight = function (border, rowIdx, colIdx, cell, row, hRow, actionUpdate, lastCell, manualUpdate) {
            var size = border ? this.getBorderSize(border) : 1;
            var sheet = this.parent.getActiveSheet();
            if (size > 2 && (!sheet.rows[rowIdx] || !sheet.rows[rowIdx].customHeight)) {
                Eif (manualUpdate) {
                    if (!this.checkHeight) {
                        this.checkHeight = true;
                    }
                    this.updateRowHeight(rowIdx, colIdx, lastCell, actionUpdate);
                }
                else {
                    var prevHeight = index_4.getRowHeight(sheet, rowIdx);
                    var height = Math.ceil(this.parent.calculateHeight(this.parent.getCellStyleValue(['fontFamily', 'fontSize'], [rowIdx, colIdx]), 1, 3));
                    if (height > prevHeight) {
                        index_3.setRowEleHeight(this.parent, sheet, height, rowIdx, row, hRow, false);
                        this.parent.notify(index_3.rowHeightChanged, { rowIdx: rowIdx, threshold: height - 20 });
                    }
                }
            }
            if (actionUpdate && (lastCell || !this.checkHeight) && size < 3 && (!sheet.rows[rowIdx] ||
                !sheet.rows[rowIdx].customHeight)) {
                if (!this.checkHeight) {
                    this.checkHeight = true;
                }
                this.updateRowHeight(rowIdx, colIdx, lastCell, actionUpdate);
            }
        };
        CellFormat.prototype.getBorderSize = function (border) {
            var size = border.split(' ')[0];
            return size === 'thin' ? 1 : (size === 'medium' ? 2 : (size === 'thick' ? 3 :
                (parseInt(size, 10) ? parseInt(size, 10) : 1)));
        };
        CellFormat.prototype.clearObj = function (args) {
            var _this = this;
            var options = args.options;
            var range = options.range ? (options.range.indexOf('!') > 0) ?
                options.range.substring(options.range.lastIndexOf('!') + 1) : options.range : this.parent.getActiveSheet().selectedRange;
            var sheetIndex = (options.range && options.range.indexOf('!') > 0) ?
                index_5.getSheetIndex(this.parent, options.range.substring(0, options.range.lastIndexOf('!'))) :
                this.parent.activeSheetIndex;
            var rangeIdx = index_8.getSwapRange(index_5.getRangeIndexes(range));
            var sheet = this.parent.sheets[sheetIndex];
            var sRIdx = rangeIdx[0];
            var eRIdx = rangeIdx[2];
            var sCIdx;
            var eCIdx;
            var overlayElements = this.parent.element.getElementsByClassName('e-ss-overlay-active');
            var isOverlay = overlayElements.length > 0;
            var clearCFArgs;
            var eventArgs = { range: range, type: options.type, requestType: 'clear',
                sheetIndex: sheetIndex };
            var actionBegin = function () {
                if (args.isAction) {
                    _this.parent.notify(index_7.beginAction, { action: 'beforeClear', eventArgs: eventArgs });
                }
            };
            var actionComplete = function () {
                if (args.isAction) {
                    eventArgs = { range: sheet.name + '!' + range, type: options.type, sheetIndex: sheetIndex };
                    if (clearCFArgs) {
                        eventArgs.cfClearActionArgs = clearCFArgs.cfClearActionArgs;
                    }
                    _this.parent.notify(index_2.completeAction, { eventArgs: eventArgs, action: 'clear' });
                }
            };
            var isClearAll = options.type === 'Clear All';
            if (isOverlay) {
                if (overlayElements[0].classList.contains('e-datavisualization-chart')) {
                    Eif (options.type === 'Clear Contents' || isClearAll) {
                        actionBegin();
                        this.parent.notify(index_9.deleteChart, {
                            id: overlayElements[0].id, sheetIdx: this.parent.activeSheetIndex + 1
                        });
                        actionComplete();
                    }
                }
                else Eif (isClearAll) {
                    actionBegin();
                    this.parent.notify(index_9.deleteImage, {
                        id: overlayElements[0].id, sheetIdx: this.parent.activeSheetIndex + 1
                    });
                    actionComplete();
                }
            }
            else {
                actionBegin();
                if (options.type === 'Clear Formats' || isClearAll) {
                    clearCFArgs = { range: range, sheetIdx: sheetIndex, isClear: true };
                    this.parent.notify(index_5.clearCFRule, clearCFArgs);
                    args.cfClearActionArgs = clearCFArgs.cfClearActionArgs;
                    if (isClearAll) {
                        this.parent.notify(index_6.cellValidation, { range: range, isRemoveValidation: true, viewport: this.parent.viewport });
                        if (sRIdx === 0 && rangeIdx[1] === 0 && eRIdx >= sheet.usedRange.rowIndex && rangeIdx[3] >= sheet.usedRange.colIndex) {
                            this.parent.setUsedRange(sRIdx, rangeIdx[1], sheet, false, true);
                        }
                    }
                    for (sRIdx; sRIdx <= eRIdx; sRIdx++) {
                        sCIdx = rangeIdx[1];
                        eCIdx = rangeIdx[3];
                        for (sCIdx; sCIdx <= eCIdx; sCIdx++) {
                            var cell = index_5.getCell(sRIdx, sCIdx, sheet);
                            var cellElem = this.parent.getCell(sRIdx, sCIdx);
                            if (cell) {
                                if (isClearAll && cell.formula) {
                                    this.parent.notify(index_4.clearFormulaDependentCells, { cellRef: index_6.getRangeAddress([sRIdx, sCIdx, sRIdx, sCIdx]) });
                                }
                                if (cell.wrap) {
                                    this.parent.notify(index_6.wrapEvent, { range: [sRIdx, sCIdx, sRIdx, sCIdx], wrap: false, sheet: sheet });
                                }
                                if (cell.hyperlink) {
                                    if (cellElem) {
                                        ej2_base_1.removeClass(cellElem.querySelectorAll('.e-hyperlink'), 'e-hyperlink-style');
                                    }
                                    if (isClearAll) {
                                        this.parent.removeHyperlink(sheet.name + '!' + index_6.getRangeAddress([sRIdx, sCIdx, sRIdx, sCIdx]));
                                    }
                                }
                            }
                        }
                    }
                }
                if (options.type === 'Clear Hyperlinks') {
                    this.parent.removeHyperlink(sheet.name + '!' + range);
                }
                this.parent.notify(index_6.clear, { range: sheet.name + '!' + range, type: options.type });
                this.parent.serviceLocator.getService('cell').refreshRange(index_8.getSwapRange(index_5.getRangeIndexes(range)), false, false, false, false, index_8.isImported(this.parent), !isClearAll);
                this.parent.notify(index_6.addHighlight, { range: range, isclearFormat: true });
                if (!args.isFromUpdateAction) {
                    this.parent.notify(index_2.selectRange, { address: range });
                }
                this.parent.notify(index_5.activeCellChanged, null);
                actionComplete();
            }
        };
        CellFormat.prototype.addEventListener = function () {
            this.parent.on(index_4.applyCellFormat, this.applyCellFormat, this);
            this.parent.on(index_1.clearViewer, this.clearObj, this);
        };
        CellFormat.prototype.removeEventListener = function () {
            if (!this.parent.isDestroyed) {
                this.parent.off(index_4.applyCellFormat, this.applyCellFormat);
                this.parent.off(index_1.clearViewer, this.clearObj);
            }
        };
        CellFormat.prototype.destroy = function () {
            this.removeEventListener();
            this.parent = null;
            this.checkHeight = null;
        };
        CellFormat.prototype.getModuleName = function () {
            return 'cellformat';
        };
        return CellFormat;
    }());
    exports.CellFormat = CellFormat;
});