all files / document-editor-container/properties-pane/ table-properties-pane.js

83.68% Statements 564/674
52.3% Branches 91/174
31.82% Functions 28/88
83.68% Lines 564/674
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 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879   60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60×   60× 60× 60× 60× 60×     1072×         60× 60× 60× 60× 60× 60× 60× 60× 60× 60×   76× 76×           60× 60× 60× 60× 60× 60× 60× 60× 60× 60×       60× 60× 60×           60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60×   59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59× 59×                                                                                                                                                                                                                                                               65× 65×       65×   65×   65× 65× 65× 65×                     60× 60× 60× 60× 60×   60× 60× 60× 60× 60×   60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60×   60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 59×       60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 60×   60× 60× 60× 60× 60× 60× 60× 60×   60× 60× 60×   60× 60× 60× 60× 60× 60× 60× 60× 60× 60× 59×       60× 60× 60× 60× 60× 60× 60× 60× 60×   60× 60× 60× 60× 60× 60× 60×   60× 60× 60× 60× 60× 60× 60×   60× 60× 60× 60× 60× 60× 60×   60× 60× 60× 60× 60× 60× 60× 60×   240× 240× 180×   240× 240× 240× 240× 240× 240× 240× 240× 240×   60× 60× 60×       60× 60× 60×     60× 60× 60×     60× 60×     60× 60×     60× 60×     60× 60×     60× 60×     60× 60×     60× 60×     60× 60×     60× 60×     60×             60× 60×           60×     60× 60× 60×               660×       660× 660× 660× 60×   600×       600×   660×       660× 660×                                 1140× 1140× 1140×       1140× 1140× 1140× 1140×   120× 120× 120× 120× 120× 60×   120×       120× 120× 120×   75× 65× 57×         65× 65× 65×   75× 55×   20× 20× 20×   20× 20×   23× 22× 22× 22× 22× 22×       59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59×   59× 59× 177× 177×   59× 59× 59×     59× 59× 59× 59× 59× 59× 59×   59× 59× 59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59×   59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59× 59×   59× 59× 59×   59× 59× 59×   59× 59× 59× 59× 59×        
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-navigations", "./text-properties-pane", "@syncfusion/ej2-buttons", "@syncfusion/ej2-splitbuttons", "@syncfusion/ej2-inputs"], function (require, exports, ej2_base_1, ej2_navigations_1, text_properties_pane_1, ej2_buttons_1, ej2_splitbuttons_1, ej2_inputs_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var TableProperties = (function () {
        function TableProperties(container, imageProperty, isRtl) {
            this.isTopMarginApply = false;
            this.isRightMarginApply = false;
            this.isBottomMarginApply = false;
            this.isLeftMarginApply = false;
            this.borderColor = '#000000';
            this.groupButtonClass = 'e-de-ctnr-group-btn e-btn-group';
            this.onOutlineBorderClickHandler = this.onOutlineBorder.bind(this);
            this.onAllBorderHandler = this.onAllBorder.bind(this);
            this.onInsideBorderHandler = this.onInsideBorder.bind(this);
            this.onLeftBorderHandler = this.onLeftBorder.bind(this);
            this.onVerticalBorderHandler = this.onVerticalBorder.bind(this);
            this.onRightBorderHandler = this.onRightBorder.bind(this);
            this.onTopBorderHandler = this.onTopBorder.bind(this);
            this.onHorizontalBorderHandler = this.onHorizontalBorder.bind(this);
            this.onBottomBorderHandler = this.onBottomBorder.bind(this);
            this.onInsertRowAboveHandler = this.onInsertRowAbove.bind(this);
            this.onInsertRowBelowHandler = this.onInsertRowBelow.bind(this);
            this.onInsertColumnLeftHandler = this.onInsertColumnLeft.bind(this);
            this.onInsertColumnRightHandler = this.onInsertColumnRight.bind(this);
            this.onDeleteRowHandler = this.onDeleteRow.bind(this);
            this.onDeleteColumnHandler = this.onDeleteColumn.bind(this);
            this.onMergeCellHandler = this.onMergeCell.bind(this);
            this.applyAlignTopHandler = this.applyAlignTop.bind(this);
            this.applyAlignBottomHandler = this.applyAlignBottom.bind(this);
            this.applyAlignCenterHorizontalHandler = this.applyAlignCenterHorizontal.bind(this);
            this.onTopMarginHandler = this.onTopMargin.bind(this);
            this.onRightMarginHandler = this.onRightMargin.bind(this);
            this.onLeftMarginHandler = this.onLeftMargin.bind(this);
            this.onBottomMarginHandler = this.onBottomMargin.bind(this);
            this.onTopMarginClickHandler = this.onTopMarginClick.bind(this);
            this.onTopMarginBlurHandler = this.onTopMarginBlur.bind(this);
            this.onRightMarginClickHandler = this.onRightMarginClick.bind(this);
            this.onRightMarginBlurHandler = this.onRightMarginBlur.bind(this);
            this.onLeftMarginClickHandler = this.onLeftMarginClick.bind(this);
            this.onLeftMarginBlurHandler = this.onLeftMarginBlur.bind(this);
            this.onBottomMarginClickHandler = this.onBottomMarginClick.bind(this);
            this.onBottomMarginBlurHandler = this.onBottomMarginBlur.bind(this);
            this.container = container;
            this.isRtl = isRtl;
            if (this.isRtl) {
                this.groupButtonClass = 'e-rtl ' + this.groupButtonClass;
            }
            this.tableTextProperties = new text_properties_pane_1.TextProperties(container, 'textProperties', true, this.isRtl);
            this.imageProperty = imageProperty;
            this.elementId = this.documentEditor.element.id;
            this.initializeTablePropPane();
            this.prevContext = this.documentEditor.selectionModule.contextType;
        }
        Object.defineProperty(TableProperties.prototype, "documentEditor", {
            get: function () {
                return this.container.documentEditor;
            },
            enumerable: true,
            configurable: true
        });
        TableProperties.prototype.initializeTablePropPane = function () {
            this.localObj = new ej2_base_1.L10n('documenteditorcontainer', this.container.defaultLocale, this.container.locale);
            this.tableProperties = ej2_base_1.createElement('div', { className: 'e-de-scrollbar-hide', styles: 'overflow: auto' });
            this.initFillColorDiv();
            this.initBorderStylesDiv();
            this.initCellDiv();
            this.initInsertOrDelCell();
            this.initCellMargin();
            this.initAlignText();
            this.addTablePropertyTab();
            this.wireEvent();
        };
        TableProperties.prototype.enableDisableElements = function (enable) {
            Eif (enable) {
                ej2_base_1.classList(this.element, [], ['e-de-overlay']);
            }
            else {
                ej2_base_1.classList(this.element, ['e-de-overlay'], []);
            }
        };
        TableProperties.prototype.addTablePropertyTab = function () {
            var tableHeader = ej2_base_1.createElement('div', { innerHTML: this.localObj.getConstant('Table') });
            var textHeader = ej2_base_1.createElement('div', { innerHTML: this.localObj.getConstant('Text') });
            this.parentElement = ej2_base_1.createElement('div', { styles: 'height:100%;overflow:auto;display:none', className: 'e-de-prop-pane e-de-scrollbar-hide' });
            this.element = ej2_base_1.createElement('div', { id: this.elementId + '_propertyTabDiv', className: 'e-de-property-tab' });
            var items = [{ header: { text: textHeader }, content: this.tableTextProperties.element }, { header: { text: tableHeader }, content: this.tableProperties }];
            this.propertiesTab = new ej2_navigations_1.Tab({ items: items, animation: { previous: { effect: 'None' }, next: { effect: 'None' } }, selected: this.onTabSelection.bind(this) });
            this.propertiesTab.isStringTemplate = true;
            this.propertiesTab.appendTo(this.element);
            this.parentElement.appendChild(this.element);
            this.container.propertiesPaneContainer.appendChild(this.parentElement);
        };
        TableProperties.prototype.onTabSelection = function (args) {
            args.preventFocus = true;
            this.documentEditor.resize();
            Eif (this.documentEditor.enableAutoFocus) {
                this.documentEditor.focusIn();
            }
        };
        TableProperties.prototype.wireEvent = function () {
            var _this = this;
            this.shadingBtn.addEventListener('change', this.changeBackgroundColor.bind(this));
            this.borderBtn.addEventListener('change', function (args) {
                setTimeout(function () {
                    _this.borderColor = args.currentValue.hex;
                    _this.tableOutlineBorder.element.focus();
                }, 10);
            });
            this.tableOutlineBorder.element.addEventListener('click', this.onOutlineBorderClickHandler);
            this.tableAllBorder.element.addEventListener('click', this.onAllBorderHandler);
            this.tableCenterBorder.element.addEventListener('click', this.onInsideBorderHandler);
            this.tableLeftBorder.element.addEventListener('click', this.onLeftBorderHandler);
            this.tableCenterVerticalBorder.element.addEventListener('click', this.onVerticalBorderHandler);
            this.tableRightBorder.element.addEventListener('click', this.onRightBorderHandler);
            this.tableTopBorder.element.addEventListener('click', this.onTopBorderHandler);
            this.tableCenterHorizontalBorder.element.addEventListener('click', this.onHorizontalBorderHandler);
            this.tableBottomBorder.element.addEventListener('click', this.onBottomBorderHandler);
            this.insertRowAbove.element.addEventListener('click', this.onInsertRowAboveHandler);
            this.insertRowBelow.element.addEventListener('click', this.onInsertRowBelowHandler);
            this.insertColumnLeft.element.addEventListener('click', this.onInsertColumnLeftHandler);
            this.insertColumnRight.element.addEventListener('click', this.onInsertColumnRightHandler);
            this.deleteRow.element.addEventListener('click', this.onDeleteRowHandler);
            this.deleteColumn.element.addEventListener('click', this.onDeleteColumnHandler);
            this.horizontalMerge.element.addEventListener('click', this.onMergeCellHandler);
            this.alignTop.element.addEventListener('click', this.applyAlignTopHandler);
            this.alignBottom.element.addEventListener('click', this.applyAlignBottomHandler);
            this.alignCenterHorizontal.element.addEventListener('click', this.applyAlignCenterHorizontalHandler);
            this.topMargin.htmlAttributes = { 'aria-label': 'top-margin' };
            this.bottomMargin.htmlAttributes = { 'aria-label': 'bottom-margin' };
            this.leftMargin.htmlAttributes = { 'aria-label': 'left-margin' };
            this.rightMargin.htmlAttributes = { 'aria-label': 'right-Margin' };
            this.topMargin.element.addEventListener('click', this.onTopMarginClickHandler);
            this.rightMargin.element.addEventListener('click', this.onRightMarginClickHandler);
            this.leftMargin.element.addEventListener('click', this.onLeftMarginClickHandler);
            this.bottomMargin.element.addEventListener('click', this.onBottomMarginClickHandler);
            this.topMargin.element.addEventListener('keydown', this.onTopMarginHandler);
            this.rightMargin.element.addEventListener('keydown', this.onRightMarginHandler);
            this.leftMargin.element.addEventListener('keydown', this.onLeftMarginHandler);
            this.bottomMargin.element.addEventListener('keydown', this.onBottomMarginHandler);
            this.topMargin.element.addEventListener('blur', this.onTopMarginBlurHandler);
            this.rightMargin.element.addEventListener('blur', this.onRightMarginBlurHandler);
            this.leftMargin.element.addEventListener('blur', this.onLeftMarginBlurHandler);
            this.bottomMargin.element.addEventListener('blur', this.onBottomMarginBlurHandler);
        };
        TableProperties.prototype.unWireEvent = function () {
            this.shadingBtn.removeEventListener('change', this.changeBackgroundColor);
            this.tableOutlineBorder.element.removeEventListener('click', this.onOutlineBorderClickHandler);
            this.tableAllBorder.element.removeEventListener('click', this.onAllBorderHandler);
            this.tableCenterBorder.element.removeEventListener('click', this.onInsideBorderHandler);
            this.tableLeftBorder.element.removeEventListener('click', this.onLeftBorderHandler);
            this.tableCenterVerticalBorder.element.removeEventListener('click', this.onVerticalBorderHandler);
            this.tableRightBorder.element.removeEventListener('click', this.onRightBorderHandler);
            this.tableTopBorder.element.removeEventListener('click', this.onTopBorderHandler);
            this.tableCenterHorizontalBorder.element.removeEventListener('click', this.onHorizontalBorderHandler);
            this.tableBottomBorder.element.removeEventListener('click', this.onBottomBorderHandler);
            this.insertRowAbove.element.removeEventListener('click', this.onInsertRowAboveHandler);
            this.insertRowBelow.element.removeEventListener('click', this.onInsertRowBelowHandler);
            this.insertColumnLeft.element.removeEventListener('click', this.onInsertColumnLeftHandler);
            this.insertColumnRight.element.removeEventListener('click', this.onInsertColumnRightHandler);
            this.deleteRow.element.removeEventListener('click', this.onDeleteRowHandler);
            this.deleteColumn.element.removeEventListener('click', this.onDeleteColumnHandler);
            this.horizontalMerge.element.removeEventListener('click', this.onMergeCellHandler);
            this.alignTop.element.removeEventListener('click', this.applyAlignTopHandler);
            this.alignBottom.element.removeEventListener('click', this.applyAlignBottomHandler);
            this.alignCenterHorizontal.element.removeEventListener('click', this.applyAlignCenterHorizontalHandler);
            this.topMargin.element.removeEventListener('click', this.onTopMarginClickHandler);
            this.rightMargin.element.removeEventListener('click', this.onRightMarginClickHandler);
            this.leftMargin.element.removeEventListener('click', this.onLeftMarginClickHandler);
            this.bottomMargin.element.removeEventListener('click', this.onBottomMarginClickHandler);
            this.topMargin.element.removeEventListener('keydown', this.onTopMarginHandler);
            this.rightMargin.element.removeEventListener('keydown', this.onRightMarginHandler);
            this.leftMargin.element.removeEventListener('keydown', this.onLeftMarginHandler);
            this.bottomMargin.element.removeEventListener('keydown', this.onBottomMarginHandler);
            this.topMargin.element.removeEventListener('blur', this.onTopMarginBlurHandler);
            this.rightMargin.element.removeEventListener('blur', this.onRightMarginBlurHandler);
            this.leftMargin.element.removeEventListener('blur', this.onLeftMarginBlurHandler);
            this.bottomMargin.element.removeEventListener('blur', this.onBottomMarginBlurHandler);
        };
        TableProperties.prototype.onTopMarginClick = function () {
            this.isTopMarginApply = true;
        };
        TableProperties.prototype.onTopMarginBlur = function () {
            this.applyTopMargin();
            this.isTopMarginApply = false;
        };
        TableProperties.prototype.onRightMarginClick = function () {
            this.isRightMarginApply = true;
        };
        TableProperties.prototype.onRightMarginBlur = function () {
            this.applyRightMargin();
            this.isRightMarginApply = false;
        };
        TableProperties.prototype.onLeftMarginClick = function () {
            this.isLeftMarginApply = true;
        };
        TableProperties.prototype.onLeftMarginBlur = function () {
            this.applyLeftMargin();
            this.isLeftMarginApply = false;
        };
        TableProperties.prototype.onBottomMarginClick = function () {
            this.isBottomMarginApply = true;
        };
        TableProperties.prototype.onBottomMarginBlur = function () {
            this.applyBottomMargin();
            this.isBottomMarginApply = false;
        };
        TableProperties.prototype.getBorder = function (border) {
            var lineWidth = (this.borderSize.content.indexOf('No Border') >= 0) ? 0 : parseFloat(this.borderSize.content);
            var linestyle = (lineWidth === 0) ? 'Cleared' : 'Single';
            var borderSettings = {
                type: border,
                borderColor: this.borderColor,
                lineWidth: lineWidth,
                borderStyle: linestyle
            };
            return borderSettings;
        };
        TableProperties.prototype.onOutlineBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('OutsideBorders'));
        };
        TableProperties.prototype.onAllBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('AllBorders'));
        };
        TableProperties.prototype.onInsideBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('InsideBorders'));
        };
        TableProperties.prototype.onLeftBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('LeftBorder'));
        };
        TableProperties.prototype.onVerticalBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('InsideVerticalBorder'));
        };
        TableProperties.prototype.onRightBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('RightBorder'));
        };
        TableProperties.prototype.onTopBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('TopBorder'));
        };
        TableProperties.prototype.onHorizontalBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('InsideHorizontalBorder'));
        };
        TableProperties.prototype.onBottomBorder = function () {
            this.documentEditor.editorModule.applyBorders(this.getBorder('BottomBorder'));
        };
        TableProperties.prototype.onTopMargin = function (e) {
            var _this = this;
            if (e.keyCode === 13) {
                setTimeout(function () {
                    _this.applyTopMargin();
                    _this.isTopMarginApply = false;
                }, 30);
            }
        };
        TableProperties.prototype.onBottomMargin = function (e) {
            var _this = this;
            if (e.keyCode === 13) {
                setTimeout(function () {
                    _this.applyBottomMargin();
                    _this.isBottomMarginApply = false;
                }, 30);
            }
        };
        TableProperties.prototype.onLeftMargin = function (e) {
            var _this = this;
            if (e.keyCode === 13) {
                setTimeout(function () {
                    _this.applyLeftMargin();
                    _this.isLeftMarginApply = false;
                }, 30);
            }
        };
        TableProperties.prototype.onRightMargin = function (e) {
            var _this = this;
            if (e.keyCode === 13) {
                setTimeout(function () {
                    _this.applyRightMargin();
                    _this.isRightMarginApply = false;
                }, 30);
            }
        };
        TableProperties.prototype.applyTopMargin = function () {
            if (!this.isTopMarginApply) {
                return;
            }
            this.documentEditor.selectionModule.cellFormat.topMargin = (this.topMargin.value > this.topMargin.max)
                ? this.topMargin.max : this.topMargin.value;
        };
        TableProperties.prototype.applyBottomMargin = function () {
            if (!this.isBottomMarginApply) {
                return;
            }
            this.documentEditor.selectionModule.cellFormat.bottomMargin = (this.bottomMargin.value > this.bottomMargin.max)
                ? this.bottomMargin.max : this.bottomMargin.value;
        };
        TableProperties.prototype.applyLeftMargin = function () {
            if (!this.isLeftMarginApply) {
                return;
            }
            this.documentEditor.selectionModule.cellFormat.leftMargin = (this.leftMargin.value > this.leftMargin.max)
                ? this.leftMargin.max : this.leftMargin.value;
        };
        TableProperties.prototype.applyRightMargin = function () {
            if (!this.isRightMarginApply) {
                return;
            }
            this.documentEditor.selectionModule.cellFormat.rightMargin = (this.rightMargin.value > this.rightMargin.max)
                ? this.rightMargin.max : this.rightMargin.value;
        };
        TableProperties.prototype.applyAlignTop = function () {
            this.documentEditor.selectionModule.cellFormat.verticalAlignment = 'Top';
        };
        TableProperties.prototype.applyAlignBottom = function () {
            this.documentEditor.selectionModule.cellFormat.verticalAlignment = 'Bottom';
        };
        TableProperties.prototype.applyAlignCenterHorizontal = function () {
            this.documentEditor.selectionModule.cellFormat.verticalAlignment = 'Center';
        };
        TableProperties.prototype.onMergeCell = function () {
            this.documentEditor.editorModule.mergeCells();
        };
        TableProperties.prototype.onInsertRowAbove = function () {
            this.documentEditor.editorModule.insertRow(true);
        };
        TableProperties.prototype.onInsertRowBelow = function () {
            this.documentEditor.editorModule.insertRow(false);
        };
        TableProperties.prototype.onInsertColumnLeft = function () {
            this.documentEditor.editorModule.insertColumn(true);
        };
        TableProperties.prototype.onInsertColumnRight = function () {
            this.documentEditor.editorModule.insertColumn(false);
        };
        TableProperties.prototype.onDeleteRow = function () {
            this.documentEditor.editorModule.deleteRow();
            this.documentEditor.focusIn();
        };
        TableProperties.prototype.onDeleteColumn = function () {
            this.documentEditor.editorModule.deleteColumn();
            this.documentEditor.focusIn();
        };
        TableProperties.prototype.onSelectionChange = function () {
            Eif (this.documentEditor.selectionModule) {
                Iif (this.documentEditor.editorModule && this.documentEditor.editorModule.canMergeCells()) {
                    this.horizontalMerge.disabled = false;
                }
                else {
                    this.horizontalMerge.disabled = true;
                }
                if (this.documentEditor.selectionModule.contextType === 'TableText' || this.documentEditor.selectionModule.contextType === 'TableImage') {
                    this.shadingBtn.value = this.documentEditor.selectionModule.cellFormat.background ? this.documentEditor.selectionModule.cellFormat.background : '';
                }
                this.topMargin.value = this.documentEditor.selectionModule.cellFormat.topMargin ? this.documentEditor.selectionModule.cellFormat.topMargin : 0;
                this.bottomMargin.value = this.documentEditor.selectionModule.cellFormat.bottomMargin ? this.documentEditor.selectionModule.cellFormat.bottomMargin : 0;
                this.rightMargin.value = this.documentEditor.selectionModule.cellFormat.rightMargin ? this.documentEditor.selectionModule.cellFormat.rightMargin : 0;
                this.leftMargin.value = this.documentEditor.selectionModule.cellFormat.leftMargin ? this.documentEditor.selectionModule.cellFormat.leftMargin : 0;
            }
        };
        TableProperties.prototype.changeBackgroundColor = function (args) {
            var _this = this;
            if (!this.documentEditor.isReadOnly) {
                this.documentEditor.selectionModule.cellFormat.background = args.currentValue.hex;
                setTimeout(function () {
                    _this.documentEditor.focusIn();
                }, 10);
            }
        };
        TableProperties.prototype.initFillColorDiv = function () {
            var fillDiv = ej2_base_1.createElement('div', { id: this.elementId + '_fillColorDiv', className: 'e-de-property-div-padding de-tbl-fill-clr' });
            this.tableProperties.appendChild(fillDiv);
            var label = ej2_base_1.createElement('label', { className: 'e-de-prop-sub-label' });
            label.classList.add('e-de-prop-fill-label');
            if (this.isRtl) {
                label.classList.add('e-de-rtl');
            }
            label.textContent = this.localObj.getConstant('Fill');
            fillDiv.appendChild(label);
            this.shadingBtn = this.createColorPickerTemplate(this.elementId + '_tableShading', fillDiv, this.localObj.getConstant('Fill color'), false);
            ej2_base_1.classList(fillDiv.lastElementChild.lastElementChild.lastElementChild.firstChild, ['e-de-ctnr-cellbg-clr-picker'], ['e-caret']);
            this.documentEditor.documentHelper.shadingBtn = this.shadingBtn;
        };
        TableProperties.prototype.initBorderStylesDiv = function () {
            this.borderStyleDiv = ej2_base_1.createElement('div', { className: 'e-de-property-div-padding' });
            this.tableProperties.appendChild(this.borderStyleDiv);
            var label = ej2_base_1.createElement('label', { className: 'e-de-ctnr-prop-label' });
            label.textContent = this.localObj.getConstant('Border Style');
            this.borderStyleDiv.appendChild(label);
            var parentDiv = ej2_base_1.createElement('div', { styles: 'display:inline-flex;' });
            var styleDiv = ej2_base_1.createElement('div', { styles: 'width:min-content;height:126px', className: 'e-de-grp-btn-ctnr' });
            var div1 = ej2_base_1.createElement('div', { className: this.groupButtonClass + ' e-de-ctnr-group-btn-top' });
            styleDiv.appendChild(div1);
            var div2 = ej2_base_1.createElement('div', { className: this.groupButtonClass + ' e-de-ctnr-group-btn-middle' });
            styleDiv.appendChild(div2);
            var div3 = ej2_base_1.createElement('div', { className: this.groupButtonClass + ' e-de-ctnr-group-btn-bottom' });
            styleDiv.appendChild(div3);
            if (this.isRtl) {
                div1.classList.add('e-de-rtl');
                div3.classList.add('e-de-rtl');
                parentDiv.classList.add('e-de-rtl');
                label.classList.add('e-de-rtl');
            }
            var btnStyle = '';
            this.tableOutlineBorder = this.createButtonTemplate(this.elementId + '_tableOutlineBorder', 'e-de-ctnr-outsideborder e-icons', div1, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Outside borders'));
            this.tableAllBorder = this.createButtonTemplate(this.elementId + '_tableAllBorder', 'e-de-ctnr-allborders e-icons', div1, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('All borders'));
            this.tableCenterBorder = this.createButtonTemplate(this.elementId + '_tableCenterBorder', 'e-de-ctnr-insideborders e-icons', div1, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Inside borders'));
            this.tableLeftBorder = this.createButtonTemplate(this.elementId + '_tableLeftBorder', 'e-de-ctnr-leftborders e-icons', div2, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Left border'));
            this.tableCenterVerticalBorder = this.createButtonTemplate(this.elementId + '_tableCenterVBorder', 'e-de-ctnr-insideverticalborder e-icons', div2, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Inside vertical border'));
            this.tableRightBorder = this.createButtonTemplate(this.elementId + '_tableRightBorder', 'e-de-ctnr-rightborder e-icons', div2, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Right border'));
            this.tableTopBorder = this.createButtonTemplate(this.elementId + '_tableTopBorder', 'e-de-ctnr-topborder e-icons', div3, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Top border'));
            this.tableCenterHorizontalBorder = this.createButtonTemplate(this.elementId + '_tableCenterHBorder', 'e-de-ctnr-insidehorizondalborder e-icons', div3, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Inside horizontal border'));
            this.tableBottomBorder = this.createButtonTemplate(this.elementId + '_tableBottomBorder', 'e-de-ctnr-bottomborder e-icons', div3, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Bottom border'));
            parentDiv.appendChild(styleDiv);
            var styleTypeDiv = ej2_base_1.createElement('div', { className: 'de-tbl-fill-clr' });
            if (!this.isRtl) {
                styleTypeDiv.classList.add('e-de-stylediv');
            }
            else {
                styleTypeDiv.classList.add('e-de-stylediv-rtl');
            }
            this.borderBtn = this.createColorPickerTemplate(this.elementId + '_tableBorderColor', styleTypeDiv, this.localObj.getConstant('Border color'), true);
            this.documentEditor.documentHelper.borderBtn = this.borderBtn;
            this.borderBtn.value = '#000000';
            styleTypeDiv.firstElementChild.lastElementChild.lastElementChild.style.width = '30px';
            styleTypeDiv.firstElementChild.lastElementChild.firstElementChild.firstElementChild.style.width = '100%';
            ej2_base_1.classList(styleTypeDiv.lastElementChild.lastElementChild.lastElementChild.firstChild, ['e-de-ctnr-highlightcolor'], ['e-caret']);
            this.borderSizeButton = ej2_base_1.createElement('button', { id: this.elementId + '_tableBorderSize', className: 'e-de-border-size-button', styles: 'font-size:10px;padding:0px;', attrs: { type: 'button' } });
            styleTypeDiv.appendChild(this.borderSizeButton);
            this.borderSize = this.createBorderSizeDropDown('e-de-ctnr-strokesize e-icons', this.borderSizeButton);
            parentDiv.appendChild(styleTypeDiv);
            this.borderSizeColorElement = document.getElementsByClassName('e-de-border-width');
            this.borderStyleDiv.appendChild(parentDiv);
        };
        TableProperties.prototype.initCellDiv = function () {
            var cellDiv = ej2_base_1.createElement('div', { className: 'e-de-property-div-padding' });
            this.tableProperties.appendChild(cellDiv);
            var label = ej2_base_1.createElement('label', { className: 'e-de-ctnr-prop-label' });
            label.textContent = this.localObj.getConstant('Cell');
            cellDiv.appendChild(label);
            var parentDiv = ej2_base_1.createElement('div', { className: 'e-de-ctnr-group-btn' });
            parentDiv.classList.add('e-de-cell-div');
            if (this.isRtl) {
                parentDiv.classList.add('e-de-rtl');
                label.classList.add('e-de-rtl');
            }
            var btnStyle = '';
            this.horizontalMerge = this.createButtonTemplate(this.elementId + '_tableOutlineBorder', 'e-de-ctnr-mergecell e-icons', parentDiv, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Merge cells'));
            cellDiv.appendChild(parentDiv);
        };
        TableProperties.prototype.initInsertOrDelCell = function () {
            var tableOperationDiv = ej2_base_1.createElement('div', { className: 'e-de-property-div-padding' });
            this.tableProperties.appendChild(tableOperationDiv);
            var label = ej2_base_1.createElement('label', { className: 'e-de-ctnr-prop-label' });
            label.textContent = this.localObj.getConstant('Insert Or Delete');
            tableOperationDiv.appendChild(label);
            var parentDiv = ej2_base_1.createElement('div', { className: 'e-de-insert-del-cell', styles: 'display:inline-flex' });
            var div1 = ej2_base_1.createElement('div', { className: this.groupButtonClass });
            parentDiv.appendChild(div1);
            var div2 = ej2_base_1.createElement('div', { className: this.groupButtonClass });
            if (!this.isRtl) {
                div2.style.marginLeft = '12px';
            }
            else {
                div2.style.marginRight = '12px';
                parentDiv.classList.add('e-de-rtl');
                label.classList.add('e-de-rtl');
            }
            parentDiv.appendChild(div2);
            var btnStyle = '';
            this.insertColumnLeft = this.createButtonTemplate(this.elementId + '_insertColumnLeft', 'e-de-ctnr-insertleft e-icons', div1, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Insert columns to the left'));
            this.insertColumnRight = this.createButtonTemplate(this.elementId + '_insertColumnRight', 'e-de-ctnr-insertright e-icons', div1, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Insert columns to the right'));
            this.insertRowAbove = this.createButtonTemplate(this.elementId + '_insertRowAbove', 'e-de-ctnr-insertabove e-icons', div1, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Insert rows above'));
            this.insertRowBelow = this.createButtonTemplate(this.elementId + '_insertRowBelow', 'e-de-ctnr-insertbelow e-icons', div1, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Insert rows below'));
            this.deleteRow = this.createButtonTemplate(this.elementId + '_deleteRow', 'e-de-ctnr-deleterows e-icons', div2, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Delete rows'));
            this.deleteColumn = this.createButtonTemplate(this.elementId + '_deleteColumn', 'e-de-ctnr-deletecolumns e-icons', div2, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Delete columns'));
            tableOperationDiv.appendChild(parentDiv);
        };
        TableProperties.prototype.initCellMargin = function () {
            var cellMarginDiv = ej2_base_1.createElement('div', { className: 'e-de-property-div-padding e-de-cellmargin-text' });
            this.tableProperties.appendChild(cellMarginDiv);
            var label = ej2_base_1.createElement('label', { className: 'e-de-ctnr-prop-label' });
            label.textContent = this.localObj.getConstant('Cell Margin');
            cellMarginDiv.appendChild(label);
            var parentDiv = ej2_base_1.createElement('div', { styles: 'display:inline-flex' });
            if (this.isRtl) {
                label.classList.add('e-de-rtl');
            }
            var textboxDivStyle = 'width:' + 48 + 'px';
            var textboxParentDivStyle = 'width:' + 50 + 'px;float:left;';
            this.topMargin = this.createCellMarginTextBox(this.localObj.getConstant('Top'), this.elementId + '_topMargin', parentDiv, textboxDivStyle, textboxParentDivStyle, 500, this.localObj.getConstant('Top margin'));
            this.bottomMargin = this.createCellMarginTextBox(this.localObj.getConstant('Bottom'), this.elementId + '_bottomMargin', parentDiv, textboxDivStyle, textboxParentDivStyle, 500, this.localObj.getConstant('Bottom margin'));
            this.leftMargin = this.createCellMarginTextBox(this.localObj.getConstant('Left'), this.elementId + '_leftMargin', parentDiv, textboxDivStyle, textboxParentDivStyle, 500, this.localObj.getConstant('Left margin'));
            this.rightMargin = this.createCellMarginTextBox(this.localObj.getConstant('Right'), this.elementId + '_rightMargin', parentDiv, textboxDivStyle, textboxParentDivStyle, 500, this.localObj.getConstant('Right margin'), true);
            cellMarginDiv.appendChild(parentDiv);
        };
        TableProperties.prototype.initAlignText = function () {
            var alignmentDiv = ej2_base_1.createElement('div', { className: 'e-de-property-div-padding', styles: 'border-bottom-width:0px' });
            this.tableProperties.appendChild(alignmentDiv);
            var label = ej2_base_1.createElement('label', { className: 'e-de-ctnr-prop-label' });
            label.textContent = this.localObj.getConstant('Align Text');
            alignmentDiv.appendChild(label);
            var parentDiv = ej2_base_1.createElement('div');
            if (this.isRtl) {
                parentDiv.classList.add('e-de-rtl');
                label.classList.add('e-de-rtl');
            }
            var div = ej2_base_1.createElement('div', { className: this.groupButtonClass });
            parentDiv.appendChild(div);
            var btnStyle = '';
            this.alignTop = this.createButtonTemplate(this.elementId + '_alignTop', 'e-de-ctnr-aligntop e-icons', div, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Align top'));
            this.alignBottom = this.createButtonTemplate(this.elementId + '_alignBottom', 'e-de-ctnr-alignbottom e-icons', div, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Align bottom'));
            this.alignCenterHorizontal = this.createButtonTemplate(this.elementId + '_alignCenterHorizontal', 'e-de-ctnr-aligncenter-table e-icons', div, 'e-de-prop-font-button', btnStyle, this.localObj.getConstant('Align center'));
            this.alignCenterHorizontal.addEventListener('click', this.applyAlignCenterHorizontal.bind(this));
            alignmentDiv.appendChild(parentDiv);
        };
        TableProperties.prototype.createCellMarginTextBox = function (textboxLabel, textboxId, parentDiv, styles, parentStyle, maxValue, toolTipText, isRight) {
            var cellMarginParentDiv = ej2_base_1.createElement('div', { styles: parentStyle });
            if (!isRight) {
                cellMarginParentDiv.classList.add('e-de-cell-text-box');
            }
            var cellMarginLabel = ej2_base_1.createElement('label', { className: 'e-de-prop-sub-label' });
            cellMarginLabel.textContent = textboxLabel;
            cellMarginParentDiv.appendChild(cellMarginLabel);
            var cellMarginTextbox = ej2_base_1.createElement('input', { className: 'e-textbox', id: textboxId, styles: styles });
            cellMarginParentDiv.appendChild(cellMarginTextbox);
            var cellMarginNumericText = new ej2_inputs_1.NumericTextBox({ showSpinButton: false, min: 0, format: 'n0', max: maxValue, enableRtl: this.isRtl }, cellMarginTextbox);
            parentDiv.appendChild(cellMarginParentDiv);
            cellMarginTextbox.setAttribute('title', toolTipText);
            return cellMarginNumericText;
        };
        TableProperties.prototype.createBorderSizeDropDown = function (iconcss, button) {
            var _this = this;
            var div = ej2_base_1.createElement('div', { id: 'borderSizeTarget', styles: 'display:none' });
            var ulTag = ej2_base_1.createElement('ul', {
                styles: 'display: block; outline: 0px; width: 126px; height: auto;',
                id: 'borderSizeListMenu'
            });
            div.appendChild(ulTag);
            var noneOption = this.createDropdownOption(ulTag, this.localObj.getConstant('No Border'));
            noneOption.addEventListener('click', function () {
                _this.onBorderSizeChange('No Border');
            });
            var pixel = this.localObj.getConstant('px');
            var quaterOption = this.createDropdownOption(ulTag, '.25' + pixel);
            quaterOption.addEventListener('click', function () {
                _this.onBorderSizeChange('.25px');
            });
            var halfOption = this.createDropdownOption(ulTag, '.5' + pixel);
            halfOption.addEventListener('click', function () {
                _this.onBorderSizeChange('.5px');
            });
            var threeQuatersOption = this.createDropdownOption(ulTag, '.75' + pixel);
            threeQuatersOption.addEventListener('click', function () {
                _this.onBorderSizeChange('.75px');
            });
            var oneOption = this.createDropdownOption(ulTag, '1' + pixel);
            oneOption.addEventListener('click', function () {
                _this.onBorderSizeChange('1px');
            });
            var oneHalfOption = this.createDropdownOption(ulTag, '1.5' + pixel);
            oneHalfOption.addEventListener('click', function () {
                _this.onBorderSizeChange('1.5px');
            });
            var twoOption = this.createDropdownOption(ulTag, '2' + pixel);
            twoOption.addEventListener('click', function () {
                _this.onBorderSizeChange('2px');
            });
            var threeOption = this.createDropdownOption(ulTag, '3' + pixel);
            threeOption.addEventListener('click', function () {
                _this.onBorderSizeChange('3px');
            });
            var fourOption = this.createDropdownOption(ulTag, '4' + pixel);
            fourOption.addEventListener('click', function () {
                _this.onBorderSizeChange('4px');
            });
            var fiveOption = this.createDropdownOption(ulTag, '5' + pixel);
            fiveOption.addEventListener('click', function () {
                _this.onBorderSizeChange('5px');
            });
            var sixOption = this.createDropdownOption(ulTag, '6' + pixel);
            sixOption.addEventListener('click', function () {
                _this.onBorderSizeChange('6px');
            });
            var menuOptions = {
                target: div,
                iconCss: iconcss,
                cssClass: 'e-de-prop-bordersize',
                enableRtl: this.isRtl,
                content: '1.5px'
            };
            var dropdown = new ej2_splitbuttons_1.DropDownButton(menuOptions);
            dropdown.beforeOpen = function () {
                div.style.display = 'block';
                for (var i = 0; i < _this.borderSizeColorElement.length; i++) {
                    _this.borderSizeColorElement[parseInt(i.toString(), 10)].style.borderBottomColor = _this.borderColor;
                }
            };
            dropdown.beforeClose = function () {
                div.style.display = 'none';
            };
            dropdown.appendTo(button);
            dropdown.element.setAttribute('title', this.localObj.getConstant('Border width'));
            return dropdown;
        };
        TableProperties.prototype.onBorderSizeChange = function (value) {
            var _this = this;
            this.borderSize.content = value;
            setTimeout(function () {
                _this.tableOutlineBorder.element.focus();
            }, 10);
        };
        TableProperties.prototype.createDropdownOption = function (ulTag, text) {
            var liTag = ej2_base_1.createElement('li', {
                styles: 'display:block',
                className: 'e-de-floating-menuitem e-de-floating-menuitem-md e-de-list-items  e-de-list-item-size'
            });
            ulTag.appendChild(liTag);
            var innerHTML;
            if (text === 'No Border') {
                innerHTML = '<div>' + text + '</div>';
            }
            else Iif (text === '1.5px') {
                innerHTML = '<div>' + text + '<span class="e-de-list-line e-de-border-width"  style="margin-left:10px;border-bottom-width:' + text + ';' + '"' + '></span></div>';
            }
            else {
                innerHTML = '<div>' + text + '<span class="e-de-list-line e-de-border-width" style="margin-left:20px;border-bottom-width:' + text + ';' + '"' + '></span></div>';
            }
            var liInnerDiv = ej2_base_1.createElement('div', {
                className: 'e-de-list-header-presetmenu',
                innerHTML: innerHTML
            });
            liTag.appendChild(liInnerDiv);
            return liTag;
        };
        TableProperties.prototype.createDropDownButton = function (id, styles, parentDiv, iconCss, content, items, target) {
            var buttonElement = ej2_base_1.createElement('button', { id: id, styles: styles, attrs: { type: 'button' } });
            parentDiv.appendChild(buttonElement);
            var splitButtonClass = 'e-de-prop-splitbutton';
            if (this.isRtl) {
                splitButtonClass = 'e-rtl ' + splitButtonClass;
            }
            var dropDownBtn = new ej2_splitbuttons_1.DropDownButton({ iconCss: iconCss, content: content, enableRtl: this.isRtl, cssClass: splitButtonClass }, buttonElement);
            if (items) {
                dropDownBtn.items = items;
            }
            if (target) {
                dropDownBtn.target = target;
            }
            return dropDownBtn;
        };
        TableProperties.prototype.createButtonTemplate = function (id, iconcss, div, buttonClass, styles, toolTipText, content, iconPos) {
            var buttonElement = ej2_base_1.createElement('Button', { id: id, styles: styles, attrs: { type: 'button' } });
            div.appendChild(buttonElement);
            var btn = new ej2_buttons_1.Button({
                cssClass: buttonClass, iconCss: iconcss, enableRtl: this.isRtl, iconPosition: (iconPos ? iconPos : 'Left'),
                content: content ? content : ''
            });
            btn.appendTo(buttonElement);
            buttonElement.setAttribute('title', toolTipText);
            buttonElement.setAttribute('aria-label', toolTipText);
            return btn;
        };
        TableProperties.prototype.createColorPickerTemplate = function (id, divElement, toolTipText, isBorderWidth) {
            var _a = this.documentEditor.documentEditorSettings.colorPickerSettings, columns = _a.columns, createPopupOnClick = _a.createPopupOnClick, disabled = _a.disabled, enablePersistence = _a.enablePersistence, inline = _a.inline, mode = _a.mode, modeSwitcher = _a.modeSwitcher, noColor = _a.noColor, presetColors = _a.presetColors, showButtons = _a.showButtons;
            var inputElement = ej2_base_1.createElement('input', { id: id });
            divElement.appendChild(inputElement);
            var cssClass = 'e-de-prop-font-button e-de-prop-font-colorpicker';
            if (isBorderWidth) {
                cssClass = cssClass + ' e-de-border-clr-picker';
            }
            var colorPicker = new ej2_inputs_1.ColorPicker({ cssClass: cssClass, enableRtl: this.isRtl, locale: this.container.locale, enableOpacity: false,
                mode: mode, modeSwitcher: modeSwitcher, showButtons: showButtons, columns: columns,
                createPopupOnClick: createPopupOnClick, disabled: disabled, enablePersistence: enablePersistence, inline: inline,
                noColor: noColor, presetColors: presetColors }, inputElement);
            inputElement.parentElement.setAttribute('title', toolTipText);
            inputElement.parentElement.setAttribute('aria-label', toolTipText);
            return colorPicker;
        };
        TableProperties.prototype.showTableProperties = function (isShow, propertyType) {
            if (isShow) {
                if (propertyType === 'text') {
                    this.propertiesTab.hideTab(1, true);
                }
                else {
                    this.propertiesTab.hideTab(1, false);
                    if (this.prevContext !== this.documentEditor.selectionModule.contextType) {
                        this.propertiesTab.selectedItem = 1;
                    }
                }
                this.prevContext = this.documentEditor.selectionModule.contextType;
                this.onSelectionChange();
                this.tableTextProperties.onSelectionChange();
            }
            if (!isShow && this.parentElement.style.display === 'none' || (isShow && this.parentElement.style.display === 'block')) {
                return;
            }
            this.parentElement.style.display = isShow ? 'block' : 'none';
            Eif (isShow) {
                this.updateTabContainerHeight();
            }
            this.documentEditor.resize();
            this.prevContext = this.documentEditor.selectionModule.contextType;
        };
        TableProperties.prototype.updateTabContainerHeight = function () {
            if (this.parentElement && this.parentElement.style.display === 'block') {
                var tabHeaderHeight = this.parentElement.getElementsByClassName('e-tab-header')[0];
                Eif (tabHeaderHeight) {
                    var paneHeight = this.parentElement.offsetHeight - tabHeaderHeight.offsetHeight;
                    this.tableProperties.style.height = paneHeight + 'px';
                    this.tableTextProperties.element.style.height = paneHeight + 'px';
                }
            }
        };
        TableProperties.prototype.removeHTMLDomElement = function () {
            var _this = this;
            Eif (this.borderSizeButton) {
                this.borderSizeButton.remove();
                this.borderSizeButton = null;
            }
            Eif (this.borderStyleDiv) {
                this.borderStyleDiv.childNodes.forEach(function (element) {
                    _this.borderStyleDiv.removeChild(element);
                    element = null;
                });
                this.borderStyleDiv.innerHTML = '';
                this.borderStyleDiv.remove();
                this.borderStyleDiv = null;
            }
            Eif (this.tableProperties) {
                this.tableProperties.childNodes.forEach(function (element) {
                    _this.tableProperties.removeChild(element);
                    element = null;
                });
                this.tableProperties.innerHTML = '';
                this.tableProperties.remove();
                this.tableProperties = null;
            }
        };
        TableProperties.prototype.destroy = function () {
            this.unWireEvent();
            this.container = undefined;
            Eif (this.shadingBtn) {
                this.shadingBtn.destroy();
                this.shadingBtn.element.remove();
                this.shadingBtn.element = null;
                this.shadingBtn = undefined;
            }
            Eif (this.borderBtn) {
                this.borderBtn.destroy();
                this.borderBtn.element.remove();
                this.borderBtn.element = null;
                this.borderBtn = undefined;
            }
            Eif (this.borderSize) {
                this.borderSize.destroy();
                this.borderSize = undefined;
            }
            Eif (this.topMargin) {
                this.topMargin.destroy();
                this.topMargin = undefined;
            }
            Eif (this.bottomMargin) {
                this.bottomMargin.destroy();
                this.bottomMargin = undefined;
            }
            Eif (this.leftMargin) {
                this.leftMargin.destroy();
                this.leftMargin = undefined;
            }
            Eif (this.rightMargin) {
                ej2_base_1.remove(this.rightMargin.element);
                this.rightMargin.destroy();
                this.rightMargin = undefined;
            }
            Eif (this.tableTextProperties) {
                this.tableTextProperties.destroy();
                this.tableTextProperties = undefined;
            }
            Eif (this.propertiesTab) {
                this.propertiesTab.destroy();
                this.propertiesTab = undefined;
            }
            Eif (this.imageProperty) {
                this.imageProperty = null;
            }
            Eif (this.tableOutlineBorder) {
                this.tableOutlineBorder.destroy();
            }
            this.tableOutlineBorder = undefined;
            Eif (this.tableAllBorder) {
                this.tableAllBorder.destroy();
            }
            this.tableAllBorder = undefined;
            Eif (this.tableCenterBorder) {
                this.tableCenterBorder.destroy();
            }
            this.tableCenterBorder = undefined;
            Eif (this.tableLeftBorder) {
                this.tableLeftBorder.destroy();
            }
            this.tableLeftBorder = undefined;
            Eif (this.tableCenterVerticalBorder) {
                this.tableCenterVerticalBorder.destroy();
            }
            this.tableCenterVerticalBorder = undefined;
            Eif (this.tableRightBorder) {
                this.tableRightBorder.destroy();
            }
            this.tableRightBorder = undefined;
            Eif (this.tableTopBorder) {
                this.tableTopBorder.destroy();
            }
            ej2_base_1.remove(this.tableTopBorder.element);
            this.tableTopBorder = undefined;
            Eif (this.tableCenterHorizontalBorder) {
                this.tableCenterHorizontalBorder.destroy();
            }
            ej2_base_1.remove(this.tableCenterHorizontalBorder.element);
            this.tableCenterHorizontalBorder = undefined;
            Eif (this.tableBottomBorder) {
                this.tableBottomBorder.destroy();
            }
            ej2_base_1.remove(this.tableBottomBorder.element);
            this.tableBottomBorder = undefined;
            Eif (this.horizontalMerge) {
                this.horizontalMerge.destroy();
            }
            ej2_base_1.remove(this.horizontalMerge.element);
            this.horizontalMerge = undefined;
            Eif (this.insertRowAbove) {
                this.insertRowAbove.destroy();
            }
            ej2_base_1.remove(this.insertRowAbove.element);
            this.insertRowAbove = undefined;
            Eif (this.insertRowBelow) {
                this.insertRowBelow.destroy();
            }
            ej2_base_1.remove(this.insertRowBelow.element);
            this.insertRowBelow = undefined;
            Eif (this.insertColumnLeft) {
                this.insertColumnLeft.destroy();
            }
            ej2_base_1.remove(this.insertColumnLeft.element);
            this.insertColumnLeft = undefined;
            Eif (this.insertColumnRight) {
                this.insertColumnRight.destroy();
            }
            ej2_base_1.remove(this.insertColumnRight.element);
            this.insertColumnRight = undefined;
            Eif (this.deleteRow) {
                this.deleteRow.destroy();
            }
            ej2_base_1.remove(this.deleteRow.element);
            this.deleteRow = undefined;
            Eif (this.deleteColumn) {
                this.deleteColumn.destroy();
            }
            ej2_base_1.remove(this.deleteColumn.element);
            this.deleteColumn = undefined;
            Eif (this.alignBottom) {
                this.alignBottom.destroy();
            }
            this.alignBottom = undefined;
            Eif (this.alignCenterHorizontal) {
                this.alignCenterHorizontal.destroy();
            }
            this.alignCenterHorizontal = undefined;
            Eif (this.alignTop) {
                this.alignTop.destroy();
            }
            this.removeHTMLDomElement();
            this.alignTop = undefined;
            this.groupButtonClass = undefined;
            this.borderColor = undefined;
            this.elementId = undefined;
        };
        return TableProperties;
    }());
    exports.TableProperties = TableProperties;
});