@syncfusion/ej2-ribbon 31.1.17 → 31.2.2

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 +19 -55
  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,400 +0,0 @@
1
- import { KeyboardEventArgs, closest, getComponent, isNullOrUndefined, merge, remove } from '@syncfusion/ej2-base';
2
- import { BeforeOpenCloseMenuEventArgs, DropDownButton, ItemModel, OpenCloseMenuEventArgs } from '@syncfusion/ej2-splitbuttons';
3
- import { Tooltip } from '@syncfusion/ej2-popups';
4
- import { getItem, Ribbon, itemProps, getItemElement, RibbonItemSize, createTooltip, setCustomAttributes } from '../base/index';
5
- import { RibbonDropDownSettingsModel, RibbonItemModel } from '../models/index';
6
- import { DROPDOWN_ID, ITEM_VERTICAL_CENTER, OVERFLOW_ID, RIBBON_CONTROL, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_POPUP_CONTROL, SPACE, VERTICAL_DDB } from '../base/constant';
7
-
8
-
9
- /**
10
- * Defines the items of Ribbon.
11
- */
12
- export class RibbonDropDown {
13
- private parent: Ribbon;
14
-
15
- constructor(parent: Ribbon) {
16
- this.parent = parent;
17
- }
18
- protected getModuleName(): string {
19
- return 'ribbonDropDown';
20
- }
21
- protected destroy(): void {
22
- this.parent = null;
23
- }
24
- private itemIndex: number;
25
- private enableRtl: boolean;
26
- /**
27
- * Creates DropDown.
28
- *
29
- * @param {RibbonItemModel} item - Gets the ribbon item model.
30
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
31
- * @returns {void}
32
- * @hidden
33
- */
34
- public createDropDown(item: RibbonItemModel, itemEle: HTMLElement): void {
35
- const buttonEle: HTMLButtonElement = this.parent.createElement('button', {
36
- id: item.id
37
- });
38
- itemEle.appendChild(buttonEle);
39
- const dropDownSettings: RibbonDropDownSettingsModel = item.dropDownSettings;
40
- const cssClass: string = (ITEM_VERTICAL_CENTER + SPACE + RIBBON_CONTROL + SPACE + (dropDownSettings.cssClass ?
41
- dropDownSettings.cssClass : '')).trim();
42
- new DropDownButton({
43
- locale: this.parent.locale,
44
- enableRtl: this.parent.enableRtl,
45
- enablePersistence: this.parent.enablePersistence,
46
- iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left',
47
- closeActionEvents: dropDownSettings.closeActionEvents,
48
- content: item.activeSize === RibbonItemSize.Small ? '' : dropDownSettings.content,
49
- cssClass: cssClass + ((item.activeSize === RibbonItemSize.Large) ? (SPACE + VERTICAL_DDB) : ''),
50
- disabled: item.disabled,
51
- iconCss: dropDownSettings.iconCss,
52
- items: dropDownSettings.items,
53
- target: dropDownSettings.target,
54
- createPopupOnClick: dropDownSettings.createPopupOnClick,
55
- beforeClose: (e: BeforeOpenCloseMenuEventArgs) => {
56
- if (dropDownSettings.beforeClose) { dropDownSettings.beforeClose.call(this, e); }
57
- },
58
- beforeItemRender: dropDownSettings.beforeItemRender,
59
- beforeOpen: dropDownSettings.beforeOpen,
60
- close: (e: OpenCloseMenuEventArgs) => {
61
- if (dropDownSettings.close) { dropDownSettings.close.call(this, e); }
62
- },
63
- created: dropDownSettings.created,
64
- open: dropDownSettings.open,
65
- select: dropDownSettings.select
66
- }).appendTo(buttonEle);
67
- if (dropDownSettings.htmlAttributes) {
68
- if (dropDownSettings.htmlAttributes.id) {
69
- delete dropDownSettings.htmlAttributes.id;
70
- }
71
- setCustomAttributes(buttonEle, dropDownSettings.htmlAttributes);
72
- }
73
- }
74
- /**
75
- * Adds the additional event handlers as the item moved into overflow popup.
76
- *
77
- * @param {RibbonItemModel} item - Gets the ribbon item model.
78
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
79
- * @param {DropDownButton} overflowButton - Gets the overflow button.
80
- * @returns {void}
81
- * @hidden
82
- */
83
- public addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement, overflowButton: DropDownButton): void {
84
- const dropdownElement: HTMLElement = itemEle.querySelector('#' + item.id);
85
- dropdownElement.setAttribute('data-control', item.type.toString());
86
- const dropdown: DropDownButton = getComponent(dropdownElement, DropDownButton);
87
- dropdown.cssClass = dropdown.cssClass + SPACE + RIBBON_POPUP_CONTROL;
88
- dropdown.dataBind();
89
- let target: HTMLElement;
90
- dropdown.beforeClose = (e: BeforeOpenCloseMenuEventArgs) => {
91
- if (item.dropDownSettings.beforeClose) { item.dropDownSettings.beforeClose.call(this, e); }
92
- target = e.event ? e.event.target as HTMLElement : null;
93
- };
94
- dropdown.close = (e: OpenCloseMenuEventArgs) => {
95
- if (item.dropDownSettings.close) { item.dropDownSettings.close.call(this, e); }
96
- if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
97
- if (overflowButton.element.classList.contains('e-active')) {
98
- overflowButton.toggle();
99
- }
100
- }
101
- };
102
- }
103
- /**
104
- * Removes the additional event handlers as the item moved from overflow popup.
105
- *
106
- * @param {RibbonItemModel} item - Gets the ribbon item model.
107
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
108
- * @returns {void}
109
- * @hidden
110
- */
111
- public removeOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void {
112
- const dropdownElement: HTMLElement = itemEle.querySelector('#' + item.id);
113
- const dropdown: DropDownButton = getComponent(dropdownElement, DropDownButton);
114
- let cssClass: string[] = dropdown.cssClass.split(SPACE);
115
- cssClass = cssClass.filter((value: string) => value !== RIBBON_POPUP_CONTROL);
116
- dropdown.cssClass = cssClass.join(SPACE);
117
- dropdown.dataBind();
118
- dropdown.close = (e: OpenCloseMenuEventArgs) => {
119
- if (item.dropDownSettings.close) { item.dropDownSettings.close.call(this, e); }
120
- };
121
- dropdown.beforeClose = (e: BeforeOpenCloseMenuEventArgs) => {
122
- if (item.dropDownSettings.beforeClose) { item.dropDownSettings.beforeClose.call(this, e); }
123
- };
124
- }
125
-
126
- /**
127
- * Creates Overflow DropDown.
128
- *
129
- * @param {string} id - Gets the ID of the dropdown item.
130
- * @param {string} name - Gets the name of the dropdown item.
131
- * @param {string} iconCss - Gets the icon of the dropdown item.
132
- * @param {HTMLElement} groupEle - Gets the overflow group element.
133
- * @param {HTMLElement} overflowEle - Gets the overflow element.
134
- * @returns {void}
135
- * @hidden
136
- */
137
-
138
- public createOverFlowDropDown(id: string, name: string, iconCss: string,
139
- groupEle: HTMLElement, overflowEle: HTMLElement, enableRtl?: boolean): DropDownButton {
140
- this.enableRtl = enableRtl;
141
- const buttonEle: HTMLButtonElement = this.parent.createElement('button', {
142
- id: id + OVERFLOW_ID + DROPDOWN_ID
143
- });
144
- groupEle.setAttribute('tabindex', '0');
145
- overflowEle.appendChild(buttonEle);
146
- const dropdown: DropDownButton = new DropDownButton({
147
- iconCss: iconCss,
148
- target: groupEle,
149
- locale: this.parent.locale,
150
- enableRtl: this.parent.enableRtl,
151
- enablePersistence: this.parent.enablePersistence,
152
- cssClass: VERTICAL_DDB + SPACE + RIBBON_GROUP_OVERFLOW_DDB,
153
- iconPosition: 'Top',
154
- content: name,
155
- beforeClose: (args: BeforeOpenCloseMenuEventArgs) => {
156
- args.cancel = !isNullOrUndefined(args.event && closest(args.event.target as HTMLElement, '.' + RIBBON_POPUP_CONTROL));
157
- }
158
- }, buttonEle);
159
- createTooltip(groupEle, this.parent);
160
- buttonEle.onclick = buttonEle.onkeydown = () => { this.itemIndex = 0; };
161
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
162
- groupEle.onkeydown = (e: KeyboardEventArgs) => { this.keyActionHandler(e, groupEle), this; };
163
- return dropdown;
164
- }
165
-
166
- private keyActionHandler(e: KeyboardEventArgs, target: HTMLElement): void {
167
- const controlElements: Array<Element> = Array.prototype.slice.call(target.querySelectorAll('.e-control'));
168
- const templateElements: Array<Element> = Array.prototype.slice.call(target.querySelectorAll('.e-ribbon-template'));
169
- const items: Element[] = controlElements.concat(templateElements);
170
- const comboBoxElements: NodeListOf<Element> = target.querySelectorAll('.e-combobox');
171
- let comboBoxEle: HTMLElement;
172
- if (comboBoxElements) {
173
- for (let i: number = 0; i < comboBoxElements.length; i++) {
174
- if (comboBoxElements[parseInt(i.toString(), 10)].closest('.e-input-focus')) {
175
- comboBoxEle = comboBoxElements[parseInt(i.toString(), 10)] as HTMLElement;
176
- }
177
- }
178
- }
179
- if (comboBoxEle) {
180
- for (let i: number = 0; i < items.length; i++) {
181
- if (items[parseInt(i.toString(), 10)].classList.contains('e-combobox')) {
182
- if (items[parseInt(i.toString(), 10)].closest('.e-input-focus')) {
183
- this.itemIndex = i;
184
- }
185
- }
186
- }
187
- }
188
- if ((e.target as HTMLElement).classList.contains('e-control') || (e.target as HTMLElement).classList.contains('e-ribbon-template') || (e.target as HTMLElement).classList.contains('e-ribbon-launcher-icon') ||
189
- (e.target as HTMLElement).classList.contains('e-ribbon-last-item') || (e.target as HTMLElement).classList.contains('e-ribbon-first-item')) {
190
- if (e.key === 'ArrowRight' || (!e.shiftKey && e.key === 'Tab')) {
191
- this.handleNavigation(e, !this.enableRtl, items);
192
- }
193
- if (e.key === 'ArrowLeft' || (e.shiftKey && e.key === 'Tab')) {
194
- this.handleNavigation(e, this.enableRtl, items);
195
- }
196
- }
197
- }
198
-
199
- private handleNavigation(e: KeyboardEventArgs, enableRtl: boolean, items: Element[]): void {
200
- if (!(items[0].classList.contains('e-ribbon-first-item'))) { items[0].classList.add('e-ribbon-first-item'); }
201
- if (!(items[items.length - 1].classList.contains('e-ribbon-last-item'))) { items[items.length - 1].classList.add('e-ribbon-last-item'); }
202
- if (enableRtl) {
203
- if (this.itemIndex === 0 && (items[parseInt(this.itemIndex.toString(), 10)] as HTMLElement).classList.contains('e-ribbon-first-item')) { this.updateItemIndex(e, items, true); }
204
- if (!(e.target as HTMLElement).classList.contains('e-combobox') && !(e.target as HTMLElement).classList.contains('e-ribbon-last-item') &&
205
- !(e.target as HTMLElement).classList.contains('e-ribbon-group-container') && ((e.target as HTMLElement).classList.contains('e-ribbon-first-item')
206
- || this.itemIndex !== 0) && ((e.target as HTMLElement).classList.contains('e-control') || (e.target as HTMLElement).classList.contains('e-ribbon-template'))) {
207
- this.itemIndex++;
208
- this.updateItemIndex(e, items, true);
209
- }
210
- if ((e.target as HTMLElement).classList.contains('e-ribbon-last-item')) {
211
- let launcherIcon: boolean = false;
212
- launcherIcon = this.focusLauncherIcon(e, items);
213
- if (!launcherIcon) { this.itemIndex = 0; this.updateItemIndex(e, items, true); }
214
- }
215
- if ((e.target as HTMLElement).classList.contains('e-ribbon-launcher-icon')) { this.itemIndex = 0; this.updateItemIndex(e, items, true); }
216
- }
217
- else {
218
- if (!(e.target as HTMLElement).classList.contains('e-combobox') && this.itemIndex !== 0) { this.itemIndex--; this.updateItemIndex(e, items, false); }
219
- if ((e.target as HTMLElement).classList.contains('e-ribbon-first-item')) {
220
- let launcherIcon: boolean = false;
221
- launcherIcon = this.focusLauncherIcon(e, items);
222
- if (!launcherIcon) { this.itemIndex = items.length - 1; this.updateItemIndex(e, items, false); }
223
- }
224
- if ((e.target as HTMLElement).classList.contains('e-ribbon-launcher-icon')) { this.itemIndex = items.length - 1; this.updateItemIndex(e, items, false); }
225
- }
226
- if ((e.target as HTMLElement).classList.contains('e-combobox') && (e.key === 'Tab')) {
227
- if (enableRtl) { if (this.itemIndex < items.length - 1) { this.itemIndex++; } }
228
- else { if (this.itemIndex > 0) { this.itemIndex--; } }
229
- }
230
- }
231
-
232
- private focusLauncherIcon(e: KeyboardEventArgs, items: Element[]): boolean {
233
- const groupContainer: HTMLElement = items[parseInt(this.itemIndex.toString(), 10)].closest('.e-ribbon-group-container') as HTMLElement;
234
- let launcherIconEle: HTMLElement;
235
- if (groupContainer) { launcherIconEle = groupContainer.querySelector('.e-ribbon-launcher-icon') as HTMLElement; }
236
- if (launcherIconEle) {
237
- if (e.key === 'Tab') { e.preventDefault(); }
238
- (groupContainer.querySelector('.e-ribbon-launcher-icon')as HTMLElement).focus();
239
- return true;
240
- }
241
- else { return false; }
242
- }
243
-
244
- private updateItemIndex(e: KeyboardEventArgs, items: Element[], enableRtl: boolean): void {
245
- let ribbonItem: HTMLElement = items[this.itemIndex].closest('.e-ribbon-item') as HTMLElement;
246
- while (ribbonItem && ribbonItem.classList.contains('e-disabled')) {
247
- if (enableRtl) {
248
- if (this.itemIndex < items.length - 1) { this.itemIndex++; }
249
- else {
250
- let launcherIcon: boolean = false;
251
- launcherIcon = this.focusLauncherIcon(e, items);
252
- if (launcherIcon) { break; }
253
- this.itemIndex = 0;
254
- }
255
- }
256
- else {
257
- if (this.itemIndex > 0) { this.itemIndex--; }
258
- else {
259
- let launcherIcon: boolean = false;
260
- launcherIcon = this.focusLauncherIcon(e, items);
261
- if (launcherIcon) { break; }
262
- this.itemIndex = items.length - 1;
263
- }
264
- }
265
- ribbonItem = items[this.itemIndex].closest('.e-ribbon-item') as HTMLElement;
266
- }
267
- if (e.key === 'Tab') { e.preventDefault(); }
268
- (items[parseInt(this.itemIndex.toString(), 10)] as HTMLElement).focus();
269
- }
270
-
271
- /**
272
- * Removes Overflow DropDown.
273
- *
274
- * @param {HTMLElement} dropdownElement - Gets the ribbon DropDown element.
275
- * @returns {void}
276
- * @hidden
277
- */
278
- public removeOverFlowDropDown(dropdownElement: HTMLElement): void {
279
- const dropdown: DropDownButton = getComponent(dropdownElement, DropDownButton);
280
- const tooltip: Tooltip = getComponent(dropdown.target as HTMLElement, Tooltip);
281
- tooltip.destroy();
282
- dropdownElement.parentElement.parentElement.insertBefore(dropdown.target as HTMLElement, dropdownElement.parentElement);
283
- dropdown.destroy();
284
- remove(dropdownElement);
285
- }
286
-
287
- /**
288
- * Gets DropDown item element.
289
- *
290
- * @param {HTMLElement} dropdownElement - Gets the ribbon DropDown element.
291
- * @param {string} id - Gets the ID of ribbon DropDown element.
292
- * @returns {HTMLElement} - Returns the DropDown item element.
293
- * @hidden
294
- */
295
- public getDDBItemElement(dropdownElement: HTMLElement, id: string): HTMLElement {
296
- const dropdown: DropDownButton = getComponent(dropdownElement, DropDownButton);
297
- const dropDownPopup: HTMLElement = dropdown.dropDown.element;
298
- return dropDownPopup.querySelector('#' + id);
299
- }
300
-
301
- /**
302
- * Gets Overflow DropDown Popup.
303
- *
304
- * @param {itemProps} itemProp - Gets the property of ribbon item.
305
- * @param {HTMLElement} contentEle - Gets the content element.
306
- * @returns {HTMLElement} - Returns the Overflow DropDown Popup.
307
- * @hidden
308
- */
309
- public getOverflowDropDownPopup(itemProp: itemProps, contentEle: HTMLElement): HTMLElement {
310
- const dropdownElement: HTMLElement = contentEle.querySelector('#' + this.parent.tabs[itemProp.tabIndex].groups[itemProp.groupIndex].id + OVERFLOW_ID + DROPDOWN_ID);
311
- const dropdown: DropDownButton = getComponent(dropdownElement, DropDownButton);
312
- return dropdown.dropDown.element;
313
- }
314
-
315
- private getDropDownObj(controlId: string): DropDownButton {
316
- const dropDownEle: HTMLElement = getItemElement(this.parent, controlId);
317
- return dropDownEle ? getComponent(dropDownEle, DropDownButton) : null;
318
- }
319
- /**
320
- * Adds a new item to the menu. By default, new item appends to
321
- * the list as the last item, but you can insert based on the text parameter.
322
- *
323
- * @param {string} controlId - Gets the control ID.
324
- * @param {ItemModel[]} Items - Gets the DropDown items.
325
- * @param {string} text - Gets the text of the dropdown item where the new item needs to be inserted.
326
- * @returns {void}
327
- */
328
- public addItems(controlId: string, Items: ItemModel[], text?: string): void {
329
- this.getDropDownObj(controlId).addItems(Items, text);
330
- }
331
- /**
332
- * Removes the items from the menu.
333
- *
334
- * @param {string} controlId - Gets the control ID.
335
- * @param {string[]} Items -
336
- * @param {string} isUniqueId -
337
- * @returns {void}
338
- */
339
- public removeItems(controlId: string, Items: string[], isUniqueId?: boolean): void {
340
- this.getDropDownObj(controlId).removeItems(Items, isUniqueId);
341
- }
342
- /**
343
- * To open/close DropDownButton popup based on current state of the DropDownButton.
344
- *
345
- * @param {string} controlId - Gets the control ID.
346
- * @returns {void}
347
- */
348
- public toggle(controlId: string): void {
349
- const dropdownObj: DropDownButton = this.getDropDownObj(controlId);
350
- if (!dropdownObj) { return; }
351
- if (!dropdownObj.disabled) {
352
- dropdownObj.toggle();
353
- }
354
- }
355
- /**
356
- * Updates the dropdown.
357
- *
358
- * @param {RibbonDropDownSettingsModel} prop - Gets the dropdown property.
359
- * @param {string} id - Gets the ID of dropdown.
360
- * @returns {void}
361
- */
362
- public updateDropDown(prop: RibbonDropDownSettingsModel, id: string): void {
363
- const itemProp: itemProps = getItem(this.parent.tabs, id);
364
- if (!itemProp) { return; }
365
- merge(itemProp.item.dropDownSettings, prop);
366
- const btnEle: HTMLElement = getItemElement(this.parent, id, itemProp);
367
- if (!btnEle) { return; }
368
- const control: DropDownButton = getComponent(btnEle, DropDownButton);
369
- if (prop.cssClass) {
370
- prop.cssClass = (RIBBON_CONTROL + SPACE + ITEM_VERTICAL_CENTER + SPACE + prop.cssClass).trim();
371
- prop.cssClass = itemProp.item.activeSize === RibbonItemSize.Large ?
372
- (VERTICAL_DDB + SPACE + prop.cssClass).trim() : prop.cssClass;
373
- control.cssClass = prop.cssClass;
374
- }
375
- delete prop.close;
376
- delete prop.beforeClose;
377
- if (prop.content) { prop.content = itemProp.item.activeSize === RibbonItemSize.Small ? '' : prop.content; }
378
- control.setProperties(prop);
379
- }
380
- /**
381
- * Updated DropDown size
382
- *
383
- * @param {HTMLElement} element - Gets the dropdown element.
384
- * @param {RibbonItemModel} item - Gets the ribbon item model.
385
- * @returns {void}
386
- * @hidden
387
- */
388
- public updateDropDownSize(element: HTMLElement, item: RibbonItemModel): void {
389
- const control: DropDownButton = getComponent(element, DropDownButton);
390
- let cssClass: string[] = control.cssClass.split(SPACE);
391
- if (item.activeSize === RibbonItemSize.Large) {
392
- cssClass.push(VERTICAL_DDB);
393
- } else {
394
- cssClass = cssClass.filter((value: string) => value !== VERTICAL_DDB);
395
- }
396
- control.cssClass = cssClass.join(SPACE);
397
- control.setProperties({ iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left' });
398
- control.setProperties({ content: item.activeSize === RibbonItemSize.Small ? '' : item.dropDownSettings.content });
399
- }
400
- }
@@ -1,97 +0,0 @@
1
- import { Ribbon } from '../base/index';
2
- import { RibbonItemModel } from '../models/index';
3
- import { Popup } from '@syncfusion/ej2-popups';
4
- /**
5
- * Defines the items of Ribbon.
6
- */
7
- export declare class RibbonGallery {
8
- private parent;
9
- private count;
10
- private isAdded;
11
- private galleryItemsIndex;
12
- private registeredTemplate;
13
- constructor(parent: Ribbon);
14
- protected getModuleName(): string;
15
- protected destroy(): void;
16
- /**
17
- * Creates gallery.
18
- *
19
- * @param {RibbonItemModel} item - Gets the ribbon item model.
20
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
21
- * @returns {void}
22
- * @hidden
23
- */
24
- createGallery(item: RibbonItemModel, itemEle: HTMLElement): void;
25
- private renderGalleryItems;
26
- private setWrapperWidth;
27
- private setWrapperStyle;
28
- /**
29
- * Checks the gallery items height.
30
- *
31
- * @param {HTMLElement} activeContent - Gets the current active content.
32
- * @returns {void}
33
- * @hidden
34
- */
35
- checkAvailableHeight(activeContent: HTMLElement): void;
36
- /**
37
- * Checks the popup collision.
38
- *
39
- * @param {Popup} popup - Gets the popup.
40
- * @param {HTMLElement} popupEle - Gets the popup element.
41
- * @param {number} offsetValue - Gets the offset value of gallery popup button.
42
- * @returns {void}
43
- * @hidden
44
- */
45
- checkCollision(popup: Popup, popupEle: HTMLElement, offsetValue?: number): void;
46
- private setGalleryPopupHeight;
47
- private createPopup;
48
- /**
49
- * Updates gallery in mode switching.
50
- *
51
- * @param {string} activeLayout - Gets the current active layout.
52
- * @param {string} itemID - Gets the ribbon item id.
53
- * @returns {void}
54
- * @hidden
55
- */
56
- switchGalleryItems(activeLayout: string, itemID: string): void;
57
- /**
58
- * Adds the additional event handlers as the item moved into overflow popup.
59
- *
60
- * @param {RibbonItemModel} item - Gets the ribbon item model.
61
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
62
- * @returns {void}
63
- * @hidden
64
- */
65
- addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void;
66
- /**
67
- * Removes the additional event handlers as the item moved into overflow popup.
68
- *
69
- * @param {RibbonItemModel} item - Gets the ribbon item model.
70
- * @param {HTMLElement} itemEle - Gets the ribbon item element.
71
- * @returns {void}
72
- * @hidden
73
- */
74
- removeOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void;
75
- private setActiveState;
76
- private popupEvents;
77
- private showPopup;
78
- private hidePopup;
79
- /**
80
- * Shows a specific gallery popup in the ribbon.
81
- *
82
- * @param {string} id - Gets the ribbon item id.
83
- * @returns {void}
84
- */
85
- showGalleryPopup(id: string): void;
86
- /**
87
- * Hides a specific gallery popup in the ribbon.
88
- *
89
- * @param {string} id - Gets the ribbon item id.
90
- * @returns {void}
91
- */
92
- hideGalleryPopup(id: string): void;
93
- private setFoucsToFirstItem;
94
- private handleGalleryPopupNavigation;
95
- private createGalleryTemplate;
96
- private createGalleryPopupTemplate;
97
- }