@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
@@ -4,7 +4,7 @@ import { ComboBox, FieldSettings } from '@syncfusion/ej2-dropdowns';
4
4
  import { DropDownButton, Item, SplitButton } from '@syncfusion/ej2-splitbuttons';
5
5
  import { Button, CheckBox } from '@syncfusion/ej2-buttons';
6
6
  import { ColorPicker } from '@syncfusion/ej2-inputs';
7
- import { Tooltip } from '@syncfusion/ej2-popups';
7
+ import { Popup, Tooltip } from '@syncfusion/ej2-popups';
8
8
 
9
9
  /**
10
10
  * Defines the layout types of ribbon.
@@ -74,7 +74,7 @@ var DisplayMode;
74
74
  */
75
75
  DisplayMode[DisplayMode["Overflow"] = 1] = "Overflow";
76
76
  /**
77
- * The item appears in classic layout group, simplified layout group, and overflow popup based on ribbon overflow state.
77
+ * The item appears in classic layout group, simplified layout group, and overflow popup based on ribbon overflow state.
78
78
  */
79
79
  DisplayMode[DisplayMode["Auto"] = 7] = "Auto";
80
80
  })(DisplayMode || (DisplayMode = {}));
@@ -107,11 +107,29 @@ var RibbonItemType;
107
107
  * Renders splitbutton as ribbon item.
108
108
  */
109
109
  RibbonItemType["SplitButton"] = "SplitButton";
110
+ /**
111
+ * Renders the group button content as ribbon item.
112
+ */
113
+ RibbonItemType["GroupButton"] = "GroupButton";
110
114
  /**
111
115
  * Renders the template content as ribbon item.
112
116
  */
113
117
  RibbonItemType["Template"] = "Template";
114
118
  })(RibbonItemType || (RibbonItemType = {}));
119
+ /**
120
+ * Defines the alignment of the items in the ribbon group.
121
+ */
122
+ var RibbonGroupButtonSelection;
123
+ (function (RibbonGroupButtonSelection) {
124
+ /**
125
+ * Allows selecting single button from button group.
126
+ */
127
+ RibbonGroupButtonSelection["Single"] = "Single";
128
+ /**
129
+ * Allows selecting multiple buttons from button group.
130
+ */
131
+ RibbonGroupButtonSelection["Multiple"] = "Multiple";
132
+ })(RibbonGroupButtonSelection || (RibbonGroupButtonSelection = {}));
115
133
 
116
134
  var __extends$5 = (undefined && undefined.__extends) || (function () {
117
135
  var extendStatics = function (d, b) {
@@ -491,6 +509,9 @@ var RibbonDropDownSettings = /** @__PURE__ @class */ (function (_super) {
491
509
  __decorate$9([
492
510
  Property('')
493
511
  ], RibbonDropDownSettings.prototype, "target", void 0);
512
+ __decorate$9([
513
+ Property(false)
514
+ ], RibbonDropDownSettings.prototype, "createPopupOnClick", void 0);
494
515
  __decorate$9([
495
516
  Event()
496
517
  ], RibbonDropDownSettings.prototype, "beforeClose", void 0);
@@ -641,6 +662,90 @@ var RibbonTooltip = /** @__PURE__ @class */ (function (_super) {
641
662
  return RibbonTooltip;
642
663
  }(ChildProperty));
643
664
 
665
+ var __extends$13 = (undefined && undefined.__extends) || (function () {
666
+ var extendStatics = function (d, b) {
667
+ extendStatics = Object.setPrototypeOf ||
668
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
669
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
670
+ return extendStatics(d, b);
671
+ };
672
+ return function (d, b) {
673
+ extendStatics(d, b);
674
+ function __() { this.constructor = d; }
675
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
676
+ };
677
+ })();
678
+ var __decorate$13 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
679
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
680
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
681
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
682
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
683
+ };
684
+ /**
685
+ * Defines the ribbon group button settings.
686
+ */
687
+ var RibbonGroupButtonItem = /** @__PURE__ @class */ (function (_super) {
688
+ __extends$13(RibbonGroupButtonItem, _super);
689
+ function RibbonGroupButtonItem() {
690
+ return _super !== null && _super.apply(this, arguments) || this;
691
+ }
692
+ __decorate$13([
693
+ Property('')
694
+ ], RibbonGroupButtonItem.prototype, "content", void 0);
695
+ __decorate$13([
696
+ Property('')
697
+ ], RibbonGroupButtonItem.prototype, "iconCss", void 0);
698
+ __decorate$13([
699
+ Complex({}, RibbonTooltip)
700
+ ], RibbonGroupButtonItem.prototype, "ribbonTooltipSettings", void 0);
701
+ __decorate$13([
702
+ Property(false)
703
+ ], RibbonGroupButtonItem.prototype, "selected", void 0);
704
+ __decorate$13([
705
+ Event()
706
+ ], RibbonGroupButtonItem.prototype, "beforeClick", void 0);
707
+ __decorate$13([
708
+ Event()
709
+ ], RibbonGroupButtonItem.prototype, "click", void 0);
710
+ return RibbonGroupButtonItem;
711
+ }(ChildProperty));
712
+
713
+ var __extends$12 = (undefined && undefined.__extends) || (function () {
714
+ var extendStatics = function (d, b) {
715
+ extendStatics = Object.setPrototypeOf ||
716
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
717
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
718
+ return extendStatics(d, b);
719
+ };
720
+ return function (d, b) {
721
+ extendStatics(d, b);
722
+ function __() { this.constructor = d; }
723
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
724
+ };
725
+ })();
726
+ var __decorate$12 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
727
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
728
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
729
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
730
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
731
+ };
732
+ /**
733
+ * Defines the ribbon group button settings.
734
+ */
735
+ var RibbonGroupButtonSettings = /** @__PURE__ @class */ (function (_super) {
736
+ __extends$12(RibbonGroupButtonSettings, _super);
737
+ function RibbonGroupButtonSettings() {
738
+ return _super !== null && _super.apply(this, arguments) || this;
739
+ }
740
+ __decorate$12([
741
+ Property('Single')
742
+ ], RibbonGroupButtonSettings.prototype, "selection", void 0);
743
+ __decorate$12([
744
+ Collection([], RibbonGroupButtonItem)
745
+ ], RibbonGroupButtonSettings.prototype, "items", void 0);
746
+ return RibbonGroupButtonSettings;
747
+ }(ChildProperty));
748
+
644
749
  var __extends$4 = (undefined && undefined.__extends) || (function () {
645
750
  var extendStatics = function (d, b) {
646
751
  extendStatics = Object.setPrototypeOf ||
@@ -722,6 +827,9 @@ var RibbonItem = /** @__PURE__ @class */ (function (_super) {
722
827
  __decorate$4([
723
828
  Complex({}, RibbonSplitButtonSettings)
724
829
  ], RibbonItem.prototype, "splitButtonSettings", void 0);
830
+ __decorate$4([
831
+ Complex({}, RibbonGroupButtonSettings)
832
+ ], RibbonItem.prototype, "groupButtonSettings", void 0);
725
833
  return RibbonItem;
726
834
  }(ChildProperty));
727
835
 
@@ -896,7 +1004,7 @@ var RibbonTab = /** @__PURE__ @class */ (function (_super) {
896
1004
  return RibbonTab;
897
1005
  }(ChildProperty));
898
1006
 
899
- var __extends$12 = (undefined && undefined.__extends) || (function () {
1007
+ var __extends$14 = (undefined && undefined.__extends) || (function () {
900
1008
  var extendStatics = function (d, b) {
901
1009
  extendStatics = Object.setPrototypeOf ||
902
1010
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -909,7 +1017,7 @@ var __extends$12 = (undefined && undefined.__extends) || (function () {
909
1017
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
910
1018
  };
911
1019
  })();
912
- var __decorate$12 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1020
+ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
913
1021
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
914
1022
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
915
1023
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -919,7 +1027,7 @@ var __decorate$12 = (undefined && undefined.__decorate) || function (decorators,
919
1027
  * Defines the ribbon file menu settings.
920
1028
  */
921
1029
  var FileMenuSettings = /** @__PURE__ @class */ (function (_super) {
922
- __extends$12(FileMenuSettings, _super);
1030
+ __extends$14(FileMenuSettings, _super);
923
1031
  function FileMenuSettings() {
924
1032
  return _super !== null && _super.apply(this, arguments) || this;
925
1033
  }
@@ -932,51 +1040,207 @@ var FileMenuSettings = /** @__PURE__ @class */ (function (_super) {
932
1040
  FileMenuSettings.prototype.setProperties = function (prop, muteOnChange) {
933
1041
  _super.prototype.setProperties.call(this, prop, muteOnChange);
934
1042
  };
935
- __decorate$12([
1043
+ __decorate$14([
936
1044
  Property('File')
937
1045
  ], FileMenuSettings.prototype, "text", void 0);
938
- __decorate$12([
1046
+ __decorate$14([
939
1047
  Property(false)
940
1048
  ], FileMenuSettings.prototype, "visible", void 0);
941
- __decorate$12([
1049
+ __decorate$14([
942
1050
  Collection([], MenuItem)
943
1051
  ], FileMenuSettings.prototype, "menuItems", void 0);
944
- __decorate$12([
1052
+ __decorate$14([
945
1053
  Property(false)
946
1054
  ], FileMenuSettings.prototype, "showItemOnClick", void 0);
947
- __decorate$12([
1055
+ __decorate$14([
948
1056
  Complex({}, MenuAnimationSettings)
949
1057
  ], FileMenuSettings.prototype, "animationSettings", void 0);
950
- __decorate$12([
1058
+ __decorate$14([
951
1059
  Property('')
952
1060
  ], FileMenuSettings.prototype, "itemTemplate", void 0);
953
- __decorate$12([
1061
+ __decorate$14([
954
1062
  Property('')
955
1063
  ], FileMenuSettings.prototype, "popupTemplate", void 0);
956
- __decorate$12([
1064
+ __decorate$14([
957
1065
  Complex({}, RibbonTooltip)
958
1066
  ], FileMenuSettings.prototype, "ribbonTooltipSettings", void 0);
959
- __decorate$12([
1067
+ __decorate$14([
960
1068
  Event()
961
1069
  ], FileMenuSettings.prototype, "beforeClose", void 0);
962
- __decorate$12([
1070
+ __decorate$14([
963
1071
  Event()
964
1072
  ], FileMenuSettings.prototype, "beforeOpen", void 0);
965
- __decorate$12([
1073
+ __decorate$14([
966
1074
  Event()
967
1075
  ], FileMenuSettings.prototype, "beforeItemRender", void 0);
968
- __decorate$12([
1076
+ __decorate$14([
969
1077
  Event()
970
1078
  ], FileMenuSettings.prototype, "close", void 0);
971
- __decorate$12([
1079
+ __decorate$14([
972
1080
  Event()
973
1081
  ], FileMenuSettings.prototype, "open", void 0);
974
- __decorate$12([
1082
+ __decorate$14([
975
1083
  Event()
976
1084
  ], FileMenuSettings.prototype, "select", void 0);
977
1085
  return FileMenuSettings;
978
1086
  }(ChildProperty));
979
1087
 
1088
+ var __extends$16 = (undefined && undefined.__extends) || (function () {
1089
+ var extendStatics = function (d, b) {
1090
+ extendStatics = Object.setPrototypeOf ||
1091
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1092
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
1093
+ return extendStatics(d, b);
1094
+ };
1095
+ return function (d, b) {
1096
+ extendStatics(d, b);
1097
+ function __() { this.constructor = d; }
1098
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1099
+ };
1100
+ })();
1101
+ var __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1102
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1103
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1104
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1105
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1106
+ };
1107
+ /**
1108
+ * Defines the ribbon backstage back button.
1109
+ */
1110
+ var BackstageBackButton = /** @__PURE__ @class */ (function (_super) {
1111
+ __extends$16(BackstageBackButton, _super);
1112
+ function BackstageBackButton() {
1113
+ return _super !== null && _super.apply(this, arguments) || this;
1114
+ }
1115
+ __decorate$16([
1116
+ Property('')
1117
+ ], BackstageBackButton.prototype, "text", void 0);
1118
+ __decorate$16([
1119
+ Property('')
1120
+ ], BackstageBackButton.prototype, "iconCss", void 0);
1121
+ __decorate$16([
1122
+ Property(true)
1123
+ ], BackstageBackButton.prototype, "visible", void 0);
1124
+ return BackstageBackButton;
1125
+ }(ChildProperty));
1126
+
1127
+ var __extends$17 = (undefined && undefined.__extends) || (function () {
1128
+ var extendStatics = function (d, b) {
1129
+ extendStatics = Object.setPrototypeOf ||
1130
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1131
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
1132
+ return extendStatics(d, b);
1133
+ };
1134
+ return function (d, b) {
1135
+ extendStatics(d, b);
1136
+ function __() { this.constructor = d; }
1137
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1138
+ };
1139
+ })();
1140
+ var __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1141
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1142
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1143
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1144
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1145
+ };
1146
+ /**
1147
+ * Defines the ribbon backstage back button.
1148
+ */
1149
+ var BackstageItem = /** @__PURE__ @class */ (function (_super) {
1150
+ __extends$17(BackstageItem, _super);
1151
+ function BackstageItem() {
1152
+ return _super !== null && _super.apply(this, arguments) || this;
1153
+ }
1154
+ __decorate$17([
1155
+ Property('')
1156
+ ], BackstageItem.prototype, "text", void 0);
1157
+ __decorate$17([
1158
+ Property('')
1159
+ ], BackstageItem.prototype, "id", void 0);
1160
+ __decorate$17([
1161
+ Property('')
1162
+ ], BackstageItem.prototype, "content", void 0);
1163
+ __decorate$17([
1164
+ Property('')
1165
+ ], BackstageItem.prototype, "iconCss", void 0);
1166
+ __decorate$17([
1167
+ Property(false)
1168
+ ], BackstageItem.prototype, "separator", void 0);
1169
+ __decorate$17([
1170
+ Property(false)
1171
+ ], BackstageItem.prototype, "isFooter", void 0);
1172
+ __decorate$17([
1173
+ Event()
1174
+ ], BackstageItem.prototype, "backStageItemClick", void 0);
1175
+ return BackstageItem;
1176
+ }(ChildProperty));
1177
+
1178
+ var __extends$15 = (undefined && undefined.__extends) || (function () {
1179
+ var extendStatics = function (d, b) {
1180
+ extendStatics = Object.setPrototypeOf ||
1181
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1182
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
1183
+ return extendStatics(d, b);
1184
+ };
1185
+ return function (d, b) {
1186
+ extendStatics(d, b);
1187
+ function __() { this.constructor = d; }
1188
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1189
+ };
1190
+ })();
1191
+ var __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1192
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1193
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1194
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1195
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1196
+ };
1197
+ /**
1198
+ * Defines the ribbon file menu settings.
1199
+ */
1200
+ var BackStageMenu = /** @__PURE__ @class */ (function (_super) {
1201
+ __extends$15(BackStageMenu, _super);
1202
+ function BackStageMenu() {
1203
+ return _super !== null && _super.apply(this, arguments) || this;
1204
+ }
1205
+ /**
1206
+ * @param {Object} prop - Gets the property of Backstage Menu.
1207
+ * @param {boolean} muteOnChange - Gets the boolean value of muteOnChange.
1208
+ * @returns {void}
1209
+ * @private
1210
+ */
1211
+ BackStageMenu.prototype.setProperties = function (prop, muteOnChange) {
1212
+ _super.prototype.setProperties.call(this, prop, muteOnChange);
1213
+ };
1214
+ __decorate$15([
1215
+ Property('File')
1216
+ ], BackStageMenu.prototype, "text", void 0);
1217
+ __decorate$15([
1218
+ Property(false)
1219
+ ], BackStageMenu.prototype, "visible", void 0);
1220
+ __decorate$15([
1221
+ Property('auto')
1222
+ ], BackStageMenu.prototype, "height", void 0);
1223
+ __decorate$15([
1224
+ Property('auto')
1225
+ ], BackStageMenu.prototype, "width", void 0);
1226
+ __decorate$15([
1227
+ Property(null)
1228
+ ], BackStageMenu.prototype, "target", void 0);
1229
+ __decorate$15([
1230
+ Complex({}, BackstageBackButton)
1231
+ ], BackStageMenu.prototype, "backButton", void 0);
1232
+ __decorate$15([
1233
+ Collection([], BackstageItem)
1234
+ ], BackStageMenu.prototype, "items", void 0);
1235
+ __decorate$15([
1236
+ Property('')
1237
+ ], BackStageMenu.prototype, "template", void 0);
1238
+ __decorate$15([
1239
+ Complex({}, RibbonTooltip)
1240
+ ], BackStageMenu.prototype, "ribbonTooltipSettings", void 0);
1241
+ return BackStageMenu;
1242
+ }(ChildProperty));
1243
+
980
1244
  // export * from './file-menu';
981
1245
 
982
1246
  /**
@@ -987,6 +1251,8 @@ var ITEM_VERTICAL_CENTER = 'e-ribbon-vertical-center';
987
1251
  /** @hidden */
988
1252
  var EXPAND_COLLAPSE_ICON = 'e-icons e-drop-icon';
989
1253
  /** @hidden */
1254
+ var BACKSTAGE_CLOSE_ICON = 'e-icons e-arrow-left';
1255
+ /** @hidden */
990
1256
  var OVERFLOW_ICON = 'e-icons e-more-horizontal-1';
991
1257
  /** @hidden */
992
1258
  var VERTICAL_DDB = 'e-vertical';
@@ -1035,6 +1301,14 @@ var RIBBON_MINIMIZE = 'e-ribbon-minimize';
1035
1301
  /** @hidden */
1036
1302
  var RIBBON_GROUP = 'e-ribbon-group';
1037
1303
  /** @hidden */
1304
+ var RIBBON_SINGLE_BUTTON_SELECTION = 'e-ribbon-single-selection';
1305
+ /** @hidden */
1306
+ var RIBBON_MULTIPLE_BUTTON_SELECTION = 'e-ribbon-multiple-selection';
1307
+ /** @hidden */
1308
+ var RIBBON_GROUP_BUTTON = 'e-ribbon-group-button';
1309
+ /** @hidden */
1310
+ var RIBBON_GROUP_BUTTON_OVERFLOW_POPUP = 'e-ribbon-group-button-overflow-popup';
1311
+ /** @hidden */
1038
1312
  var RIBBON_GROUP_CONTAINER = 'e-ribbon-group-container';
1039
1313
  /** @hidden */
1040
1314
  var RIBBON_OF_TAB_CONTAINER = 'e-ribbon-of-tab';
@@ -1097,6 +1371,26 @@ var RIBBON_TEXT_CONTAINER = 'e-ribbon-text-container';
1097
1371
  /** @hidden */
1098
1372
  var RIBBON_SIMPLIFIED_MODE = 'e-ribbon-simplified-mode';
1099
1373
  /** @hidden */
1374
+ var RIBBON_BACKSTAGE_POPUP = 'e-ribbon-backstage-popup';
1375
+ /** @hidden */
1376
+ var RIBBON_BACKSTAGE_OPEN = 'e-ribbon-backstage-open';
1377
+ /** @hidden */
1378
+ var RIBBON_BACKSTAGE_CONTENT = 'e-ribbon-backstage-content';
1379
+ /** @hidden */
1380
+ var RIBBON_SELECTED_CONTENT = 'e-ribbon-selected-content';
1381
+ /** @hidden */
1382
+ var RIBBON_BACKSTAGE = 'e-ribbon-backstage';
1383
+ /** @hidden */
1384
+ var RIBBON_BACKSTAGE_MENU = 'e-ribbon-backstage-menu';
1385
+ /** @hidden */
1386
+ var RIBBON_BACKSTAGE_TEMPLATE = 'e-ribbon-backstage-template';
1387
+ /** @hidden */
1388
+ var RIBBON_BACKSTAGE_MENU_WRAPPER = 'e-ribbon-backstage-wrapper';
1389
+ /** @hidden */
1390
+ var RIBBON_BACKSTAGE_ITEMS_WRAPPER = 'e-ribbon-backstage-items-wrapper';
1391
+ /** @hidden */
1392
+ var RIBBON_BACKSTAGE_TEXT_MENU = 'e-blankicon';
1393
+ /** @hidden */
1100
1394
  var TAB_ID = '_tab';
1101
1395
  /** @hidden */
1102
1396
  var GROUP_ID = '_group';
@@ -1125,10 +1419,20 @@ var DROPDOWN_ID = '_dropdown';
1125
1419
  /** @hidden */
1126
1420
  var RIBBON_FILE_MENU_ID = '_filemenu';
1127
1421
  /** @hidden */
1422
+ var RIBBON_BACKSTAGE_MENU_ID = '_backstage';
1423
+ /** @hidden */
1424
+ var RIBBON_BACKSTAGE_POPUP_ID = '_backstagepopup';
1425
+ /** @hidden */
1128
1426
  var RIBBON_FILE_MENU_LIST = '_filemenulist';
1129
1427
  /** @hidden */
1428
+ var RIBBON_MENU_LIST = '_menulist';
1429
+ /** @hidden */
1430
+ var RIBBON_FOOTER_MENU_LIST = '_footermenulist';
1431
+ /** @hidden */
1130
1432
  var RIBBON_HELP_PANE_TEMPLATE_ID = '_helppanetemplate';
1131
1433
  /** @hidden */
1434
+ var RIBBON_GROUP_BUTTON_ID = '_grpbtn';
1435
+ /** @hidden */
1132
1436
  var RIBBON_FILE_MENU_WIDTH = '--fileMenuWidth';
1133
1437
  /** @hidden */
1134
1438
  var RIBBON_HELP_PANE_TEMPLATE_WIDTH = '--helpTemplateWidth';
@@ -1256,6 +1560,9 @@ var RibbonButton = /** @__PURE__ @class */ (function () {
1256
1560
  return;
1257
1561
  }
1258
1562
  var buttonObj = getComponent(buttonEle, Button);
1563
+ if (prop.isToggle) {
1564
+ buttonEle.classList.add('e-active');
1565
+ }
1259
1566
  if (prop.cssClass) {
1260
1567
  prop.cssClass = (ITEM_VERTICAL_CENTER + SPACE + RIBBON_CONTROL + SPACE + prop.cssClass).trim();
1261
1568
  }
@@ -1536,7 +1843,7 @@ var RibbonColorPicker = /** @__PURE__ @class */ (function () {
1536
1843
  var splitBtn = colorPickerObj['splitBtn'];
1537
1844
  //Accessing the private property 'splitBtn' of ColorPicker component to get the colorpicker instance as there is no close event in colorpicker.
1538
1845
  splitBtn.close = null;
1539
- colorPickerObj.beforeClose = function (e) {
1846
+ colorPickerObj.beforeClose = function () {
1540
1847
  colorPickerObj.element.parentElement.classList.remove(RIBBON_POPUP_OPEN);
1541
1848
  if (item.colorPickerSettings.beforeClose) {
1542
1849
  item.colorPickerSettings.beforeClose.call(_this);
@@ -1838,6 +2145,7 @@ var RibbonDropDown = /** @__PURE__ @class */ (function () {
1838
2145
  iconCss: dropDownSettings.iconCss,
1839
2146
  items: dropDownSettings.items,
1840
2147
  target: dropDownSettings.target,
2148
+ createPopupOnClick: dropDownSettings.createPopupOnClick,
1841
2149
  beforeClose: function (e) {
1842
2150
  if (dropDownSettings.beforeClose) {
1843
2151
  dropDownSettings.beforeClose.call(_this, e);
@@ -1853,7 +2161,7 @@ var RibbonDropDown = /** @__PURE__ @class */ (function () {
1853
2161
  created: dropDownSettings.created,
1854
2162
  open: dropDownSettings.open,
1855
2163
  select: dropDownSettings.select
1856
- }, buttonEle);
2164
+ }).appendTo(buttonEle);
1857
2165
  };
1858
2166
  /**
1859
2167
  * Adds the additional event handlers as the item moved into overflow popup.
@@ -2798,68 +3106,505 @@ function updateTooltipProp(element, prop) {
2798
3106
  control.setProperties(prop);
2799
3107
  }
2800
3108
 
2801
- var __extends = (undefined && undefined.__extends) || (function () {
2802
- var extendStatics = function (d, b) {
2803
- extendStatics = Object.setPrototypeOf ||
2804
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2805
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
2806
- return extendStatics(d, b);
2807
- };
2808
- return function (d, b) {
2809
- extendStatics(d, b);
2810
- function __() { this.constructor = d; }
2811
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2812
- };
2813
- })();
2814
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2815
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2816
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2817
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2818
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2819
- };
2820
3109
  /**
2821
- * The Ribbon Component is a structured layout to manage tools with tabs and groups.
3110
+ * Defines the items of Ribbon.
2822
3111
  */
2823
- var Ribbon = /** @__PURE__ @class */ (function (_super) {
2824
- __extends(Ribbon, _super);
2825
- /**
2826
- * Constructor for creating the widget.
2827
- *
2828
- * @param {RibbonModel} options - Specifies the ribbon model
2829
- * @param {string|HTMLDivElement} element - Specifies the target element
2830
- */
2831
- function Ribbon(options, element) {
2832
- var _this = this;
2833
- Ribbon_1.Inject(RibbonButton, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonComboBox);
2834
- _this = _super.call(this, options, element) || this;
2835
- return _this;
3112
+ var RibbonGroupButton = /** @__PURE__ @class */ (function () {
3113
+ function RibbonGroupButton(parent) {
3114
+ this.parent = parent;
3115
+ this.isSelected = false;
2836
3116
  }
2837
- Ribbon_1 = Ribbon;
2838
- /**
2839
- * Initialize the control rendering.
2840
- *
2841
- * @returns {void}
2842
- * @private
2843
- */
2844
- Ribbon.prototype.render = function () {
2845
- this.initialize();
3117
+ RibbonGroupButton.prototype.getModuleName = function () {
3118
+ return 'ribbonGroupButton';
2846
3119
  };
2847
- Ribbon.prototype.preRender = function () {
2848
- this.idIndex = 0;
2849
- this.tooltipData = [];
2850
- this.isAddRemove = false;
2851
- this.keyConfigs = {
2852
- leftarrow: 'leftarrow',
2853
- rightarrow: 'rightarrow',
2854
- tab: 'tab',
2855
- shiftTab: 'shift+tab'
2856
- };
3120
+ RibbonGroupButton.prototype.destroy = function () {
3121
+ this.parent = null;
2857
3122
  };
2858
3123
  /**
2859
- * Get the properties to be maintained in the persisted state.
3124
+ * Creates Group Button
2860
3125
  *
2861
- * @returns {string} - Persist data
2862
- */
3126
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3127
+ * @param {HTMLElement} itemElement - Gets the ribbon item element.
3128
+ * @returns {void}
3129
+ * @hidden
3130
+ */
3131
+ RibbonGroupButton.prototype.createGroupButton = function (item, itemElement) {
3132
+ var _this = this;
3133
+ var groupBtnSettings = item.groupButtonSettings;
3134
+ this.count = 0;
3135
+ var btnContainerEle = this.parent.createElement('div', {
3136
+ id: item.id + RIBBON_GROUP_BUTTON_ID,
3137
+ className: 'e-btn-group'
3138
+ });
3139
+ itemElement.appendChild(btnContainerEle);
3140
+ for (var i = 0; i < groupBtnSettings.items.length; i++) {
3141
+ if ((groupBtnSettings.items[parseInt(i.toString(), 10)].iconCss)) {
3142
+ var groupButtonEle = this.parent.createElement('button', {
3143
+ id: item.id + RIBBON_GROUP_BUTTON_ID + i,
3144
+ className: RIBBON_GROUP_BUTTON
3145
+ });
3146
+ btnContainerEle.appendChild(groupButtonEle);
3147
+ new Button({
3148
+ iconCss: groupBtnSettings.items[parseInt(i.toString(), 10)].iconCss,
3149
+ disabled: item.disabled,
3150
+ enableRtl: this.parent.enableRtl,
3151
+ content: item.activeSize === RibbonItemSize.Small ? '' : groupBtnSettings.items[parseInt(i.toString(), 10)].content,
3152
+ iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left'
3153
+ }, groupButtonEle);
3154
+ var buttonEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
3155
+ if (groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
3156
+ btnContainerEle.classList.add(RIBBON_SINGLE_BUTTON_SELECTION);
3157
+ }
3158
+ else {
3159
+ btnContainerEle.classList.add(RIBBON_MULTIPLE_BUTTON_SELECTION);
3160
+ }
3161
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].selected) {
3162
+ if (groupBtnSettings.selection === RibbonGroupButtonSelection.Multiple) {
3163
+ buttonEle.classList.add('e-active');
3164
+ }
3165
+ else {
3166
+ if (this.count < 1) {
3167
+ buttonEle.classList.add('e-active');
3168
+ this.count++;
3169
+ }
3170
+ }
3171
+ }
3172
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings &&
3173
+ isTooltipPresent(groupBtnSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings)) {
3174
+ groupButtonEle.classList.add(RIBBON_TOOLTIP_TARGET);
3175
+ this.parent.tooltipData.push({
3176
+ id: groupButtonEle.id, data: groupBtnSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings
3177
+ });
3178
+ }
3179
+ EventHandler.add(buttonEle, 'click', this.groupButtonClicked.bind(this, i, item, groupBtnSettings), this);
3180
+ }
3181
+ }
3182
+ if (this.parent.activeLayout === 'Simplified') {
3183
+ var dropdownIcon = void 0;
3184
+ var activeEleCount = 0;
3185
+ var count = 0;
3186
+ var buttonEle = this.parent.createElement('button', {
3187
+ id: item.id
3188
+ });
3189
+ itemElement.appendChild(buttonEle);
3190
+ for (var i = 0; i < groupBtnSettings.items.length; i++) {
3191
+ if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].selected &&
3192
+ !this.isSelected && groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
3193
+ dropdownIcon = item.groupButtonSettings.items[parseInt(i.toString(), 10)].iconCss;
3194
+ this.isSelected = true;
3195
+ }
3196
+ else if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].selected &&
3197
+ groupBtnSettings.selection === RibbonGroupButtonSelection.Multiple) {
3198
+ activeEleCount++;
3199
+ if (activeEleCount === 1) {
3200
+ dropdownIcon = item.groupButtonSettings.items[parseInt(i.toString(), 10)].iconCss;
3201
+ }
3202
+ else {
3203
+ dropdownIcon = null;
3204
+ }
3205
+ }
3206
+ }
3207
+ while (count < item.groupButtonSettings.items.length && !this.isSelected && !dropdownIcon) {
3208
+ if (item.groupButtonSettings.items[parseInt(count.toString(), 10)].iconCss) {
3209
+ dropdownIcon = item.groupButtonSettings.items[parseInt(count.toString(), 10)].iconCss;
3210
+ this.isSelected = true;
3211
+ }
3212
+ count++;
3213
+ }
3214
+ new DropDownButton({
3215
+ iconCss: dropdownIcon,
3216
+ target: btnContainerEle,
3217
+ enableRtl: this.parent.enableRtl,
3218
+ cssClass: 'e-ribbon-dropdown-group-button',
3219
+ disabled: item.disabled
3220
+ }, buttonEle);
3221
+ buttonEle.onclick = buttonEle.onkeydown = function () {
3222
+ if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
3223
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
3224
+ _this.grpBtnIndex = 0;
3225
+ }
3226
+ };
3227
+ btnContainerEle.onkeydown = function (e) {
3228
+ if (_this.parent.activeLayout === 'Simplified') {
3229
+ _this.handleGroupButtonNavigation(e, item);
3230
+ }
3231
+ };
3232
+ createTooltip(btnContainerEle, this.parent);
3233
+ this.isSelected = false;
3234
+ }
3235
+ };
3236
+ RibbonGroupButton.prototype.groupButtonClicked = function (itemIndex, item, grpBtnSettings) {
3237
+ var previousItems = [], selectingItems = [], selectedItems = [];
3238
+ var groupButtonEle;
3239
+ var dropdown;
3240
+ for (var j = 0; j < grpBtnSettings.items.length; j++) {
3241
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j)) {
3242
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.contains('e-active')) {
3243
+ previousItems.push(grpBtnSettings.items[parseInt(j.toString(), 10)]);
3244
+ }
3245
+ }
3246
+ }
3247
+ if (!(document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active'))) {
3248
+ selectingItems.push(grpBtnSettings.items[parseInt(itemIndex.toString(), 10)]);
3249
+ }
3250
+ var eventArgs = {
3251
+ cancel: false, previousItems: previousItems, selectingItems: selectingItems
3252
+ };
3253
+ if (grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].beforeClick) {
3254
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].beforeClick.call(this, eventArgs);
3255
+ }
3256
+ if (eventArgs.cancel) {
3257
+ return;
3258
+ }
3259
+ else {
3260
+ if (grpBtnSettings.selection === RibbonGroupButtonSelection.Single) {
3261
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.contains(RIBBON_MULTIPLE_BUTTON_SELECTION)) {
3262
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.remove(RIBBON_MULTIPLE_BUTTON_SELECTION);
3263
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.add(RIBBON_SINGLE_BUTTON_SELECTION);
3264
+ }
3265
+ for (var j = 0; j < grpBtnSettings.items.length; j++) {
3266
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.contains('e-active')) {
3267
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.remove('e-active');
3268
+ }
3269
+ }
3270
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
3271
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active') && this.parent.activeLayout === 'Simplified') {
3272
+ this.grpBtnIndex = itemIndex;
3273
+ groupButtonEle = document.querySelector('#' + item.id);
3274
+ dropdown = getComponent(groupButtonEle, DropDownButton);
3275
+ dropdown.setProperties({
3276
+ iconCss: grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].iconCss
3277
+ });
3278
+ }
3279
+ }
3280
+ else {
3281
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.contains(RIBBON_SINGLE_BUTTON_SELECTION)) {
3282
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.remove(RIBBON_SINGLE_BUTTON_SELECTION);
3283
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.add(RIBBON_MULTIPLE_BUTTON_SELECTION);
3284
+ }
3285
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
3286
+ var activeEleCount = 0;
3287
+ for (var n = 0; n < grpBtnSettings.items.length; n++) {
3288
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n).classList.contains('e-active') && this.parent.activeLayout === 'Simplified' && n !== itemIndex) {
3289
+ this.isSelected = true;
3290
+ activeEleCount++;
3291
+ }
3292
+ }
3293
+ if (this.parent.activeLayout === 'Simplified') {
3294
+ var dropdownIcon = null;
3295
+ var itemsCount = 0;
3296
+ groupButtonEle = document.querySelector('#' + item.id);
3297
+ dropdown = getComponent(groupButtonEle, DropDownButton);
3298
+ if (!this.isSelected) {
3299
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active')) {
3300
+ dropdownIcon = grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].iconCss;
3301
+ }
3302
+ }
3303
+ else {
3304
+ if (activeEleCount === 1 && !(document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active'))) {
3305
+ for (var n = 0; n < grpBtnSettings.items.length; n++) {
3306
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n).classList.contains('e-active')) {
3307
+ dropdownIcon = grpBtnSettings.items[parseInt(n.toString(), 10)].iconCss;
3308
+ }
3309
+ }
3310
+ }
3311
+ }
3312
+ while (itemsCount < grpBtnSettings.items.length && !dropdownIcon) {
3313
+ if (grpBtnSettings.items[parseInt(itemsCount.toString(), 10)].iconCss) {
3314
+ dropdownIcon = grpBtnSettings.items[parseInt(itemsCount.toString(), 10)].iconCss;
3315
+ }
3316
+ itemsCount++;
3317
+ }
3318
+ dropdown.setProperties({ iconCss: dropdownIcon });
3319
+ this.grpBtnIndex = itemIndex;
3320
+ }
3321
+ this.isSelected = false;
3322
+ }
3323
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active')) {
3324
+ selectedItems.push(grpBtnSettings.items[parseInt(itemIndex.toString(), 10)]);
3325
+ }
3326
+ var eventArgs_1 = { previousItems: previousItems, selectedItems: selectedItems };
3327
+ if (grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].click) {
3328
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].click.call(this, eventArgs_1);
3329
+ }
3330
+ }
3331
+ };
3332
+ /**
3333
+ * updates group button in mode switching
3334
+ *
3335
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3336
+ * @param {HTMLElement} itemElement - Gets the ribbon item element.
3337
+ * @returns {void}
3338
+ * @hidden
3339
+ */
3340
+ RibbonGroupButton.prototype.switchGroupButton = function (item, itemElement) {
3341
+ var _this = this;
3342
+ var groupBtnSettings = item.groupButtonSettings;
3343
+ var dropdownIcon = null;
3344
+ var activeEleCount = 0;
3345
+ var itemsCount = 0;
3346
+ if (this.parent.activeLayout === 'Simplified') {
3347
+ var containerEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
3348
+ var buttonEle = this.parent.createElement('button', {
3349
+ id: item.id
3350
+ });
3351
+ itemElement.appendChild(buttonEle);
3352
+ for (var i = 0; i < groupBtnSettings.items.length; i++) {
3353
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i)) {
3354
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i).classList.contains('e-active') && groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
3355
+ dropdownIcon = groupBtnSettings.items[parseInt(i.toString(), 10)].iconCss;
3356
+ }
3357
+ else if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i).classList.contains('e-active') && groupBtnSettings.selection === RibbonGroupButtonSelection.Multiple) {
3358
+ activeEleCount++;
3359
+ if (activeEleCount === 1) {
3360
+ dropdownIcon = groupBtnSettings.items[parseInt(i.toString(), 10)].iconCss;
3361
+ }
3362
+ else if (activeEleCount > 1) {
3363
+ dropdownIcon = null;
3364
+ }
3365
+ }
3366
+ }
3367
+ }
3368
+ while (itemsCount < groupBtnSettings.items.length && !dropdownIcon) {
3369
+ if (groupBtnSettings.items[parseInt(itemsCount.toString(), 10)].iconCss) {
3370
+ dropdownIcon = groupBtnSettings.items[parseInt(itemsCount.toString(), 10)].iconCss;
3371
+ }
3372
+ itemsCount++;
3373
+ }
3374
+ new DropDownButton({
3375
+ iconCss: dropdownIcon,
3376
+ target: containerEle,
3377
+ enableRtl: this.parent.enableRtl,
3378
+ cssClass: 'e-ribbon-dropdown-group-button',
3379
+ disabled: item.disabled
3380
+ }, buttonEle);
3381
+ buttonEle.onclick = buttonEle.onkeydown = function () {
3382
+ if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
3383
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
3384
+ _this.grpBtnIndex = 0;
3385
+ }
3386
+ };
3387
+ containerEle.onkeydown = function (e) {
3388
+ if (_this.parent.activeLayout === 'Simplified') {
3389
+ _this.handleGroupButtonNavigation(e, item);
3390
+ }
3391
+ };
3392
+ createTooltip(containerEle, this.parent);
3393
+ }
3394
+ else {
3395
+ var groupButtonEle = itemElement.querySelector('#' + item.id);
3396
+ var dropdown = getComponent(groupButtonEle, DropDownButton);
3397
+ itemElement.appendChild(dropdown.target);
3398
+ if (groupButtonEle) {
3399
+ dropdown.destroy();
3400
+ remove(groupButtonEle);
3401
+ }
3402
+ }
3403
+ };
3404
+ RibbonGroupButton.prototype.handleGroupButtonNavigation = function (e, item) {
3405
+ var groupButtonEle = document.querySelector('#' + item.id);
3406
+ var dropdown = getComponent(groupButtonEle, DropDownButton);
3407
+ var targetEle = dropdown.target;
3408
+ var isOverflowPopup = false;
3409
+ if (this.parent.activeLayout === 'Simplified' && targetEle.closest('.e-ribbon-dropdown-group-button').classList.contains(RIBBON_GROUP_BUTTON_OVERFLOW_POPUP)) {
3410
+ isOverflowPopup = true;
3411
+ }
3412
+ if (e.key === 'Tab') {
3413
+ e.preventDefault();
3414
+ }
3415
+ var groupBtnSettings = item.groupButtonSettings;
3416
+ if ((e.key === 'ArrowRight' && !isOverflowPopup) || (e.key === 'ArrowDown' && isOverflowPopup)) {
3417
+ if (!this.parent.enableRtl || (e.key === 'ArrowDown' && isOverflowPopup)) {
3418
+ this.grpBtnIndex++;
3419
+ if (this.grpBtnIndex < groupBtnSettings.items.length) {
3420
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3421
+ }
3422
+ else {
3423
+ this.grpBtnIndex = 0;
3424
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3425
+ }
3426
+ }
3427
+ else {
3428
+ if (this.grpBtnIndex === 0) {
3429
+ this.grpBtnIndex = groupBtnSettings.items.length - 1;
3430
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3431
+ }
3432
+ else {
3433
+ this.grpBtnIndex--;
3434
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3435
+ }
3436
+ }
3437
+ }
3438
+ else if ((e.key === 'ArrowLeft' && !isOverflowPopup) || (e.key === 'ArrowUp' && isOverflowPopup)) {
3439
+ if (!this.parent.enableRtl || (e.key === 'ArrowUp' && isOverflowPopup)) {
3440
+ if (this.grpBtnIndex === 0) {
3441
+ this.grpBtnIndex = groupBtnSettings.items.length - 1;
3442
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3443
+ }
3444
+ else {
3445
+ this.grpBtnIndex--;
3446
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3447
+ }
3448
+ }
3449
+ else {
3450
+ this.grpBtnIndex++;
3451
+ if (this.grpBtnIndex < groupBtnSettings.items.length) {
3452
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3453
+ }
3454
+ else {
3455
+ this.grpBtnIndex = 0;
3456
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3457
+ }
3458
+ }
3459
+ }
3460
+ };
3461
+ /**
3462
+ * Adds the additional event handlers as the item moved into overflow popup.
3463
+ *
3464
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3465
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
3466
+ * @returns {void}
3467
+ * @hidden
3468
+ */
3469
+ RibbonGroupButton.prototype.addOverFlowEvents = function (item, itemEle) {
3470
+ var _this = this;
3471
+ var groupButtonEle = itemEle.querySelector('#' + item.id);
3472
+ var dropdown = getComponent(groupButtonEle, DropDownButton);
3473
+ dropdown.setProperties({ cssClass: dropdown.cssClass + SPACE + RIBBON_GROUP_BUTTON_OVERFLOW_POPUP });
3474
+ var targetEle = dropdown.target;
3475
+ targetEle.onclick = function () {
3476
+ if (_this.parent.activeLayout === 'Simplified' && targetEle.closest('.e-ribbon-dropdown-group-button').classList.contains(RIBBON_GROUP_BUTTON_OVERFLOW_POPUP)) {
3477
+ dropdown.element.focus();
3478
+ dropdown.toggle();
3479
+ }
3480
+ };
3481
+ };
3482
+ /**
3483
+ * Removes the additional event handlers as the item moved into overflow popup.
3484
+ *
3485
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3486
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
3487
+ * @returns {void}
3488
+ * @hidden
3489
+ */
3490
+ RibbonGroupButton.prototype.removeOverFlowEvents = function (item, itemEle) {
3491
+ var groupButtonEle = itemEle.querySelector('#' + item.id);
3492
+ if (groupButtonEle) {
3493
+ var dropdown = getComponent(groupButtonEle, DropDownButton);
3494
+ var cssClass = dropdown.cssClass.split(SPACE);
3495
+ cssClass = cssClass.filter(function (value) { return value !== RIBBON_GROUP_BUTTON_OVERFLOW_POPUP; });
3496
+ dropdown.setProperties({ cssClass: cssClass.join(SPACE) });
3497
+ }
3498
+ };
3499
+ /**
3500
+ * Removes DropDown.
3501
+ *
3502
+ * @param {RibbonItemModel} item - Gets the ribbon item.
3503
+ * @returns {void}
3504
+ * @hidden
3505
+ */
3506
+ RibbonGroupButton.prototype.destroyDropDown = function (item) {
3507
+ var groupButtonEle = document.querySelector('#' + item.id);
3508
+ if (groupButtonEle) {
3509
+ var dropdown = getComponent(groupButtonEle, DropDownButton);
3510
+ var tooltip = getComponent(dropdown.target, Tooltip);
3511
+ tooltip.destroy();
3512
+ dropdown.destroy();
3513
+ remove(groupButtonEle);
3514
+ }
3515
+ };
3516
+ /**
3517
+ * Updates the group button size.
3518
+ *
3519
+ * @param {HTMLElement} itemElement - Gets the group button container element.
3520
+ * @param {RibbonItemModel} item - Gets the ribbon item.
3521
+ * @returns {void}
3522
+ * @hidden
3523
+ */
3524
+ RibbonGroupButton.prototype.updateGroupButtonSize = function (itemElement, item) {
3525
+ var groupBtnSettings = item.groupButtonSettings;
3526
+ var buttonEle;
3527
+ for (var i = 0; i < groupBtnSettings.items.length; i++) {
3528
+ if (this.parent.activeLayout === 'Classic') {
3529
+ buttonEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
3530
+ }
3531
+ else {
3532
+ buttonEle = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
3533
+ }
3534
+ if (buttonEle) {
3535
+ var buttonObj = getComponent(buttonEle, Button);
3536
+ buttonObj.setProperties({
3537
+ iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left',
3538
+ content: item.activeSize === RibbonItemSize.Small ? '' : groupBtnSettings.items[parseInt(i.toString(), 10)].content
3539
+ });
3540
+ }
3541
+ }
3542
+ };
3543
+ return RibbonGroupButton;
3544
+ }());
3545
+
3546
+ var __extends = (undefined && undefined.__extends) || (function () {
3547
+ var extendStatics = function (d, b) {
3548
+ extendStatics = Object.setPrototypeOf ||
3549
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
3550
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
3551
+ return extendStatics(d, b);
3552
+ };
3553
+ return function (d, b) {
3554
+ extendStatics(d, b);
3555
+ function __() { this.constructor = d; }
3556
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3557
+ };
3558
+ })();
3559
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3560
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3561
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3562
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3563
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3564
+ };
3565
+ /**
3566
+ * The Ribbon Component is a structured layout to manage tools with tabs and groups.
3567
+ */
3568
+ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3569
+ __extends(Ribbon, _super);
3570
+ /**
3571
+ * Constructor for creating the widget.
3572
+ *
3573
+ * @param {RibbonModel} options - Specifies the ribbon model
3574
+ * @param {string|HTMLDivElement} element - Specifies the target element
3575
+ */
3576
+ function Ribbon(options, element) {
3577
+ var _this = this;
3578
+ Ribbon_1.Inject(RibbonButton, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonComboBox, RibbonGroupButton);
3579
+ _this = _super.call(this, options, element) || this;
3580
+ return _this;
3581
+ }
3582
+ Ribbon_1 = Ribbon;
3583
+ /**
3584
+ * Initialize the control rendering.
3585
+ *
3586
+ * @returns {void}
3587
+ * @private
3588
+ */
3589
+ Ribbon.prototype.render = function () {
3590
+ this.initialize();
3591
+ };
3592
+ Ribbon.prototype.preRender = function () {
3593
+ this.idIndex = 0;
3594
+ this.tooltipData = [];
3595
+ this.isAddRemove = false;
3596
+ this.keyConfigs = {
3597
+ leftarrow: 'leftarrow',
3598
+ rightarrow: 'rightarrow',
3599
+ tab: 'tab',
3600
+ shiftTab: 'shift+tab'
3601
+ };
3602
+ };
3603
+ /**
3604
+ * Get the properties to be maintained in the persisted state.
3605
+ *
3606
+ * @returns {string} - Persist data
3607
+ */
2863
3608
  Ribbon.prototype.getPersistData = function () {
2864
3609
  return this.addOnPersist(['activeLayout']);
2865
3610
  };
@@ -2880,7 +3625,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
2880
3625
  */
2881
3626
  Ribbon.prototype.requiredModules = function () {
2882
3627
  var modules = [];
2883
- 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] });
3628
+ 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] });
2884
3629
  return modules;
2885
3630
  };
2886
3631
  Ribbon.prototype.initialize = function () {
@@ -2894,6 +3639,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
2894
3639
  if (this.ribbonFileMenuModule) {
2895
3640
  this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
2896
3641
  }
3642
+ if (this.ribbonBackstageModule) {
3643
+ this.ribbonBackstageModule.createBackStage(this.backStageMenu);
3644
+ }
2897
3645
  this.createHelpPaneTemplate();
2898
3646
  var toolbar = this.tabObj['tbObj'];
2899
3647
  toolbar.refreshOverflow();
@@ -3190,7 +3938,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3190
3938
  this.switchLayout();
3191
3939
  };
3192
3940
  Ribbon.prototype.tabCreated = function () {
3193
- this.addExpandCollapse();
3941
+ if (!this.hideLayoutSwitcher) {
3942
+ this.addExpandCollapse();
3943
+ }
3194
3944
  this.renderInitialTab(this.selectedTab);
3195
3945
  };
3196
3946
  Ribbon.prototype.ribbonTabSelected = function (e) {
@@ -3333,13 +4083,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3333
4083
  if (((item.displayOptions === DisplayMode.Auto) ||
3334
4084
  (item.displayOptions === (DisplayMode.Simplified | DisplayMode.Overflow))) && !isNullOrUndefined(itemContainer)) {
3335
4085
  itemContainer.setAttribute('data-simplified-width', activeContent.offsetWidth.toString());
3336
- this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemContainer, groupContainer);
4086
+ this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemContainer, groupContainer, true);
3337
4087
  if (item.activeSize === RibbonItemSize.Small) {
3338
4088
  var itemEle = itemContainer.querySelector('#' + item.id);
3339
4089
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
3340
4090
  this.setItemSize(itemEle, item);
3341
4091
  }
3342
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
4092
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
3343
4093
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, true);
3344
4094
  }
3345
4095
  }
@@ -3351,7 +4101,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3351
4101
  }
3352
4102
  };
3353
4103
  Ribbon.prototype.updatePopupItems = function (item, itemEle, isGroupOF, isMenu) {
3354
- var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown) ? DropDownButton : SplitButton);
4104
+ var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
3355
4105
  var dropDownPopup = dropdown.dropDown;
3356
4106
  // popup is on right if (isGroupOF && isMenu)
3357
4107
  // The position is reversed if RTL is enabled.
@@ -3410,7 +4160,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3410
4160
  break;
3411
4161
  }
3412
4162
  var groupEle_1 = tabContent.querySelector('#' + collection.id);
3413
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
4163
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
3414
4164
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
3415
4165
  }
3416
4166
  groupEle_1.append(itemContainer);
@@ -3454,8 +4204,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3454
4204
  }
3455
4205
  }
3456
4206
  };
3457
- Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer) {
4207
+ Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
3458
4208
  var overflowButton;
4209
+ var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
4210
+ var isDisabledGroup = contentEle.querySelector('#' + groupId);
3459
4211
  if (isGroupOF) {
3460
4212
  var overflowDDB = groupContainer.querySelector('#' + groupId + GROUPOF_BUTTON_ID);
3461
4213
  if (!overflowDDB) {
@@ -3466,7 +4218,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3466
4218
  else {
3467
4219
  overflowButton = getInstance(overflowDDB, DropDownButton);
3468
4220
  }
3469
- overflowButton.target.append(itemEle);
4221
+ var overflowBtnTarget = overflowButton.target;
4222
+ if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
4223
+ overflowBtnTarget.classList.add('e-disabled');
4224
+ }
4225
+ isResize ? overflowBtnTarget.insertBefore(itemEle, overflowBtnTarget.querySelector('.' + RIBBON_ITEM))
4226
+ : overflowBtnTarget.append(itemEle);
3470
4227
  }
3471
4228
  else {
3472
4229
  if (!this.overflowDDB) {
@@ -3483,9 +4240,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3483
4240
  var ofGroupContainer = overflowEle.querySelector('#' + groupId + CONTAINER_ID);
3484
4241
  if (!ofGroupContainer) {
3485
4242
  ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
4243
+ if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
4244
+ ofGroupContainer.classList.add('e-disabled');
4245
+ }
3486
4246
  ofTabContainer.append(ofGroupContainer);
3487
4247
  }
3488
- ofGroupContainer.append(itemEle);
4248
+ isResize ? ofGroupContainer.insertBefore(itemEle, ofGroupContainer.querySelector('.' + RIBBON_ITEM)) : ofGroupContainer.append(itemEle);
3489
4249
  }
3490
4250
  else {
3491
4251
  this.createOfTabContainer(groupId, groupHeader, itemEle, tabIndex);
@@ -3517,6 +4277,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3517
4277
  case 'ComboBox':
3518
4278
  this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
3519
4279
  break;
4280
+ case 'GroupButton':
4281
+ if (this.activeLayout === 'Simplified') {
4282
+ this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle);
4283
+ break;
4284
+ }
3520
4285
  }
3521
4286
  };
3522
4287
  Ribbon.prototype.createOfTabContainer = function (groupId, groupHeader, itemEle, tabIndex) {
@@ -3627,7 +4392,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3627
4392
  var ele = activeContent.querySelector('#' + item.id + CONTAINER_ID);
3628
4393
  shrinkEle.appendChild(ele);
3629
4394
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
3630
- _this.setItemSize(ele.querySelector('#' + item.id), item);
4395
+ if (item.type === RibbonItemType.GroupButton && _this.activeLayout === 'Classic') {
4396
+ _this.setItemSize(ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID), item);
4397
+ }
4398
+ else {
4399
+ _this.setItemSize(ele.querySelector('#' + item.id), item);
4400
+ }
3631
4401
  }
3632
4402
  };
3633
4403
  var moveCollectionToColumn = function (start, end) {
@@ -3641,7 +4411,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3641
4411
  var ele = activeContent.querySelector('#' + collection.id);
3642
4412
  shrinkEle.appendChild(ele);
3643
4413
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Medium }, true);
3644
- _this.setItemSize(ele.querySelector('#' + collection.items[0].id), collection.items[0]);
4414
+ if (collection.items[0].type === RibbonItemType.GroupButton && _this.activeLayout === 'Classic') {
4415
+ _this.setItemSize(ele.querySelector('#' + collection.items[0].id + RIBBON_GROUP_BUTTON_ID), collection.items[0]);
4416
+ }
4417
+ else {
4418
+ _this.setItemSize(ele.querySelector('#' + collection.items[0].id), collection.items[0]);
4419
+ }
3645
4420
  }
3646
4421
  };
3647
4422
  var orientation = group.orientation;
@@ -3736,6 +4511,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3736
4511
  if (item.displayOptions & DisplayMode.Classic) {
3737
4512
  var ele_1 = activeContent.querySelector('#' + item.id);
3738
4513
  item.setProperties({ activeSize: RibbonItemSize.Small }, true);
4514
+ if (item.type === RibbonItemType.GroupButton) {
4515
+ ele_1 = activeContent.querySelector('#' + item.id + '_grpbtn');
4516
+ }
3739
4517
  _this.setItemSize(ele_1, item);
3740
4518
  }
3741
4519
  };
@@ -3757,6 +4535,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3757
4535
  if (collection.items[0].displayOptions & DisplayMode.Classic) {
3758
4536
  var ele_2 = activeContent.querySelector('#' + collection.items[0].id);
3759
4537
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Small }, true);
4538
+ if (collection.items[0].type === RibbonItemType.GroupButton) {
4539
+ ele_2 = activeContent.querySelector('#' + collection.items[0].id + RIBBON_GROUP_BUTTON_ID);
4540
+ }
3760
4541
  _this.setItemSize(ele_2, collection.items[0]);
3761
4542
  }
3762
4543
  };
@@ -3856,7 +4637,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3856
4637
  }
3857
4638
  var item = collection.items[parseInt(l.toString(), 10)];
3858
4639
  if (canReduceItem(item)) {
3859
- setWidth(item.id);
4640
+ item.type !== RibbonItemType.GroupButton ? setWidth(item.id) : setWidth(item.id + RIBBON_GROUP_BUTTON_ID);
3860
4641
  reduceItemsToSmall(k, l, l);
3861
4642
  if (!shouldSkip && (tabContent.offsetWidth > activeContent.offsetWidth)) {
3862
4643
  return true;
@@ -3894,6 +4675,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3894
4675
  if (item.displayOptions & DisplayMode.Classic) {
3895
4676
  var ele_4 = parentEle.id === item.id ? parentEle : parentEle.querySelector('#' + item.id);
3896
4677
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
4678
+ if (item.type === RibbonItemType.GroupButton) {
4679
+ ele_4 = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
4680
+ }
3897
4681
  _this.setItemSize(ele_4, item);
3898
4682
  }
3899
4683
  };
@@ -3904,6 +4688,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3904
4688
  if (item.displayOptions & DisplayMode.Classic) {
3905
4689
  var ele_5 = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id);
3906
4690
  collections[parseInt(i.toString(), 10)].items[0].setProperties({ activeSize: RibbonItemSize.Medium }, true);
4691
+ if (item.type === RibbonItemType.GroupButton) {
4692
+ ele_5 = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id + RIBBON_GROUP_BUTTON_ID);
4693
+ }
3907
4694
  _this.setItemSize(ele_5, collections[parseInt(i.toString(), 10)].items[0]);
3908
4695
  }
3909
4696
  };
@@ -3920,6 +4707,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3920
4707
  var item = collection.items[parseInt(l.toString(), 10)];
3921
4708
  if (canExpandItem(item)) {
3922
4709
  var itemEle = activeContent.querySelector('#' + item.id);
4710
+ if (item.type === 'GroupButton') {
4711
+ itemEle = activeContent.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
4712
+ }
3923
4713
  var valString = itemEle.getAttribute('data-medium-width');
3924
4714
  var value = valString ? parseInt(valString, 10) : null;
3925
4715
  if (value && (shouldSkip || (tabContent.offsetWidth > value))) {
@@ -4021,8 +4811,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4021
4811
  var container = parentEle.querySelector('#' + item.id + CONTAINER_ID);
4022
4812
  var ele_6 = container.querySelector('#' + item.id);
4023
4813
  item.setProperties({ activeSize: RibbonItemSize.Large }, true);
4814
+ if (item.type === RibbonItemType.GroupButton) {
4815
+ ele_6 = container.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
4816
+ }
4024
4817
  _this.setItemSize(ele_6, item);
4025
- parentEle.insertAdjacentElement('afterend', container);
4818
+ parentEle.insertAdjacentElement('beforebegin', container);
4026
4819
  }
4027
4820
  };
4028
4821
  reduce(start);
@@ -4043,8 +4836,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4043
4836
  var collectionEle = parentEle.querySelector('#' + collection.id);
4044
4837
  var ele_7 = collectionEle.querySelector('#' + collection.items[0].id);
4045
4838
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Large }, true);
4839
+ if (collection.items[0].type === RibbonItemType.GroupButton) {
4840
+ ele_7 = collectionEle.querySelector('#' + collection.items[0].id + RIBBON_GROUP_BUTTON_ID);
4841
+ }
4046
4842
  _this.setItemSize(ele_7, collection.items[0]);
4047
- parentEle.insertAdjacentElement('afterend', collectionEle);
4843
+ parentEle.insertAdjacentElement('beforebegin', collectionEle);
4048
4844
  }
4049
4845
  };
4050
4846
  reduce(start);
@@ -4092,6 +4888,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4092
4888
  }
4093
4889
  return false;
4094
4890
  };
4891
+ Ribbon.prototype.handleContentSize = function (itemEle, isRemoveOverflow) {
4892
+ var itemContainer = itemEle.closest('.' + RIBBON_GROUP_CONTENT);
4893
+ (isRemoveOverflow ? (itemContainer.classList.add(RIBBON_CONTENT_HEIGHT)) : (itemContainer.classList.remove(RIBBON_CONTENT_HEIGHT)));
4894
+ };
4095
4895
  Ribbon.prototype.setItemSize = function (itemEle, item) {
4096
4896
  var itemContainer = itemEle.closest('.' + RIBBON_ITEM);
4097
4897
  if (item.type === RibbonItemType.Button) {
@@ -4107,6 +4907,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4107
4907
  remove(itemEle);
4108
4908
  this.createTemplateContent(item, itemContainer);
4109
4909
  }
4910
+ else if (item.type === RibbonItemType.GroupButton) {
4911
+ this.ribbonGroupButtonModule.updateGroupButtonSize(itemEle, item);
4912
+ }
4110
4913
  itemContainer.classList.remove(RIBBON_CONTENT_HEIGHT, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM);
4111
4914
  if (item.activeSize === RibbonItemSize.Large) {
4112
4915
  itemContainer.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
@@ -4146,6 +4949,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4146
4949
  var item = collection.items[parseInt(k.toString(), 10)];
4147
4950
  var itemEle = collectionEle.querySelector('#' + item.id + CONTAINER_ID);
4148
4951
  if (itemEle !== null) {
4952
+ this_1.handleContentSize(itemEle);
4149
4953
  this_1.addOverflowEvents(item, itemEle, dropdown);
4150
4954
  }
4151
4955
  }
@@ -4188,6 +4992,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4188
4992
  var item = collection.items[parseInt(k.toString(), 10)];
4189
4993
  var itemEle = collectionEle.querySelector('#' + item.id + CONTAINER_ID);
4190
4994
  if (itemEle !== null) {
4995
+ this_2.handleContentSize(itemEle, true);
4191
4996
  this_2.removeOverflowEvent(item, itemEle);
4192
4997
  }
4193
4998
  }
@@ -4462,6 +5267,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4462
5267
  case 'ComboBox':
4463
5268
  this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
4464
5269
  break;
5270
+ case 'GroupButton':
5271
+ this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
5272
+ break;
4465
5273
  }
4466
5274
  };
4467
5275
  Ribbon.prototype.createGroupContainer = function (groupId, groupHeader) {
@@ -4506,24 +5314,83 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4506
5314
  remove(this.tabObj.element.querySelector('.' + RIBBON_COLLAPSE_BUTTON));
4507
5315
  this.collapseButton = null;
4508
5316
  };
4509
- Ribbon.prototype.reRenderTabs = function () {
5317
+ Ribbon.prototype.reRenderTabs = function (tabs) {
4510
5318
  this.destroyScroll();
4511
5319
  this.checkID(this.tabs, 'tab', this.element.id);
4512
- this.destroyTabItems(this.tabsInternal);
4513
- this.tabsInternal = this.tabs.slice();
4514
- this.validateItemSize();
4515
- var tabItems = this.createTabItems(this.tabs);
4516
- if (this.selectedTab >= this.tabs.length) {
4517
- this.selectedTab = this.tabs.length - 1;
4518
- }
4519
- this.tabObj.setProperties({ items: tabItems, selectedItem: this.selectedTab });
4520
- var contentEle = this.tabObj.items[this.selectedTab].content;
4521
- if (contentEle.innerHTML === '') {
4522
- this.renderInitialTab(this.selectedTab);
4523
- }
4524
- };
4525
- Ribbon.prototype.switchLayout = function () {
4526
- this.currentControlIndex = 0;
5320
+ for (var key in tabs) {
5321
+ var index = parseInt(key, 10);
5322
+ var tab = tabs[parseInt(index.toString(), 10)];
5323
+ var isNewTab = false;
5324
+ for (var j = 0; j < (this.tabObj.items.length); j++) {
5325
+ if (this.tabs[parseInt(index.toString(), 10)].id === this.tabObj.items[parseInt(j.toString(), 10)].id) {
5326
+ isNewTab = true;
5327
+ break;
5328
+ }
5329
+ }
5330
+ if (!isNewTab) {
5331
+ this.destroyTabItems(this.tabsInternal);
5332
+ this.tabsInternal = this.tabs.slice();
5333
+ this.validateItemSize();
5334
+ var tabItems = this.createTabItems(this.tabs);
5335
+ if (this.selectedTab >= this.tabs.length) {
5336
+ this.selectedTab = this.tabs.length - 1;
5337
+ }
5338
+ this.tabObj.setProperties({ items: tabItems, selectedItem: this.selectedTab });
5339
+ break;
5340
+ }
5341
+ else {
5342
+ var groups = this.tabs[parseInt(index.toString(), 10)].groups;
5343
+ var tabEle = this.tabObj.element;
5344
+ var ribbonTab = this.tabs[parseInt(index.toString(), 10)];
5345
+ ribbonTab.setProperties(tab, true);
5346
+ this.setProperties({ groups: this.checkID(ribbonTab.groups, 'group', ribbonTab.id) }, true);
5347
+ this.validateItemSize();
5348
+ var contentEle = this.tabObj.items[parseInt(index.toString(), 10)].content;
5349
+ if (groups) {
5350
+ // Check whether header is passed by the user and sets the updated values.
5351
+ if (tab.header) {
5352
+ this.tabObj.items[parseInt(index.toString(), 10)].header.text.innerText = ribbonTab.header;
5353
+ }
5354
+ // Check whether cssClass is passed by the user, and if it is, then remove the old values.
5355
+ if (tab.cssClass) {
5356
+ if (this.tabObj.items[parseInt(index.toString(), 10)].cssClass) {
5357
+ contentEle.classList.remove(this.tabObj.items[parseInt(index.toString(), 10)].cssClass);
5358
+ tabEle.querySelector('.e-active').classList.remove(this.tabObj.items[parseInt(index.toString(), 10)].cssClass);
5359
+ }
5360
+ contentEle.classList.add(ribbonTab.cssClass);
5361
+ tabEle.querySelector('.e-active').classList.add(ribbonTab.cssClass);
5362
+ }
5363
+ // Check whether group is passed by the user, and if it is, then remove the old values.
5364
+ if (tab.groups) {
5365
+ for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {
5366
+ var group = groups_1[_i];
5367
+ var dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
5368
+ for (var _a = 0, _b = group.collections; _a < _b.length; _a++) {
5369
+ var collection = _b[_a];
5370
+ for (var _c = 0, _d = collection.items; _c < _d.length; _c++) {
5371
+ var item = _d[_c];
5372
+ var ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
5373
+ if (ele) {
5374
+ this.destroyFunction(item, ele);
5375
+ }
5376
+ }
5377
+ }
5378
+ if (dropdownElement) {
5379
+ this.ribbonDropDownModule.removeOverFlowDropDown(dropdownElement);
5380
+ }
5381
+ }
5382
+ var groupElements = contentEle.querySelectorAll('.e-ribbon-group');
5383
+ // eslint-disable-next-line @typescript-eslint/tslint/config
5384
+ groupElements.forEach(function (groupEle) { groupEle.remove(); });
5385
+ var elements = this.createGroups(ribbonTab.groups, index);
5386
+ append(elements, contentEle);
5387
+ }
5388
+ }
5389
+ }
5390
+ }
5391
+ };
5392
+ Ribbon.prototype.switchLayout = function () {
5393
+ this.currentControlIndex = 0;
4527
5394
  this.destroyScroll();
4528
5395
  this.collapseButton.classList.toggle(RIBBON_EXPAND_BUTTON, this.activeLayout === 'Simplified');
4529
5396
  this.element.classList.toggle(RIBBON_SIMPLIFIED_MODE, this.activeLayout === 'Simplified');
@@ -4597,10 +5464,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4597
5464
  itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
4598
5465
  if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
4599
5466
  this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemEle, groupContainer);
4600
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
5467
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
4601
5468
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
4602
5469
  }
4603
5470
  }
5471
+ if (item.type === RibbonItemType.GroupButton) {
5472
+ this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
5473
+ }
4604
5474
  item.setProperties({ activeSize: size }, true);
4605
5475
  var ele = itemEle.querySelector('#' + item.id);
4606
5476
  this.setItemSize(ele, item);
@@ -4688,14 +5558,20 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4688
5558
  var itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
4689
5559
  if (!itemEle) {
4690
5560
  itemEle = overflowtarget.querySelector('#' + item.id + CONTAINER_ID);
4691
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
5561
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
4692
5562
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
4693
5563
  }
4694
5564
  this.removeOverflowEvent(item, itemEle);
4695
5565
  }
5566
+ if (item.type === RibbonItemType.GroupButton) {
5567
+ this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
5568
+ }
4696
5569
  groupCollection.append(itemEle);
4697
5570
  }
4698
5571
  var ele = groupContainer.querySelector('#' + item.id);
5572
+ if (item.type === RibbonItemType.GroupButton) {
5573
+ ele = groupContainer.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
5574
+ }
4699
5575
  var itemsize = (item.allowedSizes & RibbonItemSize.Large) ? RibbonItemSize.Large :
4700
5576
  (item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
4701
5577
  item.setProperties({ activeSize: itemsize }, true);
@@ -4862,6 +5738,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4862
5738
  case 'Template':
4863
5739
  this.createTemplateContent(item, itemEle);
4864
5740
  break;
5741
+ case 'GroupButton':
5742
+ this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
5743
+ break;
4865
5744
  }
4866
5745
  };
4867
5746
  Ribbon.prototype.createItems = function (itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
@@ -4910,7 +5789,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4910
5789
  this.createRibbonItem(item, itemEle);
4911
5790
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
4912
5791
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
4913
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
5792
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
4914
5793
  this.updatePopupItems(item, itemEle, isGroupOF, true);
4915
5794
  }
4916
5795
  }
@@ -4989,54 +5868,74 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4989
5868
  if (this.ribbonFileMenuModule) {
4990
5869
  this.ribbonFileMenuModule.setCommonProperties(commonProp);
4991
5870
  }
5871
+ if (this.ribbonBackstageModule) {
5872
+ this.ribbonBackstageModule.setCommonProperties(commonProp);
5873
+ }
4992
5874
  for (var i = 0; i < this.tabs.length; i++) {
4993
5875
  var tab = this.tabs[parseInt(i.toString(), 10)];
4994
5876
  var contentEle = this.tabObj.items[parseInt(i.toString(), 10)].content;
4995
- for (var _i = 0, _a = tab.groups; _i < _a.length; _i++) {
4996
- var group = _a[_i];
4997
- var dropdownElement = void 0;
4998
- var dropdown = void 0;
4999
- if (this.activeLayout === RibbonLayout.Classic) {
5000
- dropdownElement = group.isCollapsed ?
5001
- contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
5002
- }
5003
- else {
5004
- dropdownElement = group.enableGroupOverflow ?
5005
- contentEle.querySelector('#' + group.id + GROUPOF_BUTTON_ID) : null;
5006
- dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
5007
- if (dropdown) {
5008
- updateTooltipProp(dropdown.target, commonProp);
5009
- dropdown.setProperties(commonProp);
5877
+ if (contentEle.querySelector('.' + RIBBON_GROUP)) {
5878
+ for (var _i = 0, _a = tab.groups; _i < _a.length; _i++) {
5879
+ var group = _a[_i];
5880
+ var dropdownElement = void 0;
5881
+ var dropdown = void 0;
5882
+ if (this.activeLayout === RibbonLayout.Classic) {
5883
+ dropdownElement = group.isCollapsed ?
5884
+ contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
5010
5885
  }
5011
- }
5012
- for (var _b = 0, _c = group.collections; _b < _c.length; _b++) {
5013
- var collection = _c[_b];
5014
- for (var _d = 0, _e = collection.items; _d < _e.length; _d++) {
5015
- var item = _e[_d];
5016
- var ele = null;
5017
- if (this.activeLayout === RibbonLayout.Classic) {
5018
- if (item.displayOptions & DisplayMode.Classic) {
5019
- ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
5020
- }
5886
+ else {
5887
+ dropdownElement = group.enableGroupOverflow ?
5888
+ contentEle.querySelector('#' + group.id + GROUPOF_BUTTON_ID) : null;
5889
+ dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
5890
+ if (dropdown) {
5891
+ updateTooltipProp(dropdown.target, commonProp);
5892
+ dropdown.setProperties(commonProp);
5021
5893
  }
5022
- else {
5023
- //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
5024
- ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id) : null;
5025
- // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
5026
- if (!ele) {
5027
- ele = dropdown.target.querySelector('#' + item.id);
5028
- if (item.type === 'DropDown') {
5029
- this.updatePopupItems(item, dropdown.target, group.enableGroupOverflow, true);
5894
+ }
5895
+ for (var _b = 0, _c = group.collections; _b < _c.length; _b++) {
5896
+ var collection = _c[_b];
5897
+ for (var _d = 0, _e = collection.items; _d < _e.length; _d++) {
5898
+ var item = _e[_d];
5899
+ var ele = null;
5900
+ if (this.activeLayout === RibbonLayout.Classic) {
5901
+ if (item.displayOptions & DisplayMode.Classic) {
5902
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : item.type === RibbonItemType.GroupButton ? contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID) : contentEle.querySelector('#' + item.id);
5030
5903
  }
5031
5904
  }
5032
- }
5033
- if (ele) {
5034
- var moduleName = this.getItemModuleName(item);
5035
- if (moduleName !== 'template') {
5036
- updateCommonProperty(ele, moduleName, commonProp);
5905
+ else {
5906
+ //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
5907
+ ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id) : null;
5908
+ // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
5909
+ if (!ele) {
5910
+ ele = dropdown.target.querySelector('#' + item.id);
5911
+ if (item.type === 'DropDown') {
5912
+ this.updatePopupItems(item, dropdown.target, group.enableGroupOverflow, true);
5913
+ }
5914
+ }
5037
5915
  }
5038
- else if (!isNullOrUndefined(commonProp.enableRtl)) {
5039
- ele.classList.toggle(RTL_CSS, commonProp.enableRtl);
5916
+ if (ele) {
5917
+ var moduleName = this.getItemModuleName(item);
5918
+ if (moduleName !== 'template') {
5919
+ if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
5920
+ for (var i_4 = 0; i_4 < item.groupButtonSettings.items.length; i_4++) {
5921
+ var btnEle = ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i_4);
5922
+ updateCommonProperty(btnEle, 'btn', commonProp);
5923
+ }
5924
+ }
5925
+ else if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
5926
+ updateCommonProperty(ele, 'dropdown-btn', commonProp);
5927
+ for (var i_5 = 0; i_5 < item.groupButtonSettings.items.length; i_5++) {
5928
+ var btnEle = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i_5);
5929
+ updateCommonProperty(btnEle, 'btn', commonProp);
5930
+ }
5931
+ }
5932
+ else {
5933
+ updateCommonProperty(ele, moduleName, commonProp);
5934
+ }
5935
+ }
5936
+ else if (!isNullOrUndefined(commonProp.enableRtl)) {
5937
+ ele.classList.toggle(RTL_CSS, commonProp.enableRtl);
5938
+ }
5040
5939
  }
5041
5940
  }
5042
5941
  }
@@ -5082,6 +5981,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5082
5981
  if (item.displayOptions & DisplayMode.Classic) {
5083
5982
  ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) :
5084
5983
  contentEle.querySelector('#' + item.id);
5984
+ if (item.type === RibbonItemType.GroupButton) {
5985
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
5986
+ contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
5987
+ }
5085
5988
  }
5086
5989
  }
5087
5990
  else {
@@ -5116,6 +6019,32 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5116
6019
  if (moduleName === 'colorpicker') {
5117
6020
  this.ribbonColorPickerModule.unwireColorPickerEvents(ele);
5118
6021
  }
6022
+ else if (moduleName === 'group-btn') {
6023
+ if (this.activeLayout === 'Classic') {
6024
+ for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
6025
+ var btnEle = ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
6026
+ if (btnEle) {
6027
+ destroyControl(btnEle, 'btn');
6028
+ }
6029
+ }
6030
+ }
6031
+ else {
6032
+ this.ribbonGroupButtonModule.destroyDropDown(item);
6033
+ }
6034
+ var _loop_3 = function (i) {
6035
+ if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings) {
6036
+ var groupButtonID_1 = item.id + RIBBON_GROUP_BUTTON_ID + i;
6037
+ var index = getIndex(this_3.tooltipData, function (e) { return e.id === groupButtonID_1; });
6038
+ if (index !== -1) {
6039
+ this_3.tooltipData.splice(index, 1);
6040
+ }
6041
+ }
6042
+ };
6043
+ var this_3 = this;
6044
+ for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
6045
+ _loop_3(i);
6046
+ }
6047
+ }
5119
6048
  else if (moduleName !== 'template') {
5120
6049
  destroyControl(ele, moduleName);
5121
6050
  }
@@ -5125,6 +6054,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5125
6054
  this.tooltipData.splice(index, 1);
5126
6055
  }
5127
6056
  }
6057
+ if (item.type === 'GroupButton') {
6058
+ this.ribbonGroupButtonModule.destroyDropDown(item);
6059
+ }
5128
6060
  };
5129
6061
  Ribbon.prototype.getItemModuleName = function (item) {
5130
6062
  switch (item.type) {
@@ -5140,6 +6072,8 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5140
6072
  return 'colorpicker';
5141
6073
  case 'ComboBox':
5142
6074
  return 'combobox';
6075
+ case 'GroupButton':
6076
+ return 'group-btn';
5143
6077
  default:
5144
6078
  return 'template';
5145
6079
  }
@@ -5173,6 +6107,56 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5173
6107
  var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
5174
6108
  this.setProperties({ selectedTab: index });
5175
6109
  };
6110
+ /**
6111
+ * Shows a specific tab in the ribbon.
6112
+ *
6113
+ * @param {string} tabId - The ID of the tab to be shown.
6114
+ * @returns {void}
6115
+ */
6116
+ Ribbon.prototype.showTab = function (tabId) {
6117
+ this.showHideTab(tabId, false);
6118
+ };
6119
+ /**
6120
+ * Hides a specific tab in the ribbon.
6121
+ *
6122
+ * @param {string} tabId - The ID of the tab to be hidden.
6123
+ * @returns {void}
6124
+ */
6125
+ Ribbon.prototype.hideTab = function (tabId) {
6126
+ this.showHideTab(tabId, true);
6127
+ };
6128
+ Ribbon.prototype.showHideTab = function (tabId, value) {
6129
+ var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
6130
+ if (index === -1) {
6131
+ return;
6132
+ }
6133
+ this.tabObj.hideTab(index, value);
6134
+ };
6135
+ /**
6136
+ * Enables a specific tab in the ribbon.
6137
+ *
6138
+ * @param {string} tabId - The ID of the tab to be enabled.
6139
+ * @returns {void}
6140
+ */
6141
+ Ribbon.prototype.enableTab = function (tabId) {
6142
+ this.enableDisableTab(tabId, true);
6143
+ };
6144
+ /**
6145
+ * Disables a specific tab in the ribbon.
6146
+ *
6147
+ * @param {string} tabId - The ID of the tab to be disabled.
6148
+ * @returns {void}
6149
+ */
6150
+ Ribbon.prototype.disableTab = function (tabId) {
6151
+ this.enableDisableTab(tabId, false);
6152
+ };
6153
+ Ribbon.prototype.enableDisableTab = function (tabId, value) {
6154
+ var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
6155
+ if (index === -1) {
6156
+ return;
6157
+ }
6158
+ this.tabObj.enableTab(index, value);
6159
+ };
5176
6160
  /**
5177
6161
  * Adds the ribbon tab.
5178
6162
  *
@@ -5207,14 +6191,18 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5207
6191
  var contentEle = this.tabObj.items[parseInt(index.toString(), 10)].content;
5208
6192
  var groups = this.tabs[parseInt(index.toString(), 10)].groups;
5209
6193
  if (groups && (contentEle.innerHTML !== '')) {
5210
- for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {
5211
- var group = groups_1[_i];
6194
+ for (var _i = 0, groups_2 = groups; _i < groups_2.length; _i++) {
6195
+ var group = groups_2[_i];
5212
6196
  var dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
5213
6197
  for (var _a = 0, _b = group.collections; _a < _b.length; _a++) {
5214
6198
  var collection = _b[_a];
5215
6199
  for (var _c = 0, _d = collection.items; _c < _d.length; _c++) {
5216
6200
  var item = _d[_c];
5217
6201
  var ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
6202
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
6203
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
6204
+ contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
6205
+ }
5218
6206
  if (ele) {
5219
6207
  this.destroyFunction(item, ele);
5220
6208
  }
@@ -5338,6 +6326,105 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5338
6326
  this.refreshLayout();
5339
6327
  }
5340
6328
  };
6329
+ /**
6330
+ * Hides a specific group within a ribbon tab.
6331
+ *
6332
+ * @param {string} groupID - The ID of the group to be hidden.
6333
+ * @returns {void}
6334
+ */
6335
+ Ribbon.prototype.hideGroup = function (groupID) {
6336
+ this.showHideGroup(groupID, true);
6337
+ };
6338
+ /**
6339
+ * Shows a specific group within a ribbon tab.
6340
+ *
6341
+ * @param {string} groupID - The ID of the group to be shown.
6342
+ * @returns {void}
6343
+ */
6344
+ Ribbon.prototype.showGroup = function (groupID) {
6345
+ this.showHideGroup(groupID, false);
6346
+ };
6347
+ Ribbon.prototype.showHideGroup = function (groupID, isHidden) {
6348
+ var overflowDDB;
6349
+ var overflowtarget;
6350
+ var itemProp = getGroup(this.tabs, groupID);
6351
+ if (!itemProp) {
6352
+ return;
6353
+ }
6354
+ var contentEle = this.tabObj.items[itemProp.tabIndex].content;
6355
+ var groupEle = contentEle.querySelector('#' + groupID);
6356
+ isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
6357
+ if (this.overflowDDB) {
6358
+ var overflowEle = this.overflowDDB.target;
6359
+ var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + OVERFLOW_ID);
6360
+ if (itemProp.group.enableGroupOverflow) {
6361
+ var overflowDDBEle = contentEle.querySelector('#' + groupID + GROUPOF_BUTTON_ID);
6362
+ if (overflowDDBEle) {
6363
+ overflowDDB = getInstance(overflowDDBEle, DropDownButton);
6364
+ overflowtarget = overflowDDB.target;
6365
+ }
6366
+ if (overflowtarget) {
6367
+ isHidden ? overflowtarget.classList.add('e-hidden') : overflowtarget.classList.remove('e-hidden');
6368
+ }
6369
+ }
6370
+ else if (ofTabContainer) {
6371
+ var grpContainer = ofTabContainer.querySelector('#' + groupID + CONTAINER_ID);
6372
+ if (grpContainer) {
6373
+ isHidden ? grpContainer.classList.add('e-hidden') : grpContainer.classList.remove('e-hidden');
6374
+ }
6375
+ }
6376
+ }
6377
+ this.refreshLayout();
6378
+ };
6379
+ /**
6380
+ * Disables a specific group within a ribbon tab.
6381
+ *
6382
+ * @param {string} groupID - The ID of the group to be disabled.
6383
+ * @returns {void}
6384
+ */
6385
+ Ribbon.prototype.disableGroup = function (groupID) {
6386
+ this.enableDisableGroup(groupID, true);
6387
+ };
6388
+ /**
6389
+ * Enables a specific group within a ribbon tab.
6390
+ *
6391
+ * @param {string} groupID - The ID of the group to be enabled.
6392
+ * @returns {void}
6393
+ */
6394
+ Ribbon.prototype.enableGroup = function (groupID) {
6395
+ this.enableDisableGroup(groupID, false);
6396
+ };
6397
+ Ribbon.prototype.enableDisableGroup = function (groupID, isDisabled) {
6398
+ var overflowDDB;
6399
+ var overflowtarget;
6400
+ var itemProp = getGroup(this.tabs, groupID);
6401
+ if (!itemProp) {
6402
+ return;
6403
+ }
6404
+ var contentEle = this.tabObj.items[itemProp.tabIndex].content;
6405
+ var groupEle = contentEle.querySelector('#' + groupID);
6406
+ isDisabled ? groupEle.classList.add('e-disabled') : groupEle.classList.remove('e-disabled');
6407
+ if (this.overflowDDB) {
6408
+ var overflowEle = this.overflowDDB.target;
6409
+ var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + OVERFLOW_ID);
6410
+ if (itemProp.group.enableGroupOverflow) {
6411
+ var overflowDDBEle = contentEle.querySelector('#' + groupID + GROUPOF_BUTTON_ID);
6412
+ if (overflowDDBEle) {
6413
+ overflowDDB = getInstance(overflowDDBEle, DropDownButton);
6414
+ overflowtarget = overflowDDB.target;
6415
+ }
6416
+ if (overflowtarget) {
6417
+ isDisabled ? overflowtarget.classList.add('e-disabled') : overflowtarget.classList.remove('e-disabled');
6418
+ }
6419
+ }
6420
+ else if (ofTabContainer) {
6421
+ var grpContainer = ofTabContainer.querySelector('#' + groupID + CONTAINER_ID);
6422
+ if (grpContainer) {
6423
+ isDisabled ? grpContainer.classList.add('e-disabled') : grpContainer.classList.remove('e-disabled');
6424
+ }
6425
+ }
6426
+ }
6427
+ };
5341
6428
  /**
5342
6429
  * adds the ribbon collection.
5343
6430
  *
@@ -5511,6 +6598,41 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5511
6598
  this.refreshLayout();
5512
6599
  }
5513
6600
  };
6601
+ /**
6602
+ * Hides a specific ribbon item.
6603
+ *
6604
+ * @param {string} itemId - The ID of the item to be hidden.
6605
+ * @returns {void}
6606
+ */
6607
+ Ribbon.prototype.hideItem = function (itemId) {
6608
+ this.showHideItem(itemId, true);
6609
+ };
6610
+ /**
6611
+ * Shows a specific ribbon item.
6612
+ *
6613
+ * @param {string} itemId - The ID of the item to be shown.
6614
+ * @returns {void}
6615
+ */
6616
+ Ribbon.prototype.showItem = function (itemId) {
6617
+ this.showHideItem(itemId, false);
6618
+ };
6619
+ Ribbon.prototype.showHideItem = function (itemId, isHidden) {
6620
+ var itemProp = getItem(this.tabs, itemId);
6621
+ if (!itemProp) {
6622
+ return;
6623
+ }
6624
+ var ele;
6625
+ if (itemProp.item.type === 'GroupButton') {
6626
+ ele = getItemElement(this, itemId + RIBBON_GROUP_BUTTON_ID, itemProp);
6627
+ }
6628
+ else {
6629
+ ele = getItemElement(this, itemId, itemProp);
6630
+ }
6631
+ if (ele) {
6632
+ var itemEle = closest(ele, '.e-ribbon-item');
6633
+ isHidden ? itemEle.classList.add('e-hidden') : itemEle.classList.remove('e-hidden');
6634
+ }
6635
+ };
5514
6636
  /**
5515
6637
  * tab - Gets the ribbon tab to be updated. The id of the tab is a required property. Other properties are optional.
5516
6638
  *
@@ -5536,14 +6658,18 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5536
6658
  }
5537
6659
  // Check whether group is passed by the user, and if it is, then remove the old values.
5538
6660
  if (tab.groups) {
5539
- for (var _i = 0, groups_2 = groups; _i < groups_2.length; _i++) {
5540
- var group = groups_2[_i];
6661
+ for (var _i = 0, groups_3 = groups; _i < groups_3.length; _i++) {
6662
+ var group = groups_3[_i];
5541
6663
  var dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
5542
6664
  for (var _a = 0, _b = group.collections; _a < _b.length; _a++) {
5543
6665
  var collection = _b[_a];
5544
6666
  for (var _c = 0, _d = collection.items; _c < _d.length; _c++) {
5545
6667
  var item = _d[_c];
5546
6668
  var ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
6669
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
6670
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
6671
+ contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
6672
+ }
5547
6673
  if (ele) {
5548
6674
  this.destroyFunction(item, ele);
5549
6675
  }
@@ -5815,9 +6941,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5815
6941
  else {
5816
6942
  itemContainer = groupContainer.querySelector('#' + itemId + CONTAINER_ID);
5817
6943
  itemEle = contentEle.querySelector('#' + itemId);
6944
+ if (itemProp.item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Classic) {
6945
+ itemEle = contentEle.querySelector('#' + itemId + RIBBON_GROUP_BUTTON_ID);
6946
+ }
5818
6947
  if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
5819
6948
  this.createOverflowPopup(itemProp.item, itemProp.tabIndex, itemProp.group.enableGroupOverflow, itemProp.group.id, itemProp.group.header, itemContainer, groupContainer);
5820
- if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton)) {
6949
+ if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
5821
6950
  this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
5822
6951
  }
5823
6952
  }
@@ -5881,6 +7010,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5881
7010
  var ele = null;
5882
7011
  if (this.activeLayout === RibbonLayout.Classic) {
5883
7012
  ele = (item.displayOptions & DisplayMode.Classic) ? contentEle.querySelector('#' + item.id) : null;
7013
+ if (item.type === 'GroupButton') {
7014
+ ele = (item.displayOptions & DisplayMode.Classic) ? contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID) : null;
7015
+ }
5884
7016
  }
5885
7017
  else {
5886
7018
  //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
@@ -5892,7 +7024,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5892
7024
  }
5893
7025
  if (ele) {
5894
7026
  this.destroyFunction(item, ele);
5895
- ele.closest('#' + item.id + CONTAINER_ID).remove();
7027
+ if (item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Simplified) {
7028
+ document.getElementById(item.id + CONTAINER_ID).remove();
7029
+ }
7030
+ else {
7031
+ ele.closest('#' + item.id + CONTAINER_ID).remove();
7032
+ }
5896
7033
  }
5897
7034
  };
5898
7035
  /**
@@ -5919,13 +7056,34 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5919
7056
  return;
5920
7057
  }
5921
7058
  itemProp.item.setProperties({ disabled: isDisabled }, true);
5922
- var ele = getItemElement(this, itemId, itemProp);
7059
+ var ele;
7060
+ if (itemProp.item.type === 'GroupButton') {
7061
+ ele = getItemElement(this, itemId + RIBBON_GROUP_BUTTON_ID, itemProp);
7062
+ }
7063
+ else {
7064
+ ele = getItemElement(this, itemId, itemProp);
7065
+ }
5923
7066
  if (ele) {
5924
7067
  var itemEle = closest(ele, '.e-ribbon-item');
5925
7068
  itemEle.classList.toggle(DISABLED_CSS, itemProp.item.disabled);
5926
7069
  var moduleName = this.getItemModuleName(itemProp.item);
5927
7070
  if (moduleName !== 'template') {
5928
- updateControlDisabled(ele, moduleName, isDisabled);
7071
+ if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
7072
+ updateControlDisabled(ele, 'dropdown-btn', isDisabled);
7073
+ for (var i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
7074
+ var btnEle = document.querySelector('#' + itemId + RIBBON_GROUP_BUTTON_ID + i);
7075
+ updateControlDisabled(btnEle, 'btn', isDisabled);
7076
+ }
7077
+ }
7078
+ else if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
7079
+ for (var i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
7080
+ var btnEle = ele.querySelector('#' + itemId + RIBBON_GROUP_BUTTON_ID + i);
7081
+ updateControlDisabled(btnEle, 'btn', isDisabled);
7082
+ }
7083
+ }
7084
+ else {
7085
+ updateControlDisabled(ele, moduleName, isDisabled);
7086
+ }
5929
7087
  }
5930
7088
  else {
5931
7089
  ele.classList.toggle(DISABLED_CSS, isDisabled);
@@ -5941,7 +7099,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5941
7099
  this.keyboardModuleRibbon = null;
5942
7100
  destroyTooltip(this.element);
5943
7101
  this.destroyTabItems(this.tabs);
5944
- this.removeExpandCollapse();
7102
+ if (!this.hideLayoutSwitcher) {
7103
+ this.removeExpandCollapse();
7104
+ }
5945
7105
  this.collapseButton = undefined;
5946
7106
  if (this.scrollModule) {
5947
7107
  this.scrollModule.destroy();
@@ -6038,7 +7198,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6038
7198
  this.tabObj.setProperties({ animation: newProp.tabAnimation });
6039
7199
  break;
6040
7200
  case 'tabs':
6041
- this.reRenderTabs();
7201
+ this.reRenderTabs(newProp.tabs);
6042
7202
  break;
6043
7203
  case 'width':
6044
7204
  this.element.style.width = formatUnit(newProp.width);
@@ -6051,6 +7211,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6051
7211
  var toolbarEle = this.tabObj['tbObj'];
6052
7212
  toolbarEle.refreshOverflow();
6053
7213
  break;
7214
+ case 'backStageMenu':
7215
+ if (this.ribbonBackstageModule) {
7216
+ this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu);
7217
+ }
7218
+ var toolbarElement = this.tabObj['tbObj'];
7219
+ toolbarElement.refreshOverflow();
7220
+ break;
6054
7221
  case 'helpPaneTemplate':
6055
7222
  if (this.ribbonTempEle) {
6056
7223
  remove(this.ribbonTempEle);
@@ -6063,6 +7230,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6063
7230
  var toolbar_1 = this.tabObj['tbObj'];
6064
7231
  toolbar_1.refreshOverflow();
6065
7232
  break;
7233
+ case 'hideLayoutSwitcher':
7234
+ this.hideLayoutSwitcher ? this.removeExpandCollapse() : this.addExpandCollapse();
7235
+ break;
6066
7236
  }
6067
7237
  }
6068
7238
  };
@@ -6076,6 +7246,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6076
7246
  __decorate([
6077
7247
  Complex({}, FileMenuSettings)
6078
7248
  ], Ribbon.prototype, "fileMenu", void 0);
7249
+ __decorate([
7250
+ Complex({}, BackStageMenu)
7251
+ ], Ribbon.prototype, "backStageMenu", void 0);
6079
7252
  __decorate([
6080
7253
  Property('')
6081
7254
  ], Ribbon.prototype, "launcherIconCss", void 0);
@@ -6100,6 +7273,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6100
7273
  __decorate([
6101
7274
  Property('')
6102
7275
  ], Ribbon.prototype, "helpPaneTemplate", void 0);
7276
+ __decorate([
7277
+ Property(false)
7278
+ ], Ribbon.prototype, "hideLayoutSwitcher", void 0);
6103
7279
  __decorate([
6104
7280
  Event()
6105
7281
  ], Ribbon.prototype, "tabSelecting", void 0);
@@ -6115,6 +7291,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6115
7291
  __decorate([
6116
7292
  Event()
6117
7293
  ], Ribbon.prototype, "launcherIconClick", void 0);
7294
+ __decorate([
7295
+ Event()
7296
+ ], Ribbon.prototype, "created", void 0);
6118
7297
  Ribbon = Ribbon_1 = __decorate([
6119
7298
  NotifyPropertyChanges
6120
7299
  ], Ribbon);
@@ -6440,6 +7619,553 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
6440
7619
  return RibbonFileMenu;
6441
7620
  }());
6442
7621
 
7622
+ var __extends$18 = (undefined && undefined.__extends) || (function () {
7623
+ var extendStatics = function (d, b) {
7624
+ extendStatics = Object.setPrototypeOf ||
7625
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
7626
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7627
+ return extendStatics(d, b);
7628
+ };
7629
+ return function (d, b) {
7630
+ extendStatics(d, b);
7631
+ function __() { this.constructor = d; }
7632
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
7633
+ };
7634
+ })();
7635
+ /**
7636
+ * Defines the items of Ribbon.
7637
+ */
7638
+ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
7639
+ __extends$18(RibbonBackstage, _super);
7640
+ function RibbonBackstage(parent) {
7641
+ var _this = _super.call(this) || this;
7642
+ _this.parent = parent;
7643
+ return _this;
7644
+ }
7645
+ /**
7646
+ * @private
7647
+ * @returns {void}
7648
+ */
7649
+ RibbonBackstage.prototype.render = function () {
7650
+ // render code
7651
+ };
7652
+ /**
7653
+ * @private
7654
+ * @returns {void}
7655
+ */
7656
+ RibbonBackstage.prototype.preRender = function () {
7657
+ // pre render code
7658
+ };
7659
+ RibbonBackstage.prototype.getPersistData = function () {
7660
+ return '';
7661
+ };
7662
+ /**
7663
+ * This method is abstract member of the Component<HTMLElement>.
7664
+ *
7665
+ * @private
7666
+ * @returns {void}
7667
+ */
7668
+ RibbonBackstage.prototype.onPropertyChanged = function () {
7669
+ // onProperty changes code
7670
+ };
7671
+ RibbonBackstage.prototype.getModuleName = function () {
7672
+ return 'ribbonBackstage';
7673
+ };
7674
+ RibbonBackstage.prototype.destroy = function () {
7675
+ if (this.backstageButton) {
7676
+ this.destroyDDB();
7677
+ }
7678
+ this.parent = null;
7679
+ };
7680
+ /**
7681
+ * Creates Backstage Menu
7682
+ *
7683
+ * @param {BackStageMenuModel} backStageOptions - Gets the property of backstage.
7684
+ * @returns {void}
7685
+ * @hidden
7686
+ */
7687
+ RibbonBackstage.prototype.createBackStage = function (backStageOptions) {
7688
+ var _this = this;
7689
+ if (!backStageOptions.visible) {
7690
+ return;
7691
+ }
7692
+ this.backstageButtonEle = this.parent.createElement('button', {
7693
+ id: this.parent.element.id + RIBBON_BACKSTAGE_MENU_ID
7694
+ });
7695
+ var tabEle = this.parent.tabObj.element;
7696
+ var toolbarEle = tabEle.querySelector('.e-toolbar');
7697
+ tabEle.insertBefore(this.backstageButtonEle, toolbarEle);
7698
+ this.backstageButton = new Button({
7699
+ content: backStageOptions.text,
7700
+ enableRtl: this.parent.enableRtl,
7701
+ cssClass: RIBBON_BACKSTAGE,
7702
+ created: function () {
7703
+ tabEle.style.setProperty(RIBBON_FILE_MENU_WIDTH, _this.backstageButtonEle.offsetWidth + 'px');
7704
+ }
7705
+ }, this.backstageButtonEle);
7706
+ this.createBackStagePopup(backStageOptions);
7707
+ if (this.parent.backStageMenu.template) {
7708
+ this.createBackStageTemplate(this.parent.backStageMenu.template);
7709
+ }
7710
+ else {
7711
+ var footerItemCount = 0;
7712
+ var itemCount = 0;
7713
+ for (var i = 0; i < backStageOptions.items.length; i++) {
7714
+ var item = backStageOptions.items[parseInt(i.toString(), 10)];
7715
+ if (item.isFooter) {
7716
+ footerItemCount++;
7717
+ }
7718
+ else {
7719
+ itemCount++;
7720
+ }
7721
+ }
7722
+ if (itemCount > 0) {
7723
+ this.createBackstageMenu(backStageOptions, false);
7724
+ }
7725
+ if (footerItemCount > 0) {
7726
+ this.createBackstageMenu(backStageOptions, true);
7727
+ }
7728
+ if (this.menuCtrl) {
7729
+ this.checkMenuItems(this.menuCtrl.items);
7730
+ }
7731
+ if (this.footerMenuCtrl) {
7732
+ this.checkMenuItems(this.footerMenuCtrl.items);
7733
+ }
7734
+ }
7735
+ this.backstageButtonEle.onclick = function (e) {
7736
+ e.stopPropagation();
7737
+ _this.showBackstage();
7738
+ _this.popupHTMLElement.classList.add(RIBBON_BACKSTAGE_OPEN);
7739
+ var menuItem = _this.menuWrapper.querySelector('.e-menu-item.e-selected');
7740
+ if (menuItem) {
7741
+ menuItem.classList.remove('e-selected');
7742
+ }
7743
+ for (var i = 0; i < backStageOptions.items.length; i++) {
7744
+ var item = backStageOptions.items[parseInt(i.toString(), 10)];
7745
+ if (!item.isFooter && _this.menuCtrl.items[0].text === item.text) {
7746
+ var firstMenuEle = _this.popupHTMLElement.querySelector('#' + _this.menuCtrl.items[0].id);
7747
+ if (firstMenuEle) {
7748
+ firstMenuEle.classList.add('e-selected');
7749
+ firstMenuEle.focus();
7750
+ }
7751
+ _this.createBackStageContent(_this.menuCtrl.items[0].id, item.content);
7752
+ break;
7753
+ }
7754
+ else {
7755
+ continue;
7756
+ }
7757
+ }
7758
+ };
7759
+ this.parent.tabObj.refreshActiveTabBorder();
7760
+ this.addBackStageMenuTooltip(backStageOptions);
7761
+ EventHandler.add(document, 'click', this.onClickEvent, this);
7762
+ };
7763
+ RibbonBackstage.prototype.onClickEvent = function (e) {
7764
+ var targetEle = e.target;
7765
+ if (this.popupHTMLElement.contains(targetEle)) {
7766
+ return;
7767
+ }
7768
+ else {
7769
+ this.hideBackstage();
7770
+ }
7771
+ };
7772
+ RibbonBackstage.prototype.addBackStageMenuTooltip = function (backStageOptions) {
7773
+ if (isTooltipPresent(backStageOptions.ribbonTooltipSettings)) {
7774
+ this.backstageButtonEle.classList.add(RIBBON_TOOLTIP_TARGET);
7775
+ this.parent.tooltipData.push({ id: this.backstageButtonEle.id, data: backStageOptions.ribbonTooltipSettings });
7776
+ }
7777
+ };
7778
+ RibbonBackstage.prototype.checkMenuItems = function (backStageItems) {
7779
+ for (var i = 0; i < backStageItems.length; i++) {
7780
+ var item = backStageItems[parseInt(i.toString(), 10)];
7781
+ if (!item.iconCss) {
7782
+ var menuItemEle = this.popupHTMLElement.querySelector('#' + item.id);
7783
+ menuItemEle.classList.add(RIBBON_BACKSTAGE_TEXT_MENU);
7784
+ }
7785
+ }
7786
+ };
7787
+ RibbonBackstage.prototype.createBackStagePopup = function (backStageOptions) {
7788
+ var _this = this;
7789
+ this.popupHTMLElement = this.parent.createElement('div', {
7790
+ id: this.parent.element.id + RIBBON_BACKSTAGE_POPUP_ID,
7791
+ className: RIBBON_BACKSTAGE_POPUP
7792
+ });
7793
+ var targetEle;
7794
+ if (backStageOptions.target) {
7795
+ targetEle = backStageOptions.target instanceof HTMLElement ? backStageOptions.target : document.querySelector(backStageOptions.target);
7796
+ targetEle.appendChild(this.popupHTMLElement);
7797
+ }
7798
+ else {
7799
+ this.parent.element.appendChild(this.popupHTMLElement);
7800
+ }
7801
+ this.popupEle = new Popup(this.popupHTMLElement, {
7802
+ height: backStageOptions.height,
7803
+ width: backStageOptions.width,
7804
+ relateTo: backStageOptions.target || this.parent.element,
7805
+ enableRtl: this.parent.enableRtl
7806
+ });
7807
+ if (this.parent.enableRtl) {
7808
+ this.updatePopupPositionOnRtl(this.parent.enableRtl);
7809
+ }
7810
+ this.popupHTMLElement.onkeydown = function (e) { if (e.code === 'Escape') {
7811
+ _this.hideBackstage();
7812
+ } };
7813
+ this.hideBackstage();
7814
+ };
7815
+ RibbonBackstage.prototype.updatePopupPositionOnRtl = function (enableRtl) {
7816
+ var popupStyle = this.popupHTMLElement.style;
7817
+ if (enableRtl) {
7818
+ popupStyle.right = popupStyle.left;
7819
+ popupStyle.left = 'unset';
7820
+ }
7821
+ else {
7822
+ popupStyle.left = popupStyle.right;
7823
+ popupStyle.right = 'unset';
7824
+ }
7825
+ };
7826
+ RibbonBackstage.prototype.createBackstageMenu = function (menuOptions, isFooter) {
7827
+ var _this = this;
7828
+ var wrapperEle = this.popupHTMLElement.querySelector('#' + this.parent.element.id + '_wrapper');
7829
+ if (!wrapperEle) {
7830
+ this.menuWrapper = this.parent.createElement('div', {
7831
+ id: this.parent.element.id + '_wrapper',
7832
+ className: RIBBON_BACKSTAGE_MENU_WRAPPER
7833
+ });
7834
+ this.popupHTMLElement.appendChild(this.menuWrapper);
7835
+ }
7836
+ if (menuOptions.backButton.visible && !isFooter) {
7837
+ var closeBtnEle = this.parent.createElement('button', {
7838
+ id: this.parent.element.id + '_close',
7839
+ className: 'e-ribbon-close-btn'
7840
+ });
7841
+ this.closeBtn = new Button({
7842
+ content: menuOptions.backButton.text,
7843
+ iconCss: menuOptions.backButton.iconCss ? menuOptions.backButton.iconCss : BACKSTAGE_CLOSE_ICON,
7844
+ enableRtl: this.parent.enableRtl
7845
+ }, closeBtnEle);
7846
+ this.menuWrapper.append(closeBtnEle);
7847
+ closeBtnEle.onclick = function () {
7848
+ _this.popupHTMLElement.classList.remove(RIBBON_BACKSTAGE_OPEN);
7849
+ _this.hideBackstage();
7850
+ _this.isBackButtonClicked = true;
7851
+ };
7852
+ }
7853
+ var itemsWrapperEle = this.popupHTMLElement.querySelector('#' + this.parent.element.id + '_itemswrapper');
7854
+ if (!itemsWrapperEle) {
7855
+ this.itemsWrapperEle = this.parent.createElement('div', {
7856
+ id: this.parent.element.id + '_itemswrapper',
7857
+ className: RIBBON_BACKSTAGE_ITEMS_WRAPPER
7858
+ });
7859
+ this.menuWrapper.append(this.itemsWrapperEle);
7860
+ }
7861
+ var ulFooterElem;
7862
+ if (isFooter) {
7863
+ ulFooterElem = this.parent.createElement('ul', {
7864
+ id: this.parent.element.id + RIBBON_FOOTER_MENU_LIST
7865
+ });
7866
+ this.itemsWrapperEle.appendChild(ulFooterElem);
7867
+ }
7868
+ else {
7869
+ this.ulMenuElem = this.parent.createElement('ul', {
7870
+ id: this.parent.element.id + RIBBON_MENU_LIST
7871
+ });
7872
+ this.itemsWrapperEle.appendChild(this.ulMenuElem);
7873
+ }
7874
+ if (!isFooter) {
7875
+ this.menuCtrl = new Menu({
7876
+ orientation: 'Vertical',
7877
+ enableRtl: this.parent.enableRtl,
7878
+ cssClass: RIBBON_BACKSTAGE_MENU,
7879
+ items: this.cloneMenuItem(menuOptions.items),
7880
+ select: this.menuSelect.bind(this, menuOptions)
7881
+ }, this.ulMenuElem);
7882
+ }
7883
+ else {
7884
+ this.footerMenuCtrl = new Menu({
7885
+ orientation: 'Vertical',
7886
+ enableRtl: this.parent.enableRtl,
7887
+ cssClass: RIBBON_BACKSTAGE_MENU,
7888
+ items: this.cloneFooterMenuItem(menuOptions.items),
7889
+ select: this.menuSelect.bind(this, menuOptions)
7890
+ }, ulFooterElem);
7891
+ }
7892
+ };
7893
+ RibbonBackstage.prototype.cloneMenuItem = function (items) {
7894
+ var itemsList = [];
7895
+ for (var i = 0; i < items.length; i++) {
7896
+ var item = items[parseInt(i.toString(), 10)];
7897
+ if (item.isFooter) {
7898
+ continue;
7899
+ }
7900
+ else {
7901
+ itemsList.push({
7902
+ id: item.id,
7903
+ iconCss: item.iconCss,
7904
+ separator: item.separator,
7905
+ text: item.text
7906
+ });
7907
+ }
7908
+ }
7909
+ return itemsList;
7910
+ };
7911
+ RibbonBackstage.prototype.cloneFooterMenuItem = function (items) {
7912
+ var itemsList = [];
7913
+ for (var i = 0; i < items.length; i++) {
7914
+ var item = items[parseInt(i.toString(), 10)];
7915
+ if (!item.isFooter) {
7916
+ continue;
7917
+ }
7918
+ else {
7919
+ itemsList.push({
7920
+ id: item.id,
7921
+ iconCss: item.iconCss,
7922
+ separator: item.separator,
7923
+ text: item.text
7924
+ });
7925
+ }
7926
+ }
7927
+ return itemsList;
7928
+ };
7929
+ RibbonBackstage.prototype.createBackStageContent = function (itemId, content) {
7930
+ var templateName = 'backstageContent';
7931
+ this.clearTemplate([templateName]);
7932
+ if (!this.backstageContentEle) {
7933
+ this.backstageContentEle = this.parent.createElement('div', {
7934
+ id: itemId + CONTENT_ID,
7935
+ className: RIBBON_BACKSTAGE_CONTENT
7936
+ });
7937
+ }
7938
+ else {
7939
+ this.backstageContentEle.innerHTML = '';
7940
+ this.backstageContentEle.id = itemId + CONTENT_ID;
7941
+ }
7942
+ var templateFunction = getTemplateFunction(content);
7943
+ append(templateFunction({}, this, templateName, 'backstageContent', this.parent.isStringTemplate), this.backstageContentEle);
7944
+ if (content) {
7945
+ this.popupHTMLElement.append(this.backstageContentEle);
7946
+ }
7947
+ this.renderReactTemplates();
7948
+ return templateFunction;
7949
+ };
7950
+ RibbonBackstage.prototype.createBackStageTemplate = function (template) {
7951
+ var templateName = 'backstageTemplate';
7952
+ this.clearTemplate([templateName]);
7953
+ this.backstageTempEle = this.parent.createElement('div', {
7954
+ id: this.parent.element.id + RIBBON_BACKSTAGE_MENU_ID + '_template',
7955
+ className: RIBBON_BACKSTAGE_TEMPLATE
7956
+ });
7957
+ var templateFunction = getTemplateFunction(template);
7958
+ append(templateFunction({}, this, templateName, 'backstageTemplate', this.parent.isStringTemplate), this.backstageTempEle);
7959
+ this.popupHTMLElement.append(this.backstageTempEle);
7960
+ this.renderReactTemplates();
7961
+ return templateFunction;
7962
+ };
7963
+ RibbonBackstage.prototype.menuSelect = function (menuOptions, args) {
7964
+ for (var i = 0; i < menuOptions.items.length; i++) {
7965
+ var item = menuOptions.items[parseInt(i.toString(), 10)];
7966
+ if (item.text === args.item.text) {
7967
+ this.contentItem = item;
7968
+ break;
7969
+ }
7970
+ }
7971
+ this.createBackStageContent(args.item.id, this.contentItem.content);
7972
+ var eventArgs = { cancel: false, target: args.element, item: this.contentItem, isBackButton: this.isBackButtonClicked };
7973
+ if (this.contentItem.backStageItemClick) {
7974
+ this.contentItem.backStageItemClick.call(this, eventArgs);
7975
+ }
7976
+ if (eventArgs.cancel) {
7977
+ return;
7978
+ }
7979
+ };
7980
+ /**
7981
+ * setRtl
7982
+ *
7983
+ * @param {commonProperties} commonProp - Get the common property of ribbon.
7984
+ * @returns {void}
7985
+ * @hidden
7986
+ */
7987
+ RibbonBackstage.prototype.setCommonProperties = function (commonProp) {
7988
+ if (this.backstageButton) {
7989
+ this.backstageButton.setProperties(commonProp);
7990
+ if (this.popupEle) {
7991
+ this.popupEle.setProperties(commonProp);
7992
+ if (this.popupHTMLElement)
7993
+ this.updatePopupPositionOnRtl(commonProp.enableRtl);
7994
+ if (this.menuCtrl) {
7995
+ this.menuCtrl.setProperties(commonProp);
7996
+ if (this.closeBtn) {
7997
+ this.closeBtn.setProperties(commonProp);
7998
+ }
7999
+ }
8000
+ }
8001
+ }
8002
+ };
8003
+ /**
8004
+ * Update Backstage menu
8005
+ *
8006
+ * @param {BackStageMenuModel} backStageOptions - Gets the property of backstage menu.
8007
+ * @returns {void}
8008
+ * @hidden
8009
+ */
8010
+ RibbonBackstage.prototype.updateBackStageMenu = function (backStageOptions) {
8011
+ if (backStageOptions.visible) {
8012
+ if (this.backstageButton) {
8013
+ if (backStageOptions.text) {
8014
+ this.backstageButton.setProperties({
8015
+ content: backStageOptions.text
8016
+ });
8017
+ this.parent.tabObj.element.style.setProperty(RIBBON_FILE_MENU_WIDTH, this.backstageButtonEle.offsetWidth + 'px');
8018
+ }
8019
+ if (this.popupEle) {
8020
+ this.popupEle.setProperties({
8021
+ height: backStageOptions.height,
8022
+ width: backStageOptions.width,
8023
+ target: backStageOptions.target || this.parent.element,
8024
+ });
8025
+ }
8026
+ if (backStageOptions.template) {
8027
+ if (this.backstageTempEle) {
8028
+ remove(this.backstageTempEle);
8029
+ this.backstageTempEle = null;
8030
+ }
8031
+ this.createBackStageTemplate(backStageOptions.template);
8032
+ }
8033
+ else {
8034
+ if (this.menuCtrl) {
8035
+ this.menuCtrl.setProperties({
8036
+ items: this.cloneMenuItem(backStageOptions.items)
8037
+ });
8038
+ }
8039
+ if (this.footerMenuCtrl) {
8040
+ this.footerMenuCtrl.setProperties({
8041
+ items: this.cloneFooterMenuItem(backStageOptions.items)
8042
+ });
8043
+ }
8044
+ else {
8045
+ var footerItemCount = 0;
8046
+ var itemCount = 0;
8047
+ for (var i = 0; i < backStageOptions.items.length; i++) {
8048
+ var item = backStageOptions.items[parseInt(i.toString(), 10)];
8049
+ if (item.isFooter) {
8050
+ footerItemCount++;
8051
+ }
8052
+ else {
8053
+ itemCount++;
8054
+ }
8055
+ }
8056
+ if (itemCount > 0) {
8057
+ this.createBackstageMenu(backStageOptions, false);
8058
+ }
8059
+ if (footerItemCount > 0) {
8060
+ this.createBackstageMenu(backStageOptions, true);
8061
+ }
8062
+ }
8063
+ }
8064
+ this.removeBackstageMenuTooltip();
8065
+ this.addBackStageMenuTooltip(backStageOptions);
8066
+ }
8067
+ else {
8068
+ this.createBackStage(backStageOptions);
8069
+ }
8070
+ }
8071
+ else if (this.backstageButton) {
8072
+ this.destroyDDB();
8073
+ }
8074
+ this.parent.tabObj.refreshActiveTabBorder();
8075
+ };
8076
+ RibbonBackstage.prototype.destroyMenu = function () {
8077
+ if (this.menuCtrl) {
8078
+ this.menuCtrl.destroy();
8079
+ this.menuCtrl = null;
8080
+ }
8081
+ };
8082
+ RibbonBackstage.prototype.destroyDDB = function () {
8083
+ this.removeBackstageMenuTooltip();
8084
+ var tabEle = this.parent.tabObj.element;
8085
+ tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
8086
+ this.destroyMenu();
8087
+ this.backstageButton.destroy();
8088
+ this.backstageButton = null;
8089
+ remove(this.backstageButtonEle);
8090
+ this.backstageButtonEle = null;
8091
+ EventHandler.remove(document, 'click', this.onClickEvent);
8092
+ };
8093
+ RibbonBackstage.prototype.removeBackstageMenuTooltip = function () {
8094
+ var _this = this;
8095
+ var index = getIndex(this.parent.tooltipData, function (e) { return e.id === _this.backstageButtonEle.id; });
8096
+ if (index !== -1) {
8097
+ this.backstageButtonEle.classList.remove(RIBBON_TOOLTIP_TARGET);
8098
+ this.parent.tooltipData.splice(index, 1);
8099
+ }
8100
+ };
8101
+ /**
8102
+ * Add items to Backstage Menu.
8103
+ *
8104
+ * @param {BackstageItemModel[]} items - Gets the items to be added.
8105
+ * @param {string} target - Gets the target item to add the items.
8106
+ * @param {boolean} isAfter - Gets the boolean value to add the items after or before the target item.
8107
+ * @param {boolean} isUniqueId - Gets whether the target provided is uniqueId or not.
8108
+ * @returns {void}
8109
+ */
8110
+ RibbonBackstage.prototype.addBackstageItems = function (items, target, isAfter, isUniqueId) {
8111
+ for (var i = 0; i < items.length; i++) {
8112
+ var item = items[parseInt(i.toString(), 10)];
8113
+ if (item.isFooter) {
8114
+ isAfter ? this.footerMenuCtrl.insertAfter(items, target, isUniqueId) : this.footerMenuCtrl.insertBefore(items, target, isUniqueId);
8115
+ }
8116
+ else {
8117
+ isAfter ? this.menuCtrl.insertAfter(items, target, isUniqueId) : this.menuCtrl.insertBefore(items, target, isUniqueId);
8118
+ }
8119
+ }
8120
+ var backstageItems = [].concat(this.menuCtrl.items, this.footerMenuCtrl.items);
8121
+ var backStageOptions = this.parent.backStageMenu;
8122
+ for (var i = 0; i < backStageOptions.items.length; i++) {
8123
+ var item = backStageOptions.items[parseInt(i.toString(), 10)];
8124
+ for (var i_1 = 0; i_1 < backstageItems.length; i_1++) {
8125
+ var item1 = backstageItems[parseInt(i_1.toString(), 10)];
8126
+ if (item.text === item1.text) {
8127
+ item1.content = item.content;
8128
+ break;
8129
+ }
8130
+ }
8131
+ }
8132
+ this.parent.backStageMenu.setProperties({ items: backstageItems }, true);
8133
+ };
8134
+ /**
8135
+ * Remove items from Backstage Menu.
8136
+ *
8137
+ * @param {string[]} items - Gets the items to be removed.
8138
+ * @param {boolean} isUniqueId - Gets whether the target provided is uniqueId or not.
8139
+ * @returns {void}
8140
+ */
8141
+ RibbonBackstage.prototype.removeBackstageItems = function (items, isUniqueId) {
8142
+ this.menuCtrl.removeItems(items, isUniqueId);
8143
+ this.footerMenuCtrl.removeItems(items, isUniqueId);
8144
+ var backstageItems = [].concat(this.menuCtrl.items, this.footerMenuCtrl.items);
8145
+ this.parent.backStageMenu.setProperties({ items: backstageItems }, true);
8146
+ };
8147
+ /**
8148
+ * Renders the backstage dynamically.
8149
+ *
8150
+ * @returns {void}
8151
+ */
8152
+ RibbonBackstage.prototype.showBackstage = function () {
8153
+ this.popupEle.show();
8154
+ };
8155
+ /**
8156
+ * Hides the backstage dynamically.
8157
+ *
8158
+ * @returns {void}
8159
+ */
8160
+ RibbonBackstage.prototype.hideBackstage = function () {
8161
+ if (this.popupEle.element.classList.contains(RIBBON_BACKSTAGE_OPEN)) {
8162
+ this.popupEle.element.classList.remove(RIBBON_BACKSTAGE_OPEN);
8163
+ }
8164
+ this.popupEle.hide();
8165
+ };
8166
+ return RibbonBackstage;
8167
+ }(Component));
8168
+
6443
8169
  /**
6444
8170
  * Ribbon modules
6445
8171
  */
@@ -6447,5 +8173,5 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
6447
8173
  // export all modules from current location
6448
8174
  // example: export * from './module'
6449
8175
 
6450
- export { Ribbon, RibbonLayout, ItemOrientation, RibbonItemSize, DisplayMode, RibbonItemType, ITEM_VERTICAL_CENTER, EXPAND_COLLAPSE_ICON, OVERFLOW_ICON, VERTICAL_DDB, DISABLED_CSS, RTL_CSS, RIBBON_HOVER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_TAB_ACTIVE, RIBBON_TAB_ITEM, RIBBON_COLLAPSE_BUTTON, RIBBON_EXPAND_BUTTON, RIBBON_COLLAPSIBLE, RIBBON_OVERALL_OF_BUTTON, RIBBON_GROUP_OF_BUTTON, RIBBON_OVERFLOW_TARGET, RIBBON_OVERFLOW, TAB_CONTENT, RIBBON_MINIMIZE, RIBBON_GROUP, RIBBON_GROUP_CONTAINER, RIBBON_OF_TAB_CONTAINER, RIBBON_OF_GROUP_CONTAINER, RIBBON_GROUP_CONTENT, RIBBON_GROUP_HEADER, RIBBON_OVERFLOW_HEADER, RIBBON_GROUP_OVERFLOW, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_LAUNCHER, RIBBON_LAUNCHER_ICON_ELE, RIBBON_LAUNCHER_ICON, RIBBON_COLLECTION, RIBBON_ITEM, RIBBON_ROW, RIBBON_COLUMN, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM, RIBBON_CONTENT_HEIGHT, DROPDOWNBUTTON, DROPDOWNBUTTON_HIDE, RIBBON_TEMPLATE, RIBBON_HELP_TEMPLATE, RIBBON_TOOLTIP, RIBBON_TOOLTIP_TARGET, RIBBON_TOOLTIP_TITLE, RIBBON_TOOLTIP_CONTENT, RIBBON_TOOLTIP_ICON, RIBBON_TOOLTIP_CONTAINER, RIBBON_TEXT_CONTAINER, RIBBON_SIMPLIFIED_MODE, TAB_ID, GROUP_ID, COLLECTION_ID, ITEM_ID, COLLAPSE_BUTTON_ID, OVRLOF_BUTTON_ID, GROUPOF_BUTTON_ID, HEADER_ID, LAUNCHER_ID, CONTENT_ID, CONTAINER_ID, OVERFLOW_ID, DROPDOWN_ID, RIBBON_FILE_MENU_ID, RIBBON_FILE_MENU_LIST, RIBBON_HELP_PANE_TEMPLATE_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, RibbonTooltip, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonFileMenu };
8176
+ export { Ribbon, RibbonLayout, ItemOrientation, RibbonItemSize, DisplayMode, RibbonItemType, RibbonGroupButtonSelection, ITEM_VERTICAL_CENTER, EXPAND_COLLAPSE_ICON, BACKSTAGE_CLOSE_ICON, OVERFLOW_ICON, VERTICAL_DDB, DISABLED_CSS, RTL_CSS, RIBBON_HOVER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_TAB_ACTIVE, RIBBON_TAB_ITEM, RIBBON_COLLAPSE_BUTTON, RIBBON_EXPAND_BUTTON, RIBBON_COLLAPSIBLE, RIBBON_OVERALL_OF_BUTTON, RIBBON_GROUP_OF_BUTTON, RIBBON_OVERFLOW_TARGET, RIBBON_OVERFLOW, TAB_CONTENT, RIBBON_MINIMIZE, RIBBON_GROUP, RIBBON_SINGLE_BUTTON_SELECTION, RIBBON_MULTIPLE_BUTTON_SELECTION, RIBBON_GROUP_BUTTON, RIBBON_GROUP_BUTTON_OVERFLOW_POPUP, RIBBON_GROUP_CONTAINER, RIBBON_OF_TAB_CONTAINER, RIBBON_OF_GROUP_CONTAINER, RIBBON_GROUP_CONTENT, RIBBON_GROUP_HEADER, RIBBON_OVERFLOW_HEADER, RIBBON_GROUP_OVERFLOW, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_LAUNCHER, RIBBON_LAUNCHER_ICON_ELE, RIBBON_LAUNCHER_ICON, RIBBON_COLLECTION, RIBBON_ITEM, RIBBON_ROW, RIBBON_COLUMN, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM, RIBBON_CONTENT_HEIGHT, DROPDOWNBUTTON, DROPDOWNBUTTON_HIDE, RIBBON_TEMPLATE, RIBBON_HELP_TEMPLATE, RIBBON_TOOLTIP, RIBBON_TOOLTIP_TARGET, RIBBON_TOOLTIP_TITLE, RIBBON_TOOLTIP_CONTENT, RIBBON_TOOLTIP_ICON, RIBBON_TOOLTIP_CONTAINER, RIBBON_TEXT_CONTAINER, RIBBON_SIMPLIFIED_MODE, RIBBON_BACKSTAGE_POPUP, RIBBON_BACKSTAGE_OPEN, RIBBON_BACKSTAGE_CONTENT, RIBBON_SELECTED_CONTENT, RIBBON_BACKSTAGE, RIBBON_BACKSTAGE_MENU, RIBBON_BACKSTAGE_TEMPLATE, RIBBON_BACKSTAGE_MENU_WRAPPER, RIBBON_BACKSTAGE_ITEMS_WRAPPER, RIBBON_BACKSTAGE_TEXT_MENU, TAB_ID, GROUP_ID, COLLECTION_ID, ITEM_ID, COLLAPSE_BUTTON_ID, OVRLOF_BUTTON_ID, GROUPOF_BUTTON_ID, HEADER_ID, LAUNCHER_ID, CONTENT_ID, CONTAINER_ID, OVERFLOW_ID, DROPDOWN_ID, RIBBON_FILE_MENU_ID, RIBBON_BACKSTAGE_MENU_ID, RIBBON_BACKSTAGE_POPUP_ID, RIBBON_FILE_MENU_LIST, RIBBON_MENU_LIST, RIBBON_FOOTER_MENU_LIST, RIBBON_HELP_PANE_TEMPLATE_ID, RIBBON_GROUP_BUTTON_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, BackStageMenu, BackstageBackButton, BackstageItem, RibbonTooltip, RibbonGroupButtonSettings, RibbonGroupButtonItem, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonGroupButton, RibbonFileMenu, RibbonBackstage };
6451
8177
  //# sourceMappingURL=ej2-ribbon.es5.js.map