@syncfusion/ej2-documenteditor
Version:
Feature-rich document editor control with built-in support for context menu, options pane and dialogs.
66 lines (65 loc) • 2.21 kB
JavaScript
import { L10n } from '@syncfusion/ej2-base';
import { TableOfContentsGroup } from './table-of-contents-group';
import { FootnotesGroup } from './footnotes-group';
import { RIBBON_ID } from '../ribbon-base/ribbon-constants';
export var REFERENCES_TAB_ID = '_reference_tab';
/**
* Reference tab implementation
* @private
*/
var ReferenceTab = /** @class */ (function () {
/**
* Constructor for ReferenceTab class
* @param {DocumentEditorContainer} container - DocumentEditorContainer instance
*/
function ReferenceTab(container) {
this.container = container;
this.localObj = new L10n('documenteditorcontainer', this.container.defaultLocale, this.container.locale);
// Initialize group components
this.tableOfContentsGroup = new TableOfContentsGroup(this.container);
this.footnotesGroup = new FootnotesGroup(this.container);
}
/**
* Get the Reference tab configuration
* @returns {RibbonTabModel} - Reference tab configuration
* @private
*/
ReferenceTab.prototype.getReferenceTab = function () {
return {
id: this.container.element.id + RIBBON_ID + REFERENCES_TAB_ID,
keyTip: 'S',
header: this.localObj.getConstant('References'),
groups: [
this.tableOfContentsGroup.getGroupModel(),
this.footnotesGroup.getGroupModel()
]
};
};
/**
* Update UI based on selection state
* @returns {void}
* @private
*/
ReferenceTab.prototype.updateSelectionState = function () {
// Delegate to individual group components
this.tableOfContentsGroup.updateSelection();
this.footnotesGroup.updateSelection();
};
/**
* Clean up resources
* @returns {void}
* @private
*/
ReferenceTab.prototype.destroy = function () {
if (this.tableOfContentsGroup) {
this.tableOfContentsGroup.destroy();
}
if (this.footnotesGroup) {
this.footnotesGroup.destroy();
}
this.tableOfContentsGroup = null;
this.footnotesGroup = null;
};
return ReferenceTab;
}());
export { ReferenceTab };