@syncfusion/ej2-ribbon 23.2.7 → 24.1.41

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 (81) hide show
  1. package/CHANGELOG.md +0 -42
  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 +179 -30
  5. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  6. package/dist/es6/ej2-ribbon.es5.js +179 -30
  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 +13 -13
  12. package/src/ribbon/base/ribbon.d.ts +1 -0
  13. package/src/ribbon/base/ribbon.js +76 -19
  14. package/src/ribbon/items/ribbon-colorpicker.js +16 -0
  15. package/src/ribbon/items/ribbon-combobox.js +16 -0
  16. package/src/ribbon/items/ribbon-dropdown.js +5 -3
  17. package/src/ribbon/items/ribbon-groupbutton.d.ts +3 -1
  18. package/src/ribbon/items/ribbon-groupbutton.js +50 -7
  19. package/src/ribbon/models/ribbon-colorpicker-settings-model.d.ts +8 -1
  20. package/src/ribbon/models/ribbon-colorpicker-settings.d.ts +7 -1
  21. package/src/ribbon/models/ribbon-colorpicker-settings.js +4 -1
  22. package/src/ribbon/models/ribbon-combobox-settings-model.d.ts +7 -0
  23. package/src/ribbon/models/ribbon-combobox-settings.d.ts +6 -0
  24. package/src/ribbon/models/ribbon-combobox-settings.js +3 -0
  25. package/src/ribbon/models/ribbon-group-button-settings-model.d.ts +7 -0
  26. package/src/ribbon/models/ribbon-group-button-settings.d.ts +6 -0
  27. package/src/ribbon/models/ribbon-group-button-settings.js +3 -0
  28. package/src/ribbon/models/ribbon-group-model.d.ts +7 -0
  29. package/src/ribbon/models/ribbon-group.d.ts +6 -0
  30. package/src/ribbon/models/ribbon-group.js +3 -0
  31. package/src/ribbon/modules/ribbon-backstage.js +3 -0
  32. package/styles/bootstrap-dark.css +105 -26
  33. package/styles/bootstrap.css +104 -25
  34. package/styles/bootstrap4.css +104 -25
  35. package/styles/bootstrap5-dark.css +105 -26
  36. package/styles/bootstrap5.css +104 -25
  37. package/styles/fabric-dark.css +103 -24
  38. package/styles/fabric.css +104 -25
  39. package/styles/fluent-dark.css +104 -25
  40. package/styles/fluent.css +104 -25
  41. package/styles/highcontrast-light.css +103 -24
  42. package/styles/highcontrast.css +103 -24
  43. package/styles/material-dark.css +105 -26
  44. package/styles/material.css +105 -26
  45. package/styles/material3-dark.css +105 -26
  46. package/styles/material3.css +105 -26
  47. package/styles/ribbon/_bootstrap-dark-definition.scss +8 -0
  48. package/styles/ribbon/_bootstrap-definition.scss +8 -0
  49. package/styles/ribbon/_bootstrap4-definition.scss +8 -0
  50. package/styles/ribbon/_bootstrap5-definition.scss +8 -0
  51. package/styles/ribbon/_fabric-dark-definition.scss +8 -0
  52. package/styles/ribbon/_fabric-definition.scss +8 -0
  53. package/styles/ribbon/_fluent-definition.scss +8 -0
  54. package/styles/ribbon/_fusionnew-definition.scss +8 -0
  55. package/styles/ribbon/_highcontrast-definition.scss +8 -0
  56. package/styles/ribbon/_highcontrast-light-definition.scss +8 -0
  57. package/styles/ribbon/_layout.scss +69 -5
  58. package/styles/ribbon/_material-dark-definition.scss +9 -1
  59. package/styles/ribbon/_material-definition.scss +9 -1
  60. package/styles/ribbon/_material3-definition.scss +8 -2
  61. package/styles/ribbon/_tailwind-definition.scss +8 -0
  62. package/styles/ribbon/_theme.scss +34 -13
  63. package/styles/ribbon/bootstrap-dark.css +105 -26
  64. package/styles/ribbon/bootstrap.css +104 -25
  65. package/styles/ribbon/bootstrap4.css +104 -25
  66. package/styles/ribbon/bootstrap5-dark.css +105 -26
  67. package/styles/ribbon/bootstrap5.css +104 -25
  68. package/styles/ribbon/fabric-dark.css +103 -24
  69. package/styles/ribbon/fabric.css +104 -25
  70. package/styles/ribbon/fluent-dark.css +104 -25
  71. package/styles/ribbon/fluent.css +104 -25
  72. package/styles/ribbon/highcontrast-light.css +103 -24
  73. package/styles/ribbon/highcontrast.css +103 -24
  74. package/styles/ribbon/material-dark.css +105 -26
  75. package/styles/ribbon/material.css +105 -26
  76. package/styles/ribbon/material3-dark.css +105 -26
  77. package/styles/ribbon/material3.css +105 -26
  78. package/styles/ribbon/tailwind-dark.css +104 -25
  79. package/styles/ribbon/tailwind.css +104 -25
  80. package/styles/tailwind-dark.css +104 -25
  81. package/styles/tailwind.css +104 -25
@@ -244,11 +244,14 @@ __decorate$7([
244
244
  __decorate$7([
245
245
  Property('')
246
246
  ], RibbonColorPickerSettings.prototype, "cssClass", void 0);
247
+ __decorate$7([
248
+ Property('')
249
+ ], RibbonColorPickerSettings.prototype, "label", void 0);
247
250
  __decorate$7([
248
251
  Property(true)
249
252
  ], RibbonColorPickerSettings.prototype, "enableOpacity", void 0);
250
253
  __decorate$7([
251
- Property('Picker')
254
+ Property('Palette')
252
255
  ], RibbonColorPickerSettings.prototype, "mode", void 0);
253
256
  __decorate$7([
254
257
  Property(true)
@@ -319,6 +322,9 @@ __decorate$8([
319
322
  __decorate$8([
320
323
  Property('')
321
324
  ], RibbonComboBoxSettings.prototype, "cssClass", void 0);
325
+ __decorate$8([
326
+ Property('')
327
+ ], RibbonComboBoxSettings.prototype, "label", void 0);
322
328
  __decorate$8([
323
329
  Property([])
324
330
  ], RibbonComboBoxSettings.prototype, "dataSource", void 0);
@@ -598,6 +604,9 @@ var __decorate$12 = (undefined && undefined.__decorate) || function (decorators,
598
604
  */
599
605
  class RibbonGroupButtonSettings extends ChildProperty {
600
606
  }
607
+ __decorate$12([
608
+ Property('')
609
+ ], RibbonGroupButtonSettings.prototype, "header", void 0);
601
610
  __decorate$12([
602
611
  Property('Single')
603
612
  ], RibbonGroupButtonSettings.prototype, "selection", void 0);
@@ -751,6 +760,9 @@ __decorate$2([
751
760
  __decorate$2([
752
761
  Property('Column')
753
762
  ], RibbonGroup.prototype, "orientation", void 0);
763
+ __decorate$2([
764
+ Property('')
765
+ ], RibbonGroup.prototype, "overflowHeader", void 0);
754
766
  __decorate$2([
755
767
  Property(0)
756
768
  ], RibbonGroup.prototype, "priority", void 0);
@@ -1517,6 +1529,15 @@ class RibbonColorPicker {
1517
1529
  * @hidden
1518
1530
  */
1519
1531
  addOverFlowEvents(item, itemEle, overflowButton) {
1532
+ let colorPickerSettings = item.colorPickerSettings;
1533
+ if (colorPickerSettings.label && this.parent.activeLayout === 'Simplified') {
1534
+ const label = this.parent.createElement('div', {
1535
+ className: 'e-ribbon-colorpicker-label',
1536
+ id: item.id + '_label',
1537
+ innerHTML: colorPickerSettings.label
1538
+ });
1539
+ itemEle.insertBefore(label, itemEle.firstChild);
1540
+ }
1520
1541
  const colorPickerEle = itemEle.querySelector('#' + item.id);
1521
1542
  colorPickerEle.setAttribute('data-control', item.type.toString());
1522
1543
  const colorPickerObj = getComponent(colorPickerEle, ColorPicker);
@@ -1546,6 +1567,13 @@ class RibbonColorPicker {
1546
1567
  * @hidden
1547
1568
  */
1548
1569
  removeOverFlowEvents(item, itemEle) {
1570
+ let colorPickerSettings = item.colorPickerSettings;
1571
+ if (colorPickerSettings.label) {
1572
+ const label = itemEle.querySelector('#' + item.id + '_label');
1573
+ if (label) {
1574
+ label.remove();
1575
+ }
1576
+ }
1549
1577
  const colorPickerEle = itemEle.querySelector('#' + item.id);
1550
1578
  const colorPickerObj = getComponent(colorPickerEle, ColorPicker);
1551
1579
  let cssClass = colorPickerObj.cssClass.split(SPACE);
@@ -1708,6 +1736,15 @@ class RibbonComboBox {
1708
1736
  * @hidden
1709
1737
  */
1710
1738
  addOverFlowEvents(item, itemEle, overflowButton) {
1739
+ const comboBoxSettings = item.comboBoxSettings;
1740
+ if (comboBoxSettings.label && this.parent.activeLayout === 'Simplified') {
1741
+ const label = this.parent.createElement('div', {
1742
+ className: 'e-ribbon-combobox-label',
1743
+ id: item.id + '_label',
1744
+ innerHTML: comboBoxSettings.label
1745
+ });
1746
+ itemEle.insertBefore(label, itemEle.firstChild);
1747
+ }
1711
1748
  const inputEle = itemEle.querySelector('#' + item.id);
1712
1749
  inputEle.setAttribute('data-control', item.type.toString());
1713
1750
  const comboBoxObj = getComponent(inputEle, ComboBox);
@@ -1731,6 +1768,13 @@ class RibbonComboBox {
1731
1768
  * @hidden
1732
1769
  */
1733
1770
  removeOverFlowEvents(item, itemEle) {
1771
+ const comboBoxSettings = item.comboBoxSettings;
1772
+ if (comboBoxSettings.label) {
1773
+ const label = itemEle.querySelector('#' + item.id + '_label');
1774
+ if (label) {
1775
+ label.remove();
1776
+ }
1777
+ }
1734
1778
  const inputEle = itemEle.querySelector('#' + item.id);
1735
1779
  const comboBoxObj = getComponent(inputEle, ComboBox);
1736
1780
  let cssClass = comboBoxObj.cssClass.split(SPACE);
@@ -1967,7 +2011,9 @@ class RibbonDropDown {
1967
2011
  return dropdown;
1968
2012
  }
1969
2013
  keyActionHandler(e, target) {
1970
- const items = target.querySelectorAll('.e-control');
2014
+ const controlElements = Array.prototype.slice.call(target.querySelectorAll('.e-control'));
2015
+ const templateElements = Array.prototype.slice.call(target.querySelectorAll('.e-ribbon-template'));
2016
+ const items = controlElements.concat(templateElements);
1971
2017
  const comboBoxElements = target.querySelectorAll('.e-combobox');
1972
2018
  let comboBoxEle;
1973
2019
  if (comboBoxElements) {
@@ -1986,7 +2032,7 @@ class RibbonDropDown {
1986
2032
  }
1987
2033
  }
1988
2034
  }
1989
- if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
2035
+ if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-launcher-icon') ||
1990
2036
  e.target.classList.contains('e-ribbon-last-item') || e.target.classList.contains('e-ribbon-first-item')) {
1991
2037
  if (e.key === 'ArrowRight' || (!e.shiftKey && e.key === 'Tab')) {
1992
2038
  this.handleNavigation(e, !this.enableRtl, items);
@@ -2009,7 +2055,7 @@ class RibbonDropDown {
2009
2055
  }
2010
2056
  if (!e.target.classList.contains('e-combobox') && !e.target.classList.contains('e-ribbon-last-item') &&
2011
2057
  !e.target.classList.contains('e-ribbon-group-container') && (e.target.classList.contains('e-ribbon-first-item')
2012
- || this.itemIndex !== 0) && e.target.classList.contains('e-control')) {
2058
+ || this.itemIndex !== 0) && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template'))) {
2013
2059
  this.itemIndex++;
2014
2060
  this.updateItemIndex(e, items, true);
2015
2061
  }
@@ -2943,13 +2989,17 @@ class RibbonGroupButton {
2943
2989
  }
2944
2990
  count++;
2945
2991
  }
2946
- new DropDownButton({
2992
+ const dropdown = new DropDownButton({
2947
2993
  iconCss: dropdownIcon,
2948
2994
  target: btnContainerEle,
2949
2995
  enableRtl: this.parent.enableRtl,
2950
2996
  cssClass: 'e-ribbon-dropdown-group-button',
2951
2997
  disabled: item.disabled
2952
2998
  }, buttonEle);
2999
+ if (groupBtnSettings.header) {
3000
+ const dropDownPopup = dropdown.dropDown;
3001
+ this.addGroupButtonHeader(item.id, groupBtnSettings, dropDownPopup.element);
3002
+ }
2953
3003
  buttonEle.onclick = buttonEle.onkeydown = () => {
2954
3004
  if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
2955
3005
  document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
@@ -2966,7 +3016,9 @@ class RibbonGroupButton {
2966
3016
  }
2967
3017
  }
2968
3018
  groupButtonClicked(itemIndex, item, grpBtnSettings) {
2969
- const previousItems = [], selectingItems = [], selectedItems = [];
3019
+ const previousItems = [];
3020
+ const selectingItems = [];
3021
+ const selectedItems = [];
2970
3022
  let groupButtonEle;
2971
3023
  let dropdown;
2972
3024
  for (let j = 0; j < grpBtnSettings.items.length; j++) {
@@ -2997,9 +3049,11 @@ class RibbonGroupButton {
2997
3049
  for (let j = 0; j < grpBtnSettings.items.length; j++) {
2998
3050
  if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.contains('e-active')) {
2999
3051
  document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.remove('e-active');
3052
+ grpBtnSettings.items[parseInt(j.toString(), 10)].selected = false;
3000
3053
  }
3001
3054
  }
3002
3055
  document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
3056
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = true;
3003
3057
  if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active') && this.parent.activeLayout === 'Simplified') {
3004
3058
  this.grpBtnIndex = itemIndex;
3005
3059
  groupButtonEle = document.querySelector('#' + item.id);
@@ -3015,6 +3069,12 @@ class RibbonGroupButton {
3015
3069
  document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.add(RIBBON_MULTIPLE_BUTTON_SELECTION);
3016
3070
  }
3017
3071
  document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
3072
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active')) {
3073
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = true;
3074
+ }
3075
+ else {
3076
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = false;
3077
+ }
3018
3078
  let activeEleCount = 0;
3019
3079
  for (let n = 0; n < grpBtnSettings.items.length; n++) {
3020
3080
  if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n).classList.contains('e-active') && this.parent.activeLayout === 'Simplified' && n !== itemIndex) {
@@ -3102,13 +3162,17 @@ class RibbonGroupButton {
3102
3162
  }
3103
3163
  itemsCount++;
3104
3164
  }
3105
- new DropDownButton({
3165
+ const dropdown = new DropDownButton({
3106
3166
  iconCss: dropdownIcon,
3107
3167
  target: containerEle,
3108
3168
  enableRtl: this.parent.enableRtl,
3109
3169
  cssClass: 'e-ribbon-dropdown-group-button',
3110
3170
  disabled: item.disabled
3111
3171
  }, buttonEle);
3172
+ if (groupBtnSettings.header) {
3173
+ const dropDownPopup = dropdown.dropDown;
3174
+ this.addGroupButtonHeader(item.id, groupBtnSettings, dropDownPopup.element);
3175
+ }
3112
3176
  buttonEle.onclick = buttonEle.onkeydown = () => {
3113
3177
  if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
3114
3178
  document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
@@ -3132,6 +3196,14 @@ class RibbonGroupButton {
3132
3196
  }
3133
3197
  }
3134
3198
  }
3199
+ addGroupButtonHeader(itemID, groupBtnSettings, popupEle) {
3200
+ const groupButtonHeader = this.parent.createElement('div', {
3201
+ className: 'e-ribbon-groupbutton-header',
3202
+ id: itemID + HEADER_ID,
3203
+ innerHTML: groupBtnSettings.header
3204
+ });
3205
+ popupEle.insertBefore(groupButtonHeader, popupEle.firstChild);
3206
+ }
3135
3207
  handleGroupButtonNavigation(e, item) {
3136
3208
  const groupButtonEle = document.querySelector('#' + item.id);
3137
3209
  const dropdown = getComponent(groupButtonEle, DropDownButton);
@@ -3197,15 +3269,28 @@ class RibbonGroupButton {
3197
3269
  * @returns {void}
3198
3270
  * @hidden
3199
3271
  */
3200
- addOverFlowEvents(item, itemEle) {
3272
+ addOverFlowEvents(item, itemEle, overflowButton) {
3273
+ const groupBtnSettings = item.groupButtonSettings;
3274
+ let isIconOnly = true;
3201
3275
  const groupButtonEle = itemEle.querySelector('#' + item.id);
3202
3276
  const dropdown = getComponent(groupButtonEle, DropDownButton);
3203
- dropdown.setProperties({ cssClass: dropdown.cssClass + SPACE + RIBBON_GROUP_BUTTON_OVERFLOW_POPUP });
3277
+ dropdown.setProperties({ cssClass: dropdown.cssClass + SPACE + RIBBON_GROUP_BUTTON_OVERFLOW_POPUP, content: groupBtnSettings.header ? groupBtnSettings.header : '' });
3204
3278
  const targetEle = dropdown.target;
3279
+ if (targetEle.children.length) {
3280
+ for (let i = 0; i < targetEle.children.length; i++) {
3281
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].content) {
3282
+ isIconOnly = false;
3283
+ break;
3284
+ }
3285
+ }
3286
+ if (isIconOnly) {
3287
+ targetEle.classList.add('e-icon-btn');
3288
+ }
3289
+ }
3205
3290
  targetEle.onclick = () => {
3206
3291
  if (this.parent.activeLayout === 'Simplified' && targetEle.closest('.e-ribbon-dropdown-group-button').classList.contains(RIBBON_GROUP_BUTTON_OVERFLOW_POPUP)) {
3207
- dropdown.element.focus();
3208
3292
  dropdown.toggle();
3293
+ overflowButton.toggle();
3209
3294
  }
3210
3295
  };
3211
3296
  }
@@ -3221,9 +3306,13 @@ class RibbonGroupButton {
3221
3306
  const groupButtonEle = itemEle.querySelector('#' + item.id);
3222
3307
  if (groupButtonEle) {
3223
3308
  const dropdown = getComponent(groupButtonEle, DropDownButton);
3309
+ const targetEle = dropdown.target;
3310
+ if (targetEle.classList.contains('e-icon-btn')) {
3311
+ targetEle.classList.remove('e-icon-btn');
3312
+ }
3224
3313
  let cssClass = dropdown.cssClass.split(SPACE);
3225
3314
  cssClass = cssClass.filter((value) => value !== RIBBON_GROUP_BUTTON_OVERFLOW_POPUP);
3226
- dropdown.setProperties({ cssClass: cssClass.join(SPACE) });
3315
+ dropdown.setProperties({ cssClass: cssClass.join(SPACE), content: '' });
3227
3316
  }
3228
3317
  }
3229
3318
  /**
@@ -3379,7 +3468,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3379
3468
  e.preventDefault();
3380
3469
  }
3381
3470
  const activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
3382
- const ribbonControls = activeContent.querySelectorAll('.e-control');
3471
+ const controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
3472
+ const templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
3473
+ const ribbonControls = controlElements.concat(templateElements);
3383
3474
  const comboBoxElements = activeContent.querySelectorAll('.e-combobox');
3384
3475
  let comboBoxEle;
3385
3476
  if (comboBoxElements) {
@@ -3408,7 +3499,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3408
3499
  if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
3409
3500
  e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
3410
3501
  e.target.classList.contains('e-ribbon-first-item') || e.target.classList.contains('e-ribbon-group-of-btn') ||
3411
- e.target.classList.contains('e-ribbon-overall-of-btn')) {
3502
+ e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template')) {
3412
3503
  switch (e.action) {
3413
3504
  case 'rightarrow':
3414
3505
  this.handleNavigation(e, !this.enableRtl, ribbonControls);
@@ -3450,7 +3541,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3450
3541
  }
3451
3542
  }
3452
3543
  if ((!enableRtl && (this.currentControlIndex > 0)) || (enableRtl && (this.currentControlIndex < ribbonControls.length - 1))) {
3453
- if (!e.target.classList.contains('e-combobox') && e.target.classList.contains('e-control') && !e.target.classList.contains('e-ribbon-last-item')) {
3544
+ if (!e.target.classList.contains('e-combobox') && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template')) && !e.target.classList.contains('e-ribbon-last-item')) {
3454
3545
  if (enableRtl) {
3455
3546
  this.currentControlIndex++;
3456
3547
  }
@@ -3484,7 +3575,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3484
3575
  }
3485
3576
  if (launcherIconEle) {
3486
3577
  const items = groupContainer.querySelectorAll('.e-ribbon-item');
3487
- items[items.length - 1].querySelector('.e-control').classList.add('e-ribbon-last-item');
3578
+ const elem = items[items.length - 1].querySelector('.e-control');
3579
+ if (elem) {
3580
+ elem.classList.add('e-ribbon-last-item');
3581
+ }
3488
3582
  }
3489
3583
  }
3490
3584
  else {
@@ -3597,6 +3691,15 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3597
3691
  const scrollEle = this.tabObj.element.querySelector('.' + HORIZONTAL_SCROLLBAR);
3598
3692
  this.scrollModule.scrollStep = scrollEle.offsetWidth;
3599
3693
  }
3694
+ if (this.activeLayout === 'Simplified') {
3695
+ const activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
3696
+ if (activePopup.length) {
3697
+ for (let i = 0; i < activePopup.length; i++) {
3698
+ const dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
3699
+ dropDownBtn.toggle();
3700
+ }
3701
+ }
3702
+ }
3600
3703
  }
3601
3704
  renderTabs() {
3602
3705
  this.tabsInternal = this.tabs.slice();
@@ -3920,7 +4023,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3920
4023
  }
3921
4024
  if (overflowDDB) {
3922
4025
  if (group.enableGroupOverflow) {
3923
- if (overflowtarget.childElementCount === 0) {
4026
+ if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
3924
4027
  this.removeOverflowButton(overflowDDB);
3925
4028
  }
3926
4029
  }
@@ -3992,6 +4095,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3992
4095
  }
3993
4096
  createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
3994
4097
  let overflowButton;
4098
+ const itemProp = getGroup(this.tabs, groupId);
3995
4099
  const contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
3996
4100
  const groupEle = contentEle.querySelector('#' + groupId);
3997
4101
  if (isGroupOF) {
@@ -4005,6 +4109,17 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4005
4109
  overflowButton = getInstance(overflowDDB, DropDownButton);
4006
4110
  }
4007
4111
  const overflowBtnTarget = overflowButton.target;
4112
+ let headerEle = overflowBtnTarget.querySelector('#' + groupId + GROUPOF_BUTTON_ID + HEADER_ID);
4113
+ if (!headerEle) {
4114
+ if (itemProp.group.overflowHeader) {
4115
+ const groupHeader = this.createElement('div', {
4116
+ className: RIBBON_OVERFLOW_HEADER,
4117
+ id: groupId + GROUPOF_BUTTON_ID + HEADER_ID,
4118
+ innerHTML: itemProp.group.overflowHeader
4119
+ });
4120
+ overflowBtnTarget.append(groupHeader);
4121
+ }
4122
+ }
4008
4123
  if (groupEle) {
4009
4124
  if (groupEle.classList.contains('e-disabled')) {
4010
4125
  overflowBtnTarget.classList.add('e-disabled');
@@ -4033,7 +4148,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4033
4148
  if (ofTabContainer) {
4034
4149
  let ofGroupContainer = overflowEle.querySelector('#' + groupId + CONTAINER_ID);
4035
4150
  if (!ofGroupContainer) {
4036
- ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
4151
+ ofGroupContainer = itemProp.group.overflowHeader ? this.createGroupContainer(groupId, itemProp.group.overflowHeader) : this.createGroupContainer(groupId, groupHeader);
4037
4152
  if (groupEle) {
4038
4153
  if (groupEle.classList.contains('e-disabled')) {
4039
4154
  ofGroupContainer.classList.add('e-disabled');
@@ -4081,7 +4196,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4081
4196
  break;
4082
4197
  case 'GroupButton':
4083
4198
  if (this.activeLayout === 'Simplified') {
4084
- this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle);
4199
+ this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
4085
4200
  break;
4086
4201
  }
4087
4202
  }
@@ -4093,7 +4208,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4093
4208
  });
4094
4209
  const overflowtarget = this.overflowDDB.target;
4095
4210
  overflowtarget.append(ofTabContainer);
4096
- const ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
4211
+ const itemProp = getGroup(this.tabs, groupId);
4212
+ let ofGroupContainer = itemProp.group.overflowHeader ? this.createGroupContainer(groupId, itemProp.group.overflowHeader) : this.createGroupContainer(groupId, groupHeader);
4097
4213
  ofGroupContainer.append(itemEle);
4098
4214
  ofTabContainer.append(ofGroupContainer);
4099
4215
  if (tabIndex === this.selectedTab) {
@@ -4925,9 +5041,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4925
5041
  },
4926
5042
  beforeClose: (args) => {
4927
5043
  const ele = args.event ? closest(args.event.target, '.' + RIBBON_POPUP_CONTROL) : null;
5044
+ const groupButtonEle = args.event ? closest(args.event.target, '.e-ribbon-group-button-overflow-popup') : null;
4928
5045
  const eventArgs = { element: args.element, event: args.event, cancel: args.cancel };
4929
5046
  this.trigger('overflowPopupClose', eventArgs, (ribbonArgs) => {
4930
- if (ele || ribbonArgs.cancel) {
5047
+ if (ele || ribbonArgs.cancel || groupButtonEle) {
4931
5048
  args.cancel = true;
4932
5049
  }
4933
5050
  });
@@ -4949,8 +5066,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4949
5066
  const currentList = target.querySelector('.e-ribbon-of-tab.e-ribbon-active');
4950
5067
  items = currentList.getElementsByClassName('e-ribbon-item');
4951
5068
  }
4952
- const comboBoxEle = items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-control').classList.contains('e-combobox') ? items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-combobox') : null;
5069
+ const control = items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-control');
5070
+ const comboBoxEle = control && control.classList.contains('e-combobox') ? items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-combobox') : null;
4953
5071
  let ribbonItem;
5072
+ let templateEle;
4954
5073
  if (comboBoxEle === null || (e.key === 'Tab') || this.itemIndex < 0) {
4955
5074
  if (e.key === 'ArrowDown' || (!e.shiftKey && e.key === 'Tab')) {
4956
5075
  if ((!this.itemIndex && this.itemIndex !== 0) || this.itemIndex < 0 || this.itemIndex === items.length - 1) {
@@ -4959,13 +5078,21 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4959
5078
  this.findDisabledItem(ribbonItem, items, true);
4960
5079
  if (comboBoxEle && e.key === 'Tab') {
4961
5080
  e.preventDefault();
4962
- items[this.itemIndex].querySelector('.e-control').focus();
5081
+ const item = items[this.itemIndex].querySelector('.e-control');
5082
+ if (item) {
5083
+ item.focus();
5084
+ }
4963
5085
  }
5086
+ templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
4964
5087
  }
4965
5088
  else if (this.itemIndex < items.length - 1 && this.itemIndex >= 0) {
4966
5089
  this.itemIndex++;
4967
5090
  ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
4968
5091
  this.findDisabledItem(ribbonItem, items, true);
5092
+ templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
5093
+ }
5094
+ if (templateEle) {
5095
+ templateEle.focus();
4969
5096
  }
4970
5097
  }
4971
5098
  else if (e.key === 'ArrowUp' || (e.shiftKey && e.key === 'Tab')) {
@@ -4976,20 +5103,32 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4976
5103
  this.findDisabledItem(ribbonItem, items, false);
4977
5104
  if (comboBoxEle && (e.shiftKey && e.key === 'Tab')) {
4978
5105
  e.preventDefault();
4979
- items[this.itemIndex].querySelector('.e-control').focus();
5106
+ const item = items[this.itemIndex].querySelector('.e-control');
5107
+ if (item) {
5108
+ item.focus();
5109
+ }
4980
5110
  }
5111
+ templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
4981
5112
  }
4982
5113
  else if (this.itemIndex <= items.length - 1 && this.itemIndex > 0) {
4983
5114
  this.itemIndex--;
4984
5115
  ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
4985
5116
  this.findDisabledItem(ribbonItem, items, false);
5117
+ templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
5118
+ }
5119
+ if (templateEle) {
5120
+ templateEle.focus();
4986
5121
  }
4987
5122
  }
4988
5123
  }
4989
5124
  target.setAttribute('index', this.itemIndex.toString());
4990
5125
  }
4991
5126
  const currentItemIndex = parseInt(target.getAttribute('index'), 10);
4992
- const itemType = items[parseInt(currentItemIndex.toString(), 10)] ? items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control').getAttribute('data-control') : null;
5127
+ let itemType = "";
5128
+ const controlItem = items[parseInt(currentItemIndex.toString(), 10)] ? items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control') : null;
5129
+ if (controlItem) {
5130
+ itemType = controlItem.getAttribute('data-control');
5131
+ }
4993
5132
  if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === ' ' || e.key === 'Tab') {
4994
5133
  if (itemType === 'ColorPicker') {
4995
5134
  if (e.key === 'Tab') {
@@ -5001,7 +5140,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5001
5140
  if (e.key === 'Tab') {
5002
5141
  e.preventDefault();
5003
5142
  }
5004
- items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control').focus();
5143
+ const elem = items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control');
5144
+ if (elem) {
5145
+ elem.focus();
5146
+ }
5005
5147
  }
5006
5148
  if (e.key === ' ' && (itemType === 'CheckBox')) {
5007
5149
  const checkBoxEle = items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control');
@@ -5383,7 +5525,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5383
5525
  this.setItemSize(ele, item);
5384
5526
  }
5385
5527
  if (group.enableGroupOverflow && overflowDDB) {
5386
- if (overflowtarget.childElementCount === 0) {
5528
+ if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
5387
5529
  this.removeOverflowButton(overflowDDB);
5388
5530
  }
5389
5531
  }
@@ -5666,7 +5808,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5666
5808
  createTemplateContent(item, itemElement) {
5667
5809
  const itemEle = this.createElement('div', {
5668
5810
  className: item.cssClass ? (RIBBON_TEMPLATE + SPACE + item.cssClass) : RIBBON_TEMPLATE,
5669
- id: item.id
5811
+ id: item.id,
5812
+ attrs: { 'tabindex': '-1' }
5670
5813
  });
5671
5814
  if (item.disabled) {
5672
5815
  itemEle.classList.add(DISABLED_CSS);
@@ -6127,7 +6270,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6127
6270
  }
6128
6271
  if (this.activeLayout === RibbonLayout.Simplified) {
6129
6272
  if (itemProp.group.enableGroupOverflow) {
6130
- if (dropdown.target.childElementCount === 0) {
6273
+ if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
6131
6274
  this.removeOverflowButton(dropdown);
6132
6275
  }
6133
6276
  }
@@ -6154,6 +6297,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6154
6297
  this.refreshLayout();
6155
6298
  }
6156
6299
  }
6300
+ isHeaderVisible(headerEle, groupID) {
6301
+ return headerEle.querySelector('#' + groupID + GROUPOF_BUTTON_ID + HEADER_ID) ? true : false;
6302
+ }
6157
6303
  /**
6158
6304
  * Hides a specific group within a ribbon tab.
6159
6305
  *
@@ -6707,7 +6853,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6707
6853
  }
6708
6854
  if (this.activeLayout === RibbonLayout.Simplified) {
6709
6855
  if (itemProp.group.enableGroupOverflow) {
6710
- if (dropdown.target.childElementCount === 0) {
6856
+ if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
6711
6857
  this.removeOverflowButton(dropdown);
6712
6858
  }
6713
6859
  }
@@ -6925,7 +7071,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6925
7071
  }
6926
7072
  this.createRibbonItem(ribbonItem, itemContainer);
6927
7073
  if (this.activeLayout === 'Simplified' && itemProp.group.enableGroupOverflow) {
6928
- if (dropdown.target.childElementCount === 0) {
7074
+ if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
6929
7075
  this.removeOverflowButton(dropdown);
6930
7076
  }
6931
7077
  }
@@ -7909,6 +8055,9 @@ class RibbonBackstage extends Component {
7909
8055
  this.closeBtn.setProperties(commonProp);
7910
8056
  }
7911
8057
  }
8058
+ if (this.footerMenuCtrl) {
8059
+ this.footerMenuCtrl.setProperties(commonProp);
8060
+ }
7912
8061
  }
7913
8062
  }
7914
8063
  }