all files / document-editor/implementation/dialogs/ columns-dialog.js

69.6% Statements 490/704
43.59% Branches 136/312
89.29% Functions 25/28
69.6% Lines 490/704
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 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087       150× 150× 150× 150× 150×                             150×                                         150× 11×           150×           150×                                                                                                                                                                                                                                                               150×                                                                                                                                                                 150×                                                                                       150×   150×   150×       150×                                               150×                     150×                         12× 12× 12× 12×       150×   14461×                                                                                                                                                                                                                                                                                                                                                                                           205× 205× 205× 205× 205× 205× 205× 205× 205×   205×     205×     205×     205×     205×       205×   205×   205×   205×   205×   205×   205×   205×       205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×   205×          
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-buttons", "@syncfusion/ej2-inputs", "../index", "../../base/types"], function (require, exports, ej2_base_1, ej2_buttons_1, ej2_inputs_1, index_1, types_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Column = (function () {
        function Column() {
        }
        return Column;
    }());
    var ColumnsDialog = (function () {
        function ColumnsDialog(documentHelper) {
            var _this = this;
            this.lineCheckbox = undefined;
            this.equalCheckbox = undefined;
            this.handleSettingCheckBoxActionHandler = this.onhandleSettingCheckBoxActionClicked.bind(this);
            this.checkBox = function (args) {
                for (var i = 0; i < _this.columns.length; i++) {
                    var col = _this.columns[parseInt(i.toString(), 10)];
                    if (_this.equalCheckbox.checked === true) {
                        if (i !== 0) {
                            col.width.enabled = false;
                            col.space.enabled = false;
                        }
                    }
                    else {
                        col.width.enabled = true;
                        col.space.enabled = true;
                    }
                }
            };
            this.createTextBox = function (args) {
                if (_this.columnValueTexBox.value === 1) {
                    _this.oneDiv.classList.add('e-de-table-border-inside-setting-click');
                    _this.twoDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.threeDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.leftDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.rightDiv.classList.remove('e-de-table-border-inside-setting-click');
                }
                else Eif (_this.columnValueTexBox.value === 2) {
                    _this.oneDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.twoDiv.classList.add('e-de-table-border-inside-setting-click');
                    _this.threeDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.leftDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.rightDiv.classList.remove('e-de-table-border-inside-setting-click');
                }
                else if (_this.columnValueTexBox.value === 3) {
                    _this.oneDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.twoDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.threeDiv.classList.add('e-de-table-border-inside-setting-click');
                    _this.leftDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.rightDiv.classList.remove('e-de-table-border-inside-setting-click');
                }
                _this.numberOfColumns = args.value;
                Eif (args.value >= 1) {
                    _this.equalCheckbox.disabled = false;
                    _this.lineCheckbox.disabled = false;
                    var i = args.previousValue;
                    while (i < _this.numberOfColumns) {
                        _this.createColumn(i + 1);
                        i++;
                    }
                    while (i > _this.numberOfColumns) {
                        _this.columnTable.deleteRow(_this.columnTable.rows.length - 1);
                        _this.columns.splice(_this.columns.length - 1, _this.columns.length);
                        if (_this.numberOfColumns === 1) {
                            _this.equalCheckbox.disabled = true;
                            _this.columns[0].space.enabled = false;
                        }
                        i--;
                    }
                    _this.canUpdateColumnWidthAndSpacing(args.value, undefined, undefined, undefined);
                }
            };
            this.widthChange = function (args) {
                Iif (args.isInteracted === true) {
                    var val = (args.event.target).parentElement.classList;
                    val.replace('width1', 'Width');
                    _this.checkAndApplyColumnFormatWidth(args.value);
                }
            };
            this.spaceChange = function (args) {
                Iif (args.isInteracted === true) {
                    var val = (args.event.target).parentElement.classList;
                    val.replace('space1', 'Space');
                    _this.checkAndApplyColumnFormatSpace(args.value);
                }
            };
            this.checkAndApplyColumnFormatWidth = function (columnWidth) {
                if (_this.numberOfColumns === 1) {
                    if (columnWidth > _this.pageWidth) {
                        _this.columns[0].width.value = columnWidth - 1;
                    }
                    else {
                        _this.columns[0].width.value = columnWidth + 1;
                    }
                }
                else {
                    if (_this.equalCheckbox.checked === true) {
                        for (var i = 0; i < _this.columns.length; i++) {
                            var col = _this.columns[parseInt(i.toString(), 10)];
                            if (columnWidth >= 36 && _this.columns[0].space.value >= 0) {
                                var spaceCal = (_this.pageWidth - (_this.numberOfColumns * columnWidth)) / (_this.numberOfColumns - 1);
                                col.width.value = columnWidth;
                                if (i < _this.columns.length - 1) {
                                    col.space.value = spaceCal;
                                }
                            }
                            else {
                                _this.columns[0].width.value = _this.columns[1].width.value;
                            }
                        }
                    }
                    if (_this.equalCheckbox.checked === false) {
                        for (var i = 0; i < _this.columns.length; i++) {
                            var col = _this.columns[parseInt(i.toString(), 10)];
                            var updatedNumber = void 0;
                            if (columnWidth === _this.columns[parseInt(i.toString(), 10)].width.value) {
                                updatedNumber = i;
                                if (updatedNumber + 1 !== _this.columns.length) {
                                    if (columnWidth > _this.columns[0].width.value
                                        || columnWidth > _this.columns[_this.columns.length - 1].width.value) {
                                        for (var y = updatedNumber + 1; y <= _this.columns.length; y++) {
                                            var col_1 = _this.columns[parseInt(y.toString(), 10)];
                                            if (y < _this.columns.length) {
                                                if (col_1.width.value > 36) {
                                                    col_1.width.value = col_1.width.value - 1;
                                                }
                                            }
                                            if (_this.columns[0].space.value === 0) {
                                                for (var k = updatedNumber - 1; k >= 0; k--) {
                                                    var col_2 = _this.columns[parseInt(k.toString(), 10)];
                                                    if (col_2.width.value > 36) {
                                                        col_2.width.value = col_2.width.value - 1;
                                                    }
                                                }
                                            }
                                            if ((y >= _this.columns.length && _this.columns[0].width.value === 36)
                                                || (_this.columns[y - 1].width.value === 36 && _this.columns[0].space.value !== 0)) {
                                                for (var j = 0; j < _this.columns.length - 1; j++) {
                                                    var col_3 = _this.columns[parseInt(j.toString(), 10)];
                                                    if (col_3.space.value > 0) {
                                                        if (j < _this.columns.length - 1) {
                                                            col_3.space.value = col_3.space.value - 1;
                                                        }
                                                    }
                                                }
                                            }
                                            if (_this.columns[0].width.value === 36 && _this.columns[0].space.value === 0
                                                || _this.columns[y - 1].width.value === 36 && _this.columns[0].space.value === 0) {
                                                for (var j = 0; j < _this.columns.length; j++) {
                                                    var col_4 = _this.columns[parseInt(j.toString(), 10)];
                                                    if (col_4.width.value !== 36 && columnWidth
                                                        > (_this.pageWidth - ((_this.numberOfColumns - 1) * 36))) {
                                                        col_4.width.value = columnWidth - 1;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    else {
                                        for (var y = updatedNumber + 1; y < _this.columns.length; y++) {
                                            var col_5 = _this.columns[parseInt(y.toString(), 10)];
                                            if (col_5.width.value > 36) {
                                                col_5.width.value = col_5.width.value + 1;
                                            }
                                        }
                                    }
                                }
                                else {
                                    if (columnWidth > _this.columns[0].width.value
                                        || columnWidth > _this.columns[_this.columns.length - 1].width.value) {
                                        for (var y = updatedNumber + 1; y <= _this.columns.length; y++) {
                                            if (_this.columns[0].space.value === 0) {
                                                for (var k = updatedNumber - 1; k >= 0; k--) {
                                                    var col_6 = _this.columns[parseInt(k.toString(), 10)];
                                                    if (col_6.width.value > 36) {
                                                        col_6.width.value = col_6.width.value - 1;
                                                    }
                                                }
                                            }
                                            if ((y <= _this.columns.length && _this.columns[0].space.value !== 0)) {
                                                for (var j = 0; j < _this.columns.length - 1; j++) {
                                                    var col_7 = _this.columns[parseInt(j.toString(), 10)];
                                                    if (col_7.space.value > 0) {
                                                        if (j < _this.columns.length - 1) {
                                                            col_7.space.value = col_7.space.value - 1;
                                                        }
                                                    }
                                                }
                                            }
                                            if (_this.columns[0].width.value === 36 && _this.columns[0].space.value === 0) {
                                                for (var j = 0; j < _this.columns.length; j++) {
                                                    var col_8 = _this.columns[parseInt(j.toString(), 10)];
                                                    if (col_8.width.value !== 36 && columnWidth
                                                        > (_this.pageWidth - ((_this.numberOfColumns - 1) * 36))) {
                                                        col_8.width.value = columnWidth - 1;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    else {
                                        for (var y = updatedNumber + 1; y < _this.columns.length; y++) {
                                            var col_9 = _this.columns[parseInt(y.toString(), 10)];
                                            if (col_9.width.value > 36) {
                                                col_9.width.value = col_9.width.value + 1;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };
            this.checkAndApplyColumnFormatSpace = function (columnSpace) {
                if (_this.equalCheckbox.checked === true) {
                    for (var i = 0; i < _this.columns.length; i++) {
                        var col = _this.columns[parseInt(i.toString(), 10)];
                        if (columnSpace >= 0 && _this.columns[0].width.value >= 36) {
                            var widthCal = (_this.pageWidth - (columnSpace * (_this.numberOfColumns - 1))) / (_this.numberOfColumns);
                            col.width.value = widthCal;
                            if (i < _this.columns.length - 1) {
                                col.space.value = columnSpace;
                            }
                        }
                        else {
                            _this.columns[0].space.value = _this.columns[1].space.value;
                        }
                    }
                }
                if (_this.equalCheckbox.checked === false) {
                    for (var i = 0; i < _this.columns.length; i++) {
                        var col = _this.columns[parseInt(i.toString(), 10)];
                        var updatedNumber = void 0;
                        if (columnSpace === _this.columns[parseInt(i.toString(), 10)].space.value) {
                            updatedNumber = i;
                            if (updatedNumber + 1 !== _this.columns.length) {
                                _this.columns[_this.columns.length - 1].space.value = 0;
                                if (columnSpace > _this.columns[0].space.value || columnSpace > _this.columns[_this.columns.length - 2].space.value) {
                                    for (var y = updatedNumber + 1; y <= _this.columns.length; y++) {
                                        var col_10 = _this.columns[parseInt(y.toString(), 10)];
                                        if (y < _this.columns.length) {
                                            if (col_10.width.value > 36) {
                                                col_10.width.value = col_10.width.value - 1;
                                            }
                                        }
                                        if ((_this.columns[updatedNumber + 1].width.value === 36
                                            && _this.columns[parseInt(updatedNumber.toString(), 10)].width.value > 36)) {
                                            for (var j = updatedNumber; j >= 0; j--) {
                                                var col_11 = _this.columns[parseInt(j.toString(), 10)];
                                                if (col_11.width.value > 36) {
                                                    col_11.width.value = col_11.width.value - 1;
                                                }
                                            }
                                        }
                                        if (_this.columns[parseInt(updatedNumber.toString(), 10)].width.value === 36) {
                                            if (_this.columns[0].space.value !== 0 || _this.columns[updatedNumber + 1].space.value !== 0) {
                                                for (var k = 0; k < _this.columns.length - 1; k++) {
                                                    var col_12 = _this.columns[parseInt(k.toString(), 10)];
                                                    if (col_12.space.value > 0) {
                                                        if (k < _this.columns.length - 1) {
                                                            col_12.space.value = col_12.space.value - 1;
                                                            _this.columns[parseInt(updatedNumber.toString(), 10)].space.value = columnSpace;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        if (_this.columns[0].width.value === 36 && (_this.columns[0].space.value === 0
                                            || _this.columns[updatedNumber + 1].space.value === 0)) {
                                            for (var j = 0; j < _this.columns.length; j++) {
                                                var col_13 = _this.columns[parseInt(j.toString(), 10)];
                                                if (col_13.space.value !== 0 && columnSpace > (_this.pageWidth - ((_this.numberOfColumns) * 36))) {
                                                    col_13.space.value = columnSpace - 1;
                                                }
                                            }
                                        }
                                    }
                                }
                                else {
                                    for (var y = updatedNumber + 1; y < _this.columns.length; y++) {
                                        var col_14 = _this.columns[parseInt(y.toString(), 10)];
                                        if (col_14.width.value > 36) {
                                            col_14.width.value = col_14.width.value + 0.5;
                                        }
                                    }
                                }
                            }
                            else {
                                _this.columns[parseInt(updatedNumber.toString(), 10)].space.value = 0;
                            }
                        }
                    }
                }
            };
            this.canUpdateColumnWidthAndSpacing = function (numberOfColumns, colIndex, colWidth, colSpace) {
                var spaceValue = 36;
                var valueWidthEqualFirst = (_this.pageWidth - 36 * (numberOfColumns - 1)) / numberOfColumns;
                var valueWidthEqualsecond = (_this.pageWidth - 36 * (numberOfColumns)) / (numberOfColumns - 1);
                if (numberOfColumns === 2) {
                    _this.equalCheckbox.checked = true;
                }
                Eif (_this.equalCheckbox.checked === true) {
                    Eif (numberOfColumns > 1) {
                        var col = _this.columns[numberOfColumns - 1];
                        col.index.value = numberOfColumns;
                        for (var i = 0; i < numberOfColumns; i++) {
                            var col_15 = _this.columns[parseInt(i.toString(), 10)];
                            Eif (numberOfColumns <= 6) {
                                col_15.width.value = valueWidthEqualFirst;
                            }
                            else {
                                col_15.width.value = spaceValue;
                            }
                            col_15.width.value = valueWidthEqualFirst;
                            if (i < numberOfColumns - 1) {
                                Eif (numberOfColumns <= 6) {
                                    col_15.space.value = spaceValue;
                                }
                                else {
                                    col_15.space.value = valueWidthEqualsecond;
                                }
                            }
                            col_15.width.enabled = false;
                            col_15.space.enabled = false;
                        }
                    }
                    else {
                        _this.columns[0].width.value = _this.pageWidth;
                    }
                    _this.columns[0].width.enabled = true;
                    Eif (numberOfColumns > 1) {
                        _this.columns[0].space.enabled = true;
                    }
                    else {
                        _this.columns[0].space.enabled = false;
                    }
                }
                Iif (_this.equalCheckbox.checked === false) {
                    if (numberOfColumns > 2) {
                        var col = _this.columns[numberOfColumns - 1];
                        col.index.value = numberOfColumns;
                        for (var i = 0; i < numberOfColumns; i++) {
                            var col_16 = _this.columns[parseInt(i.toString(), 10)];
                            col_16.width.value = valueWidthEqualFirst;
                            if (i < numberOfColumns - 1) {
                                if (col_16.width.value <= 36) {
                                    col_16.space.value = valueWidthEqualsecond;
                                }
                                else {
                                    col_16.space.value = spaceValue;
                                }
                            }
                            col_16.width.enabled = true;
                            col_16.space.enabled = true;
                        }
                    }
                    else {
                        _this.columns[0].width.value = _this.pageWidth;
                    }
                }
            };
            this.closeDialog = function () {
                _this.documentHelper.dialog.hide();
                _this.unWireEventsAndBindings();
                _this.closeColumnsDialog();
            };
            this.closeColumnsDialog = function () {
                _this.documentHelper.dialog2.element.style.pointerEvents = '';
                _this.unWireEventsAndBindings();
                _this.documentHelper.updateFocus();
            };
            this.unWireEventsAndBindings = function () {
                _this.equalCheckbox.checked = true;
                _this.lineCheckbox.checked = false;
                _this.equalCheckbox.disabled = true;
                var cols = [];
                for (var i = 0; i < _this.columns.length; i++) {
                    _this.columns.splice(1, _this.columns.length - 1);
                    _this.columns[0].space.enabled = false;
                }
                while (_this.columnTable.rows.length > 1) {
                    _this.columnTable.deleteRow(_this.columnTable.rows.length - 1);
                }
            };
            this.openColumnsDialog = function () {
                var sectionFormat = _this.documentHelper.selection.sectionFormat;
                var pageWidthBox = sectionFormat.pageWidth - sectionFormat.leftMargin - sectionFormat.rightMargin;
                _this.columnValueTexBox.max = pageWidthBox / 36;
                _this.columns[0].width.value = pageWidthBox;
                _this.documentHelper.updateFocus();
                _this.equalCheckbox.checked = sectionFormat.equalWidth;
                _this.lineCheckbox.checked = sectionFormat.lineBetweenColumns;
                _this.columnValueTexBox.value = sectionFormat.columns.length === 0 ? 1 : sectionFormat.columns.length;
                switch (_this.columnValueTexBox.value) {
                    case 1:
                        _this.oneDiv.classList.add('e-de-table-border-inside-setting-click');
                        _this.twoDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.threeDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.leftDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.rightDiv.classList.remove('e-de-table-border-inside-setting-click');
                        break;
                    case 2:
                        _this.twoDiv.classList.add('e-de-table-border-inside-setting-click');
                        _this.oneDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.threeDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.leftDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.rightDiv.classList.remove('e-de-table-border-inside-setting-click');
                        break;
                    case 3:
                        _this.threeDiv.classList.add('e-de-table-border-inside-setting-click');
                        _this.twoDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.oneDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.leftDiv.classList.remove('e-de-table-border-inside-setting-click');
                        _this.rightDiv.classList.remove('e-de-table-border-inside-setting-click');
                        break;
                }
                Iif (_this.columnValueTexBox.value !== 1) {
                    _this.columns[0].space.value = sectionFormat.columns[0].space;
                    _this.columns[0].width.value = sectionFormat.columns[0].width;
                }
                Eif (_this.columnValueTexBox.value === 1) {
                    _this.columns[0].space.value = 0;
                }
                for (var i = 1; i < _this.columnValueTexBox.value; i++) {
                    _this.createColumn(i + 1, sectionFormat.columns[i].width, sectionFormat.columns[i].space);
                }
            };
            this.handleSettingCheckBoxAction = function (event) {
                var targetId = event.target.id;
                var columnDialogId = _this.target.id;
                Iif (targetId === columnDialogId + '_One_Div' || targetId === columnDialogId + '_One_Div_Container') {
                    _this.oneDiv.classList.add('e-de-table-border-inside-setting-click');
                    _this.setSettingPreviewDivElement('one');
                }
                else if (targetId === columnDialogId + '_Two_Div' || targetId === columnDialogId + '_Two_Div_Container') {
                    _this.twoDiv.classList.add('e-de-table-border-inside-setting-click');
                    _this.setSettingPreviewDivElement('two');
                }
                else Iif (targetId === columnDialogId + '_Three_Div' || targetId === columnDialogId + '_Three_Div_Container') {
                    _this.threeDiv.classList.add('e-de-table-border-inside-setting-click');
                    _this.setSettingPreviewDivElement('three');
                }
                else if (targetId === columnDialogId + '_Left_Div' || targetId === columnDialogId + '_Left_Div_Container') {
                    _this.oneDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.threeDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.rightDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.setSettingPreviewDivElement('two', 'left');
                }
                else Eif (targetId === columnDialogId + '_Right_Div' || targetId === columnDialogId + '_Right_Div_Container') {
                    _this.oneDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.threeDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.leftDiv.classList.remove('e-de-table-border-inside-setting-click');
                    _this.setSettingPreviewDivElement('two', 'right');
                }
            };
            this.applyColumnDialog = function () {
                Iif (!_this.documentHelper.selection.isEmpty) {
                    if (_this.documentHelper.owner.editorHistory) {
                        _this.documentHelper.owner.editor.initComplexHistory('InsertSectionBreak');
                    }
                    var startParagraphInfo = _this.documentHelper.selection.getParagraphInfo(_this.documentHelper.selection.start);
                    var endParagraphInfo = _this.documentHelper.selection.getParagraphInfo(_this.documentHelper.selection.end);
                    var startIndex = _this.documentHelper.selection.getHierarchicalIndex(startParagraphInfo.paragraph, startParagraphInfo.offset.toString());
                    var endIndex = _this.documentHelper.selection.getHierarchicalIndex(endParagraphInfo.paragraph, endParagraphInfo.offset.toString());
                    _this.documentHelper.selection.select(endIndex, endIndex);
                    _this.documentHelper.owner.editorModule.insertSectionBreak(types_1.SectionBreakType.Continuous);
                    _this.documentHelper.selection.select(startIndex, startIndex);
                    _this.documentHelper.owner.editorModule.insertSectionBreak(types_1.SectionBreakType.Continuous);
                }
                var sectionFormat = new index_1.WSectionFormat();
                var currentSectionFormat = _this.documentHelper.selection.sectionFormat;
                sectionFormat.bottomMargin = currentSectionFormat.bottomMargin;
                sectionFormat.topMargin = currentSectionFormat.topMargin;
                sectionFormat.leftMargin = currentSectionFormat.leftMargin;
                sectionFormat.rightMargin = currentSectionFormat.rightMargin;
                sectionFormat.pageWidth = currentSectionFormat.pageWidth;
                sectionFormat.pageHeight = currentSectionFormat.pageHeight;
                sectionFormat.differentOddAndEvenPages = currentSectionFormat.differentOddAndEvenPages;
                sectionFormat.differentFirstPage = currentSectionFormat.differentFirstPage;
                sectionFormat.headerDistance = currentSectionFormat.headerDistance;
                sectionFormat.footerDistance = currentSectionFormat.footerDistance;
                sectionFormat.numberOfColumns = _this.numberOfColumns;
                sectionFormat.equalWidth = _this.equalCheckbox.checked;
                sectionFormat.lineBetweenColumns = _this.lineCheckbox.checked;
                var cols = [];
                for (var i = 0; i < _this.columns.length; i++) {
                    var colFormat = new index_1.WColumnFormat();
                    colFormat.width = index_1.HelperMethods.convertPointToPixel(_this.columns[parseInt(i.toString(), 10)].width.value);
                    colFormat.space = index_1.HelperMethods.convertPointToPixel(_this.columns[parseInt(i.toString(), 10)].space.value);
                    cols.push(colFormat);
                }
                sectionFormat.columns = cols;
                sectionFormat.breakCode = currentSectionFormat.breakCode;
                _this.documentHelper.owner.editorModule.onApplySectionFormat(undefined, sectionFormat);
                Eif (_this.documentHelper.owner.editorHistory) {
                    _this.documentHelper.owner.editorHistory.updateComplexHistory();
                }
                _this.documentHelper.hideDialog();
            };
            this.documentHelper = documentHelper;
        }
        ColumnsDialog.prototype.getModuleName = function () {
            return 'ColumnsDialog';
        };
        ColumnsDialog.prototype.initColumnsDialog = function (localeValue, isRtl) {
            this.columns = [];
            this.target = ej2_base_1.createElement('div', {
                id: this.documentHelper.owner.containerId + '_Columns',
                className: 'e-de-table-border-shading-dlg'
            });
            this.displayText = ej2_base_1.createElement('div', {
                innerHTML: localeValue.getConstant('Presets'),
                className: 'e-de-para-dlg-heading'
            });
            this.PresetsContainer = ej2_base_1.createElement('div', {
                className: 'e-de-dlg-row'
            });
            this.oneDivContainer = ej2_base_1.createElement('div', {
                id: this.target.id + '_One_Div_Container', className: 'e-de-preset-container'
            });
            this.oneDiv = ej2_base_1.createElement('div', {
                id: this.target.id + '_One_Div',
                className: 'e-icons e-de-ctnr-columns-one e-de-columns-presets-genral'
            });
            this.oneDivLabel = ej2_base_1.createElement('label', {
                innerHTML: localeValue.getConstant('One'), className: 'e-de-column-label',
                id: this.target.id + '_One_Div_Label'
            });
            this.twoDivContainer = ej2_base_1.createElement('div', {
                id: this.target.id + '_Two_Div_Container', className: 'e-de-preset-container'
            });
            this.twoDiv = ej2_base_1.createElement('div', {
                id: this.target.id + '_Two_Div',
                className: 'e-icons e-de-ctnr-columns-two e-de-columns-presets-genral'
            });
            this.twoDivLabel = ej2_base_1.createElement('label', {
                innerHTML: localeValue.getConstant('Two'), className: 'e-de-column-label',
                id: this.target.id + '_Two_Div_Label'
            });
            this.threeDivContainer = ej2_base_1.createElement('div', {
                id: this.target.id + '_Three_Div_Container', className: 'e-de-preset-container'
            });
            this.threeDiv = ej2_base_1.createElement('div', {
                id: this.target.id + '_Three_Div',
                className: 'e-icons e-de-ctnr-columns-three  e-de-columns-presets-genral'
            });
            this.threeDivLabel = ej2_base_1.createElement('label', {
                innerHTML: localeValue.getConstant('Three'), className: 'e-de-column-label',
                id: this.target.id + '_Three_Div_Label'
            });
            this.leftDivContainer = ej2_base_1.createElement('div', {
                id: this.target.id + '_Left_Div_Container', className: 'e-de-preset-container'
            });
            this.leftDiv = ej2_base_1.createElement('div', {
                id: this.target.id + '_Left_Div',
                className: 'e-icons e-de-ctnr-columns-left e-de-columns-presets-genral'
            });
            this.leftDivLabel = ej2_base_1.createElement('label', {
                innerHTML: localeValue.getConstant('Left'), className: 'e-de-column-label',
                id: this.target.id + '_Left_Div_Label'
            });
            this.rightDivContainer = ej2_base_1.createElement('div', {
                id: this.target.id + '_Right_Div_Container', className: 'e-de-preset-container'
            });
            this.rightDiv = ej2_base_1.createElement('div', {
                id: this.target.id + '_Right_Div',
                className: 'e-icons e-de-ctnr-columns-right e-de-columns-presets-genral'
            });
            this.rightDivLabel = ej2_base_1.createElement('label', {
                innerHTML: localeValue.getConstant('Right'), className: 'e-de-column-label',
                id: this.target.id + '_Right_Div_Label'
            });
            this.nuberOfColumnsContainer = ej2_base_1.createElement('div', {
                className: 'e-de-container-row e-de-columns-padding-alignment'
            });
            this.subcontainer = ej2_base_1.createElement('div', {
                className: 'e-de-subcontainer-left'
            });
            this.oneDivContainer.setAttribute('aria-label', localeValue.getConstant('One'));
            this.twoDivContainer.setAttribute('aria-label', localeValue.getConstant('Two'));
            this.threeDivContainer.setAttribute('aria-label', localeValue.getConstant('Three'));
            this.leftDivContainer.setAttribute('aria-label', localeValue.getConstant('Left'));
            this.rightDivContainer.setAttribute('aria-label', localeValue.getConstant('Right'));
            Iif (isRtl) {
                this.oneDiv.classList.add('e-de-rtl');
                this.twoDiv.classList.add('e-de-rtl');
                this.threeDiv.classList.add('e-de-rtl');
                this.leftDiv.classList.add('e-de-rtl');
                this.rightDiv.classList.add('e-de-rtl');
                this.oneDivContainer.classList.add('e-de-rtl');
                this.twoDivContainer.classList.add('e-de-rtl');
                this.threeDivContainer.classList.add('e-de-rtl');
                this.leftDivContainer.classList.add('e-de-rtl');
                this.rightDivContainer.classList.add('e-de-rtl');
                this.oneDivLabel.classList.add('e-de-rtl');
                this.twoDivLabel.classList.add('e-de-rtl');
                this.threeDivLabel.classList.add('e-de-rtl');
                this.leftDivLabel.classList.add('e-de-rtl');
                this.rightDivLabel.classList.add('e-de-rtl');
            }
            this.columnsCountBox = ej2_base_1.createElement('input', {
                attrs: { type: 'text' }
            });
            this.subcontainer.appendChild(this.columnsCountBox);
            this.nuberOfColumnsContainer.appendChild(this.subcontainer);
            this.section = this.documentHelper.selection.sectionFormat;
            this.pageWidth = this.section.pageWidth - this.section.leftMargin - this.section.rightMargin;
            this.columnValueTexBox = new ej2_inputs_1.NumericTextBox({
                format: '#',
                value: 1,
                min: 1,
                strictMode: true,
                placeholder: localeValue.getConstant('Number of columns'),
                floatLabelType: 'Always',
                change: this.createTextBox
            });
            this.columnValueTexBox.appendTo(this.columnsCountBox);
            this.subcontainer1 = ej2_base_1.createElement('div', {
                className: 'e-de-subcontainer-right'
            });
            this.lineCheckDiv = ej2_base_1.createElement('div', {
                className: 'e-de-columns-padding-alignment'
            });
            this.lineCheck = ej2_base_1.createElement('input', { attrs: { type: 'checkbox' } });
            this.subcontainer1.appendChild(this.lineCheckDiv);
            this.lineCheckDiv.appendChild(this.lineCheck);
            this.lineCheck.setAttribute('aria-labelledby', localeValue.getConstant('Line between column'));
            this.columnsCountBox.setAttribute('aria-labelledby', localeValue.getConstant('Number of columns'));
            this.lineCheckbox = new ej2_buttons_1.CheckBox({
                label: localeValue.getConstant('Line between column')
            });
            this.widthAndSpacingContainer = ej2_base_1.createElement('div', {
                className: 'e-de-dlg-row'
            });
            this.widthAndSpacingContainerDiv = ej2_base_1.createElement('div', {});
            this.widthAndSpacingText = ej2_base_1.createElement('div', {
                innerHTML: localeValue.getConstant('Width and Spacing'),
                className: 'e-de-para-dlg-heading'
            });
            this.columnElementDiv = ej2_base_1.createElement('div', {
                className: 'e-width-space-div '
            });
            this.widthcontainerDiv1 = ej2_base_1.createElement('div', {
                className: 'e-de-container-row'
            });
            this.widthContainer = ej2_base_1.createElement('div', {
                className: 'e-de-container-row'
            });
            this.tableElement = ej2_base_1.createElement('table');
            this.tableElement.style.width = '96%';
            var row = this.tableElement.insertRow();
            var cell = row.insertCell();
            cell.innerHTML = localeValue.getConstant('Column');
            cell.style.width = '20%';
            cell.style.display = 'table-cell';
            cell.classList.add('e-de-dlg-sub-header');
            cell = row.insertCell();
            cell.innerHTML = localeValue.getConstant('Width');
            cell.style.width = '40%';
            cell.style.display = 'table-cell';
            cell.classList.add('e-de-dlg-sub-header');
            cell = row.insertCell();
            cell.innerHTML = localeValue.getConstant('Spacing');
            cell.style.width = '40%';
            cell.style.display = 'table-cell';
            cell.classList.add('e-de-dlg-sub-header');
            this.columnDiv = ej2_base_1.createElement('div', { styles: 'width:100%;height:100px;overflow-y: scroll;overflow-x: hidden;' });
            this.columnTable = ej2_base_1.createElement('table', { styles: 'width:100%;' });
            var row1 = this.columnTable.insertRow();
            var cell1 = row1.insertCell();
            cell1.style.width = '20%';
            var col = new Column();
            this.columnCountBox1 = ej2_base_1.createElement('input', {});
            col.index = new ej2_inputs_1.NumericTextBox({
                format: '#',
                min: 1,
                value: 1,
                enabled: false,
                cssClass: 'index1',
                showSpinButton: false,
                floatLabelType: 'Always',
                change: this.spaceChange
            });
            cell1.appendChild(this.columnCountBox1);
            col.index.appendTo(this.columnCountBox1);
            var cell2 = row1.insertCell();
            cell2.style.width = '40%';
            this.widthCountBox1 = ej2_base_1.createElement('input', {
                attrs: { 'type': 'text' }
            });
            col.width = new ej2_inputs_1.NumericTextBox({
                min: 36,
                decimals: 2,
                strictMode: true,
                enablePersistence: false,
                cssClass: 'width1',
                floatLabelType: 'Always',
                change: this.widthChange
            });
            cell2.appendChild(this.widthCountBox1);
            cell2.style.width = '40%';
            col.width.appendTo(this.widthCountBox1);
            var cell3 = row1.insertCell();
            cell3.style.width = '40%';
            this.spacingCountBox1 = ej2_base_1.createElement('input', {
                attrs: { 'type': 'text' }
            });
            col.space = new ej2_inputs_1.NumericTextBox({
                min: 0,
                decimals: 2,
                strictMode: true,
                enablePersistence: false,
                cssClass: 'space1',
                floatLabelType: 'Always',
                change: this.spaceChange
            });
            cell3.appendChild(this.spacingCountBox1);
            col.space.appendTo(this.spacingCountBox1);
            this.columns.push(col);
            col.space.enabled = false;
            this.widthCountBox1.setAttribute('aria-labelledby', 'Width');
            this.spacingCountBox1.setAttribute('aria-labelledby', 'Space');
            this.equalCheckDiv = ej2_base_1.createElement('div', {
                className: 'e-de-columns-padding-alignment'
            });
            this.equalCheck = ej2_base_1.createElement('input', { attrs: { type: 'checkbox' } });
            this.equalCheckDiv.appendChild(this.equalCheck);
            this.equalCheckDiv.setAttribute('aria-label', localeValue.getConstant('Equal column width'));
            this.equalCheckbox = new ej2_buttons_1.CheckBox({
                label: localeValue.getConstant('Equal column width'),
                change: this.checkBox
            });
            this.equalCheckbox.appendTo(this.equalCheck);
            this.lineCheckbox.appendTo(this.lineCheck);
            this.nuberOfColumnsContainer.appendChild(this.subcontainer1);
            this.oneDivContainer.appendChild(this.oneDiv);
            this.oneDivContainer.appendChild(this.oneDivLabel);
            this.twoDivContainer.appendChild(this.twoDiv);
            this.twoDivContainer.appendChild(this.twoDivLabel);
            this.threeDivContainer.appendChild(this.threeDiv);
            this.threeDivContainer.appendChild(this.threeDivLabel);
            this.leftDivContainer.appendChild(this.leftDiv);
            this.leftDivContainer.appendChild(this.leftDivLabel);
            this.rightDivContainer.appendChild(this.rightDiv);
            this.rightDivContainer.appendChild(this.rightDivLabel);
            this.PresetsContainer.appendChild(this.oneDivContainer);
            this.PresetsContainer.appendChild(this.twoDivContainer);
            this.PresetsContainer.appendChild(this.threeDivContainer);
            this.PresetsContainer.appendChild(this.leftDivContainer);
            this.PresetsContainer.appendChild(this.rightDivContainer);
            this.widthAndSpacingContainerDiv.appendChild(this.widthAndSpacingText);
            this.widthAndSpacingContainerDiv.appendChild(this.tableElement);
            this.columnDiv.appendChild(this.columnTable);
            this.widthAndSpacingContainerDiv.appendChild(this.columnDiv);
            this.widthAndSpacingContainer.appendChild(this.widthAndSpacingContainerDiv);
            this.target.appendChild(this.displayText);
            this.target.appendChild(this.PresetsContainer);
            this.target.appendChild(this.nuberOfColumnsContainer);
            this.target.appendChild(this.widthAndSpacingContainer);
            this.target.appendChild(this.equalCheckDiv);
            this.oneDivContainer.addEventListener('click', this.handleSettingCheckBoxActionHandler);
            this.twoDivContainer.addEventListener('click', this.handleSettingCheckBoxActionHandler);
            this.threeDivContainer.addEventListener('click', this.handleSettingCheckBoxActionHandler);
            this.leftDivContainer.addEventListener('click', this.handleSettingCheckBoxActionHandler);
            this.rightDivContainer.addEventListener('click', this.handleSettingCheckBoxActionHandler);
            this.widthcontainerDiv1.style.display = 'flex';
            this.equalCheckbox.checked = true;
            this.equalCheckbox.disabled = true;
            this.lineCheckbox.disabled = true;
        };
        ColumnsDialog.prototype.createColumn = function (index, width, space) {
            this.widthContainer = ej2_base_1.createElement('div', {
                className: 'e-de-container-row'
            });
            this.widthContainer.style.display = 'flex';
            var row = this.columnTable.insertRow();
            var cell1 = row.insertCell();
            cell1.style.width = '20%';
            var col = new Column();
            this.columnCount = ej2_base_1.createElement('input', {});
            col.index = new ej2_inputs_1.NumericTextBox({
                format: '#',
                min: 1,
                value: index,
                enabled: false,
                cssClass: 'column1',
                showSpinButton: false,
                floatLabelType: 'Always'
            });
            cell1.appendChild(this.columnCount);
            col.index.appendTo(this.columnCount);
            var cell2 = row.insertCell();
            cell2.style.width = '40%';
            var widthCountBox = ej2_base_1.createElement('input', {
                attrs: { 'type': 'text' }
            });
            col.width = new ej2_inputs_1.NumericTextBox({
                min: 36,
                decimals: 2,
                strictMode: true,
                enablePersistence: false,
                cssClass: 'width1',
                floatLabelType: 'Always',
                change: this.widthChange
            });
            Iif (!ej2_base_1.isNullOrUndefined(width)) {
                col.width.value = width;
            }
            cell2.appendChild(widthCountBox);
            col.width.appendTo(widthCountBox);
            var cell3 = row.insertCell();
            cell3.style.width = '40%';
            var spacingCountBox = ej2_base_1.createElement('input', {
                attrs: { 'type': 'text' }
            });
            col.space = new ej2_inputs_1.NumericTextBox({
                min: 0,
                decimals: 2,
                strictMode: true,
                enablePersistence: false,
                cssClass: 'space1',
                floatLabelType: 'Always',
                change: this.spaceChange
            });
            Iif (!ej2_base_1.isNullOrUndefined(space)) {
                col.space.value = space;
            }
            cell3.appendChild(spacingCountBox);
            col.space.appendTo(spacingCountBox);
            this.columns.push(col);
        };
        ColumnsDialog.prototype.show = function () {
            var localeValue = new ej2_base_1.L10n('documenteditor', this.documentHelper.owner.defaultLocale);
            localeValue.setLocale(this.documentHelper.owner.locale);
            Eif (!this.target) {
                this.initColumnsDialog(localeValue, this.documentHelper.owner.enableRtl);
            }
            this.documentHelper.dialog.content = this.target;
            this.documentHelper.dialog.header = localeValue.getConstant('Columns');
            this.documentHelper.dialog.beforeOpen = this.openColumnsDialog;
            this.documentHelper.dialog.close = this.closeColumnsDialog;
            this.documentHelper.dialog.position = { X: 'center', Y: 'center' };
            this.documentHelper.dialog.width = 'auto';
            this.documentHelper.dialog.height = 'auto';
            this.documentHelper.dialog.buttons = [{
                    click: this.applyColumnDialog,
                    buttonModel: { content: localeValue.getConstant('Ok'), cssClass: 'e-flat e-table-border-shading-okay', isPrimary: true }
                },
                {
                    click: this.closeDialog,
                    buttonModel: { content: localeValue.getConstant('Cancel'), cssClass: 'e-flat e-table-border-shading-cancel' }
                }];
            this.documentHelper.dialog.dataBind();
            this.documentHelper.dialog.show();
        };
        ColumnsDialog.prototype.onhandleSettingCheckBoxActionClicked = function (event) {
            this.handleSettingCheckBoxAction(event);
        };
        ColumnsDialog.prototype.setSettingPreviewDivElement = function (position, type) {
            var _this = this;
            this.equalCheckbox.checked = true;
            switch (position) {
                case 'one':
                    this.columnValueTexBox.value = 1;
                    break;
                case 'two':
                    this.columnValueTexBox.value = 2;
                    setTimeout(function () {
                        if (type === 'left' || type === 'right') {
                            _this.equalCheckbox.checked = false;
                        }
                        if (type === 'left') {
                            _this.numberOfColumns = 2;
                            _this.leftDiv.classList.add('e-de-table-border-inside-setting-click');
                            _this.twoDiv.classList.remove('e-de-table-border-inside-setting-click');
                            var colWidth = ((_this.pageWidth - (2 * 36)) / 3);
                            _this.columns[0].width.value = colWidth;
                            _this.columns[1].width.value = colWidth + colWidth + 36;
                            _this.columns[1].space.value = undefined;
                        }
                        else if (type === 'right') {
                            _this.numberOfColumns = 2;
                            _this.rightDiv.classList.add('e-de-table-border-inside-setting-click');
                            _this.twoDiv.classList.remove('e-de-table-border-inside-setting-click');
                            var colWidth = ((_this.pageWidth - (2 * 36)) / 3);
                            _this.columns[0].width.value = colWidth + colWidth + 36;
                            _this.columns[1].width.value = colWidth;
                            _this.columns[1].space.value = undefined;
                        }
                    }, 5);
                    break;
                case 'three':
                    this.columnValueTexBox.value = 3;
                    break;
            }
        };
        ColumnsDialog.prototype.destroy = function () {
            this.removeElements();
            this.removeEvents();
            this.target = undefined;
            this.oneDiv = undefined;
            this.twoDiv = undefined;
            this.threeDiv = undefined;
            this.leftDiv = undefined;
            this.rightDiv = undefined;
            this.documentHelper = undefined;
        };
        ColumnsDialog.prototype.removeEvents = function () {
            Iif (this.oneDivContainer) {
                this.oneDivContainer.removeEventListener('click', this.handleSettingCheckBoxActionHandler);
            }
            Iif (this.twoDivContainer) {
                this.twoDivContainer.removeEventListener('click', this.handleSettingCheckBoxActionHandler);
            }
            Iif (this.threeDivContainer) {
                this.threeDivContainer.removeEventListener('click', this.handleSettingCheckBoxActionHandler);
            }
            Iif (this.leftDivContainer) {
                this.leftDivContainer.removeEventListener('click', this.handleSettingCheckBoxActionHandler);
            }
            Iif (this.rightDivContainer) {
                this.rightDivContainer.removeEventListener('click', this.handleSettingCheckBoxActionHandler);
            }
        };
        ColumnsDialog.prototype.removeElements = function () {
            if (this.target) {
                this.target.remove();
            }
            if (this.oneDiv) {
                this.oneDiv.remove();
                this.oneDiv = undefined;
            }
            if (this.twoDiv) {
                this.twoDiv.remove();
                this.twoDiv = undefined;
            }
            if (this.threeDiv) {
                this.threeDiv.remove();
                this.threeDiv = undefined;
            }
            if (this.leftDiv) {
                this.leftDiv.remove();
                this.leftDiv = undefined;
            }
            if (this.rightDiv) {
                this.rightDiv.remove();
                this.rightDiv = undefined;
            }
            if (this.columnsCountBox) {
                this.columnsCountBox.remove();
                this.columnsCountBox = undefined;
            }
            Iif (this.columnValueTexBox && this.columnValueTexBox.element && this.columnValueTexBox.element.parentNode) {
                this.columnValueTexBox.destroy();
                this.columnValueTexBox = undefined;
            }
            if (this.lineCheckbox) {
                this.lineCheckbox.destroy();
                this.lineCheckbox = undefined;
            }
            if (this.equalCheckbox) {
                this.equalCheckbox.destroy();
                this.equalCheckbox = undefined;
            }
            if (this.columnCountBox1) {
                this.columnCountBox1.remove();
                this.columnCountBox1 = undefined;
            }
            if (this.widthCountBox1) {
                this.widthCountBox1.remove();
                this.widthCountBox1 = undefined;
            }
            if (this.spacingCountBox1) {
                this.spacingCountBox1.remove();
                this.spacingCountBox1 = undefined;
            }
            if (this.columnTable) {
                this.columnTable.remove();
                this.columnTable = undefined;
            }
            if (this.displayText) {
                this.displayText.remove();
                this.displayText = undefined;
            }
            if (this.PresetsContainer) {
                this.PresetsContainer.remove();
                this.PresetsContainer = undefined;
            }
            if (this.oneDivContainer) {
                this.oneDivContainer.remove();
                this.oneDivContainer = undefined;
            }
            if (this.oneDivLabel) {
                this.oneDivLabel.remove();
                this.oneDivLabel = undefined;
            }
            if (this.twoDivContainer) {
                this.twoDivContainer.remove();
                this.twoDivContainer = undefined;
            }
            if (this.twoDivLabel) {
                this.twoDivLabel.remove();
                this.twoDivLabel = undefined;
            }
            if (this.threeDivContainer) {
                this.threeDivContainer.remove();
                this.threeDivContainer = undefined;
            }
            if (this.threeDivLabel) {
                this.threeDivLabel.remove();
                this.threeDivLabel = undefined;
            }
            if (this.leftDivContainer) {
                this.leftDivContainer.remove();
                this.leftDivContainer = undefined;
            }
            if (this.leftDivLabel) {
                this.leftDivLabel.remove();
                this.leftDivLabel = undefined;
            }
            if (this.rightDivContainer) {
                this.rightDivContainer.remove();
                this.rightDivContainer = undefined;
            }
            if (this.rightDivLabel) {
                this.rightDivLabel.remove();
                this.rightDivLabel = undefined;
            }
            if (this.nuberOfColumnsContainer) {
                this.nuberOfColumnsContainer.remove();
                this.nuberOfColumnsContainer = undefined;
            }
            if (this.subcontainer) {
                this.subcontainer.remove();
                this.subcontainer = undefined;
            }
            if (this.subcontainer1) {
                this.subcontainer1.remove();
                this.subcontainer1 = undefined;
            }
            if (this.lineCheckDiv) {
                this.lineCheckDiv.remove();
                this.lineCheckDiv = undefined;
            }
            if (this.lineCheck) {
                this.lineCheck.remove();
                this.lineCheck = undefined;
            }
            if (this.widthAndSpacingContainer) {
                this.widthAndSpacingContainer.remove();
                this.widthAndSpacingContainer = undefined;
            }
            if (this.widthAndSpacingContainerDiv) {
                this.widthAndSpacingContainerDiv.remove();
                this.widthAndSpacingContainerDiv = undefined;
            }
            if (this.widthAndSpacingText) {
                this.widthAndSpacingText.remove();
                this.widthAndSpacingText = undefined;
            }
            if (this.tableElement) {
                this.tableElement.remove();
                this.tableElement = undefined;
            }
            if (this.columnDiv) {
                this.columnDiv.remove();
                this.columnDiv = undefined;
            }
            if (this.columnCount) {
                this.columnCount.remove();
                this.columnCount = undefined;
            }
            if (this.equalCheckDiv) {
                this.equalCheckDiv.remove();
                this.equalCheckDiv = undefined;
            }
            if (this.equalCheck) {
                this.equalCheck.remove();
                this.equalCheck = undefined;
            }
        };
        return ColumnsDialog;
    }());
    exports.ColumnsDialog = ColumnsDialog;
});