all files / document-editor-container/ document-editor-container.js

88% Statements 572/650
69.85% Branches 336/481
83.82% Functions 57/68
87.89% Lines 566/644
5 statements, 2 functions, 11 branches Ignored     
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 1088    81× 81× 81×       170× 170× 170× 170×     71× 71× 71× 71× 71× 71×     22395×                       5519×         283×     952× 456×     496×           55× 63× 63×                                                               35× 35×   35×                                                                                             73× 73× 20×   73×   73× 70×   73× 73×   73× 73×   73× 73× 73×     73× 60×   73× 73× 73× 73×   63× 61×   63× 61×   63× 61×   63× 61×                                                         76×   76×   76×     73× 11×   73× 73×   73× 73×   73× 73×   73× 73×   73× 73×   73× 73×     77× 77× 77× 77× 77×   77× 77×   77×     77× 77×   77× 77×     77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77× 77×   77×     77× 77×   77× 77×   77× 77×   77× 77×         233× 233× 225× 44×         181×         233×   73× 73× 73× 73× 73× 73× 73×   73× 73×   76× 61× 61× 60×       61× 61×     76× 76× 73×   76× 73× 73× 13×     13×       13×   13×     11×       60×     60×     57×   60×   73×       76×   73× 73× 73×                                                                   73× 73× 73× 73× 73× 73× 73× 73× 73×   73× 73× 73× 73× 73× 73× 73× 73× 73× 73×       168× 47×               72×       72×       72× 72× 72× 72× 72×       100× 97×               12×             94×               1197×   1197× 416×                         94× 17× 17× 17×       159× 159×   159× 159×   159× 159×   93× 93×   93×   93× 93× 93×   93× 90×   93× 20×   93× 93× 93×   446× 446× 441× 404× 404× 329×   404× 404× 404×                                                                             361× 361×             408× 329×   79× 79× 79× 79×                   79× 79× 77×   79× 79× 79× 79×   79× 79×   79× 79×   79×     78× 78×     78×   60×   18× 10×           79× 79× 77×       78× 76×   78× 78× 78× 78×         89× 89× 72× 70×   72×   89× 87× 87× 87× 87×   89×       89× 89× 72× 72× 71×   88× 59×   88× 88× 59×   88× 88× 59×   88× 88× 59×   88× 88× 71×   88× 59×   88× 88× 71× 71×   88×       88×       88× 88× 88× 88× 88×                                                                                                                                                                                            
/* istanbul ignore next */ 
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/* istanbul ignore next */ 
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    Iif (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) Eif (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "../document-editor/document-editor", "./properties-pane/header-footer-pane", "./properties-pane/image-properties-pane", "./properties-pane/table-of-content-pane", "./properties-pane/table-properties-pane", "./properties-pane/status-bar", "@syncfusion/ej2-popups", "../document-editor/base/constants", "../index", "@syncfusion/ej2-base", "@syncfusion/ej2-popups", "./locale-strings"], function (require, exports, ej2_base_1, ej2_base_2, document_editor_1, header_footer_pane_1, image_properties_pane_1, table_of_content_pane_1, table_properties_pane_1, status_bar_1, ej2_popups_1, constants_1, index_1, ej2_base_3, ej2_popups_2, locale_strings_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var DocumentEditorContainer = (function (_super) {
        __extends(DocumentEditorContainer, _super);
        function DocumentEditorContainer(options, element) {
            var _this = _super.call(this, options, element) || this;
            _this.previousContext = '';
            _this.showHeaderProperties = true;
            _this.showPane = true;
            _this.defaultLocale = locale_strings_1.defaultLocaleStrings;
            return _this;
        }
        Object.defineProperty(DocumentEditorContainer.prototype, "documentEditor", {
            get: function () {
                return this.documentEditorInternal;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DocumentEditorContainer.prototype, "toolbar", {
            get: function () {
                return this.toolbarModule;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DocumentEditorContainer.prototype, "ribbon", {
            get: function () {
                return this.ribbonModule;
            },
            enumerable: true,
            configurable: true
        });
        DocumentEditorContainer.prototype.getModuleName = function () {
            return 'DocumentEditorContainer';
        };
        Object.defineProperty(DocumentEditorContainer.prototype, "toolbarHandler", {
            get: function () {
                if (this.toolbarMode === 'Ribbon') {
                    return this.ribbonModule;
                }
                else {
                    return this.toolbarModule;
                }
            },
            enumerable: true,
            configurable: true
        });
        DocumentEditorContainer.prototype.onPropertyChanged = function (newModel, oldModel) {
            for (var _i = 0, _a = Object.keys(newModel); _i < _a.length; _i++) {
                var prop = _a[_i];
                switch (prop) {
                    case 'restrictEditing':
                        this.restrictEditingToggleHelper(newModel.restrictEditing);
                        break;
                    case 'showPropertiesPane':
                        this.showHidePropertiesPane(newModel.showPropertiesPane);
                        this.showPane = this.showPropertiesPane;
                        break;
                    case 'enableTrackChanges':
                        Iif (this.documentEditor.documentHelper.isTrackedOnlyMode && !newModel.enableTrackChanges && newModel.enableTrackChanges !== this.enableTrackChanges) {
                            this.enableTrackChanges = true;
                        }
                        Eif (this.documentEditor) {
                            this.documentEditor.enableTrackChanges = newModel.enableTrackChanges;
                            Eif (this.toolbarHandler) {
                                this.toolbarHandler.toggleTrackChanges(newModel.enableTrackChanges);
                            }
                            this.documentEditor.resize();
                        }
                        break;
                    case 'enableLocalPaste':
                        Eif (this.documentEditor) {
                            this.documentEditor.enableLocalPaste = newModel.enableLocalPaste;
                        }
                        break;
                    case 'serviceUrl':
                        Eif (this.documentEditor) {
                            this.documentEditor.serviceUrl = newModel.serviceUrl;
                        }
                        break;
                    case 'serverActionSettings':
                        if (this.documentEditor) {
                            this.setserverActionSettings();
                        }
                        break;
                    case 'zIndex':
                        Eif (this.documentEditor) {
                            this.documentEditor.zIndex = newModel.zIndex;
                        }
                        break;
                    case 'headers':
                        Eif (this.documentEditor) {
                            this.documentEditor.headers = newModel.headers;
                        }
                        break;
                    case 'locale':
                    case 'enableRtl':
                        this.refresh();
                        break;
                    case 'enableComment':
                        Eif (this.documentEditor) {
                            this.documentEditor.enableComment = newModel.enableComment;
                        }
                        Eif (this.toolbarHandler) {
                            this.toolbarHandler.enableDisableInsertComment(newModel.enableComment);
                        }
                        break;
                    case 'enableSpellCheck':
                        if (this.documentEditor) {
                            this.documentEditor.enableSpellCheck = newModel.enableSpellCheck;
                        }
                        break;
                    case 'documentSettings':
                        Eif (this.documentEditor) {
                            this.documentEditor.documentSettings.compatibilityMode = this.documentSettings.compatibilityMode;
                        }
                        break;
                    case 'documentEditorSettings':
                        Eif (this.documentEditor) {
                            this.customizeDocumentEditorSettings();
                        }
                        if (!ej2_base_1.isNullOrUndefined(newModel.documentEditorSettings.fontFamilies)) {
                            var fontFamilyValue = newModel.documentEditorSettings.fontFamilies;
                            this.refreshFontFamilies(fontFamilyValue);
                        }
                        break;
                    case 'toolbarItems':
                        Iif (this.toolbarModule) {
                            this.toolbarModule.reInitToolbarItems(newModel.toolbarItems);
                        }
                        break;
                    case 'currentUser':
                        Eif (this.documentEditor) {
                            this.documentEditor.currentUser = newModel.currentUser;
                        }
                        break;
                    case 'userColor':
                        Eif (this.documentEditor) {
                            this.documentEditor.userColor = newModel.userColor;
                        }
                        break;
                    case 'layoutType':
                        Eif (this.documentEditor) {
                            this.documentEditor.layoutType = newModel.layoutType;
                            Eif (newModel.layoutType === 'Continuous') {
                                this.statusBar.togglePageLayout();
                            }
                            else {
                                this.statusBar.toggleWebLayout();
                            }
                            Iif (this.ribbon) {
                                this.ribbon.tabManager.viewTab.onSelectionChange();
                            }
                        }
                        break;
                    case 'toolbarMode':
                    case 'enableToolbar':
                        this.handleToolbarModeChange();
                        break;
                    case 'height':
                        this.element.style.height = ej2_base_1.formatUnit(this.height);
                        Eif (this.documentEditor) {
                            this.documentEditor.resize();
                        }
                        this.resize();
                        break;
                    case 'width':
                        this.element.style.width = ej2_base_1.formatUnit(this.width);
                        Eif (this.documentEditor) {
                            this.documentEditor.resize();
                        }
                        break;
                    case 'enableAutoFocus':
                        Eif (this.documentEditor) {
                            this.documentEditor.enableAutoFocus = newModel.enableAutoFocus;
                        }
                        break;
                    case 'autoResizeOnVisibilityChange':
                        Eif (this.documentEditor) {
                            this.documentEditor.autoResizeOnVisibilityChange = newModel.autoResizeOnVisibilityChange;
                        }
                        break;
                    case 'backstageMenu':
                        if (this.ribbonModule) {
                            this.ribbonModule.backstageMenu = newModel.backstageMenu;
                            this.ribbonModule.ribbon.refresh();
                        }
                        break;
                    case 'fileMenuItems':
                        if (this.ribbonModule) {
                            this.ribbonModule.fileMenuItems = newModel.fileMenuItems;
                            this.ribbonModule.ribbon.refresh();
                        }
                        break;
                }
            }
        };
        DocumentEditorContainer.prototype.handleToolbarModeChange = function () {
            this.createToolbarContainer(this.enableRtl, true);
            Eif (this.toolbarHandler) {
                this.toolbarHandler.initialize(true);
            }
            Eif (this.documentEditor) {
                this.documentEditor.resize();
            }
        };
        DocumentEditorContainer.prototype.preRender = function () {
            this.localObj = new ej2_base_1.L10n('documenteditorcontainer', this.defaultLocale, this.locale);
            if (!ej2_base_1.isNullOrUndefined(this.element) && this.element.id === '') {
                this.element.id = index_1.HelperMethods.getUniqueElementId();
            }
            this.initContainerElement();
        };
        DocumentEditorContainer.prototype.render = function () {
            if (this.toolbarHandler) {
                this.toolbarHandler.initialize();
            }
            Eif (this.height !== '') {
                this.element.style.height = ej2_base_1.formatUnit(this.height);
            }
            Eif (this.width !== '') {
                this.element.style.width = ej2_base_1.formatUnit(this.width);
            }
            this.element.style.minHeight = '320px';
            this.initializeDocumentEditor();
            Iif (this.restrictEditing) {
                this.restrictEditingToggleHelper(this.restrictEditing);
            }
            if (this.toolbarMode !== 'Ribbon') {
                this.initializePane();
            }
            this.statusBar = new status_bar_1.StatusBar(this.statusBarElement, this);
            ej2_popups_1.createSpinner({ target: this.containerTarget, cssClass: 'e-spin-overlay' });
            this.setserverActionSettings();
            this.renderComplete();
        };
        DocumentEditorContainer.prototype.initializePane = function () {
            if (!this.headerFooterProperties) {
                this.headerFooterProperties = new header_footer_pane_1.HeaderFooterProperties(this, this.enableRtl);
            }
            if (!this.imageProperties) {
                this.imageProperties = new image_properties_pane_1.ImageProperties(this, this.enableRtl);
            }
            if (!this.tocProperties) {
                this.tocProperties = new table_of_content_pane_1.TocProperties(this, this.enableRtl);
            }
            if (!this.tableProperties) {
                this.tableProperties = new table_properties_pane_1.TableProperties(this, this.imageProperties, this.enableRtl);
            }
        };
        DocumentEditorContainer.prototype.destroyPane = function () {
            if (this.headerFooterProperties) {
                this.headerFooterProperties.destroy();
                this.headerFooterProperties = undefined;
            }
            if (this.imageProperties) {
                this.imageProperties.destroy();
                this.imageProperties = undefined;
            }
            if (this.tocProperties) {
                this.tocProperties.destroy();
                this.tocProperties = undefined;
            }
            if (this.tableProperties) {
                this.tableProperties.destroy();
                this.tableProperties = undefined;
            }
            if (this.propertiesPaneContainer) {
                this.propertiesPaneContainer.parentElement.removeChild(this.propertiesPaneContainer);
                this.propertiesPaneContainer = undefined;
            }
        };
        DocumentEditorContainer.prototype.restrictEditingToggleHelper = function (restrictEditing) {
            this.documentEditor.isReadOnly = restrictEditing;
            Eif (this.toolbarHandler) {
                this.toolbarHandler.restrictEditingToggleHelper(restrictEditing);
            }
            Iif (this.showPane && this.toolbarMode !== 'Ribbon') {
                this.showPropertiesPane = !restrictEditing;
                this.showHidePropertiesPane(!restrictEditing);
            }
            this.documentEditor.trackChangesPane.enableDisableButton(!restrictEditing && !this.documentEditor.documentHelper.isDocumentProtected);
        };
        DocumentEditorContainer.prototype.setFormat = function () {
            if (this.characterFormat && this.documentEditor) {
                this.documentEditor.setDefaultCharacterFormat(this.characterFormat);
            }
            if (this.paragraphFormat && this.documentEditor) {
                this.documentEditor.setDefaultParagraphFormat(this.paragraphFormat);
            }
            if (this.sectionFormat && this.documentEditor) {
                this.documentEditor.setDefaultSectionFormat(this.sectionFormat);
            }
        };
        DocumentEditorContainer.prototype.setserverActionSettings = function () {
            if (this.serviceUrl) {
                this.documentEditor.serviceUrl = index_1.HelperMethods.sanitizeString(this.serviceUrl);
            }
            Eif (this.serverActionSettings.spellCheck) {
                this.documentEditor.serverActionSettings.spellCheck = index_1.HelperMethods.sanitizeString(this.serverActionSettings.spellCheck);
            }
            Eif (this.serverActionSettings.spellCheckByPage) {
                this.documentEditor.serverActionSettings.spellCheckByPage = index_1.HelperMethods.sanitizeString(this.serverActionSettings.spellCheckByPage);
            }
            Eif (this.serverActionSettings.restrictEditing) {
                this.documentEditor.serverActionSettings.restrictEditing = index_1.HelperMethods.sanitizeString(this.serverActionSettings.restrictEditing);
            }
            Eif (this.serverActionSettings.systemClipboard) {
                this.documentEditor.serverActionSettings.systemClipboard = index_1.HelperMethods.sanitizeString(this.serverActionSettings.systemClipboard);
            }
            Eif (this.serverActionSettings.import) {
                this.documentEditor.serverActionSettingsImport = index_1.HelperMethods.sanitizeString(this.serverActionSettings.import);
            }
            Eif (this.headers) {
                this.documentEditor.headers = JSON.parse(index_1.HelperMethods.sanitizeString(JSON.stringify(this.headers)));
            }
        };
        DocumentEditorContainer.prototype.customizeDocumentEditorSettings = function () {
            Eif (this.documentEditorSettings.formFieldSettings) {
                var settings = this.documentEditorSettings.formFieldSettings;
                var documentEditor = this.documentEditor;
                Eif (!ej2_base_1.isNullOrUndefined(settings.applyShading)) {
                    documentEditor.documentEditorSettings.formFieldSettings.applyShading = settings.applyShading;
                }
                Eif (!ej2_base_1.isNullOrUndefined(settings.formFillingMode)) {
                    documentEditor.documentEditorSettings.formFieldSettings.formFillingMode = settings.formFillingMode;
                }
                Iif (!ej2_base_1.isNullOrUndefined(settings.formattingExceptions)) {
                    documentEditor.documentEditorSettings.formFieldSettings.formattingExceptions = settings.formattingExceptions;
                }
                Eif (!ej2_base_1.isNullOrUndefined(settings.selectionColor)) {
                    documentEditor.documentEditorSettings.formFieldSettings.selectionColor = settings.selectionColor;
                }
                Eif (!ej2_base_1.isNullOrUndefined(settings.shadingColor)) {
                    documentEditor.documentEditorSettings.formFieldSettings.shadingColor = settings.shadingColor;
                }
            }
            Eif (this.documentEditorSettings.searchHighlightColor) {
                this.documentEditor.documentEditorSettings.searchHighlightColor = index_1.HelperMethods.sanitizeString(this.documentEditorSettings.searchHighlightColor);
            }
            Eif (this.documentEditorSettings.fontFamilies) {
                this.documentEditor.documentEditorSettings.fontFamilies = JSON.parse(index_1.HelperMethods.sanitizeString(JSON.stringify(this.documentEditorSettings.fontFamilies)));
            }
            Eif (this.documentEditorSettings.collaborativeEditingSettings) {
                this.documentEditor.documentEditorSettings.collaborativeEditingSettings = this.documentEditorSettings.collaborativeEditingSettings;
            }
            Eif (this.documentEditorSettings.printDevicePixelRatio) {
                this.documentEditor.documentEditorSettings.printDevicePixelRatio = this.documentEditorSettings.printDevicePixelRatio;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.enableOptimizedTextMeasuring)) {
                this.documentEditor.documentEditorSettings.enableOptimizedTextMeasuring = this.documentEditorSettings.enableOptimizedTextMeasuring;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.maximumRows)) {
                this.documentEditor.documentEditorSettings.maximumRows = this.documentEditorSettings.maximumRows;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.maximumColumns)) {
                this.documentEditor.documentEditorSettings.maximumColumns = this.documentEditorSettings.maximumColumns;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.showHiddenMarks)) {
                this.documentEditor.documentEditorSettings.showHiddenMarks = this.documentEditorSettings.showHiddenMarks;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.showBookmarks)) {
                this.documentEditor.documentEditorSettings.showBookmarks = this.documentEditorSettings.showBookmarks;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.highlightEditableRanges)) {
                this.documentEditor.documentEditorSettings.highlightEditableRanges = this.documentEditorSettings.highlightEditableRanges;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.allowDragAndDrop)) {
                this.documentEditor.documentEditorSettings.allowDragAndDrop = this.documentEditorSettings.allowDragAndDrop;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.optimizeSfdt)) {
                this.documentEditor.documentEditorSettings.optimizeSfdt = this.documentEditorSettings.optimizeSfdt;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.autoResizeSettings)) {
                this.documentEditor.documentEditorSettings.autoResizeSettings = this.documentEditorSettings.autoResizeSettings;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.showRuler)) {
                this.documentEditor.documentEditorSettings.showRuler = this.documentEditorSettings.showRuler;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.colorPickerSettings)) {
                this.documentEditor.documentEditorSettings.colorPickerSettings = this.documentEditorSettings.colorPickerSettings;
            }
            Iif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.popupTarget)) {
                this.documentEditor.documentEditorSettings.popupTarget = this.documentEditorSettings.popupTarget;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.showNavigationPane)) {
                this.documentEditor.documentEditorSettings.showNavigationPane = this.documentEditorSettings.showNavigationPane;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.mentionSettings)) {
                this.documentEditor.documentEditorSettings.mentionSettings = this.documentEditorSettings.mentionSettings;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.pasteAsNewParagraph)) {
                this.documentEditor.documentEditorSettings.pasteAsNewParagraph = this.documentEditorSettings.pasteAsNewParagraph;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings.enableScreenReader)) {
                this.documentEditor.documentEditorSettings.enableScreenReader = this.documentEditorSettings.enableScreenReader;
            }
        };
        DocumentEditorContainer.prototype.getPersistData = function () {
            return 'documenteditor-container';
        };
        DocumentEditorContainer.prototype.requiredModules = function () {
            var modules = [];
            if (this.enableToolbar) {
                if (this.toolbarMode === 'Ribbon') {
                    modules.push({
                        member: 'ribbon', args: [this]
                    });
                }
                else {
                    modules.push({
                        member: 'toolbar', args: [this]
                    });
                }
            }
            return modules;
        };
        DocumentEditorContainer.prototype.initContainerElement = function () {
            var isRtl = this.enableRtl;
            this.containerTarget = this.createElement('div', { className: 'e-de-ctn' });
            this.containerTarget.contentEditable = 'false';
            this.createToolbarContainer(isRtl);
            this.containerTarget.appendChild(this.editorContainer);
            this.statusBarElement = this.createElement('div', { className: 'e-de-status-bar' });
            if (isRtl) {
                this.statusBarElement.style.direction = 'rtl';
            }
            this.containerTarget.appendChild(this.statusBarElement);
            this.element.appendChild(this.containerTarget);
        };
        DocumentEditorContainer.prototype.initializePaneElement = function () {
            if (this.toolbarMode != 'Ribbon' && !this.propertiesPaneContainer) {
                var propertiesPaneContainerBorder = void 0;
                if (!this.enableRtl) {
                    propertiesPaneContainerBorder = 'e-de-pane';
                }
                else {
                    propertiesPaneContainerBorder = 'e-de-pane-rtl';
                }
                this.propertiesPaneContainer = this.createElement('div', { className: propertiesPaneContainerBorder, styles: 'display:none' });
                this.editorContainer.appendChild(this.propertiesPaneContainer);
            }
        };
        DocumentEditorContainer.prototype.createToolbarContainer = function (isRtl, isCustom) {
            var _a, _b;
            if (ej2_base_1.isNullOrUndefined((this.editorContainer))) {
                this.editorContainer = this.createElement('div', { className: 'e-de-tool-ctnr-properties-pane' + (isRtl ? ' e-de-ctnr-rtl' : '') });
            }
            if (this.enableToolbar) {
                (_a = this.editorContainer.classList).remove.apply(_a, ['e-de-tool-ctnr-properties-pane', 'e-de-ribbon-simplified-ctnr-properties-pane', 'e-de-ribbon-classic-ctnr-properties-pane']);
                if (this.toolbarMode === 'Ribbon') {
                    this.ribbonContainer = this.createElement('div', {
                        className: 'e-de-ctnr-ribbon' + (isRtl ? ' e-de-ctnr-rtl' : '')
                    });
                    Iif (isCustom) {
                        this.containerTarget.insertBefore(this.ribbonContainer, this.containerTarget.firstChild);
                    }
                    else {
                        this.containerTarget.appendChild(this.ribbonContainer);
                    }
                    if (this.ribbonLayout === 'Simplified') {
                        this.editorContainer.classList.add('e-de-ribbon-simplified-ctnr-properties-pane');
                    }
                    else {
                        this.editorContainer.classList.add('e-de-ribbon-classic-ctnr-properties-pane');
                    }
                }
                else {
                    this.toolbarContainer = this.createElement('div', {
                        className: 'e-de-ctnr-toolbar' + (isRtl ? ' e-de-ctnr-rtl' : '')
                    });
                    if (isCustom) {
                        this.containerTarget.insertBefore(this.toolbarContainer, this.containerTarget.firstChild);
                    }
                    else {
                        this.containerTarget.appendChild(this.toolbarContainer);
                    }
                    this.editorContainer.classList.add('e-de-tool-ctnr-properties-pane');
                }
                this.editorContainer.classList.remove('e-de-ctnr-properties-pane');
            }
            else {
                (_b = this.editorContainer.classList).remove.apply(_b, ['e-de-tool-ctnr-properties-pane', 'e-de-ribbon-simplified-ctnr-properties-pane', 'e-de-ribbon-classic-ctnr-properties-pane']);
                this.editorContainer.classList.add('e-de-ctnr-properties-pane');
            }
            this.initializePaneElement();
        };
        DocumentEditorContainer.prototype.initializeDocumentEditor = function () {
            var id = this.element.id + '_editor';
            var documentEditorTarget = this.createElement('div', { id: id, styles: 'width:100%;height:100%' });
            this.documentEditorInternal = new document_editor_1.DocumentEditor({
                isReadOnly: false, enableRtl: this.enableRtl,
                selectionChange: this.onSelectionChange.bind(this),
                contentChange: this.onContentChange.bind(this),
                documentChange: this.onDocumentChange.bind(this),
                requestNavigate: this.onRequestNavigate.bind(this),
                viewChange: this.onViewChange.bind(this),
                customContextMenuSelect: this.onCustomContextMenuSelect.bind(this),
                customContextMenuBeforeOpen: this.onCustomContextMenuBeforeOpen.bind(this),
                beforePaneSwitch: this.onBeforePaneSwitch.bind(this),
                commentBegin: this.onCommentBegin.bind(this),
                commentEnd: this.onCommentEnd.bind(this),
                commentDelete: this.onCommentDelete.bind(this),
                beforeAcceptRejectChanges: this.onBeforeAcceptRejectChanges.bind(this),
                beforeCommentAction: this.onCommentAction.bind(this),
                trackChange: this.onTrackChange.bind(this),
                serviceFailure: this.fireServiceFailure.bind(this),
                beforeXmlHttpRequestSend: this.beforeXmlHttpSend.bind(this),
                locale: this.locale,
                acceptTab: true,
                zIndex: this.zIndex,
                enableLocalPaste: this.enableLocalPaste,
                layoutType: this.layoutType,
                pageOutline: '#E0E0E0',
                currentUser: this.currentUser,
                userColor: this.userColor,
                height: '100%',
                width: '100%',
                enableTrackChanges: this.enableTrackChanges,
                showRevisions: true,
                showComments: true,
                enableLockAndEdit: this.enableLockAndEdit,
                enableAutoFocus: this.enableAutoFocus
            });
            this.wireEvents();
            this.customizeDocumentEditorSettings();
            this.documentEditor.enableAllModules();
            this.documentEditor.enableComment = this.enableComment;
            this.showPane = this.showPropertiesPane;
            this.editorContainer.insertBefore(documentEditorTarget, this.editorContainer.firstChild);
            this.setFormat();
            this.documentEditor.appendTo(documentEditorTarget);
            this.documentEditor.resize();
        };
        DocumentEditorContainer.prototype.wireEvents = function () {
            window.addEventListener('resize', this.onWindowResize.bind(this));
            this.documentEditor.on(constants_1.internalZoomFactorChange, this.onZoomFactorChange, this);
            this.documentEditor.on(constants_1.internalviewChangeEvent, this.onViewChange, this);
            this.documentEditor.on(constants_1.protectionTypeChangeEvent, this.onProtectionChange, this);
            this.documentEditor.on(constants_1.internalDocumentEditorSettingsChange, this.updateShowHiddenMarks, this);
            this.documentEditor.on(constants_1.internalStyleCollectionChange, this.updateStyleCollection, this);
            this.documentEditor.on(constants_1.internalAutoResize, this.triggerAutoResize, this);
            this.documentEditor.on(constants_1.beforeAutoResize, this.onBeforeAutoResize, this);
            this.documentEditor.on(constants_1.trackChanges, this.onEnableTrackChanges, this);
            this.documentEditor.on(constants_1.internalOptionPaneChange, this.onOptionPaneChange, this);
        };
        DocumentEditorContainer.prototype.onWindowResize = function () {
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditor)) {
                this.documentEditor.isContainerResize = true;
                this.resize();
            }
        };
        DocumentEditorContainer.prototype.onOptionPaneChange = function (args) {
            if (this.toolbarMode === 'Ribbon' && this.ribbonModule) {
                this.ribbonModule.tabManager.viewTab.onSelectionChange();
            }
        };
        DocumentEditorContainer.prototype.onEnableTrackChanges = function (model) {
            Iif (model.enableTrackChanges !== this.enableTrackChanges) {
                this.enableTrackChanges = model.enableTrackChanges;
            }
        };
        DocumentEditorContainer.prototype.triggerAutoResize = function (args) {
            args.cancel = true;
            this.resize();
        };
        DocumentEditorContainer.prototype.onBeforeAutoResize = function (args) {
            args.element = this.element;
        };
        DocumentEditorContainer.prototype.unWireEvents = function () {
            Iif (ej2_base_1.isNullOrUndefined(this.documentEditor)) {
                return;
            }
            else {
                Iif (this.documentEditor.isDestroyed) {
                    return;
                }
            }
            this.documentEditor.off(constants_1.internalZoomFactorChange, this.onZoomFactorChange);
            this.documentEditor.off(constants_1.internalviewChangeEvent, this.onViewChange);
            this.documentEditor.off(constants_1.protectionTypeChangeEvent, this.onProtectionChange);
            this.documentEditor.off(constants_1.internalDocumentEditorSettingsChange, this.updateShowHiddenMarks);
            this.documentEditor.off(constants_1.internalStyleCollectionChange, this.updateStyleCollection);
        };
        DocumentEditorContainer.prototype.onCommentBegin = function () {
            Eif (this.toolbarHandler) {
                this.toolbarHandler.enableDisableInsertComment(false);
            }
        };
        DocumentEditorContainer.prototype.onCommentEnd = function () {
            if (this.toolbarHandler) {
                this.toolbarHandler.enableDisableInsertComment(true && this.enableComment);
            }
        };
        DocumentEditorContainer.prototype.beforeXmlHttpSend = function (args) {
            this.trigger(constants_1.beforeXmlHttpRequestSend, args);
        };
        DocumentEditorContainer.prototype.onCommentDelete = function (args) {
            this.trigger(constants_1.commentDeleteEvent, args);
        };
        DocumentEditorContainer.prototype.onBeforeAcceptRejectChanges = function (args) {
            this.trigger(constants_1.revisionActionEvent, args);
        };
        DocumentEditorContainer.prototype.onCommentAction = function (args) {
            this.trigger(constants_1.beforeCommentActionEvent, args);
        };
        DocumentEditorContainer.prototype.onTrackChange = function (args) {
            this.trigger(constants_1.trackChangeEvent, args);
            if (this.toolbarHandler) {
                this.toolbarHandler.toggleTrackChanges(args.isTrackChangesEnabled);
            }
        };
        DocumentEditorContainer.prototype.onBeforePaneSwitch = function (args) {
            this.trigger(constants_1.beforePaneSwitchEvent, args);
        };
        DocumentEditorContainer.prototype.fireServiceFailure = function (eventArgs) {
            this.trigger(constants_1.serviceFailureEvent, eventArgs);
        };
        DocumentEditorContainer.prototype.showHidePropertiesPane = function (show) {
            if (this.showPropertiesPane) {
                this.showPropertiesPaneOnSelection();
            }
            Eif (this.propertiesPaneContainer) {
                this.propertiesPaneContainer.style.display = show ? 'block' : 'none';
            }
            Eif (this.toolbarModule) {
                this.toolbarModule.propertiesPaneButton.element.style.opacity = show ? '1' : '0.5';
            }
            this.documentEditor.resize();
        };
        DocumentEditorContainer.prototype.updateStyleCollection = function () {
            if (!ej2_base_1.isNullOrUndefined(this.tableProperties) && !ej2_base_1.isNullOrUndefined(this.tableProperties.tableTextProperties) && !ej2_base_1.isNullOrUndefined(this.tableProperties.tableTextProperties.paragraph)) {
                this.tableProperties.tableTextProperties.paragraph.updateStyleNames();
            }
            if (this.toolbarMode == 'Ribbon' && this.ribbon) {
                this.ribbon.tabManager.homeTab.updateStyleGallery();
            }
        };
        DocumentEditorContainer.prototype.resize = function (width, height) {
            Eif (this.element) {
                if (!this.documentEditor.isContainerResize) {
                    Eif (ej2_base_1.isNullOrUndefined(height) && this.element && this.element.parentElement) {
                        height = this.element.parentElement.clientHeight;
                    }
                    Eif (ej2_base_1.isNullOrUndefined(width) && this.element && this.element.parentElement) {
                        width = this.element.parentElement.clientWidth;
                    }
                    Eif (!ej2_base_1.isNullOrUndefined(width) && width > 200) {
                        this.width = width.toString();
                        this.element.style.width = width + 'px';
                    }
                    Eif (!ej2_base_1.isNullOrUndefined(height) && height > 200) {
                        this.height = height.toString();
                        this.element.style.height = height + 'px';
                    }
                }
                Eif (this.documentEditor) {
                    this.documentEditor.resize();
                }
                Eif (this.toolbarModule) {
                    this.toolbarModule.toolbar.refreshOverflow();
                }
                Eif (this.showPropertiesPane && this.tableProperties) {
                    this.tableProperties.updateTabContainerHeight();
                }
            }
        };
        DocumentEditorContainer.prototype.refreshFontFamilies = function (fontFamilies) {
            if (!ej2_base_1.isNullOrUndefined(this.tableProperties) && !ej2_base_1.isNullOrUndefined(this.tableProperties.tableTextProperties) && !ej2_base_1.isNullOrUndefined(this.tableProperties.tableTextProperties.text)) {
                var text = this.tableProperties.tableTextProperties.text;
                text.fontFamily.refresh();
                for (var i = 0; i < fontFamilies.length; i++) {
                    var fontValue = fontFamilies[i];
                    var fontStyleValue = { 'FontName': fontValue, 'FontValue': fontValue };
                    text.fontFamily.addItem(fontStyleValue, i);
                }
            }
        };
        DocumentEditorContainer.prototype.onContentChange = function (args) {
            Eif (this.toolbarHandler) {
                this.toolbarHandler.onContentChange();
            }
            Eif (this.statusBar) {
                this.statusBar.updatePageCount();
            }
            var eventArgs = { source: this, operations: args.operations };
            this.trigger(constants_1.contentChangeEvent, eventArgs);
        };
        DocumentEditorContainer.prototype.onDocumentChange = function () {
            this.enableTrackChanges = this.documentEditor.enableTrackChanges;
            Eif (!ej2_base_1.isNullOrUndefined(this.documentSettings) && !ej2_base_1.isNullOrUndefined(this.documentEditor)
                && !ej2_base_1.isNullOrUndefined(this.documentEditor.documentSettings)) {
                this.documentSettings.compatibilityMode = this.documentEditor.documentSettings.compatibilityMode;
            }
            Eif (!ej2_base_1.isNullOrUndefined(this.documentEditorSettings) && !ej2_base_1.isNullOrUndefined(this.documentEditorSettings.fontFamilies)) {
                var fontFamilyValue = this.documentEditorSettings.fontFamilies;
                this.refreshFontFamilies(fontFamilyValue);
            }
            if (this.toolbarHandler) {
                this.toolbarHandler.onDocumentChange();
            }
            if (this.statusBar) {
                this.statusBar.updatePageCount();
            }
            var eventArgs = { source: this };
            this.trigger(constants_1.documentChangeEvent, eventArgs);
            this.updateStyleCollection();
        };
        DocumentEditorContainer.prototype.onSelectionChange = function () {
            var _this = this;
            setTimeout(function () {
                if (!ej2_base_1.isNullOrUndefined(_this.documentEditor)) {
                    _this.showPropertiesPaneOnSelection();
                    if (_this.ribbonModule) {
                        _this.ribbonModule.updateRibbonState();
                    }
                    var eventArgs = { source: _this, isCompleted: _this.documentEditor.documentHelper.isSelectionCompleted };
                    _this.trigger(constants_1.selectionChangeEvent, eventArgs);
                    _this.documentEditor.documentHelper.isSelectionCompleted = true;
                }
            });
        };
        DocumentEditorContainer.prototype.onZoomFactorChange = function () {
            Eif (this.statusBar) {
                this.statusBar.updateZoomContent();
            }
            if (this.toolbarMode === 'Ribbon' && this.ribbonModule) {
                this.ribbonModule.onZoomFactorChange();
            }
        };
        DocumentEditorContainer.prototype.onProtectionChange = function () {
            if (this.toolbarMode == 'Ribbon') {
                this.ribbon.stateManager.updateRibbonState(this.ribbon.ribbon);
            }
            else {
                this.showPropertiesPaneOnSelection();
            }
        };
        DocumentEditorContainer.prototype.updateShowHiddenMarks = function (settings) {
            this.documentEditorSettings.showHiddenMarks = settings.showHiddenMarks;
            this.tableProperties.tableTextProperties.paragraph.toggleHiddenMarks();
        };
        DocumentEditorContainer.prototype.onRequestNavigate = function (args) {
            if (args.linkType !== 'Bookmark') {
                var navLink = args.navigationLink;
                var link = ej2_base_3.SanitizeHtmlHelper.sanitize(navLink);
                if (args.localReference.length > 0) {
                    link += '#' + args.localReference;
                }
                if (navLink.substring(0, 8) === 'file:///'
                    || (navLink.substring(0, 7) === 'http://' && navLink.length > 7)
                    || (navLink.substring(0, 8) === 'https://' && navLink.length > 8)
                    || (navLink.substring(0, 4) === 'www.' && navLink.length > 4)
                    || (navLink.substring(0, 7) === 'mailto:' && navLink.length > 7)) {
                    window.open(link);
                }
                else {
                    ej2_popups_2.DialogUtility.alert({
                        title: this.localObj.getConstant("Information"),
                        content: this.localObj.getConstant("The address of this site is not valid. Check the address and try again."),
                        okButton: { text: this.localObj.getConstant("OK") },
                        closeOnEscape: true,
                    });
                }
                args.isHandled = true;
            }
        };
        DocumentEditorContainer.prototype.onViewChange = function (args) {
            Eif (this.statusBar) {
                this.statusBar.updatePageNumberOnViewChange(args);
            }
        };
        DocumentEditorContainer.prototype.onCustomContextMenuSelect = function (args) {
            this.trigger(constants_1.customContextMenuSelectEvent, args);
        };
        DocumentEditorContainer.prototype.onCustomContextMenuBeforeOpen = function (args) {
            this.trigger(constants_1.customContextMenuBeforeOpenEvent, args);
        };
        DocumentEditorContainer.prototype.showPropertiesPaneOnSelection = function () {
            if (((this.restrictEditing) && !this.showPropertiesPane) || ej2_base_1.isNullOrUndefined(this.tableProperties)) {
                return;
            }
            var isProtectedDocument = this.documentEditor.documentHelper.protectionType !== 'NoProtection';
            var allowFormatting = isProtectedDocument && this.documentEditor.documentHelper.restrictFormatting;
            var isSelectionInProtectecRegion = this.documentEditor.editorModule.restrictEditing;
            Iif (isProtectedDocument) {
                if (this.toolbarModule) {
                    this.toolbarModule.enableDisableToolBarItem(!isSelectionInProtectecRegion, true);
                }
                this.tableProperties.enableDisableElements(!allowFormatting && !isSelectionInProtectecRegion);
                this.tocProperties.enableDisableElements(!isSelectionInProtectecRegion);
                this.headerFooterProperties.enableDisableElements(!isSelectionInProtectecRegion);
                this.imageProperties.enableDisableElements(!isSelectionInProtectecRegion);
            }
            else {
                var isReadOnly = !this.documentEditor.isReadOnly;
                if (this.toolbarModule) {
                    this.toolbarModule.enableDisableToolBarItem(isReadOnly, true || this.showPropertiesPane);
                }
                this.tableProperties.enableDisableElements(true);
                this.tocProperties.enableDisableElements(true);
                this.headerFooterProperties.enableDisableElements(true);
                this.imageProperties.enableDisableElements(true);
            }
            var currentContext = this.documentEditor.selectionModule.contextType;
            var isInHeaderFooter = currentContext.indexOf('Header') >= 0
                || currentContext.indexOf('Footer') >= 0;
            Eif (!isInHeaderFooter) {
                this.showHeaderProperties = true;
            }
            if (!this.showPropertiesPane) {
                this.showHidePropertiesPane(false);
                this.propertiesPaneContainer.style.display = 'none';
            }
            else {
                this.propertiesPaneContainer.style.display = 'block';
                Iif (isInHeaderFooter && this.showHeaderProperties) {
                    this.showProperties('headerfooter');
                }
                else if ((currentContext.indexOf('List') >= 0 || currentContext.indexOf('Text') >= 0
                    && currentContext.indexOf('Table') < 0)) {
                    this.showProperties('text');
                }
                else if (currentContext.indexOf('Image') >= 0) {
                    this.showProperties('image');
                }
                else Iif (currentContext.indexOf('TableOfContents') >= 0) {
                    this.showProperties('toc');
                }
                else Eif (currentContext.indexOf('Table') >= 0) {
                    this.showProperties('table');
                }
            }
            this.previousContext = this.documentEditor.selectionModule.contextType;
            if (this.toolbarHandler) {
                this.toolbarModule.enableDisableInsertComment(!this.documentEditor.enableHeaderAndFooter && this.enableComment && !this.documentEditor.isReadOnlyMode && !this.documentEditor.selectionModule.isinFootnote && !this.documentEditor.selectionModule.isinEndnote &&
                    !this.documentEditor.selectionModule.isPlainContentControl());
            }
        };
        DocumentEditorContainer.prototype.showProperties = function (property) {
            if (this.toolbarModule && property !== 'headerfooter' && property !== 'toc') {
                this.toolbarModule.enableDisablePropertyPaneButton(true);
            }
            this.tableProperties.showTableProperties((property === 'table' || property === 'text'), property);
            this.imageProperties.showImageProperties(property === 'image');
            this.headerFooterProperties.showHeaderFooterPane(property === 'headerfooter');
            this.tocProperties.showTocPane(property === 'toc');
        };
        DocumentEditorContainer.prototype.setDefaultCharacterFormat = function (characterFormat) {
            this.characterFormat = characterFormat;
            this.setFormat();
        };
        DocumentEditorContainer.prototype.setDefaultParagraphFormat = function (paragraphFormat) {
            this.paragraphFormat = paragraphFormat;
            this.setFormat();
        };
        DocumentEditorContainer.prototype.setDefaultSectionFormat = function (sectionFormat) {
            this.sectionFormat = sectionFormat;
            this.setFormat();
        };
        DocumentEditorContainer.prototype.destroy = function () {
            _super.prototype.destroy.call(this);
            if (this.element) {
                if (!this.refreshing) {
                    this.element.classList.remove('e-documenteditorcontainer');
                }
                this.element.innerHTML = '';
            }
            if (!this.refreshing) {
                this.element = undefined;
                this.paragraphFormat = undefined;
                this.sectionFormat = undefined;
                this.characterFormat = undefined;
            }
            Iif (this.toolbarContainer && this.toolbarContainer.parentElement) {
                this.toolbarContainer.innerHTML = '';
                this.toolbarContainer.parentElement.removeChild(this.toolbarContainer);
            }
            this.toolbarContainer = undefined;
            if (this.documentEditorInternal) {
                this.unWireEvents();
                this.documentEditorInternal.destroy();
                this.documentEditorInternal = undefined;
            }
            if (this.headerFooterProperties) {
                this.headerFooterProperties.destroy();
            }
            this.headerFooterProperties = undefined;
            if (this.imageProperties) {
                this.imageProperties.destroy();
            }
            this.imageProperties = undefined;
            if (this.tocProperties) {
                this.tocProperties.destroy();
            }
            this.tocProperties = undefined;
            if (this.tableProperties) {
                this.tableProperties.destroy();
            }
            this.tableProperties = undefined;
            if (this.statusBar) {
                this.statusBar.destroy();
            }
            if (this.propertiesPaneContainer && this.propertiesPaneContainer.parentElement) {
                this.propertiesPaneContainer.remove();
            }
            this.propertiesPaneContainer = undefined;
            if (this.editorContainer && this.editorContainer.parentElement) {
                this.editorContainer.innerHTML = '';
                this.editorContainer.parentElement.removeChild(this.editorContainer);
            }
            Iif (this.statusBarElement && this.statusBarElement.parentElement) {
                this.statusBarElement.innerHTML = '';
                this.statusBarElement.parentElement.removeChild(this.statusBarElement);
            }
            Iif (this.containerTarget && this.containerTarget.parentElement) {
                this.containerTarget.innerHTML = '';
                this.containerTarget.parentElement.removeChild(this.containerTarget);
            }
            this.containerTarget = undefined;
            this.statusBarElement = undefined;
            this.editorContainer = undefined;
            this.statusBar = undefined;
            this.previousContext = undefined;
        };
        __decorate([
            ej2_base_1.Property(true)
        ], DocumentEditorContainer.prototype, "showPropertiesPane", void 0);
        __decorate([
            ej2_base_1.Property(true)
        ], DocumentEditorContainer.prototype, "enableToolbar", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], DocumentEditorContainer.prototype, "restrictEditing", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], DocumentEditorContainer.prototype, "enableSpellCheck", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], DocumentEditorContainer.prototype, "enableTrackChanges", void 0);
        __decorate([
            ej2_base_1.Property('Pages')
        ], DocumentEditorContainer.prototype, "layoutType", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], DocumentEditorContainer.prototype, "currentUser", void 0);
        __decorate([
            ej2_base_1.Property('#FFFF00')
        ], DocumentEditorContainer.prototype, "userColor", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], DocumentEditorContainer.prototype, "enableLocalPaste", void 0);
        __decorate([
            ej2_base_1.Property()
        ], DocumentEditorContainer.prototype, "serviceUrl", void 0);
        __decorate([
            ej2_base_1.Property(2000)
        ], DocumentEditorContainer.prototype, "zIndex", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], DocumentEditorContainer.prototype, "enableCsp", void 0);
        __decorate([
            ej2_base_1.Property(true)
        ], DocumentEditorContainer.prototype, "enableComment", void 0);
        __decorate([
            ej2_base_1.Property('100%')
        ], DocumentEditorContainer.prototype, "width", void 0);
        __decorate([
            ej2_base_1.Property('320px')
        ], DocumentEditorContainer.prototype, "height", void 0);
        __decorate([
            ej2_base_1.Property(true)
        ], DocumentEditorContainer.prototype, "enableAutoFocus", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], DocumentEditorContainer.prototype, "enableLockAndEdit", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], DocumentEditorContainer.prototype, "autoResizeOnVisibilityChange", void 0);
        __decorate([
            ej2_base_1.Property('Toolbar')
        ], DocumentEditorContainer.prototype, "toolbarMode", void 0);
        __decorate([
            ej2_base_1.Property('Simplified')
        ], DocumentEditorContainer.prototype, "ribbonLayout", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "created", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "destroyed", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "contentChange", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "selectionChange", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "documentChange", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "toolbarClick", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "fileMenuItemClick", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "customContextMenuSelect", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "customContextMenuBeforeOpen", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "beforePaneSwitch", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "commentDelete", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "beforeAcceptRejectChanges", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "beforeCommentAction", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "serviceFailure", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "trackChange", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "contentControl", void 0);
        __decorate([
            ej2_base_2.Event()
        ], DocumentEditorContainer.prototype, "beforeXmlHttpRequestSend", void 0);
        __decorate([
            ej2_base_1.Complex({}, document_editor_1.DocumentEditorSettings)
        ], DocumentEditorContainer.prototype, "documentEditorSettings", void 0);
        __decorate([
            ej2_base_1.Complex({}, document_editor_1.DocumentSettings)
        ], DocumentEditorContainer.prototype, "documentSettings", void 0);
        __decorate([
            ej2_base_1.Property({ import: 'Import', systemClipboard: 'SystemClipboard', spellCheck: 'SpellCheck', spellCheckByPage: 'SpellCheckByPage', restrictEditing: 'RestrictEditing', canLock: 'CanLock', getPendingActions: 'GetPendingActions' })
        ], DocumentEditorContainer.prototype, "serverActionSettings", void 0);
        __decorate([
            ej2_base_1.Property(['New', 'Open', 'Separator', 'Undo', 'Redo', 'Separator', 'Image', 'Table', 'Hyperlink', 'Bookmark', 'TableOfContents', 'Separator', 'Header', 'Footer', 'PageSetup', 'PageNumber', 'Break', 'InsertFootnote', 'InsertEndnote', 'Separator', 'Find', 'Separator', 'Comments', 'TrackChanges', 'Separator', 'LocalClipboard', 'RestrictEditing', 'Separator', 'FormFields', 'UpdateFields', 'ContentControl', 'XML Mapping'])
        ], DocumentEditorContainer.prototype, "toolbarItems", void 0);
        __decorate([
            ej2_base_1.Property([])
        ], DocumentEditorContainer.prototype, "headers", void 0);
        __decorate([
            ej2_base_1.Property(['New', 'Open', 'Export', 'Print'])
        ], DocumentEditorContainer.prototype, "fileMenuItems", void 0);
        __decorate([
            ej2_base_1.Property(undefined)
        ], DocumentEditorContainer.prototype, "backstageMenu", void 0);
        DocumentEditorContainer = __decorate([
            ej2_base_1.NotifyPropertyChanges
        ], DocumentEditorContainer);
        return DocumentEditorContainer;
    }(ej2_base_1.Component));
    exports.DocumentEditorContainer = DocumentEditorContainer;
});