@syncfusion/ej2-ribbon 23.1.41 → 23.1.44

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 (43) hide show
  1. package/CHANGELOG.md +16 -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 +225 -71
  5. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  6. package/dist/es6/ej2-ribbon.es5.js +225 -71
  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 +11 -11
  12. package/src/ribbon/base/ribbon.d.ts +3 -0
  13. package/src/ribbon/base/ribbon.js +160 -70
  14. package/src/ribbon/base/utils.d.ts +11 -0
  15. package/src/ribbon/base/utils.js +27 -1
  16. package/src/ribbon/items/ribbon-button.js +4 -1
  17. package/src/ribbon/items/ribbon-checkbox.js +1 -0
  18. package/src/ribbon/items/ribbon-colorpicker.js +4 -1
  19. package/src/ribbon/items/ribbon-combobox.js +1 -0
  20. package/src/ribbon/items/ribbon-dropdown.js +4 -1
  21. package/src/ribbon/items/ribbon-groupbutton.js +4 -1
  22. package/src/ribbon/items/ribbon-splitbutton.js +4 -1
  23. package/src/ribbon/models/ribbon-button-settings-model.d.ts +7 -0
  24. package/src/ribbon/models/ribbon-button-settings.d.ts +8 -0
  25. package/src/ribbon/models/ribbon-button-settings.js +3 -0
  26. package/src/ribbon/models/ribbon-checkbox-settings-model.d.ts +7 -0
  27. package/src/ribbon/models/ribbon-checkbox-settings.d.ts +8 -0
  28. package/src/ribbon/models/ribbon-checkbox-settings.js +3 -0
  29. package/src/ribbon/models/ribbon-colorpicker-settings-model.d.ts +7 -0
  30. package/src/ribbon/models/ribbon-colorpicker-settings.d.ts +8 -0
  31. package/src/ribbon/models/ribbon-colorpicker-settings.js +3 -0
  32. package/src/ribbon/models/ribbon-combobox-settings-model.d.ts +7 -0
  33. package/src/ribbon/models/ribbon-combobox-settings.d.ts +8 -0
  34. package/src/ribbon/models/ribbon-combobox-settings.js +3 -0
  35. package/src/ribbon/models/ribbon-dropdown-settings-model.d.ts +7 -0
  36. package/src/ribbon/models/ribbon-dropdown-settings.d.ts +8 -0
  37. package/src/ribbon/models/ribbon-dropdown-settings.js +3 -0
  38. package/src/ribbon/models/ribbon-group-button-item-model.d.ts +7 -0
  39. package/src/ribbon/models/ribbon-group-button-item.d.ts +8 -0
  40. package/src/ribbon/models/ribbon-group-button-item.js +3 -0
  41. package/src/ribbon/models/ribbon-splitbutton-settings-model.d.ts +7 -0
  42. package/src/ribbon/models/ribbon-splitbutton-settings.d.ts +8 -0
  43. package/src/ribbon/models/ribbon-splitbutton-settings.js +3 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.1.41
3
+ * version : 23.1.44
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.1.38",
3
+ "_id": "@syncfusion/ej2-ribbon@23.1.43",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-yLsbJy3HywWin8MhlGR3hdBZgKj/pWypSjlsO85FAwKXr9BDn2cqcL09sg9fjRJCeU74qKVUrUEmW0IV7FtIfA==",
5
+ "_integrity": "sha512-bF6XJhfqt4MDcbcZfZCPOoiOasDBmubxKWFQLvT1Ts9lQZEUwdL7xfQ6IuaMCJMQp7jOkZ1mPB8DH+JKRzNu+A==",
6
6
  "_location": "/@syncfusion/ej2-ribbon",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
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.1.38.tgz",
27
- "_shasum": "73bb115f3ae57e0e74c88386b15a976aeade5c86",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-ribbon/-/ej2-ribbon-23.1.43.tgz",
27
+ "_shasum": "19d571e0fc8aabc19f75d3e2fe1e644c2cadab2f",
28
28
  "_spec": "@syncfusion/ej2-ribbon@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
30
30
  "author": {
@@ -36,12 +36,12 @@
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
38
  "@syncfusion/ej2-base": "~23.1.41",
39
- "@syncfusion/ej2-buttons": "~23.1.41",
40
- "@syncfusion/ej2-dropdowns": "~23.1.41",
41
- "@syncfusion/ej2-lists": "~23.1.36",
42
- "@syncfusion/ej2-navigations": "~23.1.41",
43
- "@syncfusion/ej2-popups": "~23.1.38",
44
- "@syncfusion/ej2-splitbuttons": "~23.1.41"
39
+ "@syncfusion/ej2-buttons": "~23.1.43",
40
+ "@syncfusion/ej2-dropdowns": "~23.1.44",
41
+ "@syncfusion/ej2-lists": "~23.1.43",
42
+ "@syncfusion/ej2-navigations": "~23.1.44",
43
+ "@syncfusion/ej2-popups": "~23.1.44",
44
+ "@syncfusion/ej2-splitbuttons": "~23.1.43"
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.1.41",
65
+ "version": "23.1.44",
66
66
  "sideEffects": false
67
67
  }
@@ -181,6 +181,7 @@ export declare class Ribbon extends Component<HTMLElement> implements INotifyPro
181
181
  private currentControlIndex;
182
182
  private keyboardModuleRibbon;
183
183
  private keyConfigs;
184
+ private initialPropsData;
184
185
  /** @hidden */
185
186
  overflowDDB: DropDownButton;
186
187
  /** @hidden */
@@ -277,6 +278,7 @@ export declare class Ribbon extends Component<HTMLElement> implements INotifyPro
277
278
  private createLauncherIcon;
278
279
  private launcherIconClicked;
279
280
  private createGroups;
281
+ private updateGroupProps;
280
282
  private validateItemSize;
281
283
  private createCollection;
282
284
  private createRibbonItem;
@@ -446,6 +448,7 @@ export declare class Ribbon extends Component<HTMLElement> implements INotifyPro
446
448
  */
447
449
  showItem(itemId: string): void;
448
450
  private showHideItem;
451
+ private updateInitialProps;
449
452
  /**
450
453
  * tab - Gets the ribbon tab to be updated. The id of the tab is a required property. Other properties are optional.
451
454
  *
@@ -58,6 +58,7 @@ var Ribbon = /** @class */ (function (_super) {
58
58
  Ribbon.prototype.preRender = function () {
59
59
  this.idIndex = 0;
60
60
  this.tooltipData = [];
61
+ this.initialPropsData = {};
61
62
  this.isAddRemove = false;
62
63
  this.keyConfigs = {
63
64
  leftarrow: 'leftarrow',
@@ -573,21 +574,23 @@ var Ribbon = /** @class */ (function (_super) {
573
574
  // The position is reversed if RTL is enabled.
574
575
  // isRight = ((isGroupOF && isMenu) && !this.enableRtl ) || (!(isGroupOF && isMenu) && this.enableRtl) ==> (isGroupOF && isMenu) !== this.enableRtl
575
576
  var isLeft = (isGroupOF && isMenu) === this.enableRtl;
576
- dropDownPopup.setProperties({ position: { X: isLeft ? 'left' : 'right', Y: isMenu ? 'top' : 'bottom' } }, true);
577
- if (isMenu) {
578
- dropdown.beforeOpen = function () {
579
- if (isLeft) {
580
- dropDownPopup.element.style.setProperty('visibility', 'hidden');
581
- dropDownPopup.element.style.setProperty('display', 'block');
582
- dropDownPopup.setProperties({ offsetX: -1 * dropDownPopup.element.offsetWidth });
583
- dropDownPopup.element.style.removeProperty('display');
584
- dropDownPopup.element.style.removeProperty('visibility');
585
- }
586
- };
587
- }
588
- else {
589
- dropDownPopup.setProperties({ offsetX: 0 }, true);
590
- dropdown.beforeOpen = null;
577
+ if (dropDownPopup) {
578
+ dropDownPopup.setProperties({ position: { X: isLeft ? 'left' : 'right', Y: isMenu ? 'top' : 'bottom' } }, true);
579
+ if (isMenu) {
580
+ dropdown.beforeOpen = function () {
581
+ if (isLeft) {
582
+ dropDownPopup.element.style.setProperty('visibility', 'hidden');
583
+ dropDownPopup.element.style.setProperty('display', 'block');
584
+ dropDownPopup.setProperties({ offsetX: -1 * dropDownPopup.element.offsetWidth });
585
+ dropDownPopup.element.style.removeProperty('display');
586
+ dropDownPopup.element.style.removeProperty('visibility');
587
+ }
588
+ };
589
+ }
590
+ else {
591
+ dropDownPopup.setProperties({ offsetX: 0 }, true);
592
+ dropdown.beforeOpen = null;
593
+ }
591
594
  }
592
595
  };
593
596
  Ribbon.prototype.removeSimplfiedOverflow = function (tabContent, activeContent, tabIndex, isClear) {
@@ -673,7 +676,7 @@ var Ribbon = /** @class */ (function (_super) {
673
676
  Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
674
677
  var overflowButton;
675
678
  var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
676
- var isDisabledGroup = contentEle.querySelector('#' + groupId);
679
+ var groupEle = contentEle.querySelector('#' + groupId);
677
680
  if (isGroupOF) {
678
681
  var overflowDDB = groupContainer.querySelector('#' + groupId + constants.GROUPOF_BUTTON_ID);
679
682
  if (!overflowDDB) {
@@ -685,9 +688,12 @@ var Ribbon = /** @class */ (function (_super) {
685
688
  overflowButton = getInstance(overflowDDB, DropDownButton);
686
689
  }
687
690
  var overflowBtnTarget = overflowButton.target;
688
- if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
691
+ if (groupEle && groupEle.classList.contains('e-disabled')) {
689
692
  overflowBtnTarget.classList.add('e-disabled');
690
693
  }
694
+ if (groupEle && groupEle.classList.contains('e-hidden')) {
695
+ overflowBtnTarget.classList.add('e-hidden');
696
+ }
691
697
  isResize ? overflowBtnTarget.insertBefore(itemEle, overflowBtnTarget.querySelector('.' + constants.RIBBON_ITEM))
692
698
  : overflowBtnTarget.append(itemEle);
693
699
  }
@@ -706,7 +712,7 @@ var Ribbon = /** @class */ (function (_super) {
706
712
  var ofGroupContainer = overflowEle.querySelector('#' + groupId + constants.CONTAINER_ID);
707
713
  if (!ofGroupContainer) {
708
714
  ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
709
- if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
715
+ if (groupEle && groupEle.classList.contains('e-disabled')) {
710
716
  ofGroupContainer.classList.add('e-disabled');
711
717
  }
712
718
  ofTabContainer.append(ofGroupContainer);
@@ -763,6 +769,15 @@ var Ribbon = /** @class */ (function (_super) {
763
769
  if (tabIndex === this.selectedTab) {
764
770
  ofTabContainer.classList.add(constants.RIBBON_TAB_ACTIVE);
765
771
  }
772
+ var groupEle = document.querySelector('#' + groupId);
773
+ if (groupEle) {
774
+ if (groupEle.classList.contains('e-disabled')) {
775
+ ofGroupContainer.classList.add('e-disabled');
776
+ }
777
+ if (groupEle.classList.contains('e-hidden')) {
778
+ ofGroupContainer.classList.add('e-hidden');
779
+ }
780
+ }
766
781
  };
767
782
  Ribbon.prototype.checkGroupShrinking = function (tabIndex, tabContent, activeContent, isLarge) {
768
783
  var isOverFlow = true;
@@ -1359,30 +1374,32 @@ var Ribbon = /** @class */ (function (_super) {
1359
1374
  (isRemoveOverflow ? (itemContainer.classList.add(constants.RIBBON_CONTENT_HEIGHT)) : (itemContainer.classList.remove(constants.RIBBON_CONTENT_HEIGHT)));
1360
1375
  };
1361
1376
  Ribbon.prototype.setItemSize = function (itemEle, item) {
1362
- var itemContainer = itemEle.closest('.' + constants.RIBBON_ITEM);
1363
- if (item.type === RibbonItemType.Button) {
1364
- this.ribbonButtonModule.updateButtonSize(itemEle, item);
1365
- }
1366
- else if (item.type === RibbonItemType.DropDown) {
1367
- this.ribbonDropDownModule.updateDropDownSize(itemEle, item);
1368
- }
1369
- else if (item.type === RibbonItemType.SplitButton) {
1370
- this.ribbonSplitButtonModule.updateSplitButtonSize(itemEle, item);
1371
- }
1372
- else if (item.type === RibbonItemType.Template) {
1373
- remove(itemEle);
1374
- this.createTemplateContent(item, itemContainer);
1375
- }
1376
- else if (item.type === RibbonItemType.GroupButton) {
1377
- this.ribbonGroupButtonModule.updateGroupButtonSize(itemEle, item);
1378
- }
1379
- itemContainer.classList.remove(constants.RIBBON_CONTENT_HEIGHT, constants.RIBBON_LARGE_ITEM, constants.RIBBON_MEDIUM_ITEM, constants.RIBBON_SMALL_ITEM);
1380
- if (item.activeSize === RibbonItemSize.Large) {
1381
- itemContainer.classList.add(constants.RIBBON_LARGE_ITEM, constants.RIBBON_CONTENT_HEIGHT);
1382
- }
1383
- else {
1384
- itemContainer.classList.add((item.activeSize === RibbonItemSize.Medium) ?
1385
- constants.RIBBON_MEDIUM_ITEM : constants.RIBBON_SMALL_ITEM);
1377
+ if (itemEle) {
1378
+ var itemContainer = itemEle.closest('.' + constants.RIBBON_ITEM);
1379
+ if (item.type === RibbonItemType.Button) {
1380
+ this.ribbonButtonModule.updateButtonSize(itemEle, item);
1381
+ }
1382
+ else if (item.type === RibbonItemType.DropDown) {
1383
+ this.ribbonDropDownModule.updateDropDownSize(itemEle, item);
1384
+ }
1385
+ else if (item.type === RibbonItemType.SplitButton) {
1386
+ this.ribbonSplitButtonModule.updateSplitButtonSize(itemEle, item);
1387
+ }
1388
+ else if (item.type === RibbonItemType.Template) {
1389
+ remove(itemEle);
1390
+ this.createTemplateContent(item, itemContainer);
1391
+ }
1392
+ else if (item.type === RibbonItemType.GroupButton) {
1393
+ this.ribbonGroupButtonModule.updateGroupButtonSize(itemEle, item);
1394
+ }
1395
+ itemContainer.classList.remove(constants.RIBBON_CONTENT_HEIGHT, constants.RIBBON_LARGE_ITEM, constants.RIBBON_MEDIUM_ITEM, constants.RIBBON_SMALL_ITEM);
1396
+ if (item.activeSize === RibbonItemSize.Large) {
1397
+ itemContainer.classList.add(constants.RIBBON_LARGE_ITEM, constants.RIBBON_CONTENT_HEIGHT);
1398
+ }
1399
+ else {
1400
+ itemContainer.classList.add((item.activeSize === RibbonItemSize.Medium) ?
1401
+ constants.RIBBON_MEDIUM_ITEM : constants.RIBBON_SMALL_ITEM);
1402
+ }
1386
1403
  }
1387
1404
  };
1388
1405
  Ribbon.prototype.createOverflowDropdown = function (tabIndex, tabContent, activeContent) {
@@ -1714,28 +1731,30 @@ var Ribbon = /** @class */ (function (_super) {
1714
1731
  }
1715
1732
  };
1716
1733
  Ribbon.prototype.removeOverflowEvent = function (item, itemEle) {
1717
- switch (item.type) {
1718
- case 'Button':
1719
- this.ribbonButtonModule.removeOverFlowEvents(item, itemEle);
1720
- break;
1721
- case 'DropDown':
1722
- this.ribbonDropDownModule.removeOverFlowEvents(item, itemEle);
1723
- break;
1724
- case 'SplitButton':
1725
- this.ribbonSplitButtonModule.removeOverFlowEvents(item, itemEle);
1726
- break;
1727
- case 'CheckBox':
1728
- this.ribbonCheckBoxModule.removeOverFlowEvents(item, itemEle);
1729
- break;
1730
- case 'ColorPicker':
1731
- this.ribbonColorPickerModule.removeOverFlowEvents(item, itemEle);
1732
- break;
1733
- case 'ComboBox':
1734
- this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
1735
- break;
1736
- case 'GroupButton':
1737
- this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
1738
- break;
1734
+ if (itemEle) {
1735
+ switch (item.type) {
1736
+ case 'Button':
1737
+ this.ribbonButtonModule.removeOverFlowEvents(item, itemEle);
1738
+ break;
1739
+ case 'DropDown':
1740
+ this.ribbonDropDownModule.removeOverFlowEvents(item, itemEle);
1741
+ break;
1742
+ case 'SplitButton':
1743
+ this.ribbonSplitButtonModule.removeOverFlowEvents(item, itemEle);
1744
+ break;
1745
+ case 'CheckBox':
1746
+ this.ribbonCheckBoxModule.removeOverFlowEvents(item, itemEle);
1747
+ break;
1748
+ case 'ColorPicker':
1749
+ this.ribbonColorPickerModule.removeOverFlowEvents(item, itemEle);
1750
+ break;
1751
+ case 'ComboBox':
1752
+ this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
1753
+ break;
1754
+ case 'GroupButton':
1755
+ this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
1756
+ break;
1757
+ }
1739
1758
  }
1740
1759
  };
1741
1760
  Ribbon.prototype.createGroupContainer = function (groupId, groupHeader) {
@@ -1940,8 +1959,10 @@ var Ribbon = /** @class */ (function (_super) {
1940
1959
  this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
1941
1960
  }
1942
1961
  item.setProperties({ activeSize: size }, true);
1943
- var ele = itemEle.querySelector('#' + item.id);
1944
- this.setItemSize(ele, item);
1962
+ if (itemEle) {
1963
+ var ele = itemEle.querySelector('#' + item.id);
1964
+ this.setItemSize(ele, item);
1965
+ }
1945
1966
  }
1946
1967
  }
1947
1968
  }
@@ -2024,7 +2045,7 @@ var Ribbon = /** @class */ (function (_super) {
2024
2045
  }
2025
2046
  else {
2026
2047
  var itemEle = groupContainer.querySelector('#' + item.id + constants.CONTAINER_ID);
2027
- if (!itemEle) {
2048
+ if (!itemEle && overflowtarget) {
2028
2049
  itemEle = overflowtarget.querySelector('#' + item.id + constants.CONTAINER_ID);
2029
2050
  if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
2030
2051
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
@@ -2034,7 +2055,9 @@ var Ribbon = /** @class */ (function (_super) {
2034
2055
  if (item.type === RibbonItemType.GroupButton) {
2035
2056
  this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
2036
2057
  }
2037
- groupCollection.append(itemEle);
2058
+ if (itemEle) {
2059
+ groupCollection.append(itemEle);
2060
+ }
2038
2061
  }
2039
2062
  var ele = groupContainer.querySelector('#' + item.id);
2040
2063
  if (item.type === RibbonItemType.GroupButton) {
@@ -2122,9 +2145,28 @@ var Ribbon = /** @class */ (function (_super) {
2122
2145
  if ((this.activeLayout === 'Simplified') && !(group.enableGroupOverflow || groupEle.querySelector('.' + constants.RIBBON_ITEM))) {
2123
2146
  groupEle.classList.add('e-ribbon-emptyCollection');
2124
2147
  }
2148
+ var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
2149
+ if (initialProps) {
2150
+ if (initialProps.hiddenGroups && initialProps.hiddenGroups.length) {
2151
+ this.updateGroupProps('hiddenGroups', initialProps, groupEle);
2152
+ }
2153
+ if (initialProps.disabledGroups && initialProps.disabledGroups.length) {
2154
+ this.updateGroupProps('disabledGroups', initialProps, groupEle);
2155
+ }
2156
+ }
2157
+ }
2158
+ if (this.initialPropsData[parseInt(tabIndex.toString(), 10)]) {
2159
+ delete this.initialPropsData[parseInt(tabIndex.toString(), 10)];
2125
2160
  }
2126
2161
  return groupElements;
2127
2162
  };
2163
+ Ribbon.prototype.updateGroupProps = function (key, initialProps, groupEle) {
2164
+ // eslint-disable-next-line
2165
+ var groupIndex = initialProps[key].indexOf(groupEle.id);
2166
+ if (groupIndex !== -1) {
2167
+ key === 'hiddenGroups' ? groupEle.classList.add('e-hidden') : groupEle.classList.add('e-disabled');
2168
+ }
2169
+ };
2128
2170
  Ribbon.prototype.validateItemSize = function () {
2129
2171
  for (var k = 0; k < this.tabs.length; k++) {
2130
2172
  var groupList = this.tabs[parseInt(k.toString(), 10)].groups;
@@ -2254,6 +2296,13 @@ var Ribbon = /** @class */ (function (_super) {
2254
2296
  else {
2255
2297
  itemEle.classList.add((size & RibbonItemSize.Medium) ? constants.RIBBON_MEDIUM_ITEM : constants.RIBBON_SMALL_ITEM);
2256
2298
  }
2299
+ var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
2300
+ if (initialProps && initialProps.hiddenItems && initialProps.hiddenItems.length) {
2301
+ var itemIndex = initialProps.hiddenItems.indexOf(item.id);
2302
+ if (itemIndex !== -1) {
2303
+ itemEle.classList.add('e-hidden');
2304
+ }
2305
+ }
2257
2306
  this.createRibbonItem(item, itemEle);
2258
2307
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
2259
2308
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
@@ -2821,7 +2870,12 @@ var Ribbon = /** @class */ (function (_super) {
2821
2870
  }
2822
2871
  var contentEle = this.tabObj.items[itemProp.tabIndex].content;
2823
2872
  var groupEle = contentEle.querySelector('#' + groupID);
2824
- isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
2873
+ if (groupEle) {
2874
+ isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
2875
+ }
2876
+ else {
2877
+ this.updateInitialProps(itemProp.tabIndex, groupID, 'hiddenGroups', isHidden);
2878
+ }
2825
2879
  if (this.overflowDDB) {
2826
2880
  var overflowEle = this.overflowDDB.target;
2827
2881
  var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
@@ -2871,7 +2925,12 @@ var Ribbon = /** @class */ (function (_super) {
2871
2925
  }
2872
2926
  var contentEle = this.tabObj.items[itemProp.tabIndex].content;
2873
2927
  var groupEle = contentEle.querySelector('#' + groupID);
2874
- isDisabled ? groupEle.classList.add('e-disabled') : groupEle.classList.remove('e-disabled');
2928
+ if (groupEle) {
2929
+ isDisabled ? groupEle.classList.add('e-disabled') : groupEle.classList.remove('e-disabled');
2930
+ }
2931
+ else {
2932
+ this.updateInitialProps(itemProp.tabIndex, groupID, 'disabledGroups', isDisabled);
2933
+ }
2875
2934
  if (this.overflowDDB) {
2876
2935
  var overflowEle = this.overflowDDB.target;
2877
2936
  var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
@@ -3099,6 +3158,36 @@ var Ribbon = /** @class */ (function (_super) {
3099
3158
  if (ele) {
3100
3159
  var itemEle = closest(ele, '.e-ribbon-item');
3101
3160
  isHidden ? itemEle.classList.add('e-hidden') : itemEle.classList.remove('e-hidden');
3161
+ this.refreshLayout();
3162
+ }
3163
+ else {
3164
+ this.updateInitialProps(itemProp.tabIndex, itemId, 'hiddenItems', isHidden);
3165
+ }
3166
+ };
3167
+ Ribbon.prototype.updateInitialProps = function (tabIndex, id, key, isInsert) {
3168
+ var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
3169
+ if (!initialProps) {
3170
+ this.initialPropsData[parseInt(tabIndex.toString(), 10)] = {};
3171
+ initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
3172
+ }
3173
+ if (initialProps) {
3174
+ /* eslint-disable */
3175
+ if (!initialProps[key])
3176
+ initialProps[key] = [];
3177
+ var itemIndex = initialProps[key].indexOf(id);
3178
+ if (isInsert) {
3179
+ if (itemIndex === -1)
3180
+ initialProps[key].push(id);
3181
+ }
3182
+ else {
3183
+ if (itemIndex !== -1)
3184
+ initialProps[key].splice(itemIndex, 1);
3185
+ initialProps[key].length === 0 && delete initialProps[key];
3186
+ /* eslint-enable */
3187
+ if (Object.keys(initialProps).length === 0) {
3188
+ delete this.initialPropsData[parseInt(tabIndex.toString(), 10)];
3189
+ }
3190
+ }
3102
3191
  }
3103
3192
  };
3104
3193
  /**
@@ -3581,6 +3670,7 @@ var Ribbon = /** @class */ (function (_super) {
3581
3670
  _super.prototype.destroy.call(this);
3582
3671
  this.tabObj.destroy();
3583
3672
  this.tabObj = undefined;
3673
+ this.initialPropsData = {};
3584
3674
  remove(this.element.querySelector('#' + this.element.id + constants.TAB_ID));
3585
3675
  this.element.style.removeProperty(constants.RIBBON_FILE_MENU_WIDTH);
3586
3676
  this.element.style.removeProperty(constants.RIBBON_HELP_PANE_TEMPLATE_WIDTH);
@@ -125,3 +125,14 @@ export declare function destroyTooltip(element: HTMLElement): void;
125
125
  * @hidden
126
126
  */
127
127
  export declare function updateTooltipProp(element: HTMLElement, prop: commonProperties): void;
128
+ /**
129
+ * Sets the HTML attributes of an element
130
+ *
131
+ * @param {HTMLElement} element - The HTML element for which attributes are to be updated.
132
+ * @param {commonProperties} attributes - An object containing key-value pairs of attributes to be updated.
133
+ * @returns {void}
134
+ * @hidden
135
+ */
136
+ export declare function setCustomAttributes(element: HTMLElement, attributes: {
137
+ [key: string]: string;
138
+ }): void;
@@ -1,4 +1,4 @@
1
- import { compile, getComponent, select } from '@syncfusion/ej2-base';
1
+ import { compile, getComponent, select, addClass } from '@syncfusion/ej2-base';
2
2
  import { Tooltip } from '@syncfusion/ej2-popups';
3
3
  import { DisplayMode, RibbonLayout } from './interface';
4
4
  import * as constants from './constant';
@@ -307,3 +307,29 @@ export function updateTooltipProp(element, prop) {
307
307
  var control = getComponent(element, Tooltip);
308
308
  control.setProperties(prop);
309
309
  }
310
+ /**
311
+ * Sets the HTML attributes of an element
312
+ *
313
+ * @param {HTMLElement} element - The HTML element for which attributes are to be updated.
314
+ * @param {commonProperties} attributes - An object containing key-value pairs of attributes to be updated.
315
+ * @returns {void}
316
+ * @hidden
317
+ */
318
+ export function setCustomAttributes(element, attributes) {
319
+ for (var key in attributes) {
320
+ if (key === 'class') {
321
+ var elementClass = attributes['class'].replace(/\s+/g, ' ').trim();
322
+ if (elementClass) {
323
+ addClass([element], elementClass.split(' '));
324
+ }
325
+ }
326
+ else if (key === 'style') {
327
+ var prevStyles = element.getAttribute('style') || '';
328
+ var value = "" + prevStyles + attributes["" + key];
329
+ element.setAttribute("" + key, value);
330
+ }
331
+ else {
332
+ element.setAttribute(key, attributes["" + key]);
333
+ }
334
+ }
335
+ }
@@ -1,6 +1,6 @@
1
1
  import { getComponent, merge } from '@syncfusion/ej2-base';
2
2
  import { Button } from '@syncfusion/ej2-buttons';
3
- import { getItem, getItemElement, RibbonItemSize } from '../base/index';
3
+ import { getItem, getItemElement, RibbonItemSize, setCustomAttributes } from '../base/index';
4
4
  import { ITEM_VERTICAL_CENTER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, SPACE } from '../base/constant';
5
5
  /**
6
6
  * Defines the items of Ribbon.
@@ -43,6 +43,9 @@ var RibbonButton = /** @class */ (function () {
43
43
  isToggle: btnSettings.isToggle,
44
44
  created: btnSettings.created
45
45
  }, buttonEle);
46
+ if (btnSettings.htmlAttributes) {
47
+ setCustomAttributes(buttonEle, btnSettings.htmlAttributes);
48
+ }
46
49
  buttonEle.onclick = function (e) {
47
50
  if (btnSettings.clicked) {
48
51
  btnSettings.clicked.call(_this, e);
@@ -39,6 +39,7 @@ var RibbonCheckBox = /** @class */ (function () {
39
39
  labelPosition: checkBoxSettings.labelPosition,
40
40
  disabled: item.disabled,
41
41
  created: checkBoxSettings.created,
42
+ htmlAttributes: checkBoxSettings.htmlAttributes,
42
43
  change: function (e) {
43
44
  if (checkBoxSettings.change) {
44
45
  checkBoxSettings.change.call(_this, e);
@@ -1,6 +1,6 @@
1
1
  import { EventHandler, getComponent, merge } from '@syncfusion/ej2-base';
2
2
  import { ColorPicker } from '@syncfusion/ej2-inputs';
3
- import { getItem, getItemElement } from '../base/index';
3
+ import { getItem, getItemElement, setCustomAttributes } from '../base/index';
4
4
  import { RIBBON_CONTROL, RIBBON_HOVER, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE } from '../base/constant';
5
5
  /**
6
6
  * Defines the items of Ribbon.
@@ -62,6 +62,9 @@ var RibbonColorPicker = /** @class */ (function () {
62
62
  },
63
63
  select: colorPickerSettings.select
64
64
  }, inputEle);
65
+ if (colorPickerSettings.htmlAttributes) {
66
+ setCustomAttributes(inputEle, colorPickerSettings.htmlAttributes);
67
+ }
65
68
  var wrapper = colorPicker.element.parentElement;
66
69
  EventHandler.add(wrapper, 'mouseenter', this.toggleWrapperHover.bind(this, wrapper, true), this);
67
70
  EventHandler.add(wrapper, 'mouseleave', this.toggleWrapperHover.bind(this, wrapper, false), this);
@@ -60,6 +60,7 @@ var RibbonComboBox = /** @class */ (function () {
60
60
  width: comboBoxSettings.width,
61
61
  beforeOpen: comboBoxSettings.beforeOpen,
62
62
  open: comboBoxSettings.open,
63
+ htmlAttributes: comboBoxSettings.htmlAttributes,
63
64
  close: function (e) {
64
65
  if (comboBoxSettings.close) {
65
66
  comboBoxSettings.close.call(_this, e);
@@ -1,7 +1,7 @@
1
1
  import { closest, getComponent, isNullOrUndefined, merge, remove } from '@syncfusion/ej2-base';
2
2
  import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
3
3
  import { Tooltip } from '@syncfusion/ej2-popups';
4
- import { getItem, getItemElement, RibbonItemSize, createTooltip } from '../base/index';
4
+ import { getItem, getItemElement, RibbonItemSize, createTooltip, setCustomAttributes } from '../base/index';
5
5
  import { DROPDOWN_ID, ITEM_VERTICAL_CENTER, OVERFLOW_ID, RIBBON_CONTROL, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_POPUP_CONTROL, SPACE, VERTICAL_DDB } from '../base/constant';
6
6
  /**
7
7
  * Defines the items of Ribbon.
@@ -62,6 +62,9 @@ var RibbonDropDown = /** @class */ (function () {
62
62
  open: dropDownSettings.open,
63
63
  select: dropDownSettings.select
64
64
  }).appendTo(buttonEle);
65
+ if (dropDownSettings.htmlAttributes) {
66
+ setCustomAttributes(buttonEle, dropDownSettings.htmlAttributes);
67
+ }
65
68
  };
66
69
  /**
67
70
  * Adds the additional event handlers as the item moved into overflow popup.
@@ -3,7 +3,7 @@ import * as constants from '../base/constant';
3
3
  import { Button } from '@syncfusion/ej2-buttons';
4
4
  import { RibbonGroupButtonSelection, RibbonItemSize } from '../base/interface';
5
5
  import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
6
- import { createTooltip, isTooltipPresent } from '../base/utils';
6
+ import { createTooltip, isTooltipPresent, setCustomAttributes } from '../base/utils';
7
7
  import { Tooltip } from '@syncfusion/ej2-popups';
8
8
  /**
9
9
  * Defines the items of Ribbon.
@@ -50,6 +50,9 @@ var RibbonGroupButton = /** @class */ (function () {
50
50
  content: item.activeSize === RibbonItemSize.Small ? '' : groupBtnSettings.items[parseInt(i.toString(), 10)].content,
51
51
  iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left'
52
52
  }, groupButtonEle);
53
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes) {
54
+ setCustomAttributes(groupButtonEle, groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes);
55
+ }
53
56
  var buttonEle = itemElement.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i);
54
57
  if (groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
55
58
  btnContainerEle.classList.add(constants.RIBBON_SINGLE_BUTTON_SELECTION);
@@ -1,6 +1,6 @@
1
1
  import { EventHandler, getComponent, merge } from '@syncfusion/ej2-base';
2
2
  import { SplitButton } from '@syncfusion/ej2-splitbuttons';
3
- import { getItem, getItemElement, RibbonItemSize } from '../base/index';
3
+ import { getItem, getItemElement, RibbonItemSize, setCustomAttributes } from '../base/index';
4
4
  import { ITEM_VERTICAL_CENTER, RIBBON_CONTROL, RIBBON_HOVER, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, VERTICAL_DDB } from '../base/constant';
5
5
  /**
6
6
  * Defines the items of Ribbon.
@@ -70,6 +70,9 @@ var RibbonSplitButton = /** @class */ (function () {
70
70
  }
71
71
  }
72
72
  }, buttonEle);
73
+ if (splitButtonSettings.htmlAttributes) {
74
+ setCustomAttributes(buttonEle, splitButtonSettings.htmlAttributes);
75
+ }
73
76
  var dropdownEle = buttonEle.parentElement.querySelector('.e-dropdown-btn');
74
77
  dropdownEle.onkeydown = function (e) {
75
78
  if (e.key === 'Enter') {
@@ -40,6 +40,13 @@ export interface RibbonButtonSettingsModel {
40
40
  */
41
41
  isPrimary?: boolean;
42
42
 
43
+ /**
44
+ * Specifies additional HTML attributes to be applied to the button.
45
+ *
46
+ * @default {}
47
+ */
48
+ htmlAttributes?: { [key: string]: string };
49
+
43
50
  /**
44
51
  * Event triggers once the button is created.
45
52
  *
@@ -33,6 +33,14 @@ export declare class RibbonButtonSettings extends ChildProperty<RibbonButtonSett
33
33
  * @default false
34
34
  */
35
35
  isPrimary: boolean;
36
+ /**
37
+ * Specifies additional HTML attributes to be applied to the button.
38
+ *
39
+ * @default {}
40
+ */
41
+ htmlAttributes: {
42
+ [key: string]: string;
43
+ };
36
44
  /**
37
45
  * Event triggers once the button is created.
38
46
  *
@@ -50,6 +50,9 @@ var RibbonButtonSettings = /** @class */ (function (_super) {
50
50
  __decorate([
51
51
  Property(false)
52
52
  ], RibbonButtonSettings.prototype, "isPrimary", void 0);
53
+ __decorate([
54
+ Property({})
55
+ ], RibbonButtonSettings.prototype, "htmlAttributes", void 0);
53
56
  __decorate([
54
57
  Event()
55
58
  ], RibbonButtonSettings.prototype, "created", void 0);