@syncfusion/ej2-ribbon 22.2.12 → 23.1.38

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 +2 -20
  2. package/dist/ej2-ribbon.umd.min.js +3 -3
  3. package/dist/ej2-ribbon.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-ribbon.es2015.js +1814 -209
  5. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  6. package/dist/es6/ej2-ribbon.es5.js +1886 -160
  7. package/dist/es6/ej2-ribbon.es5.js.map +1 -1
  8. package/dist/global/ej2-ribbon.min.js +3 -3
  9. package/dist/global/ej2-ribbon.min.js.map +1 -1
  10. package/dist/global/index.d.ts +2 -2
  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 +516 -82
  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) {
@@ -544,13 +549,13 @@ var Ribbon = /** @class */ (function (_super) {
544
549
  if (((item.displayOptions === DisplayMode.Auto) ||
545
550
  (item.displayOptions === (DisplayMode.Simplified | DisplayMode.Overflow))) && !isNullOrUndefined(itemContainer)) {
546
551
  itemContainer.setAttribute('data-simplified-width', activeContent.offsetWidth.toString());
547
- this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemContainer, groupContainer);
552
+ this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemContainer, groupContainer, true);
548
553
  if (item.activeSize === RibbonItemSize.Small) {
549
554
  var itemEle = itemContainer.querySelector('#' + item.id);
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);
@@ -665,8 +670,10 @@ var Ribbon = /** @class */ (function (_super) {
665
670
  }
666
671
  }
667
672
  };
668
- Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer) {
673
+ Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
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,7 +684,12 @@ var Ribbon = /** @class */ (function (_super) {
677
684
  else {
678
685
  overflowButton = getInstance(overflowDDB, DropDownButton);
679
686
  }
680
- overflowButton.target.append(itemEle);
687
+ var overflowBtnTarget = overflowButton.target;
688
+ if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
689
+ overflowBtnTarget.classList.add('e-disabled');
690
+ }
691
+ isResize ? overflowBtnTarget.insertBefore(itemEle, overflowBtnTarget.querySelector('.' + constants.RIBBON_ITEM))
692
+ : overflowBtnTarget.append(itemEle);
681
693
  }
682
694
  else {
683
695
  if (!this.overflowDDB) {
@@ -694,9 +706,12 @@ var Ribbon = /** @class */ (function (_super) {
694
706
  var ofGroupContainer = overflowEle.querySelector('#' + groupId + constants.CONTAINER_ID);
695
707
  if (!ofGroupContainer) {
696
708
  ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
709
+ if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
710
+ ofGroupContainer.classList.add('e-disabled');
711
+ }
697
712
  ofTabContainer.append(ofGroupContainer);
698
713
  }
699
- ofGroupContainer.append(itemEle);
714
+ isResize ? ofGroupContainer.insertBefore(itemEle, ofGroupContainer.querySelector('.' + constants.RIBBON_ITEM)) : ofGroupContainer.append(itemEle);
700
715
  }
701
716
  else {
702
717
  this.createOfTabContainer(groupId, groupHeader, itemEle, tabIndex);
@@ -728,6 +743,11 @@ var Ribbon = /** @class */ (function (_super) {
728
743
  case 'ComboBox':
729
744
  this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
730
745
  break;
746
+ case 'GroupButton':
747
+ if (this.activeLayout === 'Simplified') {
748
+ this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle);
749
+ break;
750
+ }
731
751
  }
732
752
  };
733
753
  Ribbon.prototype.createOfTabContainer = function (groupId, groupHeader, itemEle, tabIndex) {
@@ -838,7 +858,12 @@ var Ribbon = /** @class */ (function (_super) {
838
858
  var ele = activeContent.querySelector('#' + item.id + constants.CONTAINER_ID);
839
859
  shrinkEle.appendChild(ele);
840
860
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
841
- _this.setItemSize(ele.querySelector('#' + item.id), item);
861
+ if (item.type === RibbonItemType.GroupButton && _this.activeLayout === 'Classic') {
862
+ _this.setItemSize(ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID), item);
863
+ }
864
+ else {
865
+ _this.setItemSize(ele.querySelector('#' + item.id), item);
866
+ }
842
867
  }
843
868
  };
844
869
  var moveCollectionToColumn = function (start, end) {
@@ -852,7 +877,12 @@ var Ribbon = /** @class */ (function (_super) {
852
877
  var ele = activeContent.querySelector('#' + collection.id);
853
878
  shrinkEle.appendChild(ele);
854
879
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Medium }, true);
855
- _this.setItemSize(ele.querySelector('#' + collection.items[0].id), collection.items[0]);
880
+ if (collection.items[0].type === RibbonItemType.GroupButton && _this.activeLayout === 'Classic') {
881
+ _this.setItemSize(ele.querySelector('#' + collection.items[0].id + constants.RIBBON_GROUP_BUTTON_ID), collection.items[0]);
882
+ }
883
+ else {
884
+ _this.setItemSize(ele.querySelector('#' + collection.items[0].id), collection.items[0]);
885
+ }
856
886
  }
857
887
  };
858
888
  var orientation = group.orientation;
@@ -947,6 +977,9 @@ var Ribbon = /** @class */ (function (_super) {
947
977
  if (item.displayOptions & DisplayMode.Classic) {
948
978
  var ele_1 = activeContent.querySelector('#' + item.id);
949
979
  item.setProperties({ activeSize: RibbonItemSize.Small }, true);
980
+ if (item.type === RibbonItemType.GroupButton) {
981
+ ele_1 = activeContent.querySelector('#' + item.id + '_grpbtn');
982
+ }
950
983
  _this.setItemSize(ele_1, item);
951
984
  }
952
985
  };
@@ -968,6 +1001,9 @@ var Ribbon = /** @class */ (function (_super) {
968
1001
  if (collection.items[0].displayOptions & DisplayMode.Classic) {
969
1002
  var ele_2 = activeContent.querySelector('#' + collection.items[0].id);
970
1003
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Small }, true);
1004
+ if (collection.items[0].type === RibbonItemType.GroupButton) {
1005
+ ele_2 = activeContent.querySelector('#' + collection.items[0].id + constants.RIBBON_GROUP_BUTTON_ID);
1006
+ }
971
1007
  _this.setItemSize(ele_2, collection.items[0]);
972
1008
  }
973
1009
  };
@@ -1067,7 +1103,7 @@ var Ribbon = /** @class */ (function (_super) {
1067
1103
  }
1068
1104
  var item = collection.items[parseInt(l.toString(), 10)];
1069
1105
  if (canReduceItem(item)) {
1070
- setWidth(item.id);
1106
+ item.type !== RibbonItemType.GroupButton ? setWidth(item.id) : setWidth(item.id + constants.RIBBON_GROUP_BUTTON_ID);
1071
1107
  reduceItemsToSmall(k, l, l);
1072
1108
  if (!shouldSkip && (tabContent.offsetWidth > activeContent.offsetWidth)) {
1073
1109
  return true;
@@ -1105,6 +1141,9 @@ var Ribbon = /** @class */ (function (_super) {
1105
1141
  if (item.displayOptions & DisplayMode.Classic) {
1106
1142
  var ele_4 = parentEle.id === item.id ? parentEle : parentEle.querySelector('#' + item.id);
1107
1143
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
1144
+ if (item.type === RibbonItemType.GroupButton) {
1145
+ ele_4 = document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
1146
+ }
1108
1147
  _this.setItemSize(ele_4, item);
1109
1148
  }
1110
1149
  };
@@ -1115,6 +1154,9 @@ var Ribbon = /** @class */ (function (_super) {
1115
1154
  if (item.displayOptions & DisplayMode.Classic) {
1116
1155
  var ele_5 = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id);
1117
1156
  collections[parseInt(i.toString(), 10)].items[0].setProperties({ activeSize: RibbonItemSize.Medium }, true);
1157
+ if (item.type === RibbonItemType.GroupButton) {
1158
+ ele_5 = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id + constants.RIBBON_GROUP_BUTTON_ID);
1159
+ }
1118
1160
  _this.setItemSize(ele_5, collections[parseInt(i.toString(), 10)].items[0]);
1119
1161
  }
1120
1162
  };
@@ -1131,6 +1173,9 @@ var Ribbon = /** @class */ (function (_super) {
1131
1173
  var item = collection.items[parseInt(l.toString(), 10)];
1132
1174
  if (canExpandItem(item)) {
1133
1175
  var itemEle = activeContent.querySelector('#' + item.id);
1176
+ if (item.type === 'GroupButton') {
1177
+ itemEle = activeContent.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
1178
+ }
1134
1179
  var valString = itemEle.getAttribute('data-medium-width');
1135
1180
  var value = valString ? parseInt(valString, 10) : null;
1136
1181
  if (value && (shouldSkip || (tabContent.offsetWidth > value))) {
@@ -1232,8 +1277,11 @@ var Ribbon = /** @class */ (function (_super) {
1232
1277
  var container = parentEle.querySelector('#' + item.id + constants.CONTAINER_ID);
1233
1278
  var ele_6 = container.querySelector('#' + item.id);
1234
1279
  item.setProperties({ activeSize: RibbonItemSize.Large }, true);
1280
+ if (item.type === RibbonItemType.GroupButton) {
1281
+ ele_6 = container.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
1282
+ }
1235
1283
  _this.setItemSize(ele_6, item);
1236
- parentEle.insertAdjacentElement('afterend', container);
1284
+ parentEle.insertAdjacentElement('beforebegin', container);
1237
1285
  }
1238
1286
  };
1239
1287
  reduce(start);
@@ -1254,8 +1302,11 @@ var Ribbon = /** @class */ (function (_super) {
1254
1302
  var collectionEle = parentEle.querySelector('#' + collection.id);
1255
1303
  var ele_7 = collectionEle.querySelector('#' + collection.items[0].id);
1256
1304
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Large }, true);
1305
+ if (collection.items[0].type === RibbonItemType.GroupButton) {
1306
+ ele_7 = collectionEle.querySelector('#' + collection.items[0].id + constants.RIBBON_GROUP_BUTTON_ID);
1307
+ }
1257
1308
  _this.setItemSize(ele_7, collection.items[0]);
1258
- parentEle.insertAdjacentElement('afterend', collectionEle);
1309
+ parentEle.insertAdjacentElement('beforebegin', collectionEle);
1259
1310
  }
1260
1311
  };
1261
1312
  reduce(start);
@@ -1303,6 +1354,10 @@ var Ribbon = /** @class */ (function (_super) {
1303
1354
  }
1304
1355
  return false;
1305
1356
  };
1357
+ Ribbon.prototype.handleContentSize = function (itemEle, isRemoveOverflow) {
1358
+ var itemContainer = itemEle.closest('.' + constants.RIBBON_GROUP_CONTENT);
1359
+ (isRemoveOverflow ? (itemContainer.classList.add(constants.RIBBON_CONTENT_HEIGHT)) : (itemContainer.classList.remove(constants.RIBBON_CONTENT_HEIGHT)));
1360
+ };
1306
1361
  Ribbon.prototype.setItemSize = function (itemEle, item) {
1307
1362
  var itemContainer = itemEle.closest('.' + constants.RIBBON_ITEM);
1308
1363
  if (item.type === RibbonItemType.Button) {
@@ -1318,6 +1373,9 @@ var Ribbon = /** @class */ (function (_super) {
1318
1373
  remove(itemEle);
1319
1374
  this.createTemplateContent(item, itemContainer);
1320
1375
  }
1376
+ else if (item.type === RibbonItemType.GroupButton) {
1377
+ this.ribbonGroupButtonModule.updateGroupButtonSize(itemEle, item);
1378
+ }
1321
1379
  itemContainer.classList.remove(constants.RIBBON_CONTENT_HEIGHT, constants.RIBBON_LARGE_ITEM, constants.RIBBON_MEDIUM_ITEM, constants.RIBBON_SMALL_ITEM);
1322
1380
  if (item.activeSize === RibbonItemSize.Large) {
1323
1381
  itemContainer.classList.add(constants.RIBBON_LARGE_ITEM, constants.RIBBON_CONTENT_HEIGHT);
@@ -1357,6 +1415,7 @@ var Ribbon = /** @class */ (function (_super) {
1357
1415
  var item = collection.items[parseInt(k.toString(), 10)];
1358
1416
  var itemEle = collectionEle.querySelector('#' + item.id + constants.CONTAINER_ID);
1359
1417
  if (itemEle !== null) {
1418
+ this_1.handleContentSize(itemEle);
1360
1419
  this_1.addOverflowEvents(item, itemEle, dropdown);
1361
1420
  }
1362
1421
  }
@@ -1399,6 +1458,7 @@ var Ribbon = /** @class */ (function (_super) {
1399
1458
  var item = collection.items[parseInt(k.toString(), 10)];
1400
1459
  var itemEle = collectionEle.querySelector('#' + item.id + constants.CONTAINER_ID);
1401
1460
  if (itemEle !== null) {
1461
+ this_2.handleContentSize(itemEle, true);
1402
1462
  this_2.removeOverflowEvent(item, itemEle);
1403
1463
  }
1404
1464
  }
@@ -1673,6 +1733,9 @@ var Ribbon = /** @class */ (function (_super) {
1673
1733
  case 'ComboBox':
1674
1734
  this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
1675
1735
  break;
1736
+ case 'GroupButton':
1737
+ this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
1738
+ break;
1676
1739
  }
1677
1740
  };
1678
1741
  Ribbon.prototype.createGroupContainer = function (groupId, groupHeader) {
@@ -1717,20 +1780,79 @@ var Ribbon = /** @class */ (function (_super) {
1717
1780
  remove(this.tabObj.element.querySelector('.' + constants.RIBBON_COLLAPSE_BUTTON));
1718
1781
  this.collapseButton = null;
1719
1782
  };
1720
- Ribbon.prototype.reRenderTabs = function () {
1783
+ Ribbon.prototype.reRenderTabs = function (tabs) {
1721
1784
  this.destroyScroll();
1722
1785
  this.checkID(this.tabs, 'tab', this.element.id);
1723
- this.destroyTabItems(this.tabsInternal);
1724
- this.tabsInternal = this.tabs.slice();
1725
- this.validateItemSize();
1726
- var tabItems = this.createTabItems(this.tabs);
1727
- if (this.selectedTab >= this.tabs.length) {
1728
- this.selectedTab = this.tabs.length - 1;
1729
- }
1730
- this.tabObj.setProperties({ items: tabItems, selectedItem: this.selectedTab });
1731
- var contentEle = this.tabObj.items[this.selectedTab].content;
1732
- if (contentEle.innerHTML === '') {
1733
- this.renderInitialTab(this.selectedTab);
1786
+ for (var key in tabs) {
1787
+ var index = parseInt(key, 10);
1788
+ var tab = tabs[parseInt(index.toString(), 10)];
1789
+ var isNewTab = false;
1790
+ for (var j = 0; j < (this.tabObj.items.length); j++) {
1791
+ if (this.tabs[parseInt(index.toString(), 10)].id === this.tabObj.items[parseInt(j.toString(), 10)].id) {
1792
+ isNewTab = true;
1793
+ break;
1794
+ }
1795
+ }
1796
+ if (!isNewTab) {
1797
+ this.destroyTabItems(this.tabsInternal);
1798
+ this.tabsInternal = this.tabs.slice();
1799
+ this.validateItemSize();
1800
+ var tabItems = this.createTabItems(this.tabs);
1801
+ if (this.selectedTab >= this.tabs.length) {
1802
+ this.selectedTab = this.tabs.length - 1;
1803
+ }
1804
+ this.tabObj.setProperties({ items: tabItems, selectedItem: this.selectedTab });
1805
+ break;
1806
+ }
1807
+ else {
1808
+ var groups = this.tabs[parseInt(index.toString(), 10)].groups;
1809
+ var tabEle = this.tabObj.element;
1810
+ var ribbonTab = this.tabs[parseInt(index.toString(), 10)];
1811
+ ribbonTab.setProperties(tab, true);
1812
+ this.setProperties({ groups: this.checkID(ribbonTab.groups, 'group', ribbonTab.id) }, true);
1813
+ this.validateItemSize();
1814
+ var contentEle = this.tabObj.items[parseInt(index.toString(), 10)].content;
1815
+ if (groups) {
1816
+ // Check whether header is passed by the user and sets the updated values.
1817
+ if (tab.header) {
1818
+ this.tabObj.items[parseInt(index.toString(), 10)].header.text.innerText = ribbonTab.header;
1819
+ }
1820
+ // Check whether cssClass is passed by the user, and if it is, then remove the old values.
1821
+ if (tab.cssClass) {
1822
+ if (this.tabObj.items[parseInt(index.toString(), 10)].cssClass) {
1823
+ contentEle.classList.remove(this.tabObj.items[parseInt(index.toString(), 10)].cssClass);
1824
+ tabEle.querySelector('.e-active').classList.remove(this.tabObj.items[parseInt(index.toString(), 10)].cssClass);
1825
+ }
1826
+ contentEle.classList.add(ribbonTab.cssClass);
1827
+ tabEle.querySelector('.e-active').classList.add(ribbonTab.cssClass);
1828
+ }
1829
+ // Check whether group is passed by the user, and if it is, then remove the old values.
1830
+ if (tab.groups) {
1831
+ for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {
1832
+ var group = groups_1[_i];
1833
+ var dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + constants.OVERFLOW_ID + constants.DROPDOWN_ID) : null;
1834
+ for (var _a = 0, _b = group.collections; _a < _b.length; _a++) {
1835
+ var collection = _b[_a];
1836
+ for (var _c = 0, _d = collection.items; _c < _d.length; _c++) {
1837
+ var item = _d[_c];
1838
+ var ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
1839
+ if (ele) {
1840
+ this.destroyFunction(item, ele);
1841
+ }
1842
+ }
1843
+ }
1844
+ if (dropdownElement) {
1845
+ this.ribbonDropDownModule.removeOverFlowDropDown(dropdownElement);
1846
+ }
1847
+ }
1848
+ var groupElements = contentEle.querySelectorAll('.e-ribbon-group');
1849
+ // eslint-disable-next-line @typescript-eslint/tslint/config
1850
+ groupElements.forEach(function (groupEle) { groupEle.remove(); });
1851
+ var elements = this.createGroups(ribbonTab.groups, index);
1852
+ append(elements, contentEle);
1853
+ }
1854
+ }
1855
+ }
1734
1856
  }
1735
1857
  };
1736
1858
  Ribbon.prototype.switchLayout = function () {
@@ -1808,10 +1930,13 @@ var Ribbon = /** @class */ (function (_super) {
1808
1930
  itemEle = groupContainer.querySelector('#' + item.id + constants.CONTAINER_ID);
1809
1931
  if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
1810
1932
  this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemEle, groupContainer);
1811
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
1933
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
1812
1934
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
1813
1935
  }
1814
1936
  }
1937
+ if (item.type === RibbonItemType.GroupButton) {
1938
+ this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
1939
+ }
1815
1940
  item.setProperties({ activeSize: size }, true);
1816
1941
  var ele = itemEle.querySelector('#' + item.id);
1817
1942
  this.setItemSize(ele, item);
@@ -1899,14 +2024,20 @@ var Ribbon = /** @class */ (function (_super) {
1899
2024
  var itemEle = groupContainer.querySelector('#' + item.id + constants.CONTAINER_ID);
1900
2025
  if (!itemEle) {
1901
2026
  itemEle = overflowtarget.querySelector('#' + item.id + constants.CONTAINER_ID);
1902
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
2027
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
1903
2028
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
1904
2029
  }
1905
2030
  this.removeOverflowEvent(item, itemEle);
1906
2031
  }
2032
+ if (item.type === RibbonItemType.GroupButton) {
2033
+ this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
2034
+ }
1907
2035
  groupCollection.append(itemEle);
1908
2036
  }
1909
2037
  var ele = groupContainer.querySelector('#' + item.id);
2038
+ if (item.type === RibbonItemType.GroupButton) {
2039
+ ele = groupContainer.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
2040
+ }
1910
2041
  var itemsize = (item.allowedSizes & RibbonItemSize.Large) ? RibbonItemSize.Large :
1911
2042
  (item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
1912
2043
  item.setProperties({ activeSize: itemsize }, true);
@@ -2073,6 +2204,9 @@ var Ribbon = /** @class */ (function (_super) {
2073
2204
  case 'Template':
2074
2205
  this.createTemplateContent(item, itemEle);
2075
2206
  break;
2207
+ case 'GroupButton':
2208
+ this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
2209
+ break;
2076
2210
  }
2077
2211
  };
2078
2212
  Ribbon.prototype.createItems = function (itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
@@ -2121,7 +2255,7 @@ var Ribbon = /** @class */ (function (_super) {
2121
2255
  this.createRibbonItem(item, itemEle);
2122
2256
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
2123
2257
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
2124
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
2258
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
2125
2259
  this.updatePopupItems(item, itemEle, isGroupOF, true);
2126
2260
  }
2127
2261
  }
@@ -2200,54 +2334,74 @@ var Ribbon = /** @class */ (function (_super) {
2200
2334
  if (this.ribbonFileMenuModule) {
2201
2335
  this.ribbonFileMenuModule.setCommonProperties(commonProp);
2202
2336
  }
2337
+ if (this.ribbonBackstageModule) {
2338
+ this.ribbonBackstageModule.setCommonProperties(commonProp);
2339
+ }
2203
2340
  for (var i = 0; i < this.tabs.length; i++) {
2204
2341
  var tab = this.tabs[parseInt(i.toString(), 10)];
2205
2342
  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);
2343
+ if (contentEle.querySelector('.' + constants.RIBBON_GROUP)) {
2344
+ for (var _i = 0, _a = tab.groups; _i < _a.length; _i++) {
2345
+ var group = _a[_i];
2346
+ var dropdownElement = void 0;
2347
+ var dropdown = void 0;
2348
+ if (this.activeLayout === RibbonLayout.Classic) {
2349
+ dropdownElement = group.isCollapsed ?
2350
+ contentEle.querySelector('#' + group.id + constants.OVERFLOW_ID + constants.DROPDOWN_ID) : null;
2221
2351
  }
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
- }
2352
+ else {
2353
+ dropdownElement = group.enableGroupOverflow ?
2354
+ contentEle.querySelector('#' + group.id + constants.GROUPOF_BUTTON_ID) : null;
2355
+ dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
2356
+ if (dropdown) {
2357
+ updateTooltipProp(dropdown.target, commonProp);
2358
+ dropdown.setProperties(commonProp);
2232
2359
  }
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);
2360
+ }
2361
+ for (var _b = 0, _c = group.collections; _b < _c.length; _b++) {
2362
+ var collection = _c[_b];
2363
+ for (var _d = 0, _e = collection.items; _d < _e.length; _d++) {
2364
+ var item = _e[_d];
2365
+ var ele = null;
2366
+ if (this.activeLayout === RibbonLayout.Classic) {
2367
+ if (item.displayOptions & DisplayMode.Classic) {
2368
+ 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
2369
  }
2242
2370
  }
2243
- }
2244
- if (ele) {
2245
- var moduleName = this.getItemModuleName(item);
2246
- if (moduleName !== 'template') {
2247
- updateCommonProperty(ele, moduleName, commonProp);
2371
+ else {
2372
+ //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
2373
+ ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id) : null;
2374
+ // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
2375
+ if (!ele) {
2376
+ ele = dropdown.target.querySelector('#' + item.id);
2377
+ if (item.type === 'DropDown') {
2378
+ this.updatePopupItems(item, dropdown.target, group.enableGroupOverflow, true);
2379
+ }
2380
+ }
2248
2381
  }
2249
- else if (!isNullOrUndefined(commonProp.enableRtl)) {
2250
- ele.classList.toggle(constants.RTL_CSS, commonProp.enableRtl);
2382
+ if (ele) {
2383
+ var moduleName = this.getItemModuleName(item);
2384
+ if (moduleName !== 'template') {
2385
+ if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
2386
+ for (var i_4 = 0; i_4 < item.groupButtonSettings.items.length; i_4++) {
2387
+ var btnEle = ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_4);
2388
+ updateCommonProperty(btnEle, 'btn', commonProp);
2389
+ }
2390
+ }
2391
+ else if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
2392
+ updateCommonProperty(ele, 'dropdown-btn', commonProp);
2393
+ for (var i_5 = 0; i_5 < item.groupButtonSettings.items.length; i_5++) {
2394
+ var btnEle = document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_5);
2395
+ updateCommonProperty(btnEle, 'btn', commonProp);
2396
+ }
2397
+ }
2398
+ else {
2399
+ updateCommonProperty(ele, moduleName, commonProp);
2400
+ }
2401
+ }
2402
+ else if (!isNullOrUndefined(commonProp.enableRtl)) {
2403
+ ele.classList.toggle(constants.RTL_CSS, commonProp.enableRtl);
2404
+ }
2251
2405
  }
2252
2406
  }
2253
2407
  }
@@ -2293,6 +2447,10 @@ var Ribbon = /** @class */ (function (_super) {
2293
2447
  if (item.displayOptions & DisplayMode.Classic) {
2294
2448
  ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) :
2295
2449
  contentEle.querySelector('#' + item.id);
2450
+ if (item.type === RibbonItemType.GroupButton) {
2451
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + constants.RIBBON_GROUP_BUTTON_ID) :
2452
+ contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
2453
+ }
2296
2454
  }
2297
2455
  }
2298
2456
  else {
@@ -2327,6 +2485,32 @@ var Ribbon = /** @class */ (function (_super) {
2327
2485
  if (moduleName === 'colorpicker') {
2328
2486
  this.ribbonColorPickerModule.unwireColorPickerEvents(ele);
2329
2487
  }
2488
+ else if (moduleName === 'group-btn') {
2489
+ if (this.activeLayout === 'Classic') {
2490
+ for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
2491
+ var btnEle = ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i);
2492
+ if (btnEle) {
2493
+ destroyControl(btnEle, 'btn');
2494
+ }
2495
+ }
2496
+ }
2497
+ else {
2498
+ this.ribbonGroupButtonModule.destroyDropDown(item);
2499
+ }
2500
+ var _loop_3 = function (i) {
2501
+ if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings) {
2502
+ var groupButtonID_1 = item.id + constants.RIBBON_GROUP_BUTTON_ID + i;
2503
+ var index = getIndex(this_3.tooltipData, function (e) { return e.id === groupButtonID_1; });
2504
+ if (index !== -1) {
2505
+ this_3.tooltipData.splice(index, 1);
2506
+ }
2507
+ }
2508
+ };
2509
+ var this_3 = this;
2510
+ for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
2511
+ _loop_3(i);
2512
+ }
2513
+ }
2330
2514
  else if (moduleName !== 'template') {
2331
2515
  destroyControl(ele, moduleName);
2332
2516
  }
@@ -2336,6 +2520,9 @@ var Ribbon = /** @class */ (function (_super) {
2336
2520
  this.tooltipData.splice(index, 1);
2337
2521
  }
2338
2522
  }
2523
+ if (item.type === 'GroupButton') {
2524
+ this.ribbonGroupButtonModule.destroyDropDown(item);
2525
+ }
2339
2526
  };
2340
2527
  Ribbon.prototype.getItemModuleName = function (item) {
2341
2528
  switch (item.type) {
@@ -2351,6 +2538,8 @@ var Ribbon = /** @class */ (function (_super) {
2351
2538
  return 'colorpicker';
2352
2539
  case 'ComboBox':
2353
2540
  return 'combobox';
2541
+ case 'GroupButton':
2542
+ return 'group-btn';
2354
2543
  default:
2355
2544
  return 'template';
2356
2545
  }
@@ -2384,6 +2573,56 @@ var Ribbon = /** @class */ (function (_super) {
2384
2573
  var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
2385
2574
  this.setProperties({ selectedTab: index });
2386
2575
  };
2576
+ /**
2577
+ * Shows a specific tab in the ribbon.
2578
+ *
2579
+ * @param {string} tabId - The ID of the tab to be shown.
2580
+ * @returns {void}
2581
+ */
2582
+ Ribbon.prototype.showTab = function (tabId) {
2583
+ this.showHideTab(tabId, false);
2584
+ };
2585
+ /**
2586
+ * Hides a specific tab in the ribbon.
2587
+ *
2588
+ * @param {string} tabId - The ID of the tab to be hidden.
2589
+ * @returns {void}
2590
+ */
2591
+ Ribbon.prototype.hideTab = function (tabId) {
2592
+ this.showHideTab(tabId, true);
2593
+ };
2594
+ Ribbon.prototype.showHideTab = function (tabId, value) {
2595
+ var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
2596
+ if (index === -1) {
2597
+ return;
2598
+ }
2599
+ this.tabObj.hideTab(index, value);
2600
+ };
2601
+ /**
2602
+ * Enables a specific tab in the ribbon.
2603
+ *
2604
+ * @param {string} tabId - The ID of the tab to be enabled.
2605
+ * @returns {void}
2606
+ */
2607
+ Ribbon.prototype.enableTab = function (tabId) {
2608
+ this.enableDisableTab(tabId, true);
2609
+ };
2610
+ /**
2611
+ * Disables a specific tab in the ribbon.
2612
+ *
2613
+ * @param {string} tabId - The ID of the tab to be disabled.
2614
+ * @returns {void}
2615
+ */
2616
+ Ribbon.prototype.disableTab = function (tabId) {
2617
+ this.enableDisableTab(tabId, false);
2618
+ };
2619
+ Ribbon.prototype.enableDisableTab = function (tabId, value) {
2620
+ var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
2621
+ if (index === -1) {
2622
+ return;
2623
+ }
2624
+ this.tabObj.enableTab(index, value);
2625
+ };
2387
2626
  /**
2388
2627
  * Adds the ribbon tab.
2389
2628
  *
@@ -2418,14 +2657,18 @@ var Ribbon = /** @class */ (function (_super) {
2418
2657
  var contentEle = this.tabObj.items[parseInt(index.toString(), 10)].content;
2419
2658
  var groups = this.tabs[parseInt(index.toString(), 10)].groups;
2420
2659
  if (groups && (contentEle.innerHTML !== '')) {
2421
- for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {
2422
- var group = groups_1[_i];
2660
+ for (var _i = 0, groups_2 = groups; _i < groups_2.length; _i++) {
2661
+ var group = groups_2[_i];
2423
2662
  var dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + constants.OVERFLOW_ID + constants.DROPDOWN_ID) : null;
2424
2663
  for (var _a = 0, _b = group.collections; _a < _b.length; _a++) {
2425
2664
  var collection = _b[_a];
2426
2665
  for (var _c = 0, _d = collection.items; _c < _d.length; _c++) {
2427
2666
  var item = _d[_c];
2428
2667
  var ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
2668
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
2669
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + constants.RIBBON_GROUP_BUTTON_ID) :
2670
+ contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
2671
+ }
2429
2672
  if (ele) {
2430
2673
  this.destroyFunction(item, ele);
2431
2674
  }
@@ -2549,6 +2792,105 @@ var Ribbon = /** @class */ (function (_super) {
2549
2792
  this.refreshLayout();
2550
2793
  }
2551
2794
  };
2795
+ /**
2796
+ * Hides a specific group within a ribbon tab.
2797
+ *
2798
+ * @param {string} groupID - The ID of the group to be hidden.
2799
+ * @returns {void}
2800
+ */
2801
+ Ribbon.prototype.hideGroup = function (groupID) {
2802
+ this.showHideGroup(groupID, true);
2803
+ };
2804
+ /**
2805
+ * Shows a specific group within a ribbon tab.
2806
+ *
2807
+ * @param {string} groupID - The ID of the group to be shown.
2808
+ * @returns {void}
2809
+ */
2810
+ Ribbon.prototype.showGroup = function (groupID) {
2811
+ this.showHideGroup(groupID, false);
2812
+ };
2813
+ Ribbon.prototype.showHideGroup = function (groupID, isHidden) {
2814
+ var overflowDDB;
2815
+ var overflowtarget;
2816
+ var itemProp = getGroup(this.tabs, groupID);
2817
+ if (!itemProp) {
2818
+ return;
2819
+ }
2820
+ var contentEle = this.tabObj.items[itemProp.tabIndex].content;
2821
+ var groupEle = contentEle.querySelector('#' + groupID);
2822
+ isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
2823
+ if (this.overflowDDB) {
2824
+ var overflowEle = this.overflowDDB.target;
2825
+ var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
2826
+ if (itemProp.group.enableGroupOverflow) {
2827
+ var overflowDDBEle = contentEle.querySelector('#' + groupID + constants.GROUPOF_BUTTON_ID);
2828
+ if (overflowDDBEle) {
2829
+ overflowDDB = getInstance(overflowDDBEle, DropDownButton);
2830
+ overflowtarget = overflowDDB.target;
2831
+ }
2832
+ if (overflowtarget) {
2833
+ isHidden ? overflowtarget.classList.add('e-hidden') : overflowtarget.classList.remove('e-hidden');
2834
+ }
2835
+ }
2836
+ else if (ofTabContainer) {
2837
+ var grpContainer = ofTabContainer.querySelector('#' + groupID + constants.CONTAINER_ID);
2838
+ if (grpContainer) {
2839
+ isHidden ? grpContainer.classList.add('e-hidden') : grpContainer.classList.remove('e-hidden');
2840
+ }
2841
+ }
2842
+ }
2843
+ this.refreshLayout();
2844
+ };
2845
+ /**
2846
+ * Disables a specific group within a ribbon tab.
2847
+ *
2848
+ * @param {string} groupID - The ID of the group to be disabled.
2849
+ * @returns {void}
2850
+ */
2851
+ Ribbon.prototype.disableGroup = function (groupID) {
2852
+ this.enableDisableGroup(groupID, true);
2853
+ };
2854
+ /**
2855
+ * Enables a specific group within a ribbon tab.
2856
+ *
2857
+ * @param {string} groupID - The ID of the group to be enabled.
2858
+ * @returns {void}
2859
+ */
2860
+ Ribbon.prototype.enableGroup = function (groupID) {
2861
+ this.enableDisableGroup(groupID, false);
2862
+ };
2863
+ Ribbon.prototype.enableDisableGroup = function (groupID, isDisabled) {
2864
+ var overflowDDB;
2865
+ var overflowtarget;
2866
+ var itemProp = getGroup(this.tabs, groupID);
2867
+ if (!itemProp) {
2868
+ return;
2869
+ }
2870
+ var contentEle = this.tabObj.items[itemProp.tabIndex].content;
2871
+ var groupEle = contentEle.querySelector('#' + groupID);
2872
+ isDisabled ? groupEle.classList.add('e-disabled') : groupEle.classList.remove('e-disabled');
2873
+ if (this.overflowDDB) {
2874
+ var overflowEle = this.overflowDDB.target;
2875
+ var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
2876
+ if (itemProp.group.enableGroupOverflow) {
2877
+ var overflowDDBEle = contentEle.querySelector('#' + groupID + constants.GROUPOF_BUTTON_ID);
2878
+ if (overflowDDBEle) {
2879
+ overflowDDB = getInstance(overflowDDBEle, DropDownButton);
2880
+ overflowtarget = overflowDDB.target;
2881
+ }
2882
+ if (overflowtarget) {
2883
+ isDisabled ? overflowtarget.classList.add('e-disabled') : overflowtarget.classList.remove('e-disabled');
2884
+ }
2885
+ }
2886
+ else if (ofTabContainer) {
2887
+ var grpContainer = ofTabContainer.querySelector('#' + groupID + constants.CONTAINER_ID);
2888
+ if (grpContainer) {
2889
+ isDisabled ? grpContainer.classList.add('e-disabled') : grpContainer.classList.remove('e-disabled');
2890
+ }
2891
+ }
2892
+ }
2893
+ };
2552
2894
  /**
2553
2895
  * adds the ribbon collection.
2554
2896
  *
@@ -2722,6 +3064,41 @@ var Ribbon = /** @class */ (function (_super) {
2722
3064
  this.refreshLayout();
2723
3065
  }
2724
3066
  };
3067
+ /**
3068
+ * Hides a specific ribbon item.
3069
+ *
3070
+ * @param {string} itemId - The ID of the item to be hidden.
3071
+ * @returns {void}
3072
+ */
3073
+ Ribbon.prototype.hideItem = function (itemId) {
3074
+ this.showHideItem(itemId, true);
3075
+ };
3076
+ /**
3077
+ * Shows a specific ribbon item.
3078
+ *
3079
+ * @param {string} itemId - The ID of the item to be shown.
3080
+ * @returns {void}
3081
+ */
3082
+ Ribbon.prototype.showItem = function (itemId) {
3083
+ this.showHideItem(itemId, false);
3084
+ };
3085
+ Ribbon.prototype.showHideItem = function (itemId, isHidden) {
3086
+ var itemProp = getItem(this.tabs, itemId);
3087
+ if (!itemProp) {
3088
+ return;
3089
+ }
3090
+ var ele;
3091
+ if (itemProp.item.type === 'GroupButton') {
3092
+ ele = getItemElement(this, itemId + constants.RIBBON_GROUP_BUTTON_ID, itemProp);
3093
+ }
3094
+ else {
3095
+ ele = getItemElement(this, itemId, itemProp);
3096
+ }
3097
+ if (ele) {
3098
+ var itemEle = closest(ele, '.e-ribbon-item');
3099
+ isHidden ? itemEle.classList.add('e-hidden') : itemEle.classList.remove('e-hidden');
3100
+ }
3101
+ };
2725
3102
  /**
2726
3103
  * tab - Gets the ribbon tab to be updated. The id of the tab is a required property. Other properties are optional.
2727
3104
  *
@@ -2747,14 +3124,18 @@ var Ribbon = /** @class */ (function (_super) {
2747
3124
  }
2748
3125
  // Check whether group is passed by the user, and if it is, then remove the old values.
2749
3126
  if (tab.groups) {
2750
- for (var _i = 0, groups_2 = groups; _i < groups_2.length; _i++) {
2751
- var group = groups_2[_i];
3127
+ for (var _i = 0, groups_3 = groups; _i < groups_3.length; _i++) {
3128
+ var group = groups_3[_i];
2752
3129
  var dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + constants.OVERFLOW_ID + constants.DROPDOWN_ID) : null;
2753
3130
  for (var _a = 0, _b = group.collections; _a < _b.length; _a++) {
2754
3131
  var collection = _b[_a];
2755
3132
  for (var _c = 0, _d = collection.items; _c < _d.length; _c++) {
2756
3133
  var item = _d[_c];
2757
3134
  var ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
3135
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
3136
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + constants.RIBBON_GROUP_BUTTON_ID) :
3137
+ contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
3138
+ }
2758
3139
  if (ele) {
2759
3140
  this.destroyFunction(item, ele);
2760
3141
  }
@@ -3026,9 +3407,12 @@ var Ribbon = /** @class */ (function (_super) {
3026
3407
  else {
3027
3408
  itemContainer = groupContainer.querySelector('#' + itemId + constants.CONTAINER_ID);
3028
3409
  itemEle = contentEle.querySelector('#' + itemId);
3410
+ if (itemProp.item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Classic) {
3411
+ itemEle = contentEle.querySelector('#' + itemId + constants.RIBBON_GROUP_BUTTON_ID);
3412
+ }
3029
3413
  if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
3030
3414
  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)) {
3415
+ if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
3032
3416
  this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
3033
3417
  }
3034
3418
  }
@@ -3092,6 +3476,9 @@ var Ribbon = /** @class */ (function (_super) {
3092
3476
  var ele = null;
3093
3477
  if (this.activeLayout === RibbonLayout.Classic) {
3094
3478
  ele = (item.displayOptions & DisplayMode.Classic) ? contentEle.querySelector('#' + item.id) : null;
3479
+ if (item.type === 'GroupButton') {
3480
+ ele = (item.displayOptions & DisplayMode.Classic) ? contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID) : null;
3481
+ }
3095
3482
  }
3096
3483
  else {
3097
3484
  //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
@@ -3103,7 +3490,12 @@ var Ribbon = /** @class */ (function (_super) {
3103
3490
  }
3104
3491
  if (ele) {
3105
3492
  this.destroyFunction(item, ele);
3106
- ele.closest('#' + item.id + constants.CONTAINER_ID).remove();
3493
+ if (item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Simplified) {
3494
+ document.getElementById(item.id + constants.CONTAINER_ID).remove();
3495
+ }
3496
+ else {
3497
+ ele.closest('#' + item.id + constants.CONTAINER_ID).remove();
3498
+ }
3107
3499
  }
3108
3500
  };
3109
3501
  /**
@@ -3130,13 +3522,34 @@ var Ribbon = /** @class */ (function (_super) {
3130
3522
  return;
3131
3523
  }
3132
3524
  itemProp.item.setProperties({ disabled: isDisabled }, true);
3133
- var ele = getItemElement(this, itemId, itemProp);
3525
+ var ele;
3526
+ if (itemProp.item.type === 'GroupButton') {
3527
+ ele = getItemElement(this, itemId + constants.RIBBON_GROUP_BUTTON_ID, itemProp);
3528
+ }
3529
+ else {
3530
+ ele = getItemElement(this, itemId, itemProp);
3531
+ }
3134
3532
  if (ele) {
3135
3533
  var itemEle = closest(ele, '.e-ribbon-item');
3136
3534
  itemEle.classList.toggle(constants.DISABLED_CSS, itemProp.item.disabled);
3137
3535
  var moduleName = this.getItemModuleName(itemProp.item);
3138
3536
  if (moduleName !== 'template') {
3139
- updateControlDisabled(ele, moduleName, isDisabled);
3537
+ if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
3538
+ updateControlDisabled(ele, 'dropdown-btn', isDisabled);
3539
+ for (var i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
3540
+ var btnEle = document.querySelector('#' + itemId + constants.RIBBON_GROUP_BUTTON_ID + i);
3541
+ updateControlDisabled(btnEle, 'btn', isDisabled);
3542
+ }
3543
+ }
3544
+ else if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
3545
+ for (var i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
3546
+ var btnEle = ele.querySelector('#' + itemId + constants.RIBBON_GROUP_BUTTON_ID + i);
3547
+ updateControlDisabled(btnEle, 'btn', isDisabled);
3548
+ }
3549
+ }
3550
+ else {
3551
+ updateControlDisabled(ele, moduleName, isDisabled);
3552
+ }
3140
3553
  }
3141
3554
  else {
3142
3555
  ele.classList.toggle(constants.DISABLED_CSS, isDisabled);
@@ -3152,7 +3565,9 @@ var Ribbon = /** @class */ (function (_super) {
3152
3565
  this.keyboardModuleRibbon = null;
3153
3566
  destroyTooltip(this.element);
3154
3567
  this.destroyTabItems(this.tabs);
3155
- this.removeExpandCollapse();
3568
+ if (!this.hideLayoutSwitcher) {
3569
+ this.removeExpandCollapse();
3570
+ }
3156
3571
  this.collapseButton = undefined;
3157
3572
  if (this.scrollModule) {
3158
3573
  this.scrollModule.destroy();
@@ -3249,7 +3664,7 @@ var Ribbon = /** @class */ (function (_super) {
3249
3664
  this.tabObj.setProperties({ animation: newProp.tabAnimation });
3250
3665
  break;
3251
3666
  case 'tabs':
3252
- this.reRenderTabs();
3667
+ this.reRenderTabs(newProp.tabs);
3253
3668
  break;
3254
3669
  case 'width':
3255
3670
  this.element.style.width = formatUnit(newProp.width);
@@ -3262,6 +3677,13 @@ var Ribbon = /** @class */ (function (_super) {
3262
3677
  var toolbarEle = this.tabObj['tbObj'];
3263
3678
  toolbarEle.refreshOverflow();
3264
3679
  break;
3680
+ case 'backStageMenu':
3681
+ if (this.ribbonBackstageModule) {
3682
+ this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu);
3683
+ }
3684
+ var toolbarElement = this.tabObj['tbObj'];
3685
+ toolbarElement.refreshOverflow();
3686
+ break;
3265
3687
  case 'helpPaneTemplate':
3266
3688
  if (this.ribbonTempEle) {
3267
3689
  remove(this.ribbonTempEle);
@@ -3274,6 +3696,9 @@ var Ribbon = /** @class */ (function (_super) {
3274
3696
  var toolbar_1 = this.tabObj['tbObj'];
3275
3697
  toolbar_1.refreshOverflow();
3276
3698
  break;
3699
+ case 'hideLayoutSwitcher':
3700
+ this.hideLayoutSwitcher ? this.removeExpandCollapse() : this.addExpandCollapse();
3701
+ break;
3277
3702
  }
3278
3703
  }
3279
3704
  };
@@ -3287,6 +3712,9 @@ var Ribbon = /** @class */ (function (_super) {
3287
3712
  __decorate([
3288
3713
  Complex({}, FileMenuSettings)
3289
3714
  ], Ribbon.prototype, "fileMenu", void 0);
3715
+ __decorate([
3716
+ Complex({}, BackStageMenu)
3717
+ ], Ribbon.prototype, "backStageMenu", void 0);
3290
3718
  __decorate([
3291
3719
  Property('')
3292
3720
  ], Ribbon.prototype, "launcherIconCss", void 0);
@@ -3311,6 +3739,9 @@ var Ribbon = /** @class */ (function (_super) {
3311
3739
  __decorate([
3312
3740
  Property('')
3313
3741
  ], Ribbon.prototype, "helpPaneTemplate", void 0);
3742
+ __decorate([
3743
+ Property(false)
3744
+ ], Ribbon.prototype, "hideLayoutSwitcher", void 0);
3314
3745
  __decorate([
3315
3746
  Event()
3316
3747
  ], Ribbon.prototype, "tabSelecting", void 0);
@@ -3326,6 +3757,9 @@ var Ribbon = /** @class */ (function (_super) {
3326
3757
  __decorate([
3327
3758
  Event()
3328
3759
  ], Ribbon.prototype, "launcherIconClick", void 0);
3760
+ __decorate([
3761
+ Event()
3762
+ ], Ribbon.prototype, "created", void 0);
3329
3763
  Ribbon = Ribbon_1 = __decorate([
3330
3764
  NotifyPropertyChanges
3331
3765
  ], Ribbon);