@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 __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
117
135
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -403,6 +421,9 @@ __decorate$9([
403
421
  __decorate$9([
404
422
  Property('')
405
423
  ], RibbonDropDownSettings.prototype, "target", void 0);
424
+ __decorate$9([
425
+ Property(false)
426
+ ], RibbonDropDownSettings.prototype, "createPopupOnClick", void 0);
406
427
  __decorate$9([
407
428
  Event()
408
429
  ], RibbonDropDownSettings.prototype, "beforeClose", void 0);
@@ -515,6 +536,54 @@ __decorate$11([
515
536
  Property('')
516
537
  ], RibbonTooltip.prototype, "iconCss", void 0);
517
538
 
539
+ var __decorate$13 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
540
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
541
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
542
+ 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;
543
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
544
+ };
545
+ /**
546
+ * Defines the ribbon group button settings.
547
+ */
548
+ class RibbonGroupButtonItem extends ChildProperty {
549
+ }
550
+ __decorate$13([
551
+ Property('')
552
+ ], RibbonGroupButtonItem.prototype, "content", void 0);
553
+ __decorate$13([
554
+ Property('')
555
+ ], RibbonGroupButtonItem.prototype, "iconCss", void 0);
556
+ __decorate$13([
557
+ Complex({}, RibbonTooltip)
558
+ ], RibbonGroupButtonItem.prototype, "ribbonTooltipSettings", void 0);
559
+ __decorate$13([
560
+ Property(false)
561
+ ], RibbonGroupButtonItem.prototype, "selected", void 0);
562
+ __decorate$13([
563
+ Event()
564
+ ], RibbonGroupButtonItem.prototype, "beforeClick", void 0);
565
+ __decorate$13([
566
+ Event()
567
+ ], RibbonGroupButtonItem.prototype, "click", void 0);
568
+
569
+ var __decorate$12 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
570
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
571
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
572
+ 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;
573
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
574
+ };
575
+ /**
576
+ * Defines the ribbon group button settings.
577
+ */
578
+ class RibbonGroupButtonSettings extends ChildProperty {
579
+ }
580
+ __decorate$12([
581
+ Property('Single')
582
+ ], RibbonGroupButtonSettings.prototype, "selection", void 0);
583
+ __decorate$12([
584
+ Collection([], RibbonGroupButtonItem)
585
+ ], RibbonGroupButtonSettings.prototype, "items", void 0);
586
+
518
587
  var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
519
588
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
520
589
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -580,6 +649,9 @@ __decorate$4([
580
649
  __decorate$4([
581
650
  Complex({}, RibbonSplitButtonSettings)
582
651
  ], RibbonItem.prototype, "splitButtonSettings", void 0);
652
+ __decorate$4([
653
+ Complex({}, RibbonGroupButtonSettings)
654
+ ], RibbonItem.prototype, "groupButtonSettings", void 0);
583
655
 
584
656
  var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
585
657
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -698,7 +770,7 @@ __decorate$1([
698
770
  Property('')
699
771
  ], RibbonTab.prototype, "header", void 0);
700
772
 
701
- var __decorate$12 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
773
+ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
702
774
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
703
775
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
704
776
  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;
@@ -718,49 +790,151 @@ class FileMenuSettings extends ChildProperty {
718
790
  super.setProperties(prop, muteOnChange);
719
791
  }
720
792
  }
721
- __decorate$12([
793
+ __decorate$14([
722
794
  Property('File')
723
795
  ], FileMenuSettings.prototype, "text", void 0);
724
- __decorate$12([
796
+ __decorate$14([
725
797
  Property(false)
726
798
  ], FileMenuSettings.prototype, "visible", void 0);
727
- __decorate$12([
799
+ __decorate$14([
728
800
  Collection([], MenuItem)
729
801
  ], FileMenuSettings.prototype, "menuItems", void 0);
730
- __decorate$12([
802
+ __decorate$14([
731
803
  Property(false)
732
804
  ], FileMenuSettings.prototype, "showItemOnClick", void 0);
733
- __decorate$12([
805
+ __decorate$14([
734
806
  Complex({}, MenuAnimationSettings)
735
807
  ], FileMenuSettings.prototype, "animationSettings", void 0);
736
- __decorate$12([
808
+ __decorate$14([
737
809
  Property('')
738
810
  ], FileMenuSettings.prototype, "itemTemplate", void 0);
739
- __decorate$12([
811
+ __decorate$14([
740
812
  Property('')
741
813
  ], FileMenuSettings.prototype, "popupTemplate", void 0);
742
- __decorate$12([
814
+ __decorate$14([
743
815
  Complex({}, RibbonTooltip)
744
816
  ], FileMenuSettings.prototype, "ribbonTooltipSettings", void 0);
745
- __decorate$12([
817
+ __decorate$14([
746
818
  Event()
747
819
  ], FileMenuSettings.prototype, "beforeClose", void 0);
748
- __decorate$12([
820
+ __decorate$14([
749
821
  Event()
750
822
  ], FileMenuSettings.prototype, "beforeOpen", void 0);
751
- __decorate$12([
823
+ __decorate$14([
752
824
  Event()
753
825
  ], FileMenuSettings.prototype, "beforeItemRender", void 0);
754
- __decorate$12([
826
+ __decorate$14([
755
827
  Event()
756
828
  ], FileMenuSettings.prototype, "close", void 0);
757
- __decorate$12([
829
+ __decorate$14([
758
830
  Event()
759
831
  ], FileMenuSettings.prototype, "open", void 0);
760
- __decorate$12([
832
+ __decorate$14([
761
833
  Event()
762
834
  ], FileMenuSettings.prototype, "select", void 0);
763
835
 
836
+ var __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
837
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
838
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
839
+ 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;
840
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
841
+ };
842
+ /**
843
+ * Defines the ribbon backstage back button.
844
+ */
845
+ class BackstageBackButton extends ChildProperty {
846
+ }
847
+ __decorate$16([
848
+ Property('')
849
+ ], BackstageBackButton.prototype, "text", void 0);
850
+ __decorate$16([
851
+ Property('')
852
+ ], BackstageBackButton.prototype, "iconCss", void 0);
853
+ __decorate$16([
854
+ Property(true)
855
+ ], BackstageBackButton.prototype, "visible", void 0);
856
+
857
+ var __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
858
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
859
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
860
+ 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;
861
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
862
+ };
863
+ /**
864
+ * Defines the ribbon backstage back button.
865
+ */
866
+ class BackstageItem extends ChildProperty {
867
+ }
868
+ __decorate$17([
869
+ Property('')
870
+ ], BackstageItem.prototype, "text", void 0);
871
+ __decorate$17([
872
+ Property('')
873
+ ], BackstageItem.prototype, "id", void 0);
874
+ __decorate$17([
875
+ Property('')
876
+ ], BackstageItem.prototype, "content", void 0);
877
+ __decorate$17([
878
+ Property('')
879
+ ], BackstageItem.prototype, "iconCss", void 0);
880
+ __decorate$17([
881
+ Property(false)
882
+ ], BackstageItem.prototype, "separator", void 0);
883
+ __decorate$17([
884
+ Property(false)
885
+ ], BackstageItem.prototype, "isFooter", void 0);
886
+ __decorate$17([
887
+ Event()
888
+ ], BackstageItem.prototype, "backStageItemClick", void 0);
889
+
890
+ var __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
891
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
892
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
893
+ 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;
894
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
895
+ };
896
+ /**
897
+ * Defines the ribbon file menu settings.
898
+ */
899
+ class BackStageMenu extends ChildProperty {
900
+ /**
901
+ * @param {Object} prop - Gets the property of Backstage Menu.
902
+ * @param {boolean} muteOnChange - Gets the boolean value of muteOnChange.
903
+ * @returns {void}
904
+ * @private
905
+ */
906
+ setProperties(prop, muteOnChange) {
907
+ super.setProperties(prop, muteOnChange);
908
+ }
909
+ }
910
+ __decorate$15([
911
+ Property('File')
912
+ ], BackStageMenu.prototype, "text", void 0);
913
+ __decorate$15([
914
+ Property(false)
915
+ ], BackStageMenu.prototype, "visible", void 0);
916
+ __decorate$15([
917
+ Property('auto')
918
+ ], BackStageMenu.prototype, "height", void 0);
919
+ __decorate$15([
920
+ Property('auto')
921
+ ], BackStageMenu.prototype, "width", void 0);
922
+ __decorate$15([
923
+ Property(null)
924
+ ], BackStageMenu.prototype, "target", void 0);
925
+ __decorate$15([
926
+ Complex({}, BackstageBackButton)
927
+ ], BackStageMenu.prototype, "backButton", void 0);
928
+ __decorate$15([
929
+ Collection([], BackstageItem)
930
+ ], BackStageMenu.prototype, "items", void 0);
931
+ __decorate$15([
932
+ Property('')
933
+ ], BackStageMenu.prototype, "template", void 0);
934
+ __decorate$15([
935
+ Complex({}, RibbonTooltip)
936
+ ], BackStageMenu.prototype, "ribbonTooltipSettings", void 0);
937
+
764
938
  // export * from './file-menu';
765
939
 
766
940
  /**
@@ -771,6 +945,8 @@ const ITEM_VERTICAL_CENTER = 'e-ribbon-vertical-center';
771
945
  /** @hidden */
772
946
  const EXPAND_COLLAPSE_ICON = 'e-icons e-drop-icon';
773
947
  /** @hidden */
948
+ const BACKSTAGE_CLOSE_ICON = 'e-icons e-arrow-left';
949
+ /** @hidden */
774
950
  const OVERFLOW_ICON = 'e-icons e-more-horizontal-1';
775
951
  /** @hidden */
776
952
  const VERTICAL_DDB = 'e-vertical';
@@ -819,6 +995,14 @@ const RIBBON_MINIMIZE = 'e-ribbon-minimize';
819
995
  /** @hidden */
820
996
  const RIBBON_GROUP = 'e-ribbon-group';
821
997
  /** @hidden */
998
+ const RIBBON_SINGLE_BUTTON_SELECTION = 'e-ribbon-single-selection';
999
+ /** @hidden */
1000
+ const RIBBON_MULTIPLE_BUTTON_SELECTION = 'e-ribbon-multiple-selection';
1001
+ /** @hidden */
1002
+ const RIBBON_GROUP_BUTTON = 'e-ribbon-group-button';
1003
+ /** @hidden */
1004
+ const RIBBON_GROUP_BUTTON_OVERFLOW_POPUP = 'e-ribbon-group-button-overflow-popup';
1005
+ /** @hidden */
822
1006
  const RIBBON_GROUP_CONTAINER = 'e-ribbon-group-container';
823
1007
  /** @hidden */
824
1008
  const RIBBON_OF_TAB_CONTAINER = 'e-ribbon-of-tab';
@@ -881,6 +1065,26 @@ const RIBBON_TEXT_CONTAINER = 'e-ribbon-text-container';
881
1065
  /** @hidden */
882
1066
  const RIBBON_SIMPLIFIED_MODE = 'e-ribbon-simplified-mode';
883
1067
  /** @hidden */
1068
+ const RIBBON_BACKSTAGE_POPUP = 'e-ribbon-backstage-popup';
1069
+ /** @hidden */
1070
+ const RIBBON_BACKSTAGE_OPEN = 'e-ribbon-backstage-open';
1071
+ /** @hidden */
1072
+ const RIBBON_BACKSTAGE_CONTENT = 'e-ribbon-backstage-content';
1073
+ /** @hidden */
1074
+ const RIBBON_SELECTED_CONTENT = 'e-ribbon-selected-content';
1075
+ /** @hidden */
1076
+ const RIBBON_BACKSTAGE = 'e-ribbon-backstage';
1077
+ /** @hidden */
1078
+ const RIBBON_BACKSTAGE_MENU = 'e-ribbon-backstage-menu';
1079
+ /** @hidden */
1080
+ const RIBBON_BACKSTAGE_TEMPLATE = 'e-ribbon-backstage-template';
1081
+ /** @hidden */
1082
+ const RIBBON_BACKSTAGE_MENU_WRAPPER = 'e-ribbon-backstage-wrapper';
1083
+ /** @hidden */
1084
+ const RIBBON_BACKSTAGE_ITEMS_WRAPPER = 'e-ribbon-backstage-items-wrapper';
1085
+ /** @hidden */
1086
+ const RIBBON_BACKSTAGE_TEXT_MENU = 'e-blankicon';
1087
+ /** @hidden */
884
1088
  const TAB_ID = '_tab';
885
1089
  /** @hidden */
886
1090
  const GROUP_ID = '_group';
@@ -909,10 +1113,20 @@ const DROPDOWN_ID = '_dropdown';
909
1113
  /** @hidden */
910
1114
  const RIBBON_FILE_MENU_ID = '_filemenu';
911
1115
  /** @hidden */
1116
+ const RIBBON_BACKSTAGE_MENU_ID = '_backstage';
1117
+ /** @hidden */
1118
+ const RIBBON_BACKSTAGE_POPUP_ID = '_backstagepopup';
1119
+ /** @hidden */
912
1120
  const RIBBON_FILE_MENU_LIST = '_filemenulist';
913
1121
  /** @hidden */
1122
+ const RIBBON_MENU_LIST = '_menulist';
1123
+ /** @hidden */
1124
+ const RIBBON_FOOTER_MENU_LIST = '_footermenulist';
1125
+ /** @hidden */
914
1126
  const RIBBON_HELP_PANE_TEMPLATE_ID = '_helppanetemplate';
915
1127
  /** @hidden */
1128
+ const RIBBON_GROUP_BUTTON_ID = '_grpbtn';
1129
+ /** @hidden */
916
1130
  const RIBBON_FILE_MENU_WIDTH = '--fileMenuWidth';
917
1131
  /** @hidden */
918
1132
  const RIBBON_HELP_PANE_TEMPLATE_WIDTH = '--helpTemplateWidth';
@@ -1037,6 +1251,9 @@ class RibbonButton {
1037
1251
  return;
1038
1252
  }
1039
1253
  const buttonObj = getComponent(buttonEle, Button);
1254
+ if (prop.isToggle) {
1255
+ buttonEle.classList.add('e-active');
1256
+ }
1040
1257
  if (prop.cssClass) {
1041
1258
  prop.cssClass = (ITEM_VERTICAL_CENTER + SPACE + RIBBON_CONTROL + SPACE + prop.cssClass).trim();
1042
1259
  }
@@ -1309,7 +1526,7 @@ class RibbonColorPicker {
1309
1526
  const splitBtn = colorPickerObj['splitBtn'];
1310
1527
  //Accessing the private property 'splitBtn' of ColorPicker component to get the colorpicker instance as there is no close event in colorpicker.
1311
1528
  splitBtn.close = null;
1312
- colorPickerObj.beforeClose = (e) => {
1529
+ colorPickerObj.beforeClose = () => {
1313
1530
  colorPickerObj.element.parentElement.classList.remove(RIBBON_POPUP_OPEN);
1314
1531
  if (item.colorPickerSettings.beforeClose) {
1315
1532
  item.colorPickerSettings.beforeClose.call(this);
@@ -1605,6 +1822,7 @@ class RibbonDropDown {
1605
1822
  iconCss: dropDownSettings.iconCss,
1606
1823
  items: dropDownSettings.items,
1607
1824
  target: dropDownSettings.target,
1825
+ createPopupOnClick: dropDownSettings.createPopupOnClick,
1608
1826
  beforeClose: (e) => {
1609
1827
  if (dropDownSettings.beforeClose) {
1610
1828
  dropDownSettings.beforeClose.call(this, e);
@@ -1620,7 +1838,7 @@ class RibbonDropDown {
1620
1838
  created: dropDownSettings.created,
1621
1839
  open: dropDownSettings.open,
1622
1840
  select: dropDownSettings.select
1623
- }, buttonEle);
1841
+ }).appendTo(buttonEle);
1624
1842
  }
1625
1843
  /**
1626
1844
  * Adds the additional event handlers as the item moved into overflow popup.
@@ -2557,130 +2775,566 @@ function updateTooltipProp(element, prop) {
2557
2775
  control.setProperties(prop);
2558
2776
  }
2559
2777
 
2560
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2561
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2562
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2563
- 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;
2564
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2565
- };
2566
- var Ribbon_1;
2567
2778
  /**
2568
- * The Ribbon Component is a structured layout to manage tools with tabs and groups.
2779
+ * Defines the items of Ribbon.
2569
2780
  */
2570
- let Ribbon = Ribbon_1 = class Ribbon extends Component {
2571
- /**
2572
- * Constructor for creating the widget.
2573
- *
2574
- * @param {RibbonModel} options - Specifies the ribbon model
2575
- * @param {string|HTMLDivElement} element - Specifies the target element
2576
- */
2577
- constructor(options, element) {
2578
- Ribbon_1.Inject(RibbonButton, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonComboBox);
2579
- super(options, element);
2580
- }
2581
- /**
2582
- * Initialize the control rendering.
2583
- *
2584
- * @returns {void}
2585
- * @private
2586
- */
2587
- render() {
2588
- this.initialize();
2589
- }
2590
- preRender() {
2591
- this.idIndex = 0;
2592
- this.tooltipData = [];
2593
- this.isAddRemove = false;
2594
- this.keyConfigs = {
2595
- leftarrow: 'leftarrow',
2596
- rightarrow: 'rightarrow',
2597
- tab: 'tab',
2598
- shiftTab: 'shift+tab'
2599
- };
2600
- }
2601
- /**
2602
- * Get the properties to be maintained in the persisted state.
2603
- *
2604
- * @returns {string} - Persist data
2605
- */
2606
- getPersistData() {
2607
- return this.addOnPersist(['activeLayout']);
2781
+ class RibbonGroupButton {
2782
+ constructor(parent) {
2783
+ this.parent = parent;
2784
+ this.isSelected = false;
2608
2785
  }
2609
- /**
2610
- * Get component name.
2611
- *
2612
- * @returns {string} - Module name
2613
- * @private
2614
- */
2615
2786
  getModuleName() {
2616
- return 'ribbon';
2787
+ return 'ribbonGroupButton';
2788
+ }
2789
+ destroy() {
2790
+ this.parent = null;
2617
2791
  }
2618
2792
  /**
2619
- * To provide the array of modules needed for component rendering
2793
+ * Creates Group Button
2620
2794
  *
2621
- * @returns {ModuleDeclaration[]} - returns module declaration.
2795
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
2796
+ * @param {HTMLElement} itemElement - Gets the ribbon item element.
2797
+ * @returns {void}
2622
2798
  * @hidden
2623
2799
  */
2624
- requiredModules() {
2625
- const modules = [];
2626
- 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] });
2627
- return modules;
2628
- }
2629
- initialize() {
2630
- this.element.id = this.element.id || getUniqueID('e-' + this.getModuleName());
2631
- addClass([this.element], ['e-rbn', ...(this.cssClass ? this.cssClass.split(SPACE) : [])]);
2632
- if (this.enableRtl) {
2633
- this.element.classList.add(RTL_CSS);
2634
- }
2635
- this.element.style.width = formatUnit(this.width);
2636
- this.renderTabs();
2637
- if (this.ribbonFileMenuModule) {
2638
- this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
2639
- }
2640
- this.createHelpPaneTemplate();
2641
- const toolbar = this.tabObj['tbObj'];
2642
- toolbar.refreshOverflow();
2643
- createTooltip(this.element, this);
2644
- this.wireEvents();
2645
- this.wireKeyboardEvent();
2646
- this.currentControlIndex = 0;
2647
- }
2648
- wireEvents() {
2649
- EventHandler.add(window, 'resize', this.resizeHandler, this);
2650
- }
2651
- wireKeyboardEvent() {
2652
- this.keyboardModuleRibbon = new KeyboardEvents(this.element, {
2653
- keyAction: this.keyActionHandler.bind(this),
2654
- keyConfigs: this.keyConfigs,
2655
- eventName: 'keydown'
2800
+ createGroupButton(item, itemElement) {
2801
+ const groupBtnSettings = item.groupButtonSettings;
2802
+ this.count = 0;
2803
+ const btnContainerEle = this.parent.createElement('div', {
2804
+ id: item.id + RIBBON_GROUP_BUTTON_ID,
2805
+ className: 'e-btn-group'
2656
2806
  });
2657
- }
2658
- keyActionHandler(e) {
2659
- if (((e.key === 'Tab') && (!(e.target.classList.contains('e-tab-wrap')) && !(e.target.classList.contains('e-combobox'))))) {
2660
- e.preventDefault();
2661
- }
2662
- const activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
2663
- const ribbonControls = activeContent.querySelectorAll('.e-control');
2664
- const comboBoxElements = activeContent.querySelectorAll('.e-combobox');
2665
- let comboBoxEle;
2666
- if (comboBoxElements) {
2667
- for (let i = 0; i < comboBoxElements.length; i++) {
2668
- if (comboBoxElements[parseInt(i.toString(), 10)].closest('.e-input-focus')) {
2669
- comboBoxEle = comboBoxElements[parseInt(i.toString(), 10)];
2807
+ itemElement.appendChild(btnContainerEle);
2808
+ for (let i = 0; i < groupBtnSettings.items.length; i++) {
2809
+ if ((groupBtnSettings.items[parseInt(i.toString(), 10)].iconCss)) {
2810
+ const groupButtonEle = this.parent.createElement('button', {
2811
+ id: item.id + RIBBON_GROUP_BUTTON_ID + i,
2812
+ className: RIBBON_GROUP_BUTTON
2813
+ });
2814
+ btnContainerEle.appendChild(groupButtonEle);
2815
+ new Button({
2816
+ iconCss: groupBtnSettings.items[parseInt(i.toString(), 10)].iconCss,
2817
+ disabled: item.disabled,
2818
+ enableRtl: this.parent.enableRtl,
2819
+ content: item.activeSize === RibbonItemSize.Small ? '' : groupBtnSettings.items[parseInt(i.toString(), 10)].content,
2820
+ iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left'
2821
+ }, groupButtonEle);
2822
+ const buttonEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
2823
+ if (groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
2824
+ btnContainerEle.classList.add(RIBBON_SINGLE_BUTTON_SELECTION);
2825
+ }
2826
+ else {
2827
+ btnContainerEle.classList.add(RIBBON_MULTIPLE_BUTTON_SELECTION);
2828
+ }
2829
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].selected) {
2830
+ if (groupBtnSettings.selection === RibbonGroupButtonSelection.Multiple) {
2831
+ buttonEle.classList.add('e-active');
2832
+ }
2833
+ else {
2834
+ if (this.count < 1) {
2835
+ buttonEle.classList.add('e-active');
2836
+ this.count++;
2837
+ }
2838
+ }
2839
+ }
2840
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings &&
2841
+ isTooltipPresent(groupBtnSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings)) {
2842
+ groupButtonEle.classList.add(RIBBON_TOOLTIP_TARGET);
2843
+ this.parent.tooltipData.push({
2844
+ id: groupButtonEle.id, data: groupBtnSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings
2845
+ });
2670
2846
  }
2847
+ EventHandler.add(buttonEle, 'click', this.groupButtonClicked.bind(this, i, item, groupBtnSettings), this);
2671
2848
  }
2672
2849
  }
2673
- if (comboBoxEle) {
2674
- for (let i = 0; i < ribbonControls.length; i++) {
2675
- if (ribbonControls[parseInt(i.toString(), 10)].classList.contains('e-combobox')) {
2676
- if (ribbonControls[parseInt(i.toString(), 10)].closest('.e-input-focus')) {
2677
- this.currentControlIndex = i;
2850
+ if (this.parent.activeLayout === 'Simplified') {
2851
+ let dropdownIcon;
2852
+ let activeEleCount = 0;
2853
+ let count = 0;
2854
+ const buttonEle = this.parent.createElement('button', {
2855
+ id: item.id
2856
+ });
2857
+ itemElement.appendChild(buttonEle);
2858
+ for (let i = 0; i < groupBtnSettings.items.length; i++) {
2859
+ if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].selected &&
2860
+ !this.isSelected && groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
2861
+ dropdownIcon = item.groupButtonSettings.items[parseInt(i.toString(), 10)].iconCss;
2862
+ this.isSelected = true;
2863
+ }
2864
+ else if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].selected &&
2865
+ groupBtnSettings.selection === RibbonGroupButtonSelection.Multiple) {
2866
+ activeEleCount++;
2867
+ if (activeEleCount === 1) {
2868
+ dropdownIcon = item.groupButtonSettings.items[parseInt(i.toString(), 10)].iconCss;
2869
+ }
2870
+ else {
2871
+ dropdownIcon = null;
2678
2872
  }
2679
2873
  }
2680
2874
  }
2681
- }
2682
- if (this.currentControlIndex === 0) {
2683
- let item = ribbonControls[this.currentControlIndex].closest('.e-ribbon-item');
2875
+ while (count < item.groupButtonSettings.items.length && !this.isSelected && !dropdownIcon) {
2876
+ if (item.groupButtonSettings.items[parseInt(count.toString(), 10)].iconCss) {
2877
+ dropdownIcon = item.groupButtonSettings.items[parseInt(count.toString(), 10)].iconCss;
2878
+ this.isSelected = true;
2879
+ }
2880
+ count++;
2881
+ }
2882
+ new DropDownButton({
2883
+ iconCss: dropdownIcon,
2884
+ target: btnContainerEle,
2885
+ enableRtl: this.parent.enableRtl,
2886
+ cssClass: 'e-ribbon-dropdown-group-button',
2887
+ disabled: item.disabled
2888
+ }, buttonEle);
2889
+ buttonEle.onclick = buttonEle.onkeydown = () => {
2890
+ if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
2891
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
2892
+ this.grpBtnIndex = 0;
2893
+ }
2894
+ };
2895
+ btnContainerEle.onkeydown = (e) => {
2896
+ if (this.parent.activeLayout === 'Simplified') {
2897
+ this.handleGroupButtonNavigation(e, item);
2898
+ }
2899
+ };
2900
+ createTooltip(btnContainerEle, this.parent);
2901
+ this.isSelected = false;
2902
+ }
2903
+ }
2904
+ groupButtonClicked(itemIndex, item, grpBtnSettings) {
2905
+ const previousItems = [], selectingItems = [], selectedItems = [];
2906
+ let groupButtonEle;
2907
+ let dropdown;
2908
+ for (let j = 0; j < grpBtnSettings.items.length; j++) {
2909
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j)) {
2910
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.contains('e-active')) {
2911
+ previousItems.push(grpBtnSettings.items[parseInt(j.toString(), 10)]);
2912
+ }
2913
+ }
2914
+ }
2915
+ if (!(document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active'))) {
2916
+ selectingItems.push(grpBtnSettings.items[parseInt(itemIndex.toString(), 10)]);
2917
+ }
2918
+ const eventArgs = {
2919
+ cancel: false, previousItems: previousItems, selectingItems: selectingItems
2920
+ };
2921
+ if (grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].beforeClick) {
2922
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].beforeClick.call(this, eventArgs);
2923
+ }
2924
+ if (eventArgs.cancel) {
2925
+ return;
2926
+ }
2927
+ else {
2928
+ if (grpBtnSettings.selection === RibbonGroupButtonSelection.Single) {
2929
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.contains(RIBBON_MULTIPLE_BUTTON_SELECTION)) {
2930
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.remove(RIBBON_MULTIPLE_BUTTON_SELECTION);
2931
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.add(RIBBON_SINGLE_BUTTON_SELECTION);
2932
+ }
2933
+ for (let j = 0; j < grpBtnSettings.items.length; j++) {
2934
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.contains('e-active')) {
2935
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.remove('e-active');
2936
+ }
2937
+ }
2938
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
2939
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active') && this.parent.activeLayout === 'Simplified') {
2940
+ this.grpBtnIndex = itemIndex;
2941
+ groupButtonEle = document.querySelector('#' + item.id);
2942
+ dropdown = getComponent(groupButtonEle, DropDownButton);
2943
+ dropdown.setProperties({
2944
+ iconCss: grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].iconCss
2945
+ });
2946
+ }
2947
+ }
2948
+ else {
2949
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.contains(RIBBON_SINGLE_BUTTON_SELECTION)) {
2950
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.remove(RIBBON_SINGLE_BUTTON_SELECTION);
2951
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.add(RIBBON_MULTIPLE_BUTTON_SELECTION);
2952
+ }
2953
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
2954
+ let activeEleCount = 0;
2955
+ for (let n = 0; n < grpBtnSettings.items.length; n++) {
2956
+ 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) {
2957
+ this.isSelected = true;
2958
+ activeEleCount++;
2959
+ }
2960
+ }
2961
+ if (this.parent.activeLayout === 'Simplified') {
2962
+ let dropdownIcon = null;
2963
+ let itemsCount = 0;
2964
+ groupButtonEle = document.querySelector('#' + item.id);
2965
+ dropdown = getComponent(groupButtonEle, DropDownButton);
2966
+ if (!this.isSelected) {
2967
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active')) {
2968
+ dropdownIcon = grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].iconCss;
2969
+ }
2970
+ }
2971
+ else {
2972
+ if (activeEleCount === 1 && !(document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active'))) {
2973
+ for (let n = 0; n < grpBtnSettings.items.length; n++) {
2974
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n).classList.contains('e-active')) {
2975
+ dropdownIcon = grpBtnSettings.items[parseInt(n.toString(), 10)].iconCss;
2976
+ }
2977
+ }
2978
+ }
2979
+ }
2980
+ while (itemsCount < grpBtnSettings.items.length && !dropdownIcon) {
2981
+ if (grpBtnSettings.items[parseInt(itemsCount.toString(), 10)].iconCss) {
2982
+ dropdownIcon = grpBtnSettings.items[parseInt(itemsCount.toString(), 10)].iconCss;
2983
+ }
2984
+ itemsCount++;
2985
+ }
2986
+ dropdown.setProperties({ iconCss: dropdownIcon });
2987
+ this.grpBtnIndex = itemIndex;
2988
+ }
2989
+ this.isSelected = false;
2990
+ }
2991
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active')) {
2992
+ selectedItems.push(grpBtnSettings.items[parseInt(itemIndex.toString(), 10)]);
2993
+ }
2994
+ const eventArgs = { previousItems: previousItems, selectedItems: selectedItems };
2995
+ if (grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].click) {
2996
+ grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].click.call(this, eventArgs);
2997
+ }
2998
+ }
2999
+ }
3000
+ /**
3001
+ * updates group button in mode switching
3002
+ *
3003
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3004
+ * @param {HTMLElement} itemElement - Gets the ribbon item element.
3005
+ * @returns {void}
3006
+ * @hidden
3007
+ */
3008
+ switchGroupButton(item, itemElement) {
3009
+ const groupBtnSettings = item.groupButtonSettings;
3010
+ let dropdownIcon = null;
3011
+ let activeEleCount = 0;
3012
+ let itemsCount = 0;
3013
+ if (this.parent.activeLayout === 'Simplified') {
3014
+ const containerEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
3015
+ const buttonEle = this.parent.createElement('button', {
3016
+ id: item.id
3017
+ });
3018
+ itemElement.appendChild(buttonEle);
3019
+ for (let i = 0; i < groupBtnSettings.items.length; i++) {
3020
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i)) {
3021
+ if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i).classList.contains('e-active') && groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
3022
+ dropdownIcon = groupBtnSettings.items[parseInt(i.toString(), 10)].iconCss;
3023
+ }
3024
+ else if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i).classList.contains('e-active') && groupBtnSettings.selection === RibbonGroupButtonSelection.Multiple) {
3025
+ activeEleCount++;
3026
+ if (activeEleCount === 1) {
3027
+ dropdownIcon = groupBtnSettings.items[parseInt(i.toString(), 10)].iconCss;
3028
+ }
3029
+ else if (activeEleCount > 1) {
3030
+ dropdownIcon = null;
3031
+ }
3032
+ }
3033
+ }
3034
+ }
3035
+ while (itemsCount < groupBtnSettings.items.length && !dropdownIcon) {
3036
+ if (groupBtnSettings.items[parseInt(itemsCount.toString(), 10)].iconCss) {
3037
+ dropdownIcon = groupBtnSettings.items[parseInt(itemsCount.toString(), 10)].iconCss;
3038
+ }
3039
+ itemsCount++;
3040
+ }
3041
+ new DropDownButton({
3042
+ iconCss: dropdownIcon,
3043
+ target: containerEle,
3044
+ enableRtl: this.parent.enableRtl,
3045
+ cssClass: 'e-ribbon-dropdown-group-button',
3046
+ disabled: item.disabled
3047
+ }, buttonEle);
3048
+ buttonEle.onclick = buttonEle.onkeydown = () => {
3049
+ if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
3050
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
3051
+ this.grpBtnIndex = 0;
3052
+ }
3053
+ };
3054
+ containerEle.onkeydown = (e) => {
3055
+ if (this.parent.activeLayout === 'Simplified') {
3056
+ this.handleGroupButtonNavigation(e, item);
3057
+ }
3058
+ };
3059
+ createTooltip(containerEle, this.parent);
3060
+ }
3061
+ else {
3062
+ const groupButtonEle = itemElement.querySelector('#' + item.id);
3063
+ const dropdown = getComponent(groupButtonEle, DropDownButton);
3064
+ itemElement.appendChild(dropdown.target);
3065
+ if (groupButtonEle) {
3066
+ dropdown.destroy();
3067
+ remove(groupButtonEle);
3068
+ }
3069
+ }
3070
+ }
3071
+ handleGroupButtonNavigation(e, item) {
3072
+ const groupButtonEle = document.querySelector('#' + item.id);
3073
+ const dropdown = getComponent(groupButtonEle, DropDownButton);
3074
+ const targetEle = dropdown.target;
3075
+ let isOverflowPopup = false;
3076
+ if (this.parent.activeLayout === 'Simplified' && targetEle.closest('.e-ribbon-dropdown-group-button').classList.contains(RIBBON_GROUP_BUTTON_OVERFLOW_POPUP)) {
3077
+ isOverflowPopup = true;
3078
+ }
3079
+ if (e.key === 'Tab') {
3080
+ e.preventDefault();
3081
+ }
3082
+ const groupBtnSettings = item.groupButtonSettings;
3083
+ if ((e.key === 'ArrowRight' && !isOverflowPopup) || (e.key === 'ArrowDown' && isOverflowPopup)) {
3084
+ if (!this.parent.enableRtl || (e.key === 'ArrowDown' && isOverflowPopup)) {
3085
+ this.grpBtnIndex++;
3086
+ if (this.grpBtnIndex < groupBtnSettings.items.length) {
3087
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3088
+ }
3089
+ else {
3090
+ this.grpBtnIndex = 0;
3091
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3092
+ }
3093
+ }
3094
+ else {
3095
+ if (this.grpBtnIndex === 0) {
3096
+ this.grpBtnIndex = groupBtnSettings.items.length - 1;
3097
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3098
+ }
3099
+ else {
3100
+ this.grpBtnIndex--;
3101
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3102
+ }
3103
+ }
3104
+ }
3105
+ else if ((e.key === 'ArrowLeft' && !isOverflowPopup) || (e.key === 'ArrowUp' && isOverflowPopup)) {
3106
+ if (!this.parent.enableRtl || (e.key === 'ArrowUp' && isOverflowPopup)) {
3107
+ if (this.grpBtnIndex === 0) {
3108
+ this.grpBtnIndex = groupBtnSettings.items.length - 1;
3109
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3110
+ }
3111
+ else {
3112
+ this.grpBtnIndex--;
3113
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3114
+ }
3115
+ }
3116
+ else {
3117
+ this.grpBtnIndex++;
3118
+ if (this.grpBtnIndex < groupBtnSettings.items.length) {
3119
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3120
+ }
3121
+ else {
3122
+ this.grpBtnIndex = 0;
3123
+ document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + (this.grpBtnIndex)).focus();
3124
+ }
3125
+ }
3126
+ }
3127
+ }
3128
+ /**
3129
+ * Adds the additional event handlers as the item moved into overflow popup.
3130
+ *
3131
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3132
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
3133
+ * @returns {void}
3134
+ * @hidden
3135
+ */
3136
+ addOverFlowEvents(item, itemEle) {
3137
+ const groupButtonEle = itemEle.querySelector('#' + item.id);
3138
+ const dropdown = getComponent(groupButtonEle, DropDownButton);
3139
+ dropdown.setProperties({ cssClass: dropdown.cssClass + SPACE + RIBBON_GROUP_BUTTON_OVERFLOW_POPUP });
3140
+ const targetEle = dropdown.target;
3141
+ targetEle.onclick = () => {
3142
+ if (this.parent.activeLayout === 'Simplified' && targetEle.closest('.e-ribbon-dropdown-group-button').classList.contains(RIBBON_GROUP_BUTTON_OVERFLOW_POPUP)) {
3143
+ dropdown.element.focus();
3144
+ dropdown.toggle();
3145
+ }
3146
+ };
3147
+ }
3148
+ /**
3149
+ * Removes the additional event handlers as the item moved into overflow popup.
3150
+ *
3151
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3152
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
3153
+ * @returns {void}
3154
+ * @hidden
3155
+ */
3156
+ removeOverFlowEvents(item, itemEle) {
3157
+ const groupButtonEle = itemEle.querySelector('#' + item.id);
3158
+ if (groupButtonEle) {
3159
+ const dropdown = getComponent(groupButtonEle, DropDownButton);
3160
+ let cssClass = dropdown.cssClass.split(SPACE);
3161
+ cssClass = cssClass.filter((value) => value !== RIBBON_GROUP_BUTTON_OVERFLOW_POPUP);
3162
+ dropdown.setProperties({ cssClass: cssClass.join(SPACE) });
3163
+ }
3164
+ }
3165
+ /**
3166
+ * Removes DropDown.
3167
+ *
3168
+ * @param {RibbonItemModel} item - Gets the ribbon item.
3169
+ * @returns {void}
3170
+ * @hidden
3171
+ */
3172
+ destroyDropDown(item) {
3173
+ const groupButtonEle = document.querySelector('#' + item.id);
3174
+ if (groupButtonEle) {
3175
+ const dropdown = getComponent(groupButtonEle, DropDownButton);
3176
+ const tooltip = getComponent(dropdown.target, Tooltip);
3177
+ tooltip.destroy();
3178
+ dropdown.destroy();
3179
+ remove(groupButtonEle);
3180
+ }
3181
+ }
3182
+ /**
3183
+ * Updates the group button size.
3184
+ *
3185
+ * @param {HTMLElement} itemElement - Gets the group button container element.
3186
+ * @param {RibbonItemModel} item - Gets the ribbon item.
3187
+ * @returns {void}
3188
+ * @hidden
3189
+ */
3190
+ updateGroupButtonSize(itemElement, item) {
3191
+ const groupBtnSettings = item.groupButtonSettings;
3192
+ let buttonEle;
3193
+ for (let i = 0; i < groupBtnSettings.items.length; i++) {
3194
+ if (this.parent.activeLayout === 'Classic') {
3195
+ buttonEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
3196
+ }
3197
+ else {
3198
+ buttonEle = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
3199
+ }
3200
+ if (buttonEle) {
3201
+ const buttonObj = getComponent(buttonEle, Button);
3202
+ buttonObj.setProperties({
3203
+ iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left',
3204
+ content: item.activeSize === RibbonItemSize.Small ? '' : groupBtnSettings.items[parseInt(i.toString(), 10)].content
3205
+ });
3206
+ }
3207
+ }
3208
+ }
3209
+ }
3210
+
3211
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3212
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3213
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3214
+ 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;
3215
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3216
+ };
3217
+ var Ribbon_1;
3218
+ /**
3219
+ * The Ribbon Component is a structured layout to manage tools with tabs and groups.
3220
+ */
3221
+ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3222
+ /**
3223
+ * Constructor for creating the widget.
3224
+ *
3225
+ * @param {RibbonModel} options - Specifies the ribbon model
3226
+ * @param {string|HTMLDivElement} element - Specifies the target element
3227
+ */
3228
+ constructor(options, element) {
3229
+ Ribbon_1.Inject(RibbonButton, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonComboBox, RibbonGroupButton);
3230
+ super(options, element);
3231
+ }
3232
+ /**
3233
+ * Initialize the control rendering.
3234
+ *
3235
+ * @returns {void}
3236
+ * @private
3237
+ */
3238
+ render() {
3239
+ this.initialize();
3240
+ }
3241
+ preRender() {
3242
+ this.idIndex = 0;
3243
+ this.tooltipData = [];
3244
+ this.isAddRemove = false;
3245
+ this.keyConfigs = {
3246
+ leftarrow: 'leftarrow',
3247
+ rightarrow: 'rightarrow',
3248
+ tab: 'tab',
3249
+ shiftTab: 'shift+tab'
3250
+ };
3251
+ }
3252
+ /**
3253
+ * Get the properties to be maintained in the persisted state.
3254
+ *
3255
+ * @returns {string} - Persist data
3256
+ */
3257
+ getPersistData() {
3258
+ return this.addOnPersist(['activeLayout']);
3259
+ }
3260
+ /**
3261
+ * Get component name.
3262
+ *
3263
+ * @returns {string} - Module name
3264
+ * @private
3265
+ */
3266
+ getModuleName() {
3267
+ return 'ribbon';
3268
+ }
3269
+ /**
3270
+ * To provide the array of modules needed for component rendering
3271
+ *
3272
+ * @returns {ModuleDeclaration[]} - returns module declaration.
3273
+ * @hidden
3274
+ */
3275
+ requiredModules() {
3276
+ const modules = [];
3277
+ 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] });
3278
+ return modules;
3279
+ }
3280
+ initialize() {
3281
+ this.element.id = this.element.id || getUniqueID('e-' + this.getModuleName());
3282
+ addClass([this.element], ['e-rbn', ...(this.cssClass ? this.cssClass.split(SPACE) : [])]);
3283
+ if (this.enableRtl) {
3284
+ this.element.classList.add(RTL_CSS);
3285
+ }
3286
+ this.element.style.width = formatUnit(this.width);
3287
+ this.renderTabs();
3288
+ if (this.ribbonFileMenuModule) {
3289
+ this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
3290
+ }
3291
+ if (this.ribbonBackstageModule) {
3292
+ this.ribbonBackstageModule.createBackStage(this.backStageMenu);
3293
+ }
3294
+ this.createHelpPaneTemplate();
3295
+ const toolbar = this.tabObj['tbObj'];
3296
+ toolbar.refreshOverflow();
3297
+ createTooltip(this.element, this);
3298
+ this.wireEvents();
3299
+ this.wireKeyboardEvent();
3300
+ this.currentControlIndex = 0;
3301
+ }
3302
+ wireEvents() {
3303
+ EventHandler.add(window, 'resize', this.resizeHandler, this);
3304
+ }
3305
+ wireKeyboardEvent() {
3306
+ this.keyboardModuleRibbon = new KeyboardEvents(this.element, {
3307
+ keyAction: this.keyActionHandler.bind(this),
3308
+ keyConfigs: this.keyConfigs,
3309
+ eventName: 'keydown'
3310
+ });
3311
+ }
3312
+ keyActionHandler(e) {
3313
+ if (((e.key === 'Tab') && (!(e.target.classList.contains('e-tab-wrap')) && !(e.target.classList.contains('e-combobox'))))) {
3314
+ e.preventDefault();
3315
+ }
3316
+ const activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
3317
+ const ribbonControls = activeContent.querySelectorAll('.e-control');
3318
+ const comboBoxElements = activeContent.querySelectorAll('.e-combobox');
3319
+ let comboBoxEle;
3320
+ if (comboBoxElements) {
3321
+ for (let i = 0; i < comboBoxElements.length; i++) {
3322
+ if (comboBoxElements[parseInt(i.toString(), 10)].closest('.e-input-focus')) {
3323
+ comboBoxEle = comboBoxElements[parseInt(i.toString(), 10)];
3324
+ }
3325
+ }
3326
+ }
3327
+ if (comboBoxEle) {
3328
+ for (let i = 0; i < ribbonControls.length; i++) {
3329
+ if (ribbonControls[parseInt(i.toString(), 10)].classList.contains('e-combobox')) {
3330
+ if (ribbonControls[parseInt(i.toString(), 10)].closest('.e-input-focus')) {
3331
+ this.currentControlIndex = i;
3332
+ }
3333
+ }
3334
+ }
3335
+ }
3336
+ if (this.currentControlIndex === 0) {
3337
+ let item = ribbonControls[this.currentControlIndex].closest('.e-ribbon-item');
2684
3338
  while (item && item.classList.contains('e-disabled')) {
2685
3339
  this.currentControlIndex++;
2686
3340
  item = ribbonControls[this.currentControlIndex].closest('.e-ribbon-item');
@@ -2932,7 +3586,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
2932
3586
  this.switchLayout();
2933
3587
  }
2934
3588
  tabCreated() {
2935
- this.addExpandCollapse();
3589
+ if (!this.hideLayoutSwitcher) {
3590
+ this.addExpandCollapse();
3591
+ }
2936
3592
  this.renderInitialTab(this.selectedTab);
2937
3593
  }
2938
3594
  ribbonTabSelected(e) {
@@ -3075,13 +3731,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3075
3731
  if (((item.displayOptions === DisplayMode.Auto) ||
3076
3732
  (item.displayOptions === (DisplayMode.Simplified | DisplayMode.Overflow))) && !isNullOrUndefined(itemContainer)) {
3077
3733
  itemContainer.setAttribute('data-simplified-width', activeContent.offsetWidth.toString());
3078
- this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemContainer, groupContainer);
3734
+ this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemContainer, groupContainer, true);
3079
3735
  if (item.activeSize === RibbonItemSize.Small) {
3080
3736
  const itemEle = itemContainer.querySelector('#' + item.id);
3081
3737
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
3082
3738
  this.setItemSize(itemEle, item);
3083
3739
  }
3084
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
3740
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
3085
3741
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, true);
3086
3742
  }
3087
3743
  }
@@ -3093,7 +3749,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3093
3749
  }
3094
3750
  }
3095
3751
  updatePopupItems(item, itemEle, isGroupOF, isMenu) {
3096
- const dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown) ? DropDownButton : SplitButton);
3752
+ const dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
3097
3753
  const dropDownPopup = dropdown.dropDown;
3098
3754
  // popup is on right if (isGroupOF && isMenu)
3099
3755
  // The position is reversed if RTL is enabled.
@@ -3151,7 +3807,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3151
3807
  break;
3152
3808
  }
3153
3809
  const groupEle = tabContent.querySelector('#' + collection.id);
3154
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
3810
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
3155
3811
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
3156
3812
  }
3157
3813
  groupEle.append(itemContainer);
@@ -3195,8 +3851,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3195
3851
  }
3196
3852
  }
3197
3853
  }
3198
- createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer) {
3854
+ createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
3199
3855
  let overflowButton;
3856
+ const contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
3857
+ const isDisabledGroup = contentEle.querySelector('#' + groupId);
3200
3858
  if (isGroupOF) {
3201
3859
  const overflowDDB = groupContainer.querySelector('#' + groupId + GROUPOF_BUTTON_ID);
3202
3860
  if (!overflowDDB) {
@@ -3207,7 +3865,12 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3207
3865
  else {
3208
3866
  overflowButton = getInstance(overflowDDB, DropDownButton);
3209
3867
  }
3210
- overflowButton.target.append(itemEle);
3868
+ const overflowBtnTarget = overflowButton.target;
3869
+ if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
3870
+ overflowBtnTarget.classList.add('e-disabled');
3871
+ }
3872
+ isResize ? overflowBtnTarget.insertBefore(itemEle, overflowBtnTarget.querySelector('.' + RIBBON_ITEM))
3873
+ : overflowBtnTarget.append(itemEle);
3211
3874
  }
3212
3875
  else {
3213
3876
  if (!this.overflowDDB) {
@@ -3224,9 +3887,12 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3224
3887
  let ofGroupContainer = overflowEle.querySelector('#' + groupId + CONTAINER_ID);
3225
3888
  if (!ofGroupContainer) {
3226
3889
  ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
3890
+ if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
3891
+ ofGroupContainer.classList.add('e-disabled');
3892
+ }
3227
3893
  ofTabContainer.append(ofGroupContainer);
3228
3894
  }
3229
- ofGroupContainer.append(itemEle);
3895
+ isResize ? ofGroupContainer.insertBefore(itemEle, ofGroupContainer.querySelector('.' + RIBBON_ITEM)) : ofGroupContainer.append(itemEle);
3230
3896
  }
3231
3897
  else {
3232
3898
  this.createOfTabContainer(groupId, groupHeader, itemEle, tabIndex);
@@ -3258,6 +3924,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3258
3924
  case 'ComboBox':
3259
3925
  this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
3260
3926
  break;
3927
+ case 'GroupButton':
3928
+ if (this.activeLayout === 'Simplified') {
3929
+ this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle);
3930
+ break;
3931
+ }
3261
3932
  }
3262
3933
  }
3263
3934
  createOfTabContainer(groupId, groupHeader, itemEle, tabIndex) {
@@ -3366,7 +4037,12 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3366
4037
  const ele = activeContent.querySelector('#' + item.id + CONTAINER_ID);
3367
4038
  shrinkEle.appendChild(ele);
3368
4039
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
3369
- this.setItemSize(ele.querySelector('#' + item.id), item);
4040
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
4041
+ this.setItemSize(ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID), item);
4042
+ }
4043
+ else {
4044
+ this.setItemSize(ele.querySelector('#' + item.id), item);
4045
+ }
3370
4046
  }
3371
4047
  };
3372
4048
  const moveCollectionToColumn = (start, end) => {
@@ -3380,7 +4056,12 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3380
4056
  const ele = activeContent.querySelector('#' + collection.id);
3381
4057
  shrinkEle.appendChild(ele);
3382
4058
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Medium }, true);
3383
- this.setItemSize(ele.querySelector('#' + collection.items[0].id), collection.items[0]);
4059
+ if (collection.items[0].type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
4060
+ this.setItemSize(ele.querySelector('#' + collection.items[0].id + RIBBON_GROUP_BUTTON_ID), collection.items[0]);
4061
+ }
4062
+ else {
4063
+ this.setItemSize(ele.querySelector('#' + collection.items[0].id), collection.items[0]);
4064
+ }
3384
4065
  }
3385
4066
  };
3386
4067
  const orientation = group.orientation;
@@ -3470,8 +4151,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3470
4151
  const reduce = (i) => {
3471
4152
  const item = collection.items[parseInt(i.toString(), 10)];
3472
4153
  if (item.displayOptions & DisplayMode.Classic) {
3473
- const ele = activeContent.querySelector('#' + item.id);
4154
+ let ele = activeContent.querySelector('#' + item.id);
3474
4155
  item.setProperties({ activeSize: RibbonItemSize.Small }, true);
4156
+ if (item.type === RibbonItemType.GroupButton) {
4157
+ ele = activeContent.querySelector('#' + item.id + '_grpbtn');
4158
+ }
3475
4159
  this.setItemSize(ele, item);
3476
4160
  }
3477
4161
  };
@@ -3490,8 +4174,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3490
4174
  const reduce = (i) => {
3491
4175
  const collection = group.collections[parseInt(i.toString(), 10)];
3492
4176
  if (collection.items[0].displayOptions & DisplayMode.Classic) {
3493
- const ele = activeContent.querySelector('#' + collection.items[0].id);
4177
+ let ele = activeContent.querySelector('#' + collection.items[0].id);
3494
4178
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Small }, true);
4179
+ if (collection.items[0].type === RibbonItemType.GroupButton) {
4180
+ ele = activeContent.querySelector('#' + collection.items[0].id + RIBBON_GROUP_BUTTON_ID);
4181
+ }
3495
4182
  this.setItemSize(ele, collection.items[0]);
3496
4183
  }
3497
4184
  };
@@ -3591,7 +4278,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3591
4278
  }
3592
4279
  const item = collection.items[parseInt(l.toString(), 10)];
3593
4280
  if (canReduceItem(item)) {
3594
- setWidth(item.id);
4281
+ item.type !== RibbonItemType.GroupButton ? setWidth(item.id) : setWidth(item.id + RIBBON_GROUP_BUTTON_ID);
3595
4282
  reduceItemsToSmall(k, l, l);
3596
4283
  if (!shouldSkip && (tabContent.offsetWidth > activeContent.offsetWidth)) {
3597
4284
  return true;
@@ -3626,8 +4313,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3626
4313
  .groups[parseInt(groupIndex.toString(), 10)].collections[parseInt(collectionIndex.toString(), 10)];
3627
4314
  const item = collection.items[parseInt(index.toString(), 10)];
3628
4315
  if (item.displayOptions & DisplayMode.Classic) {
3629
- const ele = parentEle.id === item.id ? parentEle : parentEle.querySelector('#' + item.id);
4316
+ let ele = parentEle.id === item.id ? parentEle : parentEle.querySelector('#' + item.id);
3630
4317
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
4318
+ if (item.type === RibbonItemType.GroupButton) {
4319
+ ele = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
4320
+ }
3631
4321
  this.setItemSize(ele, item);
3632
4322
  }
3633
4323
  };
@@ -3636,8 +4326,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3636
4326
  .groups[parseInt(groupIndex.toString(), 10)].collections;
3637
4327
  const item = collections[parseInt(i.toString(), 10)].items[0];
3638
4328
  if (item.displayOptions & DisplayMode.Classic) {
3639
- const ele = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id);
4329
+ let ele = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id);
3640
4330
  collections[parseInt(i.toString(), 10)].items[0].setProperties({ activeSize: RibbonItemSize.Medium }, true);
4331
+ if (item.type === RibbonItemType.GroupButton) {
4332
+ ele = activeContent.querySelector('#' + collections[parseInt(i.toString(), 10)].items[0].id + RIBBON_GROUP_BUTTON_ID);
4333
+ }
3641
4334
  this.setItemSize(ele, collections[parseInt(i.toString(), 10)].items[0]);
3642
4335
  }
3643
4336
  };
@@ -3653,7 +4346,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3653
4346
  }
3654
4347
  const item = collection.items[parseInt(l.toString(), 10)];
3655
4348
  if (canExpandItem(item)) {
3656
- const itemEle = activeContent.querySelector('#' + item.id);
4349
+ let itemEle = activeContent.querySelector('#' + item.id);
4350
+ if (item.type === 'GroupButton') {
4351
+ itemEle = activeContent.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
4352
+ }
3657
4353
  const valString = itemEle.getAttribute('data-medium-width');
3658
4354
  const value = valString ? parseInt(valString, 10) : null;
3659
4355
  if (value && (shouldSkip || (tabContent.offsetWidth > value))) {
@@ -3752,10 +4448,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3752
4448
  const item = items[parseInt(i.toString(), 10)];
3753
4449
  if (item.displayOptions & DisplayMode.Classic) {
3754
4450
  const container = parentEle.querySelector('#' + item.id + CONTAINER_ID);
3755
- const ele = container.querySelector('#' + item.id);
4451
+ let ele = container.querySelector('#' + item.id);
3756
4452
  item.setProperties({ activeSize: RibbonItemSize.Large }, true);
4453
+ if (item.type === RibbonItemType.GroupButton) {
4454
+ ele = container.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
4455
+ }
3757
4456
  this.setItemSize(ele, item);
3758
- parentEle.insertAdjacentElement('afterend', container);
4457
+ parentEle.insertAdjacentElement('beforebegin', container);
3759
4458
  }
3760
4459
  };
3761
4460
  reduce(start);
@@ -3774,10 +4473,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3774
4473
  const collection = collections[parseInt(i.toString(), 10)];
3775
4474
  if (collection.items[0].displayOptions & DisplayMode.Classic) {
3776
4475
  const collectionEle = parentEle.querySelector('#' + collection.id);
3777
- const ele = collectionEle.querySelector('#' + collection.items[0].id);
4476
+ let ele = collectionEle.querySelector('#' + collection.items[0].id);
3778
4477
  collection.items[0].setProperties({ activeSize: RibbonItemSize.Large }, true);
4478
+ if (collection.items[0].type === RibbonItemType.GroupButton) {
4479
+ ele = collectionEle.querySelector('#' + collection.items[0].id + RIBBON_GROUP_BUTTON_ID);
4480
+ }
3779
4481
  this.setItemSize(ele, collection.items[0]);
3780
- parentEle.insertAdjacentElement('afterend', collectionEle);
4482
+ parentEle.insertAdjacentElement('beforebegin', collectionEle);
3781
4483
  }
3782
4484
  };
3783
4485
  reduce(start);
@@ -3825,6 +4527,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3825
4527
  }
3826
4528
  return false;
3827
4529
  }
4530
+ handleContentSize(itemEle, isRemoveOverflow) {
4531
+ const itemContainer = itemEle.closest('.' + RIBBON_GROUP_CONTENT);
4532
+ (isRemoveOverflow ? (itemContainer.classList.add(RIBBON_CONTENT_HEIGHT)) : (itemContainer.classList.remove(RIBBON_CONTENT_HEIGHT)));
4533
+ }
3828
4534
  setItemSize(itemEle, item) {
3829
4535
  const itemContainer = itemEle.closest('.' + RIBBON_ITEM);
3830
4536
  if (item.type === RibbonItemType.Button) {
@@ -3840,6 +4546,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3840
4546
  remove(itemEle);
3841
4547
  this.createTemplateContent(item, itemContainer);
3842
4548
  }
4549
+ else if (item.type === RibbonItemType.GroupButton) {
4550
+ this.ribbonGroupButtonModule.updateGroupButtonSize(itemEle, item);
4551
+ }
3843
4552
  itemContainer.classList.remove(RIBBON_CONTENT_HEIGHT, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM);
3844
4553
  if (item.activeSize === RibbonItemSize.Large) {
3845
4554
  itemContainer.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
@@ -3879,6 +4588,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3879
4588
  const item = collection.items[parseInt(k.toString(), 10)];
3880
4589
  const itemEle = collectionEle.querySelector('#' + item.id + CONTAINER_ID);
3881
4590
  if (itemEle !== null) {
4591
+ this.handleContentSize(itemEle);
3882
4592
  this.addOverflowEvents(item, itemEle, dropdown);
3883
4593
  }
3884
4594
  }
@@ -3916,6 +4626,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3916
4626
  const item = collection.items[parseInt(k.toString(), 10)];
3917
4627
  const itemEle = collectionEle.querySelector('#' + item.id + CONTAINER_ID);
3918
4628
  if (itemEle !== null) {
4629
+ this.handleContentSize(itemEle, true);
3919
4630
  this.removeOverflowEvent(item, itemEle);
3920
4631
  }
3921
4632
  }
@@ -4178,6 +4889,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4178
4889
  case 'ComboBox':
4179
4890
  this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
4180
4891
  break;
4892
+ case 'GroupButton':
4893
+ this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
4894
+ break;
4181
4895
  }
4182
4896
  }
4183
4897
  createGroupContainer(groupId, groupHeader) {
@@ -4220,20 +4934,76 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4220
4934
  remove(this.tabObj.element.querySelector('.' + RIBBON_COLLAPSE_BUTTON));
4221
4935
  this.collapseButton = null;
4222
4936
  }
4223
- reRenderTabs() {
4937
+ reRenderTabs(tabs) {
4224
4938
  this.destroyScroll();
4225
4939
  this.checkID(this.tabs, 'tab', this.element.id);
4226
- this.destroyTabItems(this.tabsInternal);
4227
- this.tabsInternal = this.tabs.slice();
4228
- this.validateItemSize();
4229
- const tabItems = this.createTabItems(this.tabs);
4230
- if (this.selectedTab >= this.tabs.length) {
4231
- this.selectedTab = this.tabs.length - 1;
4232
- }
4233
- this.tabObj.setProperties({ items: tabItems, selectedItem: this.selectedTab });
4234
- const contentEle = this.tabObj.items[this.selectedTab].content;
4235
- if (contentEle.innerHTML === '') {
4236
- this.renderInitialTab(this.selectedTab);
4940
+ for (const key in tabs) {
4941
+ const index = parseInt(key, 10);
4942
+ const tab = tabs[parseInt(index.toString(), 10)];
4943
+ let isNewTab = false;
4944
+ for (var j = 0; j < (this.tabObj.items.length); j++) {
4945
+ if (this.tabs[parseInt(index.toString(), 10)].id === this.tabObj.items[parseInt(j.toString(), 10)].id) {
4946
+ isNewTab = true;
4947
+ break;
4948
+ }
4949
+ }
4950
+ if (!isNewTab) {
4951
+ this.destroyTabItems(this.tabsInternal);
4952
+ this.tabsInternal = this.tabs.slice();
4953
+ this.validateItemSize();
4954
+ const tabItems = this.createTabItems(this.tabs);
4955
+ if (this.selectedTab >= this.tabs.length) {
4956
+ this.selectedTab = this.tabs.length - 1;
4957
+ }
4958
+ this.tabObj.setProperties({ items: tabItems, selectedItem: this.selectedTab });
4959
+ break;
4960
+ }
4961
+ else {
4962
+ const groups = this.tabs[parseInt(index.toString(), 10)].groups;
4963
+ const tabEle = this.tabObj.element;
4964
+ const ribbonTab = this.tabs[parseInt(index.toString(), 10)];
4965
+ ribbonTab.setProperties(tab, true);
4966
+ this.setProperties({ groups: this.checkID(ribbonTab.groups, 'group', ribbonTab.id) }, true);
4967
+ this.validateItemSize();
4968
+ const contentEle = this.tabObj.items[parseInt(index.toString(), 10)].content;
4969
+ if (groups) {
4970
+ // Check whether header is passed by the user and sets the updated values.
4971
+ if (tab.header) {
4972
+ this.tabObj.items[parseInt(index.toString(), 10)].header.text.innerText = ribbonTab.header;
4973
+ }
4974
+ // Check whether cssClass is passed by the user, and if it is, then remove the old values.
4975
+ if (tab.cssClass) {
4976
+ if (this.tabObj.items[parseInt(index.toString(), 10)].cssClass) {
4977
+ contentEle.classList.remove(this.tabObj.items[parseInt(index.toString(), 10)].cssClass);
4978
+ tabEle.querySelector('.e-active').classList.remove(this.tabObj.items[parseInt(index.toString(), 10)].cssClass);
4979
+ }
4980
+ contentEle.classList.add(ribbonTab.cssClass);
4981
+ tabEle.querySelector('.e-active').classList.add(ribbonTab.cssClass);
4982
+ }
4983
+ // Check whether group is passed by the user, and if it is, then remove the old values.
4984
+ if (tab.groups) {
4985
+ for (const group of groups) {
4986
+ const dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
4987
+ for (const collection of group.collections) {
4988
+ for (const item of collection.items) {
4989
+ const ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
4990
+ if (ele) {
4991
+ this.destroyFunction(item, ele);
4992
+ }
4993
+ }
4994
+ }
4995
+ if (dropdownElement) {
4996
+ this.ribbonDropDownModule.removeOverFlowDropDown(dropdownElement);
4997
+ }
4998
+ }
4999
+ const groupElements = contentEle.querySelectorAll('.e-ribbon-group');
5000
+ // eslint-disable-next-line @typescript-eslint/tslint/config
5001
+ groupElements.forEach(groupEle => { groupEle.remove(); });
5002
+ const elements = this.createGroups(ribbonTab.groups, index);
5003
+ append(elements, contentEle);
5004
+ }
5005
+ }
5006
+ }
4237
5007
  }
4238
5008
  }
4239
5009
  switchLayout() {
@@ -4311,10 +5081,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4311
5081
  itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
4312
5082
  if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
4313
5083
  this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemEle, groupContainer);
4314
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
5084
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
4315
5085
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
4316
5086
  }
4317
5087
  }
5088
+ if (item.type === RibbonItemType.GroupButton) {
5089
+ this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
5090
+ }
4318
5091
  item.setProperties({ activeSize: size }, true);
4319
5092
  const ele = itemEle.querySelector('#' + item.id);
4320
5093
  this.setItemSize(ele, item);
@@ -4402,14 +5175,20 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4402
5175
  let itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
4403
5176
  if (!itemEle) {
4404
5177
  itemEle = overflowtarget.querySelector('#' + item.id + CONTAINER_ID);
4405
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
5178
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
4406
5179
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
4407
5180
  }
4408
5181
  this.removeOverflowEvent(item, itemEle);
4409
5182
  }
5183
+ if (item.type === RibbonItemType.GroupButton) {
5184
+ this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
5185
+ }
4410
5186
  groupCollection.append(itemEle);
4411
5187
  }
4412
- const ele = groupContainer.querySelector('#' + item.id);
5188
+ let ele = groupContainer.querySelector('#' + item.id);
5189
+ if (item.type === RibbonItemType.GroupButton) {
5190
+ ele = groupContainer.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
5191
+ }
4413
5192
  const itemsize = (item.allowedSizes & RibbonItemSize.Large) ? RibbonItemSize.Large :
4414
5193
  (item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
4415
5194
  item.setProperties({ activeSize: itemsize }, true);
@@ -4575,6 +5354,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4575
5354
  case 'Template':
4576
5355
  this.createTemplateContent(item, itemEle);
4577
5356
  break;
5357
+ case 'GroupButton':
5358
+ this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
5359
+ break;
4578
5360
  }
4579
5361
  }
4580
5362
  createItems(itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
@@ -4622,7 +5404,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4622
5404
  this.createRibbonItem(item, itemEle);
4623
5405
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
4624
5406
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
4625
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton)) {
5407
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
4626
5408
  this.updatePopupItems(item, itemEle, isGroupOF, true);
4627
5409
  }
4628
5410
  }
@@ -4701,51 +5483,71 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4701
5483
  if (this.ribbonFileMenuModule) {
4702
5484
  this.ribbonFileMenuModule.setCommonProperties(commonProp);
4703
5485
  }
5486
+ if (this.ribbonBackstageModule) {
5487
+ this.ribbonBackstageModule.setCommonProperties(commonProp);
5488
+ }
4704
5489
  for (let i = 0; i < this.tabs.length; i++) {
4705
5490
  const tab = this.tabs[parseInt(i.toString(), 10)];
4706
5491
  const contentEle = this.tabObj.items[parseInt(i.toString(), 10)].content;
4707
- for (const group of tab.groups) {
4708
- let dropdownElement;
4709
- let dropdown;
4710
- if (this.activeLayout === RibbonLayout.Classic) {
4711
- dropdownElement = group.isCollapsed ?
4712
- contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
4713
- }
4714
- else {
4715
- dropdownElement = group.enableGroupOverflow ?
4716
- contentEle.querySelector('#' + group.id + GROUPOF_BUTTON_ID) : null;
4717
- dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
4718
- if (dropdown) {
4719
- updateTooltipProp(dropdown.target, commonProp);
4720
- dropdown.setProperties(commonProp);
5492
+ if (contentEle.querySelector('.' + RIBBON_GROUP)) {
5493
+ for (const group of tab.groups) {
5494
+ let dropdownElement;
5495
+ let dropdown;
5496
+ if (this.activeLayout === RibbonLayout.Classic) {
5497
+ dropdownElement = group.isCollapsed ?
5498
+ contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
4721
5499
  }
4722
- }
4723
- for (const collection of group.collections) {
4724
- for (const item of collection.items) {
4725
- let ele = null;
4726
- if (this.activeLayout === RibbonLayout.Classic) {
4727
- if (item.displayOptions & DisplayMode.Classic) {
4728
- ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
4729
- }
5500
+ else {
5501
+ dropdownElement = group.enableGroupOverflow ?
5502
+ contentEle.querySelector('#' + group.id + GROUPOF_BUTTON_ID) : null;
5503
+ dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
5504
+ if (dropdown) {
5505
+ updateTooltipProp(dropdown.target, commonProp);
5506
+ dropdown.setProperties(commonProp);
4730
5507
  }
4731
- else {
4732
- //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
4733
- ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id) : null;
4734
- // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
4735
- if (!ele) {
4736
- ele = dropdown.target.querySelector('#' + item.id);
4737
- if (item.type === 'DropDown') {
4738
- this.updatePopupItems(item, dropdown.target, group.enableGroupOverflow, true);
5508
+ }
5509
+ for (const collection of group.collections) {
5510
+ for (const item of collection.items) {
5511
+ let ele = null;
5512
+ if (this.activeLayout === RibbonLayout.Classic) {
5513
+ if (item.displayOptions & DisplayMode.Classic) {
5514
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : item.type === RibbonItemType.GroupButton ? contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID) : contentEle.querySelector('#' + item.id);
4739
5515
  }
4740
5516
  }
4741
- }
4742
- if (ele) {
4743
- const moduleName = this.getItemModuleName(item);
4744
- if (moduleName !== 'template') {
4745
- updateCommonProperty(ele, moduleName, commonProp);
5517
+ else {
5518
+ //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
5519
+ ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id) : null;
5520
+ // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
5521
+ if (!ele) {
5522
+ ele = dropdown.target.querySelector('#' + item.id);
5523
+ if (item.type === 'DropDown') {
5524
+ this.updatePopupItems(item, dropdown.target, group.enableGroupOverflow, true);
5525
+ }
5526
+ }
4746
5527
  }
4747
- else if (!isNullOrUndefined(commonProp.enableRtl)) {
4748
- ele.classList.toggle(RTL_CSS, commonProp.enableRtl);
5528
+ if (ele) {
5529
+ const moduleName = this.getItemModuleName(item);
5530
+ if (moduleName !== 'template') {
5531
+ if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
5532
+ for (let i = 0; i < item.groupButtonSettings.items.length; i++) {
5533
+ const btnEle = ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
5534
+ updateCommonProperty(btnEle, 'btn', commonProp);
5535
+ }
5536
+ }
5537
+ else if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
5538
+ updateCommonProperty(ele, 'dropdown-btn', commonProp);
5539
+ for (let i = 0; i < item.groupButtonSettings.items.length; i++) {
5540
+ const btnEle = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
5541
+ updateCommonProperty(btnEle, 'btn', commonProp);
5542
+ }
5543
+ }
5544
+ else {
5545
+ updateCommonProperty(ele, moduleName, commonProp);
5546
+ }
5547
+ }
5548
+ else if (!isNullOrUndefined(commonProp.enableRtl)) {
5549
+ ele.classList.toggle(RTL_CSS, commonProp.enableRtl);
5550
+ }
4749
5551
  }
4750
5552
  }
4751
5553
  }
@@ -4788,6 +5590,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4788
5590
  if (item.displayOptions & DisplayMode.Classic) {
4789
5591
  ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) :
4790
5592
  contentEle.querySelector('#' + item.id);
5593
+ if (item.type === RibbonItemType.GroupButton) {
5594
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
5595
+ contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
5596
+ }
4791
5597
  }
4792
5598
  }
4793
5599
  else {
@@ -4822,6 +5628,28 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4822
5628
  if (moduleName === 'colorpicker') {
4823
5629
  this.ribbonColorPickerModule.unwireColorPickerEvents(ele);
4824
5630
  }
5631
+ else if (moduleName === 'group-btn') {
5632
+ if (this.activeLayout === 'Classic') {
5633
+ for (let i = 0; i < item.groupButtonSettings.items.length; i++) {
5634
+ const btnEle = ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
5635
+ if (btnEle) {
5636
+ destroyControl(btnEle, 'btn');
5637
+ }
5638
+ }
5639
+ }
5640
+ else {
5641
+ this.ribbonGroupButtonModule.destroyDropDown(item);
5642
+ }
5643
+ for (let i = 0; i < item.groupButtonSettings.items.length; i++) {
5644
+ if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings) {
5645
+ const groupButtonID = item.id + RIBBON_GROUP_BUTTON_ID + i;
5646
+ const index = getIndex(this.tooltipData, (e) => { return e.id === groupButtonID; });
5647
+ if (index !== -1) {
5648
+ this.tooltipData.splice(index, 1);
5649
+ }
5650
+ }
5651
+ }
5652
+ }
4825
5653
  else if (moduleName !== 'template') {
4826
5654
  destroyControl(ele, moduleName);
4827
5655
  }
@@ -4831,6 +5659,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4831
5659
  this.tooltipData.splice(index, 1);
4832
5660
  }
4833
5661
  }
5662
+ if (item.type === 'GroupButton') {
5663
+ this.ribbonGroupButtonModule.destroyDropDown(item);
5664
+ }
4834
5665
  }
4835
5666
  getItemModuleName(item) {
4836
5667
  switch (item.type) {
@@ -4846,6 +5677,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4846
5677
  return 'colorpicker';
4847
5678
  case 'ComboBox':
4848
5679
  return 'combobox';
5680
+ case 'GroupButton':
5681
+ return 'group-btn';
4849
5682
  default:
4850
5683
  return 'template';
4851
5684
  }
@@ -4879,6 +5712,56 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4879
5712
  const index = getIndex(this.tabs, (e) => { return e.id === tabId; });
4880
5713
  this.setProperties({ selectedTab: index });
4881
5714
  }
5715
+ /**
5716
+ * Shows a specific tab in the ribbon.
5717
+ *
5718
+ * @param {string} tabId - The ID of the tab to be shown.
5719
+ * @returns {void}
5720
+ */
5721
+ showTab(tabId) {
5722
+ this.showHideTab(tabId, false);
5723
+ }
5724
+ /**
5725
+ * Hides a specific tab in the ribbon.
5726
+ *
5727
+ * @param {string} tabId - The ID of the tab to be hidden.
5728
+ * @returns {void}
5729
+ */
5730
+ hideTab(tabId) {
5731
+ this.showHideTab(tabId, true);
5732
+ }
5733
+ showHideTab(tabId, value) {
5734
+ const index = getIndex(this.tabs, (e) => { return e.id === tabId; });
5735
+ if (index === -1) {
5736
+ return;
5737
+ }
5738
+ this.tabObj.hideTab(index, value);
5739
+ }
5740
+ /**
5741
+ * Enables a specific tab in the ribbon.
5742
+ *
5743
+ * @param {string} tabId - The ID of the tab to be enabled.
5744
+ * @returns {void}
5745
+ */
5746
+ enableTab(tabId) {
5747
+ this.enableDisableTab(tabId, true);
5748
+ }
5749
+ /**
5750
+ * Disables a specific tab in the ribbon.
5751
+ *
5752
+ * @param {string} tabId - The ID of the tab to be disabled.
5753
+ * @returns {void}
5754
+ */
5755
+ disableTab(tabId) {
5756
+ this.enableDisableTab(tabId, false);
5757
+ }
5758
+ enableDisableTab(tabId, value) {
5759
+ const index = getIndex(this.tabs, (e) => { return e.id === tabId; });
5760
+ if (index === -1) {
5761
+ return;
5762
+ }
5763
+ this.tabObj.enableTab(index, value);
5764
+ }
4882
5765
  /**
4883
5766
  * Adds the ribbon tab.
4884
5767
  *
@@ -4917,7 +5800,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4917
5800
  const dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
4918
5801
  for (const collection of group.collections) {
4919
5802
  for (const item of collection.items) {
4920
- const ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
5803
+ let ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
5804
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
5805
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
5806
+ contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
5807
+ }
4921
5808
  if (ele) {
4922
5809
  this.destroyFunction(item, ele);
4923
5810
  }
@@ -5039,6 +5926,105 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5039
5926
  this.refreshLayout();
5040
5927
  }
5041
5928
  }
5929
+ /**
5930
+ * Hides a specific group within a ribbon tab.
5931
+ *
5932
+ * @param {string} groupID - The ID of the group to be hidden.
5933
+ * @returns {void}
5934
+ */
5935
+ hideGroup(groupID) {
5936
+ this.showHideGroup(groupID, true);
5937
+ }
5938
+ /**
5939
+ * Shows a specific group within a ribbon tab.
5940
+ *
5941
+ * @param {string} groupID - The ID of the group to be shown.
5942
+ * @returns {void}
5943
+ */
5944
+ showGroup(groupID) {
5945
+ this.showHideGroup(groupID, false);
5946
+ }
5947
+ showHideGroup(groupID, isHidden) {
5948
+ let overflowDDB;
5949
+ let overflowtarget;
5950
+ const itemProp = getGroup(this.tabs, groupID);
5951
+ if (!itemProp) {
5952
+ return;
5953
+ }
5954
+ const contentEle = this.tabObj.items[itemProp.tabIndex].content;
5955
+ const groupEle = contentEle.querySelector('#' + groupID);
5956
+ isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
5957
+ if (this.overflowDDB) {
5958
+ const overflowEle = this.overflowDDB.target;
5959
+ const ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + OVERFLOW_ID);
5960
+ if (itemProp.group.enableGroupOverflow) {
5961
+ const overflowDDBEle = contentEle.querySelector('#' + groupID + GROUPOF_BUTTON_ID);
5962
+ if (overflowDDBEle) {
5963
+ overflowDDB = getInstance(overflowDDBEle, DropDownButton);
5964
+ overflowtarget = overflowDDB.target;
5965
+ }
5966
+ if (overflowtarget) {
5967
+ isHidden ? overflowtarget.classList.add('e-hidden') : overflowtarget.classList.remove('e-hidden');
5968
+ }
5969
+ }
5970
+ else if (ofTabContainer) {
5971
+ const grpContainer = ofTabContainer.querySelector('#' + groupID + CONTAINER_ID);
5972
+ if (grpContainer) {
5973
+ isHidden ? grpContainer.classList.add('e-hidden') : grpContainer.classList.remove('e-hidden');
5974
+ }
5975
+ }
5976
+ }
5977
+ this.refreshLayout();
5978
+ }
5979
+ /**
5980
+ * Disables a specific group within a ribbon tab.
5981
+ *
5982
+ * @param {string} groupID - The ID of the group to be disabled.
5983
+ * @returns {void}
5984
+ */
5985
+ disableGroup(groupID) {
5986
+ this.enableDisableGroup(groupID, true);
5987
+ }
5988
+ /**
5989
+ * Enables a specific group within a ribbon tab.
5990
+ *
5991
+ * @param {string} groupID - The ID of the group to be enabled.
5992
+ * @returns {void}
5993
+ */
5994
+ enableGroup(groupID) {
5995
+ this.enableDisableGroup(groupID, false);
5996
+ }
5997
+ enableDisableGroup(groupID, isDisabled) {
5998
+ let overflowDDB;
5999
+ let overflowtarget;
6000
+ const itemProp = getGroup(this.tabs, groupID);
6001
+ if (!itemProp) {
6002
+ return;
6003
+ }
6004
+ const contentEle = this.tabObj.items[itemProp.tabIndex].content;
6005
+ const groupEle = contentEle.querySelector('#' + groupID);
6006
+ isDisabled ? groupEle.classList.add('e-disabled') : groupEle.classList.remove('e-disabled');
6007
+ if (this.overflowDDB) {
6008
+ const overflowEle = this.overflowDDB.target;
6009
+ const ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + OVERFLOW_ID);
6010
+ if (itemProp.group.enableGroupOverflow) {
6011
+ const overflowDDBEle = contentEle.querySelector('#' + groupID + GROUPOF_BUTTON_ID);
6012
+ if (overflowDDBEle) {
6013
+ overflowDDB = getInstance(overflowDDBEle, DropDownButton);
6014
+ overflowtarget = overflowDDB.target;
6015
+ }
6016
+ if (overflowtarget) {
6017
+ isDisabled ? overflowtarget.classList.add('e-disabled') : overflowtarget.classList.remove('e-disabled');
6018
+ }
6019
+ }
6020
+ else if (ofTabContainer) {
6021
+ const grpContainer = ofTabContainer.querySelector('#' + groupID + CONTAINER_ID);
6022
+ if (grpContainer) {
6023
+ isDisabled ? grpContainer.classList.add('e-disabled') : grpContainer.classList.remove('e-disabled');
6024
+ }
6025
+ }
6026
+ }
6027
+ }
5042
6028
  /**
5043
6029
  * adds the ribbon collection.
5044
6030
  *
@@ -5211,6 +6197,41 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5211
6197
  this.refreshLayout();
5212
6198
  }
5213
6199
  }
6200
+ /**
6201
+ * Hides a specific ribbon item.
6202
+ *
6203
+ * @param {string} itemId - The ID of the item to be hidden.
6204
+ * @returns {void}
6205
+ */
6206
+ hideItem(itemId) {
6207
+ this.showHideItem(itemId, true);
6208
+ }
6209
+ /**
6210
+ * Shows a specific ribbon item.
6211
+ *
6212
+ * @param {string} itemId - The ID of the item to be shown.
6213
+ * @returns {void}
6214
+ */
6215
+ showItem(itemId) {
6216
+ this.showHideItem(itemId, false);
6217
+ }
6218
+ showHideItem(itemId, isHidden) {
6219
+ const itemProp = getItem(this.tabs, itemId);
6220
+ if (!itemProp) {
6221
+ return;
6222
+ }
6223
+ let ele;
6224
+ if (itemProp.item.type === 'GroupButton') {
6225
+ ele = getItemElement(this, itemId + RIBBON_GROUP_BUTTON_ID, itemProp);
6226
+ }
6227
+ else {
6228
+ ele = getItemElement(this, itemId, itemProp);
6229
+ }
6230
+ if (ele) {
6231
+ const itemEle = closest(ele, '.e-ribbon-item');
6232
+ isHidden ? itemEle.classList.add('e-hidden') : itemEle.classList.remove('e-hidden');
6233
+ }
6234
+ }
5214
6235
  /**
5215
6236
  * tab - Gets the ribbon tab to be updated. The id of the tab is a required property. Other properties are optional.
5216
6237
  *
@@ -5240,7 +6261,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5240
6261
  const dropdownElement = group.isCollapsed ? contentEle.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID) : null;
5241
6262
  for (const collection of group.collections) {
5242
6263
  for (const item of collection.items) {
5243
- const ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
6264
+ let ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id) : contentEle.querySelector('#' + item.id);
6265
+ if (item.type === RibbonItemType.GroupButton && this.activeLayout === 'Classic') {
6266
+ ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
6267
+ contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
6268
+ }
5244
6269
  if (ele) {
5245
6270
  this.destroyFunction(item, ele);
5246
6271
  }
@@ -5509,9 +6534,12 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5509
6534
  else {
5510
6535
  itemContainer = groupContainer.querySelector('#' + itemId + CONTAINER_ID);
5511
6536
  itemEle = contentEle.querySelector('#' + itemId);
6537
+ if (itemProp.item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Classic) {
6538
+ itemEle = contentEle.querySelector('#' + itemId + RIBBON_GROUP_BUTTON_ID);
6539
+ }
5512
6540
  if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
5513
6541
  this.createOverflowPopup(itemProp.item, itemProp.tabIndex, itemProp.group.enableGroupOverflow, itemProp.group.id, itemProp.group.header, itemContainer, groupContainer);
5514
- if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton)) {
6542
+ if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
5515
6543
  this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
5516
6544
  }
5517
6545
  }
@@ -5575,6 +6603,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5575
6603
  let ele = null;
5576
6604
  if (this.activeLayout === RibbonLayout.Classic) {
5577
6605
  ele = (item.displayOptions & DisplayMode.Classic) ? contentEle.querySelector('#' + item.id) : null;
6606
+ if (item.type === 'GroupButton') {
6607
+ ele = (item.displayOptions & DisplayMode.Classic) ? contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID) : null;
6608
+ }
5578
6609
  }
5579
6610
  else {
5580
6611
  //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
@@ -5586,7 +6617,12 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5586
6617
  }
5587
6618
  if (ele) {
5588
6619
  this.destroyFunction(item, ele);
5589
- ele.closest('#' + item.id + CONTAINER_ID).remove();
6620
+ if (item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Simplified) {
6621
+ document.getElementById(item.id + CONTAINER_ID).remove();
6622
+ }
6623
+ else {
6624
+ ele.closest('#' + item.id + CONTAINER_ID).remove();
6625
+ }
5590
6626
  }
5591
6627
  }
5592
6628
  /**
@@ -5613,13 +6649,34 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5613
6649
  return;
5614
6650
  }
5615
6651
  itemProp.item.setProperties({ disabled: isDisabled }, true);
5616
- const ele = getItemElement(this, itemId, itemProp);
6652
+ let ele;
6653
+ if (itemProp.item.type === 'GroupButton') {
6654
+ ele = getItemElement(this, itemId + RIBBON_GROUP_BUTTON_ID, itemProp);
6655
+ }
6656
+ else {
6657
+ ele = getItemElement(this, itemId, itemProp);
6658
+ }
5617
6659
  if (ele) {
5618
6660
  const itemEle = closest(ele, '.e-ribbon-item');
5619
6661
  itemEle.classList.toggle(DISABLED_CSS, itemProp.item.disabled);
5620
6662
  const moduleName = this.getItemModuleName(itemProp.item);
5621
6663
  if (moduleName !== 'template') {
5622
- updateControlDisabled(ele, moduleName, isDisabled);
6664
+ if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
6665
+ updateControlDisabled(ele, 'dropdown-btn', isDisabled);
6666
+ for (let i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
6667
+ const btnEle = document.querySelector('#' + itemId + RIBBON_GROUP_BUTTON_ID + i);
6668
+ updateControlDisabled(btnEle, 'btn', isDisabled);
6669
+ }
6670
+ }
6671
+ else if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
6672
+ for (let i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
6673
+ const btnEle = ele.querySelector('#' + itemId + RIBBON_GROUP_BUTTON_ID + i);
6674
+ updateControlDisabled(btnEle, 'btn', isDisabled);
6675
+ }
6676
+ }
6677
+ else {
6678
+ updateControlDisabled(ele, moduleName, isDisabled);
6679
+ }
5623
6680
  }
5624
6681
  else {
5625
6682
  ele.classList.toggle(DISABLED_CSS, isDisabled);
@@ -5635,7 +6692,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5635
6692
  this.keyboardModuleRibbon = null;
5636
6693
  destroyTooltip(this.element);
5637
6694
  this.destroyTabItems(this.tabs);
5638
- this.removeExpandCollapse();
6695
+ if (!this.hideLayoutSwitcher) {
6696
+ this.removeExpandCollapse();
6697
+ }
5639
6698
  this.collapseButton = undefined;
5640
6699
  if (this.scrollModule) {
5641
6700
  this.scrollModule.destroy();
@@ -5729,7 +6788,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5729
6788
  this.tabObj.setProperties({ animation: newProp.tabAnimation });
5730
6789
  break;
5731
6790
  case 'tabs':
5732
- this.reRenderTabs();
6791
+ this.reRenderTabs(newProp.tabs);
5733
6792
  break;
5734
6793
  case 'width':
5735
6794
  this.element.style.width = formatUnit(newProp.width);
@@ -5742,6 +6801,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5742
6801
  const toolbarEle = this.tabObj['tbObj'];
5743
6802
  toolbarEle.refreshOverflow();
5744
6803
  break;
6804
+ case 'backStageMenu':
6805
+ if (this.ribbonBackstageModule) {
6806
+ this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu);
6807
+ }
6808
+ const toolbarElement = this.tabObj['tbObj'];
6809
+ toolbarElement.refreshOverflow();
6810
+ break;
5745
6811
  case 'helpPaneTemplate':
5746
6812
  if (this.ribbonTempEle) {
5747
6813
  remove(this.ribbonTempEle);
@@ -5754,6 +6820,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5754
6820
  const toolbar = this.tabObj['tbObj'];
5755
6821
  toolbar.refreshOverflow();
5756
6822
  break;
6823
+ case 'hideLayoutSwitcher':
6824
+ this.hideLayoutSwitcher ? this.removeExpandCollapse() : this.addExpandCollapse();
6825
+ break;
5757
6826
  }
5758
6827
  }
5759
6828
  }
@@ -5767,6 +6836,9 @@ __decorate([
5767
6836
  __decorate([
5768
6837
  Complex({}, FileMenuSettings)
5769
6838
  ], Ribbon.prototype, "fileMenu", void 0);
6839
+ __decorate([
6840
+ Complex({}, BackStageMenu)
6841
+ ], Ribbon.prototype, "backStageMenu", void 0);
5770
6842
  __decorate([
5771
6843
  Property('')
5772
6844
  ], Ribbon.prototype, "launcherIconCss", void 0);
@@ -5791,6 +6863,9 @@ __decorate([
5791
6863
  __decorate([
5792
6864
  Property('')
5793
6865
  ], Ribbon.prototype, "helpPaneTemplate", void 0);
6866
+ __decorate([
6867
+ Property(false)
6868
+ ], Ribbon.prototype, "hideLayoutSwitcher", void 0);
5794
6869
  __decorate([
5795
6870
  Event()
5796
6871
  ], Ribbon.prototype, "tabSelecting", void 0);
@@ -5806,6 +6881,9 @@ __decorate([
5806
6881
  __decorate([
5807
6882
  Event()
5808
6883
  ], Ribbon.prototype, "launcherIconClick", void 0);
6884
+ __decorate([
6885
+ Event()
6886
+ ], Ribbon.prototype, "created", void 0);
5809
6887
  Ribbon = Ribbon_1 = __decorate([
5810
6888
  NotifyPropertyChanges
5811
6889
  ], Ribbon);
@@ -6125,6 +7203,533 @@ class RibbonFileMenu {
6125
7203
  }
6126
7204
  }
6127
7205
 
7206
+ /**
7207
+ * Defines the items of Ribbon.
7208
+ */
7209
+ class RibbonBackstage extends Component {
7210
+ constructor(parent) {
7211
+ super();
7212
+ this.parent = parent;
7213
+ }
7214
+ /**
7215
+ * @private
7216
+ * @returns {void}
7217
+ */
7218
+ render() {
7219
+ // render code
7220
+ }
7221
+ /**
7222
+ * @private
7223
+ * @returns {void}
7224
+ */
7225
+ preRender() {
7226
+ // pre render code
7227
+ }
7228
+ getPersistData() {
7229
+ return '';
7230
+ }
7231
+ /**
7232
+ * This method is abstract member of the Component<HTMLElement>.
7233
+ *
7234
+ * @private
7235
+ * @returns {void}
7236
+ */
7237
+ onPropertyChanged() {
7238
+ // onProperty changes code
7239
+ }
7240
+ getModuleName() {
7241
+ return 'ribbonBackstage';
7242
+ }
7243
+ destroy() {
7244
+ if (this.backstageButton) {
7245
+ this.destroyDDB();
7246
+ }
7247
+ this.parent = null;
7248
+ }
7249
+ /**
7250
+ * Creates Backstage Menu
7251
+ *
7252
+ * @param {BackStageMenuModel} backStageOptions - Gets the property of backstage.
7253
+ * @returns {void}
7254
+ * @hidden
7255
+ */
7256
+ createBackStage(backStageOptions) {
7257
+ if (!backStageOptions.visible) {
7258
+ return;
7259
+ }
7260
+ this.backstageButtonEle = this.parent.createElement('button', {
7261
+ id: this.parent.element.id + RIBBON_BACKSTAGE_MENU_ID
7262
+ });
7263
+ const tabEle = this.parent.tabObj.element;
7264
+ const toolbarEle = tabEle.querySelector('.e-toolbar');
7265
+ tabEle.insertBefore(this.backstageButtonEle, toolbarEle);
7266
+ this.backstageButton = new Button({
7267
+ content: backStageOptions.text,
7268
+ enableRtl: this.parent.enableRtl,
7269
+ cssClass: RIBBON_BACKSTAGE,
7270
+ created: () => {
7271
+ tabEle.style.setProperty(RIBBON_FILE_MENU_WIDTH, this.backstageButtonEle.offsetWidth + 'px');
7272
+ }
7273
+ }, this.backstageButtonEle);
7274
+ this.createBackStagePopup(backStageOptions);
7275
+ if (this.parent.backStageMenu.template) {
7276
+ this.createBackStageTemplate(this.parent.backStageMenu.template);
7277
+ }
7278
+ else {
7279
+ let footerItemCount = 0;
7280
+ let itemCount = 0;
7281
+ for (let i = 0; i < backStageOptions.items.length; i++) {
7282
+ const item = backStageOptions.items[parseInt(i.toString(), 10)];
7283
+ if (item.isFooter) {
7284
+ footerItemCount++;
7285
+ }
7286
+ else {
7287
+ itemCount++;
7288
+ }
7289
+ }
7290
+ if (itemCount > 0) {
7291
+ this.createBackstageMenu(backStageOptions, false);
7292
+ }
7293
+ if (footerItemCount > 0) {
7294
+ this.createBackstageMenu(backStageOptions, true);
7295
+ }
7296
+ if (this.menuCtrl) {
7297
+ this.checkMenuItems(this.menuCtrl.items);
7298
+ }
7299
+ if (this.footerMenuCtrl) {
7300
+ this.checkMenuItems(this.footerMenuCtrl.items);
7301
+ }
7302
+ }
7303
+ this.backstageButtonEle.onclick = (e) => {
7304
+ e.stopPropagation();
7305
+ this.showBackstage();
7306
+ this.popupHTMLElement.classList.add(RIBBON_BACKSTAGE_OPEN);
7307
+ const menuItem = this.menuWrapper.querySelector('.e-menu-item.e-selected');
7308
+ if (menuItem) {
7309
+ menuItem.classList.remove('e-selected');
7310
+ }
7311
+ for (let i = 0; i < backStageOptions.items.length; i++) {
7312
+ const item = backStageOptions.items[parseInt(i.toString(), 10)];
7313
+ if (!item.isFooter && this.menuCtrl.items[0].text === item.text) {
7314
+ const firstMenuEle = this.popupHTMLElement.querySelector('#' + this.menuCtrl.items[0].id);
7315
+ if (firstMenuEle) {
7316
+ firstMenuEle.classList.add('e-selected');
7317
+ firstMenuEle.focus();
7318
+ }
7319
+ this.createBackStageContent(this.menuCtrl.items[0].id, item.content);
7320
+ break;
7321
+ }
7322
+ else {
7323
+ continue;
7324
+ }
7325
+ }
7326
+ };
7327
+ this.parent.tabObj.refreshActiveTabBorder();
7328
+ this.addBackStageMenuTooltip(backStageOptions);
7329
+ EventHandler.add(document, 'click', this.onClickEvent, this);
7330
+ }
7331
+ onClickEvent(e) {
7332
+ const targetEle = e.target;
7333
+ if (this.popupHTMLElement.contains(targetEle)) {
7334
+ return;
7335
+ }
7336
+ else {
7337
+ this.hideBackstage();
7338
+ }
7339
+ }
7340
+ addBackStageMenuTooltip(backStageOptions) {
7341
+ if (isTooltipPresent(backStageOptions.ribbonTooltipSettings)) {
7342
+ this.backstageButtonEle.classList.add(RIBBON_TOOLTIP_TARGET);
7343
+ this.parent.tooltipData.push({ id: this.backstageButtonEle.id, data: backStageOptions.ribbonTooltipSettings });
7344
+ }
7345
+ }
7346
+ checkMenuItems(backStageItems) {
7347
+ for (let i = 0; i < backStageItems.length; i++) {
7348
+ const item = backStageItems[parseInt(i.toString(), 10)];
7349
+ if (!item.iconCss) {
7350
+ const menuItemEle = this.popupHTMLElement.querySelector('#' + item.id);
7351
+ menuItemEle.classList.add(RIBBON_BACKSTAGE_TEXT_MENU);
7352
+ }
7353
+ }
7354
+ }
7355
+ createBackStagePopup(backStageOptions) {
7356
+ this.popupHTMLElement = this.parent.createElement('div', {
7357
+ id: this.parent.element.id + RIBBON_BACKSTAGE_POPUP_ID,
7358
+ className: RIBBON_BACKSTAGE_POPUP
7359
+ });
7360
+ let targetEle;
7361
+ if (backStageOptions.target) {
7362
+ targetEle = backStageOptions.target instanceof HTMLElement ? backStageOptions.target : document.querySelector(backStageOptions.target);
7363
+ targetEle.appendChild(this.popupHTMLElement);
7364
+ }
7365
+ else {
7366
+ this.parent.element.appendChild(this.popupHTMLElement);
7367
+ }
7368
+ this.popupEle = new Popup(this.popupHTMLElement, {
7369
+ height: backStageOptions.height,
7370
+ width: backStageOptions.width,
7371
+ relateTo: backStageOptions.target || this.parent.element,
7372
+ enableRtl: this.parent.enableRtl
7373
+ });
7374
+ if (this.parent.enableRtl) {
7375
+ this.updatePopupPositionOnRtl(this.parent.enableRtl);
7376
+ }
7377
+ this.popupHTMLElement.onkeydown = (e) => { if (e.code === 'Escape') {
7378
+ this.hideBackstage();
7379
+ } };
7380
+ this.hideBackstage();
7381
+ }
7382
+ updatePopupPositionOnRtl(enableRtl) {
7383
+ const popupStyle = this.popupHTMLElement.style;
7384
+ if (enableRtl) {
7385
+ popupStyle.right = popupStyle.left;
7386
+ popupStyle.left = 'unset';
7387
+ }
7388
+ else {
7389
+ popupStyle.left = popupStyle.right;
7390
+ popupStyle.right = 'unset';
7391
+ }
7392
+ }
7393
+ createBackstageMenu(menuOptions, isFooter) {
7394
+ const wrapperEle = this.popupHTMLElement.querySelector('#' + this.parent.element.id + '_wrapper');
7395
+ if (!wrapperEle) {
7396
+ this.menuWrapper = this.parent.createElement('div', {
7397
+ id: this.parent.element.id + '_wrapper',
7398
+ className: RIBBON_BACKSTAGE_MENU_WRAPPER
7399
+ });
7400
+ this.popupHTMLElement.appendChild(this.menuWrapper);
7401
+ }
7402
+ if (menuOptions.backButton.visible && !isFooter) {
7403
+ const closeBtnEle = this.parent.createElement('button', {
7404
+ id: this.parent.element.id + '_close',
7405
+ className: 'e-ribbon-close-btn'
7406
+ });
7407
+ this.closeBtn = new Button({
7408
+ content: menuOptions.backButton.text,
7409
+ iconCss: menuOptions.backButton.iconCss ? menuOptions.backButton.iconCss : BACKSTAGE_CLOSE_ICON,
7410
+ enableRtl: this.parent.enableRtl
7411
+ }, closeBtnEle);
7412
+ this.menuWrapper.append(closeBtnEle);
7413
+ closeBtnEle.onclick = () => {
7414
+ this.popupHTMLElement.classList.remove(RIBBON_BACKSTAGE_OPEN);
7415
+ this.hideBackstage();
7416
+ this.isBackButtonClicked = true;
7417
+ };
7418
+ }
7419
+ const itemsWrapperEle = this.popupHTMLElement.querySelector('#' + this.parent.element.id + '_itemswrapper');
7420
+ if (!itemsWrapperEle) {
7421
+ this.itemsWrapperEle = this.parent.createElement('div', {
7422
+ id: this.parent.element.id + '_itemswrapper',
7423
+ className: RIBBON_BACKSTAGE_ITEMS_WRAPPER
7424
+ });
7425
+ this.menuWrapper.append(this.itemsWrapperEle);
7426
+ }
7427
+ let ulFooterElem;
7428
+ if (isFooter) {
7429
+ ulFooterElem = this.parent.createElement('ul', {
7430
+ id: this.parent.element.id + RIBBON_FOOTER_MENU_LIST
7431
+ });
7432
+ this.itemsWrapperEle.appendChild(ulFooterElem);
7433
+ }
7434
+ else {
7435
+ this.ulMenuElem = this.parent.createElement('ul', {
7436
+ id: this.parent.element.id + RIBBON_MENU_LIST
7437
+ });
7438
+ this.itemsWrapperEle.appendChild(this.ulMenuElem);
7439
+ }
7440
+ if (!isFooter) {
7441
+ this.menuCtrl = new Menu({
7442
+ orientation: 'Vertical',
7443
+ enableRtl: this.parent.enableRtl,
7444
+ cssClass: RIBBON_BACKSTAGE_MENU,
7445
+ items: this.cloneMenuItem(menuOptions.items),
7446
+ select: this.menuSelect.bind(this, menuOptions)
7447
+ }, this.ulMenuElem);
7448
+ }
7449
+ else {
7450
+ this.footerMenuCtrl = new Menu({
7451
+ orientation: 'Vertical',
7452
+ enableRtl: this.parent.enableRtl,
7453
+ cssClass: RIBBON_BACKSTAGE_MENU,
7454
+ items: this.cloneFooterMenuItem(menuOptions.items),
7455
+ select: this.menuSelect.bind(this, menuOptions)
7456
+ }, ulFooterElem);
7457
+ }
7458
+ }
7459
+ cloneMenuItem(items) {
7460
+ const itemsList = [];
7461
+ for (let i = 0; i < items.length; i++) {
7462
+ const item = items[parseInt(i.toString(), 10)];
7463
+ if (item.isFooter) {
7464
+ continue;
7465
+ }
7466
+ else {
7467
+ itemsList.push({
7468
+ id: item.id,
7469
+ iconCss: item.iconCss,
7470
+ separator: item.separator,
7471
+ text: item.text
7472
+ });
7473
+ }
7474
+ }
7475
+ return itemsList;
7476
+ }
7477
+ cloneFooterMenuItem(items) {
7478
+ const itemsList = [];
7479
+ for (let i = 0; i < items.length; i++) {
7480
+ const item = items[parseInt(i.toString(), 10)];
7481
+ if (!item.isFooter) {
7482
+ continue;
7483
+ }
7484
+ else {
7485
+ itemsList.push({
7486
+ id: item.id,
7487
+ iconCss: item.iconCss,
7488
+ separator: item.separator,
7489
+ text: item.text
7490
+ });
7491
+ }
7492
+ }
7493
+ return itemsList;
7494
+ }
7495
+ createBackStageContent(itemId, content) {
7496
+ const templateName = 'backstageContent';
7497
+ this.clearTemplate([templateName]);
7498
+ if (!this.backstageContentEle) {
7499
+ this.backstageContentEle = this.parent.createElement('div', {
7500
+ id: itemId + CONTENT_ID,
7501
+ className: RIBBON_BACKSTAGE_CONTENT
7502
+ });
7503
+ }
7504
+ else {
7505
+ this.backstageContentEle.innerHTML = '';
7506
+ this.backstageContentEle.id = itemId + CONTENT_ID;
7507
+ }
7508
+ const templateFunction = getTemplateFunction(content);
7509
+ append(templateFunction({}, this, templateName, 'backstageContent', this.parent.isStringTemplate), this.backstageContentEle);
7510
+ if (content) {
7511
+ this.popupHTMLElement.append(this.backstageContentEle);
7512
+ }
7513
+ this.renderReactTemplates();
7514
+ return templateFunction;
7515
+ }
7516
+ createBackStageTemplate(template) {
7517
+ const templateName = 'backstageTemplate';
7518
+ this.clearTemplate([templateName]);
7519
+ this.backstageTempEle = this.parent.createElement('div', {
7520
+ id: this.parent.element.id + RIBBON_BACKSTAGE_MENU_ID + '_template',
7521
+ className: RIBBON_BACKSTAGE_TEMPLATE
7522
+ });
7523
+ const templateFunction = getTemplateFunction(template);
7524
+ append(templateFunction({}, this, templateName, 'backstageTemplate', this.parent.isStringTemplate), this.backstageTempEle);
7525
+ this.popupHTMLElement.append(this.backstageTempEle);
7526
+ this.renderReactTemplates();
7527
+ return templateFunction;
7528
+ }
7529
+ menuSelect(menuOptions, args) {
7530
+ for (let i = 0; i < menuOptions.items.length; i++) {
7531
+ const item = menuOptions.items[parseInt(i.toString(), 10)];
7532
+ if (item.text === args.item.text) {
7533
+ this.contentItem = item;
7534
+ break;
7535
+ }
7536
+ }
7537
+ this.createBackStageContent(args.item.id, this.contentItem.content);
7538
+ const eventArgs = { cancel: false, target: args.element, item: this.contentItem, isBackButton: this.isBackButtonClicked };
7539
+ if (this.contentItem.backStageItemClick) {
7540
+ this.contentItem.backStageItemClick.call(this, eventArgs);
7541
+ }
7542
+ if (eventArgs.cancel) {
7543
+ return;
7544
+ }
7545
+ }
7546
+ /**
7547
+ * setRtl
7548
+ *
7549
+ * @param {commonProperties} commonProp - Get the common property of ribbon.
7550
+ * @returns {void}
7551
+ * @hidden
7552
+ */
7553
+ setCommonProperties(commonProp) {
7554
+ if (this.backstageButton) {
7555
+ this.backstageButton.setProperties(commonProp);
7556
+ if (this.popupEle) {
7557
+ this.popupEle.setProperties(commonProp);
7558
+ if (this.popupHTMLElement)
7559
+ this.updatePopupPositionOnRtl(commonProp.enableRtl);
7560
+ if (this.menuCtrl) {
7561
+ this.menuCtrl.setProperties(commonProp);
7562
+ if (this.closeBtn) {
7563
+ this.closeBtn.setProperties(commonProp);
7564
+ }
7565
+ }
7566
+ }
7567
+ }
7568
+ }
7569
+ /**
7570
+ * Update Backstage menu
7571
+ *
7572
+ * @param {BackStageMenuModel} backStageOptions - Gets the property of backstage menu.
7573
+ * @returns {void}
7574
+ * @hidden
7575
+ */
7576
+ updateBackStageMenu(backStageOptions) {
7577
+ if (backStageOptions.visible) {
7578
+ if (this.backstageButton) {
7579
+ if (backStageOptions.text) {
7580
+ this.backstageButton.setProperties({
7581
+ content: backStageOptions.text
7582
+ });
7583
+ this.parent.tabObj.element.style.setProperty(RIBBON_FILE_MENU_WIDTH, this.backstageButtonEle.offsetWidth + 'px');
7584
+ }
7585
+ if (this.popupEle) {
7586
+ this.popupEle.setProperties({
7587
+ height: backStageOptions.height,
7588
+ width: backStageOptions.width,
7589
+ target: backStageOptions.target || this.parent.element,
7590
+ });
7591
+ }
7592
+ if (backStageOptions.template) {
7593
+ if (this.backstageTempEle) {
7594
+ remove(this.backstageTempEle);
7595
+ this.backstageTempEle = null;
7596
+ }
7597
+ this.createBackStageTemplate(backStageOptions.template);
7598
+ }
7599
+ else {
7600
+ if (this.menuCtrl) {
7601
+ this.menuCtrl.setProperties({
7602
+ items: this.cloneMenuItem(backStageOptions.items)
7603
+ });
7604
+ }
7605
+ if (this.footerMenuCtrl) {
7606
+ this.footerMenuCtrl.setProperties({
7607
+ items: this.cloneFooterMenuItem(backStageOptions.items)
7608
+ });
7609
+ }
7610
+ else {
7611
+ let footerItemCount = 0;
7612
+ let itemCount = 0;
7613
+ for (let i = 0; i < backStageOptions.items.length; i++) {
7614
+ const item = backStageOptions.items[parseInt(i.toString(), 10)];
7615
+ if (item.isFooter) {
7616
+ footerItemCount++;
7617
+ }
7618
+ else {
7619
+ itemCount++;
7620
+ }
7621
+ }
7622
+ if (itemCount > 0) {
7623
+ this.createBackstageMenu(backStageOptions, false);
7624
+ }
7625
+ if (footerItemCount > 0) {
7626
+ this.createBackstageMenu(backStageOptions, true);
7627
+ }
7628
+ }
7629
+ }
7630
+ this.removeBackstageMenuTooltip();
7631
+ this.addBackStageMenuTooltip(backStageOptions);
7632
+ }
7633
+ else {
7634
+ this.createBackStage(backStageOptions);
7635
+ }
7636
+ }
7637
+ else if (this.backstageButton) {
7638
+ this.destroyDDB();
7639
+ }
7640
+ this.parent.tabObj.refreshActiveTabBorder();
7641
+ }
7642
+ destroyMenu() {
7643
+ if (this.menuCtrl) {
7644
+ this.menuCtrl.destroy();
7645
+ this.menuCtrl = null;
7646
+ }
7647
+ }
7648
+ destroyDDB() {
7649
+ this.removeBackstageMenuTooltip();
7650
+ const tabEle = this.parent.tabObj.element;
7651
+ tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
7652
+ this.destroyMenu();
7653
+ this.backstageButton.destroy();
7654
+ this.backstageButton = null;
7655
+ remove(this.backstageButtonEle);
7656
+ this.backstageButtonEle = null;
7657
+ EventHandler.remove(document, 'click', this.onClickEvent);
7658
+ }
7659
+ removeBackstageMenuTooltip() {
7660
+ const index = getIndex(this.parent.tooltipData, (e) => { return e.id === this.backstageButtonEle.id; });
7661
+ if (index !== -1) {
7662
+ this.backstageButtonEle.classList.remove(RIBBON_TOOLTIP_TARGET);
7663
+ this.parent.tooltipData.splice(index, 1);
7664
+ }
7665
+ }
7666
+ /**
7667
+ * Add items to Backstage Menu.
7668
+ *
7669
+ * @param {BackstageItemModel[]} items - Gets the items to be added.
7670
+ * @param {string} target - Gets the target item to add the items.
7671
+ * @param {boolean} isAfter - Gets the boolean value to add the items after or before the target item.
7672
+ * @param {boolean} isUniqueId - Gets whether the target provided is uniqueId or not.
7673
+ * @returns {void}
7674
+ */
7675
+ addBackstageItems(items, target, isAfter, isUniqueId) {
7676
+ for (let i = 0; i < items.length; i++) {
7677
+ const item = items[parseInt(i.toString(), 10)];
7678
+ if (item.isFooter) {
7679
+ isAfter ? this.footerMenuCtrl.insertAfter(items, target, isUniqueId) : this.footerMenuCtrl.insertBefore(items, target, isUniqueId);
7680
+ }
7681
+ else {
7682
+ isAfter ? this.menuCtrl.insertAfter(items, target, isUniqueId) : this.menuCtrl.insertBefore(items, target, isUniqueId);
7683
+ }
7684
+ }
7685
+ const backstageItems = [].concat(this.menuCtrl.items, this.footerMenuCtrl.items);
7686
+ const backStageOptions = this.parent.backStageMenu;
7687
+ for (let i = 0; i < backStageOptions.items.length; i++) {
7688
+ const item = backStageOptions.items[parseInt(i.toString(), 10)];
7689
+ for (let i = 0; i < backstageItems.length; i++) {
7690
+ const item1 = backstageItems[parseInt(i.toString(), 10)];
7691
+ if (item.text === item1.text) {
7692
+ item1.content = item.content;
7693
+ break;
7694
+ }
7695
+ }
7696
+ }
7697
+ this.parent.backStageMenu.setProperties({ items: backstageItems }, true);
7698
+ }
7699
+ /**
7700
+ * Remove items from Backstage Menu.
7701
+ *
7702
+ * @param {string[]} items - Gets the items to be removed.
7703
+ * @param {boolean} isUniqueId - Gets whether the target provided is uniqueId or not.
7704
+ * @returns {void}
7705
+ */
7706
+ removeBackstageItems(items, isUniqueId) {
7707
+ this.menuCtrl.removeItems(items, isUniqueId);
7708
+ this.footerMenuCtrl.removeItems(items, isUniqueId);
7709
+ const backstageItems = [].concat(this.menuCtrl.items, this.footerMenuCtrl.items);
7710
+ this.parent.backStageMenu.setProperties({ items: backstageItems }, true);
7711
+ }
7712
+ /**
7713
+ * Renders the backstage dynamically.
7714
+ *
7715
+ * @returns {void}
7716
+ */
7717
+ showBackstage() {
7718
+ this.popupEle.show();
7719
+ }
7720
+ /**
7721
+ * Hides the backstage dynamically.
7722
+ *
7723
+ * @returns {void}
7724
+ */
7725
+ hideBackstage() {
7726
+ if (this.popupEle.element.classList.contains(RIBBON_BACKSTAGE_OPEN)) {
7727
+ this.popupEle.element.classList.remove(RIBBON_BACKSTAGE_OPEN);
7728
+ }
7729
+ this.popupEle.hide();
7730
+ }
7731
+ }
7732
+
6128
7733
  /**
6129
7734
  * Ribbon modules
6130
7735
  */
@@ -6132,5 +7737,5 @@ class RibbonFileMenu {
6132
7737
  // export all modules from current location
6133
7738
  // example: export * from './module'
6134
7739
 
6135
- 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 };
7740
+ 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 };
6136
7741
  //# sourceMappingURL=ej2-ribbon.es2015.js.map