@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
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.2.7
3
+ * version : 24.1.41
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-ribbon@*",
3
- "_id": "@syncfusion/ej2-ribbon@23.2.5",
3
+ "_id": "@syncfusion/ej2-ribbon@21.27.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-yaxRdEtxHw8Ko6CIOCA3KeaoQuBu8pNB/hDtISHgRg+VlFVdvfxy450RiOQFaN8ivXOiwi7jyGT4NvHA4E+qlA==",
5
+ "_integrity": "sha512-Yp291W26tAmLS4Vev1bAKc12r3ExMoy1eV3QNuoxM4mysAxjyUBRN0MjP4w8xpLrGgBZqosG3G7Ewc/IphDVww==",
6
6
  "_location": "/@syncfusion/ej2-ribbon",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,10 +23,10 @@
23
23
  "/@syncfusion/ej2-react-ribbon",
24
24
  "/@syncfusion/ej2-vue-ribbon"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-ribbon/-/ej2-ribbon-23.2.5.tgz",
27
- "_shasum": "249585a25ef9d78e2207bdcecd2ee38fd2d74c05",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-ribbon/-/ej2-ribbon-21.27.0.tgz",
27
+ "_shasum": "93461696848f6b7ca64be65ee903922584f6b52c",
28
28
  "_spec": "@syncfusion/ej2-ribbon@*",
29
- "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
29
+ "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~23.2.6",
39
- "@syncfusion/ej2-buttons": "~23.2.7",
40
- "@syncfusion/ej2-dropdowns": "~23.2.7",
41
- "@syncfusion/ej2-lists": "~23.2.4",
42
- "@syncfusion/ej2-navigations": "~23.2.7",
43
- "@syncfusion/ej2-popups": "~23.2.4",
44
- "@syncfusion/ej2-splitbuttons": "~23.2.4"
38
+ "@syncfusion/ej2-base": "~24.1.41",
39
+ "@syncfusion/ej2-buttons": "~24.1.41",
40
+ "@syncfusion/ej2-dropdowns": "~24.1.41",
41
+ "@syncfusion/ej2-lists": "~24.1.41",
42
+ "@syncfusion/ej2-navigations": "~24.1.41",
43
+ "@syncfusion/ej2-popups": "~24.1.41",
44
+ "@syncfusion/ej2-splitbuttons": "~24.1.41"
45
45
  },
46
46
  "deprecated": false,
47
47
  "description": "Essential JS 2 Component",
@@ -62,6 +62,6 @@
62
62
  "url": "git+https://github.com/syncfusion/ej2-ribbon-component.git"
63
63
  },
64
64
  "typings": "index.d.ts",
65
- "version": "23.2.7",
65
+ "version": "24.1.41",
66
66
  "sideEffects": false
67
67
  }
@@ -383,6 +383,7 @@ export declare class Ribbon extends Component<HTMLElement> implements INotifyPro
383
383
  * @returns {void}
384
384
  */
385
385
  removeGroup(groupId: string): void;
386
+ private isHeaderVisible;
386
387
  /**
387
388
  * Hides a specific group within a ribbon tab.
388
389
  *
@@ -132,7 +132,9 @@ var Ribbon = /** @class */ (function (_super) {
132
132
  e.preventDefault();
133
133
  }
134
134
  var activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + constants.CONTENT_ID);
135
- var ribbonControls = activeContent.querySelectorAll('.e-control');
135
+ var controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
136
+ var templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
137
+ var ribbonControls = controlElements.concat(templateElements);
136
138
  var comboBoxElements = activeContent.querySelectorAll('.e-combobox');
137
139
  var comboBoxEle;
138
140
  if (comboBoxElements) {
@@ -161,7 +163,7 @@ var Ribbon = /** @class */ (function (_super) {
161
163
  if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
162
164
  e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
163
165
  e.target.classList.contains('e-ribbon-first-item') || e.target.classList.contains('e-ribbon-group-of-btn') ||
164
- e.target.classList.contains('e-ribbon-overall-of-btn')) {
166
+ e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template')) {
165
167
  switch (e.action) {
166
168
  case 'rightarrow':
167
169
  this.handleNavigation(e, !this.enableRtl, ribbonControls);
@@ -203,7 +205,7 @@ var Ribbon = /** @class */ (function (_super) {
203
205
  }
204
206
  }
205
207
  if ((!enableRtl && (this.currentControlIndex > 0)) || (enableRtl && (this.currentControlIndex < ribbonControls.length - 1))) {
206
- if (!e.target.classList.contains('e-combobox') && e.target.classList.contains('e-control') && !e.target.classList.contains('e-ribbon-last-item')) {
208
+ 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')) {
207
209
  if (enableRtl) {
208
210
  this.currentControlIndex++;
209
211
  }
@@ -237,7 +239,10 @@ var Ribbon = /** @class */ (function (_super) {
237
239
  }
238
240
  if (launcherIconEle) {
239
241
  var items = groupContainer.querySelectorAll('.e-ribbon-item');
240
- items[items.length - 1].querySelector('.e-control').classList.add('e-ribbon-last-item');
242
+ var elem = items[items.length - 1].querySelector('.e-control');
243
+ if (elem) {
244
+ elem.classList.add('e-ribbon-last-item');
245
+ }
241
246
  }
242
247
  }
243
248
  else {
@@ -350,6 +355,15 @@ var Ribbon = /** @class */ (function (_super) {
350
355
  var scrollEle = this.tabObj.element.querySelector('.' + constants.HORIZONTAL_SCROLLBAR);
351
356
  this.scrollModule.scrollStep = scrollEle.offsetWidth;
352
357
  }
358
+ if (this.activeLayout === 'Simplified') {
359
+ var activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
360
+ if (activePopup.length) {
361
+ for (var i = 0; i < activePopup.length; i++) {
362
+ var dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
363
+ dropDownBtn.toggle();
364
+ }
365
+ }
366
+ }
353
367
  };
354
368
  Ribbon.prototype.renderTabs = function () {
355
369
  this.tabsInternal = this.tabs.slice();
@@ -675,7 +689,7 @@ var Ribbon = /** @class */ (function (_super) {
675
689
  }
676
690
  if (overflowDDB) {
677
691
  if (group.enableGroupOverflow) {
678
- if (overflowtarget.childElementCount === 0) {
692
+ if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
679
693
  this.removeOverflowButton(overflowDDB);
680
694
  }
681
695
  }
@@ -747,6 +761,7 @@ var Ribbon = /** @class */ (function (_super) {
747
761
  };
748
762
  Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
749
763
  var overflowButton;
764
+ var itemProp = getGroup(this.tabs, groupId);
750
765
  var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
751
766
  var groupEle = contentEle.querySelector('#' + groupId);
752
767
  if (isGroupOF) {
@@ -760,6 +775,17 @@ var Ribbon = /** @class */ (function (_super) {
760
775
  overflowButton = getInstance(overflowDDB, DropDownButton);
761
776
  }
762
777
  var overflowBtnTarget = overflowButton.target;
778
+ var headerEle = overflowBtnTarget.querySelector('#' + groupId + constants.GROUPOF_BUTTON_ID + constants.HEADER_ID);
779
+ if (!headerEle) {
780
+ if (itemProp.group.overflowHeader) {
781
+ var groupHeader_1 = this.createElement('div', {
782
+ className: constants.RIBBON_OVERFLOW_HEADER,
783
+ id: groupId + constants.GROUPOF_BUTTON_ID + constants.HEADER_ID,
784
+ innerHTML: itemProp.group.overflowHeader
785
+ });
786
+ overflowBtnTarget.append(groupHeader_1);
787
+ }
788
+ }
763
789
  if (groupEle) {
764
790
  if (groupEle.classList.contains('e-disabled')) {
765
791
  overflowBtnTarget.classList.add('e-disabled');
@@ -788,7 +814,7 @@ var Ribbon = /** @class */ (function (_super) {
788
814
  if (ofTabContainer) {
789
815
  var ofGroupContainer = overflowEle.querySelector('#' + groupId + constants.CONTAINER_ID);
790
816
  if (!ofGroupContainer) {
791
- ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
817
+ ofGroupContainer = itemProp.group.overflowHeader ? this.createGroupContainer(groupId, itemProp.group.overflowHeader) : this.createGroupContainer(groupId, groupHeader);
792
818
  if (groupEle) {
793
819
  if (groupEle.classList.contains('e-disabled')) {
794
820
  ofGroupContainer.classList.add('e-disabled');
@@ -836,7 +862,7 @@ var Ribbon = /** @class */ (function (_super) {
836
862
  break;
837
863
  case 'GroupButton':
838
864
  if (this.activeLayout === 'Simplified') {
839
- this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle);
865
+ this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
840
866
  break;
841
867
  }
842
868
  }
@@ -848,7 +874,8 @@ var Ribbon = /** @class */ (function (_super) {
848
874
  });
849
875
  var overflowtarget = this.overflowDDB.target;
850
876
  overflowtarget.append(ofTabContainer);
851
- var ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
877
+ var itemProp = getGroup(this.tabs, groupId);
878
+ var ofGroupContainer = itemProp.group.overflowHeader ? this.createGroupContainer(groupId, itemProp.group.overflowHeader) : this.createGroupContainer(groupId, groupHeader);
852
879
  ofGroupContainer.append(itemEle);
853
880
  ofTabContainer.append(ofGroupContainer);
854
881
  if (tabIndex === this.selectedTab) {
@@ -1705,9 +1732,10 @@ var Ribbon = /** @class */ (function (_super) {
1705
1732
  },
1706
1733
  beforeClose: function (args) {
1707
1734
  var ele = args.event ? closest(args.event.target, '.' + constants.RIBBON_POPUP_CONTROL) : null;
1735
+ var groupButtonEle = args.event ? closest(args.event.target, '.e-ribbon-group-button-overflow-popup') : null;
1708
1736
  var eventArgs = { element: args.element, event: args.event, cancel: args.cancel };
1709
1737
  _this.trigger('overflowPopupClose', eventArgs, function (ribbonArgs) {
1710
- if (ele || ribbonArgs.cancel) {
1738
+ if (ele || ribbonArgs.cancel || groupButtonEle) {
1711
1739
  args.cancel = true;
1712
1740
  }
1713
1741
  });
@@ -1729,8 +1757,10 @@ var Ribbon = /** @class */ (function (_super) {
1729
1757
  var currentList = target.querySelector('.e-ribbon-of-tab.e-ribbon-active');
1730
1758
  items = currentList.getElementsByClassName('e-ribbon-item');
1731
1759
  }
1732
- var 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;
1760
+ var control = items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-control');
1761
+ var comboBoxEle = control && control.classList.contains('e-combobox') ? items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-combobox') : null;
1733
1762
  var ribbonItem;
1763
+ var templateEle;
1734
1764
  if (comboBoxEle === null || (e.key === 'Tab') || this.itemIndex < 0) {
1735
1765
  if (e.key === 'ArrowDown' || (!e.shiftKey && e.key === 'Tab')) {
1736
1766
  if ((!this.itemIndex && this.itemIndex !== 0) || this.itemIndex < 0 || this.itemIndex === items.length - 1) {
@@ -1739,13 +1769,21 @@ var Ribbon = /** @class */ (function (_super) {
1739
1769
  this.findDisabledItem(ribbonItem, items, true);
1740
1770
  if (comboBoxEle && e.key === 'Tab') {
1741
1771
  e.preventDefault();
1742
- items[this.itemIndex].querySelector('.e-control').focus();
1772
+ var item = items[this.itemIndex].querySelector('.e-control');
1773
+ if (item) {
1774
+ item.focus();
1775
+ }
1743
1776
  }
1777
+ templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
1744
1778
  }
1745
1779
  else if (this.itemIndex < items.length - 1 && this.itemIndex >= 0) {
1746
1780
  this.itemIndex++;
1747
1781
  ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
1748
1782
  this.findDisabledItem(ribbonItem, items, true);
1783
+ templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
1784
+ }
1785
+ if (templateEle) {
1786
+ templateEle.focus();
1749
1787
  }
1750
1788
  }
1751
1789
  else if (e.key === 'ArrowUp' || (e.shiftKey && e.key === 'Tab')) {
@@ -1756,20 +1794,32 @@ var Ribbon = /** @class */ (function (_super) {
1756
1794
  this.findDisabledItem(ribbonItem, items, false);
1757
1795
  if (comboBoxEle && (e.shiftKey && e.key === 'Tab')) {
1758
1796
  e.preventDefault();
1759
- items[this.itemIndex].querySelector('.e-control').focus();
1797
+ var item = items[this.itemIndex].querySelector('.e-control');
1798
+ if (item) {
1799
+ item.focus();
1800
+ }
1760
1801
  }
1802
+ templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
1761
1803
  }
1762
1804
  else if (this.itemIndex <= items.length - 1 && this.itemIndex > 0) {
1763
1805
  this.itemIndex--;
1764
1806
  ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
1765
1807
  this.findDisabledItem(ribbonItem, items, false);
1808
+ templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
1809
+ }
1810
+ if (templateEle) {
1811
+ templateEle.focus();
1766
1812
  }
1767
1813
  }
1768
1814
  }
1769
1815
  target.setAttribute('index', this.itemIndex.toString());
1770
1816
  }
1771
1817
  var currentItemIndex = parseInt(target.getAttribute('index'), 10);
1772
- var itemType = items[parseInt(currentItemIndex.toString(), 10)] ? items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control').getAttribute('data-control') : null;
1818
+ var itemType = "";
1819
+ var controlItem = items[parseInt(currentItemIndex.toString(), 10)] ? items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control') : null;
1820
+ if (controlItem) {
1821
+ itemType = controlItem.getAttribute('data-control');
1822
+ }
1773
1823
  if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === ' ' || e.key === 'Tab') {
1774
1824
  if (itemType === 'ColorPicker') {
1775
1825
  if (e.key === 'Tab') {
@@ -1781,7 +1831,10 @@ var Ribbon = /** @class */ (function (_super) {
1781
1831
  if (e.key === 'Tab') {
1782
1832
  e.preventDefault();
1783
1833
  }
1784
- items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control').focus();
1834
+ var elem = items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control');
1835
+ if (elem) {
1836
+ elem.focus();
1837
+ }
1785
1838
  }
1786
1839
  if (e.key === ' ' && (itemType === 'CheckBox')) {
1787
1840
  var checkBoxEle = items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control');
@@ -2168,7 +2221,7 @@ var Ribbon = /** @class */ (function (_super) {
2168
2221
  this.setItemSize(ele, item);
2169
2222
  }
2170
2223
  if (group.enableGroupOverflow && overflowDDB) {
2171
- if (overflowtarget.childElementCount === 0) {
2224
+ if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
2172
2225
  this.removeOverflowButton(overflowDDB);
2173
2226
  }
2174
2227
  }
@@ -2453,7 +2506,8 @@ var Ribbon = /** @class */ (function (_super) {
2453
2506
  Ribbon.prototype.createTemplateContent = function (item, itemElement) {
2454
2507
  var itemEle = this.createElement('div', {
2455
2508
  className: item.cssClass ? (constants.RIBBON_TEMPLATE + constants.SPACE + item.cssClass) : constants.RIBBON_TEMPLATE,
2456
- id: item.id
2509
+ id: item.id,
2510
+ attrs: { 'tabindex': '-1' }
2457
2511
  });
2458
2512
  if (item.disabled) {
2459
2513
  itemEle.classList.add(constants.DISABLED_CSS);
@@ -2929,7 +2983,7 @@ var Ribbon = /** @class */ (function (_super) {
2929
2983
  }
2930
2984
  if (this.activeLayout === RibbonLayout.Simplified) {
2931
2985
  if (itemProp.group.enableGroupOverflow) {
2932
- if (dropdown.target.childElementCount === 0) {
2986
+ if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
2933
2987
  this.removeOverflowButton(dropdown);
2934
2988
  }
2935
2989
  }
@@ -2956,6 +3010,9 @@ var Ribbon = /** @class */ (function (_super) {
2956
3010
  this.refreshLayout();
2957
3011
  }
2958
3012
  };
3013
+ Ribbon.prototype.isHeaderVisible = function (headerEle, groupID) {
3014
+ return headerEle.querySelector('#' + groupID + constants.GROUPOF_BUTTON_ID + constants.HEADER_ID) ? true : false;
3015
+ };
2959
3016
  /**
2960
3017
  * Hides a specific group within a ribbon tab.
2961
3018
  *
@@ -3515,7 +3572,7 @@ var Ribbon = /** @class */ (function (_super) {
3515
3572
  }
3516
3573
  if (this.activeLayout === RibbonLayout.Simplified) {
3517
3574
  if (itemProp.group.enableGroupOverflow) {
3518
- if (dropdown.target.childElementCount === 0) {
3575
+ if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
3519
3576
  this.removeOverflowButton(dropdown);
3520
3577
  }
3521
3578
  }
@@ -3734,7 +3791,7 @@ var Ribbon = /** @class */ (function (_super) {
3734
3791
  }
3735
3792
  this.createRibbonItem(ribbonItem, itemContainer);
3736
3793
  if (this.activeLayout === 'Simplified' && itemProp.group.enableGroupOverflow) {
3737
- if (dropdown.target.childElementCount === 0) {
3794
+ if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
3738
3795
  this.removeOverflowButton(dropdown);
3739
3796
  }
3740
3797
  }
@@ -88,6 +88,15 @@ var RibbonColorPicker = /** @class */ (function () {
88
88
  */
89
89
  RibbonColorPicker.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
90
90
  var _this = this;
91
+ var colorPickerSettings = item.colorPickerSettings;
92
+ if (colorPickerSettings.label && this.parent.activeLayout === 'Simplified') {
93
+ var label = this.parent.createElement('div', {
94
+ className: 'e-ribbon-colorpicker-label',
95
+ id: item.id + '_label',
96
+ innerHTML: colorPickerSettings.label
97
+ });
98
+ itemEle.insertBefore(label, itemEle.firstChild);
99
+ }
91
100
  var colorPickerEle = itemEle.querySelector('#' + item.id);
92
101
  colorPickerEle.setAttribute('data-control', item.type.toString());
93
102
  var colorPickerObj = getComponent(colorPickerEle, ColorPicker);
@@ -118,6 +127,13 @@ var RibbonColorPicker = /** @class */ (function () {
118
127
  */
119
128
  RibbonColorPicker.prototype.removeOverFlowEvents = function (item, itemEle) {
120
129
  var _this = this;
130
+ var colorPickerSettings = item.colorPickerSettings;
131
+ if (colorPickerSettings.label) {
132
+ var label = itemEle.querySelector('#' + item.id + '_label');
133
+ if (label) {
134
+ label.remove();
135
+ }
136
+ }
121
137
  var colorPickerEle = itemEle.querySelector('#' + item.id);
122
138
  var colorPickerObj = getComponent(colorPickerEle, ColorPicker);
123
139
  var cssClass = colorPickerObj.cssClass.split(SPACE);
@@ -83,6 +83,15 @@ var RibbonComboBox = /** @class */ (function () {
83
83
  */
84
84
  RibbonComboBox.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
85
85
  var _this = this;
86
+ var comboBoxSettings = item.comboBoxSettings;
87
+ if (comboBoxSettings.label && this.parent.activeLayout === 'Simplified') {
88
+ var label = this.parent.createElement('div', {
89
+ className: 'e-ribbon-combobox-label',
90
+ id: item.id + '_label',
91
+ innerHTML: comboBoxSettings.label
92
+ });
93
+ itemEle.insertBefore(label, itemEle.firstChild);
94
+ }
86
95
  var inputEle = itemEle.querySelector('#' + item.id);
87
96
  inputEle.setAttribute('data-control', item.type.toString());
88
97
  var comboBoxObj = getComponent(inputEle, ComboBox);
@@ -107,6 +116,13 @@ var RibbonComboBox = /** @class */ (function () {
107
116
  */
108
117
  RibbonComboBox.prototype.removeOverFlowEvents = function (item, itemEle) {
109
118
  var _this = this;
119
+ var comboBoxSettings = item.comboBoxSettings;
120
+ if (comboBoxSettings.label) {
121
+ var label = itemEle.querySelector('#' + item.id + '_label');
122
+ if (label) {
123
+ label.remove();
124
+ }
125
+ }
110
126
  var inputEle = itemEle.querySelector('#' + item.id);
111
127
  var comboBoxObj = getComponent(inputEle, ComboBox);
112
128
  var cssClass = comboBoxObj.cssClass.split(SPACE);
@@ -164,7 +164,9 @@ var RibbonDropDown = /** @class */ (function () {
164
164
  return dropdown;
165
165
  };
166
166
  RibbonDropDown.prototype.keyActionHandler = function (e, target) {
167
- var items = target.querySelectorAll('.e-control');
167
+ var controlElements = Array.prototype.slice.call(target.querySelectorAll('.e-control'));
168
+ var templateElements = Array.prototype.slice.call(target.querySelectorAll('.e-ribbon-template'));
169
+ var items = controlElements.concat(templateElements);
168
170
  var comboBoxElements = target.querySelectorAll('.e-combobox');
169
171
  var comboBoxEle;
170
172
  if (comboBoxElements) {
@@ -183,7 +185,7 @@ var RibbonDropDown = /** @class */ (function () {
183
185
  }
184
186
  }
185
187
  }
186
- if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
188
+ if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-launcher-icon') ||
187
189
  e.target.classList.contains('e-ribbon-last-item') || e.target.classList.contains('e-ribbon-first-item')) {
188
190
  if (e.key === 'ArrowRight' || (!e.shiftKey && e.key === 'Tab')) {
189
191
  this.handleNavigation(e, !this.enableRtl, items);
@@ -206,7 +208,7 @@ var RibbonDropDown = /** @class */ (function () {
206
208
  }
207
209
  if (!e.target.classList.contains('e-combobox') && !e.target.classList.contains('e-ribbon-last-item') &&
208
210
  !e.target.classList.contains('e-ribbon-group-container') && (e.target.classList.contains('e-ribbon-first-item')
209
- || this.itemIndex !== 0) && e.target.classList.contains('e-control')) {
211
+ || this.itemIndex !== 0) && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template'))) {
210
212
  this.itemIndex++;
211
213
  this.updateItemIndex(e, items, true);
212
214
  }
@@ -1,5 +1,6 @@
1
1
  import { Ribbon } from '../base/ribbon';
2
2
  import { RibbonItemModel } from '../models';
3
+ import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
3
4
  /**
4
5
  * Defines the items of Ribbon.
5
6
  */
@@ -30,6 +31,7 @@ export declare class RibbonGroupButton {
30
31
  * @hidden
31
32
  */
32
33
  switchGroupButton(item: RibbonItemModel, itemElement: HTMLElement): void;
34
+ private addGroupButtonHeader;
33
35
  private handleGroupButtonNavigation;
34
36
  /**
35
37
  * Adds the additional event handlers as the item moved into overflow popup.
@@ -39,7 +41,7 @@ export declare class RibbonGroupButton {
39
41
  * @returns {void}
40
42
  * @hidden
41
43
  */
42
- addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void;
44
+ addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement, overflowButton: DropDownButton): void;
43
45
  /**
44
46
  * Removes the additional event handlers as the item moved into overflow popup.
45
47
  *
@@ -113,13 +113,17 @@ var RibbonGroupButton = /** @class */ (function () {
113
113
  }
114
114
  count++;
115
115
  }
116
- new DropDownButton({
116
+ var dropdown = new DropDownButton({
117
117
  iconCss: dropdownIcon,
118
118
  target: btnContainerEle,
119
119
  enableRtl: this.parent.enableRtl,
120
120
  cssClass: 'e-ribbon-dropdown-group-button',
121
121
  disabled: item.disabled
122
122
  }, buttonEle);
123
+ if (groupBtnSettings.header) {
124
+ var dropDownPopup = dropdown.dropDown;
125
+ this.addGroupButtonHeader(item.id, groupBtnSettings, dropDownPopup.element);
126
+ }
123
127
  buttonEle.onclick = buttonEle.onkeydown = function () {
124
128
  if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
125
129
  document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + 0).focus();
@@ -136,7 +140,9 @@ var RibbonGroupButton = /** @class */ (function () {
136
140
  }
137
141
  };
138
142
  RibbonGroupButton.prototype.groupButtonClicked = function (itemIndex, item, grpBtnSettings) {
139
- var previousItems = [], selectingItems = [], selectedItems = [];
143
+ var previousItems = [];
144
+ var selectingItems = [];
145
+ var selectedItems = [];
140
146
  var groupButtonEle;
141
147
  var dropdown;
142
148
  for (var j = 0; j < grpBtnSettings.items.length; j++) {
@@ -167,9 +173,11 @@ var RibbonGroupButton = /** @class */ (function () {
167
173
  for (var j = 0; j < grpBtnSettings.items.length; j++) {
168
174
  if (document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + j) && document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + j).classList.contains('e-active')) {
169
175
  document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + j).classList.remove('e-active');
176
+ grpBtnSettings.items[parseInt(j.toString(), 10)].selected = false;
170
177
  }
171
178
  }
172
179
  document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
180
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = true;
173
181
  if (document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active') && this.parent.activeLayout === 'Simplified') {
174
182
  this.grpBtnIndex = itemIndex;
175
183
  groupButtonEle = document.querySelector('#' + item.id);
@@ -185,6 +193,12 @@ var RibbonGroupButton = /** @class */ (function () {
185
193
  document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID).classList.add(constants.RIBBON_MULTIPLE_BUTTON_SELECTION);
186
194
  }
187
195
  document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
196
+ if (document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active')) {
197
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = true;
198
+ }
199
+ else {
200
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = false;
201
+ }
188
202
  var activeEleCount = 0;
189
203
  for (var n = 0; n < grpBtnSettings.items.length; n++) {
190
204
  if (document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + n) && document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + n).classList.contains('e-active') && this.parent.activeLayout === 'Simplified' && n !== itemIndex) {
@@ -273,13 +287,17 @@ var RibbonGroupButton = /** @class */ (function () {
273
287
  }
274
288
  itemsCount++;
275
289
  }
276
- new DropDownButton({
290
+ var dropdown = new DropDownButton({
277
291
  iconCss: dropdownIcon,
278
292
  target: containerEle,
279
293
  enableRtl: this.parent.enableRtl,
280
294
  cssClass: 'e-ribbon-dropdown-group-button',
281
295
  disabled: item.disabled
282
296
  }, buttonEle);
297
+ if (groupBtnSettings.header) {
298
+ var dropDownPopup = dropdown.dropDown;
299
+ this.addGroupButtonHeader(item.id, groupBtnSettings, dropDownPopup.element);
300
+ }
283
301
  buttonEle.onclick = buttonEle.onkeydown = function () {
284
302
  if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
285
303
  document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + 0).focus();
@@ -303,6 +321,14 @@ var RibbonGroupButton = /** @class */ (function () {
303
321
  }
304
322
  }
305
323
  };
324
+ RibbonGroupButton.prototype.addGroupButtonHeader = function (itemID, groupBtnSettings, popupEle) {
325
+ var groupButtonHeader = this.parent.createElement('div', {
326
+ className: 'e-ribbon-groupbutton-header',
327
+ id: itemID + constants.HEADER_ID,
328
+ innerHTML: groupBtnSettings.header
329
+ });
330
+ popupEle.insertBefore(groupButtonHeader, popupEle.firstChild);
331
+ };
306
332
  RibbonGroupButton.prototype.handleGroupButtonNavigation = function (e, item) {
307
333
  var groupButtonEle = document.querySelector('#' + item.id);
308
334
  var dropdown = getComponent(groupButtonEle, DropDownButton);
@@ -368,16 +394,29 @@ var RibbonGroupButton = /** @class */ (function () {
368
394
  * @returns {void}
369
395
  * @hidden
370
396
  */
371
- RibbonGroupButton.prototype.addOverFlowEvents = function (item, itemEle) {
397
+ RibbonGroupButton.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
372
398
  var _this = this;
399
+ var groupBtnSettings = item.groupButtonSettings;
400
+ var isIconOnly = true;
373
401
  var groupButtonEle = itemEle.querySelector('#' + item.id);
374
402
  var dropdown = getComponent(groupButtonEle, DropDownButton);
375
- dropdown.setProperties({ cssClass: dropdown.cssClass + constants.SPACE + constants.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP });
403
+ dropdown.setProperties({ cssClass: dropdown.cssClass + constants.SPACE + constants.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP, content: groupBtnSettings.header ? groupBtnSettings.header : '' });
376
404
  var targetEle = dropdown.target;
405
+ if (targetEle.children.length) {
406
+ for (var i = 0; i < targetEle.children.length; i++) {
407
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].content) {
408
+ isIconOnly = false;
409
+ break;
410
+ }
411
+ }
412
+ if (isIconOnly) {
413
+ targetEle.classList.add('e-icon-btn');
414
+ }
415
+ }
377
416
  targetEle.onclick = function () {
378
417
  if (_this.parent.activeLayout === 'Simplified' && targetEle.closest('.e-ribbon-dropdown-group-button').classList.contains(constants.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP)) {
379
- dropdown.element.focus();
380
418
  dropdown.toggle();
419
+ overflowButton.toggle();
381
420
  }
382
421
  };
383
422
  };
@@ -393,9 +432,13 @@ var RibbonGroupButton = /** @class */ (function () {
393
432
  var groupButtonEle = itemEle.querySelector('#' + item.id);
394
433
  if (groupButtonEle) {
395
434
  var dropdown = getComponent(groupButtonEle, DropDownButton);
435
+ var targetEle = dropdown.target;
436
+ if (targetEle.classList.contains('e-icon-btn')) {
437
+ targetEle.classList.remove('e-icon-btn');
438
+ }
396
439
  var cssClass = dropdown.cssClass.split(constants.SPACE);
397
440
  cssClass = cssClass.filter(function (value) { return value !== constants.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP; });
398
- dropdown.setProperties({ cssClass: cssClass.join(constants.SPACE) });
441
+ dropdown.setProperties({ cssClass: cssClass.join(constants.SPACE), content: '' });
399
442
  }
400
443
  };
401
444
  /**
@@ -19,6 +19,13 @@ export interface RibbonColorPickerSettingsModel {
19
19
  */
20
20
  cssClass?: string;
21
21
 
22
+ /**
23
+ * Specifies the label text for the overflow item.
24
+ *
25
+ * @default ''
26
+ */
27
+ label?: string;
28
+
22
29
  /**
23
30
  * Defines whether to enable the opacity option in the color picker.
24
31
  *
@@ -29,7 +36,7 @@ export interface RibbonColorPickerSettingsModel {
29
36
  /**
30
37
  * Defines the rendering mode of the color picker.
31
38
  *
32
- * @default 'Picker'
39
+ * @default 'Palette'
33
40
  */
34
41
  mode?: ColorPickerMode;
35
42
 
@@ -16,6 +16,12 @@ export declare class RibbonColorPickerSettings extends ChildProperty<RibbonColor
16
16
  * @default ''
17
17
  */
18
18
  cssClass: string;
19
+ /**
20
+ * Specifies the label text for the overflow item.
21
+ *
22
+ * @default ''
23
+ */
24
+ label: string;
19
25
  /**
20
26
  * Defines whether to enable the opacity option in the color picker.
21
27
  *
@@ -25,7 +31,7 @@ export declare class RibbonColorPickerSettings extends ChildProperty<RibbonColor
25
31
  /**
26
32
  * Defines the rendering mode of the color picker.
27
33
  *
28
- * @default 'Picker'
34
+ * @default 'Palette'
29
35
  */
30
36
  mode: ColorPickerMode;
31
37
  /**
@@ -41,11 +41,14 @@ var RibbonColorPickerSettings = /** @class */ (function (_super) {
41
41
  __decorate([
42
42
  Property('')
43
43
  ], RibbonColorPickerSettings.prototype, "cssClass", void 0);
44
+ __decorate([
45
+ Property('')
46
+ ], RibbonColorPickerSettings.prototype, "label", void 0);
44
47
  __decorate([
45
48
  Property(true)
46
49
  ], RibbonColorPickerSettings.prototype, "enableOpacity", void 0);
47
50
  __decorate([
48
- Property('Picker')
51
+ Property('Palette')
49
52
  ], RibbonColorPickerSettings.prototype, "mode", void 0);
50
53
  __decorate([
51
54
  Property(true)