@syncfusion/ej2-ribbon 24.2.8 → 25.1.35

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 (125) hide show
  1. package/CHANGELOG.md +5 -9
  2. package/README.md +3 -0
  3. package/dist/ej2-ribbon.umd.min.js +2 -2
  4. package/dist/ej2-ribbon.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-ribbon.es2015.js +2051 -137
  6. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  7. package/dist/es6/ej2-ribbon.es5.js +2180 -146
  8. package/dist/es6/ej2-ribbon.es5.js.map +1 -1
  9. package/dist/global/ej2-ribbon.min.js +2 -2
  10. package/dist/global/ej2-ribbon.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/global.js +1 -1
  14. package/src/ribbon/base/constant.d.ts +8 -0
  15. package/src/ribbon/base/constant.js +8 -0
  16. package/src/ribbon/base/interface.d.ts +114 -1
  17. package/src/ribbon/base/interface.js +4 -0
  18. package/src/ribbon/base/ribbon-model.d.ts +22 -1
  19. package/src/ribbon/base/ribbon.d.ts +67 -5
  20. package/src/ribbon/base/ribbon.js +457 -76
  21. package/src/ribbon/base/utils.d.ts +3 -2
  22. package/src/ribbon/base/utils.js +3 -2
  23. package/src/ribbon/items/index.d.ts +1 -0
  24. package/src/ribbon/items/index.js +1 -0
  25. package/src/ribbon/items/ribbon-colorpicker.js +6 -1
  26. package/src/ribbon/items/ribbon-gallery.d.ts +87 -0
  27. package/src/ribbon/items/ribbon-gallery.js +712 -0
  28. package/src/ribbon/items/ribbon-groupbutton.js +3 -0
  29. package/src/ribbon/models/index.d.ts +8 -0
  30. package/src/ribbon/models/index.js +4 -0
  31. package/src/ribbon/models/ribbon-back-stage-settings-model.d.ts +7 -0
  32. package/src/ribbon/models/ribbon-back-stage-settings.d.ts +6 -0
  33. package/src/ribbon/models/ribbon-back-stage-settings.js +3 -0
  34. package/src/ribbon/models/ribbon-backstage-item-model.d.ts +7 -0
  35. package/src/ribbon/models/ribbon-backstage-item.d.ts +6 -0
  36. package/src/ribbon/models/ribbon-backstage-item.js +3 -0
  37. package/src/ribbon/models/ribbon-contextual-tab-settings-model.d.ts +30 -0
  38. package/src/ribbon/models/ribbon-contextual-tab-settings.d.ts +33 -0
  39. package/src/ribbon/models/ribbon-contextual-tab-settings.js +50 -0
  40. package/src/ribbon/models/ribbon-file-menu-settings-model.d.ts +7 -0
  41. package/src/ribbon/models/ribbon-file-menu-settings.d.ts +6 -0
  42. package/src/ribbon/models/ribbon-file-menu-settings.js +3 -0
  43. package/src/ribbon/models/ribbon-gallery-group-model.d.ts +44 -0
  44. package/src/ribbon/models/ribbon-gallery-group.d.ts +38 -0
  45. package/src/ribbon/models/ribbon-gallery-group.js +47 -0
  46. package/src/ribbon/models/ribbon-gallery-item-model.d.ts +43 -0
  47. package/src/ribbon/models/ribbon-gallery-item.d.ts +38 -0
  48. package/src/ribbon/models/ribbon-gallery-item.js +46 -0
  49. package/src/ribbon/models/ribbon-gallery-settings-model.d.ts +108 -0
  50. package/src/ribbon/models/ribbon-gallery-settings.d.ts +95 -0
  51. package/src/ribbon/models/ribbon-gallery-settings.js +71 -0
  52. package/src/ribbon/models/ribbon-group-button-item-model.d.ts +7 -0
  53. package/src/ribbon/models/ribbon-group-button-item.d.ts +6 -0
  54. package/src/ribbon/models/ribbon-group-button-item.js +3 -0
  55. package/src/ribbon/models/ribbon-group-model.d.ts +14 -0
  56. package/src/ribbon/models/ribbon-group.d.ts +12 -0
  57. package/src/ribbon/models/ribbon-group.js +6 -0
  58. package/src/ribbon/models/ribbon-item-model.d.ts +15 -1
  59. package/src/ribbon/models/ribbon-item.d.ts +13 -0
  60. package/src/ribbon/models/ribbon-item.js +7 -0
  61. package/src/ribbon/models/ribbon-tab-model.d.ts +7 -0
  62. package/src/ribbon/models/ribbon-tab.d.ts +6 -0
  63. package/src/ribbon/models/ribbon-tab.js +3 -0
  64. package/src/ribbon/modules/index.d.ts +2 -0
  65. package/src/ribbon/modules/index.js +2 -0
  66. package/src/ribbon/modules/ribbon-backstage.d.ts +2 -0
  67. package/src/ribbon/modules/ribbon-backstage.js +37 -0
  68. package/src/ribbon/modules/ribbon-contextualtab.d.ts +27 -0
  69. package/src/ribbon/modules/ribbon-contextualtab.js +90 -0
  70. package/src/ribbon/modules/ribbon-filemenu.d.ts +2 -0
  71. package/src/ribbon/modules/ribbon-filemenu.js +19 -0
  72. package/src/ribbon/modules/ribbon-keytip.d.ts +54 -0
  73. package/src/ribbon/modules/ribbon-keytip.js +554 -0
  74. package/styles/bootstrap-dark.css +398 -24
  75. package/styles/bootstrap.css +389 -15
  76. package/styles/bootstrap4.css +398 -24
  77. package/styles/bootstrap5-dark.css +391 -17
  78. package/styles/bootstrap5.css +391 -17
  79. package/styles/fabric-dark.css +390 -16
  80. package/styles/fabric.css +387 -13
  81. package/styles/fluent-dark.css +389 -15
  82. package/styles/fluent.css +389 -15
  83. package/styles/highcontrast-light.css +381 -7
  84. package/styles/highcontrast.css +390 -16
  85. package/styles/material-dark.css +391 -17
  86. package/styles/material.css +391 -17
  87. package/styles/material3-dark.css +389 -15
  88. package/styles/material3.css +389 -15
  89. package/styles/ribbon/_bds-definition.scss +360 -0
  90. package/styles/ribbon/_bootstrap-dark-definition.scss +81 -6
  91. package/styles/ribbon/_bootstrap-definition.scss +81 -6
  92. package/styles/ribbon/_bootstrap4-definition.scss +82 -7
  93. package/styles/ribbon/_bootstrap5-definition.scss +81 -6
  94. package/styles/ribbon/_fabric-dark-definition.scss +79 -4
  95. package/styles/ribbon/_fabric-definition.scss +78 -3
  96. package/styles/ribbon/_fluent-definition.scss +80 -5
  97. package/styles/ribbon/_fusionnew-definition.scss +76 -1
  98. package/styles/ribbon/_highcontrast-definition.scss +80 -5
  99. package/styles/ribbon/_highcontrast-light-definition.scss +76 -1
  100. package/styles/ribbon/_layout.scss +344 -38
  101. package/styles/ribbon/_material-dark-definition.scss +80 -5
  102. package/styles/ribbon/_material-definition.scss +81 -6
  103. package/styles/ribbon/_material3-definition.scss +80 -5
  104. package/styles/ribbon/_tailwind-definition.scss +80 -5
  105. package/styles/ribbon/_theme.scss +71 -0
  106. package/styles/ribbon/bootstrap-dark.css +398 -24
  107. package/styles/ribbon/bootstrap.css +389 -15
  108. package/styles/ribbon/bootstrap4.css +398 -24
  109. package/styles/ribbon/bootstrap5-dark.css +391 -17
  110. package/styles/ribbon/bootstrap5.css +391 -17
  111. package/styles/ribbon/fabric-dark.css +390 -16
  112. package/styles/ribbon/fabric.css +387 -13
  113. package/styles/ribbon/fluent-dark.css +389 -15
  114. package/styles/ribbon/fluent.css +389 -15
  115. package/styles/ribbon/highcontrast-light.css +381 -7
  116. package/styles/ribbon/highcontrast.css +390 -16
  117. package/styles/ribbon/icons/_bds.scss +9 -0
  118. package/styles/ribbon/material-dark.css +391 -17
  119. package/styles/ribbon/material.css +391 -17
  120. package/styles/ribbon/material3-dark.css +389 -15
  121. package/styles/ribbon/material3.css +389 -15
  122. package/styles/ribbon/tailwind-dark.css +390 -16
  123. package/styles/ribbon/tailwind.css +390 -16
  124. package/styles/tailwind-dark.css +390 -16
  125. package/styles/tailwind.css +390 -16
@@ -111,6 +111,10 @@ var RibbonItemType;
111
111
  * Renders the group button content as ribbon item.
112
112
  */
113
113
  RibbonItemType["GroupButton"] = "GroupButton";
114
+ /**
115
+ * Renders the gallery as ribbon item.
116
+ */
117
+ RibbonItemType["Gallery"] = "Gallery";
114
118
  /**
115
119
  * Renders the template content as ribbon item.
116
120
  */
@@ -728,6 +732,9 @@ var RibbonGroupButtonItem = /** @__PURE__ @class */ (function (_super) {
728
732
  __decorate$13([
729
733
  Property('')
730
734
  ], RibbonGroupButtonItem.prototype, "iconCss", void 0);
735
+ __decorate$13([
736
+ Property('')
737
+ ], RibbonGroupButtonItem.prototype, "keyTip", void 0);
731
738
  __decorate$13([
732
739
  Complex({}, RibbonTooltip)
733
740
  ], RibbonGroupButtonItem.prototype, "ribbonTooltipSettings", void 0);
@@ -785,6 +792,165 @@ var RibbonGroupButtonSettings = /** @__PURE__ @class */ (function (_super) {
785
792
  return RibbonGroupButtonSettings;
786
793
  }(ChildProperty));
787
794
 
795
+ var __extends$16 = (undefined && undefined.__extends) || (function () {
796
+ var extendStatics = function (d, b) {
797
+ extendStatics = Object.setPrototypeOf ||
798
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
799
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
800
+ return extendStatics(d, b);
801
+ };
802
+ return function (d, b) {
803
+ extendStatics(d, b);
804
+ function __() { this.constructor = d; }
805
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
806
+ };
807
+ })();
808
+ var __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
809
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
810
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
811
+ 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;
812
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
813
+ };
814
+ /**
815
+ * Defines the ribbon gallery item.
816
+ */
817
+ var RibbonGalleryItem = /** @__PURE__ @class */ (function (_super) {
818
+ __extends$16(RibbonGalleryItem, _super);
819
+ function RibbonGalleryItem() {
820
+ return _super !== null && _super.apply(this, arguments) || this;
821
+ }
822
+ __decorate$16([
823
+ Property('')
824
+ ], RibbonGalleryItem.prototype, "content", void 0);
825
+ __decorate$16([
826
+ Property('')
827
+ ], RibbonGalleryItem.prototype, "iconCss", void 0);
828
+ __decorate$16([
829
+ Property({})
830
+ ], RibbonGalleryItem.prototype, "htmlAttributes", void 0);
831
+ __decorate$16([
832
+ Property('')
833
+ ], RibbonGalleryItem.prototype, "cssClass", void 0);
834
+ __decorate$16([
835
+ Property(false)
836
+ ], RibbonGalleryItem.prototype, "disabled", void 0);
837
+ return RibbonGalleryItem;
838
+ }(ChildProperty));
839
+
840
+ var __extends$15 = (undefined && undefined.__extends) || (function () {
841
+ var extendStatics = function (d, b) {
842
+ extendStatics = Object.setPrototypeOf ||
843
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
844
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
845
+ return extendStatics(d, b);
846
+ };
847
+ return function (d, b) {
848
+ extendStatics(d, b);
849
+ function __() { this.constructor = d; }
850
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
851
+ };
852
+ })();
853
+ var __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
854
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
855
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
856
+ 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;
857
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
858
+ };
859
+ /**
860
+ * Defines the ribbon gallery group.
861
+ */
862
+ var RibbonGalleryGroup = /** @__PURE__ @class */ (function (_super) {
863
+ __extends$15(RibbonGalleryGroup, _super);
864
+ function RibbonGalleryGroup() {
865
+ return _super !== null && _super.apply(this, arguments) || this;
866
+ }
867
+ __decorate$15([
868
+ Collection([], RibbonGalleryItem)
869
+ ], RibbonGalleryGroup.prototype, "items", void 0);
870
+ __decorate$15([
871
+ Property('')
872
+ ], RibbonGalleryGroup.prototype, "header", void 0);
873
+ __decorate$15([
874
+ Property('auto')
875
+ ], RibbonGalleryGroup.prototype, "itemWidth", void 0);
876
+ __decorate$15([
877
+ Property('auto')
878
+ ], RibbonGalleryGroup.prototype, "itemHeight", void 0);
879
+ __decorate$15([
880
+ Property('')
881
+ ], RibbonGalleryGroup.prototype, "cssClass", void 0);
882
+ return RibbonGalleryGroup;
883
+ }(ChildProperty));
884
+
885
+ var __extends$14 = (undefined && undefined.__extends) || (function () {
886
+ var extendStatics = function (d, b) {
887
+ extendStatics = Object.setPrototypeOf ||
888
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
889
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
890
+ return extendStatics(d, b);
891
+ };
892
+ return function (d, b) {
893
+ extendStatics(d, b);
894
+ function __() { this.constructor = d; }
895
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
896
+ };
897
+ })();
898
+ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
899
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
900
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
901
+ 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;
902
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
903
+ };
904
+ /**
905
+ * Defines the ribbon gallery settings.
906
+ */
907
+ var RibbonGallerySettings = /** @__PURE__ @class */ (function (_super) {
908
+ __extends$14(RibbonGallerySettings, _super);
909
+ function RibbonGallerySettings() {
910
+ return _super !== null && _super.apply(this, arguments) || this;
911
+ }
912
+ __decorate$14([
913
+ Collection([], RibbonGalleryGroup)
914
+ ], RibbonGallerySettings.prototype, "groups", void 0);
915
+ __decorate$14([
916
+ Property(3)
917
+ ], RibbonGallerySettings.prototype, "itemCount", void 0);
918
+ __decorate$14([
919
+ Property(null)
920
+ ], RibbonGallerySettings.prototype, "selectedItemIndex", void 0);
921
+ __decorate$14([
922
+ Property('auto')
923
+ ], RibbonGallerySettings.prototype, "popupHeight", void 0);
924
+ __decorate$14([
925
+ Property('auto')
926
+ ], RibbonGallerySettings.prototype, "popupWidth", void 0);
927
+ __decorate$14([
928
+ Property('')
929
+ ], RibbonGallerySettings.prototype, "template", void 0);
930
+ __decorate$14([
931
+ Property('')
932
+ ], RibbonGallerySettings.prototype, "popupTemplate", void 0);
933
+ __decorate$14([
934
+ Event()
935
+ ], RibbonGallerySettings.prototype, "popupOpen", void 0);
936
+ __decorate$14([
937
+ Event()
938
+ ], RibbonGallerySettings.prototype, "popupClose", void 0);
939
+ __decorate$14([
940
+ Event()
941
+ ], RibbonGallerySettings.prototype, "itemHover", void 0);
942
+ __decorate$14([
943
+ Event()
944
+ ], RibbonGallerySettings.prototype, "beforeItemRender", void 0);
945
+ __decorate$14([
946
+ Event()
947
+ ], RibbonGallerySettings.prototype, "beforeSelect", void 0);
948
+ __decorate$14([
949
+ Event()
950
+ ], RibbonGallerySettings.prototype, "select", void 0);
951
+ return RibbonGallerySettings;
952
+ }(ChildProperty));
953
+
788
954
  var __extends$4 = (undefined && undefined.__extends) || (function () {
789
955
  var extendStatics = function (d, b) {
790
956
  extendStatics = Object.setPrototypeOf ||
@@ -821,6 +987,9 @@ var RibbonItem = /** @__PURE__ @class */ (function (_super) {
821
987
  RibbonItem.prototype.setProperties = function (prop, muteOnChange) {
822
988
  _super.prototype.setProperties.call(this, prop, muteOnChange);
823
989
  };
990
+ __decorate$4([
991
+ Property('')
992
+ ], RibbonItem.prototype, "keyTip", void 0);
824
993
  __decorate$4([
825
994
  Property(RibbonItemSize.Medium)
826
995
  ], RibbonItem.prototype, "activeSize", void 0);
@@ -869,6 +1038,9 @@ var RibbonItem = /** @__PURE__ @class */ (function (_super) {
869
1038
  __decorate$4([
870
1039
  Complex({}, RibbonGroupButtonSettings)
871
1040
  ], RibbonItem.prototype, "groupButtonSettings", void 0);
1041
+ __decorate$4([
1042
+ Complex({}, RibbonGallerySettings)
1043
+ ], RibbonItem.prototype, "gallerySettings", void 0);
872
1044
  return RibbonItem;
873
1045
  }(ChildProperty));
874
1046
 
@@ -956,6 +1128,12 @@ var RibbonGroup = /** @__PURE__ @class */ (function (_super) {
956
1128
  RibbonGroup.prototype.setProperties = function (prop, muteOnChange) {
957
1129
  _super.prototype.setProperties.call(this, prop, muteOnChange);
958
1130
  };
1131
+ __decorate$2([
1132
+ Property('')
1133
+ ], RibbonGroup.prototype, "keyTip", void 0);
1134
+ __decorate$2([
1135
+ Property('')
1136
+ ], RibbonGroup.prototype, "launcherIconKeyTip", void 0);
959
1137
  __decorate$2([
960
1138
  Collection([], RibbonCollection)
961
1139
  ], RibbonGroup.prototype, "collections", void 0);
@@ -1031,6 +1209,9 @@ var RibbonTab = /** @__PURE__ @class */ (function (_super) {
1031
1209
  RibbonTab.prototype.setProperties = function (prop, muteOnChange) {
1032
1210
  _super.prototype.setProperties.call(this, prop, muteOnChange);
1033
1211
  };
1212
+ __decorate$1([
1213
+ Property('')
1214
+ ], RibbonTab.prototype, "keyTip", void 0);
1034
1215
  __decorate$1([
1035
1216
  Property('')
1036
1217
  ], RibbonTab.prototype, "id", void 0);
@@ -1046,7 +1227,7 @@ var RibbonTab = /** @__PURE__ @class */ (function (_super) {
1046
1227
  return RibbonTab;
1047
1228
  }(ChildProperty));
1048
1229
 
1049
- var __extends$14 = (undefined && undefined.__extends) || (function () {
1230
+ var __extends$17 = (undefined && undefined.__extends) || (function () {
1050
1231
  var extendStatics = function (d, b) {
1051
1232
  extendStatics = Object.setPrototypeOf ||
1052
1233
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -1059,7 +1240,7 @@ var __extends$14 = (undefined && undefined.__extends) || (function () {
1059
1240
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1060
1241
  };
1061
1242
  })();
1062
- var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1243
+ var __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1063
1244
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1064
1245
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1065
1246
  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;
@@ -1069,7 +1250,7 @@ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators,
1069
1250
  * Defines the ribbon file menu settings.
1070
1251
  */
1071
1252
  var FileMenuSettings = /** @__PURE__ @class */ (function (_super) {
1072
- __extends$14(FileMenuSettings, _super);
1253
+ __extends$17(FileMenuSettings, _super);
1073
1254
  function FileMenuSettings() {
1074
1255
  return _super !== null && _super.apply(this, arguments) || this;
1075
1256
  }
@@ -1082,52 +1263,55 @@ var FileMenuSettings = /** @__PURE__ @class */ (function (_super) {
1082
1263
  FileMenuSettings.prototype.setProperties = function (prop, muteOnChange) {
1083
1264
  _super.prototype.setProperties.call(this, prop, muteOnChange);
1084
1265
  };
1085
- __decorate$14([
1266
+ __decorate$17([
1086
1267
  Property('File')
1087
1268
  ], FileMenuSettings.prototype, "text", void 0);
1088
- __decorate$14([
1269
+ __decorate$17([
1089
1270
  Property(false)
1090
1271
  ], FileMenuSettings.prototype, "visible", void 0);
1091
- __decorate$14([
1272
+ __decorate$17([
1092
1273
  Collection([], MenuItem)
1093
1274
  ], FileMenuSettings.prototype, "menuItems", void 0);
1094
- __decorate$14([
1275
+ __decorate$17([
1095
1276
  Property(false)
1096
1277
  ], FileMenuSettings.prototype, "showItemOnClick", void 0);
1097
- __decorate$14([
1278
+ __decorate$17([
1098
1279
  Complex({}, MenuAnimationSettings)
1099
1280
  ], FileMenuSettings.prototype, "animationSettings", void 0);
1100
- __decorate$14([
1281
+ __decorate$17([
1101
1282
  Property('')
1102
1283
  ], FileMenuSettings.prototype, "itemTemplate", void 0);
1103
- __decorate$14([
1284
+ __decorate$17([
1104
1285
  Property('')
1105
1286
  ], FileMenuSettings.prototype, "popupTemplate", void 0);
1106
- __decorate$14([
1287
+ __decorate$17([
1107
1288
  Complex({}, RibbonTooltip)
1108
1289
  ], FileMenuSettings.prototype, "ribbonTooltipSettings", void 0);
1109
- __decorate$14([
1290
+ __decorate$17([
1110
1291
  Event()
1111
1292
  ], FileMenuSettings.prototype, "beforeClose", void 0);
1112
- __decorate$14([
1293
+ __decorate$17([
1113
1294
  Event()
1114
1295
  ], FileMenuSettings.prototype, "beforeOpen", void 0);
1115
- __decorate$14([
1296
+ __decorate$17([
1116
1297
  Event()
1117
1298
  ], FileMenuSettings.prototype, "beforeItemRender", void 0);
1118
- __decorate$14([
1299
+ __decorate$17([
1119
1300
  Event()
1120
1301
  ], FileMenuSettings.prototype, "close", void 0);
1121
- __decorate$14([
1302
+ __decorate$17([
1122
1303
  Event()
1123
1304
  ], FileMenuSettings.prototype, "open", void 0);
1124
- __decorate$14([
1305
+ __decorate$17([
1125
1306
  Event()
1126
1307
  ], FileMenuSettings.prototype, "select", void 0);
1308
+ __decorate$17([
1309
+ Property('')
1310
+ ], FileMenuSettings.prototype, "keyTip", void 0);
1127
1311
  return FileMenuSettings;
1128
1312
  }(ChildProperty));
1129
1313
 
1130
- var __extends$16 = (undefined && undefined.__extends) || (function () {
1314
+ var __extends$19 = (undefined && undefined.__extends) || (function () {
1131
1315
  var extendStatics = function (d, b) {
1132
1316
  extendStatics = Object.setPrototypeOf ||
1133
1317
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -1140,7 +1324,7 @@ var __extends$16 = (undefined && undefined.__extends) || (function () {
1140
1324
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1141
1325
  };
1142
1326
  })();
1143
- var __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1327
+ var __decorate$19 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1144
1328
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1145
1329
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1146
1330
  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;
@@ -1150,23 +1334,23 @@ var __decorate$16 = (undefined && undefined.__decorate) || function (decorators,
1150
1334
  * Defines the ribbon backstage back button.
1151
1335
  */
1152
1336
  var BackstageBackButton = /** @__PURE__ @class */ (function (_super) {
1153
- __extends$16(BackstageBackButton, _super);
1337
+ __extends$19(BackstageBackButton, _super);
1154
1338
  function BackstageBackButton() {
1155
1339
  return _super !== null && _super.apply(this, arguments) || this;
1156
1340
  }
1157
- __decorate$16([
1341
+ __decorate$19([
1158
1342
  Property('')
1159
1343
  ], BackstageBackButton.prototype, "text", void 0);
1160
- __decorate$16([
1344
+ __decorate$19([
1161
1345
  Property('')
1162
1346
  ], BackstageBackButton.prototype, "iconCss", void 0);
1163
- __decorate$16([
1347
+ __decorate$19([
1164
1348
  Property(true)
1165
1349
  ], BackstageBackButton.prototype, "visible", void 0);
1166
1350
  return BackstageBackButton;
1167
1351
  }(ChildProperty));
1168
1352
 
1169
- var __extends$17 = (undefined && undefined.__extends) || (function () {
1353
+ var __extends$20 = (undefined && undefined.__extends) || (function () {
1170
1354
  var extendStatics = function (d, b) {
1171
1355
  extendStatics = Object.setPrototypeOf ||
1172
1356
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -1179,7 +1363,7 @@ var __extends$17 = (undefined && undefined.__extends) || (function () {
1179
1363
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1180
1364
  };
1181
1365
  })();
1182
- var __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1366
+ var __decorate$20 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1183
1367
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1184
1368
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1185
1369
  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;
@@ -1189,35 +1373,38 @@ var __decorate$17 = (undefined && undefined.__decorate) || function (decorators,
1189
1373
  * Defines the ribbon backstage back button.
1190
1374
  */
1191
1375
  var BackstageItem = /** @__PURE__ @class */ (function (_super) {
1192
- __extends$17(BackstageItem, _super);
1376
+ __extends$20(BackstageItem, _super);
1193
1377
  function BackstageItem() {
1194
1378
  return _super !== null && _super.apply(this, arguments) || this;
1195
1379
  }
1196
- __decorate$17([
1380
+ __decorate$20([
1197
1381
  Property('')
1198
1382
  ], BackstageItem.prototype, "text", void 0);
1199
- __decorate$17([
1383
+ __decorate$20([
1200
1384
  Property('')
1201
1385
  ], BackstageItem.prototype, "id", void 0);
1202
- __decorate$17([
1386
+ __decorate$20([
1387
+ Property('')
1388
+ ], BackstageItem.prototype, "keyTip", void 0);
1389
+ __decorate$20([
1203
1390
  Property('')
1204
1391
  ], BackstageItem.prototype, "content", void 0);
1205
- __decorate$17([
1392
+ __decorate$20([
1206
1393
  Property('')
1207
1394
  ], BackstageItem.prototype, "iconCss", void 0);
1208
- __decorate$17([
1395
+ __decorate$20([
1209
1396
  Property(false)
1210
1397
  ], BackstageItem.prototype, "separator", void 0);
1211
- __decorate$17([
1398
+ __decorate$20([
1212
1399
  Property(false)
1213
1400
  ], BackstageItem.prototype, "isFooter", void 0);
1214
- __decorate$17([
1401
+ __decorate$20([
1215
1402
  Event()
1216
1403
  ], BackstageItem.prototype, "backStageItemClick", void 0);
1217
1404
  return BackstageItem;
1218
1405
  }(ChildProperty));
1219
1406
 
1220
- var __extends$15 = (undefined && undefined.__extends) || (function () {
1407
+ var __extends$18 = (undefined && undefined.__extends) || (function () {
1221
1408
  var extendStatics = function (d, b) {
1222
1409
  extendStatics = Object.setPrototypeOf ||
1223
1410
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -1230,7 +1417,7 @@ var __extends$15 = (undefined && undefined.__extends) || (function () {
1230
1417
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1231
1418
  };
1232
1419
  })();
1233
- var __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1420
+ var __decorate$18 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1234
1421
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1235
1422
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1236
1423
  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;
@@ -1240,7 +1427,7 @@ var __decorate$15 = (undefined && undefined.__decorate) || function (decorators,
1240
1427
  * Defines the ribbon file menu settings.
1241
1428
  */
1242
1429
  var BackStageMenu = /** @__PURE__ @class */ (function (_super) {
1243
- __extends$15(BackStageMenu, _super);
1430
+ __extends$18(BackStageMenu, _super);
1244
1431
  function BackStageMenu() {
1245
1432
  return _super !== null && _super.apply(this, arguments) || this;
1246
1433
  }
@@ -1253,36 +1440,87 @@ var BackStageMenu = /** @__PURE__ @class */ (function (_super) {
1253
1440
  BackStageMenu.prototype.setProperties = function (prop, muteOnChange) {
1254
1441
  _super.prototype.setProperties.call(this, prop, muteOnChange);
1255
1442
  };
1256
- __decorate$15([
1443
+ __decorate$18([
1257
1444
  Property('File')
1258
1445
  ], BackStageMenu.prototype, "text", void 0);
1259
- __decorate$15([
1446
+ __decorate$18([
1447
+ Property('')
1448
+ ], BackStageMenu.prototype, "keyTip", void 0);
1449
+ __decorate$18([
1260
1450
  Property(false)
1261
1451
  ], BackStageMenu.prototype, "visible", void 0);
1262
- __decorate$15([
1452
+ __decorate$18([
1263
1453
  Property('auto')
1264
1454
  ], BackStageMenu.prototype, "height", void 0);
1265
- __decorate$15([
1455
+ __decorate$18([
1266
1456
  Property('auto')
1267
1457
  ], BackStageMenu.prototype, "width", void 0);
1268
- __decorate$15([
1458
+ __decorate$18([
1269
1459
  Property(null)
1270
1460
  ], BackStageMenu.prototype, "target", void 0);
1271
- __decorate$15([
1461
+ __decorate$18([
1272
1462
  Complex({}, BackstageBackButton)
1273
1463
  ], BackStageMenu.prototype, "backButton", void 0);
1274
- __decorate$15([
1464
+ __decorate$18([
1275
1465
  Collection([], BackstageItem)
1276
1466
  ], BackStageMenu.prototype, "items", void 0);
1277
- __decorate$15([
1467
+ __decorate$18([
1278
1468
  Property('')
1279
1469
  ], BackStageMenu.prototype, "template", void 0);
1280
- __decorate$15([
1470
+ __decorate$18([
1281
1471
  Complex({}, RibbonTooltip)
1282
1472
  ], BackStageMenu.prototype, "ribbonTooltipSettings", void 0);
1283
1473
  return BackStageMenu;
1284
1474
  }(ChildProperty));
1285
1475
 
1476
+ var __extends$21 = (undefined && undefined.__extends) || (function () {
1477
+ var extendStatics = function (d, b) {
1478
+ extendStatics = Object.setPrototypeOf ||
1479
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1480
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
1481
+ return extendStatics(d, b);
1482
+ };
1483
+ return function (d, b) {
1484
+ extendStatics(d, b);
1485
+ function __() { this.constructor = d; }
1486
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1487
+ };
1488
+ })();
1489
+ var __decorate$21 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1490
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1491
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1492
+ 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;
1493
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1494
+ };
1495
+ /**
1496
+ * Defines the ribbon contextual tab.
1497
+ */
1498
+ var RibbonContextualTabSettings = /** @__PURE__ @class */ (function (_super) {
1499
+ __extends$21(RibbonContextualTabSettings, _super);
1500
+ function RibbonContextualTabSettings() {
1501
+ return _super !== null && _super.apply(this, arguments) || this;
1502
+ }
1503
+ /**
1504
+ * @param {Object} prop - Gets the property of contextual tab.
1505
+ * @param {boolean} muteOnChange - Gets the boolean value of muteOnChange.
1506
+ * @returns {void}
1507
+ * @private
1508
+ */
1509
+ RibbonContextualTabSettings.prototype.setProperties = function (prop, muteOnChange) {
1510
+ _super.prototype.setProperties.call(this, prop, muteOnChange);
1511
+ };
1512
+ __decorate$21([
1513
+ Property(false)
1514
+ ], RibbonContextualTabSettings.prototype, "visible", void 0);
1515
+ __decorate$21([
1516
+ Property(false)
1517
+ ], RibbonContextualTabSettings.prototype, "isSelected", void 0);
1518
+ __decorate$21([
1519
+ Collection([], RibbonTab)
1520
+ ], RibbonContextualTabSettings.prototype, "tabs", void 0);
1521
+ return RibbonContextualTabSettings;
1522
+ }(ChildProperty));
1523
+
1286
1524
  // export * from './file-menu';
1287
1525
 
1288
1526
  /**
@@ -1311,6 +1549,8 @@ var RIBBON_POPUP_CONTROL = 'e-ribbon-popup-control';
1311
1549
  /** @hidden */
1312
1550
  var RIBBON_POPUP_OPEN = 'e-ribbon-open';
1313
1551
  /** @hidden */
1552
+ var RIBBON_KEYTIP = 'e-ribbon-keytip';
1553
+ /** @hidden */
1314
1554
  var SPACE = ' ';
1315
1555
  /** @hidden */
1316
1556
  var HORIZONTAL_SCROLLBAR = 'e-hscroll-bar';
@@ -1319,6 +1559,8 @@ var HIDE_CSS = 'e-ribbon-hide';
1319
1559
  /** @hidden */
1320
1560
  var RIBBON_TAB = 'e-ribbon-tab';
1321
1561
  /** @hidden */
1562
+ var RIBBON_CONTEXTUAL_TAB = 'e-ribbon-contextual-tab';
1563
+ /** @hidden */
1322
1564
  var RIBBON_TAB_ACTIVE = 'e-ribbon-active';
1323
1565
  /** @hidden */
1324
1566
  var RIBBON_TAB_ITEM = 'e-ribbon-tab-item';
@@ -1351,6 +1593,8 @@ var RIBBON_GROUP_BUTTON = 'e-ribbon-group-button';
1351
1593
  /** @hidden */
1352
1594
  var RIBBON_GROUP_BUTTON_OVERFLOW_POPUP = 'e-ribbon-group-button-overflow-popup';
1353
1595
  /** @hidden */
1596
+ var RIBBON_GROUP_BUTTON_CONTENT = 'e-ribbon-group-button-content';
1597
+ /** @hidden */
1354
1598
  var RIBBON_GROUP_CONTAINER = 'e-ribbon-group-container';
1355
1599
  /** @hidden */
1356
1600
  var RIBBON_OF_TAB_CONTAINER = 'e-ribbon-of-tab';
@@ -1475,6 +1719,8 @@ var RIBBON_HELP_PANE_TEMPLATE_ID = '_helppanetemplate';
1475
1719
  /** @hidden */
1476
1720
  var RIBBON_GROUP_BUTTON_ID = '_grpbtn';
1477
1721
  /** @hidden */
1722
+ var RIBBON_KEYTIP_ID = '_keytip';
1723
+ /** @hidden */
1478
1724
  var RIBBON_FILE_MENU_WIDTH = '--fileMenuWidth';
1479
1725
  /** @hidden */
1480
1726
  var RIBBON_HELP_PANE_TEMPLATE_WIDTH = '--helpTemplateWidth';
@@ -1819,7 +2065,12 @@ var RibbonColorPicker = /** @__PURE__ @class */ (function () {
1819
2065
  beforeOpen: colorPickerSettings.beforeOpen,
1820
2066
  beforeTileRender: colorPickerSettings.beforeTileRender,
1821
2067
  created: colorPickerSettings.created,
1822
- change: colorPickerSettings.change,
2068
+ change: function (e) {
2069
+ colorPickerSettings.value = e.value.toString();
2070
+ if (colorPickerSettings.change) {
2071
+ colorPickerSettings.change.call(_this, e);
2072
+ }
2073
+ },
1823
2074
  open: function () {
1824
2075
  colorPicker.element.parentElement.classList.add(RIBBON_POPUP_OPEN);
1825
2076
  if (colorPickerSettings.open) {
@@ -2942,10 +3193,11 @@ function getTemplateFunction(template) {
2942
3193
  *
2943
3194
  * @param {RibbonTabModel} tabs - Gets the ribbon tab model.
2944
3195
  * @param {string} id - Gets the ID of the tab.
3196
+ * @param {RibbonItemType} type - Gets the type of the item.
2945
3197
  * @returns {itemProps} - Gets the ribbon item.
2946
3198
  * @hidden
2947
3199
  */
2948
- function getItem(tabs, id) {
3200
+ function getItem(tabs, id, type) {
2949
3201
  for (var i = 0; i < tabs.length; i++) {
2950
3202
  var tab = tabs[parseInt(i.toString(), 10)];
2951
3203
  for (var j = 0; j < tab.groups.length; j++) {
@@ -2954,7 +3206,7 @@ function getItem(tabs, id) {
2954
3206
  var collection = group.collections[parseInt(k.toString(), 10)];
2955
3207
  for (var l = 0; l < collection.items.length; l++) {
2956
3208
  var item = collection.items[parseInt(l.toString(), 10)];
2957
- if (item.id === id) {
3209
+ if ((id && item.id === id) || (type && item.type === type)) {
2958
3210
  return {
2959
3211
  item: item, collection: collection, group: group,
2960
3212
  tabIndex: i, groupIndex: j, collectionIndex: k, itemIndex: l
@@ -3270,6 +3522,9 @@ var RibbonGroupButton = /** @__PURE__ @class */ (function () {
3270
3522
  if (groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes) {
3271
3523
  setCustomAttributes(groupButtonEle, groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes);
3272
3524
  }
3525
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].content) {
3526
+ groupButtonEle.classList.add(RIBBON_GROUP_BUTTON_CONTENT);
3527
+ }
3273
3528
  var buttonEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
3274
3529
  if (groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
3275
3530
  btnContainerEle.classList.add(RIBBON_SINGLE_BUTTON_SELECTION);
@@ -3711,27 +3966,734 @@ var RibbonGroupButton = /** @__PURE__ @class */ (function () {
3711
3966
  return RibbonGroupButton;
3712
3967
  }());
3713
3968
 
3714
- var __extends = (undefined && undefined.__extends) || (function () {
3715
- var extendStatics = function (d, b) {
3716
- extendStatics = Object.setPrototypeOf ||
3717
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
3718
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
3719
- return extendStatics(d, b);
3720
- };
3721
- return function (d, b) {
3722
- extendStatics(d, b);
3723
- function __() { this.constructor = d; }
3724
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3725
- };
3726
- })();
3727
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3728
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3729
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3730
- 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;
3731
- return c > 3 && r && Object.defineProperty(target, key, r), r;
3732
- };
3733
3969
  /**
3734
- * The Ribbon Component is a structured layout to manage tools with tabs and groups.
3970
+ * Defines the items of Ribbon.
3971
+ */
3972
+ var RibbonGallery = /** @__PURE__ @class */ (function () {
3973
+ function RibbonGallery(parent) {
3974
+ this.count = 0;
3975
+ this.isAdded = false;
3976
+ this.galleryItemsIndex = 0;
3977
+ this.parent = parent;
3978
+ }
3979
+ RibbonGallery.prototype.getModuleName = function () {
3980
+ return 'ribbonGallery';
3981
+ };
3982
+ RibbonGallery.prototype.destroy = function () {
3983
+ this.parent = null;
3984
+ };
3985
+ /**
3986
+ * Creates gallery.
3987
+ *
3988
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3989
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
3990
+ * @returns {void}
3991
+ * @hidden
3992
+ */
3993
+ RibbonGallery.prototype.createGallery = function (item, itemEle) {
3994
+ var _this = this;
3995
+ var gallerySettings = item.gallerySettings;
3996
+ this.renderGalleryItems(gallerySettings, false, item.id, itemEle);
3997
+ var buttonEle = this.parent.createElement('button', {
3998
+ id: item.id + '_popupButton',
3999
+ className: 'e-ribbon-gallery-button e-icons e-drop-icon'
4000
+ });
4001
+ itemEle.appendChild(buttonEle);
4002
+ this.createPopup(item, buttonEle);
4003
+ buttonEle.onclick = function (args) {
4004
+ var popupEle = document.querySelector('#' + item.id + '_galleryPopup');
4005
+ if (popupEle) {
4006
+ var popup = getComponent(popupEle, Popup);
4007
+ popupEle.classList.contains('e-popup-close') ? _this.showPopup(popup, popupEle, args, gallerySettings, item.id) : _this.hidePopup(popup, popupEle, args, gallerySettings, item.id);
4008
+ }
4009
+ };
4010
+ document.onclick = function (args) {
4011
+ var popupEle = document.querySelectorAll('.e-ribbon-gallery-popup.e-popup-open');
4012
+ var popupID;
4013
+ var itemProp;
4014
+ for (var i = 0; i < popupEle.length; i++) {
4015
+ var popup = getComponent(popupEle[parseInt(i.toString(), 10)], Popup);
4016
+ if (args.target.classList.contains('e-ribbon-gallery-button')) {
4017
+ popupID = (popupEle[parseInt(i.toString(), 10)].id).replace(/_galleryPopup/g, '');
4018
+ if ((args.target.id).replace(/_popupButton/g, '') !== popupID) {
4019
+ itemProp = getItem(_this.parent.tabs, popupID);
4020
+ _this.hidePopup(popup, popupEle[parseInt(i.toString(), 10)], args, itemProp.item.gallerySettings, popupID);
4021
+ break;
4022
+ }
4023
+ }
4024
+ else {
4025
+ popupID = (popupEle[parseInt(i.toString(), 10)].id).replace(/_galleryPopup/g, '');
4026
+ itemProp = getItem(_this.parent.tabs, popupID);
4027
+ _this.hidePopup(popup, popupEle[parseInt(i.toString(), 10)], args, itemProp.item.gallerySettings, popupID);
4028
+ break;
4029
+ }
4030
+ }
4031
+ };
4032
+ };
4033
+ RibbonGallery.prototype.renderGalleryItems = function (gallerySettings, isPopup, id, itemEle) {
4034
+ var _this = this;
4035
+ var galleryContainerEle;
4036
+ var galleryEle;
4037
+ var itemProp = getItem(this.parent.tabs, id);
4038
+ if (itemProp && itemProp.group) {
4039
+ itemProp.group.isCollapsible = false;
4040
+ }
4041
+ var galleryWrapper = this.parent.createElement('div', {
4042
+ className: 'e-ribbon-gallery-wrapper',
4043
+ id: id + '_galleryWrapper'
4044
+ });
4045
+ if (!isPopup) {
4046
+ itemEle.appendChild(galleryWrapper);
4047
+ }
4048
+ var _loop_1 = function (i) {
4049
+ var isHeightDefined = false;
4050
+ galleryContainerEle = this_1.parent.createElement('ol', {
4051
+ className: 'e-ribbon-gallery-container',
4052
+ id: id + '_galleryContainer' + i
4053
+ });
4054
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
4055
+ isHeightDefined = true;
4056
+ }
4057
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].cssClass) {
4058
+ galleryContainerEle.classList.add(gallerySettings.groups[parseInt(i.toString(), 10)].cssClass);
4059
+ }
4060
+ var _loop_2 = function (j) {
4061
+ galleryEle = this_1.parent.createElement('li', {
4062
+ className: 'e-ribbon-gallery-item',
4063
+ id: galleryContainerEle.id + '_gallery' + j,
4064
+ attrs: { 'tabindex': '0' }
4065
+ });
4066
+ var itemEventArgs = { name: 'beforeItemRender', item: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)] };
4067
+ if (gallerySettings.beforeItemRender) {
4068
+ gallerySettings.beforeItemRender.call(this_1, itemEventArgs);
4069
+ }
4070
+ galleryContainerEle.appendChild(galleryEle);
4071
+ if (gallerySettings.selectedItemIndex && gallerySettings.selectedItemIndex === this_1.count) {
4072
+ galleryEle.classList.add('e-ribbon-gallery-selected');
4073
+ }
4074
+ else {
4075
+ if (!gallerySettings.selectedItemIndex && this_1.count === 0) {
4076
+ galleryEle.classList.add('e-ribbon-gallery-selected');
4077
+ gallerySettings.selectedItemIndex = this_1.count;
4078
+ }
4079
+ }
4080
+ this_1.count = this_1.count + 1;
4081
+ galleryEle.onclick = function (e) {
4082
+ _this.setActiveState(e.currentTarget, gallerySettings, id, true, e);
4083
+ };
4084
+ galleryEle.onkeydown = function (e) {
4085
+ if (e.key === 'Enter' || e.key === ' ') {
4086
+ _this.setActiveState(e.currentTarget, gallerySettings, id, true, e);
4087
+ }
4088
+ };
4089
+ galleryEle.onmouseover = function (e) {
4090
+ var hoverEventArgs = { event: e, name: 'itemHover', item: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)] };
4091
+ if (gallerySettings.itemHover) {
4092
+ gallerySettings.itemHover.call(_this, hoverEventArgs);
4093
+ }
4094
+ };
4095
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth && gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth !== 'auto') {
4096
+ galleryEle.style.width = gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth + 'px';
4097
+ }
4098
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
4099
+ galleryEle.style.height = gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight + 'px';
4100
+ galleryEle.style.paddingTop = '0px';
4101
+ galleryEle.style.paddingBottom = '0px';
4102
+ if (this_1.parent.activeLayout !== 'Simplified' && !isPopup) {
4103
+ galleryContainerEle.style.flexFlow = 'wrap';
4104
+ }
4105
+ }
4106
+ if ((!gallerySettings.template && !gallerySettings.popupTemplate) || ((gallerySettings.template && !gallerySettings.popupTemplate) && isPopup) || ((gallerySettings.popupTemplate && !gallerySettings.template) && !isPopup)) {
4107
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].htmlAttributes) {
4108
+ setCustomAttributes(galleryEle, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].htmlAttributes);
4109
+ }
4110
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss) {
4111
+ var iconEle = this_1.parent.createElement('span', {
4112
+ className: 'e-ribbon-gallery-icons' + ' ' + gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss
4113
+ });
4114
+ galleryEle.appendChild(iconEle);
4115
+ if (this_1.parent.activeLayout === 'Simplified' && !isPopup) {
4116
+ iconEle.classList.add('e-hidden');
4117
+ }
4118
+ }
4119
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].content) {
4120
+ galleryEle.appendChild(this_1.parent.createElement('span', {
4121
+ innerHTML: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].content,
4122
+ className: 'e-ribbon-gallery-text'
4123
+ }));
4124
+ }
4125
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].disabled) {
4126
+ galleryEle.classList.add('e-disabled');
4127
+ }
4128
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].cssClass) {
4129
+ galleryEle.classList.add(gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].cssClass);
4130
+ }
4131
+ }
4132
+ if (gallerySettings.template && !isPopup) {
4133
+ this_1.createGalleryTemplate(galleryEle, gallerySettings, id, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)]);
4134
+ }
4135
+ if (gallerySettings.popupTemplate && isPopup) {
4136
+ this_1.createGalleryPopupTemplate(galleryEle, gallerySettings, id, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)]);
4137
+ }
4138
+ if ((!isPopup && !isHeightDefined && (gallerySettings.itemCount === this_1.count))) {
4139
+ galleryWrapper.appendChild(galleryContainerEle);
4140
+ this_1.isAdded = true;
4141
+ return "break";
4142
+ }
4143
+ };
4144
+ for (var j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
4145
+ var state_2 = _loop_2(j);
4146
+ if (state_2 === "break")
4147
+ break;
4148
+ }
4149
+ if (this_1.isAdded && !isPopup) {
4150
+ return "break";
4151
+ }
4152
+ !isPopup ? galleryWrapper.appendChild(galleryContainerEle) : itemEle.appendChild(galleryContainerEle);
4153
+ if (isPopup && gallerySettings.groups[parseInt(i.toString(), 10)].header) {
4154
+ var headerEle = (this_1.parent.createElement('div', {
4155
+ className: 'e-ribbon-gallery-header',
4156
+ innerHTML: gallerySettings.groups[parseInt(i.toString(), 10)].header
4157
+ }));
4158
+ itemEle.insertBefore(headerEle, galleryContainerEle);
4159
+ }
4160
+ };
4161
+ var this_1 = this;
4162
+ for (var i = 0; i < gallerySettings.groups.length; i++) {
4163
+ var state_1 = _loop_1(i);
4164
+ if (state_1 === "break")
4165
+ break;
4166
+ }
4167
+ this.count = 0;
4168
+ this.isAdded = false;
4169
+ };
4170
+ RibbonGallery.prototype.setWrapperWidth = function (itemCount, galleryWrapper, gallerySettings, itemID) {
4171
+ var count = 1;
4172
+ var itemsWidth = 0;
4173
+ var isWidthApplied = false;
4174
+ for (var i = 0; i < gallerySettings.groups.length; i++) {
4175
+ for (var j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
4176
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
4177
+ if (itemCount >= count) {
4178
+ var galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + i + '_gallery' + j);
4179
+ if (galleryItemEle) {
4180
+ itemsWidth += galleryItemEle.offsetWidth;
4181
+ var itemStyles = window.getComputedStyle(galleryItemEle);
4182
+ if (itemStyles) {
4183
+ var paddingWidth = parseFloat(itemStyles.paddingLeft) + parseFloat(itemStyles.paddingRight);
4184
+ if (!(isNullOrUndefined(paddingWidth)))
4185
+ itemsWidth += paddingWidth;
4186
+ var marginWidth = parseFloat(itemStyles.marginLeft) + parseFloat(itemStyles.marginRight);
4187
+ if (!(isNullOrUndefined(marginWidth)))
4188
+ itemsWidth += marginWidth;
4189
+ }
4190
+ }
4191
+ }
4192
+ else {
4193
+ isWidthApplied = true;
4194
+ break;
4195
+ }
4196
+ count++;
4197
+ }
4198
+ }
4199
+ if (isWidthApplied) {
4200
+ break;
4201
+ }
4202
+ }
4203
+ if (itemsWidth > 0)
4204
+ galleryWrapper.style.width = itemsWidth + 'px';
4205
+ };
4206
+ /**
4207
+ * Checks the gallery items height.
4208
+ *
4209
+ * @param {number} selectedTab - Gets the current selected tab.
4210
+ * @param {HTMLElement} activeContent - Gets the current active content.
4211
+ * @returns {void}
4212
+ * @hidden
4213
+ */
4214
+ RibbonGallery.prototype.checkAvailableHeight = function (selectedTab, activeContent) {
4215
+ var galleryWrapperItems = activeContent.querySelectorAll('.e-ribbon-gallery-wrapper');
4216
+ for (var n = 0; n < galleryWrapperItems.length; n++) {
4217
+ var isHeight = false;
4218
+ var itemsCount = 0;
4219
+ var galleryWrapper = galleryWrapperItems[parseInt(n.toString(), 10)];
4220
+ var galleryWrapperHeight = galleryWrapper.offsetHeight;
4221
+ var itemID = galleryWrapper.id.replace(/_galleryWrapper/g, '');
4222
+ var itemProp = getItem(this.parent.tabs, itemID);
4223
+ if (itemProp) {
4224
+ this.setWrapperWidth(itemProp.item.gallerySettings.itemCount, galleryWrapper, itemProp.item.gallerySettings, itemID);
4225
+ for (var i = 0; i < itemProp.item.gallerySettings.groups.length; i++) {
4226
+ if (itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
4227
+ for (var j = 0; j < itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
4228
+ var galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + i + '_gallery' + j);
4229
+ if (galleryItemEle) {
4230
+ itemsCount++;
4231
+ if (!isHeight) {
4232
+ if (itemsCount === 1) {
4233
+ var itemsValues = 0;
4234
+ var itemStyles = window.getComputedStyle(galleryItemEle);
4235
+ if (itemStyles) {
4236
+ var paddingWidth = parseFloat(itemStyles.paddingTop) + parseFloat(itemStyles.paddingBottom);
4237
+ if (!(isNullOrUndefined(paddingWidth)))
4238
+ itemsValues += paddingWidth;
4239
+ var marginWidth = parseFloat(itemStyles.marginTop) + parseFloat(itemStyles.marginBottom);
4240
+ if (!(isNullOrUndefined(marginWidth)))
4241
+ itemsValues += marginWidth;
4242
+ }
4243
+ if (galleryWrapperHeight > (galleryItemEle.offsetHeight + itemsValues)) {
4244
+ galleryWrapperHeight -= (galleryItemEle.offsetHeight + itemsValues);
4245
+ }
4246
+ else {
4247
+ isHeight = true;
4248
+ galleryItemEle.remove();
4249
+ }
4250
+ }
4251
+ if (itemsCount === itemProp.item.gallerySettings.itemCount) {
4252
+ itemsCount = 0;
4253
+ }
4254
+ }
4255
+ else {
4256
+ galleryItemEle.remove();
4257
+ }
4258
+ }
4259
+ }
4260
+ }
4261
+ }
4262
+ }
4263
+ }
4264
+ };
4265
+ RibbonGallery.prototype.checkCollision = function (popup, popupEle) {
4266
+ var paddingWidth = 0;
4267
+ var marginWidth = 0;
4268
+ if (popupEle) {
4269
+ var screenWidth = window.innerWidth;
4270
+ var paddingStyles = window.getComputedStyle(popupEle);
4271
+ if (paddingStyles) {
4272
+ paddingWidth = parseFloat(paddingStyles.paddingLeft) + parseFloat(paddingStyles.paddingRight);
4273
+ if (!(isNullOrUndefined(paddingWidth)))
4274
+ screenWidth = screenWidth - paddingWidth;
4275
+ }
4276
+ var popupContainerItems = popupEle.querySelectorAll('.e-ribbon-gallery-container');
4277
+ if (popup.width !== 'auto') {
4278
+ popupContainerItems.forEach(function (ele) {
4279
+ ele.style.flexFlow = 'wrap';
4280
+ });
4281
+ }
4282
+ var isCollideOccurs = false;
4283
+ for (var i = 0; i < popupContainerItems.length; i++) {
4284
+ var itemsWidth = 0;
4285
+ for (var j = 0; j < popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item').length; j++) {
4286
+ var marginStyles = window.getComputedStyle(popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)]);
4287
+ if (marginStyles) {
4288
+ marginWidth = parseFloat(marginStyles.marginLeft) + parseFloat(marginStyles.marginRight);
4289
+ if (!(isNullOrUndefined(marginWidth)))
4290
+ itemsWidth += marginWidth;
4291
+ }
4292
+ itemsWidth += popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)].offsetWidth;
4293
+ if (((screenWidth <= itemsWidth) && popup.width === 'auto') || ((popup.width !== 'auto') && (screenWidth <= parseInt(popup.width.toString(), 10)) && (screenWidth <= itemsWidth))) {
4294
+ popupEle.style.width = ((itemsWidth + Math.abs(paddingWidth - marginWidth)) - popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)].offsetWidth) + 'px';
4295
+ isCollideOccurs = true;
4296
+ break;
4297
+ }
4298
+ }
4299
+ if (isCollideOccurs) {
4300
+ popupContainerItems.forEach(function (ele) {
4301
+ ele.style.flexFlow = 'wrap';
4302
+ });
4303
+ break;
4304
+ }
4305
+ }
4306
+ if (!isCollideOccurs) {
4307
+ if (popup.width === 'auto') {
4308
+ popupContainerItems.forEach(function (ele) {
4309
+ ele.style.flexFlow = 'nowrap';
4310
+ });
4311
+ popupEle.style.width = 'auto';
4312
+ }
4313
+ else {
4314
+ popupEle.style.width = (popup.width).toString();
4315
+ }
4316
+ }
4317
+ }
4318
+ };
4319
+ RibbonGallery.prototype.createPopup = function (item, buttonEle) {
4320
+ var popupContainer = this.parent.createElement('div', {
4321
+ className: 'e-ribbon-popup-container',
4322
+ id: item.id + '_popupContainer'
4323
+ });
4324
+ this.renderGalleryItems(item.gallerySettings, true, item.id, popupContainer);
4325
+ var gallerypopupElement = this.parent.createElement('div', {
4326
+ className: 'e-ribbon-gallery-popup',
4327
+ id: item.id + '_galleryPopup'
4328
+ });
4329
+ document.body.append(gallerypopupElement);
4330
+ var galleryPopup = new Popup(gallerypopupElement, {
4331
+ relateTo: buttonEle,
4332
+ content: popupContainer,
4333
+ collision: { X: 'fit', Y: 'flip' },
4334
+ actionOnScroll: 'hide',
4335
+ targetType: 'relative',
4336
+ position: { X: 'left', Y: 'bottom' },
4337
+ enableRtl: this.parent.enableRtl,
4338
+ width: item.gallerySettings.popupWidth,
4339
+ height: item.gallerySettings.popupHeight
4340
+ });
4341
+ galleryPopup.hide();
4342
+ };
4343
+ /**
4344
+ * Updates gallery in mode switching.
4345
+ *
4346
+ * @param {string} activeLayout - Gets the current active layout.
4347
+ * @param {string} itemID - Gets the ribbon item id.
4348
+ * @returns {void}
4349
+ * @hidden
4350
+ */
4351
+ RibbonGallery.prototype.switchGalleryItems = function (activeLayout, itemID) {
4352
+ var itemEle = this.parent.element.querySelector('#' + itemID + CONTAINER_ID);
4353
+ var count = 0;
4354
+ var itemProp = getItem(this.parent.tabs, itemID);
4355
+ if (itemEle) {
4356
+ var galleryWrapper = itemEle.querySelector('.e-ribbon-gallery-wrapper');
4357
+ var galleryIcons = itemEle.querySelectorAll('.e-ribbon-gallery-icons');
4358
+ var galleryContainer = itemEle.querySelectorAll('.e-ribbon-gallery-container');
4359
+ if (galleryIcons.length) {
4360
+ for (var i = 0; i < galleryIcons.length; i++) {
4361
+ activeLayout === 'Simplified' ? galleryIcons[parseInt(i.toString(), 10)].classList.add('e-hidden') : galleryIcons[parseInt(i.toString(), 10)].classList.remove('e-hidden');
4362
+ }
4363
+ }
4364
+ if (galleryContainer.length && itemProp) {
4365
+ for (var n = 0; n < itemProp.item.gallerySettings.groups.length; n++) {
4366
+ for (var i = 0; i < galleryContainer.length; i++) {
4367
+ if (itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].itemHeight && itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].itemHeight !== 'auto') {
4368
+ if (itemID + '_galleryContainer' + n === galleryContainer[parseInt(i.toString(), 10)].id) {
4369
+ activeLayout === 'Simplified' ? galleryContainer[parseInt(i.toString(), 10)].style.flexFlow = 'nowrap' : galleryContainer[parseInt(i.toString(), 10)].style.flexFlow = 'wrap';
4370
+ }
4371
+ }
4372
+ }
4373
+ }
4374
+ }
4375
+ if (galleryWrapper) {
4376
+ for (var n = 0; n < itemProp.item.gallerySettings.groups.length; n++) {
4377
+ for (var i = 0; i < itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].items.length; i++) {
4378
+ count++;
4379
+ if (count > itemProp.item.gallerySettings.itemCount) {
4380
+ var galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + n + '_gallery' + i);
4381
+ if (galleryItemEle) {
4382
+ activeLayout === 'Simplified' ? galleryItemEle.classList.add('e-hidden') : galleryItemEle.classList.remove('e-hidden');
4383
+ }
4384
+ }
4385
+ }
4386
+ }
4387
+ }
4388
+ }
4389
+ };
4390
+ /**
4391
+ * Adds the additional event handlers as the item moved into overflow popup.
4392
+ *
4393
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
4394
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
4395
+ * @param {DropDownButton} overflowButton - Gets the overflow button.
4396
+ * @returns {void}
4397
+ * @hidden
4398
+ */
4399
+ RibbonGallery.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
4400
+ var _this = this;
4401
+ if (itemEle.closest('.e-ribbon-overflow-target')) {
4402
+ var buttonEle = this.parent.createElement('button', {
4403
+ id: item.id,
4404
+ });
4405
+ itemEle.appendChild(buttonEle);
4406
+ itemEle.querySelector('.e-ribbon-gallery-wrapper').classList.add('e-hidden');
4407
+ itemEle.querySelectorAll('.e-ribbon-gallery-container').forEach(function (ele) {
4408
+ ele.classList.add('e-hidden');
4409
+ });
4410
+ var popupButton = itemEle.querySelector('#' + item.id + '_popupButton');
4411
+ if (popupButton)
4412
+ popupButton.classList.add('e-hidden');
4413
+ var itemProp = getItem(this.parent.tabs, item.id);
4414
+ var iconCss = itemProp && itemProp.group.groupIconCss ? itemProp.group.groupIconCss : '';
4415
+ var content = itemProp && itemProp.group.header ? itemProp.group.header : '';
4416
+ if (!iconCss) {
4417
+ for (var i = 0; i < item.gallerySettings.groups.length; i++) {
4418
+ for (var j = 0; j < item.gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
4419
+ if (item.gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss) {
4420
+ iconCss = item.gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss;
4421
+ break;
4422
+ }
4423
+ }
4424
+ if (iconCss) {
4425
+ break;
4426
+ }
4427
+ }
4428
+ }
4429
+ var popupEle = document.querySelector('#' + item.id + '_galleryPopup');
4430
+ var popup = getComponent(popupEle, Popup);
4431
+ var popupContainerEle_1 = document.querySelector('#' + item.id + '_galleryPopup .e-ribbon-popup-container');
4432
+ var dropdown_1 = new DropDownButton({
4433
+ iconCss: iconCss,
4434
+ content: content,
4435
+ target: popupContainerEle_1,
4436
+ enableRtl: this.parent.enableRtl,
4437
+ cssClass: 'e-ribbon-gallery-dropdown',
4438
+ disabled: item.disabled,
4439
+ open: function () {
4440
+ _this.setFoucsToFirstItem(popupContainerEle_1, true, item.id);
4441
+ _this.checkCollision(dropdown_1.dropDown, dropdown_1.dropDown.element);
4442
+ },
4443
+ beforeClose: function (args) {
4444
+ var isCancelled = _this.popupEvents(args.event, item.gallerySettings, 'popupClose', false);
4445
+ if (isCancelled) {
4446
+ args.cancel = true;
4447
+ }
4448
+ }
4449
+ }, buttonEle);
4450
+ if (popup.width !== 'auto') {
4451
+ dropdown_1.dropDown.width = formatUnit(popup.width);
4452
+ }
4453
+ if (popup.height !== 'auto') {
4454
+ dropdown_1.dropDown.height = formatUnit(popup.height);
4455
+ dropdown_1.dropDown.element.style.height = (popup.height).toString();
4456
+ }
4457
+ }
4458
+ };
4459
+ /**
4460
+ * Removes the additional event handlers as the item moved into overflow popup.
4461
+ *
4462
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
4463
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
4464
+ * @returns {void}
4465
+ * @hidden
4466
+ */
4467
+ RibbonGallery.prototype.removeOverFlowEvents = function (item, itemEle) {
4468
+ var popupButton = itemEle.querySelector('#' + item.id + '_popupButton');
4469
+ if (popupButton) {
4470
+ popupButton.classList.remove('e-hidden');
4471
+ }
4472
+ itemEle.querySelector('.e-ribbon-gallery-wrapper').classList.remove('e-hidden');
4473
+ itemEle.querySelectorAll('.e-ribbon-gallery-container').forEach(function (ele) {
4474
+ ele.classList.remove('e-hidden');
4475
+ });
4476
+ var galleryDDBEle = document.querySelector('#' + item.id);
4477
+ if (galleryDDBEle) {
4478
+ var popupEle = document.querySelector('#' + item.id + '_galleryPopup');
4479
+ var dropdown = getComponent(galleryDDBEle, DropDownButton);
4480
+ popupEle.appendChild(dropdown.target);
4481
+ dropdown.destroy();
4482
+ remove(galleryDDBEle);
4483
+ }
4484
+ };
4485
+ RibbonGallery.prototype.setActiveState = function (galleryEle, gallerySettings, itemID, isInteracted, event) {
4486
+ var previousItem;
4487
+ var currentItem;
4488
+ var itemEle = document.querySelector('#' + itemID + CONTAINER_ID);
4489
+ var selctedGalleryItem = Array.prototype.slice.call(itemEle.querySelectorAll('.e-ribbon-gallery-selected'));
4490
+ var popupEle = document.querySelector('#' + itemID + '_popupContainer');
4491
+ var popupGalleryItem = Array.prototype.slice.call(popupEle.querySelectorAll('.e-ribbon-gallery-selected'));
4492
+ if (popupGalleryItem.length) {
4493
+ selctedGalleryItem = selctedGalleryItem.concat(popupGalleryItem);
4494
+ }
4495
+ for (var i = 0; i < gallerySettings.groups.length; i++) {
4496
+ for (var j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
4497
+ if (selctedGalleryItem[0].id === itemID + '_galleryContainer' + i + '_gallery' + j) {
4498
+ previousItem = gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)];
4499
+ }
4500
+ if (galleryEle.id === itemID + '_galleryContainer' + i + '_gallery' + j) {
4501
+ currentItem = gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)];
4502
+ }
4503
+ }
4504
+ }
4505
+ var galleryItem = document.querySelectorAll('#' + galleryEle.id);
4506
+ var selectingEventArgs = { cancel: false, name: 'beforeSelect', previousItem: previousItem, currentItem: currentItem, isInteracted: isInteracted, event: event };
4507
+ if (gallerySettings.beforeSelect) {
4508
+ gallerySettings.beforeSelect.call(this, selectingEventArgs);
4509
+ }
4510
+ if (selectingEventArgs.cancel) {
4511
+ return;
4512
+ }
4513
+ else {
4514
+ for (var i = 0; i < selctedGalleryItem.length; i++) {
4515
+ selctedGalleryItem[parseInt(i.toString(), 10)].classList.remove('e-ribbon-gallery-selected');
4516
+ }
4517
+ for (var i = 0; i < galleryItem.length; i++) {
4518
+ galleryItem[parseInt(i.toString(), 10)].classList.add('e-ribbon-gallery-selected');
4519
+ }
4520
+ var selectedEventArgs = { previousItem: previousItem, currentItem: currentItem, name: 'select', isInteracted: isInteracted, event: event };
4521
+ var galleryPopupItems = document.querySelectorAll('#' + itemID + '_popupContainer .e-ribbon-gallery-item');
4522
+ for (var i = 0; i < galleryPopupItems.length; i++) {
4523
+ if (galleryPopupItems[parseInt(i.toString(), 10)].id === galleryEle.id) {
4524
+ gallerySettings.selectedItemIndex = i;
4525
+ break;
4526
+ }
4527
+ }
4528
+ if (gallerySettings.select) {
4529
+ gallerySettings.select.call(this, selectedEventArgs);
4530
+ }
4531
+ }
4532
+ };
4533
+ RibbonGallery.prototype.popupEvents = function (args, gallerySettings, name, isOpen) {
4534
+ var popupEventArgs = { cancel: false, event: args, name: name };
4535
+ if (isOpen && gallerySettings.popupOpen) {
4536
+ gallerySettings.popupOpen.call(this, popupEventArgs);
4537
+ }
4538
+ else if (!isOpen && gallerySettings.popupClose) {
4539
+ gallerySettings.popupClose.call(this, popupEventArgs);
4540
+ }
4541
+ if (popupEventArgs.cancel) {
4542
+ return true;
4543
+ }
4544
+ return false;
4545
+ };
4546
+ RibbonGallery.prototype.showPopup = function (popup, popupEle, args, gallerySettings, itemID) {
4547
+ var isCancelled = this.popupEvents(args, gallerySettings, 'popupOpen', true);
4548
+ if (isCancelled) {
4549
+ return;
4550
+ }
4551
+ popup.show();
4552
+ this.checkCollision(popup, popupEle);
4553
+ var buttonEle = document.querySelector('#' + itemID + '_popupButton');
4554
+ buttonEle.classList.add('e-gallery-button-active');
4555
+ var buttonPosition = buttonEle.getBoundingClientRect();
4556
+ var offsetX = Math.abs((popupEle.offsetWidth - buttonPosition.left)) + buttonEle.offsetWidth;
4557
+ popupEle.style.left = offsetX + 'px';
4558
+ popupEle.style.top = popupEle.getBoundingClientRect().top + 2 + 'px';
4559
+ this.setFoucsToFirstItem(popupEle, false, itemID, popup, gallerySettings);
4560
+ };
4561
+ RibbonGallery.prototype.hidePopup = function (popup, popupEle, args, gallerySettings, itemID) {
4562
+ var isCancelled = this.popupEvents(args, gallerySettings, 'popupClose', false);
4563
+ if (isCancelled) {
4564
+ return;
4565
+ }
4566
+ popup.hide();
4567
+ var buttonEle = document.querySelector('#' + itemID + '_popupButton');
4568
+ buttonEle.classList.remove('e-gallery-button-active');
4569
+ };
4570
+ /**
4571
+ * Shows a specific gallery popup in the ribbon.
4572
+ *
4573
+ * @param {string} id - Gets the ribbon item id.
4574
+ * @returns {void}
4575
+ */
4576
+ RibbonGallery.prototype.showGalleryPopup = function (id) {
4577
+ var itemProp = getItem(this.parent.tabs, id);
4578
+ var popupEle = document.querySelector('#' + id + '_galleryPopup');
4579
+ var popup = getComponent(popupEle, Popup);
4580
+ this.showPopup(popup, popupEle, null, itemProp.item.gallerySettings, id);
4581
+ };
4582
+ /**
4583
+ * Hides a specific gallery popup in the ribbon.
4584
+ *
4585
+ * @param {string} id - Gets the ribbon item id.
4586
+ * @returns {void}
4587
+ */
4588
+ RibbonGallery.prototype.hideGalleryPopup = function (id) {
4589
+ var itemProp = getItem(this.parent.tabs, id);
4590
+ var popupEle = document.querySelector('#' + id + '_galleryPopup');
4591
+ var popup = getComponent(popupEle, Popup);
4592
+ this.hidePopup(popup, popupEle, null, itemProp.item.gallerySettings, id);
4593
+ };
4594
+ RibbonGallery.prototype.setFoucsToFirstItem = function (popupEle, isDropdown, itemID, popup, gallerySettings) {
4595
+ var _this = this;
4596
+ popupEle.querySelectorAll('.e-ribbon-gallery-item')[0].focus();
4597
+ this.galleryItemsIndex = 0;
4598
+ popupEle.onkeydown = function (e) {
4599
+ _this.handleGalleryPopupNavigation(e, popupEle, isDropdown, itemID, popup, gallerySettings);
4600
+ };
4601
+ };
4602
+ RibbonGallery.prototype.handleGalleryPopupNavigation = function (e, popupEle, isDropdown, itemID, popup, gallerySettings) {
4603
+ var galleryPopupEle = popupEle.querySelectorAll('.e-ribbon-gallery-item');
4604
+ if (galleryPopupEle) {
4605
+ if (e.key === 'Home') {
4606
+ this.galleryItemsIndex = 0;
4607
+ galleryPopupEle[this.galleryItemsIndex].focus();
4608
+ }
4609
+ else if (e.key === 'End') {
4610
+ this.galleryItemsIndex = galleryPopupEle.length - 1;
4611
+ galleryPopupEle[this.galleryItemsIndex].focus();
4612
+ }
4613
+ else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
4614
+ this.galleryItemsIndex++;
4615
+ if (this.galleryItemsIndex !== galleryPopupEle.length) {
4616
+ if (galleryPopupEle && (galleryPopupEle[this.galleryItemsIndex])) {
4617
+ galleryPopupEle[this.galleryItemsIndex].focus();
4618
+ }
4619
+ }
4620
+ else {
4621
+ this.galleryItemsIndex = 0;
4622
+ galleryPopupEle[this.galleryItemsIndex].focus();
4623
+ }
4624
+ }
4625
+ else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
4626
+ if (this.galleryItemsIndex !== 0) {
4627
+ this.galleryItemsIndex--;
4628
+ if (galleryPopupEle && (galleryPopupEle[this.galleryItemsIndex])) {
4629
+ galleryPopupEle[this.galleryItemsIndex].focus();
4630
+ }
4631
+ }
4632
+ else {
4633
+ this.galleryItemsIndex = galleryPopupEle.length - 1;
4634
+ galleryPopupEle[this.galleryItemsIndex].focus();
4635
+ }
4636
+ }
4637
+ else if (e.key === 'Enter' || e.code === 'Space') {
4638
+ galleryPopupEle[this.galleryItemsIndex].click();
4639
+ }
4640
+ else if (e.key === 'Escape' && !isDropdown) {
4641
+ this.hidePopup(popup, popupEle, e, gallerySettings, itemID);
4642
+ }
4643
+ }
4644
+ };
4645
+ RibbonGallery.prototype.createGalleryTemplate = function (galleryItemEle, gallerySettings, id, items) {
4646
+ galleryItemEle.classList.add('e-ribbon-gallery-template');
4647
+ var templateName = 'ribbon' + id + 'galleryTemplate';
4648
+ this.parent['clearTemplate']([templateName]);
4649
+ var templateFunction = getTemplateFunction(gallerySettings.template);
4650
+ if (items.disabled) {
4651
+ galleryItemEle.classList.add('e-disabled');
4652
+ }
4653
+ if (items.cssClass) {
4654
+ galleryItemEle.classList.add(items.cssClass);
4655
+ }
4656
+ append(templateFunction({ items: items }, this, templateName, (id + 'galleryTemplate'), this.parent.isStringTemplate), galleryItemEle);
4657
+ this.parent['renderReactTemplates']();
4658
+ };
4659
+ RibbonGallery.prototype.createGalleryPopupTemplate = function (galleryItemEle, gallerySettings, id, items) {
4660
+ galleryItemEle.classList.add('e-ribbon-gallery-popup-template');
4661
+ var templateName = 'ribbon' + id + 'galleryPopupTemplate';
4662
+ this.parent['clearTemplate']([templateName]);
4663
+ var templateFunction = getTemplateFunction(gallerySettings.popupTemplate);
4664
+ if (items.disabled) {
4665
+ galleryItemEle.classList.add('e-disabled');
4666
+ }
4667
+ if (items.cssClass) {
4668
+ galleryItemEle.classList.add(items.cssClass);
4669
+ }
4670
+ append(templateFunction({ items: items }, this, templateName, (id + 'galleryPopupTemplate'), this.parent.isStringTemplate), galleryItemEle);
4671
+ this.parent['renderReactTemplates']();
4672
+ };
4673
+ return RibbonGallery;
4674
+ }());
4675
+
4676
+ var __extends = (undefined && undefined.__extends) || (function () {
4677
+ var extendStatics = function (d, b) {
4678
+ extendStatics = Object.setPrototypeOf ||
4679
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4680
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
4681
+ return extendStatics(d, b);
4682
+ };
4683
+ return function (d, b) {
4684
+ extendStatics(d, b);
4685
+ function __() { this.constructor = d; }
4686
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4687
+ };
4688
+ })();
4689
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4690
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4691
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4692
+ 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;
4693
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4694
+ };
4695
+ /**
4696
+ * The Ribbon Component is a structured layout to manage tools with tabs and groups.
3735
4697
  */
3736
4698
  var Ribbon = /** @__PURE__ @class */ (function (_super) {
3737
4699
  __extends(Ribbon, _super);
@@ -3758,10 +4720,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3758
4720
  this.initialize();
3759
4721
  };
3760
4722
  Ribbon.prototype.preRender = function () {
4723
+ this.keysPress = '';
3761
4724
  this.idIndex = 0;
3762
4725
  this.tooltipData = [];
3763
4726
  this.initialPropsData = {};
3764
4727
  this.hiddenElements = {};
4728
+ this.keyTipElements = {};
3765
4729
  this.hiddenGroups = [];
3766
4730
  this.isAddRemove = false;
3767
4731
  this.keyConfigs = {
@@ -3796,7 +4760,27 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3796
4760
  */
3797
4761
  Ribbon.prototype.requiredModules = function () {
3798
4762
  var modules = [];
3799
- 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] });
4763
+ modules.push({ member: 'ribbonButton', args: [this], name: 'RibbonButton' }, { member: 'ribbonDropDown', args: [this], name: 'RibbonDropDown' }, { member: 'ribbonSplitButton', args: [this], name: 'RibbonSplitButton' }, { member: 'ribbonCheckBox', args: [this], name: 'RibbonCheckBox' }, { member: 'ribbonComboBox', args: [this], name: 'RibbonComboBox' }, { member: 'ribbonGroupButton', args: [this], name: 'RibbonGroupButton' });
4764
+ var canInjectColorPickerModule = getItem(this.tabs, null, RibbonItemType.ColorPicker);
4765
+ var canInjectGalleryModule = getItem(this.tabs, null, RibbonItemType.Gallery);
4766
+ if (canInjectColorPickerModule) {
4767
+ modules.push({ member: 'ribbonColorPicker', args: [this], name: 'RibbonColorPicker' });
4768
+ }
4769
+ if (canInjectGalleryModule) {
4770
+ modules.push({ member: 'ribbonGallery', args: [this], name: 'RibbonGallery' });
4771
+ }
4772
+ if (this.backStageMenu.visible || this.backStageMenu.items.length) {
4773
+ modules.push({ member: 'ribbonBackstage', args: [this], name: 'RibbonBackstage' });
4774
+ }
4775
+ if (this.fileMenu.visible || this.fileMenu.menuItems.length) {
4776
+ modules.push({ member: 'ribbonFileMenu', args: [this], name: 'RibbonFileMenu' });
4777
+ }
4778
+ if (this.contextualTabs.length) {
4779
+ modules.push({ member: 'ribbonContextualTab', args: [this], name: 'RibbonContextualTab' });
4780
+ }
4781
+ if (this.enableKeyTips) {
4782
+ modules.push({ member: 'ribbonKeyTip', args: [this], name: 'RibbonKeyTip' });
4783
+ }
3800
4784
  return modules;
3801
4785
  };
3802
4786
  Ribbon.prototype.initialize = function () {
@@ -3807,6 +4791,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3807
4791
  }
3808
4792
  this.element.style.width = formatUnit(this.width);
3809
4793
  this.renderTabs();
4794
+ if (this.ribbonContextualTabModule) {
4795
+ this.ribbonContextualTabModule.addContextualTabs();
4796
+ }
3810
4797
  if (this.ribbonFileMenuModule) {
3811
4798
  this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
3812
4799
  }
@@ -3816,13 +4803,18 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3816
4803
  this.createHelpPaneTemplate();
3817
4804
  var toolbar = this.tabObj['tbObj'];
3818
4805
  toolbar.refreshOverflow();
4806
+ this.addTabOverflowKeyTip();
3819
4807
  createTooltip(this.element, this);
4808
+ this.isKeytipOpen = false;
3820
4809
  this.wireEvents();
3821
4810
  this.wireKeyboardEvent();
3822
4811
  this.currentControlIndex = 0;
3823
4812
  };
3824
4813
  Ribbon.prototype.wireEvents = function () {
3825
4814
  EventHandler.add(window, 'resize', this.resizeHandler, this);
4815
+ EventHandler.add(document.body, 'keydown', this.keytipActionHandler, this);
4816
+ EventHandler.add(document, 'mousedown', this.mouseEventHandler, this);
4817
+ EventHandler.add(document, 'scroll', this.mouseEventHandler, this);
3826
4818
  };
3827
4819
  Ribbon.prototype.wireKeyboardEvent = function () {
3828
4820
  this.keyboardModuleRibbon = new KeyboardEvents(this.element, {
@@ -3838,7 +4830,8 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3838
4830
  var activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
3839
4831
  var controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
3840
4832
  var templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
3841
- var ribbonControls = controlElements.concat(templateElements);
4833
+ var galleryElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-gallery-item'));
4834
+ var ribbonControls = controlElements.concat(templateElements, galleryElements);
3842
4835
  var comboBoxElements = activeContent.querySelectorAll('.e-combobox');
3843
4836
  var comboBoxEle;
3844
4837
  if (comboBoxElements) {
@@ -3867,7 +4860,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3867
4860
  if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
3868
4861
  e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
3869
4862
  e.target.classList.contains('e-ribbon-first-item') || e.target.classList.contains('e-ribbon-group-of-btn') ||
3870
- e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template')) {
4863
+ e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-gallery-item')) {
3871
4864
  switch (e.action) {
3872
4865
  case 'rightarrow':
3873
4866
  this.handleNavigation(e, !this.enableRtl, ribbonControls);
@@ -3909,7 +4902,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3909
4902
  }
3910
4903
  }
3911
4904
  if ((!enableRtl && (this.currentControlIndex > 0)) || (enableRtl && (this.currentControlIndex < ribbonControls.length - 1))) {
3912
- if (!e.target.classList.contains('e-combobox') && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template')) && !e.target.classList.contains('e-ribbon-last-item')) {
4905
+ if (!e.target.classList.contains('e-combobox') && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-gallery-item')) && !e.target.classList.contains('e-ribbon-last-item')) {
3913
4906
  if (enableRtl) {
3914
4907
  this.currentControlIndex++;
3915
4908
  }
@@ -4068,6 +5061,111 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4068
5061
  }
4069
5062
  }
4070
5063
  }
5064
+ var galleryPopupEle = document.querySelector('.e-ribbon-gallery-popup.e-popup-open');
5065
+ if (galleryPopupEle) {
5066
+ var popup = getComponent(galleryPopupEle, Popup);
5067
+ popup.hide();
5068
+ }
5069
+ if (this.ribbonKeyTipModule && this.enableKeyTips) {
5070
+ this.ribbonKeyTipModule.removeKeytip();
5071
+ }
5072
+ };
5073
+ Ribbon.prototype.mouseEventHandler = function (e) {
5074
+ if (this.ribbonKeyTipModule && this.enableKeyTips) {
5075
+ this.ribbonKeyTipModule.removeKeytip();
5076
+ }
5077
+ };
5078
+ Ribbon.prototype.keytipActionHandler = function (e) {
5079
+ if (this.enableKeyTips) {
5080
+ var isKeyTipPresent = false;
5081
+ var keyPress = e.key;
5082
+ if (e.altKey && e.key === 'Meta') {
5083
+ var activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
5084
+ if (activePopup.length) {
5085
+ for (var i = 0; i < activePopup.length; i++) {
5086
+ var dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
5087
+ dropDownBtn.toggle();
5088
+ }
5089
+ this.ribbonKeyTipModule.removeKeytip();
5090
+ }
5091
+ else {
5092
+ if (!this.isKeytipOpen) {
5093
+ var backstagePopup = document.querySelector('.e-ribbon-backstage-popup');
5094
+ if (backstagePopup && backstagePopup.classList.contains('e-popup-open')) {
5095
+ this.ribbonBackstageModule.hideBackstage();
5096
+ }
5097
+ this.ribbonKeyTipModule.createKeytip('tab');
5098
+ }
5099
+ else {
5100
+ this.ribbonKeyTipModule.removeKeytip();
5101
+ }
5102
+ }
5103
+ }
5104
+ else if (e.key === 'Escape' || e.key === 'Tab' || e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'ArrowRight' || e.key === 'ArrowDown') {
5105
+ this.ribbonKeyTipModule.removeKeytip(e.key);
5106
+ }
5107
+ else {
5108
+ var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
5109
+ if (keyTipItems) {
5110
+ for (var i = 0; i < keyTipItems.length; i++) {
5111
+ var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
5112
+ if (keyTipItem.innerHTML.toLowerCase() === keyPress) {
5113
+ isKeyTipPresent = true;
5114
+ this.ribbonKeyTipModule.keytipPress(keyPress);
5115
+ break;
5116
+ }
5117
+ }
5118
+ if (!isKeyTipPresent) {
5119
+ this.checkKeyTipPresent(keyPress, this.keysPress.length);
5120
+ }
5121
+ }
5122
+ }
5123
+ }
5124
+ };
5125
+ Ribbon.prototype.checkKeyTipPresent = function (keyTip, length) {
5126
+ var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
5127
+ for (var i = 0; i < keyTipItems.length; i++) {
5128
+ var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
5129
+ if (keyTipItem.innerHTML.length > 1 && keyTipItem.innerHTML[parseInt(length.toString(), 10)].toLowerCase() === keyTip) {
5130
+ this.keysPress += keyTip;
5131
+ this.ribbonKeyTipModule.keytipPress(this.keysPress);
5132
+ this.removeKeytip(this.keysPress);
5133
+ break;
5134
+ }
5135
+ }
5136
+ };
5137
+ Ribbon.prototype.removeKeytip = function (keyTip) {
5138
+ var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
5139
+ for (var i = 0; i < keyTipItems.length; i++) {
5140
+ var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
5141
+ if (keyTipItem.innerHTML[0].toLowerCase() !== keyTip && keyTip !== '') {
5142
+ remove(keyTipItem);
5143
+ }
5144
+ }
5145
+ };
5146
+ Ribbon.prototype.addKeyTip = function (tabIndex, keyTip, id, type) {
5147
+ if (this.keyTipElements && this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
5148
+ var isKeyTipExist = false;
5149
+ /* eslint-disable */
5150
+ if (!(this.keyTipElements[parseInt(tabIndex.toString(), 10)][type])) {
5151
+ this.keyTipElements[parseInt(tabIndex.toString(), 10)][type] = [];
5152
+ }
5153
+ if (Object.keys(this.keyTipElements[tabIndex][type]).length) {
5154
+ var keytipData = this.keyTipElements[tabIndex][type];
5155
+ for (var i = 0; i < Object.keys(this.keyTipElements[tabIndex][type]).length; i++) {
5156
+ if (keytipData[parseInt(i.toString(), 10)].id === id) {
5157
+ isKeyTipExist = true;
5158
+ }
5159
+ }
5160
+ if (!isKeyTipExist) {
5161
+ this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
5162
+ }
5163
+ }
5164
+ else {
5165
+ this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
5166
+ }
5167
+ /* eslint-enable */
5168
+ }
4071
5169
  };
4072
5170
  Ribbon.prototype.renderTabs = function () {
4073
5171
  this.tabsInternal = this.tabs.slice();
@@ -4130,14 +5228,20 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4130
5228
  this.renderInitialTab(this.selectedTab);
4131
5229
  };
4132
5230
  Ribbon.prototype.ribbonTabSelected = function (e) {
5231
+ e.preventFocus = true;
4133
5232
  this.isAddRemove = false;
4134
5233
  var selectedTabId = e.selectedItem.getAttribute('data-id');
4135
5234
  var selectedIndex = getIndex(this.tabs, (function (tab) { return (tab.id === selectedTabId); }));
4136
5235
  selectedIndex = selectedIndex === -1 ? this.selectedTab : selectedIndex;
4137
- var eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex };
5236
+ var isContextual = this.isContextualTab(selectedTabId);
5237
+ this.updateSelectedState(selectedTabId);
5238
+ var eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex, isContextual: isContextual };
4138
5239
  this.setProperties({ selectedTab: selectedIndex }, true);
4139
5240
  this.calculateHiddenElementsWidth(selectedIndex);
4140
5241
  this.checkOverflow(selectedIndex, e.selectedContent.firstChild);
5242
+ if (this.activeLayout === 'Classic' && this.ribbonGalleryModule) {
5243
+ this.ribbonGalleryModule.checkAvailableHeight(selectedIndex, e.selectedContent.firstChild);
5244
+ }
4141
5245
  if (this.activeLayout === 'Simplified' && this.overflowDDB) {
4142
5246
  var overflowTarget = this.overflowDDB.target;
4143
5247
  var ofTabContainer = overflowTarget.querySelector('.' + RIBBON_TAB_ACTIVE);
@@ -4156,6 +5260,20 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4156
5260
  }
4157
5261
  this.trigger('tabSelected', eventArgs);
4158
5262
  };
5263
+ Ribbon.prototype.updateSelectedState = function (tabID) {
5264
+ if (this.contextualTabs.length) {
5265
+ for (var i = 0; i < this.contextualTabs.length; i++) {
5266
+ var isSelected = false;
5267
+ for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
5268
+ if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
5269
+ isSelected = true;
5270
+ break;
5271
+ }
5272
+ }
5273
+ this.contextualTabs[parseInt(i.toString(), 10)].setProperties({ isSelected: isSelected }, true);
5274
+ }
5275
+ }
5276
+ };
4159
5277
  Ribbon.prototype.checkOverflow = function (tabIndex, activeContent) {
4160
5278
  var tabContent = activeContent.closest('.' + TAB_CONTENT);
4161
5279
  var isOverFlow = tabContent.offsetWidth < activeContent.offsetWidth;
@@ -4205,6 +5323,17 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4205
5323
  }
4206
5324
  }
4207
5325
  }
5326
+ this.addTabOverflowKeyTip();
5327
+ };
5328
+ Ribbon.prototype.addTabOverflowKeyTip = function () {
5329
+ var tabOverflow = this.tabObj.element.querySelector('#_nav');
5330
+ if (tabOverflow) {
5331
+ this.keyTipElements['taboverflow'] = [];
5332
+ this.keyTipElements['taboverflow'].push({ id: tabOverflow.id, type: 'taboverflow', keyTip: '00' });
5333
+ }
5334
+ else {
5335
+ delete (this.keyTipElements['taboverflow']);
5336
+ }
4208
5337
  };
4209
5338
  Ribbon.prototype.checkSimplifiedItemShrinking = function (tabIndex, tabContent, activeContent) {
4210
5339
  var tab = this.tabs[parseInt(tabIndex.toString(), 10)];
@@ -4339,7 +5468,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4339
5468
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
4340
5469
  this.setItemSize(itemEle, item);
4341
5470
  }
4342
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
5471
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
4343
5472
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, true);
4344
5473
  }
4345
5474
  }
@@ -4369,7 +5498,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4369
5498
  return isEmptyCollection;
4370
5499
  };
4371
5500
  Ribbon.prototype.updatePopupItems = function (item, itemEle, isGroupOF, isMenu) {
4372
- var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
5501
+ var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.Gallery || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
4373
5502
  var dropDownPopup = dropdown.dropDown;
4374
5503
  // popup is on right if (isGroupOF && isMenu)
4375
5504
  // The position is reversed if RTL is enabled.
@@ -4435,7 +5564,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4435
5564
  break;
4436
5565
  }
4437
5566
  var groupEle = tabContent.querySelector('#' + collection.id);
4438
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
5567
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
4439
5568
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
4440
5569
  }
4441
5570
  groupEle.append(itemContainer);
@@ -4554,19 +5683,22 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4554
5683
  };
4555
5684
  Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
4556
5685
  var overflowButton;
5686
+ var overflowtarget;
4557
5687
  var itemProp = getGroup(this.tabs, groupId);
4558
5688
  var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
4559
5689
  var groupEle = contentEle.querySelector('#' + groupId);
4560
5690
  if (isGroupOF) {
4561
5691
  var overflowDDB = groupContainer.querySelector('#' + groupId + GROUPOF_BUTTON_ID);
4562
5692
  if (!overflowDDB) {
4563
- overflowButton = this.addOverflowButton(groupId + GROUPOF_BUTTON_ID);
5693
+ overflowButton = this.addOverflowButton(groupId + GROUPOF_BUTTON_ID, isGroupOF);
4564
5694
  overflowButton.element.classList.add(RIBBON_GROUP_OF_BUTTON);
4565
5695
  groupContainer.appendChild(overflowButton.element);
4566
5696
  }
4567
5697
  else {
4568
5698
  overflowButton = getInstance(overflowDDB, DropDownButton);
4569
5699
  }
5700
+ this.addKeyTip(tabIndex, '0' + (itemProp.groupIndex + 1), overflowButton.element.id, 'grpofbtn');
5701
+ overflowtarget = overflowButton.target;
4570
5702
  var overflowBtnTarget = overflowButton.target;
4571
5703
  var headerEle = overflowBtnTarget.querySelector('#' + groupId + GROUPOF_BUTTON_ID + HEADER_ID);
4572
5704
  if (!headerEle) {
@@ -4595,7 +5727,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4595
5727
  }
4596
5728
  else {
4597
5729
  if (!this.overflowDDB) {
4598
- this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + OVRLOF_BUTTON_ID);
5730
+ this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + OVRLOF_BUTTON_ID, isGroupOF);
4599
5731
  this.tabObj.element.insertBefore(this.overflowDDB.element, this.collapseButton);
4600
5732
  this.overflowDDB.element.classList.add(RIBBON_OVERALL_OF_BUTTON);
4601
5733
  this.createOfTabContainer(groupId, groupHeader, itemEle, tabIndex);
@@ -4628,10 +5760,16 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4628
5760
  }
4629
5761
  }
4630
5762
  overflowButton = this.overflowDDB;
5763
+ overflowtarget = this.overflowDDB ? this.overflowDDB.target : null;
4631
5764
  }
4632
5765
  if (itemEle !== null) {
4633
5766
  this.addOverflowEvents(item, itemEle, overflowButton);
4634
5767
  }
5768
+ if (overflowtarget) {
5769
+ if (item.keyTip) {
5770
+ this.addKeyTip(tabIndex, item.keyTip, item.id, 'popupitem');
5771
+ }
5772
+ }
4635
5773
  };
4636
5774
  Ribbon.prototype.addOverflowEvents = function (item, itemEle, overflowButton) {
4637
5775
  switch (item.type) {
@@ -4653,6 +5791,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4653
5791
  case 'ComboBox':
4654
5792
  this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
4655
5793
  break;
5794
+ case 'Gallery':
5795
+ if (this.activeLayout === 'Simplified') {
5796
+ this.ribbonGalleryModule.addOverFlowEvents(item, itemEle, overflowButton);
5797
+ }
5798
+ break;
4656
5799
  case 'GroupButton':
4657
5800
  if (this.activeLayout === 'Simplified') {
4658
5801
  this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
@@ -5331,6 +6474,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5331
6474
  this_1.checkSmallToMedium(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
5332
6475
  this_1.checkMediumToLarge(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
5333
6476
  var dropdown = this_1.ribbonDropDownModule.createOverFlowDropDown(group.id, group.header, group.groupIconCss, groupContainer, groupOverFlow, this_1.enableRtl);
6477
+ if (group.keyTip) {
6478
+ var overflowDDB = group.id + OVERFLOW_ID + DROPDOWN_ID;
6479
+ this_1.addKeyTip(tabIndex, group.keyTip, overflowDDB, 'grpoverflow');
6480
+ }
5334
6481
  this_1.tabs[parseInt(tabIndex.toString(), 10)].
5335
6482
  groups[parseInt(groupIndex.toString(), 10)].setProperties({ isCollapsed: true }, true);
5336
6483
  for (var j = 0; j < group.collections.length; j++) {
@@ -5343,6 +6490,25 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5343
6490
  this_1.handleContentSize(itemEle);
5344
6491
  this_1.addOverflowEvents(item, itemEle, dropdown);
5345
6492
  }
6493
+ var overflowDDB = document.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID);
6494
+ var overflowButton = getInstance(overflowDDB, DropDownButton);
6495
+ if (overflowButton) {
6496
+ var overflowtarget = overflowButton.target;
6497
+ if (overflowtarget) {
6498
+ if (this_1.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
6499
+ if (item.type === RibbonItemType.GroupButton) {
6500
+ for (var i_3 = 0; i_3 < item.groupButtonSettings.items.length; i_3++) {
6501
+ if (item.groupButtonSettings.items[parseInt(i_3.toString(), 10)].keyTip) {
6502
+ this_1.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i_3.toString(), 10)].keyTip, item.id + (RIBBON_GROUP_BUTTON_ID + i_3), 'grpoverflowpopup');
6503
+ }
6504
+ }
6505
+ }
6506
+ if (item.keyTip) {
6507
+ this_1.addKeyTip(tabIndex, item.keyTip, item.id, 'grpoverflowpopup');
6508
+ }
6509
+ }
6510
+ }
6511
+ }
5346
6512
  }
5347
6513
  }
5348
6514
  };
@@ -5441,16 +6607,31 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5441
6607
  this.removeOverflowDropdown(activeContent, tabContent, true, index);
5442
6608
  }
5443
6609
  };
6610
+ Ribbon.prototype.isContextualTab = function (tabID) {
6611
+ var isContextual = false;
6612
+ if (this.contextualTabs.length) {
6613
+ for (var i = 0; i < this.contextualTabs.length; i++) {
6614
+ for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
6615
+ if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
6616
+ isContextual = true;
6617
+ break;
6618
+ }
6619
+ }
6620
+ }
6621
+ }
6622
+ return isContextual;
6623
+ };
5444
6624
  Ribbon.prototype.ribbonTabSelecting = function (e) {
5445
6625
  var _this = this;
5446
6626
  this.currentControlIndex = 0;
5447
6627
  var nextTabId = e.selectingItem.getAttribute('data-id');
5448
6628
  var previousTabId = e.previousItem.getAttribute('data-id');
5449
6629
  var nextIndex = getIndex(this.tabs, (function (tab) { return (tab.id === nextTabId); }));
6630
+ var isContextual = this.isContextualTab(nextTabId);
5450
6631
  var previousIndex = getIndex(this.tabs, (function (tab) { return (tab.id === previousTabId); }));
5451
6632
  nextIndex = nextIndex === -1 ? this.selectedTab : nextIndex;
5452
6633
  var eventArgs = {
5453
- cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex
6634
+ cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex, isContextual: isContextual
5454
6635
  };
5455
6636
  this.trigger('tabSelecting', eventArgs, function (args) {
5456
6637
  if (args.cancel) {
@@ -5470,22 +6651,33 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5470
6651
  Ribbon.prototype.createTabItems = function (tabs) {
5471
6652
  var _this = this;
5472
6653
  var tabItems = [];
5473
- for (var i = 0; i < tabs.length; i++) {
6654
+ var _loop_3 = function (i) {
5474
6655
  var ribbonTab = tabs[parseInt(i.toString(), 10)];
5475
- var header = this.createElement('span', {
6656
+ var header = this_3.createElement('span', {
5476
6657
  innerHTML: ribbonTab.header,
5477
6658
  id: ribbonTab.id + HEADER_ID
5478
6659
  });
6660
+ var tabIndex = getIndex(this_3.tabs, (function (tab) { return (tab.id === ribbonTab.id); }));
6661
+ if (ribbonTab.keyTip) {
6662
+ if (!this_3.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
6663
+ this_3.keyTipElements[parseInt(tabIndex.toString(), 10)] = {};
6664
+ }
6665
+ this_3.addKeyTip(tabIndex, ribbonTab.keyTip, ribbonTab.id, 'tab');
6666
+ }
5479
6667
  header.onclick = function () { _this.minimize(false); };
5480
6668
  header.ondblclick = function () { _this.minimize(true); };
5481
6669
  var tab = { header: { text: header }, id: ribbonTab.id, cssClass: ribbonTab.cssClass };
5482
- var content = this.createElement('div', {
6670
+ var content = this_3.createElement('div', {
5483
6671
  className: tab.cssClass,
5484
6672
  id: ribbonTab.id + CONTENT_ID
5485
6673
  });
5486
6674
  content.classList.add(RIBBON_TAB_ITEM);
5487
6675
  tab.content = content;
5488
6676
  tabItems.push(tab);
6677
+ };
6678
+ var this_3 = this;
6679
+ for (var i = 0; i < tabs.length; i++) {
6680
+ _loop_3(i);
5489
6681
  }
5490
6682
  return tabItems;
5491
6683
  };
@@ -5498,8 +6690,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5498
6690
  }
5499
6691
  var activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
5500
6692
  this.checkOverflow(this.selectedTab, activeContent);
6693
+ if (this.activeLayout === 'Classic' && this.ribbonGalleryModule)
6694
+ this.ribbonGalleryModule.checkAvailableHeight(this.selectedTab, activeContent);
5501
6695
  };
5502
- Ribbon.prototype.addOverflowButton = function (btnId) {
6696
+ Ribbon.prototype.addOverflowButton = function (btnId, isGroupOF) {
5503
6697
  var _this = this;
5504
6698
  var overflowButton = this.createElement('button', {
5505
6699
  id: btnId
@@ -5536,6 +6730,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5536
6730
  }, overflowButton);
5537
6731
  this.element.classList.add(RIBBON_OVERFLOW);
5538
6732
  createTooltip(overflowTarget, this);
6733
+ if (!isGroupOF) {
6734
+ this.keyTipElements['overflowbtn'] = [];
6735
+ this.keyTipElements['overflowbtn'].push({ id: btnId, type: 'overflowbtn', keyTip: '00' });
6736
+ }
5539
6737
  var isGroupOf;
5540
6738
  overflowButton.onkeydown = overflowButton.onclick = function () { _this.itemIndex = -1; isGroupOf = overflowButton.classList.contains('e-ribbon-overall-of-btn') ? false : true; };
5541
6739
  overflowTarget.onkeydown = function (e) { return (_this.upDownKeyHandler(e, overflowTarget, isGroupOf), _this); };
@@ -5696,6 +6894,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5696
6894
  case 'ComboBox':
5697
6895
  this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
5698
6896
  break;
6897
+ case 'Gallery':
6898
+ this.ribbonGalleryModule.removeOverFlowEvents(item, itemEle);
6899
+ break;
5699
6900
  case 'GroupButton':
5700
6901
  this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
5701
6902
  break;
@@ -5733,6 +6934,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5733
6934
  this.collapseButton.classList.add(RIBBON_EXPAND_BUTTON);
5734
6935
  }
5735
6936
  this.tabObj.element.appendChild(this.collapseButton);
6937
+ if (this.layoutSwitcherKeyTip) {
6938
+ this.keyTipElements['collapse'] = [];
6939
+ this.keyTipElements['collapse'].push({ id: this.collapseButton.id, type: 'collapse', keyTip: this.layoutSwitcherKeyTip });
6940
+ }
5736
6941
  };
5737
6942
  Ribbon.prototype.removeExpandCollapse = function () {
5738
6943
  var _this = this;
@@ -5835,22 +7040,22 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5835
7040
  var activeContent = this.tabObj.element.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + CONTENT_ID);
5836
7041
  var tabContent = activeContent.closest('.' + TAB_CONTENT);
5837
7042
  if (this.activeLayout === 'Simplified') {
5838
- for (var i_3 = 0; i_3 < groupList.length; i_3++) {
5839
- var group = groupList[parseInt(i_3.toString(), 10)];
5840
- var alignType = groupList[parseInt(i_3.toString(), 10)].orientation;
7043
+ for (var i_4 = 0; i_4 < groupList.length; i_4++) {
7044
+ var group = groupList[parseInt(i_4.toString(), 10)];
7045
+ var alignType = groupList[parseInt(i_4.toString(), 10)].orientation;
5841
7046
  if (group.isCollapsed) {
5842
7047
  group.setProperties({ isCollapsed: false }, true);
5843
7048
  this.removeDropdown(group.id);
5844
7049
  }
5845
7050
  else {
5846
- this.checkSmallToMedium(tabIndex, tab, i_3, tabContent, activeContent, true, false);
5847
- this.checkMediumToLarge(tabIndex, tab, i_3, tabContent, activeContent, true, false);
7051
+ this.checkSmallToMedium(tabIndex, tab, i_4, tabContent, activeContent, true, false);
7052
+ this.checkMediumToLarge(tabIndex, tab, i_4, tabContent, activeContent, true, false);
5848
7053
  }
5849
7054
  var groupEle = tabContent.querySelector('#' + group.id);
5850
7055
  var groupContainer = groupEle.querySelector('#' + group.id + CONTAINER_ID);
5851
7056
  var shrinkColumns = groupContainer.querySelectorAll('.' + 'e-ribbon-shrink');
5852
- for (var i_4 = 0; i_4 < shrinkColumns.length; i_4++) {
5853
- shrinkColumns[parseInt(i_4.toString(), 10)].remove();
7057
+ for (var i_5 = 0; i_5 < shrinkColumns.length; i_5++) {
7058
+ shrinkColumns[parseInt(i_5.toString(), 10)].remove();
5854
7059
  }
5855
7060
  var groupHeader = groupContainer.querySelector('#' + group.id + HEADER_ID);
5856
7061
  groupHeader.remove();
@@ -5896,7 +7101,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5896
7101
  itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
5897
7102
  if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
5898
7103
  this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemEle, groupContainer);
5899
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
7104
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
5900
7105
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
5901
7106
  }
5902
7107
  }
@@ -5909,6 +7114,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5909
7114
  this.setItemSize(ele, item);
5910
7115
  }
5911
7116
  }
7117
+ if (item.type === RibbonItemType.Gallery) {
7118
+ this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
7119
+ }
5912
7120
  }
5913
7121
  }
5914
7122
  if (!(group.enableGroupOverflow || groupEle.querySelector('.' + RIBBON_ITEM))) {
@@ -5918,9 +7126,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5918
7126
  }
5919
7127
  else {
5920
7128
  this.element.classList.remove(RIBBON_OVERFLOW);
5921
- for (var i_5 = 0; i_5 < groupList.length; i_5++) {
5922
- var group = groupList[parseInt(i_5.toString(), 10)];
5923
- var alignType = groupList[parseInt(i_5.toString(), 10)].orientation;
7129
+ for (var i_6 = 0; i_6 < groupList.length; i_6++) {
7130
+ var group = groupList[parseInt(i_6.toString(), 10)];
7131
+ var alignType = groupList[parseInt(i_6.toString(), 10)].orientation;
5924
7132
  var groupContainer = tabContent.querySelector('#' + group.id + CONTAINER_ID);
5925
7133
  var groupContent = groupContainer.querySelector('#' + group.id + CONTENT_ID);
5926
7134
  var groupHeader = this.createElement('div', {
@@ -5992,7 +7200,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5992
7200
  var itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
5993
7201
  if (!itemEle && overflowtarget) {
5994
7202
  itemEle = overflowtarget.querySelector('#' + item.id + CONTAINER_ID);
5995
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
7203
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
5996
7204
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
5997
7205
  }
5998
7206
  this.removeOverflowEvent(item, itemEle);
@@ -6012,6 +7220,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6012
7220
  (item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
6013
7221
  item.setProperties({ activeSize: itemsize }, true);
6014
7222
  this.setItemSize(ele, item);
7223
+ if (item.type === RibbonItemType.Gallery) {
7224
+ this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
7225
+ }
6015
7226
  }
6016
7227
  if (group.enableGroupOverflow && overflowDDB) {
6017
7228
  if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
@@ -6031,7 +7242,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6031
7242
  this.overflowDDB = null;
6032
7243
  }
6033
7244
  };
6034
- Ribbon.prototype.createLauncherIcon = function (groupId, groupContainer) {
7245
+ Ribbon.prototype.createLauncherIcon = function (groupId, groupContainer, tabIndex) {
6035
7246
  var _this = this;
6036
7247
  var launcherIcon = this.createElement('div', {
6037
7248
  className: RIBBON_LAUNCHER_ICON_ELE + ' ' + (this.launcherIconCss ? this.launcherIconCss : RIBBON_LAUNCHER_ICON),
@@ -6046,6 +7257,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6046
7257
  _this.launcherIconClicked(groupId);
6047
7258
  }
6048
7259
  }, this);
7260
+ var itemProp = getGroup(this.tabs, groupId);
7261
+ if (itemProp.group.launcherIconKeyTip) {
7262
+ this.addKeyTip(tabIndex, itemProp.group.launcherIconKeyTip, launcherIcon.id, 'launcher');
7263
+ }
6049
7264
  };
6050
7265
  Ribbon.prototype.launcherIconClicked = function (id) {
6051
7266
  var eventArgs = { groupId: id };
@@ -6083,7 +7298,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6083
7298
  groupContainer.appendChild(groupHeader);
6084
7299
  }
6085
7300
  if (group.showLauncherIcon) {
6086
- this.createLauncherIcon(group.id, groupContainer);
7301
+ this.createLauncherIcon(group.id, groupContainer, tabIndex);
6087
7302
  }
6088
7303
  var elements = this.createCollection(group.collections, group.orientation, group.id, group.header, group.enableGroupOverflow, tabIndex, groupContainer);
6089
7304
  append(elements, groupContent);
@@ -6210,6 +7425,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6210
7425
  case 'GroupButton':
6211
7426
  this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
6212
7427
  break;
7428
+ case 'Gallery':
7429
+ this.ribbonGalleryModule.createGallery(item, itemEle);
7430
+ break;
6213
7431
  }
6214
7432
  };
6215
7433
  Ribbon.prototype.createItems = function (itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
@@ -6243,17 +7461,34 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6243
7461
  itemEle.classList.add(RIBBON_TOOLTIP_TARGET);
6244
7462
  this.tooltipData.push({ id: itemEle.id, data: item.ribbonTooltipSettings });
6245
7463
  }
6246
- var size = item.activeSize;
6247
- if (this.activeLayout === 'Simplified') {
6248
- size = ((item.allowedSizes === RibbonItemSize.Large) || (item.allowedSizes & RibbonItemSize.Medium) ||
6249
- (item.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
6250
- item.setProperties({ activeSize: size }, true);
7464
+ if (item.type === RibbonItemType.GroupButton) {
7465
+ for (var i_7 = 0; i_7 < item.groupButtonSettings.items.length; i_7++) {
7466
+ if (this.keyTipElements[parseInt(tabIndex.toString(), 10)] && item.groupButtonSettings.items[parseInt(i_7.toString(), 10)].keyTip) {
7467
+ this.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i_7.toString(), 10)].keyTip, item.id + (RIBBON_GROUP_BUTTON_ID + i_7), 'item');
7468
+ }
7469
+ }
6251
7470
  }
6252
- if (size & RibbonItemSize.Large) {
6253
- itemEle.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
7471
+ if (item.keyTip) {
7472
+ if (item.type === RibbonItemType.Gallery) {
7473
+ this.addKeyTip(tabIndex, item.keyTip, (item.id + '_popupButton'), 'item');
7474
+ }
7475
+ else {
7476
+ this.addKeyTip(tabIndex, item.keyTip, item.id, 'item');
7477
+ }
6254
7478
  }
6255
- else {
6256
- itemEle.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
7479
+ var size = item.activeSize;
7480
+ if (!(item.type === RibbonItemType.Gallery)) {
7481
+ if (this.activeLayout === 'Simplified') {
7482
+ size = ((item.allowedSizes === RibbonItemSize.Large) || (item.allowedSizes & RibbonItemSize.Medium) ||
7483
+ (item.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
7484
+ item.setProperties({ activeSize: size }, true);
7485
+ }
7486
+ if (size & RibbonItemSize.Large) {
7487
+ itemEle.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
7488
+ }
7489
+ else {
7490
+ itemEle.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
7491
+ }
6257
7492
  }
6258
7493
  var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
6259
7494
  if (initialProps && initialProps.hiddenItems && initialProps.hiddenItems.length) {
@@ -6265,7 +7500,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6265
7500
  this.createRibbonItem(item, itemEle);
6266
7501
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
6267
7502
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
6268
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
7503
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
6269
7504
  this.updatePopupItems(item, itemEle, isGroupOF, true);
6270
7505
  }
6271
7506
  }
@@ -6394,15 +7629,15 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6394
7629
  var moduleName = this.getItemModuleName(item);
6395
7630
  if (moduleName !== 'template') {
6396
7631
  if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
6397
- for (var i_6 = 0; i_6 < item.groupButtonSettings.items.length; i_6++) {
6398
- var btnEle = ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i_6);
7632
+ for (var i_8 = 0; i_8 < item.groupButtonSettings.items.length; i_8++) {
7633
+ var btnEle = ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i_8);
6399
7634
  updateCommonProperty(btnEle, 'btn', commonProp);
6400
7635
  }
6401
7636
  }
6402
7637
  else if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
6403
7638
  updateCommonProperty(ele, 'dropdown-btn', commonProp);
6404
- for (var i_7 = 0; i_7 < item.groupButtonSettings.items.length; i_7++) {
6405
- var btnEle = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i_7);
7639
+ for (var i_9 = 0; i_9 < item.groupButtonSettings.items.length; i_9++) {
7640
+ var btnEle = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i_9);
6406
7641
  updateCommonProperty(btnEle, 'btn', commonProp);
6407
7642
  }
6408
7643
  }
@@ -6462,12 +7697,18 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6462
7697
  ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
6463
7698
  contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
6464
7699
  }
7700
+ if (item.type === RibbonItemType.Gallery) {
7701
+ ele = contentEle.querySelector('#' + item.id + CONTAINER_ID);
7702
+ }
6465
7703
  }
6466
7704
  }
6467
7705
  else {
6468
7706
  //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
6469
7707
  ele = (item.displayOptions & DisplayMode.Simplified) ?
6470
7708
  contentEle.querySelector('#' + item.id) : null;
7709
+ if (item.type === RibbonItemType.Gallery) {
7710
+ ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id + CONTAINER_ID) : null;
7711
+ }
6471
7712
  // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
6472
7713
  if (!ele) {
6473
7714
  ele = dropdown ? dropdown.target.querySelector('#' + item.id) : null;
@@ -6508,18 +7749,42 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6508
7749
  else {
6509
7750
  this.ribbonGroupButtonModule.destroyDropDown(item);
6510
7751
  }
6511
- var _loop_3 = function (i) {
7752
+ var _loop_4 = function (i) {
6512
7753
  if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings) {
6513
7754
  var groupButtonID_1 = item.id + RIBBON_GROUP_BUTTON_ID + i;
6514
- var index = getIndex(this_3.tooltipData, function (e) { return e.id === groupButtonID_1; });
7755
+ var index = getIndex(this_4.tooltipData, function (e) { return e.id === groupButtonID_1; });
6515
7756
  if (index !== -1) {
6516
- this_3.tooltipData.splice(index, 1);
7757
+ this_4.tooltipData.splice(index, 1);
6517
7758
  }
6518
7759
  }
6519
7760
  };
6520
- var this_3 = this;
7761
+ var this_4 = this;
6521
7762
  for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
6522
- _loop_3(i);
7763
+ _loop_4(i);
7764
+ }
7765
+ }
7766
+ else if (moduleName === 'gallery') {
7767
+ if (ele.closest('.e-ribbon-overflow-target')) {
7768
+ destroyControl(ele, 'dropdown-btn');
7769
+ var galleryPopupEle = Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '_galleryPopup'));
7770
+ galleryPopupEle.concat(Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '-popup')));
7771
+ for (var i = 0; i < galleryPopupEle.length; i++) {
7772
+ galleryPopupEle[parseInt(i.toString(), 10)].remove();
7773
+ }
7774
+ }
7775
+ else {
7776
+ var galleryEle = ele.querySelectorAll('.e-ribbon-gallery-item');
7777
+ var galleryPopupBtn = ele.querySelector('#' + item.id + '_popupButton');
7778
+ if (galleryPopupBtn) {
7779
+ galleryPopupBtn.remove();
7780
+ }
7781
+ for (var i = 0; i < galleryEle.length; i++) {
7782
+ galleryEle[parseInt(i.toString(), 10)].remove();
7783
+ }
7784
+ var galleryPopupEle = document.querySelectorAll('#' + item.id + '_galleryPopup');
7785
+ for (var i = 0; i < galleryPopupEle.length; i++) {
7786
+ galleryPopupEle[parseInt(i.toString(), 10)].remove();
7787
+ }
6523
7788
  }
6524
7789
  }
6525
7790
  else if (moduleName !== 'template') {
@@ -6535,6 +7800,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6535
7800
  this.ribbonGroupButtonModule.destroyDropDown(item);
6536
7801
  }
6537
7802
  };
7803
+ /**
7804
+ * Gets the item module name.
7805
+ *
7806
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
7807
+ * @returns {void}
7808
+ * @hidden
7809
+ */
6538
7810
  Ribbon.prototype.getItemModuleName = function (item) {
6539
7811
  switch (item.type) {
6540
7812
  case 'Button':
@@ -6551,6 +7823,8 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6551
7823
  return 'combobox';
6552
7824
  case 'GroupButton':
6553
7825
  return 'group-btn';
7826
+ case 'Gallery':
7827
+ return 'gallery';
6554
7828
  default:
6555
7829
  return 'template';
6556
7830
  }
@@ -6590,8 +7864,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6590
7864
  * @param {string} tabId - The ID of the tab to be shown.
6591
7865
  * @returns {void}
6592
7866
  */
6593
- Ribbon.prototype.showTab = function (tabId) {
6594
- this.showHideTab(tabId, false);
7867
+ Ribbon.prototype.showTab = function (tabId, isContextual) {
7868
+ if (isContextual === void 0) { isContextual = false; }
7869
+ this.showHideTab(tabId, false, isContextual);
6595
7870
  };
6596
7871
  /**
6597
7872
  * Hides a specific tab in the ribbon.
@@ -6599,15 +7874,49 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6599
7874
  * @param {string} tabId - The ID of the tab to be hidden.
6600
7875
  * @returns {void}
6601
7876
  */
6602
- Ribbon.prototype.hideTab = function (tabId) {
6603
- this.showHideTab(tabId, true);
7877
+ Ribbon.prototype.hideTab = function (tabId, isContextual) {
7878
+ if (isContextual === void 0) { isContextual = false; }
7879
+ this.showHideTab(tabId, true, isContextual);
6604
7880
  };
6605
- Ribbon.prototype.showHideTab = function (tabId, value) {
7881
+ Ribbon.prototype.showHideTab = function (tabId, value, isContextual) {
6606
7882
  var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
6607
7883
  if (index === -1) {
6608
7884
  return;
6609
7885
  }
6610
7886
  this.tabObj.hideTab(index, value);
7887
+ if (isContextual) {
7888
+ var contextualTab_1;
7889
+ var tabEle = this.tabObj.element;
7890
+ for (var i = 0; i < this.contextualTabs.length; i++) {
7891
+ for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
7892
+ if (tabId === this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id) {
7893
+ contextualTab_1 = this.contextualTabs[parseInt(i.toString(), 10)];
7894
+ }
7895
+ }
7896
+ }
7897
+ if (contextualTab_1) {
7898
+ var isTabHidden = true;
7899
+ var _loop_5 = function (i) {
7900
+ var index_1 = getIndex(this_5.tabs, function (e) { return e.id === contextualTab_1.tabs[parseInt(i.toString(), 10)].id; });
7901
+ if (index_1 !== -1) {
7902
+ var toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index_1.toString(), 10)];
7903
+ if (!(toolbarEle.classList.contains('e-hidden'))) {
7904
+ isTabHidden = false;
7905
+ }
7906
+ }
7907
+ };
7908
+ var this_5 = this;
7909
+ for (var i = 0; i < contextualTab_1.tabs.length; i++) {
7910
+ _loop_5(i);
7911
+ }
7912
+ if (isTabHidden) {
7913
+ contextualTab_1.setProperties({ visible: false }, true);
7914
+ }
7915
+ else {
7916
+ contextualTab_1.setProperties({ visible: true }, true);
7917
+ }
7918
+ }
7919
+ }
6611
7920
  };
6612
7921
  /**
6613
7922
  * Enables a specific tab in the ribbon.
@@ -6914,8 +8223,8 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6914
8223
  var hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
6915
8224
  /* eslint-disable */
6916
8225
  if (hiddenProps && hiddenProps[key] && hiddenProps[key].length) {
6917
- var _loop_4 = function (i) {
6918
- var contentEle = this_4.tabObj.items[tabIndex].content;
8226
+ var _loop_6 = function (i) {
8227
+ var contentEle = this_6.tabObj.items[tabIndex].content;
6919
8228
  var hiddenEle;
6920
8229
  var groupEle = void 0;
6921
8230
  var isGroupHidden = false;
@@ -6937,11 +8246,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6937
8246
  groupEle = hiddenEle.closest('.e-ribbon-group');
6938
8247
  if (groupEle.classList.contains('e-hide-group')) {
6939
8248
  isGroupHidden = true;
6940
- widthDifference = this_4.checkWidthDifference(hiddenEle, groupEle);
8249
+ widthDifference = this_6.checkWidthDifference(hiddenEle, groupEle);
6941
8250
  }
6942
8251
  }
6943
- this_4.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, true, tabIndex);
6944
- this_4.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, true);
8252
+ this_6.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, true, tabIndex);
8253
+ this_6.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, true);
6945
8254
  if (isHidden) {
6946
8255
  hiddenEle.classList.add('e-hidden');
6947
8256
  }
@@ -6954,12 +8263,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6954
8263
  groupEle.classList.remove('e-hide-group');
6955
8264
  groupEle.classList.remove('e-ribbon-emptyCollection');
6956
8265
  widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
6957
- if (this_4.hiddenGroups.indexOf(groupEle.id) !== -1) {
6958
- this_4.hiddenGroups.splice(this_4.hiddenGroups.indexOf(groupEle.id), 1);
8266
+ if (this_6.hiddenGroups.indexOf(groupEle.id) !== -1) {
8267
+ this_6.hiddenGroups.splice(this_6.hiddenGroups.indexOf(groupEle.id), 1);
6959
8268
  }
6960
8269
  }
6961
8270
  else {
6962
- if (this_4.hiddenGroups.indexOf(groupEle.id) !== -1) {
8271
+ if (this_6.hiddenGroups.indexOf(groupEle.id) !== -1) {
6963
8272
  var hiddenItems = groupEle.querySelectorAll('.e-ribbon-item:not(.e-hidden)');
6964
8273
  hiddenItems.forEach(function (item) {
6965
8274
  if (item.id !== hiddenEle.id) {
@@ -6972,12 +8281,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6972
8281
  item.classList.remove('e-hidden');
6973
8282
  }
6974
8283
  });
6975
- this_4.hiddenGroups.splice(this_4.hiddenGroups.indexOf(groupEle.id), 1);
8284
+ this_6.hiddenGroups.splice(this_6.hiddenGroups.indexOf(groupEle.id), 1);
6976
8285
  }
6977
8286
  }
6978
8287
  }
6979
- this_4.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, false, tabIndex);
6980
- this_4.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, false);
8288
+ this_6.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, false, tabIndex);
8289
+ this_6.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, false);
6981
8290
  }
6982
8291
  if (isGroupHidden) {
6983
8292
  groupEle.classList.add('e-hide-group');
@@ -6991,9 +8300,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6991
8300
  }
6992
8301
  out_i_1 = i;
6993
8302
  };
6994
- var this_4 = this, out_i_1;
8303
+ var this_6 = this, out_i_1;
6995
8304
  for (var i = 0; i < hiddenProps[key].length; i++) {
6996
- _loop_4(i);
8305
+ _loop_6(i);
6997
8306
  i = out_i_1;
6998
8307
  }
6999
8308
  }
@@ -7044,9 +8353,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7044
8353
  var overflowButton = getInstance(groupOFButton[parseInt(i.toString(), 10)], DropDownButton);
7045
8354
  var overflowBtnTarget = overflowButton.target;
7046
8355
  var overflowItems = overflowBtnTarget.querySelectorAll('.e-ribbon-item');
7047
- for (var i_8 = 0; i_8 < overflowItems.length; i_8++) {
7048
- if (overflowItems[parseInt(i_8.toString(), 10)].hasAttribute('data-medium-width')) {
7049
- mediumDataItems.push(overflowItems[parseInt(i_8.toString(), 10)]);
8356
+ for (var i_10 = 0; i_10 < overflowItems.length; i_10++) {
8357
+ if (overflowItems[parseInt(i_10.toString(), 10)].hasAttribute('data-medium-width')) {
8358
+ mediumDataItems.push(overflowItems[parseInt(i_10.toString(), 10)]);
7050
8359
  }
7051
8360
  }
7052
8361
  }
@@ -7073,10 +8382,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7073
8382
  if (overflowButton) {
7074
8383
  var overflowEle = overflowButton.target;
7075
8384
  var overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
7076
- for (var i_9 = 0; i_9 < overflowItems.length; i_9++) {
7077
- var previousWidth = parseInt(overflowItems[parseInt(i_9.toString(), 10)].getAttribute('data-simplified-width'), 10);
8385
+ for (var i_11 = 0; i_11 < overflowItems.length; i_11++) {
8386
+ var previousWidth = parseInt(overflowItems[parseInt(i_11.toString(), 10)].getAttribute('data-simplified-width'), 10);
7078
8387
  if (previousWidth) {
7079
- overflowItems[parseInt(i_9.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
8388
+ overflowItems[parseInt(i_11.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
7080
8389
  }
7081
8390
  }
7082
8391
  }
@@ -7626,7 +8935,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7626
8935
  if (contentEle.innerHTML !== '') {
7627
8936
  // Check whether showLauncherIcon or orientation is passed by the user and sets the updated values.
7628
8937
  if (group.showLauncherIcon) {
7629
- this.createLauncherIcon(ribbongroup.id, groupContainer);
8938
+ this.createLauncherIcon(ribbongroup.id, groupContainer, itemProp.tabIndex);
7630
8939
  }
7631
8940
  // Check whether collections or orientation is passed by the user and sets the updated values.
7632
8941
  if (group.collections || group.orientation) {
@@ -7775,7 +9084,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7775
9084
  }
7776
9085
  if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
7777
9086
  this.createOverflowPopup(itemProp.item, itemProp.tabIndex, itemProp.group.enableGroupOverflow, itemProp.group.id, itemProp.group.header, itemContainer, groupContainer);
7778
- if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
9087
+ if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
7779
9088
  this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
7780
9089
  }
7781
9090
  }
@@ -7882,6 +9191,15 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7882
9191
  Ribbon.prototype.disableItem = function (itemId) {
7883
9192
  this.enableDisableItem(itemId, true);
7884
9193
  };
9194
+ /**
9195
+ * Gets the Ribbon item model associated with the specified item ID.
9196
+ *
9197
+ * @param {string} itemId - The unique ID of the Ribbon item.
9198
+ * @returns {RibbonItemModel}
9199
+ */
9200
+ Ribbon.prototype.getItem = function (itemId) {
9201
+ return getItem(this.tabs, itemId).item;
9202
+ };
7885
9203
  Ribbon.prototype.enableDisableItem = function (itemId, isDisabled) {
7886
9204
  var isUpdated = false;
7887
9205
  var itemProp = getItem(this.tabs, itemId);
@@ -7929,6 +9247,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7929
9247
  };
7930
9248
  Ribbon.prototype.unwireEvents = function () {
7931
9249
  EventHandler.remove(window, 'resize', this.resizeHandler);
9250
+ EventHandler.remove(document.body, 'keydown', this.keytipActionHandler);
9251
+ EventHandler.remove(document, 'mousedown', this.mouseEventHandler);
9252
+ EventHandler.remove(document, 'scroll', this.mouseEventHandler);
7932
9253
  };
7933
9254
  Ribbon.prototype.destroy = function () {
7934
9255
  this.keyboardModuleRibbon.destroy();
@@ -7956,6 +9277,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7956
9277
  this.initialPropsData = {};
7957
9278
  this.hiddenGroups = [];
7958
9279
  this.hiddenElements = {};
9280
+ this.keyTipElements = {};
7959
9281
  remove(this.element.querySelector('#' + this.element.id + TAB_ID));
7960
9282
  this.element.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
7961
9283
  this.element.style.removeProperty(RIBBON_HELP_PANE_TEMPLATE_WIDTH);
@@ -8035,7 +9357,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
8035
9357
  }
8036
9358
  break;
8037
9359
  case 'selectedTab':
8038
- this.tabObj.setProperties({ selectedItem: newProp.selectedTab });
9360
+ var tabEle = this.tabObj.element;
9361
+ var toolbarItem = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(newProp.selectedTab.toString(), 10)];
9362
+ if (!(toolbarItem.classList.contains('e-hidden') || toolbarItem.classList.contains('e-disable'))) {
9363
+ this.tabObj.setProperties({ selectedItem: newProp.selectedTab });
9364
+ }
8039
9365
  break;
8040
9366
  case 'tabAnimation':
8041
9367
  this.tabObj.setProperties({ animation: newProp.tabAnimation });
@@ -8043,6 +9369,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
8043
9369
  case 'tabs':
8044
9370
  this.reRenderTabs(newProp.tabs);
8045
9371
  break;
9372
+ case 'contextualTabs':
9373
+ for (var i = 0; i < this.contextualTabs.length; i++) {
9374
+ if (newProp.contextualTabs[parseInt(i.toString(), 10)]) {
9375
+ this.ribbonContextualTabModule.updateContextualTabs(newProp.contextualTabs[parseInt(i.toString(), 10)], this.contextualTabs[parseInt(i.toString(), 10)]);
9376
+ }
9377
+ }
9378
+ break;
8046
9379
  case 'width':
8047
9380
  this.element.style.width = formatUnit(newProp.width);
8048
9381
  this.refreshLayout();
@@ -8086,6 +9419,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
8086
9419
  __decorate([
8087
9420
  Property('')
8088
9421
  ], Ribbon.prototype, "cssClass", void 0);
9422
+ __decorate([
9423
+ Property(false)
9424
+ ], Ribbon.prototype, "enableKeyTips", void 0);
9425
+ __decorate([
9426
+ Property('')
9427
+ ], Ribbon.prototype, "layoutSwitcherKeyTip", void 0);
8089
9428
  __decorate([
8090
9429
  Complex({}, FileMenuSettings)
8091
9430
  ], Ribbon.prototype, "fileMenu", void 0);
@@ -8110,6 +9449,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
8110
9449
  __decorate([
8111
9450
  Collection([], RibbonTab)
8112
9451
  ], Ribbon.prototype, "tabs", void 0);
9452
+ __decorate([
9453
+ Collection([], RibbonContextualTabSettings)
9454
+ ], Ribbon.prototype, "contextualTabs", void 0);
8113
9455
  __decorate([
8114
9456
  Property('100%')
8115
9457
  ], Ribbon.prototype, "width", void 0);
@@ -8207,6 +9549,7 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
8207
9549
  }
8208
9550
  this.parent.tabObj.refreshActiveTabBorder();
8209
9551
  this.addFileMenuTooltip(fileMenuOptions);
9552
+ this.addFileMenuKeytip();
8210
9553
  };
8211
9554
  RibbonFileMenu.prototype.addFileMenuTooltip = function (fileMenuOptions) {
8212
9555
  if (isTooltipPresent(fileMenuOptions.ribbonTooltipSettings)) {
@@ -8214,6 +9557,12 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
8214
9557
  this.parent.tooltipData.push({ id: this.ddbElement.id, data: fileMenuOptions.ribbonTooltipSettings });
8215
9558
  }
8216
9559
  };
9560
+ RibbonFileMenu.prototype.addFileMenuKeytip = function () {
9561
+ if (this.parent.fileMenu.keyTip) {
9562
+ this.parent.keyTipElements['filemenu'] = [];
9563
+ this.parent.keyTipElements['filemenu'].push({ id: this.ddbElement.id, type: 'filemenu', keyTip: this.parent.fileMenu.keyTip });
9564
+ }
9565
+ };
8217
9566
  RibbonFileMenu.prototype.ddbBeforeEvent = function (isOpen, args) {
8218
9567
  //args.event is null when dropdown button is closed using a method call
8219
9568
  if (!isOpen && args.event && args.event.target.closest('.e-ribbon-menu')) {
@@ -8366,7 +9715,9 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
8366
9715
  }
8367
9716
  }
8368
9717
  this.removeFileMenuTooltip();
9718
+ this.removeFileMenuKeytip();
8369
9719
  this.addFileMenuTooltip(fileMenuOptions);
9720
+ this.addFileMenuKeytip();
8370
9721
  }
8371
9722
  else {
8372
9723
  this.createFileMenu(fileMenuOptions);
@@ -8385,6 +9736,7 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
8385
9736
  };
8386
9737
  RibbonFileMenu.prototype.destroyDDB = function () {
8387
9738
  this.removeFileMenuTooltip();
9739
+ this.removeFileMenuKeytip();
8388
9740
  var tabEle = this.parent.tabObj.element;
8389
9741
  tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
8390
9742
  this.destroyMenu();
@@ -8401,6 +9753,15 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
8401
9753
  this.parent.tooltipData.splice(index, 1);
8402
9754
  }
8403
9755
  };
9756
+ RibbonFileMenu.prototype.removeFileMenuKeytip = function () {
9757
+ var _this = this;
9758
+ if (this.parent.keyTipElements['filemenu']) {
9759
+ var index = getIndex(this.parent.keyTipElements['filemenu'], function (e) { return e.id === _this.ddbElement.id; });
9760
+ if (index !== -1) {
9761
+ this.parent.keyTipElements['filemenu'].splice(index, 1);
9762
+ }
9763
+ }
9764
+ };
8404
9765
  /**
8405
9766
  * Add items to FileMenu.
8406
9767
  *
@@ -8468,7 +9829,7 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
8468
9829
  return RibbonFileMenu;
8469
9830
  }());
8470
9831
 
8471
- var __extends$18 = (undefined && undefined.__extends) || (function () {
9832
+ var __extends$22 = (undefined && undefined.__extends) || (function () {
8472
9833
  var extendStatics = function (d, b) {
8473
9834
  extendStatics = Object.setPrototypeOf ||
8474
9835
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -8485,7 +9846,7 @@ var __extends$18 = (undefined && undefined.__extends) || (function () {
8485
9846
  * Defines the items of Ribbon.
8486
9847
  */
8487
9848
  var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
8488
- __extends$18(RibbonBackstage, _super);
9849
+ __extends$22(RibbonBackstage, _super);
8489
9850
  function RibbonBackstage(parent) {
8490
9851
  var _this = _super.call(this) || this;
8491
9852
  _this.parent = parent;
@@ -8607,6 +9968,7 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
8607
9968
  };
8608
9969
  this.parent.tabObj.refreshActiveTabBorder();
8609
9970
  this.addBackStageMenuTooltip(backStageOptions);
9971
+ this.addBackStageMenuKeyTip(backStageOptions);
8610
9972
  EventHandler.add(document, 'click', this.onClickEvent, this);
8611
9973
  };
8612
9974
  RibbonBackstage.prototype.onClickEvent = function (e) {
@@ -8624,6 +9986,24 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
8624
9986
  this.parent.tooltipData.push({ id: this.backstageButtonEle.id, data: backStageOptions.ribbonTooltipSettings });
8625
9987
  }
8626
9988
  };
9989
+ RibbonBackstage.prototype.addBackStageMenuKeyTip = function (backStageOptions) {
9990
+ if (backStageOptions.keyTip) {
9991
+ if (!(this.parent.keyTipElements['backstage'])) {
9992
+ this.parent.keyTipElements['backstage'] = [];
9993
+ }
9994
+ this.parent.keyTipElements['backstage'].push({ id: this.backstageButtonEle.id, type: 'backstage', keyTip: backStageOptions.keyTip });
9995
+ }
9996
+ if (backStageOptions.items && backStageOptions.items.length) {
9997
+ if (!(this.parent.keyTipElements['backstageMenu'])) {
9998
+ this.parent.keyTipElements['backstageMenu'] = [];
9999
+ }
10000
+ for (var i = 0; i < backStageOptions.items.length; i++) {
10001
+ if (backStageOptions.items[parseInt(i.toString(), 10)].keyTip) {
10002
+ this.parent.keyTipElements['backstageMenu'].push({ id: backStageOptions.items[parseInt(i.toString(), 10)].id, type: 'backstageMenu', keyTip: backStageOptions.items[parseInt(i.toString(), 10)].keyTip });
10003
+ }
10004
+ }
10005
+ }
10006
+ };
8627
10007
  RibbonBackstage.prototype.checkMenuItems = function (backStageItems) {
8628
10008
  for (var i = 0; i < backStageItems.length; i++) {
8629
10009
  var item = backStageItems[parseInt(i.toString(), 10)];
@@ -8914,7 +10294,9 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
8914
10294
  }
8915
10295
  }
8916
10296
  this.removeBackstageMenuTooltip();
10297
+ this.removeBackstageMenuKeyTip();
8917
10298
  this.addBackStageMenuTooltip(backStageOptions);
10299
+ this.addBackStageMenuKeyTip(backStageOptions);
8918
10300
  }
8919
10301
  else {
8920
10302
  this.createBackStage(backStageOptions);
@@ -8933,6 +10315,7 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
8933
10315
  };
8934
10316
  RibbonBackstage.prototype.destroyDDB = function () {
8935
10317
  this.removeBackstageMenuTooltip();
10318
+ this.removeBackstageMenuKeyTip();
8936
10319
  var tabEle = this.parent.tabObj.element;
8937
10320
  tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
8938
10321
  this.destroyMenu();
@@ -8950,6 +10333,21 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
8950
10333
  this.parent.tooltipData.splice(index, 1);
8951
10334
  }
8952
10335
  };
10336
+ RibbonBackstage.prototype.removeBackstageMenuKeyTip = function () {
10337
+ var _this = this;
10338
+ if (this.parent.keyTipElements['backstage'] && this.parent.keyTipElements['backstage'].length) {
10339
+ var index = getIndex(this.parent.keyTipElements['backstage'], function (e) { return e.id === _this.backstageButtonEle.id; });
10340
+ if (index !== -1) {
10341
+ this.parent.keyTipElements['backstage'].splice(index, 1);
10342
+ }
10343
+ }
10344
+ if (this.parent.keyTipElements['backstageMenu'] && this.parent.keyTipElements['backstageMenu'].length) {
10345
+ for (var i = 0; i < this.parent.keyTipElements['backstageMenu'].length; i++) {
10346
+ this.parent.keyTipElements['backstageMenu'].splice(i, 1);
10347
+ i--;
10348
+ }
10349
+ }
10350
+ };
8953
10351
  /**
8954
10352
  * Add items to Backstage Menu.
8955
10353
  *
@@ -9018,6 +10416,642 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
9018
10416
  return RibbonBackstage;
9019
10417
  }(Component));
9020
10418
 
10419
+ /**
10420
+ * Defines the ribbon contextual tab.
10421
+ */
10422
+ var RibbonContextualTab = /** @__PURE__ @class */ (function () {
10423
+ function RibbonContextualTab(parent) {
10424
+ this.parent = parent;
10425
+ }
10426
+ RibbonContextualTab.prototype.getModuleName = function () {
10427
+ return 'ribbonContextualTab';
10428
+ };
10429
+ RibbonContextualTab.prototype.destroy = function () {
10430
+ this.parent = null;
10431
+ };
10432
+ /**
10433
+ * Creates Contextual tab.
10434
+ *
10435
+ * @returns {void}
10436
+ * @hidden
10437
+ */
10438
+ RibbonContextualTab.prototype.addContextualTabs = function () {
10439
+ var isSelected = false;
10440
+ for (var n = 0; n < this.parent.contextualTabs.length; n++) {
10441
+ for (var i = 0; i < this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs.length; i++) {
10442
+ this.parent.addTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[parseInt(i.toString(), 10)]);
10443
+ var index = this.parent.tabs.length - 1;
10444
+ var tabEle = this.parent.tabObj.element;
10445
+ var toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index.toString(), 10)];
10446
+ toolbarEle.classList.add(RIBBON_CONTEXTUAL_TAB);
10447
+ toolbarEle.classList.add('e-hidden');
10448
+ if (this.parent.contextualTabs[parseInt(n.toString(), 10)].visible) {
10449
+ this.parent.showTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[parseInt(i.toString(), 10)].id, true);
10450
+ if (this.parent.contextualTabs[parseInt(n.toString(), 10)].isSelected && !isSelected) {
10451
+ this.parent.selectTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[0].id);
10452
+ isSelected = true;
10453
+ }
10454
+ }
10455
+ }
10456
+ }
10457
+ };
10458
+ /**
10459
+ * Updates Contextual tab.
10460
+ *
10461
+ * @param {RibbonContextualTabSettingsModel} newProp - Specifies new properties.
10462
+ * @param {RibbonContextualTabSettingsModel} contextualTab - Gets the property of contextual tab.
10463
+ * @returns {void}
10464
+ * @hidden
10465
+ */
10466
+ RibbonContextualTab.prototype.updateContextualTabs = function (newProp, contextualTab) {
10467
+ if (!(isNullOrUndefined(newProp.visible))) {
10468
+ for (var i = 0; i < contextualTab.tabs.length; i++) {
10469
+ if (newProp.visible) {
10470
+ this.parent.showTab(contextualTab.tabs[parseInt(i.toString(), 10)].id, true);
10471
+ }
10472
+ else {
10473
+ this.parent.hideTab(contextualTab.tabs[parseInt(i.toString(), 10)].id, true);
10474
+ }
10475
+ }
10476
+ }
10477
+ if (!(isNullOrUndefined(newProp.isSelected))) {
10478
+ if (newProp.isSelected && contextualTab.visible) {
10479
+ this.parent.selectTab(contextualTab.tabs[0].id);
10480
+ }
10481
+ else {
10482
+ var tabEle = this.parent.tabObj.element;
10483
+ for (var i = 0; i < this.parent.tabs.length; i++) {
10484
+ var toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(i.toString(), 10)];
10485
+ if (!(toolbarEle.classList.contains('e-hidden') || toolbarEle.classList.contains('e-disable'))) {
10486
+ this.parent.selectTab(this.parent.tabs[parseInt(i.toString(), 10)].id);
10487
+ break;
10488
+ }
10489
+ }
10490
+ }
10491
+ }
10492
+ if (newProp.tabs) {
10493
+ var _loop_1 = function (key) {
10494
+ var index = parseInt(key, 10);
10495
+ var tab = this_1.parent.tabs.filter(function (e) { return e.id === contextualTab.tabs[parseInt(index.toString(), 10)].id; })[0];
10496
+ this_1.parent.updateTab(tab);
10497
+ };
10498
+ var this_1 = this;
10499
+ for (var key in newProp.tabs) {
10500
+ _loop_1(key);
10501
+ }
10502
+ }
10503
+ };
10504
+ return RibbonContextualTab;
10505
+ }());
10506
+
10507
+ /**
10508
+ * Defines the keytip of Ribbon.
10509
+ */
10510
+ var RibbonKeyTip = /** @__PURE__ @class */ (function () {
10511
+ function RibbonKeyTip(parent) {
10512
+ this.isKeytipPopupOpen = false;
10513
+ this.parent = parent;
10514
+ }
10515
+ RibbonKeyTip.prototype.getModuleName = function () {
10516
+ return 'ribbonKeyTip';
10517
+ };
10518
+ RibbonKeyTip.prototype.destroy = function () {
10519
+ this.parent = null;
10520
+ };
10521
+ /**
10522
+ * Creates the keytips.
10523
+ *
10524
+ * @param {string} key - get's the keytip type.
10525
+ * @returns {void}
10526
+ * @hidden
10527
+ */
10528
+ RibbonKeyTip.prototype.createKeytip = function (key) {
10529
+ if (this.parent.keyTipElements) {
10530
+ var keytipData = void 0;
10531
+ if (key === 'tab') {
10532
+ for (var i = 0; i < this.parent.tabs.length; i++) {
10533
+ if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
10534
+ // eslint-disable-next-line
10535
+ keytipData = this.parent.keyTipElements[i][key];
10536
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'tab', 'center', 'bottom', true);
10537
+ }
10538
+ }
10539
+ if (this.parent.keyTipElements['filemenu']) {
10540
+ keytipData = this.parent.keyTipElements['filemenu'];
10541
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'filemenu');
10542
+ }
10543
+ if (this.parent.keyTipElements['backstage']) {
10544
+ keytipData = this.parent.keyTipElements['backstage'];
10545
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'backstage');
10546
+ }
10547
+ if (this.parent.keyTipElements['collapse']) {
10548
+ keytipData = this.parent.keyTipElements['collapse'];
10549
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'collapse');
10550
+ }
10551
+ if (this.parent.keyTipElements['taboverflow']) {
10552
+ keytipData = this.parent.keyTipElements['taboverflow'];
10553
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'taboverflow');
10554
+ }
10555
+ }
10556
+ else if (key === 'popupitem') {
10557
+ if (this.parent.keyTipElements[this.parent.selectedTab]['popupitem']) {
10558
+ var popupKeyTipData = this.parent.keyTipElements[this.parent.selectedTab]['popupitem'];
10559
+ for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['popupitem']).length; i++) {
10560
+ this.createKeyTipElement((popupKeyTipData[parseInt(i.toString(), 10)].id), popupKeyTipData[parseInt(i.toString(), 10)].keyTip, 'popupitem', 'left', 'top', false, true);
10561
+ }
10562
+ }
10563
+ }
10564
+ else if (key === 'backstageMenu') {
10565
+ if (this.parent.keyTipElements['backstageMenu']) {
10566
+ var backstageKeyTipData = this.parent.keyTipElements['backstageMenu'];
10567
+ for (var i = 0; i < Object.keys(this.parent.keyTipElements['backstageMenu']).length; i++) {
10568
+ this.createKeyTipElement((backstageKeyTipData[parseInt(i.toString(), 10)].id), backstageKeyTipData[parseInt(i.toString(), 10)].keyTip, 'backstageMenu', 'left', 'center');
10569
+ }
10570
+ }
10571
+ }
10572
+ else if (key === 'grpoverflowpopup' && this.parent.activeLayout === 'Classic') {
10573
+ if (this.parent.keyTipElements[this.parent.selectedTab]['grpoverflowpopup']) {
10574
+ this.calculateItemPosition(key);
10575
+ }
10576
+ if (this.parent.keyTipElements[this.parent.selectedTab]['launcher']) {
10577
+ for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['launcher']).length; i++) {
10578
+ keytipData = this.parent.keyTipElements[this.parent.selectedTab]['launcher'];
10579
+ this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'launcher', 'center', 'bottom', false, true);
10580
+ }
10581
+ }
10582
+ }
10583
+ else {
10584
+ this.calculateItemPosition(key);
10585
+ if (this.parent.activeLayout === 'Classic') {
10586
+ if (this.parent.keyTipElements[this.parent.selectedTab]['launcher']) {
10587
+ for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['launcher']).length; i++) {
10588
+ keytipData = this.parent.keyTipElements[this.parent.selectedTab]['launcher'];
10589
+ this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'launcher');
10590
+ }
10591
+ }
10592
+ if (this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow']) {
10593
+ for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow']).length; i++) {
10594
+ keytipData = this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow'];
10595
+ this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'grpoverflow');
10596
+ }
10597
+ }
10598
+ }
10599
+ if (this.parent.activeLayout === 'Simplified') {
10600
+ if (this.parent.keyTipElements['overflowbtn']) {
10601
+ keytipData = this.parent.keyTipElements['overflowbtn'];
10602
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'overflowbtn');
10603
+ }
10604
+ if (this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn']) {
10605
+ for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn']).length; i++) {
10606
+ keytipData = this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn'];
10607
+ this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'grpofbtn');
10608
+ }
10609
+ }
10610
+ }
10611
+ }
10612
+ }
10613
+ };
10614
+ RibbonKeyTip.prototype.calculateItemPosition = function (key, isMethod, keyTip) {
10615
+ if (isMethod === void 0) { isMethod = false; }
10616
+ var xOffset;
10617
+ var yOffset;
10618
+ var keytipData;
10619
+ /* eslint-disable */
10620
+ keytipData = this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(), 10)][key];
10621
+ if (keytipData) {
10622
+ for (var i = 0; i < Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(), 10)][key]).length; i++) {
10623
+ /* eslint-enable */
10624
+ if ((isMethod && (keytipData[parseInt(i.toString(), 10)].keyTip === keyTip)) || !isMethod) {
10625
+ var itemID = keytipData[parseInt(i.toString(), 10)].id;
10626
+ if (keytipData[parseInt(i.toString(), 10)].id.includes("_grpbtn")) {
10627
+ itemID = keytipData[parseInt(i.toString(), 10)].id.replace(/_grpbtn\d+/, '');
10628
+ }
10629
+ var itemProp = getItem(this.parent.tabs, itemID);
10630
+ if (itemProp && itemProp.group.orientation === 'Column' && itemProp.collection.items.length > 1 && this.parent.activeLayout !== 'Simplified') {
10631
+ if (itemProp.itemIndex === 0) {
10632
+ xOffset = 'center';
10633
+ yOffset = 'top';
10634
+ }
10635
+ else if (itemProp.itemIndex === 1) {
10636
+ xOffset = 'center';
10637
+ yOffset = 'center';
10638
+ }
10639
+ else {
10640
+ xOffset = 'center';
10641
+ yOffset = 'bottom';
10642
+ }
10643
+ }
10644
+ else if (itemProp && itemProp.group.orientation === 'Row' && itemProp.group.collections.length > 1 && this.parent.activeLayout !== 'Simplified') {
10645
+ if (itemProp.collectionIndex === 0) {
10646
+ xOffset = 'center';
10647
+ yOffset = 'top';
10648
+ }
10649
+ else {
10650
+ xOffset = 'center';
10651
+ yOffset = 'bottom';
10652
+ }
10653
+ }
10654
+ key === 'item' ? this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, key, xOffset, yOffset) : this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, key, xOffset, yOffset, false, true);
10655
+ }
10656
+ }
10657
+ }
10658
+ };
10659
+ RibbonKeyTip.prototype.createKeyTipElement = function (id, keyTip, type, xOffset, yOffset, isTab, isPopUpItem) {
10660
+ if (xOffset === void 0) { xOffset = 'center'; }
10661
+ if (yOffset === void 0) { yOffset = 'bottom'; }
10662
+ if (isTab === void 0) { isTab = false; }
10663
+ if (isPopUpItem === void 0) { isPopUpItem = false; }
10664
+ var keyEle = document.querySelector('#' + id);
10665
+ var isPopUpPresent = false;
10666
+ var splitBtnID;
10667
+ if (isTab) {
10668
+ keyEle = document.querySelector('#' + id + HEADER_ID);
10669
+ }
10670
+ if (keyEle) {
10671
+ if (keyEle.closest('.e-ribbon-group-overflow-ddb')) {
10672
+ isPopUpPresent = true;
10673
+ }
10674
+ if ((isTab && isPopUpItem) && keyEle.closest('.e-toolbar-pop')) {
10675
+ isPopUpPresent = true;
10676
+ }
10677
+ if (keyEle.closest('.e-split-btn-wrapper')) {
10678
+ var splitBtn = keyEle.closest('.e-split-btn-wrapper');
10679
+ splitBtnID = splitBtn.closest('.e-ribbon-item').id;
10680
+ }
10681
+ else {
10682
+ if (keyEle.closest('.e-colorpicker-wrapper')) {
10683
+ keyEle = keyEle.closest('.e-colorpicker-wrapper');
10684
+ splitBtnID = keyEle.closest('.e-ribbon-item').id;
10685
+ }
10686
+ }
10687
+ }
10688
+ if ((keyEle && keyEle.offsetParent) || (isTab && isPopUpItem)) {
10689
+ if ((isPopUpItem && isPopUpPresent) || !isPopUpItem) {
10690
+ var keytipElement = this.parent.createElement('div', {
10691
+ className: RIBBON_KEYTIP,
10692
+ id: id + RIBBON_KEYTIP_ID
10693
+ });
10694
+ document.body.append(keytipElement);
10695
+ var keytipPopup = new Popup(keytipElement, {
10696
+ relateTo: '#' + (isTab ? id + HEADER_ID : splitBtnID ? splitBtnID : id),
10697
+ content: keyTip,
10698
+ collision: { X: 'fit', Y: 'flip' },
10699
+ targetType: 'relative',
10700
+ position: { X: xOffset, Y: yOffset },
10701
+ enableRtl: this.parent.enableRtl
10702
+ });
10703
+ keytipPopup.show();
10704
+ this.calculateKeyTipPosition(keyEle, keytipElement, type, yOffset, (isTab && isPopUpItem));
10705
+ this.parent.isKeytipOpen = true;
10706
+ }
10707
+ }
10708
+ };
10709
+ RibbonKeyTip.prototype.calculateKeyTipPosition = function (itemEle, keytipElement, type, yOffset, isTabOverflow) {
10710
+ if (isTabOverflow === void 0) { isTabOverflow = false; }
10711
+ var position = itemEle.getBoundingClientRect();
10712
+ if (type === 'backstageMenu') {
10713
+ keytipElement.style.top = position.top + ((keytipElement.offsetHeight) / 2) + 'px';
10714
+ keytipElement.style.left = position.left + (itemEle.offsetWidth / 5) + 'px';
10715
+ }
10716
+ else {
10717
+ if (type !== 'popupitem') {
10718
+ keytipElement.style.left = position.left + (position.width - keytipElement.offsetWidth) / 2 + 'px';
10719
+ }
10720
+ }
10721
+ if (type === 'filemenu' || type === 'backstage') {
10722
+ keytipElement.style.top = position.top + ((itemEle.offsetHeight - (itemEle.offsetHeight / 3)) + (keytipElement.offsetHeight / 6)) + 'px';
10723
+ }
10724
+ else if ((type === 'item' && yOffset === 'top')) {
10725
+ keytipElement.style.top = (position.top - (itemEle.offsetHeight) / 2) + 'px';
10726
+ }
10727
+ };
10728
+ /**
10729
+ * Performs keytip action.
10730
+ *
10731
+ * @param {string} keyPress - Gets the keytip text.
10732
+ * @returns {void}
10733
+ * @hidden
10734
+ */
10735
+ RibbonKeyTip.prototype.keytipPress = function (keyPress, isMethod) {
10736
+ var _this = this;
10737
+ if (isMethod === void 0) { isMethod = false; }
10738
+ this.isKeytipPresent = false;
10739
+ for (var i = 0; ((i < Object.keys(this.parent.keyTipElements).length) && !this.isKeytipPresent); i++) {
10740
+ if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
10741
+ for (var j = 0; ((j < Object.keys(this.parent.keyTipElements[parseInt(i.toString(), 10)]).length) && !this.isKeytipPresent); j++) {
10742
+ var keytipData = this.parent.keyTipElements[parseInt(i.toString(), 10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(), 10)])[parseInt(j.toString(), 10)]];
10743
+ for (var k = 0; ((k < keytipData.length) && !this.isKeytipPresent); k++) {
10744
+ if (keyPress.toUpperCase() === keytipData[parseInt(k.toString(), 10)].keyTip) {
10745
+ var keyTipElement = document.querySelector('#' + keytipData[parseInt(k.toString(), 10)].id + RIBBON_KEYTIP_ID);
10746
+ if (keyTipElement || isMethod) {
10747
+ this.isKeytipPresent = true;
10748
+ this.removeKeytip();
10749
+ if (keytipData[parseInt(k.toString(), 10)].type === 'tab') {
10750
+ if (i !== this.parent.selectedTab) {
10751
+ this.parent.tabObj.select(i);
10752
+ setTimeout(function () {
10753
+ var tabOverflow = _this.parent.tabObj.element.querySelector('.e-nav-active');
10754
+ if (tabOverflow)
10755
+ tabOverflow.click();
10756
+ _this.createKeytip('item');
10757
+ }, 600);
10758
+ }
10759
+ else {
10760
+ this.createKeytip('item');
10761
+ }
10762
+ }
10763
+ else {
10764
+ if (keytipData[parseInt(k.toString(), 10)].type === 'item' || keytipData[parseInt(k.toString(), 10)].type === 'grpoverflowpopup' || keytipData[parseInt(k.toString(), 10)].type === 'popupitem') {
10765
+ if (document.getElementById(keytipData[parseInt(k.toString(), 10)].id) && document.getElementById(keytipData[parseInt(k.toString(), 10)].id).classList.contains('e-ribbon-group-button')) {
10766
+ document.getElementById(keytipData[parseInt(k.toString(), 10)].id).click();
10767
+ }
10768
+ else {
10769
+ var itemProp = void 0;
10770
+ if ((keytipData[parseInt(k.toString(), 10)].id).includes("_popupButton")) {
10771
+ var galleryID = keytipData[parseInt(k.toString(), 10)].id.replace(/_popupButton/g, '');
10772
+ itemProp = getItem(this.parent.tabs, galleryID);
10773
+ }
10774
+ else {
10775
+ itemProp = getItem(this.parent.tabs, keytipData[parseInt(k.toString(), 10)].id);
10776
+ }
10777
+ if (!isMethod || (isMethod && itemProp.tabIndex === this.parent.selectedTab)) {
10778
+ this.clickItems(itemProp, keytipData, k, false, isMethod);
10779
+ }
10780
+ }
10781
+ }
10782
+ else if (keytipData[parseInt(k.toString(), 10)].type === 'grpoverflow' || keytipData[parseInt(k.toString(), 10)].type === 'grpofbtn' || keytipData[parseInt(k.toString(), 10)].type === 'launcher') {
10783
+ var keyEle = document.querySelector('#' + keytipData[parseInt(k.toString(), 10)].id);
10784
+ this.removeKeytip();
10785
+ if (keyEle) {
10786
+ var groupID = keytipData[parseInt(k.toString(), 10)].id;
10787
+ if (isMethod) {
10788
+ if (keytipData[parseInt(k.toString(), 10)].id.includes("_launcher") || keytipData[parseInt(k.toString(), 10)].id.includes("_sim_grp_overflow") || keytipData[parseInt(k.toString(), 10)].id.includes("_overflow_dropdown")) {
10789
+ groupID = keytipData[parseInt(k.toString(), 10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g, '');
10790
+ var itemProp = getGroup(this.parent.tabs, groupID);
10791
+ if (itemProp.tabIndex === this.parent.selectedTab) {
10792
+ this.clickItems(itemProp, keytipData, k, true, isMethod, keyEle);
10793
+ }
10794
+ }
10795
+ }
10796
+ else {
10797
+ this.clickItems(null, keytipData, k, true, isMethod, keyEle);
10798
+ }
10799
+ }
10800
+ }
10801
+ }
10802
+ }
10803
+ }
10804
+ }
10805
+ }
10806
+ }
10807
+ else {
10808
+ if (this.parent.keyTipElements) {
10809
+ this.commonItemsKeyTipPress(keyPress, Object.keys(this.parent.keyTipElements)[parseInt(i.toString(), 10)], isMethod);
10810
+ }
10811
+ }
10812
+ }
10813
+ };
10814
+ RibbonKeyTip.prototype.clickItems = function (itemProp, keytipData, k, isGroupItems, isMethod, keyEle) {
10815
+ if (isGroupItems) {
10816
+ keyEle.click();
10817
+ if (!(keytipData[parseInt(k.toString(), 10)].type === 'launcher')) {
10818
+ this.isKeytipPopupOpen = true;
10819
+ keytipData[parseInt(k.toString(), 10)].type === 'grpoverflow' ? this.createKeytip('grpoverflowpopup') : this.createKeytip('popupitem');
10820
+ }
10821
+ }
10822
+ else {
10823
+ var itemID = keytipData[parseInt(k.toString(), 10)].id;
10824
+ if (document.querySelector('#' + itemID) && isMethod) {
10825
+ if (this.parent.activeLayout === 'Simplified') {
10826
+ if (document.querySelector('#' + itemID).closest('#' + itemProp.group.id + '_sim_grp_overflow-popup') && document.querySelector('#' + itemID).closest('#' + itemProp.group.id + '_sim_grp_overflow-popup').classList.contains('e-popup-close')) {
10827
+ document.querySelector('#' + itemProp.group.id + '_sim_grp_overflow').click();
10828
+ }
10829
+ else if (document.querySelector('#' + itemID).closest('#' + this.parent.tabObj.element.id + OVRLOF_BUTTON_ID + '-popup') && document.querySelector('#' + itemID).closest('#' + this.parent.tabObj.element.id + OVRLOF_BUTTON_ID + '-popup').classList.contains('e-popup-close')) {
10830
+ document.querySelector('#' + this.parent.tabObj.element.id + OVRLOF_BUTTON_ID).click();
10831
+ }
10832
+ }
10833
+ else {
10834
+ if (document.querySelector('#' + itemID).closest('#' + itemProp.group.id + OVERFLOW_ID + DROPDOWN_ID + '-popup') && document.querySelector('#' + itemID).closest('#' + itemProp.group.id + OVERFLOW_ID + DROPDOWN_ID + '-popup').classList.contains('e-popup-close')) {
10835
+ document.querySelector('#' + itemProp.group.id + OVERFLOW_ID + DROPDOWN_ID).click();
10836
+ }
10837
+ }
10838
+ }
10839
+ var itemType = this.parent.getItemModuleName(itemProp.item);
10840
+ switch (itemType) {
10841
+ case 'btn':
10842
+ this.parent.ribbonButtonModule.click(itemID);
10843
+ break;
10844
+ case 'dropdown-btn':
10845
+ this.parent.ribbonDropDownModule.toggle(itemID);
10846
+ break;
10847
+ case 'split-btn':
10848
+ this.parent.ribbonSplitButtonModule.toggle(itemID);
10849
+ break;
10850
+ case 'checkbox':
10851
+ this.parent.ribbonCheckBoxModule.click(itemID);
10852
+ break;
10853
+ case 'colorpicker':
10854
+ this.parent.ribbonColorPickerModule.toggle(itemID);
10855
+ break;
10856
+ case 'combobox':
10857
+ var itemEle_1 = document.querySelector('#' + itemID);
10858
+ setTimeout(function () {
10859
+ itemEle_1.focus();
10860
+ }, 100);
10861
+ break;
10862
+ case 'gallery':
10863
+ var galleryEle = document.querySelector('#' + itemID);
10864
+ galleryEle.click();
10865
+ break;
10866
+ case 'template':
10867
+ var templateEle = document.querySelector('#' + itemID);
10868
+ templateEle.focus();
10869
+ break;
10870
+ case 'group-btn':
10871
+ var itemElement = document.querySelector('#' + itemID);
10872
+ if (itemElement) {
10873
+ var item = getInstance(itemElement, DropDownButton);
10874
+ item.toggle();
10875
+ for (var i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
10876
+ if (itemProp.item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip) {
10877
+ this.createKeyTipElement(itemID + (RIBBON_GROUP_BUTTON_ID + i), itemProp.item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip, 'item');
10878
+ }
10879
+ }
10880
+ }
10881
+ break;
10882
+ }
10883
+ }
10884
+ };
10885
+ RibbonKeyTip.prototype.commonItemsKeyTipPress = function (keyPress, key, isMethod) {
10886
+ var _this = this;
10887
+ /* eslint-disable */
10888
+ if (this.parent.keyTipElements[key]) {
10889
+ var isKeyPressed = false;
10890
+ var keytipData = this.parent.keyTipElements[key];
10891
+ var keyEle = void 0;
10892
+ var keytipElement = void 0;
10893
+ if (keytipData) {
10894
+ if (key === 'backstageMenu') {
10895
+ for (var i = 0; i < Object.keys(this.parent.keyTipElements[key]).length; i++) {
10896
+ /* eslint-enable */
10897
+ if (keytipData[parseInt(i.toString(), 10)].keyTip === keyPress.toUpperCase()) {
10898
+ keyEle = document.querySelector('#' + keytipData[parseInt(i.toString(), 10)].id);
10899
+ keytipElement = document.querySelector('#' + keyEle.id + RIBBON_KEYTIP_ID);
10900
+ if (keytipElement || isMethod) {
10901
+ isKeyPressed = true;
10902
+ if (isMethod && document.querySelector('.e-ribbon-backstage-popup').classList.contains('e-popup-close')) {
10903
+ this.parent.tabObj.element.querySelector('.e-ribbon-backstage').click();
10904
+ }
10905
+ break;
10906
+ }
10907
+ }
10908
+ }
10909
+ }
10910
+ else {
10911
+ if (keytipData[0] && keytipData[0].keyTip === keyPress.toUpperCase()) {
10912
+ keyEle = document.querySelector('#' + keytipData[0].id);
10913
+ keytipElement = document.querySelector('#' + keytipData[0].id + RIBBON_KEYTIP_ID);
10914
+ if (keytipElement || isMethod) {
10915
+ isKeyPressed = true;
10916
+ }
10917
+ }
10918
+ }
10919
+ }
10920
+ if (isKeyPressed) {
10921
+ this.removeKeytip();
10922
+ this.isKeytipPresent = true;
10923
+ if (keyEle) {
10924
+ keyEle.click();
10925
+ if (key === 'backstage') {
10926
+ this.createKeytip('backstageMenu');
10927
+ }
10928
+ else if (key === 'overflowbtn') {
10929
+ this.isKeytipPopupOpen = true;
10930
+ this.createKeytip('popupitem');
10931
+ }
10932
+ else if (key === 'taboverflow') {
10933
+ setTimeout(function () {
10934
+ for (var i = 0; i < Object.keys(_this.parent.keyTipElements).length; i++) {
10935
+ if (_this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
10936
+ var keytipData_1 = _this.parent.keyTipElements[parseInt(i.toString(), 10)]['tab'];
10937
+ _this.createKeyTipElement((keytipData_1[0].id), keytipData_1[0].keyTip, 'tab', 'center', 'bottom', true, true);
10938
+ }
10939
+ }
10940
+ }, 600);
10941
+ }
10942
+ }
10943
+ }
10944
+ }
10945
+ };
10946
+ /**
10947
+ * Removes the keytip.
10948
+ *
10949
+ * @param {string} key - Gets the keyboard key element.
10950
+ * @returns {void}
10951
+ * @hidden
10952
+ */
10953
+ RibbonKeyTip.prototype.removeKeytip = function (key) {
10954
+ var _this = this;
10955
+ var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
10956
+ var isKeyTipExist = false;
10957
+ this.parent.keysPress = '';
10958
+ var _loop_1 = function (i) {
10959
+ var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
10960
+ if (key === 'Escape' && this_1.parent.keyTipElements && this_1.parent.keyTipElements[this_1.parent.selectedTab]) {
10961
+ /* eslint-disable */
10962
+ for (var j = 0; j < Object.keys(this_1.parent.keyTipElements[this_1.parent.selectedTab]).length; j++) {
10963
+ var keyText = (Object.keys(this_1.parent.keyTipElements[this_1.parent.selectedTab]))[j];
10964
+ if (this_1.parent.keyTipElements[this_1.parent.selectedTab][keyText]) {
10965
+ var index = getIndex(this_1.parent.keyTipElements[this_1.parent.selectedTab][keyText], function (e) { return e.id + RIBBON_KEYTIP_ID === keyTipItems[parseInt(i.toString(), 10)].id; });
10966
+ /* eslint-enable */
10967
+ if (index !== -1) {
10968
+ if ((keyText === 'item' && !(this_1.isKeytipPopupOpen)) || (keyText === 'grpoverflow' && this_1.parent.activeLayout === 'Classic')) {
10969
+ this_1.createKeytip('tab');
10970
+ key = '';
10971
+ isKeyTipExist = true;
10972
+ break;
10973
+ }
10974
+ else if (this_1.isKeytipPopupOpen) {
10975
+ if ((keyText === 'popupitem' && this_1.parent.activeLayout === 'Simplified') || (keyText === 'grpoverflowpopup' && this_1.parent.activeLayout === 'Classic')) {
10976
+ this_1.createKeytip('item');
10977
+ key = '';
10978
+ isKeyTipExist = true;
10979
+ break;
10980
+ }
10981
+ }
10982
+ }
10983
+ }
10984
+ }
10985
+ for (var n = 0; n < Object.keys(this_1.parent.keyTipElements).length; n++) {
10986
+ if (this_1.parent.keyTipElements[parseInt(n.toString(), 10)]) {
10987
+ var keytipData = this_1.parent.keyTipElements[parseInt(n.toString(), 10)]['tab'];
10988
+ for (var j = 0; j < keytipData.length; j++) {
10989
+ if (keyTipItem.id === keytipData[0].id + RIBBON_KEYTIP_ID) {
10990
+ if (document.querySelector('#' + keytipData[0].id + HEADER_ID).closest('.e-toolbar-pop')) {
10991
+ var tabOverflow = this_1.parent.tabObj.element.querySelector('.e-nav-active');
10992
+ tabOverflow.click();
10993
+ setTimeout(function () {
10994
+ _this.createKeytip('tab');
10995
+ }, 600);
10996
+ key = '';
10997
+ isKeyTipExist = true;
10998
+ break;
10999
+ }
11000
+ }
11001
+ }
11002
+ if (isKeyTipExist) {
11003
+ break;
11004
+ }
11005
+ }
11006
+ }
11007
+ if (!isKeyTipExist && this_1.parent.keyTipElements['backstageMenu']) {
11008
+ var index = getIndex(this_1.parent.keyTipElements['backstageMenu'], function (e) { return e.id + RIBBON_KEYTIP_ID === keyTipItems[parseInt(i.toString(), 10)].id; });
11009
+ if (index !== -1) {
11010
+ this_1.createKeytip('tab');
11011
+ key = '';
11012
+ isKeyTipExist = true;
11013
+ }
11014
+ }
11015
+ }
11016
+ if (keyTipItem) {
11017
+ remove(keyTipItem);
11018
+ }
11019
+ };
11020
+ var this_1 = this;
11021
+ for (var i = 0; i < keyTipItems.length; i++) {
11022
+ _loop_1(i);
11023
+ }
11024
+ this.isKeytipPopupOpen = false;
11025
+ if (!isKeyTipExist)
11026
+ this.parent.isKeytipOpen = false;
11027
+ };
11028
+ /**
11029
+ * Shows the Keytip dynamically.
11030
+ *
11031
+ * @param {string} keyAction - Item for which the tooltip is to be shown.
11032
+ * @returns {void}
11033
+ */
11034
+ RibbonKeyTip.prototype.showKeyTips = function (keyAction) {
11035
+ if (this.parent.enableKeyTips) {
11036
+ if (keyAction) {
11037
+ this.keytipPress(keyAction, true);
11038
+ }
11039
+ else {
11040
+ this.createKeytip('tab');
11041
+ }
11042
+ }
11043
+ };
11044
+ /**
11045
+ * Hides the Keytip dynamically.
11046
+ *
11047
+ * @returns {void}
11048
+ */
11049
+ RibbonKeyTip.prototype.hideKeyTips = function () {
11050
+ this.removeKeytip();
11051
+ };
11052
+ return RibbonKeyTip;
11053
+ }());
11054
+
9021
11055
  /**
9022
11056
  * Ribbon modules
9023
11057
  */
@@ -9025,5 +11059,5 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
9025
11059
  // export all modules from current location
9026
11060
  // example: export * from './module'
9027
11061
 
9028
- 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, setCustomAttributes, 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 };
11062
+ 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, RIBBON_KEYTIP, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_CONTEXTUAL_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_BUTTON_CONTENT, 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_KEYTIP_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, setCustomAttributes, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, BackStageMenu, BackstageBackButton, BackstageItem, RibbonTooltip, RibbonGroupButtonSettings, RibbonGroupButtonItem, RibbonContextualTabSettings, RibbonGalleryGroup, RibbonGalleryItem, RibbonGallerySettings, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonGroupButton, RibbonGallery, RibbonFileMenu, RibbonBackstage, RibbonContextualTab, RibbonKeyTip };
9029
11063
  //# sourceMappingURL=ej2-ribbon.es5.js.map