@syncfusion/ej2-ribbon 21.1.37 → 22.1.34

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 (89) hide show
  1. package/.eslintrc.json +1 -0
  2. package/dist/ej2-ribbon.umd.min.js +2 -2
  3. package/dist/ej2-ribbon.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-ribbon.es2015.js +1344 -176
  5. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  6. package/dist/es6/ej2-ribbon.es5.js +1367 -191
  7. package/dist/es6/ej2-ribbon.es5.js.map +1 -1
  8. package/dist/global/ej2-ribbon.min.js +2 -2
  9. package/dist/global/ej2-ribbon.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +12 -12
  12. package/src/ribbon/base/constant.d.ts +2 -0
  13. package/src/ribbon/base/constant.js +2 -0
  14. package/src/ribbon/base/interface.d.ts +6 -6
  15. package/src/ribbon/base/interface.js +6 -6
  16. package/src/ribbon/base/ribbon-model.d.ts +2 -2
  17. package/src/ribbon/base/ribbon.d.ts +43 -1
  18. package/src/ribbon/base/ribbon.js +1082 -169
  19. package/src/ribbon/base/utils.d.ts +2 -2
  20. package/src/ribbon/base/utils.js +11 -6
  21. package/src/ribbon/items/ribbon-button.js +1 -0
  22. package/src/ribbon/items/ribbon-checkbox.js +1 -0
  23. package/src/ribbon/items/ribbon-colorpicker.d.ts +7 -0
  24. package/src/ribbon/items/ribbon-colorpicker.js +41 -3
  25. package/src/ribbon/items/ribbon-combobox.js +5 -1
  26. package/src/ribbon/items/ribbon-dropdown.d.ts +7 -1
  27. package/src/ribbon/items/ribbon-dropdown.js +173 -3
  28. package/src/ribbon/items/ribbon-splitbutton.js +45 -2
  29. package/src/ribbon/models/ribbon-combobox-settings-model.d.ts +10 -5
  30. package/src/ribbon/models/ribbon-combobox-settings.d.ts +10 -5
  31. package/src/ribbon/models/ribbon-file-menu-settings-model.d.ts +3 -1
  32. package/src/ribbon/models/ribbon-file-menu-settings.d.ts +3 -1
  33. package/src/ribbon/models/ribbon-item-model.d.ts +1 -1
  34. package/src/ribbon/models/ribbon-item.d.ts +1 -1
  35. package/styles/bootstrap-dark.css +62 -12
  36. package/styles/bootstrap.css +62 -12
  37. package/styles/bootstrap4.css +62 -12
  38. package/styles/bootstrap5-dark.css +62 -12
  39. package/styles/bootstrap5.css +62 -12
  40. package/styles/fabric-dark.css +62 -12
  41. package/styles/fabric.css +62 -12
  42. package/styles/fluent-dark.css +62 -12
  43. package/styles/fluent.css +62 -12
  44. package/styles/highcontrast-light.css +62 -12
  45. package/styles/highcontrast.css +66 -16
  46. package/styles/material-dark.css +62 -12
  47. package/styles/material.css +62 -12
  48. package/styles/material3-dark.css +1671 -0
  49. package/styles/material3-dark.scss +3 -0
  50. package/styles/material3.css +1727 -0
  51. package/styles/material3.scss +3 -0
  52. package/styles/ribbon/_bootstrap-dark-definition.scss +4 -0
  53. package/styles/ribbon/_bootstrap-definition.scss +4 -0
  54. package/styles/ribbon/_bootstrap4-definition.scss +4 -0
  55. package/styles/ribbon/_bootstrap5-definition.scss +4 -0
  56. package/styles/ribbon/_fabric-dark-definition.scss +4 -0
  57. package/styles/ribbon/_fabric-definition.scss +4 -0
  58. package/styles/ribbon/_fluent-definition.scss +4 -0
  59. package/styles/ribbon/_fusionnew-definition.scss +4 -0
  60. package/styles/ribbon/_highcontrast-definition.scss +6 -2
  61. package/styles/ribbon/_highcontrast-light-definition.scss +4 -0
  62. package/styles/ribbon/_layout.scss +88 -18
  63. package/styles/ribbon/_material-dark-definition.scss +4 -0
  64. package/styles/ribbon/_material-definition.scss +4 -0
  65. package/styles/ribbon/_material3-dark-definition.scss +1 -0
  66. package/styles/ribbon/_material3-definition.scss +210 -0
  67. package/styles/ribbon/_tailwind-definition.scss +4 -0
  68. package/styles/ribbon/bootstrap-dark.css +62 -12
  69. package/styles/ribbon/bootstrap.css +62 -12
  70. package/styles/ribbon/bootstrap4.css +62 -12
  71. package/styles/ribbon/bootstrap5-dark.css +62 -12
  72. package/styles/ribbon/bootstrap5.css +62 -12
  73. package/styles/ribbon/fabric-dark.css +62 -12
  74. package/styles/ribbon/fabric.css +62 -12
  75. package/styles/ribbon/fluent-dark.css +62 -12
  76. package/styles/ribbon/fluent.css +62 -12
  77. package/styles/ribbon/highcontrast-light.css +62 -12
  78. package/styles/ribbon/highcontrast.css +66 -16
  79. package/styles/ribbon/icons/_material3-dark.scss +1 -0
  80. package/styles/ribbon/material-dark.css +62 -12
  81. package/styles/ribbon/material.css +62 -12
  82. package/styles/ribbon/material3-dark.css +1671 -0
  83. package/styles/ribbon/material3-dark.scss +18 -0
  84. package/styles/ribbon/material3.css +1727 -0
  85. package/styles/ribbon/material3.scss +18 -0
  86. package/styles/ribbon/tailwind-dark.css +62 -12
  87. package/styles/ribbon/tailwind.css +62 -12
  88. package/styles/tailwind-dark.css +62 -12
  89. package/styles/tailwind.css +62 -12
@@ -14,11 +14,11 @@ export declare function getIndex<T>(arr: Array<T>, condition: (value: T, index:
14
14
  /**
15
15
  * Gets template content based on the template property value.
16
16
  *
17
- * @param {string | HTMLElement} template - Template property value.
17
+ * @param {string | HTMLElement| Function} template - Template property value.
18
18
  * @returns {Function} - Return template function.
19
19
  * @hidden
20
20
  */
21
- export declare function getTemplateFunction(template: string | HTMLElement): Function;
21
+ export declare function getTemplateFunction(template: string | HTMLElement | Function): Function;
22
22
  /**
23
23
  * Gets the ribbon item
24
24
  *
@@ -22,7 +22,7 @@ export function getIndex(arr, condition) {
22
22
  /**
23
23
  * Gets template content based on the template property value.
24
24
  *
25
- * @param {string | HTMLElement} template - Template property value.
25
+ * @param {string | HTMLElement| Function} template - Template property value.
26
26
  * @returns {Function} - Return template function.
27
27
  * @hidden
28
28
  */
@@ -183,16 +183,21 @@ export function getItemElement(parent, id, itemProp) {
183
183
  return null;
184
184
  }
185
185
  if (parent.activeLayout === RibbonLayout.Classic) {
186
- contentEle = (itemProp.group.isCollapsed) ? parent.ribbonDropDownModule.getOverflowDropDownPopup(itemProp, contentEle)
187
- : contentEle;
188
- return contentEle.querySelector('#' + id);
186
+ if (itemProp.item.displayOptions & DisplayMode.Classic) {
187
+ contentEle = (itemProp.group.isCollapsed) ? parent.ribbonDropDownModule.getOverflowDropDownPopup(itemProp, contentEle)
188
+ : contentEle;
189
+ return contentEle.querySelector('#' + id);
190
+ }
191
+ else {
192
+ return null;
193
+ }
189
194
  }
190
195
  else {
191
- //Checks for Simplified and Auto options (Auto = simplified + popup)
196
+ //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
192
197
  var ele = (itemProp.item.displayOptions & DisplayMode.Simplified) ?
193
198
  contentEle.querySelector('#' + itemProp.item.id) : null;
194
199
  // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
195
- if (!ele && (DisplayMode.Simplified !== DisplayMode.None)) {
200
+ if (!ele) {
196
201
  var dropdown = itemProp.group.enableGroupOverflow ?
197
202
  getComponent(contentEle.querySelector('#' + itemProp.group.id + constants.GROUPOF_BUTTON_ID), DropDownButton)
198
203
  : parent.overflowDDB;
@@ -62,6 +62,7 @@ var RibbonButton = /** @class */ (function () {
62
62
  RibbonButton.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
63
63
  var _this = this;
64
64
  var buttonEle = itemEle.querySelector('#' + item.id);
65
+ buttonEle.setAttribute('data-control', item.type.toString());
65
66
  var buttonObj = getComponent(buttonEle, Button);
66
67
  buttonObj.setProperties({ cssClass: buttonObj.cssClass + SPACE + RIBBON_POPUP_CONTROL });
67
68
  buttonEle.onclick = function (e) {
@@ -58,6 +58,7 @@ var RibbonCheckBox = /** @class */ (function () {
58
58
  RibbonCheckBox.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
59
59
  var _this = this;
60
60
  var inputEle = itemEle.querySelector('#' + item.id);
61
+ inputEle.setAttribute('data-control', item.type.toString());
61
62
  var checkBoxObj = getComponent(inputEle, CheckBox);
62
63
  checkBoxObj.cssClass = checkBoxObj.cssClass + SPACE + RIBBON_POPUP_CONTROL;
63
64
  checkBoxObj.dataBind();
@@ -18,6 +18,7 @@ export declare class RibbonColorPicker {
18
18
  * @hidden
19
19
  */
20
20
  createColorPicker(item: RibbonItemModel, itemEle: HTMLElement): void;
21
+ private toggleWrapperHover;
21
22
  /**
22
23
  * Adds the additional event handlers as the item moved into overflow popup.
23
24
  *
@@ -62,4 +63,10 @@ export declare class RibbonColorPicker {
62
63
  * @returns {void}
63
64
  */
64
65
  updateColorPicker(prop: RibbonColorPickerSettingsModel, id: string): void;
66
+ /**
67
+ * @param {HTMLElement} element - Gets the colorpicker element to be destroyed.
68
+ * @returns {void}
69
+ * @hidden
70
+ */
71
+ unwireColorPickerEvents(element: HTMLElement): void;
65
72
  }
@@ -63,8 +63,16 @@ var RibbonColorPicker = /** @class */ (function () {
63
63
  select: colorPickerSettings.select
64
64
  }, inputEle);
65
65
  var wrapper = colorPicker.element.parentElement;
66
- EventHandler.add(wrapper, 'mouseenter', function () { wrapper.classList.add(RIBBON_HOVER); }, this);
67
- EventHandler.add(wrapper, 'mouseleave', function () { wrapper.classList.remove(RIBBON_HOVER); }, this);
66
+ EventHandler.add(wrapper, 'mouseenter', this.toggleWrapperHover.bind(this, wrapper, true), this);
67
+ EventHandler.add(wrapper, 'mouseleave', this.toggleWrapperHover.bind(this, wrapper, false), this);
68
+ };
69
+ RibbonColorPicker.prototype.toggleWrapperHover = function (wrapper, isAdd) {
70
+ if (isAdd) {
71
+ wrapper.classList.add(RIBBON_HOVER);
72
+ }
73
+ else {
74
+ wrapper.classList.remove(RIBBON_HOVER);
75
+ }
68
76
  };
69
77
  /**
70
78
  * Adds the additional event handlers as the item moved into overflow popup.
@@ -76,13 +84,25 @@ var RibbonColorPicker = /** @class */ (function () {
76
84
  * @hidden
77
85
  */
78
86
  RibbonColorPicker.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
87
+ var _this = this;
79
88
  var colorPickerEle = itemEle.querySelector('#' + item.id);
89
+ colorPickerEle.setAttribute('data-control', item.type.toString());
80
90
  var colorPickerObj = getComponent(colorPickerEle, ColorPicker);
81
91
  colorPickerObj.setProperties({ cssClass: colorPickerObj.cssClass + SPACE + RIBBON_POPUP_CONTROL });
82
92
  //Accessing the private property 'splitBtn' of ColorPicker component to get the colorpicker instance as there is no close event in colorpicker.
83
93
  var splitBtn = colorPickerObj['splitBtn'];
94
+ var target;
95
+ colorPickerObj.beforeClose = function (e) {
96
+ target = e.event ? e.event.target : null;
97
+ colorPickerObj.element.parentElement.classList.remove(RIBBON_POPUP_OPEN);
98
+ if (item.colorPickerSettings.beforeClose) {
99
+ item.colorPickerSettings.beforeClose.call(_this);
100
+ }
101
+ };
84
102
  splitBtn.close = function () {
85
- overflowButton.toggle();
103
+ if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
104
+ overflowButton.toggle();
105
+ }
86
106
  };
87
107
  };
88
108
  /**
@@ -94,6 +114,7 @@ var RibbonColorPicker = /** @class */ (function () {
94
114
  * @hidden
95
115
  */
96
116
  RibbonColorPicker.prototype.removeOverFlowEvents = function (item, itemEle) {
117
+ var _this = this;
97
118
  var colorPickerEle = itemEle.querySelector('#' + item.id);
98
119
  var colorPickerObj = getComponent(colorPickerEle, ColorPicker);
99
120
  var cssClass = colorPickerObj.cssClass.split(SPACE);
@@ -102,6 +123,12 @@ var RibbonColorPicker = /** @class */ (function () {
102
123
  var splitBtn = colorPickerObj['splitBtn'];
103
124
  //Accessing the private property 'splitBtn' of ColorPicker component to get the colorpicker instance as there is no close event in colorpicker.
104
125
  splitBtn.close = null;
126
+ colorPickerObj.beforeClose = function (e) {
127
+ colorPickerObj.element.parentElement.classList.remove(RIBBON_POPUP_OPEN);
128
+ if (item.colorPickerSettings.beforeClose) {
129
+ item.colorPickerSettings.beforeClose.call(_this);
130
+ }
131
+ };
105
132
  };
106
133
  RibbonColorPicker.prototype.getColorPickerObj = function (controlId) {
107
134
  var inputEle = getItemElement(this.parent, controlId);
@@ -157,6 +184,17 @@ var RibbonColorPicker = /** @class */ (function () {
157
184
  var colorPickerObj = getComponent(inputEle, ColorPicker);
158
185
  colorPickerObj.setProperties(prop);
159
186
  };
187
+ /**
188
+ * @param {HTMLElement} element - Gets the colorpicker element to be destroyed.
189
+ * @returns {void}
190
+ * @hidden
191
+ */
192
+ RibbonColorPicker.prototype.unwireColorPickerEvents = function (element) {
193
+ var colorPickerObj = getComponent(element, ColorPicker);
194
+ var wrapper = colorPickerObj.element.parentElement;
195
+ EventHandler.remove(wrapper, 'mouseenter', this.toggleWrapperHover);
196
+ EventHandler.remove(wrapper, 'mouseleave', this.toggleWrapperHover);
197
+ };
160
198
  return RibbonColorPicker;
161
199
  }());
162
200
  export { RibbonColorPicker };
@@ -83,13 +83,17 @@ var RibbonComboBox = /** @class */ (function () {
83
83
  RibbonComboBox.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
84
84
  var _this = this;
85
85
  var inputEle = itemEle.querySelector('#' + item.id);
86
+ inputEle.setAttribute('data-control', item.type.toString());
86
87
  var comboBoxObj = getComponent(inputEle, ComboBox);
87
88
  comboBoxObj.setProperties({ cssClass: comboBoxObj.cssClass + SPACE + RIBBON_POPUP_CONTROL });
88
89
  comboBoxObj.close = function (e) {
90
+ var target = e.event ? e.event.target : null;
89
91
  if (item.comboBoxSettings.close) {
90
92
  item.comboBoxSettings.close.call(_this, e);
91
93
  }
92
- overflowButton.toggle();
94
+ if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
95
+ overflowButton.toggle();
96
+ }
93
97
  };
94
98
  };
95
99
  /**
@@ -9,6 +9,8 @@ export declare class RibbonDropDown {
9
9
  constructor(parent: Ribbon);
10
10
  protected getModuleName(): string;
11
11
  protected destroy(): void;
12
+ private itemIndex;
13
+ private enableRtl;
12
14
  /**
13
15
  * Creates DropDown.
14
16
  *
@@ -48,7 +50,11 @@ export declare class RibbonDropDown {
48
50
  * @returns {void}
49
51
  * @hidden
50
52
  */
51
- createOverFlowDropDown(id: string, name: string, iconCss: string, groupEle: HTMLElement, overflowEle: HTMLElement): DropDownButton;
53
+ createOverFlowDropDown(id: string, name: string, iconCss: string, groupEle: HTMLElement, overflowEle: HTMLElement, enableRtl?: boolean): DropDownButton;
54
+ private keyActionHandler;
55
+ private handleNavigation;
56
+ private focusLauncherIcon;
57
+ private updateItemIndex;
52
58
  /**
53
59
  * Removes Overflow DropDown.
54
60
  *
@@ -45,7 +45,11 @@ var RibbonDropDown = /** @class */ (function () {
45
45
  iconCss: dropDownSettings.iconCss,
46
46
  items: dropDownSettings.items,
47
47
  target: dropDownSettings.target,
48
- beforeClose: dropDownSettings.beforeClose,
48
+ beforeClose: function (e) {
49
+ if (dropDownSettings.beforeClose) {
50
+ dropDownSettings.beforeClose.call(_this, e);
51
+ }
52
+ },
49
53
  beforeItemRender: dropDownSettings.beforeItemRender,
50
54
  beforeOpen: dropDownSettings.beforeOpen,
51
55
  close: function (e) {
@@ -70,14 +74,24 @@ var RibbonDropDown = /** @class */ (function () {
70
74
  RibbonDropDown.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
71
75
  var _this = this;
72
76
  var dropdownElement = itemEle.querySelector('#' + item.id);
77
+ dropdownElement.setAttribute('data-control', item.type.toString());
73
78
  var dropdown = getComponent(dropdownElement, DropDownButton);
74
79
  dropdown.cssClass = dropdown.cssClass + SPACE + RIBBON_POPUP_CONTROL;
75
80
  dropdown.dataBind();
81
+ var target;
82
+ dropdown.beforeClose = function (e) {
83
+ if (item.dropDownSettings.beforeClose) {
84
+ item.dropDownSettings.beforeClose.call(_this, e);
85
+ }
86
+ target = e.event ? e.event.target : null;
87
+ };
76
88
  dropdown.close = function (e) {
77
89
  if (item.dropDownSettings.close) {
78
90
  item.dropDownSettings.close.call(_this, e);
79
91
  }
80
- overflowButton.toggle();
92
+ if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
93
+ overflowButton.toggle();
94
+ }
81
95
  };
82
96
  };
83
97
  /**
@@ -101,6 +115,11 @@ var RibbonDropDown = /** @class */ (function () {
101
115
  item.dropDownSettings.close.call(_this, e);
102
116
  }
103
117
  };
118
+ dropdown.beforeClose = function (e) {
119
+ if (item.dropDownSettings.beforeClose) {
120
+ item.dropDownSettings.beforeClose.call(_this, e);
121
+ }
122
+ };
104
123
  };
105
124
  /**
106
125
  * Creates Overflow DropDown.
@@ -113,10 +132,13 @@ var RibbonDropDown = /** @class */ (function () {
113
132
  * @returns {void}
114
133
  * @hidden
115
134
  */
116
- RibbonDropDown.prototype.createOverFlowDropDown = function (id, name, iconCss, groupEle, overflowEle) {
135
+ RibbonDropDown.prototype.createOverFlowDropDown = function (id, name, iconCss, groupEle, overflowEle, enableRtl) {
136
+ var _this = this;
137
+ this.enableRtl = enableRtl;
117
138
  var buttonEle = this.parent.createElement('button', {
118
139
  id: id + OVERFLOW_ID + DROPDOWN_ID
119
140
  });
141
+ groupEle.setAttribute('tabindex', '0');
120
142
  overflowEle.appendChild(buttonEle);
121
143
  var dropdown = new DropDownButton({
122
144
  iconCss: iconCss,
@@ -132,8 +154,155 @@ var RibbonDropDown = /** @class */ (function () {
132
154
  }
133
155
  }, buttonEle);
134
156
  createTooltip(groupEle, this.parent);
157
+ buttonEle.onclick = buttonEle.onkeydown = function () { _this.itemIndex = 0; };
158
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
159
+ groupEle.onkeydown = function (e) { _this.keyActionHandler(e, groupEle), _this; };
135
160
  return dropdown;
136
161
  };
162
+ RibbonDropDown.prototype.keyActionHandler = function (e, target) {
163
+ var items = target.querySelectorAll('.e-control');
164
+ var comboBoxElements = target.querySelectorAll('.e-combobox');
165
+ var comboBoxEle;
166
+ if (comboBoxElements) {
167
+ for (var i = 0; i < comboBoxElements.length; i++) {
168
+ if (comboBoxElements[parseInt(i.toString(), 10)].closest('.e-input-focus')) {
169
+ comboBoxEle = comboBoxElements[parseInt(i.toString(), 10)];
170
+ }
171
+ }
172
+ }
173
+ if (comboBoxEle) {
174
+ for (var i = 0; i < items.length; i++) {
175
+ if (items[parseInt(i.toString(), 10)].classList.contains('e-combobox')) {
176
+ if (items[parseInt(i.toString(), 10)].closest('.e-input-focus')) {
177
+ this.itemIndex = i;
178
+ }
179
+ }
180
+ }
181
+ }
182
+ if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
183
+ e.target.classList.contains('e-ribbon-last-item') || e.target.classList.contains('e-ribbon-first-item')) {
184
+ if (e.key === 'ArrowRight' || (!e.shiftKey && e.key === 'Tab')) {
185
+ this.handleNavigation(e, !this.enableRtl, items);
186
+ }
187
+ if (e.key === 'ArrowLeft' || (e.shiftKey && e.key === 'Tab')) {
188
+ this.handleNavigation(e, this.enableRtl, items);
189
+ }
190
+ }
191
+ };
192
+ RibbonDropDown.prototype.handleNavigation = function (e, enableRtl, items) {
193
+ if (!(items[0].classList.contains('e-ribbon-first-item'))) {
194
+ items[0].classList.add('e-ribbon-first-item');
195
+ }
196
+ if (!(items[items.length - 1].classList.contains('e-ribbon-last-item'))) {
197
+ items[items.length - 1].classList.add('e-ribbon-last-item');
198
+ }
199
+ if (enableRtl) {
200
+ if (this.itemIndex === 0 && items[parseInt(this.itemIndex.toString(), 10)].classList.contains('e-ribbon-first-item')) {
201
+ this.updateItemIndex(e, items, true);
202
+ }
203
+ if (!e.target.classList.contains('e-combobox') && !e.target.classList.contains('e-ribbon-last-item') &&
204
+ !e.target.classList.contains('e-ribbon-group-container') && (e.target.classList.contains('e-ribbon-first-item')
205
+ || this.itemIndex !== 0) && e.target.classList.contains('e-control')) {
206
+ this.itemIndex++;
207
+ this.updateItemIndex(e, items, true);
208
+ }
209
+ if (e.target.classList.contains('e-ribbon-last-item')) {
210
+ var launcherIcon = false;
211
+ launcherIcon = this.focusLauncherIcon(e, items);
212
+ if (!launcherIcon) {
213
+ this.itemIndex = 0;
214
+ this.updateItemIndex(e, items, true);
215
+ }
216
+ }
217
+ if (e.target.classList.contains('e-ribbon-launcher-icon')) {
218
+ this.itemIndex = 0;
219
+ this.updateItemIndex(e, items, true);
220
+ }
221
+ }
222
+ else {
223
+ if (!e.target.classList.contains('e-combobox') && this.itemIndex !== 0) {
224
+ this.itemIndex--;
225
+ this.updateItemIndex(e, items, false);
226
+ }
227
+ if (e.target.classList.contains('e-ribbon-first-item')) {
228
+ var launcherIcon = false;
229
+ launcherIcon = this.focusLauncherIcon(e, items);
230
+ if (!launcherIcon) {
231
+ this.itemIndex = items.length - 1;
232
+ this.updateItemIndex(e, items, false);
233
+ }
234
+ }
235
+ if (e.target.classList.contains('e-ribbon-launcher-icon')) {
236
+ this.itemIndex = items.length - 1;
237
+ this.updateItemIndex(e, items, false);
238
+ }
239
+ }
240
+ if (e.target.classList.contains('e-combobox') && (e.key === 'Tab')) {
241
+ if (enableRtl) {
242
+ if (this.itemIndex < items.length - 1) {
243
+ this.itemIndex++;
244
+ }
245
+ }
246
+ else {
247
+ if (this.itemIndex > 0) {
248
+ this.itemIndex--;
249
+ }
250
+ }
251
+ }
252
+ };
253
+ RibbonDropDown.prototype.focusLauncherIcon = function (e, items) {
254
+ var groupContainer = items[parseInt(this.itemIndex.toString(), 10)].closest('.e-ribbon-group-container');
255
+ var launcherIconEle;
256
+ if (groupContainer) {
257
+ launcherIconEle = groupContainer.querySelector('.e-ribbon-launcher-icon');
258
+ }
259
+ if (launcherIconEle) {
260
+ if (e.key === 'Tab') {
261
+ e.preventDefault();
262
+ }
263
+ groupContainer.querySelector('.e-ribbon-launcher-icon').focus();
264
+ return true;
265
+ }
266
+ else {
267
+ return false;
268
+ }
269
+ };
270
+ RibbonDropDown.prototype.updateItemIndex = function (e, items, enableRtl) {
271
+ var ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
272
+ while (ribbonItem && ribbonItem.classList.contains('e-disabled')) {
273
+ if (enableRtl) {
274
+ if (this.itemIndex < items.length - 1) {
275
+ this.itemIndex++;
276
+ }
277
+ else {
278
+ var launcherIcon = false;
279
+ launcherIcon = this.focusLauncherIcon(e, items);
280
+ if (launcherIcon) {
281
+ break;
282
+ }
283
+ this.itemIndex = 0;
284
+ }
285
+ }
286
+ else {
287
+ if (this.itemIndex > 0) {
288
+ this.itemIndex--;
289
+ }
290
+ else {
291
+ var launcherIcon = false;
292
+ launcherIcon = this.focusLauncherIcon(e, items);
293
+ if (launcherIcon) {
294
+ break;
295
+ }
296
+ this.itemIndex = items.length - 1;
297
+ }
298
+ }
299
+ ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
300
+ }
301
+ if (e.key === 'Tab') {
302
+ e.preventDefault();
303
+ }
304
+ items[parseInt(this.itemIndex.toString(), 10)].focus();
305
+ };
137
306
  /**
138
307
  * Removes Overflow DropDown.
139
308
  *
@@ -236,6 +405,7 @@ var RibbonDropDown = /** @class */ (function () {
236
405
  control.cssClass = prop.cssClass;
237
406
  }
238
407
  delete prop.close;
408
+ delete prop.beforeClose;
239
409
  if (prop.content) {
240
410
  prop.content = itemProp.item.activeSize === RibbonItemSize.Small ? '' : prop.content;
241
411
  }
@@ -43,7 +43,11 @@ var RibbonSplitButton = /** @class */ (function () {
43
43
  iconCss: splitButtonSettings.iconCss,
44
44
  items: splitButtonSettings.items,
45
45
  target: splitButtonSettings.target,
46
- beforeClose: splitButtonSettings.beforeClose,
46
+ beforeClose: function (e) {
47
+ if (splitButtonSettings.beforeClose) {
48
+ splitButtonSettings.beforeClose.call(_this, e);
49
+ }
50
+ },
47
51
  beforeItemRender: splitButtonSettings.beforeItemRender,
48
52
  beforeOpen: splitButtonSettings.beforeOpen,
49
53
  close: function () {
@@ -66,6 +70,13 @@ var RibbonSplitButton = /** @class */ (function () {
66
70
  }
67
71
  }
68
72
  }, buttonEle);
73
+ var dropdownEle = buttonEle.parentElement.querySelector('.e-dropdown-btn');
74
+ dropdownEle.onkeydown = function (e) {
75
+ if (e.key === 'Enter') {
76
+ e.stopImmediatePropagation();
77
+ dropdownEle.click();
78
+ }
79
+ };
69
80
  this.setContent(item, splitbutton);
70
81
  var wrapper = splitbutton['wrapper'];
71
82
  EventHandler.add(wrapper, 'mouseenter', function () { wrapper.classList.add(RIBBON_HOVER); }, this);
@@ -83,9 +94,33 @@ var RibbonSplitButton = /** @class */ (function () {
83
94
  RibbonSplitButton.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
84
95
  var _this = this;
85
96
  var splitButtonEle = itemEle.querySelector('#' + item.id);
97
+ splitButtonEle.setAttribute('data-control', item.type.toString());
86
98
  var splitbutton = getComponent(splitButtonEle, SplitButton);
87
99
  splitbutton.cssClass = splitbutton.cssClass + SPACE + RIBBON_POPUP_CONTROL;
88
100
  splitbutton.dataBind();
101
+ var dropdownEle = splitButtonEle.parentElement.querySelector('.e-dropdown-btn');
102
+ var ddbId = dropdownEle.getAttribute('id');
103
+ var popupEle = document.querySelector('#' + ddbId + '-popup');
104
+ dropdownEle.onkeydown = function (e) {
105
+ if (e.key === 'Enter') {
106
+ e.stopImmediatePropagation();
107
+ dropdownEle.click();
108
+ }
109
+ };
110
+ popupEle.onkeydown = function (e) {
111
+ if (e.key === 'Enter') {
112
+ e.preventDefault();
113
+ splitbutton['wrapper'].classList.remove('e-ribbon-open');
114
+ popupEle.querySelector('.e-focused').click();
115
+ }
116
+ };
117
+ var target;
118
+ splitbutton.beforeClose = function (e) {
119
+ if (item.splitButtonSettings.beforeClose) {
120
+ item.splitButtonSettings.beforeClose.call(_this, e);
121
+ }
122
+ target = e.event ? e.event.target : null;
123
+ };
89
124
  splitbutton.click = function (e) {
90
125
  if (item.splitButtonSettings.click) {
91
126
  item.splitButtonSettings.click.call(_this, e);
@@ -97,7 +132,9 @@ var RibbonSplitButton = /** @class */ (function () {
97
132
  item.splitButtonSettings.close.call(_this, e);
98
133
  }
99
134
  splitbutton['wrapper'].classList.remove(RIBBON_POPUP_OPEN);
100
- overflowButton.toggle();
135
+ if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
136
+ overflowButton.toggle();
137
+ }
101
138
  };
102
139
  };
103
140
  /**
@@ -116,6 +153,11 @@ var RibbonSplitButton = /** @class */ (function () {
116
153
  cssClass = cssClass.filter(function (value) { return value !== RIBBON_POPUP_CONTROL; });
117
154
  splitbutton.cssClass = cssClass.join(SPACE);
118
155
  splitbutton.dataBind();
156
+ splitbutton.beforeClose = function (e) {
157
+ if (item.splitButtonSettings.beforeClose) {
158
+ item.splitButtonSettings.beforeClose.call(_this, e);
159
+ }
160
+ };
119
161
  splitbutton.click = function (e) {
120
162
  if (item.splitButtonSettings.click) {
121
163
  item.splitButtonSettings.click.call(_this, e);
@@ -195,6 +237,7 @@ var RibbonSplitButton = /** @class */ (function () {
195
237
  delete prop.open;
196
238
  delete prop.click;
197
239
  delete prop.close;
240
+ delete prop.beforeClose;
198
241
  control.setProperties(prop);
199
242
  if (prop.content) {
200
243
  this.setContent(itemProp.item, control);
@@ -82,22 +82,25 @@ export interface RibbonComboBoxSettingsModel {
82
82
  * Specifies the template content for the footer container of the popup list.
83
83
  *
84
84
  * @default null
85
+ * @aspType string
85
86
  */
86
- footerTemplate?: string;
87
+ footerTemplate?: string | Function;
87
88
 
88
89
  /**
89
90
  * Specifies the template content for the group headers present in the popup list.
90
91
  *
91
92
  * @default null
93
+ * @aspType string
92
94
  */
93
- groupTemplate?: string;
95
+ groupTemplate?: string | Function;
94
96
 
95
97
  /**
96
98
  * Specifies the template content for the header container of the popup list.
97
99
  *
98
100
  * @default null
101
+ * @aspType string
99
102
  */
100
- headerTemplate?: string;
103
+ headerTemplate?: string | Function;
101
104
 
102
105
  /**
103
106
  * Specifies the index of the selected item in the combobox.
@@ -110,15 +113,17 @@ export interface RibbonComboBoxSettingsModel {
110
113
  * Specifies the template content for each list item present in the popup.
111
114
  *
112
115
  * @default null
116
+ * @aspType string
113
117
  */
114
- itemTemplate?: string;
118
+ itemTemplate?: string | Function;
115
119
 
116
120
  /**
117
121
  * Specifies the template content for the popup list of combobox when no data is available.
118
122
  *
119
123
  * @default 'No records found'
124
+ * @aspType string
120
125
  */
121
- noRecordsTemplate?: string;
126
+ noRecordsTemplate?: string | Function;
122
127
 
123
128
  /**
124
129
  * Specifies a short hint that describes the expected value of the combobox.
@@ -78,20 +78,23 @@ export declare class RibbonComboBoxSettings extends ChildProperty<RibbonComboBox
78
78
  * Specifies the template content for the footer container of the popup list.
79
79
  *
80
80
  * @default null
81
+ * @aspType string
81
82
  */
82
- footerTemplate: string;
83
+ footerTemplate: string | Function;
83
84
  /**
84
85
  * Specifies the template content for the group headers present in the popup list.
85
86
  *
86
87
  * @default null
88
+ * @aspType string
87
89
  */
88
- groupTemplate: string;
90
+ groupTemplate: string | Function;
89
91
  /**
90
92
  * Specifies the template content for the header container of the popup list.
91
93
  *
92
94
  * @default null
95
+ * @aspType string
93
96
  */
94
- headerTemplate: string;
97
+ headerTemplate: string | Function;
95
98
  /**
96
99
  * Specifies the index of the selected item in the combobox.
97
100
  *
@@ -102,14 +105,16 @@ export declare class RibbonComboBoxSettings extends ChildProperty<RibbonComboBox
102
105
  * Specifies the template content for each list item present in the popup.
103
106
  *
104
107
  * @default null
108
+ * @aspType string
105
109
  */
106
- itemTemplate: string;
110
+ itemTemplate: string | Function;
107
111
  /**
108
112
  * Specifies the template content for the popup list of combobox when no data is available.
109
113
  *
110
114
  * @default 'No records found'
115
+ * @aspType string
111
116
  */
112
- noRecordsTemplate: string;
117
+ noRecordsTemplate: string | Function;
113
118
  /**
114
119
  * Specifies a short hint that describes the expected value of the combobox.
115
120
  *
@@ -46,13 +46,15 @@ export interface FileMenuSettingsModel {
46
46
  * Specifies the template for file menu item.
47
47
  *
48
48
  * @default ''
49
+ * @aspType string
49
50
  */
50
- itemTemplate?: string;
51
+ itemTemplate?: string | Function;
51
52
 
52
53
  /**
53
54
  * Specifies the custom content for the file menu popup.
54
55
  *
55
56
  * @default ''
57
+ * @aspType string
56
58
  */
57
59
  popupTemplate?: string | HTMLElement;
58
60
 
@@ -40,12 +40,14 @@ export declare class FileMenuSettings extends ChildProperty<FileMenuSettings> {
40
40
  * Specifies the template for file menu item.
41
41
  *
42
42
  * @default ''
43
+ * @aspType string
43
44
  */
44
- itemTemplate: string;
45
+ itemTemplate: string | Function;
45
46
  /**
46
47
  * Specifies the custom content for the file menu popup.
47
48
  *
48
49
  * @default ''
50
+ * @aspType string
49
51
  */
50
52
  popupTemplate: string | HTMLElement;
51
53
  /**