@syncfusion/ej2-ribbon 22.2.12 → 23.1.36

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 (126) hide show
  1. package/CHANGELOG.md +0 -26
  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 +1739 -192
  5. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  6. package/dist/es6/ej2-ribbon.es5.js +1800 -135
  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/global.js +1 -1
  13. package/src/ribbon/base/constant.d.ts +40 -0
  14. package/src/ribbon/base/constant.js +40 -0
  15. package/src/ribbon/base/interface.d.ts +49 -2
  16. package/src/ribbon/base/interface.js +19 -1
  17. package/src/ribbon/base/ribbon-model.d.ts +25 -1
  18. package/src/ribbon/base/ribbon.d.ts +108 -3
  19. package/src/ribbon/base/ribbon.js +434 -61
  20. package/src/ribbon/items/index.d.ts +1 -0
  21. package/src/ribbon/items/index.js +1 -0
  22. package/src/ribbon/items/ribbon-button.js +3 -0
  23. package/src/ribbon/items/ribbon-colorpicker.js +1 -1
  24. package/src/ribbon/items/ribbon-dropdown.js +2 -1
  25. package/src/ribbon/items/ribbon-groupbutton.d.ts +69 -0
  26. package/src/ribbon/items/ribbon-groupbutton.js +444 -0
  27. package/src/ribbon/models/index.d.ts +10 -0
  28. package/src/ribbon/models/index.js +5 -0
  29. package/src/ribbon/models/ribbon-back-button-model.d.ts +29 -0
  30. package/src/ribbon/models/ribbon-back-button.d.ts +24 -0
  31. package/src/ribbon/models/ribbon-back-button.js +40 -0
  32. package/src/ribbon/models/ribbon-back-stage-settings-model.d.ts +76 -0
  33. package/src/ribbon/models/ribbon-back-stage-settings.d.ts +75 -0
  34. package/src/ribbon/models/ribbon-back-stage-settings.js +70 -0
  35. package/src/ribbon/models/ribbon-backstage-item-model.d.ts +62 -0
  36. package/src/ribbon/models/ribbon-backstage-item.d.ts +74 -0
  37. package/src/ribbon/models/ribbon-backstage-item.js +52 -0
  38. package/src/ribbon/models/ribbon-combobox-settings-model.d.ts +15 -0
  39. package/src/ribbon/models/ribbon-combobox-settings.d.ts +15 -0
  40. package/src/ribbon/models/ribbon-dropdown-settings-model.d.ts +7 -0
  41. package/src/ribbon/models/ribbon-dropdown-settings.d.ts +6 -0
  42. package/src/ribbon/models/ribbon-dropdown-settings.js +3 -0
  43. package/src/ribbon/models/ribbon-file-menu-settings-model.d.ts +6 -0
  44. package/src/ribbon/models/ribbon-file-menu-settings.d.ts +6 -0
  45. package/src/ribbon/models/ribbon-group-button-item-model.d.ts +50 -0
  46. package/src/ribbon/models/ribbon-group-button-item.d.ts +44 -0
  47. package/src/ribbon/models/ribbon-group-button-item.js +50 -0
  48. package/src/ribbon/models/ribbon-group-button-settings-model.d.ts +25 -0
  49. package/src/ribbon/models/ribbon-group-button-settings.d.ts +23 -0
  50. package/src/ribbon/models/ribbon-group-button-settings.js +38 -0
  51. package/src/ribbon/models/ribbon-item-model.d.ts +11 -1
  52. package/src/ribbon/models/ribbon-item.d.ts +10 -0
  53. package/src/ribbon/models/ribbon-item.js +4 -0
  54. package/src/ribbon/modules/index.d.ts +1 -0
  55. package/src/ribbon/modules/index.js +1 -0
  56. package/src/ribbon/modules/ribbon-backstage.d.ts +112 -0
  57. package/src/ribbon/modules/ribbon-backstage.js +554 -0
  58. package/styles/bootstrap-dark.css +511 -8
  59. package/styles/bootstrap.css +511 -8
  60. package/styles/bootstrap4.css +511 -8
  61. package/styles/bootstrap5-dark.css +511 -8
  62. package/styles/bootstrap5.css +511 -8
  63. package/styles/fabric-dark.css +511 -8
  64. package/styles/fabric.css +511 -8
  65. package/styles/fluent-dark.css +511 -8
  66. package/styles/fluent.css +511 -8
  67. package/styles/highcontrast-light.css +511 -8
  68. package/styles/highcontrast.css +511 -8
  69. package/styles/material-dark.css +511 -9
  70. package/styles/material.css +512 -9
  71. package/styles/material3-dark.css +511 -9
  72. package/styles/material3-dark.scss +1 -1
  73. package/styles/material3.css +511 -9
  74. package/styles/material3.scss +1 -1
  75. package/styles/ribbon/_bootstrap-dark-definition.scss +65 -0
  76. package/styles/ribbon/_bootstrap-definition.scss +65 -0
  77. package/styles/ribbon/_bootstrap4-definition.scss +65 -0
  78. package/styles/ribbon/_bootstrap5-definition.scss +65 -0
  79. package/styles/ribbon/_fabric-dark-definition.scss +65 -0
  80. package/styles/ribbon/_fabric-definition.scss +65 -0
  81. package/styles/ribbon/_fluent-definition.scss +65 -0
  82. package/styles/ribbon/_fusionnew-definition.scss +65 -0
  83. package/styles/ribbon/_highcontrast-definition.scss +65 -0
  84. package/styles/ribbon/_highcontrast-light-definition.scss +65 -0
  85. package/styles/ribbon/_layout.scss +280 -5
  86. package/styles/ribbon/_material-dark-definition.scss +65 -0
  87. package/styles/ribbon/_material-definition.scss +65 -0
  88. package/styles/ribbon/_material3-definition.scss +66 -0
  89. package/styles/ribbon/_tailwind-definition.scss +65 -0
  90. package/styles/ribbon/_theme.scss +144 -1
  91. package/styles/ribbon/bootstrap-dark.css +511 -8
  92. package/styles/ribbon/bootstrap-dark.scss +1 -1
  93. package/styles/ribbon/bootstrap.css +511 -8
  94. package/styles/ribbon/bootstrap.scss +1 -1
  95. package/styles/ribbon/bootstrap4.css +511 -8
  96. package/styles/ribbon/bootstrap4.scss +1 -1
  97. package/styles/ribbon/bootstrap5-dark.css +511 -8
  98. package/styles/ribbon/bootstrap5-dark.scss +1 -1
  99. package/styles/ribbon/bootstrap5.css +511 -8
  100. package/styles/ribbon/bootstrap5.scss +1 -1
  101. package/styles/ribbon/fabric-dark.css +511 -8
  102. package/styles/ribbon/fabric-dark.scss +1 -1
  103. package/styles/ribbon/fabric.css +511 -8
  104. package/styles/ribbon/fabric.scss +1 -1
  105. package/styles/ribbon/fluent-dark.css +511 -8
  106. package/styles/ribbon/fluent-dark.scss +1 -1
  107. package/styles/ribbon/fluent.css +511 -8
  108. package/styles/ribbon/fluent.scss +1 -1
  109. package/styles/ribbon/highcontrast-light.css +511 -8
  110. package/styles/ribbon/highcontrast-light.scss +1 -1
  111. package/styles/ribbon/highcontrast.css +511 -8
  112. package/styles/ribbon/highcontrast.scss +1 -1
  113. package/styles/ribbon/material-dark.css +511 -9
  114. package/styles/ribbon/material-dark.scss +1 -1
  115. package/styles/ribbon/material.css +512 -9
  116. package/styles/ribbon/material.scss +1 -1
  117. package/styles/ribbon/material3-dark.css +511 -9
  118. package/styles/ribbon/material3-dark.scss +1 -1
  119. package/styles/ribbon/material3.css +511 -9
  120. package/styles/ribbon/material3.scss +1 -1
  121. package/styles/ribbon/tailwind-dark.css +511 -9
  122. package/styles/ribbon/tailwind-dark.scss +1 -1
  123. package/styles/ribbon/tailwind.css +511 -9
  124. package/styles/ribbon/tailwind.scss +1 -1
  125. package/styles/tailwind-dark.css +511 -9
  126. package/styles/tailwind.css +511 -9
@@ -20,10 +20,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
20
20
  import { addClass, append, Event, Collection, Complex, Component, EventHandler, formatUnit, getInstance, getComponent, getUniqueID, closest, KeyboardEvents } from '@syncfusion/ej2-base';
21
21
  import { isNullOrUndefined, isUndefined, NotifyPropertyChanges, Property, remove, removeClass } from '@syncfusion/ej2-base';
22
22
  import { Tab, TabAnimationSettings, HScroll, Toolbar } from '@syncfusion/ej2-navigations';
23
- import { RibbonTab, FileMenuSettings } from '../models/index';
23
+ import { RibbonTab, FileMenuSettings, BackStageMenu } from '../models/index';
24
24
  import { DisplayMode, RibbonLayout } from './interface';
25
25
  import { ItemOrientation, RibbonItemSize, RibbonItemType } from './interface';
26
- import { RibbonButton, RibbonComboBox, RibbonCheckBox, RibbonDropDown, RibbonSplitButton } from '../items/index';
26
+ import { RibbonButton, RibbonComboBox, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonGroupButton } from '../items/index';
27
27
  import { destroyControl, getCollection, getGroup, getIndex, getItem, getItemElement, updateCommonProperty, updateControlDisabled, isTooltipPresent, getTemplateFunction, createTooltip, destroyTooltip, updateTooltipProp } from './utils';
28
28
  import * as constants from './constant';
29
29
  import { DropDownButton, SplitButton } from '@syncfusion/ej2-splitbuttons';
@@ -41,7 +41,7 @@ var Ribbon = /** @class */ (function (_super) {
41
41
  */
42
42
  function Ribbon(options, element) {
43
43
  var _this = this;
44
- Ribbon_1.Inject(RibbonButton, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonComboBox);
44
+ Ribbon_1.Inject(RibbonButton, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonComboBox, RibbonGroupButton);
45
45
  _this = _super.call(this, options, element) || this;
46
46
  return _this;
47
47
  }
@@ -91,7 +91,7 @@ var Ribbon = /** @class */ (function (_super) {
91
91
  */
92
92
  Ribbon.prototype.requiredModules = function () {
93
93
  var modules = [];
94
- modules.push({ member: 'ribbonButton', args: [this] }, { member: 'ribbonDropDown', args: [this] }, { member: 'ribbonSplitButton', args: [this] }, { member: 'ribbonCheckBox', args: [this] }, { member: 'ribbonColorPicker', args: [this] }, { member: 'ribbonComboBox', args: [this] }, { member: 'ribbonFileMenu', args: [this] });
94
+ modules.push({ member: 'ribbonButton', args: [this] }, { member: 'ribbonDropDown', args: [this] }, { member: 'ribbonSplitButton', args: [this] }, { member: 'ribbonCheckBox', args: [this] }, { member: 'ribbonColorPicker', args: [this] }, { member: 'ribbonComboBox', args: [this] }, { member: 'ribbonGroupButton', args: [this] }, { member: 'ribbonFileMenu', args: [this] }, { member: 'ribbonBackstage', args: [this] });
95
95
  return modules;
96
96
  };
97
97
  Ribbon.prototype.initialize = function () {
@@ -105,6 +105,9 @@ var Ribbon = /** @class */ (function (_super) {
105
105
  if (this.ribbonFileMenuModule) {
106
106
  this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
107
107
  }
108
+ if (this.ribbonBackstageModule) {
109
+ this.ribbonBackstageModule.createBackStage(this.backStageMenu);
110
+ }
108
111
  this.createHelpPaneTemplate();
109
112
  var toolbar = this.tabObj['tbObj'];
110
113
  toolbar.refreshOverflow();
@@ -401,7 +404,9 @@ var Ribbon = /** @class */ (function (_super) {
401
404
  this.switchLayout();
402
405
  };
403
406
  Ribbon.prototype.tabCreated = function () {
404
- this.addExpandCollapse();
407
+ if (!this.hideLayoutSwitcher) {
408
+ this.addExpandCollapse();
409
+ }
405
410
  this.renderInitialTab(this.selectedTab);
406
411
  };
407
412
  Ribbon.prototype.ribbonTabSelected = function (e) {
@@ -550,7 +555,7 @@ var Ribbon = /** @class */ (function (_super) {
550
555
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
551
556
  this.setItemSize(itemEle, item);
552
557
  }
553
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
558
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
554
559
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, true);
555
560
  }
556
561
  }
@@ -562,7 +567,7 @@ var Ribbon = /** @class */ (function (_super) {
562
567
  }
563
568
  };
564
569
  Ribbon.prototype.updatePopupItems = function (item, itemEle, isGroupOF, isMenu) {
565
- var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown) ? DropDownButton : SplitButton);
570
+ var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
566
571
  var dropDownPopup = dropdown.dropDown;
567
572
  // popup is on right if (isGroupOF && isMenu)
568
573
  // The position is reversed if RTL is enabled.
@@ -621,7 +626,7 @@ var Ribbon = /** @class */ (function (_super) {
621
626
  break;
622
627
  }
623
628
  var groupEle_1 = tabContent.querySelector('#' + collection.id);
624
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
629
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
625
630
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
626
631
  }
627
632
  groupEle_1.append(itemContainer);
@@ -667,6 +672,8 @@ var Ribbon = /** @class */ (function (_super) {
667
672
  };
668
673
  Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer) {
669
674
  var overflowButton;
675
+ var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
676
+ var isDisabledGroup = contentEle.querySelector('#' + groupId);
670
677
  if (isGroupOF) {
671
678
  var overflowDDB = groupContainer.querySelector('#' + groupId + constants.GROUPOF_BUTTON_ID);
672
679
  if (!overflowDDB) {
@@ -677,6 +684,9 @@ var Ribbon = /** @class */ (function (_super) {
677
684
  else {
678
685
  overflowButton = getInstance(overflowDDB, DropDownButton);
679
686
  }
687
+ if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
688
+ overflowButton.target.classList.add('e-disabled');
689
+ }
680
690
  overflowButton.target.append(itemEle);
681
691
  }
682
692
  else {
@@ -694,6 +704,9 @@ var Ribbon = /** @class */ (function (_super) {
694
704
  var ofGroupContainer = overflowEle.querySelector('#' + groupId + constants.CONTAINER_ID);
695
705
  if (!ofGroupContainer) {
696
706
  ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
707
+ if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
708
+ ofGroupContainer.classList.add('e-disabled');
709
+ }
697
710
  ofTabContainer.append(ofGroupContainer);
698
711
  }
699
712
  ofGroupContainer.append(itemEle);
@@ -728,6 +741,11 @@ var Ribbon = /** @class */ (function (_super) {
728
741
  case 'ComboBox':
729
742
  this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
730
743
  break;
744
+ case 'GroupButton':
745
+ if (this.activeLayout === 'Simplified') {
746
+ this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle);
747
+ break;
748
+ }
731
749
  }
732
750
  };
733
751
  Ribbon.prototype.createOfTabContainer = function (groupId, groupHeader, itemEle, tabIndex) {
@@ -838,7 +856,12 @@ var Ribbon = /** @class */ (function (_super) {
838
856
  var ele = activeContent.querySelector('#' + item.id + constants.CONTAINER_ID);
839
857
  shrinkEle.appendChild(ele);
840
858
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
841
- _this.setItemSize(ele.querySelector('#' + item.id), item);
859
+ if (item.type === RibbonItemType.GroupButton && _this.activeLayout === 'Classic') {
860
+ _this.setItemSize(ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID), item);
861
+ }
862
+ else {
863
+ _this.setItemSize(ele.querySelector('#' + item.id), item);
864
+ }
842
865
  }
843
866
  };
844
867
  var moveCollectionToColumn = function (start, end) {
@@ -852,7 +875,12 @@ var Ribbon = /** @class */ (function (_super) {
852
875
  var ele = activeContent.querySelector('#' + collection.id);
853
876
  shrinkEle.appendChild(ele);
854
877
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Medium }, true);
855
- _this.setItemSize(ele.querySelector('#' + collection.items[0].id), collection.items[0]);
878
+ if (collection.items[0].type === RibbonItemType.GroupButton && _this.activeLayout === 'Classic') {
879
+ _this.setItemSize(ele.querySelector('#' + collection.items[0].id + constants.RIBBON_GROUP_BUTTON_ID), collection.items[0]);
880
+ }
881
+ else {
882
+ _this.setItemSize(ele.querySelector('#' + collection.items[0].id), collection.items[0]);
883
+ }
856
884
  }
857
885
  };
858
886
  var orientation = group.orientation;
@@ -947,6 +975,9 @@ var Ribbon = /** @class */ (function (_super) {
947
975
  if (item.displayOptions & DisplayMode.Classic) {
948
976
  var ele_1 = activeContent.querySelector('#' + item.id);
949
977
  item.setProperties({ activeSize: RibbonItemSize.Small }, true);
978
+ if (item.type === RibbonItemType.GroupButton) {
979
+ ele_1 = activeContent.querySelector('#' + item.id + '_grpbtn');
980
+ }
950
981
  _this.setItemSize(ele_1, item);
951
982
  }
952
983
  };
@@ -968,6 +999,9 @@ var Ribbon = /** @class */ (function (_super) {
968
999
  if (collection.items[0].displayOptions & DisplayMode.Classic) {
969
1000
  var ele_2 = activeContent.querySelector('#' + collection.items[0].id);
970
1001
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Small }, true);
1002
+ if (collection.items[0].type === RibbonItemType.GroupButton) {
1003
+ ele_2 = activeContent.querySelector('#' + collection.items[0].id + constants.RIBBON_GROUP_BUTTON_ID);
1004
+ }
971
1005
  _this.setItemSize(ele_2, collection.items[0]);
972
1006
  }
973
1007
  };
@@ -1067,7 +1101,7 @@ var Ribbon = /** @class */ (function (_super) {
1067
1101
  }
1068
1102
  var item = collection.items[parseInt(l.toString(), 10)];
1069
1103
  if (canReduceItem(item)) {
1070
- setWidth(item.id);
1104
+ item.type !== RibbonItemType.GroupButton ? setWidth(item.id) : setWidth(item.id + constants.RIBBON_GROUP_BUTTON_ID);
1071
1105
  reduceItemsToSmall(k, l, l);
1072
1106
  if (!shouldSkip && (tabContent.offsetWidth > activeContent.offsetWidth)) {
1073
1107
  return true;
@@ -1105,6 +1139,9 @@ var Ribbon = /** @class */ (function (_super) {
1105
1139
  if (item.displayOptions & DisplayMode.Classic) {
1106
1140
  var ele_4 = parentEle.id === item.id ? parentEle : parentEle.querySelector('#' + item.id);
1107
1141
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
1142
+ if (item.type === RibbonItemType.GroupButton) {
1143
+ ele_4 = document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
1144
+ }
1108
1145
  _this.setItemSize(ele_4, item);
1109
1146
  }
1110
1147
  };
@@ -1115,6 +1152,9 @@ var Ribbon = /** @class */ (function (_super) {
1115
1152
  if (item.displayOptions & DisplayMode.Classic) {
1116
1153
  var ele_5 = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id);
1117
1154
  collections[parseInt(i.toString(), 10)].items[0].setProperties({ activeSize: RibbonItemSize.Medium }, true);
1155
+ if (item.type === RibbonItemType.GroupButton) {
1156
+ ele_5 = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id + constants.RIBBON_GROUP_BUTTON_ID);
1157
+ }
1118
1158
  _this.setItemSize(ele_5, collections[parseInt(i.toString(), 10)].items[0]);
1119
1159
  }
1120
1160
  };
@@ -1131,6 +1171,9 @@ var Ribbon = /** @class */ (function (_super) {
1131
1171
  var item = collection.items[parseInt(l.toString(), 10)];
1132
1172
  if (canExpandItem(item)) {
1133
1173
  var itemEle = activeContent.querySelector('#' + item.id);
1174
+ if (item.type === 'GroupButton') {
1175
+ itemEle = activeContent.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
1176
+ }
1134
1177
  var valString = itemEle.getAttribute('data-medium-width');
1135
1178
  var value = valString ? parseInt(valString, 10) : null;
1136
1179
  if (value && (shouldSkip || (tabContent.offsetWidth > value))) {
@@ -1232,8 +1275,11 @@ var Ribbon = /** @class */ (function (_super) {
1232
1275
  var container = parentEle.querySelector('#' + item.id + constants.CONTAINER_ID);
1233
1276
  var ele_6 = container.querySelector('#' + item.id);
1234
1277
  item.setProperties({ activeSize: RibbonItemSize.Large }, true);
1278
+ if (item.type === RibbonItemType.GroupButton) {
1279
+ ele_6 = container.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
1280
+ }
1235
1281
  _this.setItemSize(ele_6, item);
1236
- parentEle.insertAdjacentElement('afterend', container);
1282
+ parentEle.insertAdjacentElement('beforebegin', container);
1237
1283
  }
1238
1284
  };
1239
1285
  reduce(start);
@@ -1254,8 +1300,11 @@ var Ribbon = /** @class */ (function (_super) {
1254
1300
  var collectionEle = parentEle.querySelector('#' + collection.id);
1255
1301
  var ele_7 = collectionEle.querySelector('#' + collection.items[0].id);
1256
1302
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Large }, true);
1303
+ if (collection.items[0].type === RibbonItemType.GroupButton) {
1304
+ ele_7 = collectionEle.querySelector('#' + collection.items[0].id + constants.RIBBON_GROUP_BUTTON_ID);
1305
+ }
1257
1306
  _this.setItemSize(ele_7, collection.items[0]);
1258
- parentEle.insertAdjacentElement('afterend', collectionEle);
1307
+ parentEle.insertAdjacentElement('beforebegin', collectionEle);
1259
1308
  }
1260
1309
  };
1261
1310
  reduce(start);
@@ -1303,6 +1352,10 @@ var Ribbon = /** @class */ (function (_super) {
1303
1352
  }
1304
1353
  return false;
1305
1354
  };
1355
+ Ribbon.prototype.handleContentSize = function (itemEle, isRemoveOverflow) {
1356
+ var itemContainer = itemEle.closest('.' + constants.RIBBON_GROUP_CONTENT);
1357
+ (isRemoveOverflow ? (itemContainer.classList.add(constants.RIBBON_CONTENT_HEIGHT)) : (itemContainer.classList.remove(constants.RIBBON_CONTENT_HEIGHT)));
1358
+ };
1306
1359
  Ribbon.prototype.setItemSize = function (itemEle, item) {
1307
1360
  var itemContainer = itemEle.closest('.' + constants.RIBBON_ITEM);
1308
1361
  if (item.type === RibbonItemType.Button) {
@@ -1318,6 +1371,9 @@ var Ribbon = /** @class */ (function (_super) {
1318
1371
  remove(itemEle);
1319
1372
  this.createTemplateContent(item, itemContainer);
1320
1373
  }
1374
+ else if (item.type === RibbonItemType.GroupButton) {
1375
+ this.ribbonGroupButtonModule.updateGroupButtonSize(itemEle, item);
1376
+ }
1321
1377
  itemContainer.classList.remove(constants.RIBBON_CONTENT_HEIGHT, constants.RIBBON_LARGE_ITEM, constants.RIBBON_MEDIUM_ITEM, constants.RIBBON_SMALL_ITEM);
1322
1378
  if (item.activeSize === RibbonItemSize.Large) {
1323
1379
  itemContainer.classList.add(constants.RIBBON_LARGE_ITEM, constants.RIBBON_CONTENT_HEIGHT);
@@ -1357,6 +1413,7 @@ var Ribbon = /** @class */ (function (_super) {
1357
1413
  var item = collection.items[parseInt(k.toString(), 10)];
1358
1414
  var itemEle = collectionEle.querySelector('#' + item.id + constants.CONTAINER_ID);
1359
1415
  if (itemEle !== null) {
1416
+ this_1.handleContentSize(itemEle);
1360
1417
  this_1.addOverflowEvents(item, itemEle, dropdown);
1361
1418
  }
1362
1419
  }
@@ -1399,6 +1456,7 @@ var Ribbon = /** @class */ (function (_super) {
1399
1456
  var item = collection.items[parseInt(k.toString(), 10)];
1400
1457
  var itemEle = collectionEle.querySelector('#' + item.id + constants.CONTAINER_ID);
1401
1458
  if (itemEle !== null) {
1459
+ this_2.handleContentSize(itemEle, true);
1402
1460
  this_2.removeOverflowEvent(item, itemEle);
1403
1461
  }
1404
1462
  }
@@ -1673,6 +1731,9 @@ var Ribbon = /** @class */ (function (_super) {
1673
1731
  case 'ComboBox':
1674
1732
  this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
1675
1733
  break;
1734
+ case 'GroupButton':
1735
+ this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
1736
+ break;
1676
1737
  }
1677
1738
  };
1678
1739
  Ribbon.prototype.createGroupContainer = function (groupId, groupHeader) {
@@ -1808,10 +1869,13 @@ var Ribbon = /** @class */ (function (_super) {
1808
1869
  itemEle = groupContainer.querySelector('#' + item.id + constants.CONTAINER_ID);
1809
1870
  if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
1810
1871
  this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemEle, groupContainer);
1811
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
1872
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
1812
1873
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
1813
1874
  }
1814
1875
  }
1876
+ if (item.type === RibbonItemType.GroupButton) {
1877
+ this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
1878
+ }
1815
1879
  item.setProperties({ activeSize: size }, true);
1816
1880
  var ele = itemEle.querySelector('#' + item.id);
1817
1881
  this.setItemSize(ele, item);
@@ -1899,14 +1963,20 @@ var Ribbon = /** @class */ (function (_super) {
1899
1963
  var itemEle = groupContainer.querySelector('#' + item.id + constants.CONTAINER_ID);
1900
1964
  if (!itemEle) {
1901
1965
  itemEle = overflowtarget.querySelector('#' + item.id + constants.CONTAINER_ID);
1902
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
1966
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
1903
1967
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
1904
1968
  }
1905
1969
  this.removeOverflowEvent(item, itemEle);
1906
1970
  }
1971
+ if (item.type === RibbonItemType.GroupButton) {
1972
+ this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
1973
+ }
1907
1974
  groupCollection.append(itemEle);
1908
1975
  }
1909
1976
  var ele = groupContainer.querySelector('#' + item.id);
1977
+ if (item.type === RibbonItemType.GroupButton) {
1978
+ ele = groupContainer.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
1979
+ }
1910
1980
  var itemsize = (item.allowedSizes & RibbonItemSize.Large) ? RibbonItemSize.Large :
1911
1981
  (item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
1912
1982
  item.setProperties({ activeSize: itemsize }, true);
@@ -2073,6 +2143,9 @@ var Ribbon = /** @class */ (function (_super) {
2073
2143
  case 'Template':
2074
2144
  this.createTemplateContent(item, itemEle);
2075
2145
  break;
2146
+ case 'GroupButton':
2147
+ this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
2148
+ break;
2076
2149
  }
2077
2150
  };
2078
2151
  Ribbon.prototype.createItems = function (itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
@@ -2121,7 +2194,7 @@ var Ribbon = /** @class */ (function (_super) {
2121
2194
  this.createRibbonItem(item, itemEle);
2122
2195
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
2123
2196
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
2124
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
2197
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
2125
2198
  this.updatePopupItems(item, itemEle, isGroupOF, true);
2126
2199
  }
2127
2200
  }
@@ -2200,54 +2273,74 @@ var Ribbon = /** @class */ (function (_super) {
2200
2273
  if (this.ribbonFileMenuModule) {
2201
2274
  this.ribbonFileMenuModule.setCommonProperties(commonProp);
2202
2275
  }
2276
+ if (this.ribbonBackstageModule) {
2277
+ this.ribbonBackstageModule.setCommonProperties(commonProp);
2278
+ }
2203
2279
  for (var i = 0; i < this.tabs.length; i++) {
2204
2280
  var tab = this.tabs[parseInt(i.toString(), 10)];
2205
2281
  var contentEle = this.tabObj.items[parseInt(i.toString(), 10)].content;
2206
- for (var _i = 0, _a = tab.groups; _i < _a.length; _i++) {
2207
- var group = _a[_i];
2208
- var dropdownElement = void 0;
2209
- var dropdown = void 0;
2210
- if (this.activeLayout === RibbonLayout.Classic) {
2211
- dropdownElement = group.isCollapsed ?
2212
- contentEle.querySelector('#' + group.id + constants.OVERFLOW_ID + constants.DROPDOWN_ID) : null;
2213
- }
2214
- else {
2215
- dropdownElement = group.enableGroupOverflow ?
2216
- contentEle.querySelector('#' + group.id + constants.GROUPOF_BUTTON_ID) : null;
2217
- dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
2218
- if (dropdown) {
2219
- updateTooltipProp(dropdown.target, commonProp);
2220
- dropdown.setProperties(commonProp);
2282
+ if (contentEle.querySelector('.' + constants.RIBBON_GROUP)) {
2283
+ for (var _i = 0, _a = tab.groups; _i < _a.length; _i++) {
2284
+ var group = _a[_i];
2285
+ var dropdownElement = void 0;
2286
+ var dropdown = void 0;
2287
+ if (this.activeLayout === RibbonLayout.Classic) {
2288
+ dropdownElement = group.isCollapsed ?
2289
+ contentEle.querySelector('#' + group.id + constants.OVERFLOW_ID + constants.DROPDOWN_ID) : null;
2221
2290
  }
2222
- }
2223
- for (var _b = 0, _c = group.collections; _b < _c.length; _b++) {
2224
- var collection = _c[_b];
2225
- for (var _d = 0, _e = collection.items; _d < _e.length; _d++) {
2226
- var item = _e[_d];
2227
- var ele = null;
2228
- if (this.activeLayout === RibbonLayout.Classic) {
2229
- if (item.displayOptions & DisplayMode.Classic) {
2230
- ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
2231
- }
2291
+ else {
2292
+ dropdownElement = group.enableGroupOverflow ?
2293
+ contentEle.querySelector('#' + group.id + constants.GROUPOF_BUTTON_ID) : null;
2294
+ dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
2295
+ if (dropdown) {
2296
+ updateTooltipProp(dropdown.target, commonProp);
2297
+ dropdown.setProperties(commonProp);
2232
2298
  }
2233
- else {
2234
- //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
2235
- ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id) : null;
2236
- // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
2237
- if (!ele) {
2238
- ele = dropdown.target.querySelector('#' + item.id);
2239
- if (item.type === 'DropDown') {
2240
- this.updatePopupItems(item, dropdown.target, group.enableGroupOverflow, true);
2299
+ }
2300
+ for (var _b = 0, _c = group.collections; _b < _c.length; _b++) {
2301
+ var collection = _c[_b];
2302
+ for (var _d = 0, _e = collection.items; _d < _e.length; _d++) {
2303
+ var item = _e[_d];
2304
+ var ele = null;
2305
+ if (this.activeLayout === RibbonLayout.Classic) {
2306
+ if (item.displayOptions & DisplayMode.Classic) {
2307
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : item.type === RibbonItemType.GroupButton ? contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID) : contentEle.querySelector('#' + item.id);
2241
2308
  }
2242
2309
  }
2243
- }
2244
- if (ele) {
2245
- var moduleName = this.getItemModuleName(item);
2246
- if (moduleName !== 'template') {
2247
- updateCommonProperty(ele, moduleName, commonProp);
2310
+ else {
2311
+ //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
2312
+ ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id) : null;
2313
+ // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
2314
+ if (!ele) {
2315
+ ele = dropdown.target.querySelector('#' + item.id);
2316
+ if (item.type === 'DropDown') {
2317
+ this.updatePopupItems(item, dropdown.target, group.enableGroupOverflow, true);
2318
+ }
2319
+ }
2248
2320
  }
2249
- else if (!isNullOrUndefined(commonProp.enableRtl)) {
2250
- ele.classList.toggle(constants.RTL_CSS, commonProp.enableRtl);
2321
+ if (ele) {
2322
+ var moduleName = this.getItemModuleName(item);
2323
+ if (moduleName !== 'template') {
2324
+ if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
2325
+ for (var i_4 = 0; i_4 < item.groupButtonSettings.items.length; i_4++) {
2326
+ var btnEle = ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_4);
2327
+ updateCommonProperty(btnEle, 'btn', commonProp);
2328
+ }
2329
+ }
2330
+ else if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
2331
+ updateCommonProperty(ele, 'dropdown-btn', commonProp);
2332
+ for (var i_5 = 0; i_5 < item.groupButtonSettings.items.length; i_5++) {
2333
+ var btnEle = document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_5);
2334
+ updateCommonProperty(btnEle, 'btn', commonProp);
2335
+ }
2336
+ }
2337
+ else {
2338
+ updateCommonProperty(ele, moduleName, commonProp);
2339
+ }
2340
+ }
2341
+ else if (!isNullOrUndefined(commonProp.enableRtl)) {
2342
+ ele.classList.toggle(constants.RTL_CSS, commonProp.enableRtl);
2343
+ }
2251
2344
  }
2252
2345
  }
2253
2346
  }
@@ -2293,6 +2386,10 @@ var Ribbon = /** @class */ (function (_super) {
2293
2386
  if (item.displayOptions & DisplayMode.Classic) {
2294
2387
  ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) :
2295
2388
  contentEle.querySelector('#' + item.id);
2389
+ if (item.type === RibbonItemType.GroupButton) {
2390
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + constants.RIBBON_GROUP_BUTTON_ID) :
2391
+ contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
2392
+ }
2296
2393
  }
2297
2394
  }
2298
2395
  else {
@@ -2327,6 +2424,32 @@ var Ribbon = /** @class */ (function (_super) {
2327
2424
  if (moduleName === 'colorpicker') {
2328
2425
  this.ribbonColorPickerModule.unwireColorPickerEvents(ele);
2329
2426
  }
2427
+ else if (moduleName === 'group-btn') {
2428
+ if (this.activeLayout === 'Classic') {
2429
+ for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
2430
+ var btnEle = ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i);
2431
+ if (btnEle) {
2432
+ destroyControl(btnEle, 'btn');
2433
+ }
2434
+ }
2435
+ }
2436
+ else {
2437
+ this.ribbonGroupButtonModule.destroyDropDown(item);
2438
+ }
2439
+ var _loop_3 = function (i) {
2440
+ if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings) {
2441
+ var groupButtonID_1 = item.id + constants.RIBBON_GROUP_BUTTON_ID + i;
2442
+ var index = getIndex(this_3.tooltipData, function (e) { return e.id === groupButtonID_1; });
2443
+ if (index !== -1) {
2444
+ this_3.tooltipData.splice(index, 1);
2445
+ }
2446
+ }
2447
+ };
2448
+ var this_3 = this;
2449
+ for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
2450
+ _loop_3(i);
2451
+ }
2452
+ }
2330
2453
  else if (moduleName !== 'template') {
2331
2454
  destroyControl(ele, moduleName);
2332
2455
  }
@@ -2336,6 +2459,9 @@ var Ribbon = /** @class */ (function (_super) {
2336
2459
  this.tooltipData.splice(index, 1);
2337
2460
  }
2338
2461
  }
2462
+ if (item.type === 'GroupButton') {
2463
+ this.ribbonGroupButtonModule.destroyDropDown(item);
2464
+ }
2339
2465
  };
2340
2466
  Ribbon.prototype.getItemModuleName = function (item) {
2341
2467
  switch (item.type) {
@@ -2351,6 +2477,8 @@ var Ribbon = /** @class */ (function (_super) {
2351
2477
  return 'colorpicker';
2352
2478
  case 'ComboBox':
2353
2479
  return 'combobox';
2480
+ case 'GroupButton':
2481
+ return 'group-btn';
2354
2482
  default:
2355
2483
  return 'template';
2356
2484
  }
@@ -2384,6 +2512,56 @@ var Ribbon = /** @class */ (function (_super) {
2384
2512
  var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
2385
2513
  this.setProperties({ selectedTab: index });
2386
2514
  };
2515
+ /**
2516
+ * Shows a specific tab in the ribbon.
2517
+ *
2518
+ * @param {string} tabId - The ID of the tab to be shown.
2519
+ * @returns {void}
2520
+ */
2521
+ Ribbon.prototype.showTab = function (tabId) {
2522
+ this.showHideTab(tabId, false);
2523
+ };
2524
+ /**
2525
+ * Hides a specific tab in the ribbon.
2526
+ *
2527
+ * @param {string} tabId - The ID of the tab to be hidden.
2528
+ * @returns {void}
2529
+ */
2530
+ Ribbon.prototype.hideTab = function (tabId) {
2531
+ this.showHideTab(tabId, true);
2532
+ };
2533
+ Ribbon.prototype.showHideTab = function (tabId, value) {
2534
+ var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
2535
+ if (index === -1) {
2536
+ return;
2537
+ }
2538
+ this.tabObj.hideTab(index, value);
2539
+ };
2540
+ /**
2541
+ * Enables a specific tab in the ribbon.
2542
+ *
2543
+ * @param {string} tabId - The ID of the tab to be enabled.
2544
+ * @returns {void}
2545
+ */
2546
+ Ribbon.prototype.enableTab = function (tabId) {
2547
+ this.enableDisableTab(tabId, true);
2548
+ };
2549
+ /**
2550
+ * Disables a specific tab in the ribbon.
2551
+ *
2552
+ * @param {string} tabId - The ID of the tab to be disabled.
2553
+ * @returns {void}
2554
+ */
2555
+ Ribbon.prototype.disableTab = function (tabId) {
2556
+ this.enableDisableTab(tabId, false);
2557
+ };
2558
+ Ribbon.prototype.enableDisableTab = function (tabId, value) {
2559
+ var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
2560
+ if (index === -1) {
2561
+ return;
2562
+ }
2563
+ this.tabObj.enableTab(index, value);
2564
+ };
2387
2565
  /**
2388
2566
  * Adds the ribbon tab.
2389
2567
  *
@@ -2426,6 +2604,10 @@ var Ribbon = /** @class */ (function (_super) {
2426
2604
  for (var _c = 0, _d = collection.items; _c < _d.length; _c++) {
2427
2605
  var item = _d[_c];
2428
2606
  var ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
2607
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
2608
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + constants.RIBBON_GROUP_BUTTON_ID) :
2609
+ contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
2610
+ }
2429
2611
  if (ele) {
2430
2612
  this.destroyFunction(item, ele);
2431
2613
  }
@@ -2549,6 +2731,105 @@ var Ribbon = /** @class */ (function (_super) {
2549
2731
  this.refreshLayout();
2550
2732
  }
2551
2733
  };
2734
+ /**
2735
+ * Hides a specific group within a ribbon tab.
2736
+ *
2737
+ * @param {string} groupID - The ID of the group to be hidden.
2738
+ * @returns {void}
2739
+ */
2740
+ Ribbon.prototype.hideGroup = function (groupID) {
2741
+ this.showHideGroup(groupID, true);
2742
+ };
2743
+ /**
2744
+ * Shows a specific group within a ribbon tab.
2745
+ *
2746
+ * @param {string} groupID - The ID of the group to be shown.
2747
+ * @returns {void}
2748
+ */
2749
+ Ribbon.prototype.showGroup = function (groupID) {
2750
+ this.showHideGroup(groupID, false);
2751
+ };
2752
+ Ribbon.prototype.showHideGroup = function (groupID, isHidden) {
2753
+ var overflowDDB;
2754
+ var overflowtarget;
2755
+ var itemProp = getGroup(this.tabs, groupID);
2756
+ if (!itemProp) {
2757
+ return;
2758
+ }
2759
+ var contentEle = this.tabObj.items[itemProp.tabIndex].content;
2760
+ var groupEle = contentEle.querySelector('#' + groupID);
2761
+ isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
2762
+ if (this.overflowDDB) {
2763
+ var overflowEle = this.overflowDDB.target;
2764
+ var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
2765
+ if (itemProp.group.enableGroupOverflow) {
2766
+ var overflowDDBEle = contentEle.querySelector('#' + groupID + constants.GROUPOF_BUTTON_ID);
2767
+ if (overflowDDBEle) {
2768
+ overflowDDB = getInstance(overflowDDBEle, DropDownButton);
2769
+ overflowtarget = overflowDDB.target;
2770
+ }
2771
+ if (overflowtarget) {
2772
+ isHidden ? overflowtarget.classList.add('e-hidden') : overflowtarget.classList.remove('e-hidden');
2773
+ }
2774
+ }
2775
+ else if (ofTabContainer) {
2776
+ var grpContainer = ofTabContainer.querySelector('#' + groupID + constants.CONTAINER_ID);
2777
+ if (grpContainer) {
2778
+ isHidden ? grpContainer.classList.add('e-hidden') : grpContainer.classList.remove('e-hidden');
2779
+ }
2780
+ }
2781
+ }
2782
+ this.refreshLayout();
2783
+ };
2784
+ /**
2785
+ * Disables a specific group within a ribbon tab.
2786
+ *
2787
+ * @param {string} groupID - The ID of the group to be disabled.
2788
+ * @returns {void}
2789
+ */
2790
+ Ribbon.prototype.disableGroup = function (groupID) {
2791
+ this.enableDisableGroup(groupID, true);
2792
+ };
2793
+ /**
2794
+ * Enables a specific group within a ribbon tab.
2795
+ *
2796
+ * @param {string} groupID - The ID of the group to be enabled.
2797
+ * @returns {void}
2798
+ */
2799
+ Ribbon.prototype.enableGroup = function (groupID) {
2800
+ this.enableDisableGroup(groupID, false);
2801
+ };
2802
+ Ribbon.prototype.enableDisableGroup = function (groupID, isDisabled) {
2803
+ var overflowDDB;
2804
+ var overflowtarget;
2805
+ var itemProp = getGroup(this.tabs, groupID);
2806
+ if (!itemProp) {
2807
+ return;
2808
+ }
2809
+ var contentEle = this.tabObj.items[itemProp.tabIndex].content;
2810
+ var groupEle = contentEle.querySelector('#' + groupID);
2811
+ isDisabled ? groupEle.classList.add('e-disabled') : groupEle.classList.remove('e-disabled');
2812
+ if (this.overflowDDB) {
2813
+ var overflowEle = this.overflowDDB.target;
2814
+ var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
2815
+ if (itemProp.group.enableGroupOverflow) {
2816
+ var overflowDDBEle = contentEle.querySelector('#' + groupID + constants.GROUPOF_BUTTON_ID);
2817
+ if (overflowDDBEle) {
2818
+ overflowDDB = getInstance(overflowDDBEle, DropDownButton);
2819
+ overflowtarget = overflowDDB.target;
2820
+ }
2821
+ if (overflowtarget) {
2822
+ isDisabled ? overflowtarget.classList.add('e-disabled') : overflowtarget.classList.remove('e-disabled');
2823
+ }
2824
+ }
2825
+ else if (ofTabContainer) {
2826
+ var grpContainer = ofTabContainer.querySelector('#' + groupID + constants.CONTAINER_ID);
2827
+ if (grpContainer) {
2828
+ isDisabled ? grpContainer.classList.add('e-disabled') : grpContainer.classList.remove('e-disabled');
2829
+ }
2830
+ }
2831
+ }
2832
+ };
2552
2833
  /**
2553
2834
  * adds the ribbon collection.
2554
2835
  *
@@ -2722,6 +3003,41 @@ var Ribbon = /** @class */ (function (_super) {
2722
3003
  this.refreshLayout();
2723
3004
  }
2724
3005
  };
3006
+ /**
3007
+ * Hides a specific ribbon item.
3008
+ *
3009
+ * @param {string} itemId - The ID of the item to be hidden.
3010
+ * @returns {void}
3011
+ */
3012
+ Ribbon.prototype.hideItem = function (itemId) {
3013
+ this.showHideItem(itemId, true);
3014
+ };
3015
+ /**
3016
+ * Shows a specific ribbon item.
3017
+ *
3018
+ * @param {string} itemId - The ID of the item to be shown.
3019
+ * @returns {void}
3020
+ */
3021
+ Ribbon.prototype.showItem = function (itemId) {
3022
+ this.showHideItem(itemId, false);
3023
+ };
3024
+ Ribbon.prototype.showHideItem = function (itemId, isHidden) {
3025
+ var itemProp = getItem(this.tabs, itemId);
3026
+ if (!itemProp) {
3027
+ return;
3028
+ }
3029
+ var ele;
3030
+ if (itemProp.item.type === 'GroupButton') {
3031
+ ele = getItemElement(this, itemId + constants.RIBBON_GROUP_BUTTON_ID, itemProp);
3032
+ }
3033
+ else {
3034
+ ele = getItemElement(this, itemId, itemProp);
3035
+ }
3036
+ if (ele) {
3037
+ var itemEle = closest(ele, '.e-ribbon-item');
3038
+ isHidden ? itemEle.classList.add('e-hidden') : itemEle.classList.remove('e-hidden');
3039
+ }
3040
+ };
2725
3041
  /**
2726
3042
  * tab - Gets the ribbon tab to be updated. The id of the tab is a required property. Other properties are optional.
2727
3043
  *
@@ -2755,6 +3071,10 @@ var Ribbon = /** @class */ (function (_super) {
2755
3071
  for (var _c = 0, _d = collection.items; _c < _d.length; _c++) {
2756
3072
  var item = _d[_c];
2757
3073
  var ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
3074
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
3075
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + constants.RIBBON_GROUP_BUTTON_ID) :
3076
+ contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
3077
+ }
2758
3078
  if (ele) {
2759
3079
  this.destroyFunction(item, ele);
2760
3080
  }
@@ -3026,9 +3346,12 @@ var Ribbon = /** @class */ (function (_super) {
3026
3346
  else {
3027
3347
  itemContainer = groupContainer.querySelector('#' + itemId + constants.CONTAINER_ID);
3028
3348
  itemEle = contentEle.querySelector('#' + itemId);
3349
+ if (itemProp.item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Classic) {
3350
+ itemEle = contentEle.querySelector('#' + itemId + constants.RIBBON_GROUP_BUTTON_ID);
3351
+ }
3029
3352
  if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
3030
3353
  this.createOverflowPopup(itemProp.item, itemProp.tabIndex, itemProp.group.enableGroupOverflow, itemProp.group.id, itemProp.group.header, itemContainer, groupContainer);
3031
- if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton)) {
3354
+ if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
3032
3355
  this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
3033
3356
  }
3034
3357
  }
@@ -3092,6 +3415,9 @@ var Ribbon = /** @class */ (function (_super) {
3092
3415
  var ele = null;
3093
3416
  if (this.activeLayout === RibbonLayout.Classic) {
3094
3417
  ele = (item.displayOptions & DisplayMode.Classic) ? contentEle.querySelector('#' + item.id) : null;
3418
+ if (item.type === 'GroupButton') {
3419
+ ele = (item.displayOptions & DisplayMode.Classic) ? contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID) : null;
3420
+ }
3095
3421
  }
3096
3422
  else {
3097
3423
  //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
@@ -3103,7 +3429,12 @@ var Ribbon = /** @class */ (function (_super) {
3103
3429
  }
3104
3430
  if (ele) {
3105
3431
  this.destroyFunction(item, ele);
3106
- ele.closest('#' + item.id + constants.CONTAINER_ID).remove();
3432
+ if (item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Simplified) {
3433
+ document.getElementById(item.id + constants.CONTAINER_ID).remove();
3434
+ }
3435
+ else {
3436
+ ele.closest('#' + item.id + constants.CONTAINER_ID).remove();
3437
+ }
3107
3438
  }
3108
3439
  };
3109
3440
  /**
@@ -3130,13 +3461,34 @@ var Ribbon = /** @class */ (function (_super) {
3130
3461
  return;
3131
3462
  }
3132
3463
  itemProp.item.setProperties({ disabled: isDisabled }, true);
3133
- var ele = getItemElement(this, itemId, itemProp);
3464
+ var ele;
3465
+ if (itemProp.item.type === 'GroupButton') {
3466
+ ele = getItemElement(this, itemId + constants.RIBBON_GROUP_BUTTON_ID, itemProp);
3467
+ }
3468
+ else {
3469
+ ele = getItemElement(this, itemId, itemProp);
3470
+ }
3134
3471
  if (ele) {
3135
3472
  var itemEle = closest(ele, '.e-ribbon-item');
3136
3473
  itemEle.classList.toggle(constants.DISABLED_CSS, itemProp.item.disabled);
3137
3474
  var moduleName = this.getItemModuleName(itemProp.item);
3138
3475
  if (moduleName !== 'template') {
3139
- updateControlDisabled(ele, moduleName, isDisabled);
3476
+ if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
3477
+ updateControlDisabled(ele, 'dropdown-btn', isDisabled);
3478
+ for (var i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
3479
+ var btnEle = document.querySelector('#' + itemId + constants.RIBBON_GROUP_BUTTON_ID + i);
3480
+ updateControlDisabled(btnEle, 'btn', isDisabled);
3481
+ }
3482
+ }
3483
+ else if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
3484
+ for (var i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
3485
+ var btnEle = ele.querySelector('#' + itemId + constants.RIBBON_GROUP_BUTTON_ID + i);
3486
+ updateControlDisabled(btnEle, 'btn', isDisabled);
3487
+ }
3488
+ }
3489
+ else {
3490
+ updateControlDisabled(ele, moduleName, isDisabled);
3491
+ }
3140
3492
  }
3141
3493
  else {
3142
3494
  ele.classList.toggle(constants.DISABLED_CSS, isDisabled);
@@ -3152,7 +3504,9 @@ var Ribbon = /** @class */ (function (_super) {
3152
3504
  this.keyboardModuleRibbon = null;
3153
3505
  destroyTooltip(this.element);
3154
3506
  this.destroyTabItems(this.tabs);
3155
- this.removeExpandCollapse();
3507
+ if (!this.hideLayoutSwitcher) {
3508
+ this.removeExpandCollapse();
3509
+ }
3156
3510
  this.collapseButton = undefined;
3157
3511
  if (this.scrollModule) {
3158
3512
  this.scrollModule.destroy();
@@ -3262,6 +3616,13 @@ var Ribbon = /** @class */ (function (_super) {
3262
3616
  var toolbarEle = this.tabObj['tbObj'];
3263
3617
  toolbarEle.refreshOverflow();
3264
3618
  break;
3619
+ case 'backStageMenu':
3620
+ if (this.ribbonBackstageModule) {
3621
+ this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu);
3622
+ }
3623
+ var toolbarElement = this.tabObj['tbObj'];
3624
+ toolbarElement.refreshOverflow();
3625
+ break;
3265
3626
  case 'helpPaneTemplate':
3266
3627
  if (this.ribbonTempEle) {
3267
3628
  remove(this.ribbonTempEle);
@@ -3274,6 +3635,9 @@ var Ribbon = /** @class */ (function (_super) {
3274
3635
  var toolbar_1 = this.tabObj['tbObj'];
3275
3636
  toolbar_1.refreshOverflow();
3276
3637
  break;
3638
+ case 'hideLayoutSwitcher':
3639
+ this.hideLayoutSwitcher ? this.removeExpandCollapse() : this.addExpandCollapse();
3640
+ break;
3277
3641
  }
3278
3642
  }
3279
3643
  };
@@ -3287,6 +3651,9 @@ var Ribbon = /** @class */ (function (_super) {
3287
3651
  __decorate([
3288
3652
  Complex({}, FileMenuSettings)
3289
3653
  ], Ribbon.prototype, "fileMenu", void 0);
3654
+ __decorate([
3655
+ Complex({}, BackStageMenu)
3656
+ ], Ribbon.prototype, "backStageMenu", void 0);
3290
3657
  __decorate([
3291
3658
  Property('')
3292
3659
  ], Ribbon.prototype, "launcherIconCss", void 0);
@@ -3311,6 +3678,9 @@ var Ribbon = /** @class */ (function (_super) {
3311
3678
  __decorate([
3312
3679
  Property('')
3313
3680
  ], Ribbon.prototype, "helpPaneTemplate", void 0);
3681
+ __decorate([
3682
+ Property(false)
3683
+ ], Ribbon.prototype, "hideLayoutSwitcher", void 0);
3314
3684
  __decorate([
3315
3685
  Event()
3316
3686
  ], Ribbon.prototype, "tabSelecting", void 0);
@@ -3326,6 +3696,9 @@ var Ribbon = /** @class */ (function (_super) {
3326
3696
  __decorate([
3327
3697
  Event()
3328
3698
  ], Ribbon.prototype, "launcherIconClick", void 0);
3699
+ __decorate([
3700
+ Event()
3701
+ ], Ribbon.prototype, "created", void 0);
3329
3702
  Ribbon = Ribbon_1 = __decorate([
3330
3703
  NotifyPropertyChanges
3331
3704
  ], Ribbon);