UNPKG

@syncfusion/ej2-documenteditor

Version:

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

65 lines (64 loc) 2.14 kB
import { BordersGroup } from './borders-group'; import { ShadingGroup } from './shading-group'; import { RIBBON_ID } from '../ribbon-base/ribbon-constants'; export var TABLE_DESIGN_TAB_ID = '_table_design_tab'; /** * TableDesignTab class provides a ribbon tab for table design options * @private */ var TableDesignTab = /** @class */ (function () { /** * Constructor for the TableDesignTab class * @param {DocumentEditorContainer} container - DocumentEditorContainer instance */ function TableDesignTab(container) { this.container = container; this.localObj = this.container.localObj; this.bordersGroup = new BordersGroup(container); this.shadingGroup = new ShadingGroup(container); } /** * Gets the Table Design tab configuration * @returns {RibbonTabModel} - RibbonTabModel for the Table Design tab * @private */ TableDesignTab.prototype.getTableDesignTab = function () { return { id: this.container.element.id + RIBBON_ID + TABLE_DESIGN_TAB_ID, keyTip: 'JT', header: this.localObj.getConstant('Table Design'), groups: [ this.bordersGroup.getBordersGroup(), this.shadingGroup.getShadingGroup() ] }; }; /** * Updates the state of table design controls based on the current selection * @returns {void} * @private */ TableDesignTab.prototype.onSelectionChange = function () { if (this.container.documentEditor.selection) { // Update shading color this.shadingGroup.updateShadingColor(); } }; /** * Clean up resources when destroyed * @returns {void} * @private */ TableDesignTab.prototype.destroy = function () { if (this.bordersGroup) { this.bordersGroup.destroy(); this.bordersGroup = undefined; } if (this.shadingGroup) { this.shadingGroup.destroy(); this.shadingGroup = undefined; } }; return TableDesignTab; }()); export { TableDesignTab };