@syncfusion/ej2-ribbon 31.1.17 → 31.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/ej2-ribbon.umd.min.js +3 -3
  2. package/dist/ej2-ribbon.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-ribbon.es2015.js +24 -5
  4. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  5. package/dist/es6/ej2-ribbon.es5.js +24 -5
  6. package/dist/es6/ej2-ribbon.es5.js.map +1 -1
  7. package/dist/global/ej2-ribbon.min.js +3 -3
  8. package/dist/global/ej2-ribbon.min.js.map +1 -1
  9. package/dist/global/index.d.ts +2 -2
  10. package/package.json +17 -53
  11. package/src/ribbon/base/ribbon-model.d.ts +1 -1
  12. package/src/ribbon/base/ribbon.js +14 -5
  13. package/src/ribbon/items/ribbon-splitbutton.js +11 -0
  14. package/styles/bds-lite.css +9 -0
  15. package/styles/bds.css +9 -0
  16. package/styles/bootstrap-dark-lite.css +9 -0
  17. package/styles/bootstrap-dark.css +9 -0
  18. package/styles/bootstrap-lite.css +9 -0
  19. package/styles/bootstrap.css +9 -0
  20. package/styles/bootstrap4-lite.css +17 -0
  21. package/styles/bootstrap4.css +17 -0
  22. package/styles/bootstrap5-dark-lite.css +9 -0
  23. package/styles/bootstrap5-dark.css +9 -0
  24. package/styles/bootstrap5-lite.css +9 -0
  25. package/styles/bootstrap5.3-lite.css +9 -0
  26. package/styles/bootstrap5.3.css +9 -0
  27. package/styles/bootstrap5.css +9 -0
  28. package/styles/fabric-dark-lite.css +9 -0
  29. package/styles/fabric-dark.css +9 -0
  30. package/styles/fabric-lite.css +9 -0
  31. package/styles/fabric.css +9 -0
  32. package/styles/fluent-dark-lite.css +9 -0
  33. package/styles/fluent-dark.css +9 -0
  34. package/styles/fluent-lite.css +9 -0
  35. package/styles/fluent.css +9 -0
  36. package/styles/fluent2-lite.css +11 -2
  37. package/styles/fluent2.css +11 -2
  38. package/styles/highcontrast-light-lite.css +9 -0
  39. package/styles/highcontrast-light.css +9 -0
  40. package/styles/highcontrast-lite.css +9 -0
  41. package/styles/highcontrast.css +9 -0
  42. package/styles/material-dark-lite.css +9 -0
  43. package/styles/material-dark.css +9 -0
  44. package/styles/material-lite.css +9 -0
  45. package/styles/material.css +9 -0
  46. package/styles/material3-dark-lite.css +9 -0
  47. package/styles/material3-dark.css +9 -0
  48. package/styles/material3-lite.css +9 -0
  49. package/styles/material3.css +9 -0
  50. package/styles/ribbon/_fluent2-definition.scss +2 -2
  51. package/styles/ribbon/_layout.scss +7 -0
  52. package/styles/ribbon/bds.css +9 -0
  53. package/styles/ribbon/bootstrap-dark.css +9 -0
  54. package/styles/ribbon/bootstrap.css +9 -0
  55. package/styles/ribbon/bootstrap4.css +17 -0
  56. package/styles/ribbon/bootstrap5-dark.css +9 -0
  57. package/styles/ribbon/bootstrap5.3.css +9 -0
  58. package/styles/ribbon/bootstrap5.css +9 -0
  59. package/styles/ribbon/fabric-dark.css +9 -0
  60. package/styles/ribbon/fabric.css +9 -0
  61. package/styles/ribbon/fluent-dark.css +9 -0
  62. package/styles/ribbon/fluent.css +9 -0
  63. package/styles/ribbon/fluent2.css +11 -2
  64. package/styles/ribbon/highcontrast-light.css +9 -0
  65. package/styles/ribbon/highcontrast.css +9 -0
  66. package/styles/ribbon/material-dark.css +9 -0
  67. package/styles/ribbon/material.css +9 -0
  68. package/styles/ribbon/material3-dark.css +9 -0
  69. package/styles/ribbon/material3.css +9 -0
  70. package/styles/ribbon/tailwind-dark.css +9 -0
  71. package/styles/ribbon/tailwind.css +9 -0
  72. package/styles/ribbon/tailwind3.css +9 -0
  73. package/styles/tailwind-dark-lite.css +9 -0
  74. package/styles/tailwind-dark.css +9 -0
  75. package/styles/tailwind-lite.css +9 -0
  76. package/styles/tailwind.css +9 -0
  77. package/styles/tailwind3-lite.css +9 -0
  78. package/styles/tailwind3.css +9 -0
  79. package/dist/ts/index.d.ts +0 -1
  80. package/dist/ts/index.ts +0 -3
  81. package/dist/ts/ribbon/base/constant.d.ts +0 -201
  82. package/dist/ts/ribbon/base/constant.ts +0 -204
  83. package/dist/ts/ribbon/base/index.d.ts +0 -8
  84. package/dist/ts/ribbon/base/index.ts +0 -8
  85. package/dist/ts/ribbon/base/interface.d.ts +0 -398
  86. package/dist/ts/ribbon/base/interface.ts +0 -424
  87. package/dist/ts/ribbon/base/ribbon-model.d.ts +0 -195
  88. package/dist/ts/ribbon/base/ribbon.d.ts +0 -608
  89. package/dist/ts/ribbon/base/ribbon.ts +0 -4896
  90. package/dist/ts/ribbon/base/utils.d.ts +0 -139
  91. package/dist/ts/ribbon/base/utils.ts +0 -341
  92. package/dist/ts/ribbon/index.d.ts +0 -7
  93. package/dist/ts/ribbon/index.ts +0 -7
  94. package/dist/ts/ribbon/items/index.d.ts +0 -8
  95. package/dist/ts/ribbon/items/index.ts +0 -8
  96. package/dist/ts/ribbon/items/ribbon-button.d.ts +0 -64
  97. package/dist/ts/ribbon/items/ribbon-button.ts +0 -160
  98. package/dist/ts/ribbon/items/ribbon-checkbox.d.ts +0 -55
  99. package/dist/ts/ribbon/items/ribbon-checkbox.ts +0 -130
  100. package/dist/ts/ribbon/items/ribbon-colorpicker.d.ts +0 -72
  101. package/dist/ts/ribbon/items/ribbon-colorpicker.ts +0 -228
  102. package/dist/ts/ribbon/items/ribbon-combobox.d.ts +0 -77
  103. package/dist/ts/ribbon/items/ribbon-combobox.ts +0 -201
  104. package/dist/ts/ribbon/items/ribbon-dropdown.d.ts +0 -128
  105. package/dist/ts/ribbon/items/ribbon-dropdown.ts +0 -400
  106. package/dist/ts/ribbon/items/ribbon-gallery.d.ts +0 -97
  107. package/dist/ts/ribbon/items/ribbon-gallery.ts +0 -773
  108. package/dist/ts/ribbon/items/ribbon-groupbutton.d.ts +0 -73
  109. package/dist/ts/ribbon/items/ribbon-groupbutton.ts +0 -531
  110. package/dist/ts/ribbon/items/ribbon-splitbutton.d.ts +0 -85
  111. package/dist/ts/ribbon/items/ribbon-splitbutton.ts +0 -257
  112. package/dist/ts/ribbon/models/index.d.ts +0 -42
  113. package/dist/ts/ribbon/models/index.ts +0 -44
  114. package/dist/ts/ribbon/models/ribbon-back-button-model.d.ts +0 -29
  115. package/dist/ts/ribbon/models/ribbon-back-button.d.ts +0 -24
  116. package/dist/ts/ribbon/models/ribbon-back-button.ts +0 -31
  117. package/dist/ts/ribbon/models/ribbon-back-stage-settings-model.d.ts +0 -83
  118. package/dist/ts/ribbon/models/ribbon-back-stage-settings.d.ts +0 -81
  119. package/dist/ts/ribbon/models/ribbon-back-stage-settings.ts +0 -109
  120. package/dist/ts/ribbon/models/ribbon-backstage-item-model.d.ts +0 -69
  121. package/dist/ts/ribbon/models/ribbon-backstage-item.d.ts +0 -80
  122. package/dist/ts/ribbon/models/ribbon-backstage-item.ts +0 -102
  123. package/dist/ts/ribbon/models/ribbon-button-settings-model.d.ts +0 -64
  124. package/dist/ts/ribbon/models/ribbon-button-settings.d.ts +0 -63
  125. package/dist/ts/ribbon/models/ribbon-button-settings.ts +0 -80
  126. package/dist/ts/ribbon/models/ribbon-checkbox-settings-model.d.ts +0 -57
  127. package/dist/ts/ribbon/models/ribbon-checkbox-settings.d.ts +0 -58
  128. package/dist/ts/ribbon/models/ribbon-checkbox-settings.ts +0 -74
  129. package/dist/ts/ribbon/models/ribbon-collection-model.d.ts +0 -30
  130. package/dist/ts/ribbon/models/ribbon-collection.d.ts +0 -33
  131. package/dist/ts/ribbon/models/ribbon-collection.ts +0 -45
  132. package/dist/ts/ribbon/models/ribbon-colorpicker-settings-model.d.ts +0 -137
  133. package/dist/ts/ribbon/models/ribbon-colorpicker-settings.d.ts +0 -129
  134. package/dist/ts/ribbon/models/ribbon-colorpicker-settings.ts +0 -165
  135. package/dist/ts/ribbon/models/ribbon-combobox-settings-model.d.ts +0 -275
  136. package/dist/ts/ribbon/models/ribbon-combobox-settings.d.ts +0 -257
  137. package/dist/ts/ribbon/models/ribbon-combobox-settings.ts +0 -313
  138. package/dist/ts/ribbon/models/ribbon-contextual-tab-settings-model.d.ts +0 -30
  139. package/dist/ts/ribbon/models/ribbon-contextual-tab-settings.d.ts +0 -33
  140. package/dist/ts/ribbon/models/ribbon-contextual-tab-settings.ts +0 -44
  141. package/dist/ts/ribbon/models/ribbon-dropdown-settings-model.d.ts +0 -114
  142. package/dist/ts/ribbon/models/ribbon-dropdown-settings.d.ts +0 -107
  143. package/dist/ts/ribbon/models/ribbon-dropdown-settings.ts +0 -139
  144. package/dist/ts/ribbon/models/ribbon-file-menu-settings-model.d.ts +0 -123
  145. package/dist/ts/ribbon/models/ribbon-file-menu-settings.d.ts +0 -173
  146. package/dist/ts/ribbon/models/ribbon-file-menu-settings.ts +0 -220
  147. package/dist/ts/ribbon/models/ribbon-gallery-group-model.d.ts +0 -44
  148. package/dist/ts/ribbon/models/ribbon-gallery-group.d.ts +0 -38
  149. package/dist/ts/ribbon/models/ribbon-gallery-group.ts +0 -50
  150. package/dist/ts/ribbon/models/ribbon-gallery-item-model.d.ts +0 -43
  151. package/dist/ts/ribbon/models/ribbon-gallery-item.d.ts +0 -38
  152. package/dist/ts/ribbon/models/ribbon-gallery-item.ts +0 -47
  153. package/dist/ts/ribbon/models/ribbon-gallery-settings-model.d.ts +0 -108
  154. package/dist/ts/ribbon/models/ribbon-gallery-settings.d.ts +0 -95
  155. package/dist/ts/ribbon/models/ribbon-gallery-settings.ts +0 -123
  156. package/dist/ts/ribbon/models/ribbon-group-button-item-model.d.ts +0 -64
  157. package/dist/ts/ribbon/models/ribbon-group-button-item.d.ts +0 -65
  158. package/dist/ts/ribbon/models/ribbon-group-button-item.ts +0 -85
  159. package/dist/ts/ribbon/models/ribbon-group-button-settings-model.d.ts +0 -32
  160. package/dist/ts/ribbon/models/ribbon-group-button-settings.d.ts +0 -29
  161. package/dist/ts/ribbon/models/ribbon-group-button-settings.ts +0 -38
  162. package/dist/ts/ribbon/models/ribbon-group-model.d.ts +0 -112
  163. package/dist/ts/ribbon/models/ribbon-group.d.ts +0 -105
  164. package/dist/ts/ribbon/models/ribbon-group.ts +0 -138
  165. package/dist/ts/ribbon/models/ribbon-item-model.d.ts +0 -144
  166. package/dist/ts/ribbon/models/ribbon-item.d.ts +0 -141
  167. package/dist/ts/ribbon/models/ribbon-item.ts +0 -190
  168. package/dist/ts/ribbon/models/ribbon-splitbutton-settings-model.d.ts +0 -114
  169. package/dist/ts/ribbon/models/ribbon-splitbutton-settings.d.ts +0 -107
  170. package/dist/ts/ribbon/models/ribbon-splitbutton-settings.ts +0 -140
  171. package/dist/ts/ribbon/models/ribbon-tab-model.d.ts +0 -44
  172. package/dist/ts/ribbon/models/ribbon-tab.d.ts +0 -45
  173. package/dist/ts/ribbon/models/ribbon-tab.ts +0 -61
  174. package/dist/ts/ribbon/models/ribbon-tooltip-model.d.ts +0 -43
  175. package/dist/ts/ribbon/models/ribbon-tooltip.d.ts +0 -36
  176. package/dist/ts/ribbon/models/ribbon-tooltip.ts +0 -47
  177. package/dist/ts/ribbon/modules/index.d.ts +0 -4
  178. package/dist/ts/ribbon/modules/index.ts +0 -5
  179. package/dist/ts/ribbon/modules/ribbon-backstage.d.ts +0 -117
  180. package/dist/ts/ribbon/modules/ribbon-backstage.ts +0 -620
  181. package/dist/ts/ribbon/modules/ribbon-contextualtab.d.ts +0 -27
  182. package/dist/ts/ribbon/modules/ribbon-contextualtab.ts +0 -93
  183. package/dist/ts/ribbon/modules/ribbon-filemenu.d.ts +0 -96
  184. package/dist/ts/ribbon/modules/ribbon-filemenu.ts +0 -353
  185. package/dist/ts/ribbon/modules/ribbon-keytip.d.ts +0 -56
  186. package/dist/ts/ribbon/modules/ribbon-keytip.ts +0 -580
@@ -1,85 +0,0 @@
1
- import { DropDownButton, ItemModel } from '@syncfusion/ej2-splitbuttons';
2
- import { Ribbon } from '../base/index';
3
- import { RibbonSplitButtonSettingsModel, RibbonItemModel } from '../models/index';
4
- /**
5
- * Defines the items of Ribbon.
6
- */
7
- export declare class RibbonSplitButton {
8
- private parent;
9
- constructor(parent: Ribbon);
10
- protected getModuleName(): string;
11
- protected destroy(): void;
12
- /**
13
- * Creates SplitButton.
14
- *
15
- * @param {RibbonItemModel} item - Gets the ribbon item model.
16
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
17
- * @returns {void}
18
- * @hidden
19
- */
20
- createSplitButton(item: RibbonItemModel, itemEle: HTMLElement): void;
21
- /**
22
- * Adds the additional event handlers as the item moved into overflow popup.
23
- *
24
- * @param {RibbonItemModel} item - Gets the ribbon item model.
25
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
26
- * @param {DropDownButton} overflowButton - Gets the overflow button.
27
- * @returns {void}
28
- * @hidden
29
- */
30
- addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement, overflowButton: DropDownButton): void;
31
- /**
32
- * Removes the additional event handlers as the item moved from overflow popup.
33
- *
34
- * @param {RibbonItemModel} item - Gets the ribbon item model.
35
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
36
- * @returns {void}
37
- * @hidden
38
- */
39
- removeOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void;
40
- private setContent;
41
- private getSplitButtonObj;
42
- /**
43
- * Adds a new item to the menu. By default, new item appends to
44
- * the list as the last item, but you can insert based on the text parameter.
45
- *
46
- * @param {string} controlId - Gets the control ID.
47
- * @param {ItemModel[]} Items - Gets the SplitButton items.
48
- * @param {string} text - Gets the text of the splitbutton item where the new item needs to be inserted.
49
- * @returns {void}
50
- */
51
- addItems(controlId: string, Items: ItemModel[], text?: string): void;
52
- /**
53
- * Removes the items from the menu.
54
- *
55
- * @param {string} controlId - Gets the control ID.
56
- * @param {string[]} Items -
57
- * @param {string} isUniqueId -
58
- * @returns {void}
59
- */
60
- removeItems(controlId: string, Items: string[], isUniqueId?: boolean): void;
61
- /**
62
- * To open/close SplitButton popup based on current state of the SplitButton.
63
- *
64
- * @param {string} controlId - Gets the control ID.
65
- * @returns {void}
66
- */
67
- toggle(controlId: string): void;
68
- /**
69
- * Updates the splitbutton.
70
- *
71
- * @param {RibbonSplitButtonSettingsModel} prop - Gets the splitbutton property.
72
- * @param {string} id - Gets the ID of dropdown.
73
- * @returns {void}
74
- */
75
- updateSplitButton(prop: RibbonSplitButtonSettingsModel, id: string): void;
76
- /**
77
- * Updated SplitButton size
78
- *
79
- * @param {HTMLElement} element - Gets the splibutton element.
80
- * @param {RibbonItemModel} item - Gets the ribbon item model.
81
- * @returns {void}
82
- * @hidden
83
- */
84
- updateSplitButtonSize(element: HTMLElement, item: RibbonItemModel): void;
85
- }
@@ -1,257 +0,0 @@
1
- import { EventHandler, KeyboardEventArgs, getComponent, merge } from '@syncfusion/ej2-base';
2
- import { BeforeOpenCloseMenuEventArgs, ClickEventArgs, DropDownButton, ItemModel, OpenCloseMenuEventArgs, SplitButton } from '@syncfusion/ej2-splitbuttons';
3
- import { Button } from '@syncfusion/ej2-buttons';
4
- import { getItem, Ribbon, itemProps, getItemElement, RibbonItemSize, setCustomAttributes } from '../base/index';
5
- import { ITEM_VERTICAL_CENTER, RIBBON_CONTROL, RIBBON_HOVER, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, VERTICAL_DDB } from '../base/constant';
6
- import { RibbonSplitButtonSettingsModel, RibbonItemModel } from '../models/index';
7
-
8
- /**
9
- * Defines the items of Ribbon.
10
- */
11
- export class RibbonSplitButton {
12
- private parent: Ribbon;
13
-
14
- constructor(parent: Ribbon) {
15
- this.parent = parent;
16
- }
17
- protected getModuleName(): string {
18
- return 'ribbonSplitButton';
19
- }
20
- protected destroy(): void {
21
- this.parent = null;
22
- }
23
- /**
24
- * Creates SplitButton.
25
- *
26
- * @param {RibbonItemModel} item - Gets the ribbon item model.
27
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
28
- * @returns {void}
29
- * @hidden
30
- */
31
- public createSplitButton(item: RibbonItemModel, itemEle: HTMLElement): void {
32
- const buttonEle: HTMLButtonElement = this.parent.createElement('button', {
33
- id: item.id
34
- });
35
- itemEle.appendChild(buttonEle);
36
- const splitButtonSettings: RibbonSplitButtonSettingsModel = item.splitButtonSettings;
37
- const cssClass: string = (ITEM_VERTICAL_CENTER + SPACE + RIBBON_CONTROL + SPACE + (splitButtonSettings.cssClass ?
38
- splitButtonSettings.cssClass : '')).trim();
39
- const splitbutton: SplitButton = new SplitButton({
40
- locale: this.parent.locale,
41
- enableRtl: this.parent.enableRtl,
42
- enablePersistence: this.parent.enablePersistence,
43
- iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left',
44
- closeActionEvents: splitButtonSettings.closeActionEvents,
45
- cssClass: cssClass + ((item.activeSize === RibbonItemSize.Large) ? (SPACE + VERTICAL_DDB) : ''),
46
- disabled: item.disabled,
47
- iconCss: splitButtonSettings.iconCss,
48
- items: splitButtonSettings.items,
49
- target: splitButtonSettings.target,
50
- beforeClose: (e: BeforeOpenCloseMenuEventArgs) => {
51
- if (splitButtonSettings.beforeClose) { splitButtonSettings.beforeClose.call(this, e); }
52
- },
53
- beforeItemRender: splitButtonSettings.beforeItemRender,
54
- beforeOpen: splitButtonSettings.beforeOpen,
55
- close: () => {
56
- (splitbutton['wrapper'] as HTMLElement).classList.remove(RIBBON_POPUP_OPEN);
57
- if (splitButtonSettings.close) {
58
- splitButtonSettings.close.call(this);
59
- }
60
- },
61
- created: splitButtonSettings.created,
62
- open: () => {
63
- (splitbutton['wrapper'] as HTMLElement).classList.add(RIBBON_POPUP_OPEN);
64
- if (splitButtonSettings.open) {
65
- splitButtonSettings.open.call(this);
66
- }
67
- },
68
- select: splitButtonSettings.select,
69
- click: (e: ClickEventArgs) => {
70
- if (splitButtonSettings.click) { splitButtonSettings.click.call(this, e); }
71
- }
72
- }, buttonEle);
73
- if (splitButtonSettings.htmlAttributes) {
74
- if (splitButtonSettings.htmlAttributes.id) {
75
- delete splitButtonSettings.htmlAttributes.id;
76
- }
77
- setCustomAttributes(buttonEle, splitButtonSettings.htmlAttributes);
78
- }
79
- const dropdownEle: HTMLElement = buttonEle.parentElement.querySelector('.e-dropdown-btn');
80
- dropdownEle.onkeydown = (e: KeyboardEventArgs) => {
81
- if (e.key === 'Enter') { e.stopImmediatePropagation(); (dropdownEle as HTMLElement).click(); }
82
- };
83
- this.setContent(item, splitbutton);
84
- const wrapper: HTMLElement = splitbutton['wrapper'] as HTMLElement;
85
- EventHandler.add(wrapper, 'mouseenter', () => { wrapper.classList.add(RIBBON_HOVER); }, this);
86
- EventHandler.add(wrapper, 'mouseleave', () => { wrapper.classList.remove(RIBBON_HOVER); }, this);
87
- }
88
-
89
- /**
90
- * Adds the additional event handlers as the item moved into overflow popup.
91
- *
92
- * @param {RibbonItemModel} item - Gets the ribbon item model.
93
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
94
- * @param {DropDownButton} overflowButton - Gets the overflow button.
95
- * @returns {void}
96
- * @hidden
97
- */
98
- public addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement, overflowButton: DropDownButton): void {
99
- const splitButtonEle: HTMLElement = itemEle.querySelector('#' + item.id);
100
- splitButtonEle.setAttribute('data-control', item.type.toString());
101
- const splitbutton: SplitButton = getComponent(splitButtonEle, SplitButton);
102
- splitbutton.cssClass = splitbutton.cssClass + SPACE + RIBBON_POPUP_CONTROL;
103
- splitbutton.dataBind();
104
- const dropdownEle: HTMLElement = splitButtonEle.parentElement.querySelector('.e-dropdown-btn');
105
- const ddbId: string = dropdownEle.getAttribute('id');
106
- const popupEle: HTMLElement = document.querySelector('#' + ddbId + '-popup');
107
- dropdownEle.onkeydown = (e: KeyboardEventArgs) => {
108
- if (e.key === 'Enter') { e.stopImmediatePropagation(); (dropdownEle as HTMLElement).click(); }
109
- };
110
- popupEle.onkeydown = (e: KeyboardEventArgs) => {
111
- if (e.key === 'Enter') {
112
- e.preventDefault();
113
- splitbutton['wrapper'].classList.remove('e-ribbon-open');
114
- (popupEle.querySelector('.e-focused') as HTMLElement).click();
115
- }
116
- };
117
- let target: HTMLElement;
118
- splitbutton.beforeClose = (e: BeforeOpenCloseMenuEventArgs) => {
119
- if (item.splitButtonSettings.beforeClose) { item.splitButtonSettings.beforeClose.call(this, e); }
120
- target = e.event ? e.event.target as HTMLElement : null;
121
- };
122
- splitbutton.click = (e: ClickEventArgs) => {
123
- if (item.splitButtonSettings.click) { item.splitButtonSettings.click.call(this, e); }
124
- if (overflowButton.element.classList.contains('e-active')) {
125
- overflowButton.toggle();
126
- }
127
- };
128
- splitbutton.close = (e: OpenCloseMenuEventArgs) => {
129
- if (item.splitButtonSettings.close) { item.splitButtonSettings.close.call(this, e); }
130
- (splitbutton['wrapper'] as HTMLElement).classList.remove(RIBBON_POPUP_OPEN);
131
- if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
132
- if (overflowButton.element.classList.contains('e-active')) {
133
- overflowButton.toggle();
134
- }
135
- }
136
- };
137
- }
138
- /**
139
- * Removes the additional event handlers as the item moved from overflow popup.
140
- *
141
- * @param {RibbonItemModel} item - Gets the ribbon item model.
142
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
143
- * @returns {void}
144
- * @hidden
145
- */
146
- public removeOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void {
147
- const splitButtonEle: HTMLElement = itemEle.querySelector('#' + item.id);
148
- const splitbutton: SplitButton = getComponent(splitButtonEle, SplitButton);
149
- let cssClass: string[] = splitbutton.cssClass.split(SPACE);
150
- cssClass = cssClass.filter((value: string) => value !== RIBBON_POPUP_CONTROL);
151
- splitbutton.cssClass = cssClass.join(SPACE);
152
- splitbutton.dataBind();
153
- splitbutton.beforeClose = (e: BeforeOpenCloseMenuEventArgs) => {
154
- if (item.splitButtonSettings.beforeClose) { item.splitButtonSettings.beforeClose.call(this, e); }
155
- };
156
- splitbutton.click = (e: ClickEventArgs) => {
157
- if (item.splitButtonSettings.click) { item.splitButtonSettings.click.call(this, e); }
158
- };
159
- splitbutton.close = (e: OpenCloseMenuEventArgs) => {
160
- if (item.splitButtonSettings.close) { item.splitButtonSettings.close.call(this, e); }
161
- (splitbutton['wrapper'] as HTMLElement).classList.remove(RIBBON_POPUP_OPEN);
162
- };
163
- }
164
-
165
- private setContent(item: RibbonItemModel, control: SplitButton): void {
166
- (control['primaryBtnObj'] as Button).setProperties({ content: (item.activeSize === RibbonItemSize.Medium) ? item.splitButtonSettings.content : '' });
167
- (control['secondaryBtnObj'] as DropDownButton).setProperties({ content: (item.activeSize === RibbonItemSize.Large) ? item.splitButtonSettings.content : '' });
168
- }
169
-
170
- private getSplitButtonObj(controlId: string): SplitButton {
171
- const splitButtonEle: HTMLElement = getItemElement(this.parent, controlId);
172
- return getComponent(splitButtonEle, SplitButton);
173
- }
174
- /**
175
- * Adds a new item to the menu. By default, new item appends to
176
- * the list as the last item, but you can insert based on the text parameter.
177
- *
178
- * @param {string} controlId - Gets the control ID.
179
- * @param {ItemModel[]} Items - Gets the SplitButton items.
180
- * @param {string} text - Gets the text of the splitbutton item where the new item needs to be inserted.
181
- * @returns {void}
182
- */
183
- public addItems(controlId: string, Items: ItemModel[], text?: string): void {
184
- this.getSplitButtonObj(controlId).addItems(Items, text);
185
- }
186
- /**
187
- * Removes the items from the menu.
188
- *
189
- * @param {string} controlId - Gets the control ID.
190
- * @param {string[]} Items -
191
- * @param {string} isUniqueId -
192
- * @returns {void}
193
- */
194
- public removeItems(controlId: string, Items: string[], isUniqueId?: boolean): void {
195
- this.getSplitButtonObj(controlId).removeItems(Items, isUniqueId);
196
- }
197
- /**
198
- * To open/close SplitButton popup based on current state of the SplitButton.
199
- *
200
- * @param {string} controlId - Gets the control ID.
201
- * @returns {void}
202
- */
203
- public toggle(controlId: string): void {
204
- const splitBtnObj: SplitButton = this.getSplitButtonObj(controlId);
205
- if (!splitBtnObj) { return; }
206
- if (!splitBtnObj.disabled) {
207
- splitBtnObj.toggle();
208
- }
209
- }
210
- /**
211
- * Updates the splitbutton.
212
- *
213
- * @param {RibbonSplitButtonSettingsModel} prop - Gets the splitbutton property.
214
- * @param {string} id - Gets the ID of dropdown.
215
- * @returns {void}
216
- */
217
- public updateSplitButton(prop: RibbonSplitButtonSettingsModel, id: string): void {
218
- const itemProp: itemProps = getItem(this.parent.tabs, id);
219
- if (!itemProp) { return; }
220
- merge(itemProp.item.splitButtonSettings, prop);
221
- const btnEle: HTMLElement = getItemElement(this.parent, id, itemProp);
222
- if (!btnEle) { return; }
223
- const control: SplitButton = getComponent(btnEle, SplitButton);
224
- if (prop.cssClass) {
225
- prop.cssClass = (RIBBON_CONTROL + SPACE + ITEM_VERTICAL_CENTER + SPACE + prop.cssClass).trim();
226
- prop.cssClass = itemProp.item.activeSize === RibbonItemSize.Large ?
227
- (VERTICAL_DDB + SPACE + prop.cssClass).trim() : prop.cssClass;
228
- control.cssClass = prop.cssClass;
229
- }
230
- delete prop.open;
231
- delete prop.click;
232
- delete prop.close;
233
- delete prop.beforeClose;
234
- control.setProperties(prop);
235
- if (prop.content) { this.setContent(itemProp.item, control); }
236
- }
237
- /**
238
- * Updated SplitButton size
239
- *
240
- * @param {HTMLElement} element - Gets the splibutton element.
241
- * @param {RibbonItemModel} item - Gets the ribbon item model.
242
- * @returns {void}
243
- * @hidden
244
- */
245
- public updateSplitButtonSize(element: HTMLElement, item: RibbonItemModel): void {
246
- const control: SplitButton = getComponent(element, SplitButton);
247
- let cssClass: string[] = control.cssClass.split(SPACE);
248
- if (item.activeSize === RibbonItemSize.Large) {
249
- cssClass.push(VERTICAL_DDB);
250
- } else {
251
- cssClass = cssClass.filter((value: string) => value !== VERTICAL_DDB);
252
- }
253
- control.cssClass = cssClass.join(SPACE);
254
- control.setProperties({ iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left' });
255
- this.setContent(item, control);
256
- }
257
- }
@@ -1,42 +0,0 @@
1
- export * from './ribbon-tab';
2
- export * from './ribbon-group';
3
- export * from './ribbon-collection';
4
- export * from './ribbon-item';
5
- export * from './ribbon-button-settings';
6
- export * from './ribbon-checkbox-settings';
7
- export * from './ribbon-colorpicker-settings';
8
- export * from './ribbon-combobox-settings';
9
- export * from './ribbon-dropdown-settings';
10
- export * from './ribbon-splitbutton-settings';
11
- export * from './ribbon-file-menu-settings';
12
- export * from './ribbon-back-stage-settings';
13
- export * from './ribbon-back-button';
14
- export * from './ribbon-backstage-item';
15
- export * from './ribbon-tooltip';
16
- export * from './ribbon-group-button-settings';
17
- export * from './ribbon-group-button-item';
18
- export * from './ribbon-contextual-tab-settings';
19
- export * from './ribbon-gallery-group';
20
- export * from './ribbon-gallery-item';
21
- export * from './ribbon-gallery-settings';
22
- export * from './ribbon-gallery-settings-model';
23
- export * from './ribbon-gallery-item-model';
24
- export * from './ribbon-gallery-group-model';
25
- export * from './ribbon-contextual-tab-settings-model';
26
- export * from './ribbon-group-button-item-model';
27
- export * from './ribbon-group-button-settings-model';
28
- export * from './ribbon-tooltip-model';
29
- export * from './ribbon-file-menu-settings-model';
30
- export * from './ribbon-back-stage-settings-model';
31
- export * from './ribbon-back-button-model';
32
- export * from './ribbon-backstage-item-model';
33
- export * from './ribbon-tab-model';
34
- export * from './ribbon-group-model';
35
- export * from './ribbon-collection-model';
36
- export * from './ribbon-item-model';
37
- export * from './ribbon-button-settings-model';
38
- export * from './ribbon-checkbox-settings-model';
39
- export * from './ribbon-colorpicker-settings-model';
40
- export * from './ribbon-combobox-settings-model';
41
- export * from './ribbon-dropdown-settings-model';
42
- export * from './ribbon-splitbutton-settings-model';
@@ -1,44 +0,0 @@
1
- // export * from './file-menu';
2
- export * from './ribbon-tab';
3
- export * from './ribbon-group';
4
- export * from './ribbon-collection';
5
- export * from './ribbon-item';
6
- export * from './ribbon-button-settings';
7
- export * from './ribbon-checkbox-settings';
8
- export * from './ribbon-colorpicker-settings';
9
- export * from './ribbon-combobox-settings';
10
- export * from './ribbon-dropdown-settings';
11
- export * from './ribbon-splitbutton-settings';
12
- export * from './ribbon-file-menu-settings';
13
- export * from './ribbon-back-stage-settings';
14
- export * from './ribbon-back-button';
15
- export * from './ribbon-backstage-item';
16
- export * from './ribbon-tooltip';
17
- export * from './ribbon-group-button-settings';
18
- export * from './ribbon-group-button-item';
19
- export * from './ribbon-contextual-tab-settings';
20
- export * from './ribbon-gallery-group';
21
- export * from './ribbon-gallery-item';
22
- export * from './ribbon-gallery-settings';
23
-
24
- export * from './ribbon-gallery-settings-model';
25
- export * from './ribbon-gallery-item-model';
26
- export * from './ribbon-gallery-group-model';
27
- export * from './ribbon-contextual-tab-settings-model';
28
- export * from './ribbon-group-button-item-model';
29
- export * from './ribbon-group-button-settings-model';
30
- export * from './ribbon-tooltip-model';
31
- export * from './ribbon-file-menu-settings-model';
32
- export * from './ribbon-back-stage-settings-model';
33
- export * from './ribbon-back-button-model';
34
- export * from './ribbon-backstage-item-model';
35
- export * from './ribbon-tab-model';
36
- export * from './ribbon-group-model';
37
- export * from './ribbon-collection-model';
38
- export * from './ribbon-item-model';
39
- export * from './ribbon-button-settings-model';
40
- export * from './ribbon-checkbox-settings-model';
41
- export * from './ribbon-colorpicker-settings-model';
42
- export * from './ribbon-combobox-settings-model';
43
- export * from './ribbon-dropdown-settings-model';
44
- export * from './ribbon-splitbutton-settings-model';
@@ -1,29 +0,0 @@
1
- import { ChildProperty, Property } from '@syncfusion/ej2-base';
2
-
3
- /**
4
- * Interface for a class BackstageBackButton
5
- */
6
- export interface BackstageBackButtonModel {
7
-
8
- /**
9
- * Specifies the text for backstage back button.
10
- *
11
- * @default ''
12
- */
13
- text?: string;
14
-
15
- /**
16
- * Specifies the icon css class for backstage back button.
17
- *
18
- * @default ''
19
- */
20
- iconCss?: string;
21
-
22
- /**
23
- * Specifies whether to show the backstage back button or not.
24
- *
25
- * @default true
26
- */
27
- visible?: boolean;
28
-
29
- }
@@ -1,24 +0,0 @@
1
- import { ChildProperty } from '@syncfusion/ej2-base';
2
- /**
3
- * Defines the ribbon backstage back button.
4
- */
5
- export declare class BackstageBackButton extends ChildProperty<BackstageBackButton> {
6
- /**
7
- * Specifies the text for backstage back button.
8
- *
9
- * @default ''
10
- */
11
- text: string;
12
- /**
13
- * Specifies the icon css class for backstage back button.
14
- *
15
- * @default ''
16
- */
17
- iconCss: string;
18
- /**
19
- * Specifies whether to show the backstage back button or not.
20
- *
21
- * @default true
22
- */
23
- visible: boolean;
24
- }
@@ -1,31 +0,0 @@
1
- import { ChildProperty, Property } from '@syncfusion/ej2-base';
2
-
3
- /**
4
- * Defines the ribbon backstage back button.
5
- */
6
- export class BackstageBackButton extends ChildProperty<BackstageBackButton> {
7
-
8
- /**
9
- * Specifies the text for backstage back button.
10
- *
11
- * @default ''
12
- */
13
- @Property('')
14
- public text: string;
15
-
16
- /**
17
- * Specifies the icon css class for backstage back button.
18
- *
19
- * @default ''
20
- */
21
- @Property('')
22
- public iconCss: string;
23
-
24
- /**
25
- * Specifies whether to show the backstage back button or not.
26
- *
27
- * @default true
28
- */
29
- @Property(true)
30
- public visible: boolean;
31
- }
@@ -1,83 +0,0 @@
1
- import { ChildProperty, Property, Complex, Collection } from '@syncfusion/ej2-base';import { BackstageBackButton } from './ribbon-back-button';import { BackstageBackButtonModel } from './ribbon-back-button-model';import { BackstageItem } from './ribbon-backstage-item';import { BackstageItemModel } from './ribbon-backstage-item-model';import { RibbonTooltipModel } from './ribbon-tooltip-model';import { RibbonTooltip } from './ribbon-tooltip';
2
-
3
- /**
4
- * Interface for a class BackStageMenu
5
- */
6
- export interface BackStageMenuModel {
7
-
8
- /**
9
- * Defines the text content of backstage menu button.
10
- *
11
- * @default 'File'
12
- */
13
- text?: string;
14
-
15
- /**
16
- * Specifies the keytip content.
17
- *
18
- * @default ''
19
- */
20
- keyTip?: string;
21
-
22
- /**
23
- * Defines whether to show the backstage menu button.
24
- *
25
- * @default false
26
- */
27
- visible?: boolean;
28
-
29
- /**
30
- * Defines the height of the backstage menu.
31
- *
32
- * @default 'auto'
33
- */
34
- height?: string;
35
-
36
- /**
37
- * Defines the width of the backstage menu.
38
- *
39
- * @default 'auto'
40
- */
41
- width?: string;
42
-
43
- /**
44
- * Defines the selector that points to the element in which backstage will be positioned.
45
- *
46
- * @default null
47
- */
48
- target?: string | HTMLElement;
49
-
50
- /**
51
- * Defines the properties of ribbon backstage back button.
52
- *
53
- * @default {}
54
- */
55
- backButton?: BackstageBackButtonModel;
56
-
57
- /**
58
- * Defines the properties of ribbon backstage back button.
59
- *
60
- * @default []
61
- * @aspType List<BackstageItem>
62
- */
63
- items?: BackstageItemModel[];
64
-
65
- /**
66
- * Defines the template for Backstage content.
67
- *
68
- * @default ''
69
- * @angularType string | object
70
- * @reactType string | function | JSX.Element
71
- * @vueType string | function
72
- * @aspType string
73
- */
74
- template?: string | Function;
75
-
76
- /**
77
- * Specifies the tooltip settings for the file menu button.
78
- *
79
- * @default {}
80
- */
81
- ribbonTooltipSettings?: RibbonTooltipModel;
82
-
83
- }
@@ -1,81 +0,0 @@
1
- import { ChildProperty } from '@syncfusion/ej2-base';
2
- import { BackstageBackButtonModel } from './ribbon-back-button-model';
3
- import { BackstageItemModel } from './ribbon-backstage-item-model';
4
- import { RibbonTooltipModel } from './ribbon-tooltip-model';
5
- /**
6
- * Defines the ribbon file menu settings.
7
- */
8
- export declare class BackStageMenu extends ChildProperty<BackStageMenu> {
9
- /**
10
- * Defines the text content of backstage menu button.
11
- *
12
- * @default 'File'
13
- */
14
- text: string;
15
- /**
16
- * Specifies the keytip content.
17
- *
18
- * @default ''
19
- */
20
- keyTip: string;
21
- /**
22
- * Defines whether to show the backstage menu button.
23
- *
24
- * @default false
25
- */
26
- visible: boolean;
27
- /**
28
- * Defines the height of the backstage menu.
29
- *
30
- * @default 'auto'
31
- */
32
- height: string;
33
- /**
34
- * Defines the width of the backstage menu.
35
- *
36
- * @default 'auto'
37
- */
38
- width: string;
39
- /**
40
- * Defines the selector that points to the element in which backstage will be positioned.
41
- *
42
- * @default null
43
- */
44
- target: string | HTMLElement;
45
- /**
46
- * Defines the properties of ribbon backstage back button.
47
- *
48
- * @default {}
49
- */
50
- backButton: BackstageBackButtonModel;
51
- /**
52
- * Defines the properties of ribbon backstage back button.
53
- *
54
- * @default []
55
- * @aspType List<BackstageItem>
56
- */
57
- items: BackstageItemModel[];
58
- /**
59
- * Defines the template for Backstage content.
60
- *
61
- * @default ''
62
- * @angularType string | object
63
- * @reactType string | function | JSX.Element
64
- * @vueType string | function
65
- * @aspType string
66
- */
67
- template: string | Function;
68
- /**
69
- * Specifies the tooltip settings for the file menu button.
70
- *
71
- * @default {}
72
- */
73
- ribbonTooltipSettings: RibbonTooltipModel;
74
- /**
75
- * @param {Object} prop - Gets the property of Backstage Menu.
76
- * @param {boolean} muteOnChange - Gets the boolean value of muteOnChange.
77
- * @returns {void}
78
- * @private
79
- */
80
- setProperties(prop: Object, muteOnChange: boolean): void;
81
- }