all files / document-editor/implementation/dialogs/ content-control-properties-dialog.js

76.88% Statements 306/398
61.18% Branches 93/152
44% Functions 11/25
76.88% Lines 306/398
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   144× 144× 144× 144× 144× 144× 144× 144×                       144×                                 144×     144×                                                                         144×                                                               144×         144×         144×     144×   14486×                                                                                                                                                                     197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197× 197× 197× 197× 197×         197×   197×   197×     197×       197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×   197×          
define(["require", "exports", "@syncfusion/ej2-lists", "@syncfusion/ej2-buttons", "@syncfusion/ej2-base", "../viewer/page", "@syncfusion/ej2-inputs"], function (require, exports, ej2_lists_1, ej2_buttons_1, ej2_base_1, page_1, ej2_inputs_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var ContentControlPropertiesDialog = (function () {
        function ContentControlPropertiesDialog(documentHelper) {
            var _this = this;
            this.colorPicker = undefined;
            this.fontColor = undefined;
            this.keyUpOnTextBoxClickHandler = this.onKeyUpOnTextBoxClicked.bind(this);
            this.setButtonClickHandler = this.onSetButtonClick.bind(this);
            this.clearButtonClickHandler = this.onClearButtonClick.bind(this);
            this.characterFormat = undefined;
            this.clearButtonClick = function (args) {
                _this.textBoxInput.value = '';
                _this.valueBoxInput.value = '';
                for (var i = 0; i < _this.convertedItems.length; i++) {
                    if (_this.convertedItems[parseInt(i.toString(), 10)].value === _this.currentSelectedItem) {
                        _this.currentContentControl.contentControlProperties.contentControlListItems.splice(i, 1);
                        _this.convertedItems.splice(i, 1);
                    }
                }
                _this.listviewInstance.dataSource = _this.convertedItems.slice();
                _this.listviewInstance.dataBind();
            };
            this.setButtonClick = function (args) {
                if (!ej2_base_1.isNullOrUndefined(_this.textBoxInput.value) ||
                    !ej2_base_1.isNullOrUndefined(_this.valueBoxInput.value)) {
                    var newItem = new page_1.ContentControlListItems();
                    newItem.displayText = _this.textBoxInput.value ? _this.textBoxInput.value : '';
                    newItem.value = _this.valueBoxInput.value ? _this.valueBoxInput.value : '';
                    _this.currentContentControl.contentControlProperties.contentControlListItems.push(newItem);
                    var convertedItem = {
                        displayText: newItem.displayText,
                        value: newItem.value
                    };
                    _this.convertedItems.push(convertedItem);
                    _this.listviewInstance.addItem([convertedItem]);
                }
                _this.textBoxInput.value = '';
                _this.valueBoxInput.value = '';
            };
            this.onKeyUpOnTextBox = function () {
                _this.enableOrDisableButton();
            };
            this.loadPropertiesdialog = function () {
                _this.currentContentControl = _this.documentHelper.owner.editor.getContentControl();
                Iif (!ej2_base_1.isNullOrUndefined(_this.currentContentControl)) {
                    _this.contentEditedCheckBox.checked = _this.currentContentControl.contentControlProperties.lockContents;
                    _this.contentDeletedCheckBox.checked = _this.currentContentControl.contentControlProperties.lockContentControl;
                    _this.removeCheckBox.checked = _this.currentContentControl.contentControlProperties.isTemporary;
                    _this.multilineCheckBox.checked = _this.currentContentControl.contentControlProperties.multiline;
                    _this.colorPicker.value = _this.currentContentControl.contentControlProperties.color;
                    if (_this.removeCheckBox.checked) {
                        _this.contentEditedCheckBox.checked = false;
                    }
                    _this.titleText.value = _this.currentContentControl.contentControlProperties.title ? _this.currentContentControl.contentControlProperties.title : '';
                    _this.tagText.value = _this.currentContentControl.contentControlProperties.tag ? _this.currentContentControl.contentControlProperties.tag : '';
                    _this.fontColor = _this.currentContentControl.contentControlProperties.color;
                    if (_this.currentContentControl.contentControlProperties.type === 'Text') {
                        _this.plainTextPropertiesDiv.style.display = 'block';
                    }
                    else {
                        _this.plainTextPropertiesDiv.style.display = 'none';
                    }
                    if (_this.currentContentControl.contentControlProperties.type === 'ComboBox' || _this.currentContentControl.contentControlProperties.type === 'DropDownList') {
                        _this.dropDownPropertiesDiv.style.display = 'block';
                    }
                    else {
                        _this.dropDownPropertiesDiv.style.display = 'none';
                    }
                    if (!ej2_base_1.isNullOrUndefined(_this.currentContentControl.contentControlProperties.contentControlListItems !== undefined)) {
                        _this.convertedItems = _this.currentContentControl.contentControlProperties.contentControlListItems.map(function (item) {
                            var convertedItem = {};
                            for (var prop in item) {
                                convertedItem["" + prop] = item["" + prop];
                            }
                            return convertedItem;
                        });
                        _this.listviewInstance.dataSource = _this.convertedItems;
                        _this.listviewInstance.dataBind();
                    }
                }
                _this.documentHelper.updateFocus();
            };
            this.applyProperties = function () {
                if (!ej2_base_1.isNullOrUndefined(_this.fontColor)) {
                    _this.currentContentControl.contentControlProperties.color = _this.fontColor;
                }
                var contentControlImage = _this.documentHelper.owner.getImageContentControl();
                if ((contentControlImage instanceof page_1.ContentControl && contentControlImage.contentControlProperties.type == 'Picture')) {
                    contentControlImage.contentControlProperties.lockContents = _this.contentEditedCheckBox.checked;
                    contentControlImage.contentControlProperties.lockContentControl = _this.contentDeletedCheckBox.checked;
                    contentControlImage.contentControlProperties.isTemporary = _this.removeCheckBox.checked;
                    if (_this.removeCheckBox.checked) {
                        contentControlImage.contentControlProperties.lockContents = false;
                    }
                    contentControlImage.contentControlProperties.title = _this.titleText.value !== undefined ? _this.titleText.value : '';
                    contentControlImage.contentControlProperties.tag = _this.tagText.value !== undefined ? _this.tagText.value : '';
                    contentControlImage.contentControlProperties.multiline = _this.multilineCheckBox.checked;
                }
                if (!ej2_base_1.isNullOrUndefined(_this.currentContentControl)) {
                    _this.currentContentControl.contentControlProperties.lockContents = _this.contentEditedCheckBox.checked;
                    _this.currentContentControl.contentControlProperties.lockContentControl = _this.contentDeletedCheckBox.checked;
                    _this.currentContentControl.contentControlProperties.isTemporary = _this.removeCheckBox.checked;
                    if (_this.removeCheckBox.checked) {
                        _this.currentContentControl.contentControlProperties.lockContents = false;
                    }
                    _this.currentContentControl.contentControlProperties.title = _this.titleText.value !== undefined ? _this.titleText.value : '';
                    _this.currentContentControl.contentControlProperties.tag = _this.tagText.value !== undefined ? _this.tagText.value : '';
                    _this.currentContentControl.contentControlProperties.multiline = _this.multilineCheckBox.checked;
                }
                _this.unWireEventsAndBindings();
                _this.documentHelper.dialog.hide();
                _this.documentHelper.viewer.updateScrollBars();
                _this.documentHelper.updateFocus();
            };
            this.closePropertiesDialog = function () {
                _this.documentHelper.dialog.hide();
                _this.unWireEventsAndBindings();
                _this.documentHelper.updateFocus();
            };
            this.fontColorUpdate = function (args) {
                if (!ej2_base_1.isNullOrUndefined(args.currentValue)) {
                    _this.fontColor = args.currentValue.hex;
                }
            };
            this.selectHandler = function (args) {
                _this.currentSelectedItem = args.text;
            };
            this.documentHelper = documentHelper;
        }
        ContentControlPropertiesDialog.prototype.getModuleName = function () {
            return 'ContentControlPropertiesDialog';
        };
        ContentControlPropertiesDialog.prototype.createInputElement = function (type, id, className) {
            var element = ej2_base_1.createElement('input', {
                attrs: { type: type },
                id: id,
                className: className
            });
            return element;
        };
        ContentControlPropertiesDialog.prototype.initContentControlPropertiesDialog = function (localeValue, enableRtl) {
            var _this = this;
            this.target = ej2_base_1.createElement('div', { className: 'e-de-hyperlink' });
            this.container = ej2_base_1.createElement('div');
            this.generalDiv = ej2_base_1.createElement('div');
            this.genLabel = ej2_base_1.createElement('div', { className: 'e-de-para-dlg-heading', innerHTML: localeValue.getConstant('General') });
            this.generalDiv.appendChild(this.genLabel);
            this.displayText = ej2_base_1.createElement('div', { className: 'e-de-dlg-container' });
            this.titleText = ej2_base_1.createElement('input', { className: 'e-input' });
            this.displayText.appendChild(this.titleText);
            this.generalDiv.appendChild(this.displayText);
            this.tagText = ej2_base_1.createElement('input', { className: 'e-input' });
            this.generalDiv.appendChild(this.tagText);
            this.colorDiv = ej2_base_1.createElement('div', { className: 'e-de-container-row' });
            this.colorDiv.style.paddingTop = '10px';
            this.fontColorDiv = ej2_base_1.createElement('div', { className: 'e-de-font-dlg-display' });
            this.fontColorLabel = ej2_base_1.createElement('label', {
                className: 'e-de-font-dlg-header-font-color e-de-font-color-margin',
                innerHTML: localeValue.getConstant('Color')
            });
            this.fontColorDiv.appendChild(this.fontColorLabel);
            this.fontColorElement = this.createInputElement('color', this.target.id + '_ColorDiv', 'e-de-font-dlg-color');
            this.fontColorDiv.appendChild(this.fontColorElement);
            this.colorDiv.appendChild(this.fontColorDiv);
            this.generalDiv.appendChild(this.colorDiv);
            var _a = this.documentHelper.owner.documentEditorSettings.colorPickerSettings, columns = _a.columns, createPopupOnClick = _a.createPopupOnClick, cssClass = _a.cssClass, disabled = _a.disabled, enablePersistence = _a.enablePersistence, inline = _a.inline, mode = _a.mode, modeSwitcher = _a.modeSwitcher, noColor = _a.noColor, presetColors = _a.presetColors, showButtons = _a.showButtons;
            this.colorPicker = new ej2_inputs_1.ColorPicker({
                change: this.fontColorUpdate, value: '#000000', locale: this.documentHelper.owner.locale, enableOpacity: false, mode: mode, modeSwitcher: modeSwitcher, showButtons: showButtons, columns: columns, createPopupOnClick: createPopupOnClick, cssClass: cssClass, disabled: disabled, enablePersistence: enablePersistence, inline: inline, noColor: noColor, presetColors: presetColors
            });
            this.colorPicker.appendTo(this.fontColorElement);
            this.style = ej2_base_1.createElement('div', { styles: 'display:block' });
            this.generalDiv.appendChild(this.style);
            this.remove = ej2_base_1.createElement('div', { styles: 'display:block' });
            this.generalDiv.appendChild(this.remove);
            this.removeContent = ej2_base_1.createElement('input', {
                attrs: { type: 'checkbox' }
            });
            this.remove.appendChild(this.removeContent);
            this.removeCheckBox = new ej2_buttons_1.CheckBox({
                label: localeValue.getConstant('Remove content control when contents are edited'),
                cssClass: 'e-de-para-dlg-cs-check-box'
            });
            this.removeCheckBox.appendTo(this.removeContent);
            this.removeContent.setAttribute('aria-label', localeValue.getConstant('Remove content control when contents are edited'));
            this.container.appendChild(this.generalDiv);
            this.lockedDiv = ej2_base_1.createElement('div');
            this.lockedDiv.style.paddingTop = '10px';
            this.lockedLabel = ej2_base_1.createElement('div', { className: 'e-de-para-dlg-heading', innerHTML: localeValue.getConstant('Locking') });
            this.lockedDiv.appendChild(this.lockedLabel);
            this.contentDelete = ej2_base_1.createElement('div', { styles: 'display:block' });
            this.lockedDiv.appendChild(this.contentDelete);
            this.contentDeleted = ej2_base_1.createElement('input', {
                attrs: { type: 'checkbox' }
            });
            this.contentDelete.appendChild(this.contentDeleted);
            this.contentDeletedCheckBox = new ej2_buttons_1.CheckBox({
                label: localeValue.getConstant('Content control cannot be deleted'),
                cssClass: 'e-de-para-dlg-cs-check-box',
                change: function (args) {
                    if (args.checked) {
                        _this.removeCheckBox.disabled = true;
                        _this.removeCheckBox.dataBind();
                    }
                    else {
                        _this.removeCheckBox.disabled = false;
                        _this.removeCheckBox.dataBind();
                    }
                }
            });
            this.contentDeletedCheckBox.appendTo(this.contentDeleted);
            this.contentDeleted.setAttribute('aria-label', localeValue.getConstant('Content control cannot be deleted'));
            this.contentEdit = ej2_base_1.createElement('div', { styles: 'display:block' });
            this.lockedDiv.appendChild(this.contentEdit);
            this.contentEdited = ej2_base_1.createElement('input', {
                attrs: { type: 'checkbox' }
            });
            this.contentEdit.appendChild(this.contentEdited);
            this.contentEditedCheckBox = new ej2_buttons_1.CheckBox({
                label: localeValue.getConstant('Contents cannot be edited'),
                cssClass: 'e-de-para-dlg-cs-check-box'
            });
            this.contentEditedCheckBox.appendTo(this.contentEdited);
            this.contentEdited.setAttribute('aria-label', localeValue.getConstant('Contents cannot be edited'));
            this.container.appendChild(this.lockedDiv);
            this.plainTextPropertiesDiv = ej2_base_1.createElement('div');
            this.plainTextPropertiesDiv.style.marginTop = '10px';
            this.plainTextPropertiesDiv.style.display = 'none';
            this.plainTextLabel = ej2_base_1.createElement('div', { className: 'e-de-para-dlg-heading', innerHTML: localeValue.getConstant('Plain Text properties') });
            this.plainTextPropertiesDiv.appendChild(this.plainTextLabel);
            this.multiline = ej2_base_1.createElement('input', {
                attrs: { type: 'checkbox' }
            });
            this.plainTextPropertiesDiv.appendChild(this.multiline);
            this.multilineCheckBox = new ej2_buttons_1.CheckBox({
                label: localeValue.getConstant('Allow carriage returns'),
                cssClass: 'e-de-para-dlg-cs-check-box'
            });
            this.multilineCheckBox.appendTo(this.multiline);
            this.multiline.setAttribute('aria-label', localeValue.getConstant('Allow carriage returns'));
            this.container.appendChild(this.plainTextPropertiesDiv);
            this.dropDownPropertiesDiv = ej2_base_1.createElement('div');
            this.dropDownPropertiesDiv.style.marginTop = '10px';
            this.dropDownPropertiesDiv.style.display = 'none';
            this.lockedcontentLabel = ej2_base_1.createElement('div', { className: 'e-de-para-dlg-heading', innerHTML: localeValue.getConstant('Drop_Down List properties') });
            this.dropDownPropertiesDiv.appendChild(this.lockedcontentLabel);
            this.commonDiv = ej2_base_1.createElement('div', { className: 'e-bookmark-common' });
            this.dropDownPropertiesDiv.appendChild(this.commonDiv);
            this.searchDiv = ej2_base_1.createElement('div', { className: 'e-bookmark-list' });
            this.commonDiv.appendChild(this.searchDiv);
            this.textBoxDiv = ej2_base_1.createElement('div', { className: 'e-bookmark-textboxdiv' });
            this.searchDiv.appendChild(this.textBoxDiv);
            this.textBoxInput = ej2_base_1.createElement('input', { className: 'e-input e-bookmark-textbox-input', id: 'bookmark_text_box' });
            this.textBoxInput.setAttribute('type', 'text');
            this.textBoxInput.addEventListener('keyup', this.keyUpOnTextBoxClickHandler);
            this.textBoxInput.setAttribute('aria-label', localeValue.getConstant('Display Text'));
            this.textBoxDiv.appendChild(this.textBoxInput);
            this.valueBoxDiv = ej2_base_1.createElement('div', { className: 'e-bookmark-textboxdiv' });
            this.searchDiv.appendChild(this.valueBoxDiv);
            this.valueBoxInput = ej2_base_1.createElement('input', { className: 'e-input e-bookmark-textbox-input', id: 'bookmark_text_box' });
            this.valueBoxInput.setAttribute('type', 'text');
            this.valueBoxInput.addEventListener('keyup', this.keyUpOnTextBoxClickHandler);
            this.valueBoxInput.setAttribute('aria-label', localeValue.getConstant('Value'));
            this.valueBoxDiv.appendChild(this.valueBoxInput);
            this.listviewDiv = ej2_base_1.createElement('div', { className: 'e-bookmark-listViewDiv', id: 'bookmark_listview', attrs: { tabindex: '-1', role: 'listbox' } });
            this.searchDiv.appendChild(this.listviewDiv);
            this.listviewInstance = new ej2_lists_1.ListView({
                cssClass: 'e-bookmark-listview',
                select: this.selectHandler,
                fields: { text: 'value' }
            });
            this.listviewInstance.appendTo(this.listviewDiv);
            this.buttonDiv = ej2_base_1.createElement('div', { className: 'e-bookmark-button' });
            this.commonDiv.appendChild(this.buttonDiv);
            this.addbuttonDiv = ej2_base_1.createElement('div', { className: 'e-bookmark-addbutton' });
            this.buttonDiv.appendChild(this.addbuttonDiv);
            this.addButtonElement = ej2_base_1.createElement('button', {
                innerHTML: 'Add', id: 'add',
                attrs: { type: 'button' }
            });
            this.addButtonElement.setAttribute('aria-label', localeValue.getConstant('Add'));
            this.addbuttonDiv.appendChild(this.addButtonElement);
            this.addButton = new ej2_buttons_1.Button({ cssClass: 'e-button-custom' });
            this.addButton.disabled = true;
            this.addButton.appendTo(this.addButtonElement);
            this.addButtonElement.addEventListener('click', this.setButtonClickHandler);
            this.deleteButtonDiv = ej2_base_1.createElement('div', { className: 'e-bookmark-deletebutton' });
            this.buttonDiv.appendChild(this.deleteButtonDiv);
            this.deleteButtonElement = ej2_base_1.createElement('button', {
                innerHTML: 'Delete', id: 'delete',
                attrs: { type: 'button' }
            });
            this.deleteButtonElement.setAttribute('aria-label', 'Delete');
            this.deleteButtonDiv.appendChild(this.deleteButtonElement);
            this.deleteButton = new ej2_buttons_1.Button({ cssClass: 'e-button-custom' });
            this.deleteButton.appendTo(this.deleteButtonElement);
            this.deleteButtonElement.addEventListener('click', this.clearButtonClickHandler);
            this.container.appendChild(this.dropDownPropertiesDiv);
            this.target.appendChild(this.container);
            new ej2_inputs_1.TextBox({ placeholder: localeValue.getConstant('Title'), floatLabelType: 'Always' }, this.titleText);
            new ej2_inputs_1.TextBox({ placeholder: localeValue.getConstant('Tag'), floatLabelType: 'Always' }, this.tagText);
            new ej2_inputs_1.TextBox({ placeholder: localeValue.getConstant('Display Text'), floatLabelType: 'Always' }, this.textBoxInput);
            new ej2_inputs_1.TextBox({ placeholder: localeValue.getConstant('Value'), floatLabelType: 'Always' }, this.valueBoxInput);
        };
        ContentControlPropertiesDialog.prototype.show = function () {
            var localValue = new ej2_base_1.L10n('documenteditor', this.documentHelper.owner.defaultLocale);
            localValue.setLocale(this.documentHelper.owner.locale);
            this.localeValue = localValue;
            Eif (!this.target) {
                this.initContentControlPropertiesDialog(localValue, false);
            }
            Eif (this.documentHelper.selection.caret.style.display !== 'none') {
                this.documentHelper.selection.caret.style.display = 'none';
            }
            Iif (this.dropDownPropertiesDiv.style.display !== 'none' || this.plainTextPropertiesDiv.style.display !== 'none') {
                this.dropDownPropertiesDiv.style.display = 'none';
                this.plainTextPropertiesDiv.style.display = 'none';
            }
            this.documentHelper.dialog.header = localValue.getConstant('Content Control Properties');
            this.documentHelper.dialog.height = 'auto';
            this.documentHelper.dialog.width = 'auto';
            this.documentHelper.dialog.beforeOpen = this.loadPropertiesdialog;
            this.documentHelper.dialog.content = this.target;
            this.documentHelper.dialog.buttons = [
                {
                    click: this.applyProperties,
                    buttonModel: { content: this.localeValue.getConstant('Ok'), cssClass: 'e-flat e-para-okay', isPrimary: true }
                },
                {
                    click: this.closePropertiesDialog,
                    buttonModel: { content: this.localeValue.getConstant('Cancel'), cssClass: 'e-flat e-para-cancel' }
                }
            ];
            this.documentHelper.dialog.close = this.documentHelper.updateFocus;
            this.documentHelper.dialog.dataBind();
            this.documentHelper.dialog.show();
        };
        ContentControlPropertiesDialog.prototype.onClearButtonClick = function (args) {
            this.clearButtonClick(args);
        };
        ContentControlPropertiesDialog.prototype.onSetButtonClick = function (args) {
            this.setButtonClick(args);
        };
        ContentControlPropertiesDialog.prototype.onKeyUpOnTextBoxClicked = function () {
            this.onKeyUpOnTextBox();
        };
        ContentControlPropertiesDialog.prototype.enableOrDisableButton = function () {
            if (!ej2_base_1.isNullOrUndefined(this.addButton)) {
                this.addButton.disabled = this.textBoxInput.value === '' || this.valueBoxInput.value === '';
            }
        };
        ContentControlPropertiesDialog.prototype.unWireEventsAndBindings = function () {
            this.fontColor = undefined;
            this.currentContentControl = undefined;
            this.currentSelectedItem = undefined;
            this.convertedItems = [];
        };
        ContentControlPropertiesDialog.prototype.destroy = function () {
            if (this.contentDeletedCheckBox) {
                this.contentDeletedCheckBox.destroy();
                this.contentDeletedCheckBox = undefined;
            }
            if (this.contentEditedCheckBox) {
                this.contentEditedCheckBox.destroy();
                this.contentEditedCheckBox = undefined;
            }
            if (this.removeCheckBox) {
                this.removeCheckBox.destroy();
                this.removeCheckBox = undefined;
            }
            if (this.multilineCheckBox) {
                this.multilineCheckBox.destroy();
                this.multilineCheckBox = undefined;
            }
            if (this.listviewInstance) {
                this.listviewInstance.destroy();
                this.listviewInstance = undefined;
            }
            if (this.textBoxInput) {
                this.textBoxInput.remove();
                this.textBoxInput = undefined;
            }
            if (this.valueBoxInput) {
                this.valueBoxInput.remove();
                this.valueBoxInput = undefined;
            }
            if (this.titleText) {
                this.titleText.remove();
                this.titleText = undefined;
            }
            if (this.tagText) {
                this.tagText.remove();
                this.tagText = undefined;
            }
            if (this.colorPicker) {
                this.colorPicker.destroy();
            }
            this.colorPicker = undefined;
            this.documentHelper = undefined;
            this.removeEvents();
            this.removeElements();
            if (!ej2_base_1.isNullOrUndefined(this.target)) {
                Eif (this.target.parentElement) {
                    this.target.parentElement.removeChild(this.target);
                }
                for (var i = 0; i < this.target.childNodes.length; i++) {
                    this.target.removeChild(this.target.childNodes[parseInt(i.toString(), 10)]);
                    i--;
                }
                this.target = undefined;
            }
        };
        ContentControlPropertiesDialog.prototype.removeEvents = function () {
            if (this.addButtonElement) {
                this.addButtonElement.removeEventListener('click', this.setButtonClickHandler);
            }
            if (this.deleteButtonElement) {
                this.deleteButtonElement.removeEventListener('click', this.clearButtonClickHandler);
            }
            Iif (this.textBoxInput) {
                this.textBoxInput.removeEventListener('keyup', this.keyUpOnTextBoxClickHandler);
            }
            Iif (this.valueBoxInput) {
                this.valueBoxInput.removeEventListener('keyup', this.keyUpOnTextBoxClickHandler);
            }
        };
        ContentControlPropertiesDialog.prototype.removeElements = function () {
            if (this.generalDiv) {
                this.generalDiv.remove();
                this.generalDiv = undefined;
            }
            if (this.genLabel) {
                this.genLabel.remove();
                this.genLabel = undefined;
            }
            if (this.displayText) {
                this.displayText.remove();
                this.displayText = undefined;
            }
            if (this.colorDiv) {
                this.colorDiv.remove();
                this.colorDiv = undefined;
            }
            if (this.fontColorDiv) {
                this.fontColorDiv.remove();
                this.fontColorDiv = undefined;
            }
            if (this.fontColorLabel) {
                this.fontColorLabel.remove();
                this.fontColorLabel = undefined;
            }
            if (this.fontColorElement) {
                this.fontColorElement.remove();
                this.fontColorElement = undefined;
            }
            if (this.style) {
                this.style.remove();
                this.style = undefined;
            }
            if (this.remove) {
                this.remove.remove();
                this.remove = undefined;
            }
            if (this.removeContent) {
                this.removeContent.remove();
                this.removeContent = undefined;
            }
            if (this.lockedDiv) {
                this.lockedDiv.remove();
                this.lockedDiv = undefined;
            }
            if (this.lockedLabel) {
                this.lockedLabel.remove();
                this.lockedLabel = undefined;
            }
            if (this.contentDelete) {
                this.contentDelete.remove();
                this.contentDelete = undefined;
            }
            if (this.contentDeleted) {
                this.contentDeleted.remove();
                this.contentDeleted = undefined;
            }
            if (this.contentEdit) {
                this.contentEdit.remove();
                this.contentEdit = undefined;
            }
            if (this.contentEdited) {
                this.contentEdited.remove();
                this.contentEdited = undefined;
            }
            if (this.plainTextLabel) {
                this.plainTextLabel.remove();
                this.plainTextLabel = undefined;
            }
            if (this.multiline) {
                this.multiline.remove();
                this.multiline = undefined;
            }
            if (this.lockedcontentLabel) {
                this.lockedcontentLabel.remove();
                this.lockedcontentLabel = undefined;
            }
            if (this.commonDiv) {
                this.commonDiv.remove();
                this.commonDiv = undefined;
            }
            if (this.searchDiv) {
                this.searchDiv.remove();
                this.searchDiv = undefined;
            }
            if (this.textBoxDiv) {
                this.textBoxDiv.remove();
                this.textBoxDiv = undefined;
            }
            if (this.valueBoxDiv) {
                this.valueBoxDiv.remove();
                this.valueBoxDiv = undefined;
            }
            if (this.listviewDiv) {
                this.listviewDiv.remove();
                this.listviewDiv = undefined;
            }
            if (this.buttonDiv) {
                this.buttonDiv.remove();
                this.buttonDiv = undefined;
            }
            if (this.addbuttonDiv) {
                this.addbuttonDiv.remove();
                this.addbuttonDiv = undefined;
            }
            if (this.addButtonElement) {
                this.addButtonElement.remove();
                this.addButtonElement = undefined;
            }
            if (this.deleteButtonDiv) {
                this.deleteButtonDiv.remove();
                this.deleteButtonDiv = undefined;
            }
            if (this.deleteButtonElement) {
                this.deleteButtonElement.remove();
                this.deleteButtonElement = undefined;
            }
        };
        return ContentControlPropertiesDialog;
    }());
    exports.ContentControlPropertiesDialog = ContentControlPropertiesDialog;
});