UNPKG

@syncfusion/ej2-documenteditor

Version:

Feature-rich document editor control with built-in support for context menu, options pane and dialogs.

94 lines (93 loc) 3.12 kB
import { FormFieldsGroup } from './form-fields-group'; import { ControlGroup } from './control-group'; import { MappingGroup } from './mapping-group'; import { ProtectGroup } from './protect-group'; /** * Constants for tab identification */ export var DEVELOPER_TAB_ID = '_developer_tab'; /** * DeveloperTab module * @private */ var DeveloperTab = /** @class */ (function () { /** * Constructor for DeveloperTab class * @param {DocumentEditorContainer} container - DocumentEditorContainer instance */ function DeveloperTab(container) { this.container = container; this.ribbonId = this.container.element.id + '_ribbon'; // Initialize group instances this.formFieldsGroup = new FormFieldsGroup(container); this.controlGroup = new ControlGroup(container); this.mappingGroup = new MappingGroup(container); this.protectGroup = new ProtectGroup(container); } Object.defineProperty(DeveloperTab.prototype, "documentEditor", { /** * Get the DocumentEditor instance * @returns {DocumentEditor} The DocumentEditor instance */ get: function () { return this.container.documentEditor; }, enumerable: true, configurable: true }); /** * Get the Developer tab configuration * @returns {RibbonTabModel} The Developer tab model */ DeveloperTab.prototype.getDeveloperTab = function () { return { id: this.ribbonId + DEVELOPER_TAB_ID, keyTip: 'D', header: this.container.localObj.getConstant('Developer'), groups: [ this.formFieldsGroup.getGroupModel(), this.controlGroup.getGroupModel(), this.mappingGroup.getGroupModel(), this.protectGroup.getGroupModel() ] }; }; /** * Update UI when selection changes in the document * @returns {void} * @private */ DeveloperTab.prototype.updateDeveloperTabOnSelectionChange = function () { // Update all groups based on current selection this.formFieldsGroup.updateSelection(); this.controlGroup.updateSelection(); this.mappingGroup.updateSelection(); this.protectGroup.updateSelection(); }; /** * Destroy the DeveloperTab instance * @returns {void} */ DeveloperTab.prototype.destroy = function () { // Clean up group resources if (this.formFieldsGroup.destroy) { this.formFieldsGroup.destroy(); } if (this.controlGroup.destroy) { this.controlGroup.destroy(); } if (this.mappingGroup.destroy) { this.mappingGroup.destroy(); } if (this.protectGroup.destroy) { this.protectGroup.destroy(); } // Clear references this.formFieldsGroup = undefined; this.controlGroup = undefined; this.mappingGroup = undefined; this.protectGroup = undefined; }; return DeveloperTab; }()); export { DeveloperTab };