@syncfusion/ej2-documenteditor
Version:
Feature-rich document editor control with built-in support for context menu, options pane and dialogs.
77 lines (76 loc) • 2.47 kB
JavaScript
import { PageSetupGroup } from './index';
import { LayoutParagraphGroup } from './layout-paragraph-group';
import { RIBBON_ID } from '../ribbon-base/ribbon-constants';
export var LAYOUT_TAB_ID = '_layout_tab';
/**
* Represents the Layout Tab in the Ribbon
* @private
*/
var LayoutTab = /** @class */ (function () {
/**
* Constructor for the LayoutTab
* @param {DocumentEditorContainer} container - DocumentEditorContainer instance
*/
function LayoutTab(container) {
this.container = container;
this.localObj = this.container.localObj;
// Initialize group instances
this.pageSetupGroup = new PageSetupGroup(container);
this.layoutParagraphGroup = new LayoutParagraphGroup(container);
}
/**
* Creates the Layout tab for the ribbon
* @returns {RibbonTabModel} - Ribbon tab model for Layout tab
* @private
*/
LayoutTab.prototype.getLayoutTab = function () {
return {
id: this.container.element.id + RIBBON_ID + LAYOUT_TAB_ID,
keyTip: 'P',
header: this.localObj.getConstant('Layout'),
groups: [
this.pageSetupGroup.getGroupModel(),
// this.paragraphGroup.getGroupModel(),
this.layoutParagraphGroup.getGroupModel()
]
};
};
/**
* Updates UI based on the current selection
* @returns {void}
* @private
*/
LayoutTab.prototype.updateControlState = function () {
this.layoutParagraphGroup.updateSelection();
this.pageSetupGroup.updateSelection();
};
/**
* Initializes event handlers
* @returns {void}
* @private
*/
LayoutTab.prototype.wireEvents = function () {
// Wire events in group classes if needed
if (this.pageSetupGroup.wireEvents) {
this.pageSetupGroup.wireEvents();
}
};
/**
* Disposes event handlers and resources
* @returns {void}
* @private
*/
LayoutTab.prototype.destroy = function () {
// Dispose events and resources in group classes
if (this.pageSetupGroup.destroy) {
this.pageSetupGroup.destroy();
}
if (this.layoutParagraphGroup.destroy) {
this.layoutParagraphGroup.destroy();
}
this.pageSetupGroup = undefined;
this.layoutParagraphGroup = undefined;
};
return LayoutTab;
}());
export { LayoutTab };