@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
  */
@@ -586,6 +590,9 @@ __decorate$13([
586
590
  __decorate$13([
587
591
  Property('')
588
592
  ], RibbonGroupButtonItem.prototype, "iconCss", void 0);
593
+ __decorate$13([
594
+ Property('')
595
+ ], RibbonGroupButtonItem.prototype, "keyTip", void 0);
589
596
  __decorate$13([
590
597
  Complex({}, RibbonTooltip)
591
598
  ], RibbonGroupButtonItem.prototype, "ribbonTooltipSettings", void 0);
@@ -623,6 +630,111 @@ __decorate$12([
623
630
  Collection([], RibbonGroupButtonItem)
624
631
  ], RibbonGroupButtonSettings.prototype, "items", void 0);
625
632
 
633
+ var __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
634
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
635
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
636
+ 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;
637
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
638
+ };
639
+ /**
640
+ * Defines the ribbon gallery item.
641
+ */
642
+ class RibbonGalleryItem extends ChildProperty {
643
+ }
644
+ __decorate$16([
645
+ Property('')
646
+ ], RibbonGalleryItem.prototype, "content", void 0);
647
+ __decorate$16([
648
+ Property('')
649
+ ], RibbonGalleryItem.prototype, "iconCss", void 0);
650
+ __decorate$16([
651
+ Property({})
652
+ ], RibbonGalleryItem.prototype, "htmlAttributes", void 0);
653
+ __decorate$16([
654
+ Property('')
655
+ ], RibbonGalleryItem.prototype, "cssClass", void 0);
656
+ __decorate$16([
657
+ Property(false)
658
+ ], RibbonGalleryItem.prototype, "disabled", void 0);
659
+
660
+ var __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
661
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
662
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
663
+ 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;
664
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
665
+ };
666
+ /**
667
+ * Defines the ribbon gallery group.
668
+ */
669
+ class RibbonGalleryGroup extends ChildProperty {
670
+ }
671
+ __decorate$15([
672
+ Collection([], RibbonGalleryItem)
673
+ ], RibbonGalleryGroup.prototype, "items", void 0);
674
+ __decorate$15([
675
+ Property('')
676
+ ], RibbonGalleryGroup.prototype, "header", void 0);
677
+ __decorate$15([
678
+ Property('auto')
679
+ ], RibbonGalleryGroup.prototype, "itemWidth", void 0);
680
+ __decorate$15([
681
+ Property('auto')
682
+ ], RibbonGalleryGroup.prototype, "itemHeight", void 0);
683
+ __decorate$15([
684
+ Property('')
685
+ ], RibbonGalleryGroup.prototype, "cssClass", void 0);
686
+
687
+ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
688
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
689
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
690
+ 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;
691
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
692
+ };
693
+ /**
694
+ * Defines the ribbon gallery settings.
695
+ */
696
+ class RibbonGallerySettings extends ChildProperty {
697
+ }
698
+ __decorate$14([
699
+ Collection([], RibbonGalleryGroup)
700
+ ], RibbonGallerySettings.prototype, "groups", void 0);
701
+ __decorate$14([
702
+ Property(3)
703
+ ], RibbonGallerySettings.prototype, "itemCount", void 0);
704
+ __decorate$14([
705
+ Property(null)
706
+ ], RibbonGallerySettings.prototype, "selectedItemIndex", void 0);
707
+ __decorate$14([
708
+ Property('auto')
709
+ ], RibbonGallerySettings.prototype, "popupHeight", void 0);
710
+ __decorate$14([
711
+ Property('auto')
712
+ ], RibbonGallerySettings.prototype, "popupWidth", void 0);
713
+ __decorate$14([
714
+ Property('')
715
+ ], RibbonGallerySettings.prototype, "template", void 0);
716
+ __decorate$14([
717
+ Property('')
718
+ ], RibbonGallerySettings.prototype, "popupTemplate", void 0);
719
+ __decorate$14([
720
+ Event()
721
+ ], RibbonGallerySettings.prototype, "popupOpen", void 0);
722
+ __decorate$14([
723
+ Event()
724
+ ], RibbonGallerySettings.prototype, "popupClose", void 0);
725
+ __decorate$14([
726
+ Event()
727
+ ], RibbonGallerySettings.prototype, "itemHover", void 0);
728
+ __decorate$14([
729
+ Event()
730
+ ], RibbonGallerySettings.prototype, "beforeItemRender", void 0);
731
+ __decorate$14([
732
+ Event()
733
+ ], RibbonGallerySettings.prototype, "beforeSelect", void 0);
734
+ __decorate$14([
735
+ Event()
736
+ ], RibbonGallerySettings.prototype, "select", void 0);
737
+
626
738
  var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
627
739
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
628
740
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -643,6 +755,9 @@ class RibbonItem extends ChildProperty {
643
755
  super.setProperties(prop, muteOnChange);
644
756
  }
645
757
  }
758
+ __decorate$4([
759
+ Property('')
760
+ ], RibbonItem.prototype, "keyTip", void 0);
646
761
  __decorate$4([
647
762
  Property(RibbonItemSize.Medium)
648
763
  ], RibbonItem.prototype, "activeSize", void 0);
@@ -691,6 +806,9 @@ __decorate$4([
691
806
  __decorate$4([
692
807
  Complex({}, RibbonGroupButtonSettings)
693
808
  ], RibbonItem.prototype, "groupButtonSettings", void 0);
809
+ __decorate$4([
810
+ Complex({}, RibbonGallerySettings)
811
+ ], RibbonItem.prototype, "gallerySettings", void 0);
694
812
 
695
813
  var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
696
814
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -742,6 +860,12 @@ class RibbonGroup extends ChildProperty {
742
860
  super.setProperties(prop, muteOnChange);
743
861
  }
744
862
  }
863
+ __decorate$2([
864
+ Property('')
865
+ ], RibbonGroup.prototype, "keyTip", void 0);
866
+ __decorate$2([
867
+ Property('')
868
+ ], RibbonGroup.prototype, "launcherIconKeyTip", void 0);
745
869
  __decorate$2([
746
870
  Collection([], RibbonCollection)
747
871
  ], RibbonGroup.prototype, "collections", void 0);
@@ -799,6 +923,9 @@ class RibbonTab extends ChildProperty {
799
923
  super.setProperties(prop, muteOnChange);
800
924
  }
801
925
  }
926
+ __decorate$1([
927
+ Property('')
928
+ ], RibbonTab.prototype, "keyTip", void 0);
802
929
  __decorate$1([
803
930
  Property('')
804
931
  ], RibbonTab.prototype, "id", void 0);
@@ -812,7 +939,7 @@ __decorate$1([
812
939
  Property('')
813
940
  ], RibbonTab.prototype, "header", void 0);
814
941
 
815
- var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
942
+ var __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
816
943
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
817
944
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
818
945
  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;
@@ -832,50 +959,53 @@ class FileMenuSettings extends ChildProperty {
832
959
  super.setProperties(prop, muteOnChange);
833
960
  }
834
961
  }
835
- __decorate$14([
962
+ __decorate$17([
836
963
  Property('File')
837
964
  ], FileMenuSettings.prototype, "text", void 0);
838
- __decorate$14([
965
+ __decorate$17([
839
966
  Property(false)
840
967
  ], FileMenuSettings.prototype, "visible", void 0);
841
- __decorate$14([
968
+ __decorate$17([
842
969
  Collection([], MenuItem)
843
970
  ], FileMenuSettings.prototype, "menuItems", void 0);
844
- __decorate$14([
971
+ __decorate$17([
845
972
  Property(false)
846
973
  ], FileMenuSettings.prototype, "showItemOnClick", void 0);
847
- __decorate$14([
974
+ __decorate$17([
848
975
  Complex({}, MenuAnimationSettings)
849
976
  ], FileMenuSettings.prototype, "animationSettings", void 0);
850
- __decorate$14([
977
+ __decorate$17([
851
978
  Property('')
852
979
  ], FileMenuSettings.prototype, "itemTemplate", void 0);
853
- __decorate$14([
980
+ __decorate$17([
854
981
  Property('')
855
982
  ], FileMenuSettings.prototype, "popupTemplate", void 0);
856
- __decorate$14([
983
+ __decorate$17([
857
984
  Complex({}, RibbonTooltip)
858
985
  ], FileMenuSettings.prototype, "ribbonTooltipSettings", void 0);
859
- __decorate$14([
986
+ __decorate$17([
860
987
  Event()
861
988
  ], FileMenuSettings.prototype, "beforeClose", void 0);
862
- __decorate$14([
989
+ __decorate$17([
863
990
  Event()
864
991
  ], FileMenuSettings.prototype, "beforeOpen", void 0);
865
- __decorate$14([
992
+ __decorate$17([
866
993
  Event()
867
994
  ], FileMenuSettings.prototype, "beforeItemRender", void 0);
868
- __decorate$14([
995
+ __decorate$17([
869
996
  Event()
870
997
  ], FileMenuSettings.prototype, "close", void 0);
871
- __decorate$14([
998
+ __decorate$17([
872
999
  Event()
873
1000
  ], FileMenuSettings.prototype, "open", void 0);
874
- __decorate$14([
1001
+ __decorate$17([
875
1002
  Event()
876
1003
  ], FileMenuSettings.prototype, "select", void 0);
1004
+ __decorate$17([
1005
+ Property('')
1006
+ ], FileMenuSettings.prototype, "keyTip", void 0);
877
1007
 
878
- var __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1008
+ var __decorate$19 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
879
1009
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
880
1010
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
881
1011
  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;
@@ -886,17 +1016,17 @@ var __decorate$16 = (undefined && undefined.__decorate) || function (decorators,
886
1016
  */
887
1017
  class BackstageBackButton extends ChildProperty {
888
1018
  }
889
- __decorate$16([
1019
+ __decorate$19([
890
1020
  Property('')
891
1021
  ], BackstageBackButton.prototype, "text", void 0);
892
- __decorate$16([
1022
+ __decorate$19([
893
1023
  Property('')
894
1024
  ], BackstageBackButton.prototype, "iconCss", void 0);
895
- __decorate$16([
1025
+ __decorate$19([
896
1026
  Property(true)
897
1027
  ], BackstageBackButton.prototype, "visible", void 0);
898
1028
 
899
- var __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1029
+ var __decorate$20 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
900
1030
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
901
1031
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
902
1032
  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;
@@ -907,29 +1037,32 @@ var __decorate$17 = (undefined && undefined.__decorate) || function (decorators,
907
1037
  */
908
1038
  class BackstageItem extends ChildProperty {
909
1039
  }
910
- __decorate$17([
1040
+ __decorate$20([
911
1041
  Property('')
912
1042
  ], BackstageItem.prototype, "text", void 0);
913
- __decorate$17([
1043
+ __decorate$20([
914
1044
  Property('')
915
1045
  ], BackstageItem.prototype, "id", void 0);
916
- __decorate$17([
1046
+ __decorate$20([
1047
+ Property('')
1048
+ ], BackstageItem.prototype, "keyTip", void 0);
1049
+ __decorate$20([
917
1050
  Property('')
918
1051
  ], BackstageItem.prototype, "content", void 0);
919
- __decorate$17([
1052
+ __decorate$20([
920
1053
  Property('')
921
1054
  ], BackstageItem.prototype, "iconCss", void 0);
922
- __decorate$17([
1055
+ __decorate$20([
923
1056
  Property(false)
924
1057
  ], BackstageItem.prototype, "separator", void 0);
925
- __decorate$17([
1058
+ __decorate$20([
926
1059
  Property(false)
927
1060
  ], BackstageItem.prototype, "isFooter", void 0);
928
- __decorate$17([
1061
+ __decorate$20([
929
1062
  Event()
930
1063
  ], BackstageItem.prototype, "backStageItemClick", void 0);
931
1064
 
932
- var __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1065
+ var __decorate$18 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
933
1066
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
934
1067
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
935
1068
  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;
@@ -949,34 +1082,67 @@ class BackStageMenu extends ChildProperty {
949
1082
  super.setProperties(prop, muteOnChange);
950
1083
  }
951
1084
  }
952
- __decorate$15([
1085
+ __decorate$18([
953
1086
  Property('File')
954
1087
  ], BackStageMenu.prototype, "text", void 0);
955
- __decorate$15([
1088
+ __decorate$18([
1089
+ Property('')
1090
+ ], BackStageMenu.prototype, "keyTip", void 0);
1091
+ __decorate$18([
956
1092
  Property(false)
957
1093
  ], BackStageMenu.prototype, "visible", void 0);
958
- __decorate$15([
1094
+ __decorate$18([
959
1095
  Property('auto')
960
1096
  ], BackStageMenu.prototype, "height", void 0);
961
- __decorate$15([
1097
+ __decorate$18([
962
1098
  Property('auto')
963
1099
  ], BackStageMenu.prototype, "width", void 0);
964
- __decorate$15([
1100
+ __decorate$18([
965
1101
  Property(null)
966
1102
  ], BackStageMenu.prototype, "target", void 0);
967
- __decorate$15([
1103
+ __decorate$18([
968
1104
  Complex({}, BackstageBackButton)
969
1105
  ], BackStageMenu.prototype, "backButton", void 0);
970
- __decorate$15([
1106
+ __decorate$18([
971
1107
  Collection([], BackstageItem)
972
1108
  ], BackStageMenu.prototype, "items", void 0);
973
- __decorate$15([
1109
+ __decorate$18([
974
1110
  Property('')
975
1111
  ], BackStageMenu.prototype, "template", void 0);
976
- __decorate$15([
1112
+ __decorate$18([
977
1113
  Complex({}, RibbonTooltip)
978
1114
  ], BackStageMenu.prototype, "ribbonTooltipSettings", void 0);
979
1115
 
1116
+ var __decorate$21 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1117
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1118
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1119
+ 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;
1120
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1121
+ };
1122
+ /**
1123
+ * Defines the ribbon contextual tab.
1124
+ */
1125
+ class RibbonContextualTabSettings extends ChildProperty {
1126
+ /**
1127
+ * @param {Object} prop - Gets the property of contextual tab.
1128
+ * @param {boolean} muteOnChange - Gets the boolean value of muteOnChange.
1129
+ * @returns {void}
1130
+ * @private
1131
+ */
1132
+ setProperties(prop, muteOnChange) {
1133
+ super.setProperties(prop, muteOnChange);
1134
+ }
1135
+ }
1136
+ __decorate$21([
1137
+ Property(false)
1138
+ ], RibbonContextualTabSettings.prototype, "visible", void 0);
1139
+ __decorate$21([
1140
+ Property(false)
1141
+ ], RibbonContextualTabSettings.prototype, "isSelected", void 0);
1142
+ __decorate$21([
1143
+ Collection([], RibbonTab)
1144
+ ], RibbonContextualTabSettings.prototype, "tabs", void 0);
1145
+
980
1146
  // export * from './file-menu';
981
1147
 
982
1148
  /**
@@ -1005,6 +1171,8 @@ const RIBBON_POPUP_CONTROL = 'e-ribbon-popup-control';
1005
1171
  /** @hidden */
1006
1172
  const RIBBON_POPUP_OPEN = 'e-ribbon-open';
1007
1173
  /** @hidden */
1174
+ const RIBBON_KEYTIP = 'e-ribbon-keytip';
1175
+ /** @hidden */
1008
1176
  const SPACE = ' ';
1009
1177
  /** @hidden */
1010
1178
  const HORIZONTAL_SCROLLBAR = 'e-hscroll-bar';
@@ -1013,6 +1181,8 @@ const HIDE_CSS = 'e-ribbon-hide';
1013
1181
  /** @hidden */
1014
1182
  const RIBBON_TAB = 'e-ribbon-tab';
1015
1183
  /** @hidden */
1184
+ const RIBBON_CONTEXTUAL_TAB = 'e-ribbon-contextual-tab';
1185
+ /** @hidden */
1016
1186
  const RIBBON_TAB_ACTIVE = 'e-ribbon-active';
1017
1187
  /** @hidden */
1018
1188
  const RIBBON_TAB_ITEM = 'e-ribbon-tab-item';
@@ -1045,6 +1215,8 @@ const RIBBON_GROUP_BUTTON = 'e-ribbon-group-button';
1045
1215
  /** @hidden */
1046
1216
  const RIBBON_GROUP_BUTTON_OVERFLOW_POPUP = 'e-ribbon-group-button-overflow-popup';
1047
1217
  /** @hidden */
1218
+ const RIBBON_GROUP_BUTTON_CONTENT = 'e-ribbon-group-button-content';
1219
+ /** @hidden */
1048
1220
  const RIBBON_GROUP_CONTAINER = 'e-ribbon-group-container';
1049
1221
  /** @hidden */
1050
1222
  const RIBBON_OF_TAB_CONTAINER = 'e-ribbon-of-tab';
@@ -1169,6 +1341,8 @@ const RIBBON_HELP_PANE_TEMPLATE_ID = '_helppanetemplate';
1169
1341
  /** @hidden */
1170
1342
  const RIBBON_GROUP_BUTTON_ID = '_grpbtn';
1171
1343
  /** @hidden */
1344
+ const RIBBON_KEYTIP_ID = '_keytip';
1345
+ /** @hidden */
1172
1346
  const RIBBON_FILE_MENU_WIDTH = '--fileMenuWidth';
1173
1347
  /** @hidden */
1174
1348
  const RIBBON_HELP_PANE_TEMPLATE_WIDTH = '--helpTemplateWidth';
@@ -1504,7 +1678,12 @@ class RibbonColorPicker {
1504
1678
  beforeOpen: colorPickerSettings.beforeOpen,
1505
1679
  beforeTileRender: colorPickerSettings.beforeTileRender,
1506
1680
  created: colorPickerSettings.created,
1507
- change: colorPickerSettings.change,
1681
+ change: (e) => {
1682
+ colorPickerSettings.value = e.value.toString();
1683
+ if (colorPickerSettings.change) {
1684
+ colorPickerSettings.change.call(this, e);
1685
+ }
1686
+ },
1508
1687
  open: () => {
1509
1688
  colorPicker.element.parentElement.classList.add(RIBBON_POPUP_OPEN);
1510
1689
  if (colorPickerSettings.open) {
@@ -2611,10 +2790,11 @@ function getTemplateFunction(template) {
2611
2790
  *
2612
2791
  * @param {RibbonTabModel} tabs - Gets the ribbon tab model.
2613
2792
  * @param {string} id - Gets the ID of the tab.
2793
+ * @param {RibbonItemType} type - Gets the type of the item.
2614
2794
  * @returns {itemProps} - Gets the ribbon item.
2615
2795
  * @hidden
2616
2796
  */
2617
- function getItem(tabs, id) {
2797
+ function getItem(tabs, id, type) {
2618
2798
  for (let i = 0; i < tabs.length; i++) {
2619
2799
  const tab = tabs[parseInt(i.toString(), 10)];
2620
2800
  for (let j = 0; j < tab.groups.length; j++) {
@@ -2623,7 +2803,7 @@ function getItem(tabs, id) {
2623
2803
  const collection = group.collections[parseInt(k.toString(), 10)];
2624
2804
  for (let l = 0; l < collection.items.length; l++) {
2625
2805
  const item = collection.items[parseInt(l.toString(), 10)];
2626
- if (item.id === id) {
2806
+ if ((id && item.id === id) || (type && item.type === type)) {
2627
2807
  return {
2628
2808
  item: item, collection: collection, group: group,
2629
2809
  tabIndex: i, groupIndex: j, collectionIndex: k, itemIndex: l
@@ -2938,6 +3118,9 @@ class RibbonGroupButton {
2938
3118
  if (groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes) {
2939
3119
  setCustomAttributes(groupButtonEle, groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes);
2940
3120
  }
3121
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].content) {
3122
+ groupButtonEle.classList.add(RIBBON_GROUP_BUTTON_CONTENT);
3123
+ }
2941
3124
  const buttonEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
2942
3125
  if (groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
2943
3126
  btnContainerEle.classList.add(RIBBON_SINGLE_BUTTON_SELECTION);
@@ -3376,79 +3559,792 @@ class RibbonGroupButton {
3376
3559
  }
3377
3560
  }
3378
3561
 
3379
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3380
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3381
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3382
- 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;
3383
- return c > 3 && r && Object.defineProperty(target, key, r), r;
3384
- };
3385
- var Ribbon_1;
3386
3562
  /**
3387
- * The Ribbon Component is a structured layout to manage tools with tabs and groups.
3563
+ * Defines the items of Ribbon.
3388
3564
  */
3389
- let Ribbon = Ribbon_1 = class Ribbon extends Component {
3390
- /**
3391
- * Constructor for creating the widget.
3392
- *
3393
- * @param {RibbonModel} options - Specifies the ribbon model
3394
- * @param {string|HTMLDivElement} element - Specifies the target element
3395
- */
3396
- constructor(options, element) {
3397
- Ribbon_1.Inject(RibbonButton, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonComboBox, RibbonGroupButton);
3398
- super(options, element);
3399
- }
3400
- /**
3401
- * Initialize the control rendering.
3402
- *
3403
- * @returns {void}
3404
- * @private
3405
- */
3406
- render() {
3407
- this.initialize();
3408
- }
3409
- preRender() {
3410
- this.idIndex = 0;
3411
- this.tooltipData = [];
3412
- this.initialPropsData = {};
3413
- this.hiddenElements = {};
3414
- this.hiddenGroups = [];
3415
- this.isAddRemove = false;
3416
- this.keyConfigs = {
3417
- leftarrow: 'leftarrow',
3418
- rightarrow: 'rightarrow',
3419
- tab: 'tab',
3420
- shiftTab: 'shift+tab'
3421
- };
3422
- }
3423
- /**
3424
- * Get the properties to be maintained in the persisted state.
3425
- *
3426
- * @returns {string} - Persist data
3427
- */
3428
- getPersistData() {
3429
- return this.addOnPersist(['activeLayout']);
3565
+ class RibbonGallery {
3566
+ constructor(parent) {
3567
+ this.count = 0;
3568
+ this.isAdded = false;
3569
+ this.galleryItemsIndex = 0;
3570
+ this.parent = parent;
3430
3571
  }
3431
- /**
3432
- * Get component name.
3433
- *
3434
- * @returns {string} - Module name
3435
- * @private
3436
- */
3437
3572
  getModuleName() {
3438
- return 'ribbon';
3573
+ return 'ribbonGallery';
3574
+ }
3575
+ destroy() {
3576
+ this.parent = null;
3439
3577
  }
3440
3578
  /**
3441
- * To provide the array of modules needed for component rendering
3579
+ * Creates gallery.
3442
3580
  *
3443
- * @returns {ModuleDeclaration[]} - returns module declaration.
3581
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3582
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
3583
+ * @returns {void}
3444
3584
  * @hidden
3445
3585
  */
3446
- requiredModules() {
3447
- const modules = [];
3448
- 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] });
3449
- return modules;
3586
+ createGallery(item, itemEle) {
3587
+ const gallerySettings = item.gallerySettings;
3588
+ this.renderGalleryItems(gallerySettings, false, item.id, itemEle);
3589
+ const buttonEle = this.parent.createElement('button', {
3590
+ id: item.id + '_popupButton',
3591
+ className: 'e-ribbon-gallery-button e-icons e-drop-icon'
3592
+ });
3593
+ itemEle.appendChild(buttonEle);
3594
+ this.createPopup(item, buttonEle);
3595
+ buttonEle.onclick = (args) => {
3596
+ let popupEle = document.querySelector('#' + item.id + '_galleryPopup');
3597
+ if (popupEle) {
3598
+ let popup = getComponent(popupEle, Popup);
3599
+ popupEle.classList.contains('e-popup-close') ? this.showPopup(popup, popupEle, args, gallerySettings, item.id) : this.hidePopup(popup, popupEle, args, gallerySettings, item.id);
3600
+ }
3601
+ };
3602
+ document.onclick = (args) => {
3603
+ let popupEle = document.querySelectorAll('.e-ribbon-gallery-popup.e-popup-open');
3604
+ let popupID;
3605
+ let itemProp;
3606
+ for (let i = 0; i < popupEle.length; i++) {
3607
+ let popup = getComponent(popupEle[parseInt(i.toString(), 10)], Popup);
3608
+ if (args.target.classList.contains('e-ribbon-gallery-button')) {
3609
+ popupID = (popupEle[parseInt(i.toString(), 10)].id).replace(/_galleryPopup/g, '');
3610
+ if ((args.target.id).replace(/_popupButton/g, '') !== popupID) {
3611
+ itemProp = getItem(this.parent.tabs, popupID);
3612
+ this.hidePopup(popup, popupEle[parseInt(i.toString(), 10)], args, itemProp.item.gallerySettings, popupID);
3613
+ break;
3614
+ }
3615
+ }
3616
+ else {
3617
+ popupID = (popupEle[parseInt(i.toString(), 10)].id).replace(/_galleryPopup/g, '');
3618
+ itemProp = getItem(this.parent.tabs, popupID);
3619
+ this.hidePopup(popup, popupEle[parseInt(i.toString(), 10)], args, itemProp.item.gallerySettings, popupID);
3620
+ break;
3621
+ }
3622
+ }
3623
+ };
3450
3624
  }
3451
- initialize() {
3625
+ renderGalleryItems(gallerySettings, isPopup, id, itemEle) {
3626
+ let galleryContainerEle;
3627
+ let galleryEle;
3628
+ const itemProp = getItem(this.parent.tabs, id);
3629
+ if (itemProp && itemProp.group) {
3630
+ itemProp.group.isCollapsible = false;
3631
+ }
3632
+ let galleryWrapper = this.parent.createElement('div', {
3633
+ className: 'e-ribbon-gallery-wrapper',
3634
+ id: id + '_galleryWrapper'
3635
+ });
3636
+ if (!isPopup) {
3637
+ itemEle.appendChild(galleryWrapper);
3638
+ }
3639
+ for (let i = 0; i < gallerySettings.groups.length; i++) {
3640
+ let isHeightDefined = false;
3641
+ galleryContainerEle = this.parent.createElement('ol', {
3642
+ className: 'e-ribbon-gallery-container',
3643
+ id: id + '_galleryContainer' + i
3644
+ });
3645
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
3646
+ isHeightDefined = true;
3647
+ }
3648
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].cssClass) {
3649
+ galleryContainerEle.classList.add(gallerySettings.groups[parseInt(i.toString(), 10)].cssClass);
3650
+ }
3651
+ for (let j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
3652
+ galleryEle = this.parent.createElement('li', {
3653
+ className: 'e-ribbon-gallery-item',
3654
+ id: galleryContainerEle.id + '_gallery' + j,
3655
+ attrs: { 'tabindex': '0' }
3656
+ });
3657
+ const itemEventArgs = { name: 'beforeItemRender', item: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)] };
3658
+ if (gallerySettings.beforeItemRender) {
3659
+ gallerySettings.beforeItemRender.call(this, itemEventArgs);
3660
+ }
3661
+ galleryContainerEle.appendChild(galleryEle);
3662
+ if (gallerySettings.selectedItemIndex && gallerySettings.selectedItemIndex === this.count) {
3663
+ galleryEle.classList.add('e-ribbon-gallery-selected');
3664
+ }
3665
+ else {
3666
+ if (!gallerySettings.selectedItemIndex && this.count === 0) {
3667
+ galleryEle.classList.add('e-ribbon-gallery-selected');
3668
+ gallerySettings.selectedItemIndex = this.count;
3669
+ }
3670
+ }
3671
+ this.count = this.count + 1;
3672
+ galleryEle.onclick = (e) => {
3673
+ this.setActiveState(e.currentTarget, gallerySettings, id, true, e);
3674
+ };
3675
+ galleryEle.onkeydown = (e) => {
3676
+ if (e.key === 'Enter' || e.key === ' ') {
3677
+ this.setActiveState(e.currentTarget, gallerySettings, id, true, e);
3678
+ }
3679
+ };
3680
+ galleryEle.onmouseover = (e) => {
3681
+ const hoverEventArgs = { event: e, name: 'itemHover', item: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)] };
3682
+ if (gallerySettings.itemHover) {
3683
+ gallerySettings.itemHover.call(this, hoverEventArgs);
3684
+ }
3685
+ };
3686
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth && gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth !== 'auto') {
3687
+ galleryEle.style.width = gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth + 'px';
3688
+ }
3689
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
3690
+ galleryEle.style.height = gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight + 'px';
3691
+ galleryEle.style.paddingTop = '0px';
3692
+ galleryEle.style.paddingBottom = '0px';
3693
+ if (this.parent.activeLayout !== 'Simplified' && !isPopup) {
3694
+ galleryContainerEle.style.flexFlow = 'wrap';
3695
+ }
3696
+ }
3697
+ if ((!gallerySettings.template && !gallerySettings.popupTemplate) || ((gallerySettings.template && !gallerySettings.popupTemplate) && isPopup) || ((gallerySettings.popupTemplate && !gallerySettings.template) && !isPopup)) {
3698
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].htmlAttributes) {
3699
+ setCustomAttributes(galleryEle, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].htmlAttributes);
3700
+ }
3701
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss) {
3702
+ const iconEle = this.parent.createElement('span', {
3703
+ className: 'e-ribbon-gallery-icons' + ' ' + gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss
3704
+ });
3705
+ galleryEle.appendChild(iconEle);
3706
+ if (this.parent.activeLayout === 'Simplified' && !isPopup) {
3707
+ iconEle.classList.add('e-hidden');
3708
+ }
3709
+ }
3710
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].content) {
3711
+ galleryEle.appendChild(this.parent.createElement('span', {
3712
+ innerHTML: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].content,
3713
+ className: 'e-ribbon-gallery-text'
3714
+ }));
3715
+ }
3716
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].disabled) {
3717
+ galleryEle.classList.add('e-disabled');
3718
+ }
3719
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].cssClass) {
3720
+ galleryEle.classList.add(gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].cssClass);
3721
+ }
3722
+ }
3723
+ if (gallerySettings.template && !isPopup) {
3724
+ this.createGalleryTemplate(galleryEle, gallerySettings, id, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)]);
3725
+ }
3726
+ if (gallerySettings.popupTemplate && isPopup) {
3727
+ this.createGalleryPopupTemplate(galleryEle, gallerySettings, id, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)]);
3728
+ }
3729
+ if ((!isPopup && !isHeightDefined && (gallerySettings.itemCount === this.count))) {
3730
+ galleryWrapper.appendChild(galleryContainerEle);
3731
+ this.isAdded = true;
3732
+ break;
3733
+ }
3734
+ }
3735
+ if (this.isAdded && !isPopup) {
3736
+ break;
3737
+ }
3738
+ !isPopup ? galleryWrapper.appendChild(galleryContainerEle) : itemEle.appendChild(galleryContainerEle);
3739
+ if (isPopup && gallerySettings.groups[parseInt(i.toString(), 10)].header) {
3740
+ let headerEle = (this.parent.createElement('div', {
3741
+ className: 'e-ribbon-gallery-header',
3742
+ innerHTML: gallerySettings.groups[parseInt(i.toString(), 10)].header
3743
+ }));
3744
+ itemEle.insertBefore(headerEle, galleryContainerEle);
3745
+ }
3746
+ }
3747
+ this.count = 0;
3748
+ this.isAdded = false;
3749
+ }
3750
+ setWrapperWidth(itemCount, galleryWrapper, gallerySettings, itemID) {
3751
+ let count = 1;
3752
+ let itemsWidth = 0;
3753
+ let isWidthApplied = false;
3754
+ for (let i = 0; i < gallerySettings.groups.length; i++) {
3755
+ for (let j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
3756
+ if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
3757
+ if (itemCount >= count) {
3758
+ let galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + i + '_gallery' + j);
3759
+ if (galleryItemEle) {
3760
+ itemsWidth += galleryItemEle.offsetWidth;
3761
+ let itemStyles = window.getComputedStyle(galleryItemEle);
3762
+ if (itemStyles) {
3763
+ let paddingWidth = parseFloat(itemStyles.paddingLeft) + parseFloat(itemStyles.paddingRight);
3764
+ if (!(isNullOrUndefined(paddingWidth)))
3765
+ itemsWidth += paddingWidth;
3766
+ let marginWidth = parseFloat(itemStyles.marginLeft) + parseFloat(itemStyles.marginRight);
3767
+ if (!(isNullOrUndefined(marginWidth)))
3768
+ itemsWidth += marginWidth;
3769
+ }
3770
+ }
3771
+ }
3772
+ else {
3773
+ isWidthApplied = true;
3774
+ break;
3775
+ }
3776
+ count++;
3777
+ }
3778
+ }
3779
+ if (isWidthApplied) {
3780
+ break;
3781
+ }
3782
+ }
3783
+ if (itemsWidth > 0)
3784
+ galleryWrapper.style.width = itemsWidth + 'px';
3785
+ }
3786
+ /**
3787
+ * Checks the gallery items height.
3788
+ *
3789
+ * @param {number} selectedTab - Gets the current selected tab.
3790
+ * @param {HTMLElement} activeContent - Gets the current active content.
3791
+ * @returns {void}
3792
+ * @hidden
3793
+ */
3794
+ checkAvailableHeight(selectedTab, activeContent) {
3795
+ let galleryWrapperItems = activeContent.querySelectorAll('.e-ribbon-gallery-wrapper');
3796
+ for (let n = 0; n < galleryWrapperItems.length; n++) {
3797
+ let isHeight = false;
3798
+ let itemsCount = 0;
3799
+ let galleryWrapper = galleryWrapperItems[parseInt(n.toString(), 10)];
3800
+ let galleryWrapperHeight = galleryWrapper.offsetHeight;
3801
+ let itemID = galleryWrapper.id.replace(/_galleryWrapper/g, '');
3802
+ const itemProp = getItem(this.parent.tabs, itemID);
3803
+ if (itemProp) {
3804
+ this.setWrapperWidth(itemProp.item.gallerySettings.itemCount, galleryWrapper, itemProp.item.gallerySettings, itemID);
3805
+ for (let i = 0; i < itemProp.item.gallerySettings.groups.length; i++) {
3806
+ if (itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
3807
+ for (let j = 0; j < itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
3808
+ let galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + i + '_gallery' + j);
3809
+ if (galleryItemEle) {
3810
+ itemsCount++;
3811
+ if (!isHeight) {
3812
+ if (itemsCount === 1) {
3813
+ let itemsValues = 0;
3814
+ let itemStyles = window.getComputedStyle(galleryItemEle);
3815
+ if (itemStyles) {
3816
+ let paddingWidth = parseFloat(itemStyles.paddingTop) + parseFloat(itemStyles.paddingBottom);
3817
+ if (!(isNullOrUndefined(paddingWidth)))
3818
+ itemsValues += paddingWidth;
3819
+ let marginWidth = parseFloat(itemStyles.marginTop) + parseFloat(itemStyles.marginBottom);
3820
+ if (!(isNullOrUndefined(marginWidth)))
3821
+ itemsValues += marginWidth;
3822
+ }
3823
+ if (galleryWrapperHeight > (galleryItemEle.offsetHeight + itemsValues)) {
3824
+ galleryWrapperHeight -= (galleryItemEle.offsetHeight + itemsValues);
3825
+ }
3826
+ else {
3827
+ isHeight = true;
3828
+ galleryItemEle.remove();
3829
+ }
3830
+ }
3831
+ if (itemsCount === itemProp.item.gallerySettings.itemCount) {
3832
+ itemsCount = 0;
3833
+ }
3834
+ }
3835
+ else {
3836
+ galleryItemEle.remove();
3837
+ }
3838
+ }
3839
+ }
3840
+ }
3841
+ }
3842
+ }
3843
+ }
3844
+ }
3845
+ checkCollision(popup, popupEle) {
3846
+ let paddingWidth = 0;
3847
+ let marginWidth = 0;
3848
+ if (popupEle) {
3849
+ let screenWidth = window.innerWidth;
3850
+ let paddingStyles = window.getComputedStyle(popupEle);
3851
+ if (paddingStyles) {
3852
+ paddingWidth = parseFloat(paddingStyles.paddingLeft) + parseFloat(paddingStyles.paddingRight);
3853
+ if (!(isNullOrUndefined(paddingWidth)))
3854
+ screenWidth = screenWidth - paddingWidth;
3855
+ }
3856
+ let popupContainerItems = popupEle.querySelectorAll('.e-ribbon-gallery-container');
3857
+ if (popup.width !== 'auto') {
3858
+ popupContainerItems.forEach((ele) => {
3859
+ ele.style.flexFlow = 'wrap';
3860
+ });
3861
+ }
3862
+ let isCollideOccurs = false;
3863
+ for (let i = 0; i < popupContainerItems.length; i++) {
3864
+ let itemsWidth = 0;
3865
+ for (let j = 0; j < popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item').length; j++) {
3866
+ let marginStyles = window.getComputedStyle(popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)]);
3867
+ if (marginStyles) {
3868
+ marginWidth = parseFloat(marginStyles.marginLeft) + parseFloat(marginStyles.marginRight);
3869
+ if (!(isNullOrUndefined(marginWidth)))
3870
+ itemsWidth += marginWidth;
3871
+ }
3872
+ itemsWidth += popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)].offsetWidth;
3873
+ if (((screenWidth <= itemsWidth) && popup.width === 'auto') || ((popup.width !== 'auto') && (screenWidth <= parseInt(popup.width.toString(), 10)) && (screenWidth <= itemsWidth))) {
3874
+ popupEle.style.width = ((itemsWidth + Math.abs(paddingWidth - marginWidth)) - popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)].offsetWidth) + 'px';
3875
+ isCollideOccurs = true;
3876
+ break;
3877
+ }
3878
+ }
3879
+ if (isCollideOccurs) {
3880
+ popupContainerItems.forEach((ele) => {
3881
+ ele.style.flexFlow = 'wrap';
3882
+ });
3883
+ break;
3884
+ }
3885
+ }
3886
+ if (!isCollideOccurs) {
3887
+ if (popup.width === 'auto') {
3888
+ popupContainerItems.forEach((ele) => {
3889
+ ele.style.flexFlow = 'nowrap';
3890
+ });
3891
+ popupEle.style.width = 'auto';
3892
+ }
3893
+ else {
3894
+ popupEle.style.width = (popup.width).toString();
3895
+ }
3896
+ }
3897
+ }
3898
+ }
3899
+ createPopup(item, buttonEle) {
3900
+ let popupContainer = this.parent.createElement('div', {
3901
+ className: 'e-ribbon-popup-container',
3902
+ id: item.id + '_popupContainer'
3903
+ });
3904
+ this.renderGalleryItems(item.gallerySettings, true, item.id, popupContainer);
3905
+ const gallerypopupElement = this.parent.createElement('div', {
3906
+ className: 'e-ribbon-gallery-popup',
3907
+ id: item.id + '_galleryPopup'
3908
+ });
3909
+ document.body.append(gallerypopupElement);
3910
+ const galleryPopup = new Popup(gallerypopupElement, {
3911
+ relateTo: buttonEle,
3912
+ content: popupContainer,
3913
+ collision: { X: 'fit', Y: 'flip' },
3914
+ actionOnScroll: 'hide',
3915
+ targetType: 'relative',
3916
+ position: { X: 'left', Y: 'bottom' },
3917
+ enableRtl: this.parent.enableRtl,
3918
+ width: item.gallerySettings.popupWidth,
3919
+ height: item.gallerySettings.popupHeight
3920
+ });
3921
+ galleryPopup.hide();
3922
+ }
3923
+ /**
3924
+ * Updates gallery in mode switching.
3925
+ *
3926
+ * @param {string} activeLayout - Gets the current active layout.
3927
+ * @param {string} itemID - Gets the ribbon item id.
3928
+ * @returns {void}
3929
+ * @hidden
3930
+ */
3931
+ switchGalleryItems(activeLayout, itemID) {
3932
+ let itemEle = this.parent.element.querySelector('#' + itemID + CONTAINER_ID);
3933
+ let count = 0;
3934
+ const itemProp = getItem(this.parent.tabs, itemID);
3935
+ if (itemEle) {
3936
+ let galleryWrapper = itemEle.querySelector('.e-ribbon-gallery-wrapper');
3937
+ let galleryIcons = itemEle.querySelectorAll('.e-ribbon-gallery-icons');
3938
+ let galleryContainer = itemEle.querySelectorAll('.e-ribbon-gallery-container');
3939
+ if (galleryIcons.length) {
3940
+ for (let i = 0; i < galleryIcons.length; i++) {
3941
+ activeLayout === 'Simplified' ? galleryIcons[parseInt(i.toString(), 10)].classList.add('e-hidden') : galleryIcons[parseInt(i.toString(), 10)].classList.remove('e-hidden');
3942
+ }
3943
+ }
3944
+ if (galleryContainer.length && itemProp) {
3945
+ for (let n = 0; n < itemProp.item.gallerySettings.groups.length; n++) {
3946
+ for (let i = 0; i < galleryContainer.length; i++) {
3947
+ if (itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].itemHeight && itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].itemHeight !== 'auto') {
3948
+ if (itemID + '_galleryContainer' + n === galleryContainer[parseInt(i.toString(), 10)].id) {
3949
+ activeLayout === 'Simplified' ? galleryContainer[parseInt(i.toString(), 10)].style.flexFlow = 'nowrap' : galleryContainer[parseInt(i.toString(), 10)].style.flexFlow = 'wrap';
3950
+ }
3951
+ }
3952
+ }
3953
+ }
3954
+ }
3955
+ if (galleryWrapper) {
3956
+ for (let n = 0; n < itemProp.item.gallerySettings.groups.length; n++) {
3957
+ for (let i = 0; i < itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].items.length; i++) {
3958
+ count++;
3959
+ if (count > itemProp.item.gallerySettings.itemCount) {
3960
+ let galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + n + '_gallery' + i);
3961
+ if (galleryItemEle) {
3962
+ activeLayout === 'Simplified' ? galleryItemEle.classList.add('e-hidden') : galleryItemEle.classList.remove('e-hidden');
3963
+ }
3964
+ }
3965
+ }
3966
+ }
3967
+ }
3968
+ }
3969
+ }
3970
+ /**
3971
+ * Adds the additional event handlers as the item moved into overflow popup.
3972
+ *
3973
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3974
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
3975
+ * @param {DropDownButton} overflowButton - Gets the overflow button.
3976
+ * @returns {void}
3977
+ * @hidden
3978
+ */
3979
+ addOverFlowEvents(item, itemEle, overflowButton) {
3980
+ if (itemEle.closest('.e-ribbon-overflow-target')) {
3981
+ const buttonEle = this.parent.createElement('button', {
3982
+ id: item.id,
3983
+ });
3984
+ itemEle.appendChild(buttonEle);
3985
+ itemEle.querySelector('.e-ribbon-gallery-wrapper').classList.add('e-hidden');
3986
+ itemEle.querySelectorAll('.e-ribbon-gallery-container').forEach((ele) => {
3987
+ ele.classList.add('e-hidden');
3988
+ });
3989
+ let popupButton = itemEle.querySelector('#' + item.id + '_popupButton');
3990
+ if (popupButton)
3991
+ popupButton.classList.add('e-hidden');
3992
+ const itemProp = getItem(this.parent.tabs, item.id);
3993
+ let iconCss = itemProp && itemProp.group.groupIconCss ? itemProp.group.groupIconCss : '';
3994
+ let content = itemProp && itemProp.group.header ? itemProp.group.header : '';
3995
+ if (!iconCss) {
3996
+ for (let i = 0; i < item.gallerySettings.groups.length; i++) {
3997
+ for (let j = 0; j < item.gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
3998
+ if (item.gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss) {
3999
+ iconCss = item.gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss;
4000
+ break;
4001
+ }
4002
+ }
4003
+ if (iconCss) {
4004
+ break;
4005
+ }
4006
+ }
4007
+ }
4008
+ let popupEle = document.querySelector('#' + item.id + '_galleryPopup');
4009
+ let popup = getComponent(popupEle, Popup);
4010
+ let popupContainerEle = document.querySelector('#' + item.id + '_galleryPopup .e-ribbon-popup-container');
4011
+ const dropdown = new DropDownButton({
4012
+ iconCss: iconCss,
4013
+ content: content,
4014
+ target: popupContainerEle,
4015
+ enableRtl: this.parent.enableRtl,
4016
+ cssClass: 'e-ribbon-gallery-dropdown',
4017
+ disabled: item.disabled,
4018
+ open: () => {
4019
+ this.setFoucsToFirstItem(popupContainerEle, true, item.id);
4020
+ this.checkCollision(dropdown.dropDown, dropdown.dropDown.element);
4021
+ },
4022
+ beforeClose: (args) => {
4023
+ const isCancelled = this.popupEvents(args.event, item.gallerySettings, 'popupClose', false);
4024
+ if (isCancelled) {
4025
+ args.cancel = true;
4026
+ }
4027
+ }
4028
+ }, buttonEle);
4029
+ if (popup.width !== 'auto') {
4030
+ dropdown.dropDown.width = formatUnit(popup.width);
4031
+ }
4032
+ if (popup.height !== 'auto') {
4033
+ dropdown.dropDown.height = formatUnit(popup.height);
4034
+ dropdown.dropDown.element.style.height = (popup.height).toString();
4035
+ }
4036
+ }
4037
+ }
4038
+ /**
4039
+ * Removes the additional event handlers as the item moved into overflow popup.
4040
+ *
4041
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
4042
+ * @param {HTMLElement} itemEle - Gets the ribbon item element.
4043
+ * @returns {void}
4044
+ * @hidden
4045
+ */
4046
+ removeOverFlowEvents(item, itemEle) {
4047
+ let popupButton = itemEle.querySelector('#' + item.id + '_popupButton');
4048
+ if (popupButton) {
4049
+ popupButton.classList.remove('e-hidden');
4050
+ }
4051
+ itemEle.querySelector('.e-ribbon-gallery-wrapper').classList.remove('e-hidden');
4052
+ itemEle.querySelectorAll('.e-ribbon-gallery-container').forEach((ele) => {
4053
+ ele.classList.remove('e-hidden');
4054
+ });
4055
+ const galleryDDBEle = document.querySelector('#' + item.id);
4056
+ if (galleryDDBEle) {
4057
+ let popupEle = document.querySelector('#' + item.id + '_galleryPopup');
4058
+ const dropdown = getComponent(galleryDDBEle, DropDownButton);
4059
+ popupEle.appendChild(dropdown.target);
4060
+ dropdown.destroy();
4061
+ remove(galleryDDBEle);
4062
+ }
4063
+ }
4064
+ setActiveState(galleryEle, gallerySettings, itemID, isInteracted, event) {
4065
+ let previousItem;
4066
+ let currentItem;
4067
+ let itemEle = document.querySelector('#' + itemID + CONTAINER_ID);
4068
+ let selctedGalleryItem = Array.prototype.slice.call(itemEle.querySelectorAll('.e-ribbon-gallery-selected'));
4069
+ let popupEle = document.querySelector('#' + itemID + '_popupContainer');
4070
+ let popupGalleryItem = Array.prototype.slice.call(popupEle.querySelectorAll('.e-ribbon-gallery-selected'));
4071
+ if (popupGalleryItem.length) {
4072
+ selctedGalleryItem = selctedGalleryItem.concat(popupGalleryItem);
4073
+ }
4074
+ for (let i = 0; i < gallerySettings.groups.length; i++) {
4075
+ for (let j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
4076
+ if (selctedGalleryItem[0].id === itemID + '_galleryContainer' + i + '_gallery' + j) {
4077
+ previousItem = gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)];
4078
+ }
4079
+ if (galleryEle.id === itemID + '_galleryContainer' + i + '_gallery' + j) {
4080
+ currentItem = gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)];
4081
+ }
4082
+ }
4083
+ }
4084
+ let galleryItem = document.querySelectorAll('#' + galleryEle.id);
4085
+ const selectingEventArgs = { cancel: false, name: 'beforeSelect', previousItem: previousItem, currentItem: currentItem, isInteracted: isInteracted, event: event };
4086
+ if (gallerySettings.beforeSelect) {
4087
+ gallerySettings.beforeSelect.call(this, selectingEventArgs);
4088
+ }
4089
+ if (selectingEventArgs.cancel) {
4090
+ return;
4091
+ }
4092
+ else {
4093
+ for (let i = 0; i < selctedGalleryItem.length; i++) {
4094
+ selctedGalleryItem[parseInt(i.toString(), 10)].classList.remove('e-ribbon-gallery-selected');
4095
+ }
4096
+ for (let i = 0; i < galleryItem.length; i++) {
4097
+ galleryItem[parseInt(i.toString(), 10)].classList.add('e-ribbon-gallery-selected');
4098
+ }
4099
+ const selectedEventArgs = { previousItem: previousItem, currentItem: currentItem, name: 'select', isInteracted: isInteracted, event: event };
4100
+ let galleryPopupItems = document.querySelectorAll('#' + itemID + '_popupContainer .e-ribbon-gallery-item');
4101
+ for (let i = 0; i < galleryPopupItems.length; i++) {
4102
+ if (galleryPopupItems[parseInt(i.toString(), 10)].id === galleryEle.id) {
4103
+ gallerySettings.selectedItemIndex = i;
4104
+ break;
4105
+ }
4106
+ }
4107
+ if (gallerySettings.select) {
4108
+ gallerySettings.select.call(this, selectedEventArgs);
4109
+ }
4110
+ }
4111
+ }
4112
+ popupEvents(args, gallerySettings, name, isOpen) {
4113
+ const popupEventArgs = { cancel: false, event: args, name: name };
4114
+ if (isOpen && gallerySettings.popupOpen) {
4115
+ gallerySettings.popupOpen.call(this, popupEventArgs);
4116
+ }
4117
+ else if (!isOpen && gallerySettings.popupClose) {
4118
+ gallerySettings.popupClose.call(this, popupEventArgs);
4119
+ }
4120
+ if (popupEventArgs.cancel) {
4121
+ return true;
4122
+ }
4123
+ return false;
4124
+ }
4125
+ showPopup(popup, popupEle, args, gallerySettings, itemID) {
4126
+ const isCancelled = this.popupEvents(args, gallerySettings, 'popupOpen', true);
4127
+ if (isCancelled) {
4128
+ return;
4129
+ }
4130
+ popup.show();
4131
+ this.checkCollision(popup, popupEle);
4132
+ const buttonEle = document.querySelector('#' + itemID + '_popupButton');
4133
+ buttonEle.classList.add('e-gallery-button-active');
4134
+ const buttonPosition = buttonEle.getBoundingClientRect();
4135
+ const offsetX = Math.abs((popupEle.offsetWidth - buttonPosition.left)) + buttonEle.offsetWidth;
4136
+ popupEle.style.left = offsetX + 'px';
4137
+ popupEle.style.top = popupEle.getBoundingClientRect().top + 2 + 'px';
4138
+ this.setFoucsToFirstItem(popupEle, false, itemID, popup, gallerySettings);
4139
+ }
4140
+ hidePopup(popup, popupEle, args, gallerySettings, itemID) {
4141
+ const isCancelled = this.popupEvents(args, gallerySettings, 'popupClose', false);
4142
+ if (isCancelled) {
4143
+ return;
4144
+ }
4145
+ popup.hide();
4146
+ const buttonEle = document.querySelector('#' + itemID + '_popupButton');
4147
+ buttonEle.classList.remove('e-gallery-button-active');
4148
+ }
4149
+ /**
4150
+ * Shows a specific gallery popup in the ribbon.
4151
+ *
4152
+ * @param {string} id - Gets the ribbon item id.
4153
+ * @returns {void}
4154
+ */
4155
+ showGalleryPopup(id) {
4156
+ const itemProp = getItem(this.parent.tabs, id);
4157
+ let popupEle = document.querySelector('#' + id + '_galleryPopup');
4158
+ let popup = getComponent(popupEle, Popup);
4159
+ this.showPopup(popup, popupEle, null, itemProp.item.gallerySettings, id);
4160
+ }
4161
+ /**
4162
+ * Hides a specific gallery popup in the ribbon.
4163
+ *
4164
+ * @param {string} id - Gets the ribbon item id.
4165
+ * @returns {void}
4166
+ */
4167
+ hideGalleryPopup(id) {
4168
+ const itemProp = getItem(this.parent.tabs, id);
4169
+ let popupEle = document.querySelector('#' + id + '_galleryPopup');
4170
+ let popup = getComponent(popupEle, Popup);
4171
+ this.hidePopup(popup, popupEle, null, itemProp.item.gallerySettings, id);
4172
+ }
4173
+ setFoucsToFirstItem(popupEle, isDropdown, itemID, popup, gallerySettings) {
4174
+ popupEle.querySelectorAll('.e-ribbon-gallery-item')[0].focus();
4175
+ this.galleryItemsIndex = 0;
4176
+ popupEle.onkeydown = (e) => {
4177
+ this.handleGalleryPopupNavigation(e, popupEle, isDropdown, itemID, popup, gallerySettings);
4178
+ };
4179
+ }
4180
+ handleGalleryPopupNavigation(e, popupEle, isDropdown, itemID, popup, gallerySettings) {
4181
+ let galleryPopupEle = popupEle.querySelectorAll('.e-ribbon-gallery-item');
4182
+ if (galleryPopupEle) {
4183
+ if (e.key === 'Home') {
4184
+ this.galleryItemsIndex = 0;
4185
+ galleryPopupEle[this.galleryItemsIndex].focus();
4186
+ }
4187
+ else if (e.key === 'End') {
4188
+ this.galleryItemsIndex = galleryPopupEle.length - 1;
4189
+ galleryPopupEle[this.galleryItemsIndex].focus();
4190
+ }
4191
+ else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
4192
+ this.galleryItemsIndex++;
4193
+ if (this.galleryItemsIndex !== galleryPopupEle.length) {
4194
+ if (galleryPopupEle && (galleryPopupEle[this.galleryItemsIndex])) {
4195
+ galleryPopupEle[this.galleryItemsIndex].focus();
4196
+ }
4197
+ }
4198
+ else {
4199
+ this.galleryItemsIndex = 0;
4200
+ galleryPopupEle[this.galleryItemsIndex].focus();
4201
+ }
4202
+ }
4203
+ else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
4204
+ if (this.galleryItemsIndex !== 0) {
4205
+ this.galleryItemsIndex--;
4206
+ if (galleryPopupEle && (galleryPopupEle[this.galleryItemsIndex])) {
4207
+ galleryPopupEle[this.galleryItemsIndex].focus();
4208
+ }
4209
+ }
4210
+ else {
4211
+ this.galleryItemsIndex = galleryPopupEle.length - 1;
4212
+ galleryPopupEle[this.galleryItemsIndex].focus();
4213
+ }
4214
+ }
4215
+ else if (e.key === 'Enter' || e.code === 'Space') {
4216
+ galleryPopupEle[this.galleryItemsIndex].click();
4217
+ }
4218
+ else if (e.key === 'Escape' && !isDropdown) {
4219
+ this.hidePopup(popup, popupEle, e, gallerySettings, itemID);
4220
+ }
4221
+ }
4222
+ }
4223
+ createGalleryTemplate(galleryItemEle, gallerySettings, id, items) {
4224
+ galleryItemEle.classList.add('e-ribbon-gallery-template');
4225
+ const templateName = 'ribbon' + id + 'galleryTemplate';
4226
+ this.parent['clearTemplate']([templateName]);
4227
+ const templateFunction = getTemplateFunction(gallerySettings.template);
4228
+ if (items.disabled) {
4229
+ galleryItemEle.classList.add('e-disabled');
4230
+ }
4231
+ if (items.cssClass) {
4232
+ galleryItemEle.classList.add(items.cssClass);
4233
+ }
4234
+ append(templateFunction({ items: items }, this, templateName, (id + 'galleryTemplate'), this.parent.isStringTemplate), galleryItemEle);
4235
+ this.parent['renderReactTemplates']();
4236
+ }
4237
+ createGalleryPopupTemplate(galleryItemEle, gallerySettings, id, items) {
4238
+ galleryItemEle.classList.add('e-ribbon-gallery-popup-template');
4239
+ const templateName = 'ribbon' + id + 'galleryPopupTemplate';
4240
+ this.parent['clearTemplate']([templateName]);
4241
+ const templateFunction = getTemplateFunction(gallerySettings.popupTemplate);
4242
+ if (items.disabled) {
4243
+ galleryItemEle.classList.add('e-disabled');
4244
+ }
4245
+ if (items.cssClass) {
4246
+ galleryItemEle.classList.add(items.cssClass);
4247
+ }
4248
+ append(templateFunction({ items: items }, this, templateName, (id + 'galleryPopupTemplate'), this.parent.isStringTemplate), galleryItemEle);
4249
+ this.parent['renderReactTemplates']();
4250
+ }
4251
+ }
4252
+
4253
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4254
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4255
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4256
+ 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;
4257
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4258
+ };
4259
+ var Ribbon_1;
4260
+ /**
4261
+ * The Ribbon Component is a structured layout to manage tools with tabs and groups.
4262
+ */
4263
+ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4264
+ /**
4265
+ * Constructor for creating the widget.
4266
+ *
4267
+ * @param {RibbonModel} options - Specifies the ribbon model
4268
+ * @param {string|HTMLDivElement} element - Specifies the target element
4269
+ */
4270
+ constructor(options, element) {
4271
+ Ribbon_1.Inject(RibbonButton, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonComboBox, RibbonGroupButton);
4272
+ super(options, element);
4273
+ }
4274
+ /**
4275
+ * Initialize the control rendering.
4276
+ *
4277
+ * @returns {void}
4278
+ * @private
4279
+ */
4280
+ render() {
4281
+ this.initialize();
4282
+ }
4283
+ preRender() {
4284
+ this.keysPress = '';
4285
+ this.idIndex = 0;
4286
+ this.tooltipData = [];
4287
+ this.initialPropsData = {};
4288
+ this.hiddenElements = {};
4289
+ this.keyTipElements = {};
4290
+ this.hiddenGroups = [];
4291
+ this.isAddRemove = false;
4292
+ this.keyConfigs = {
4293
+ leftarrow: 'leftarrow',
4294
+ rightarrow: 'rightarrow',
4295
+ tab: 'tab',
4296
+ shiftTab: 'shift+tab'
4297
+ };
4298
+ }
4299
+ /**
4300
+ * Get the properties to be maintained in the persisted state.
4301
+ *
4302
+ * @returns {string} - Persist data
4303
+ */
4304
+ getPersistData() {
4305
+ return this.addOnPersist(['activeLayout']);
4306
+ }
4307
+ /**
4308
+ * Get component name.
4309
+ *
4310
+ * @returns {string} - Module name
4311
+ * @private
4312
+ */
4313
+ getModuleName() {
4314
+ return 'ribbon';
4315
+ }
4316
+ /**
4317
+ * To provide the array of modules needed for component rendering
4318
+ *
4319
+ * @returns {ModuleDeclaration[]} - returns module declaration.
4320
+ * @hidden
4321
+ */
4322
+ requiredModules() {
4323
+ const modules = [];
4324
+ 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' });
4325
+ const canInjectColorPickerModule = getItem(this.tabs, null, RibbonItemType.ColorPicker);
4326
+ const canInjectGalleryModule = getItem(this.tabs, null, RibbonItemType.Gallery);
4327
+ if (canInjectColorPickerModule) {
4328
+ modules.push({ member: 'ribbonColorPicker', args: [this], name: 'RibbonColorPicker' });
4329
+ }
4330
+ if (canInjectGalleryModule) {
4331
+ modules.push({ member: 'ribbonGallery', args: [this], name: 'RibbonGallery' });
4332
+ }
4333
+ if (this.backStageMenu.visible || this.backStageMenu.items.length) {
4334
+ modules.push({ member: 'ribbonBackstage', args: [this], name: 'RibbonBackstage' });
4335
+ }
4336
+ if (this.fileMenu.visible || this.fileMenu.menuItems.length) {
4337
+ modules.push({ member: 'ribbonFileMenu', args: [this], name: 'RibbonFileMenu' });
4338
+ }
4339
+ if (this.contextualTabs.length) {
4340
+ modules.push({ member: 'ribbonContextualTab', args: [this], name: 'RibbonContextualTab' });
4341
+ }
4342
+ if (this.enableKeyTips) {
4343
+ modules.push({ member: 'ribbonKeyTip', args: [this], name: 'RibbonKeyTip' });
4344
+ }
4345
+ return modules;
4346
+ }
4347
+ initialize() {
3452
4348
  this.element.id = this.element.id || getUniqueID('e-' + this.getModuleName());
3453
4349
  addClass([this.element], ['e-rbn', ...(this.cssClass ? this.cssClass.split(SPACE) : [])]);
3454
4350
  if (this.enableRtl) {
@@ -3456,6 +4352,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3456
4352
  }
3457
4353
  this.element.style.width = formatUnit(this.width);
3458
4354
  this.renderTabs();
4355
+ if (this.ribbonContextualTabModule) {
4356
+ this.ribbonContextualTabModule.addContextualTabs();
4357
+ }
3459
4358
  if (this.ribbonFileMenuModule) {
3460
4359
  this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
3461
4360
  }
@@ -3465,13 +4364,18 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3465
4364
  this.createHelpPaneTemplate();
3466
4365
  const toolbar = this.tabObj['tbObj'];
3467
4366
  toolbar.refreshOverflow();
4367
+ this.addTabOverflowKeyTip();
3468
4368
  createTooltip(this.element, this);
4369
+ this.isKeytipOpen = false;
3469
4370
  this.wireEvents();
3470
4371
  this.wireKeyboardEvent();
3471
4372
  this.currentControlIndex = 0;
3472
4373
  }
3473
4374
  wireEvents() {
3474
4375
  EventHandler.add(window, 'resize', this.resizeHandler, this);
4376
+ EventHandler.add(document.body, 'keydown', this.keytipActionHandler, this);
4377
+ EventHandler.add(document, 'mousedown', this.mouseEventHandler, this);
4378
+ EventHandler.add(document, 'scroll', this.mouseEventHandler, this);
3475
4379
  }
3476
4380
  wireKeyboardEvent() {
3477
4381
  this.keyboardModuleRibbon = new KeyboardEvents(this.element, {
@@ -3487,7 +4391,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3487
4391
  const activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
3488
4392
  const controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
3489
4393
  const templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
3490
- const ribbonControls = controlElements.concat(templateElements);
4394
+ const galleryElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-gallery-item'));
4395
+ const ribbonControls = controlElements.concat(templateElements, galleryElements);
3491
4396
  const comboBoxElements = activeContent.querySelectorAll('.e-combobox');
3492
4397
  let comboBoxEle;
3493
4398
  if (comboBoxElements) {
@@ -3516,7 +4421,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3516
4421
  if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
3517
4422
  e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
3518
4423
  e.target.classList.contains('e-ribbon-first-item') || e.target.classList.contains('e-ribbon-group-of-btn') ||
3519
- e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template')) {
4424
+ e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-gallery-item')) {
3520
4425
  switch (e.action) {
3521
4426
  case 'rightarrow':
3522
4427
  this.handleNavigation(e, !this.enableRtl, ribbonControls);
@@ -3558,7 +4463,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3558
4463
  }
3559
4464
  }
3560
4465
  if ((!enableRtl && (this.currentControlIndex > 0)) || (enableRtl && (this.currentControlIndex < ribbonControls.length - 1))) {
3561
- 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')) {
4466
+ 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')) {
3562
4467
  if (enableRtl) {
3563
4468
  this.currentControlIndex++;
3564
4469
  }
@@ -3717,6 +4622,111 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3717
4622
  }
3718
4623
  }
3719
4624
  }
4625
+ let galleryPopupEle = document.querySelector('.e-ribbon-gallery-popup.e-popup-open');
4626
+ if (galleryPopupEle) {
4627
+ let popup = getComponent(galleryPopupEle, Popup);
4628
+ popup.hide();
4629
+ }
4630
+ if (this.ribbonKeyTipModule && this.enableKeyTips) {
4631
+ this.ribbonKeyTipModule.removeKeytip();
4632
+ }
4633
+ }
4634
+ mouseEventHandler(e) {
4635
+ if (this.ribbonKeyTipModule && this.enableKeyTips) {
4636
+ this.ribbonKeyTipModule.removeKeytip();
4637
+ }
4638
+ }
4639
+ keytipActionHandler(e) {
4640
+ if (this.enableKeyTips) {
4641
+ let isKeyTipPresent = false;
4642
+ const keyPress = e.key;
4643
+ if (e.altKey && e.key === 'Meta') {
4644
+ const activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
4645
+ if (activePopup.length) {
4646
+ for (let i = 0; i < activePopup.length; i++) {
4647
+ const dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
4648
+ dropDownBtn.toggle();
4649
+ }
4650
+ this.ribbonKeyTipModule.removeKeytip();
4651
+ }
4652
+ else {
4653
+ if (!this.isKeytipOpen) {
4654
+ const backstagePopup = document.querySelector('.e-ribbon-backstage-popup');
4655
+ if (backstagePopup && backstagePopup.classList.contains('e-popup-open')) {
4656
+ this.ribbonBackstageModule.hideBackstage();
4657
+ }
4658
+ this.ribbonKeyTipModule.createKeytip('tab');
4659
+ }
4660
+ else {
4661
+ this.ribbonKeyTipModule.removeKeytip();
4662
+ }
4663
+ }
4664
+ }
4665
+ else if (e.key === 'Escape' || e.key === 'Tab' || e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'ArrowRight' || e.key === 'ArrowDown') {
4666
+ this.ribbonKeyTipModule.removeKeytip(e.key);
4667
+ }
4668
+ else {
4669
+ const keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
4670
+ if (keyTipItems) {
4671
+ for (let i = 0; i < keyTipItems.length; i++) {
4672
+ const keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
4673
+ if (keyTipItem.innerHTML.toLowerCase() === keyPress) {
4674
+ isKeyTipPresent = true;
4675
+ this.ribbonKeyTipModule.keytipPress(keyPress);
4676
+ break;
4677
+ }
4678
+ }
4679
+ if (!isKeyTipPresent) {
4680
+ this.checkKeyTipPresent(keyPress, this.keysPress.length);
4681
+ }
4682
+ }
4683
+ }
4684
+ }
4685
+ }
4686
+ checkKeyTipPresent(keyTip, length) {
4687
+ const keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
4688
+ for (let i = 0; i < keyTipItems.length; i++) {
4689
+ const keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
4690
+ if (keyTipItem.innerHTML.length > 1 && keyTipItem.innerHTML[parseInt(length.toString(), 10)].toLowerCase() === keyTip) {
4691
+ this.keysPress += keyTip;
4692
+ this.ribbonKeyTipModule.keytipPress(this.keysPress);
4693
+ this.removeKeytip(this.keysPress);
4694
+ break;
4695
+ }
4696
+ }
4697
+ }
4698
+ removeKeytip(keyTip) {
4699
+ const keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
4700
+ for (let i = 0; i < keyTipItems.length; i++) {
4701
+ const keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
4702
+ if (keyTipItem.innerHTML[0].toLowerCase() !== keyTip && keyTip !== '') {
4703
+ remove(keyTipItem);
4704
+ }
4705
+ }
4706
+ }
4707
+ addKeyTip(tabIndex, keyTip, id, type) {
4708
+ if (this.keyTipElements && this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
4709
+ let isKeyTipExist = false;
4710
+ /* eslint-disable */
4711
+ if (!(this.keyTipElements[parseInt(tabIndex.toString(), 10)][type])) {
4712
+ this.keyTipElements[parseInt(tabIndex.toString(), 10)][type] = [];
4713
+ }
4714
+ if (Object.keys(this.keyTipElements[tabIndex][type]).length) {
4715
+ let keytipData = this.keyTipElements[tabIndex][type];
4716
+ for (let i = 0; i < Object.keys(this.keyTipElements[tabIndex][type]).length; i++) {
4717
+ if (keytipData[parseInt(i.toString(), 10)].id === id) {
4718
+ isKeyTipExist = true;
4719
+ }
4720
+ }
4721
+ if (!isKeyTipExist) {
4722
+ this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
4723
+ }
4724
+ }
4725
+ else {
4726
+ this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
4727
+ }
4728
+ /* eslint-enable */
4729
+ }
3720
4730
  }
3721
4731
  renderTabs() {
3722
4732
  this.tabsInternal = this.tabs.slice();
@@ -3778,14 +4788,20 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3778
4788
  this.renderInitialTab(this.selectedTab);
3779
4789
  }
3780
4790
  ribbonTabSelected(e) {
4791
+ e.preventFocus = true;
3781
4792
  this.isAddRemove = false;
3782
4793
  const selectedTabId = e.selectedItem.getAttribute('data-id');
3783
4794
  let selectedIndex = getIndex(this.tabs, ((tab) => (tab.id === selectedTabId)));
3784
4795
  selectedIndex = selectedIndex === -1 ? this.selectedTab : selectedIndex;
3785
- const eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex };
4796
+ let isContextual = this.isContextualTab(selectedTabId);
4797
+ this.updateSelectedState(selectedTabId);
4798
+ const eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex, isContextual: isContextual };
3786
4799
  this.setProperties({ selectedTab: selectedIndex }, true);
3787
4800
  this.calculateHiddenElementsWidth(selectedIndex);
3788
4801
  this.checkOverflow(selectedIndex, e.selectedContent.firstChild);
4802
+ if (this.activeLayout === 'Classic' && this.ribbonGalleryModule) {
4803
+ this.ribbonGalleryModule.checkAvailableHeight(selectedIndex, e.selectedContent.firstChild);
4804
+ }
3789
4805
  if (this.activeLayout === 'Simplified' && this.overflowDDB) {
3790
4806
  const overflowTarget = this.overflowDDB.target;
3791
4807
  const ofTabContainer = overflowTarget.querySelector('.' + RIBBON_TAB_ACTIVE);
@@ -3804,6 +4820,20 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3804
4820
  }
3805
4821
  this.trigger('tabSelected', eventArgs);
3806
4822
  }
4823
+ updateSelectedState(tabID) {
4824
+ if (this.contextualTabs.length) {
4825
+ for (let i = 0; i < this.contextualTabs.length; i++) {
4826
+ let isSelected = false;
4827
+ for (let j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
4828
+ if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
4829
+ isSelected = true;
4830
+ break;
4831
+ }
4832
+ }
4833
+ this.contextualTabs[parseInt(i.toString(), 10)].setProperties({ isSelected: isSelected }, true);
4834
+ }
4835
+ }
4836
+ }
3807
4837
  checkOverflow(tabIndex, activeContent) {
3808
4838
  const tabContent = activeContent.closest('.' + TAB_CONTENT);
3809
4839
  const isOverFlow = tabContent.offsetWidth < activeContent.offsetWidth;
@@ -3853,6 +4883,17 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3853
4883
  }
3854
4884
  }
3855
4885
  }
4886
+ this.addTabOverflowKeyTip();
4887
+ }
4888
+ addTabOverflowKeyTip() {
4889
+ const tabOverflow = this.tabObj.element.querySelector('#_nav');
4890
+ if (tabOverflow) {
4891
+ this.keyTipElements['taboverflow'] = [];
4892
+ this.keyTipElements['taboverflow'].push({ id: tabOverflow.id, type: 'taboverflow', keyTip: '00' });
4893
+ }
4894
+ else {
4895
+ delete (this.keyTipElements['taboverflow']);
4896
+ }
3856
4897
  }
3857
4898
  checkSimplifiedItemShrinking(tabIndex, tabContent, activeContent) {
3858
4899
  const tab = this.tabs[parseInt(tabIndex.toString(), 10)];
@@ -3987,7 +5028,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3987
5028
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
3988
5029
  this.setItemSize(itemEle, item);
3989
5030
  }
3990
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
5031
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
3991
5032
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, true);
3992
5033
  }
3993
5034
  }
@@ -4017,7 +5058,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4017
5058
  return isEmptyCollection;
4018
5059
  }
4019
5060
  updatePopupItems(item, itemEle, isGroupOF, isMenu) {
4020
- const dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
5061
+ const dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.Gallery || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
4021
5062
  const dropDownPopup = dropdown.dropDown;
4022
5063
  // popup is on right if (isGroupOF && isMenu)
4023
5064
  // The position is reversed if RTL is enabled.
@@ -4082,7 +5123,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4082
5123
  break;
4083
5124
  }
4084
5125
  const groupEle = tabContent.querySelector('#' + collection.id);
4085
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
5126
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
4086
5127
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
4087
5128
  }
4088
5129
  groupEle.append(itemContainer);
@@ -4201,19 +5242,22 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4201
5242
  }
4202
5243
  createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
4203
5244
  let overflowButton;
5245
+ let overflowtarget;
4204
5246
  const itemProp = getGroup(this.tabs, groupId);
4205
5247
  const contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
4206
5248
  const groupEle = contentEle.querySelector('#' + groupId);
4207
5249
  if (isGroupOF) {
4208
5250
  const overflowDDB = groupContainer.querySelector('#' + groupId + GROUPOF_BUTTON_ID);
4209
5251
  if (!overflowDDB) {
4210
- overflowButton = this.addOverflowButton(groupId + GROUPOF_BUTTON_ID);
5252
+ overflowButton = this.addOverflowButton(groupId + GROUPOF_BUTTON_ID, isGroupOF);
4211
5253
  overflowButton.element.classList.add(RIBBON_GROUP_OF_BUTTON);
4212
5254
  groupContainer.appendChild(overflowButton.element);
4213
5255
  }
4214
5256
  else {
4215
5257
  overflowButton = getInstance(overflowDDB, DropDownButton);
4216
5258
  }
5259
+ this.addKeyTip(tabIndex, '0' + (itemProp.groupIndex + 1), overflowButton.element.id, 'grpofbtn');
5260
+ overflowtarget = overflowButton.target;
4217
5261
  const overflowBtnTarget = overflowButton.target;
4218
5262
  let headerEle = overflowBtnTarget.querySelector('#' + groupId + GROUPOF_BUTTON_ID + HEADER_ID);
4219
5263
  if (!headerEle) {
@@ -4242,7 +5286,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4242
5286
  }
4243
5287
  else {
4244
5288
  if (!this.overflowDDB) {
4245
- this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + OVRLOF_BUTTON_ID);
5289
+ this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + OVRLOF_BUTTON_ID, isGroupOF);
4246
5290
  this.tabObj.element.insertBefore(this.overflowDDB.element, this.collapseButton);
4247
5291
  this.overflowDDB.element.classList.add(RIBBON_OVERALL_OF_BUTTON);
4248
5292
  this.createOfTabContainer(groupId, groupHeader, itemEle, tabIndex);
@@ -4275,10 +5319,16 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4275
5319
  }
4276
5320
  }
4277
5321
  overflowButton = this.overflowDDB;
5322
+ overflowtarget = this.overflowDDB ? this.overflowDDB.target : null;
4278
5323
  }
4279
5324
  if (itemEle !== null) {
4280
5325
  this.addOverflowEvents(item, itemEle, overflowButton);
4281
5326
  }
5327
+ if (overflowtarget) {
5328
+ if (item.keyTip) {
5329
+ this.addKeyTip(tabIndex, item.keyTip, item.id, 'popupitem');
5330
+ }
5331
+ }
4282
5332
  }
4283
5333
  addOverflowEvents(item, itemEle, overflowButton) {
4284
5334
  switch (item.type) {
@@ -4300,6 +5350,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4300
5350
  case 'ComboBox':
4301
5351
  this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
4302
5352
  break;
5353
+ case 'Gallery':
5354
+ if (this.activeLayout === 'Simplified') {
5355
+ this.ribbonGalleryModule.addOverFlowEvents(item, itemEle, overflowButton);
5356
+ }
5357
+ break;
4303
5358
  case 'GroupButton':
4304
5359
  if (this.activeLayout === 'Simplified') {
4305
5360
  this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
@@ -4970,6 +6025,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4970
6025
  this.checkSmallToMedium(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
4971
6026
  this.checkMediumToLarge(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
4972
6027
  const dropdown = this.ribbonDropDownModule.createOverFlowDropDown(group.id, group.header, group.groupIconCss, groupContainer, groupOverFlow, this.enableRtl);
6028
+ if (group.keyTip) {
6029
+ const overflowDDB = group.id + OVERFLOW_ID + DROPDOWN_ID;
6030
+ this.addKeyTip(tabIndex, group.keyTip, overflowDDB, 'grpoverflow');
6031
+ }
4973
6032
  this.tabs[parseInt(tabIndex.toString(), 10)].
4974
6033
  groups[parseInt(groupIndex.toString(), 10)].setProperties({ isCollapsed: true }, true);
4975
6034
  for (let j = 0; j < group.collections.length; j++) {
@@ -4982,6 +6041,25 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4982
6041
  this.handleContentSize(itemEle);
4983
6042
  this.addOverflowEvents(item, itemEle, dropdown);
4984
6043
  }
6044
+ const overflowDDB = document.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID);
6045
+ const overflowButton = getInstance(overflowDDB, DropDownButton);
6046
+ if (overflowButton) {
6047
+ const overflowtarget = overflowButton.target;
6048
+ if (overflowtarget) {
6049
+ if (this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
6050
+ if (item.type === RibbonItemType.GroupButton) {
6051
+ for (let i = 0; i < item.groupButtonSettings.items.length; i++) {
6052
+ if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip) {
6053
+ this.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip, item.id + (RIBBON_GROUP_BUTTON_ID + i), 'grpoverflowpopup');
6054
+ }
6055
+ }
6056
+ }
6057
+ if (item.keyTip) {
6058
+ this.addKeyTip(tabIndex, item.keyTip, item.id, 'grpoverflowpopup');
6059
+ }
6060
+ }
6061
+ }
6062
+ }
4985
6063
  }
4986
6064
  }
4987
6065
  }
@@ -5066,15 +6144,30 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5066
6144
  this.removeOverflowDropdown(activeContent, tabContent, true, index);
5067
6145
  }
5068
6146
  }
6147
+ isContextualTab(tabID) {
6148
+ let isContextual = false;
6149
+ if (this.contextualTabs.length) {
6150
+ for (let i = 0; i < this.contextualTabs.length; i++) {
6151
+ for (let j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
6152
+ if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
6153
+ isContextual = true;
6154
+ break;
6155
+ }
6156
+ }
6157
+ }
6158
+ }
6159
+ return isContextual;
6160
+ }
5069
6161
  ribbonTabSelecting(e) {
5070
6162
  this.currentControlIndex = 0;
5071
6163
  const nextTabId = e.selectingItem.getAttribute('data-id');
5072
6164
  const previousTabId = e.previousItem.getAttribute('data-id');
5073
6165
  let nextIndex = getIndex(this.tabs, ((tab) => (tab.id === nextTabId)));
6166
+ let isContextual = this.isContextualTab(nextTabId);
5074
6167
  const previousIndex = getIndex(this.tabs, ((tab) => (tab.id === previousTabId)));
5075
6168
  nextIndex = nextIndex === -1 ? this.selectedTab : nextIndex;
5076
6169
  const eventArgs = {
5077
- cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex
6170
+ cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex, isContextual: isContextual
5078
6171
  };
5079
6172
  this.trigger('tabSelecting', eventArgs, (args) => {
5080
6173
  if (args.cancel) {
@@ -5099,6 +6192,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5099
6192
  innerHTML: ribbonTab.header,
5100
6193
  id: ribbonTab.id + HEADER_ID
5101
6194
  });
6195
+ const tabIndex = getIndex(this.tabs, ((tab) => (tab.id === ribbonTab.id)));
6196
+ if (ribbonTab.keyTip) {
6197
+ if (!this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
6198
+ this.keyTipElements[parseInt(tabIndex.toString(), 10)] = {};
6199
+ }
6200
+ this.addKeyTip(tabIndex, ribbonTab.keyTip, ribbonTab.id, 'tab');
6201
+ }
5102
6202
  header.onclick = () => { this.minimize(false); };
5103
6203
  header.ondblclick = () => { this.minimize(true); };
5104
6204
  const tab = { header: { text: header }, id: ribbonTab.id, cssClass: ribbonTab.cssClass };
@@ -5121,8 +6221,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5121
6221
  }
5122
6222
  const activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
5123
6223
  this.checkOverflow(this.selectedTab, activeContent);
6224
+ if (this.activeLayout === 'Classic' && this.ribbonGalleryModule)
6225
+ this.ribbonGalleryModule.checkAvailableHeight(this.selectedTab, activeContent);
5124
6226
  }
5125
- addOverflowButton(btnId) {
6227
+ addOverflowButton(btnId, isGroupOF) {
5126
6228
  const overflowButton = this.createElement('button', {
5127
6229
  id: btnId
5128
6230
  });
@@ -5158,6 +6260,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5158
6260
  }, overflowButton);
5159
6261
  this.element.classList.add(RIBBON_OVERFLOW);
5160
6262
  createTooltip(overflowTarget, this);
6263
+ if (!isGroupOF) {
6264
+ this.keyTipElements['overflowbtn'] = [];
6265
+ this.keyTipElements['overflowbtn'].push({ id: btnId, type: 'overflowbtn', keyTip: '00' });
6266
+ }
5161
6267
  let isGroupOf;
5162
6268
  overflowButton.onkeydown = overflowButton.onclick = () => { this.itemIndex = -1; isGroupOf = overflowButton.classList.contains('e-ribbon-overall-of-btn') ? false : true; };
5163
6269
  overflowTarget.onkeydown = (e) => (this.upDownKeyHandler(e, overflowTarget, isGroupOf), this);
@@ -5318,6 +6424,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5318
6424
  case 'ComboBox':
5319
6425
  this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
5320
6426
  break;
6427
+ case 'Gallery':
6428
+ this.ribbonGalleryModule.removeOverFlowEvents(item, itemEle);
6429
+ break;
5321
6430
  case 'GroupButton':
5322
6431
  this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
5323
6432
  break;
@@ -5354,6 +6463,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5354
6463
  this.collapseButton.classList.add(RIBBON_EXPAND_BUTTON);
5355
6464
  }
5356
6465
  this.tabObj.element.appendChild(this.collapseButton);
6466
+ if (this.layoutSwitcherKeyTip) {
6467
+ this.keyTipElements['collapse'] = [];
6468
+ this.keyTipElements['collapse'].push({ id: this.collapseButton.id, type: 'collapse', keyTip: this.layoutSwitcherKeyTip });
6469
+ }
5357
6470
  }
5358
6471
  removeExpandCollapse() {
5359
6472
  const index = getIndex(this.tooltipData, (e) => { return e.id === this.collapseButton.id; });
@@ -5513,7 +6626,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5513
6626
  itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
5514
6627
  if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
5515
6628
  this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemEle, groupContainer);
5516
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
6629
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
5517
6630
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
5518
6631
  }
5519
6632
  }
@@ -5526,6 +6639,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5526
6639
  this.setItemSize(ele, item);
5527
6640
  }
5528
6641
  }
6642
+ if (item.type === RibbonItemType.Gallery) {
6643
+ this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
6644
+ }
5529
6645
  }
5530
6646
  }
5531
6647
  if (!(group.enableGroupOverflow || groupEle.querySelector('.' + RIBBON_ITEM))) {
@@ -5609,7 +6725,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5609
6725
  let itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
5610
6726
  if (!itemEle && overflowtarget) {
5611
6727
  itemEle = overflowtarget.querySelector('#' + item.id + CONTAINER_ID);
5612
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
6728
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
5613
6729
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
5614
6730
  }
5615
6731
  this.removeOverflowEvent(item, itemEle);
@@ -5629,6 +6745,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5629
6745
  (item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
5630
6746
  item.setProperties({ activeSize: itemsize }, true);
5631
6747
  this.setItemSize(ele, item);
6748
+ if (item.type === RibbonItemType.Gallery) {
6749
+ this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
6750
+ }
5632
6751
  }
5633
6752
  if (group.enableGroupOverflow && overflowDDB) {
5634
6753
  if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
@@ -5648,7 +6767,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5648
6767
  this.overflowDDB = null;
5649
6768
  }
5650
6769
  }
5651
- createLauncherIcon(groupId, groupContainer) {
6770
+ createLauncherIcon(groupId, groupContainer, tabIndex) {
5652
6771
  const launcherIcon = this.createElement('div', {
5653
6772
  className: RIBBON_LAUNCHER_ICON_ELE + ' ' + (this.launcherIconCss ? this.launcherIconCss : RIBBON_LAUNCHER_ICON),
5654
6773
  id: groupId + LAUNCHER_ID,
@@ -5662,6 +6781,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5662
6781
  this.launcherIconClicked(groupId);
5663
6782
  }
5664
6783
  }, this);
6784
+ const itemProp = getGroup(this.tabs, groupId);
6785
+ if (itemProp.group.launcherIconKeyTip) {
6786
+ this.addKeyTip(tabIndex, itemProp.group.launcherIconKeyTip, launcherIcon.id, 'launcher');
6787
+ }
5665
6788
  }
5666
6789
  launcherIconClicked(id) {
5667
6790
  const eventArgs = { groupId: id };
@@ -5699,7 +6822,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5699
6822
  groupContainer.appendChild(groupHeader);
5700
6823
  }
5701
6824
  if (group.showLauncherIcon) {
5702
- this.createLauncherIcon(group.id, groupContainer);
6825
+ this.createLauncherIcon(group.id, groupContainer, tabIndex);
5703
6826
  }
5704
6827
  const elements = this.createCollection(group.collections, group.orientation, group.id, group.header, group.enableGroupOverflow, tabIndex, groupContainer);
5705
6828
  append(elements, groupContent);
@@ -5826,6 +6949,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5826
6949
  case 'GroupButton':
5827
6950
  this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
5828
6951
  break;
6952
+ case 'Gallery':
6953
+ this.ribbonGalleryModule.createGallery(item, itemEle);
6954
+ break;
5829
6955
  }
5830
6956
  }
5831
6957
  createItems(itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
@@ -5858,17 +6984,34 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5858
6984
  itemEle.classList.add(RIBBON_TOOLTIP_TARGET);
5859
6985
  this.tooltipData.push({ id: itemEle.id, data: item.ribbonTooltipSettings });
5860
6986
  }
5861
- let size = item.activeSize;
5862
- if (this.activeLayout === 'Simplified') {
5863
- size = ((item.allowedSizes === RibbonItemSize.Large) || (item.allowedSizes & RibbonItemSize.Medium) ||
5864
- (item.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
5865
- item.setProperties({ activeSize: size }, true);
6987
+ if (item.type === RibbonItemType.GroupButton) {
6988
+ for (let i = 0; i < item.groupButtonSettings.items.length; i++) {
6989
+ if (this.keyTipElements[parseInt(tabIndex.toString(), 10)] && item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip) {
6990
+ this.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip, item.id + (RIBBON_GROUP_BUTTON_ID + i), 'item');
6991
+ }
6992
+ }
5866
6993
  }
5867
- if (size & RibbonItemSize.Large) {
5868
- itemEle.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
6994
+ if (item.keyTip) {
6995
+ if (item.type === RibbonItemType.Gallery) {
6996
+ this.addKeyTip(tabIndex, item.keyTip, (item.id + '_popupButton'), 'item');
6997
+ }
6998
+ else {
6999
+ this.addKeyTip(tabIndex, item.keyTip, item.id, 'item');
7000
+ }
5869
7001
  }
5870
- else {
5871
- itemEle.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
7002
+ let size = item.activeSize;
7003
+ if (!(item.type === RibbonItemType.Gallery)) {
7004
+ if (this.activeLayout === 'Simplified') {
7005
+ size = ((item.allowedSizes === RibbonItemSize.Large) || (item.allowedSizes & RibbonItemSize.Medium) ||
7006
+ (item.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
7007
+ item.setProperties({ activeSize: size }, true);
7008
+ }
7009
+ if (size & RibbonItemSize.Large) {
7010
+ itemEle.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
7011
+ }
7012
+ else {
7013
+ itemEle.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
7014
+ }
5872
7015
  }
5873
7016
  const initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
5874
7017
  if (initialProps && initialProps.hiddenItems && initialProps.hiddenItems.length) {
@@ -5880,7 +7023,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
5880
7023
  this.createRibbonItem(item, itemEle);
5881
7024
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
5882
7025
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
5883
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
7026
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
5884
7027
  this.updatePopupItems(item, itemEle, isGroupOF, true);
5885
7028
  }
5886
7029
  }
@@ -6071,12 +7214,18 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6071
7214
  ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
6072
7215
  contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
6073
7216
  }
7217
+ if (item.type === RibbonItemType.Gallery) {
7218
+ ele = contentEle.querySelector('#' + item.id + CONTAINER_ID);
7219
+ }
6074
7220
  }
6075
7221
  }
6076
7222
  else {
6077
7223
  //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
6078
7224
  ele = (item.displayOptions & DisplayMode.Simplified) ?
6079
7225
  contentEle.querySelector('#' + item.id) : null;
7226
+ if (item.type === RibbonItemType.Gallery) {
7227
+ ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id + CONTAINER_ID) : null;
7228
+ }
6080
7229
  // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
6081
7230
  if (!ele) {
6082
7231
  ele = dropdown ? dropdown.target.querySelector('#' + item.id) : null;
@@ -6127,6 +7276,30 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6127
7276
  }
6128
7277
  }
6129
7278
  }
7279
+ else if (moduleName === 'gallery') {
7280
+ if (ele.closest('.e-ribbon-overflow-target')) {
7281
+ destroyControl(ele, 'dropdown-btn');
7282
+ let galleryPopupEle = Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '_galleryPopup'));
7283
+ galleryPopupEle.concat(Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '-popup')));
7284
+ for (let i = 0; i < galleryPopupEle.length; i++) {
7285
+ galleryPopupEle[parseInt(i.toString(), 10)].remove();
7286
+ }
7287
+ }
7288
+ else {
7289
+ let galleryEle = ele.querySelectorAll('.e-ribbon-gallery-item');
7290
+ let galleryPopupBtn = ele.querySelector('#' + item.id + '_popupButton');
7291
+ if (galleryPopupBtn) {
7292
+ galleryPopupBtn.remove();
7293
+ }
7294
+ for (let i = 0; i < galleryEle.length; i++) {
7295
+ galleryEle[parseInt(i.toString(), 10)].remove();
7296
+ }
7297
+ let galleryPopupEle = document.querySelectorAll('#' + item.id + '_galleryPopup');
7298
+ for (let i = 0; i < galleryPopupEle.length; i++) {
7299
+ galleryPopupEle[parseInt(i.toString(), 10)].remove();
7300
+ }
7301
+ }
7302
+ }
6130
7303
  else if (moduleName !== 'template') {
6131
7304
  destroyControl(ele, moduleName);
6132
7305
  }
@@ -6140,6 +7313,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6140
7313
  this.ribbonGroupButtonModule.destroyDropDown(item);
6141
7314
  }
6142
7315
  }
7316
+ /**
7317
+ * Gets the item module name.
7318
+ *
7319
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
7320
+ * @returns {void}
7321
+ * @hidden
7322
+ */
6143
7323
  getItemModuleName(item) {
6144
7324
  switch (item.type) {
6145
7325
  case 'Button':
@@ -6156,6 +7336,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6156
7336
  return 'combobox';
6157
7337
  case 'GroupButton':
6158
7338
  return 'group-btn';
7339
+ case 'Gallery':
7340
+ return 'gallery';
6159
7341
  default:
6160
7342
  return 'template';
6161
7343
  }
@@ -6195,8 +7377,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6195
7377
  * @param {string} tabId - The ID of the tab to be shown.
6196
7378
  * @returns {void}
6197
7379
  */
6198
- showTab(tabId) {
6199
- this.showHideTab(tabId, false);
7380
+ showTab(tabId, isContextual = false) {
7381
+ this.showHideTab(tabId, false, isContextual);
6200
7382
  }
6201
7383
  /**
6202
7384
  * Hides a specific tab in the ribbon.
@@ -6204,15 +7386,44 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
6204
7386
  * @param {string} tabId - The ID of the tab to be hidden.
6205
7387
  * @returns {void}
6206
7388
  */
6207
- hideTab(tabId) {
6208
- this.showHideTab(tabId, true);
7389
+ hideTab(tabId, isContextual = false) {
7390
+ this.showHideTab(tabId, true, isContextual);
6209
7391
  }
6210
- showHideTab(tabId, value) {
7392
+ showHideTab(tabId, value, isContextual) {
6211
7393
  const index = getIndex(this.tabs, (e) => { return e.id === tabId; });
6212
7394
  if (index === -1) {
6213
7395
  return;
6214
7396
  }
6215
7397
  this.tabObj.hideTab(index, value);
7398
+ if (isContextual) {
7399
+ let contextualTab;
7400
+ const tabEle = this.tabObj.element;
7401
+ for (let i = 0; i < this.contextualTabs.length; i++) {
7402
+ for (let j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
7403
+ if (tabId === this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id) {
7404
+ contextualTab = this.contextualTabs[parseInt(i.toString(), 10)];
7405
+ }
7406
+ }
7407
+ }
7408
+ if (contextualTab) {
7409
+ let isTabHidden = true;
7410
+ for (let i = 0; i < contextualTab.tabs.length; i++) {
7411
+ const index = getIndex(this.tabs, (e) => { return e.id === contextualTab.tabs[parseInt(i.toString(), 10)].id; });
7412
+ if (index !== -1) {
7413
+ const toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index.toString(), 10)];
7414
+ if (!(toolbarEle.classList.contains('e-hidden'))) {
7415
+ isTabHidden = false;
7416
+ }
7417
+ }
7418
+ }
7419
+ if (isTabHidden) {
7420
+ contextualTab.setProperties({ visible: false }, true);
7421
+ }
7422
+ else {
7423
+ contextualTab.setProperties({ visible: true }, true);
7424
+ }
7425
+ }
7426
+ }
6216
7427
  }
6217
7428
  /**
6218
7429
  * Enables a specific tab in the ribbon.
@@ -7215,7 +8426,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
7215
8426
  if (contentEle.innerHTML !== '') {
7216
8427
  // Check whether showLauncherIcon or orientation is passed by the user and sets the updated values.
7217
8428
  if (group.showLauncherIcon) {
7218
- this.createLauncherIcon(ribbongroup.id, groupContainer);
8429
+ this.createLauncherIcon(ribbongroup.id, groupContainer, itemProp.tabIndex);
7219
8430
  }
7220
8431
  // Check whether collections or orientation is passed by the user and sets the updated values.
7221
8432
  if (group.collections || group.orientation) {
@@ -7363,7 +8574,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
7363
8574
  }
7364
8575
  if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
7365
8576
  this.createOverflowPopup(itemProp.item, itemProp.tabIndex, itemProp.group.enableGroupOverflow, itemProp.group.id, itemProp.group.header, itemContainer, groupContainer);
7366
- if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
8577
+ if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
7367
8578
  this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
7368
8579
  }
7369
8580
  }
@@ -7470,6 +8681,15 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
7470
8681
  disableItem(itemId) {
7471
8682
  this.enableDisableItem(itemId, true);
7472
8683
  }
8684
+ /**
8685
+ * Gets the Ribbon item model associated with the specified item ID.
8686
+ *
8687
+ * @param {string} itemId - The unique ID of the Ribbon item.
8688
+ * @returns {RibbonItemModel}
8689
+ */
8690
+ getItem(itemId) {
8691
+ return getItem(this.tabs, itemId).item;
8692
+ }
7473
8693
  enableDisableItem(itemId, isDisabled) {
7474
8694
  let isUpdated = false;
7475
8695
  const itemProp = getItem(this.tabs, itemId);
@@ -7517,6 +8737,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
7517
8737
  }
7518
8738
  unwireEvents() {
7519
8739
  EventHandler.remove(window, 'resize', this.resizeHandler);
8740
+ EventHandler.remove(document.body, 'keydown', this.keytipActionHandler);
8741
+ EventHandler.remove(document, 'mousedown', this.mouseEventHandler);
8742
+ EventHandler.remove(document, 'scroll', this.mouseEventHandler);
7520
8743
  }
7521
8744
  destroy() {
7522
8745
  this.keyboardModuleRibbon.destroy();
@@ -7544,6 +8767,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
7544
8767
  this.initialPropsData = {};
7545
8768
  this.hiddenGroups = [];
7546
8769
  this.hiddenElements = {};
8770
+ this.keyTipElements = {};
7547
8771
  remove(this.element.querySelector('#' + this.element.id + TAB_ID));
7548
8772
  this.element.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
7549
8773
  this.element.style.removeProperty(RIBBON_HELP_PANE_TEMPLATE_WIDTH);
@@ -7620,7 +8844,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
7620
8844
  }
7621
8845
  break;
7622
8846
  case 'selectedTab':
7623
- this.tabObj.setProperties({ selectedItem: newProp.selectedTab });
8847
+ const tabEle = this.tabObj.element;
8848
+ const toolbarItem = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(newProp.selectedTab.toString(), 10)];
8849
+ if (!(toolbarItem.classList.contains('e-hidden') || toolbarItem.classList.contains('e-disable'))) {
8850
+ this.tabObj.setProperties({ selectedItem: newProp.selectedTab });
8851
+ }
7624
8852
  break;
7625
8853
  case 'tabAnimation':
7626
8854
  this.tabObj.setProperties({ animation: newProp.tabAnimation });
@@ -7628,6 +8856,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
7628
8856
  case 'tabs':
7629
8857
  this.reRenderTabs(newProp.tabs);
7630
8858
  break;
8859
+ case 'contextualTabs':
8860
+ for (let i = 0; i < this.contextualTabs.length; i++) {
8861
+ if (newProp.contextualTabs[parseInt(i.toString(), 10)]) {
8862
+ this.ribbonContextualTabModule.updateContextualTabs(newProp.contextualTabs[parseInt(i.toString(), 10)], this.contextualTabs[parseInt(i.toString(), 10)]);
8863
+ }
8864
+ }
8865
+ break;
7631
8866
  case 'width':
7632
8867
  this.element.style.width = formatUnit(newProp.width);
7633
8868
  this.refreshLayout();
@@ -7671,6 +8906,12 @@ __decorate([
7671
8906
  __decorate([
7672
8907
  Property('')
7673
8908
  ], Ribbon.prototype, "cssClass", void 0);
8909
+ __decorate([
8910
+ Property(false)
8911
+ ], Ribbon.prototype, "enableKeyTips", void 0);
8912
+ __decorate([
8913
+ Property('')
8914
+ ], Ribbon.prototype, "layoutSwitcherKeyTip", void 0);
7674
8915
  __decorate([
7675
8916
  Complex({}, FileMenuSettings)
7676
8917
  ], Ribbon.prototype, "fileMenu", void 0);
@@ -7695,6 +8936,9 @@ __decorate([
7695
8936
  __decorate([
7696
8937
  Collection([], RibbonTab)
7697
8938
  ], Ribbon.prototype, "tabs", void 0);
8939
+ __decorate([
8940
+ Collection([], RibbonContextualTabSettings)
8941
+ ], Ribbon.prototype, "contextualTabs", void 0);
7698
8942
  __decorate([
7699
8943
  Property('100%')
7700
8944
  ], Ribbon.prototype, "width", void 0);
@@ -7789,6 +9033,7 @@ class RibbonFileMenu {
7789
9033
  }
7790
9034
  this.parent.tabObj.refreshActiveTabBorder();
7791
9035
  this.addFileMenuTooltip(fileMenuOptions);
9036
+ this.addFileMenuKeytip();
7792
9037
  }
7793
9038
  addFileMenuTooltip(fileMenuOptions) {
7794
9039
  if (isTooltipPresent(fileMenuOptions.ribbonTooltipSettings)) {
@@ -7796,6 +9041,12 @@ class RibbonFileMenu {
7796
9041
  this.parent.tooltipData.push({ id: this.ddbElement.id, data: fileMenuOptions.ribbonTooltipSettings });
7797
9042
  }
7798
9043
  }
9044
+ addFileMenuKeytip() {
9045
+ if (this.parent.fileMenu.keyTip) {
9046
+ this.parent.keyTipElements['filemenu'] = [];
9047
+ this.parent.keyTipElements['filemenu'].push({ id: this.ddbElement.id, type: 'filemenu', keyTip: this.parent.fileMenu.keyTip });
9048
+ }
9049
+ }
7799
9050
  ddbBeforeEvent(isOpen, args) {
7800
9051
  //args.event is null when dropdown button is closed using a method call
7801
9052
  if (!isOpen && args.event && args.event.target.closest('.e-ribbon-menu')) {
@@ -7947,7 +9198,9 @@ class RibbonFileMenu {
7947
9198
  }
7948
9199
  }
7949
9200
  this.removeFileMenuTooltip();
9201
+ this.removeFileMenuKeytip();
7950
9202
  this.addFileMenuTooltip(fileMenuOptions);
9203
+ this.addFileMenuKeytip();
7951
9204
  }
7952
9205
  else {
7953
9206
  this.createFileMenu(fileMenuOptions);
@@ -7966,6 +9219,7 @@ class RibbonFileMenu {
7966
9219
  }
7967
9220
  destroyDDB() {
7968
9221
  this.removeFileMenuTooltip();
9222
+ this.removeFileMenuKeytip();
7969
9223
  const tabEle = this.parent.tabObj.element;
7970
9224
  tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
7971
9225
  this.destroyMenu();
@@ -7981,6 +9235,14 @@ class RibbonFileMenu {
7981
9235
  this.parent.tooltipData.splice(index, 1);
7982
9236
  }
7983
9237
  }
9238
+ removeFileMenuKeytip() {
9239
+ if (this.parent.keyTipElements['filemenu']) {
9240
+ const index = getIndex(this.parent.keyTipElements['filemenu'], (e) => { return e.id === this.ddbElement.id; });
9241
+ if (index !== -1) {
9242
+ this.parent.keyTipElements['filemenu'].splice(index, 1);
9243
+ }
9244
+ }
9245
+ }
7984
9246
  /**
7985
9247
  * Add items to FileMenu.
7986
9248
  *
@@ -8170,6 +9432,7 @@ class RibbonBackstage extends Component {
8170
9432
  };
8171
9433
  this.parent.tabObj.refreshActiveTabBorder();
8172
9434
  this.addBackStageMenuTooltip(backStageOptions);
9435
+ this.addBackStageMenuKeyTip(backStageOptions);
8173
9436
  EventHandler.add(document, 'click', this.onClickEvent, this);
8174
9437
  }
8175
9438
  onClickEvent(e) {
@@ -8187,6 +9450,24 @@ class RibbonBackstage extends Component {
8187
9450
  this.parent.tooltipData.push({ id: this.backstageButtonEle.id, data: backStageOptions.ribbonTooltipSettings });
8188
9451
  }
8189
9452
  }
9453
+ addBackStageMenuKeyTip(backStageOptions) {
9454
+ if (backStageOptions.keyTip) {
9455
+ if (!(this.parent.keyTipElements['backstage'])) {
9456
+ this.parent.keyTipElements['backstage'] = [];
9457
+ }
9458
+ this.parent.keyTipElements['backstage'].push({ id: this.backstageButtonEle.id, type: 'backstage', keyTip: backStageOptions.keyTip });
9459
+ }
9460
+ if (backStageOptions.items && backStageOptions.items.length) {
9461
+ if (!(this.parent.keyTipElements['backstageMenu'])) {
9462
+ this.parent.keyTipElements['backstageMenu'] = [];
9463
+ }
9464
+ for (let i = 0; i < backStageOptions.items.length; i++) {
9465
+ if (backStageOptions.items[parseInt(i.toString(), 10)].keyTip) {
9466
+ this.parent.keyTipElements['backstageMenu'].push({ id: backStageOptions.items[parseInt(i.toString(), 10)].id, type: 'backstageMenu', keyTip: backStageOptions.items[parseInt(i.toString(), 10)].keyTip });
9467
+ }
9468
+ }
9469
+ }
9470
+ }
8190
9471
  checkMenuItems(backStageItems) {
8191
9472
  for (let i = 0; i < backStageItems.length; i++) {
8192
9473
  const item = backStageItems[parseInt(i.toString(), 10)];
@@ -8475,7 +9756,9 @@ class RibbonBackstage extends Component {
8475
9756
  }
8476
9757
  }
8477
9758
  this.removeBackstageMenuTooltip();
9759
+ this.removeBackstageMenuKeyTip();
8478
9760
  this.addBackStageMenuTooltip(backStageOptions);
9761
+ this.addBackStageMenuKeyTip(backStageOptions);
8479
9762
  }
8480
9763
  else {
8481
9764
  this.createBackStage(backStageOptions);
@@ -8494,6 +9777,7 @@ class RibbonBackstage extends Component {
8494
9777
  }
8495
9778
  destroyDDB() {
8496
9779
  this.removeBackstageMenuTooltip();
9780
+ this.removeBackstageMenuKeyTip();
8497
9781
  const tabEle = this.parent.tabObj.element;
8498
9782
  tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
8499
9783
  this.destroyMenu();
@@ -8510,6 +9794,20 @@ class RibbonBackstage extends Component {
8510
9794
  this.parent.tooltipData.splice(index, 1);
8511
9795
  }
8512
9796
  }
9797
+ removeBackstageMenuKeyTip() {
9798
+ if (this.parent.keyTipElements['backstage'] && this.parent.keyTipElements['backstage'].length) {
9799
+ const index = getIndex(this.parent.keyTipElements['backstage'], (e) => { return e.id === this.backstageButtonEle.id; });
9800
+ if (index !== -1) {
9801
+ this.parent.keyTipElements['backstage'].splice(index, 1);
9802
+ }
9803
+ }
9804
+ if (this.parent.keyTipElements['backstageMenu'] && this.parent.keyTipElements['backstageMenu'].length) {
9805
+ for (let i = 0; i < this.parent.keyTipElements['backstageMenu'].length; i++) {
9806
+ this.parent.keyTipElements['backstageMenu'].splice(i, 1);
9807
+ i--;
9808
+ }
9809
+ }
9810
+ }
8513
9811
  /**
8514
9812
  * Add items to Backstage Menu.
8515
9813
  *
@@ -8577,6 +9875,622 @@ class RibbonBackstage extends Component {
8577
9875
  }
8578
9876
  }
8579
9877
 
9878
+ /**
9879
+ * Defines the ribbon contextual tab.
9880
+ */
9881
+ class RibbonContextualTab {
9882
+ constructor(parent) {
9883
+ this.parent = parent;
9884
+ }
9885
+ getModuleName() {
9886
+ return 'ribbonContextualTab';
9887
+ }
9888
+ destroy() {
9889
+ this.parent = null;
9890
+ }
9891
+ /**
9892
+ * Creates Contextual tab.
9893
+ *
9894
+ * @returns {void}
9895
+ * @hidden
9896
+ */
9897
+ addContextualTabs() {
9898
+ let isSelected = false;
9899
+ for (let n = 0; n < this.parent.contextualTabs.length; n++) {
9900
+ for (let i = 0; i < this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs.length; i++) {
9901
+ this.parent.addTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[parseInt(i.toString(), 10)]);
9902
+ const index = this.parent.tabs.length - 1;
9903
+ const tabEle = this.parent.tabObj.element;
9904
+ const toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index.toString(), 10)];
9905
+ toolbarEle.classList.add(RIBBON_CONTEXTUAL_TAB);
9906
+ toolbarEle.classList.add('e-hidden');
9907
+ if (this.parent.contextualTabs[parseInt(n.toString(), 10)].visible) {
9908
+ this.parent.showTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[parseInt(i.toString(), 10)].id, true);
9909
+ if (this.parent.contextualTabs[parseInt(n.toString(), 10)].isSelected && !isSelected) {
9910
+ this.parent.selectTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[0].id);
9911
+ isSelected = true;
9912
+ }
9913
+ }
9914
+ }
9915
+ }
9916
+ }
9917
+ /**
9918
+ * Updates Contextual tab.
9919
+ *
9920
+ * @param {RibbonContextualTabSettingsModel} newProp - Specifies new properties.
9921
+ * @param {RibbonContextualTabSettingsModel} contextualTab - Gets the property of contextual tab.
9922
+ * @returns {void}
9923
+ * @hidden
9924
+ */
9925
+ updateContextualTabs(newProp, contextualTab) {
9926
+ if (!(isNullOrUndefined(newProp.visible))) {
9927
+ for (let i = 0; i < contextualTab.tabs.length; i++) {
9928
+ if (newProp.visible) {
9929
+ this.parent.showTab(contextualTab.tabs[parseInt(i.toString(), 10)].id, true);
9930
+ }
9931
+ else {
9932
+ this.parent.hideTab(contextualTab.tabs[parseInt(i.toString(), 10)].id, true);
9933
+ }
9934
+ }
9935
+ }
9936
+ if (!(isNullOrUndefined(newProp.isSelected))) {
9937
+ if (newProp.isSelected && contextualTab.visible) {
9938
+ this.parent.selectTab(contextualTab.tabs[0].id);
9939
+ }
9940
+ else {
9941
+ const tabEle = this.parent.tabObj.element;
9942
+ for (let i = 0; i < this.parent.tabs.length; i++) {
9943
+ const toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(i.toString(), 10)];
9944
+ if (!(toolbarEle.classList.contains('e-hidden') || toolbarEle.classList.contains('e-disable'))) {
9945
+ this.parent.selectTab(this.parent.tabs[parseInt(i.toString(), 10)].id);
9946
+ break;
9947
+ }
9948
+ }
9949
+ }
9950
+ }
9951
+ if (newProp.tabs) {
9952
+ for (const key in newProp.tabs) {
9953
+ let index = parseInt(key, 10);
9954
+ const tab = this.parent.tabs.filter((e) => e.id === contextualTab.tabs[parseInt(index.toString(), 10)].id)[0];
9955
+ this.parent.updateTab(tab);
9956
+ }
9957
+ }
9958
+ }
9959
+ }
9960
+
9961
+ /**
9962
+ * Defines the keytip of Ribbon.
9963
+ */
9964
+ class RibbonKeyTip {
9965
+ constructor(parent) {
9966
+ this.isKeytipPopupOpen = false;
9967
+ this.parent = parent;
9968
+ }
9969
+ getModuleName() {
9970
+ return 'ribbonKeyTip';
9971
+ }
9972
+ destroy() {
9973
+ this.parent = null;
9974
+ }
9975
+ /**
9976
+ * Creates the keytips.
9977
+ *
9978
+ * @param {string} key - get's the keytip type.
9979
+ * @returns {void}
9980
+ * @hidden
9981
+ */
9982
+ createKeytip(key) {
9983
+ if (this.parent.keyTipElements) {
9984
+ let keytipData;
9985
+ if (key === 'tab') {
9986
+ for (let i = 0; i < this.parent.tabs.length; i++) {
9987
+ if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
9988
+ // eslint-disable-next-line
9989
+ keytipData = this.parent.keyTipElements[i][key];
9990
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'tab', 'center', 'bottom', true);
9991
+ }
9992
+ }
9993
+ if (this.parent.keyTipElements['filemenu']) {
9994
+ keytipData = this.parent.keyTipElements['filemenu'];
9995
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'filemenu');
9996
+ }
9997
+ if (this.parent.keyTipElements['backstage']) {
9998
+ keytipData = this.parent.keyTipElements['backstage'];
9999
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'backstage');
10000
+ }
10001
+ if (this.parent.keyTipElements['collapse']) {
10002
+ keytipData = this.parent.keyTipElements['collapse'];
10003
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'collapse');
10004
+ }
10005
+ if (this.parent.keyTipElements['taboverflow']) {
10006
+ keytipData = this.parent.keyTipElements['taboverflow'];
10007
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'taboverflow');
10008
+ }
10009
+ }
10010
+ else if (key === 'popupitem') {
10011
+ if (this.parent.keyTipElements[this.parent.selectedTab]['popupitem']) {
10012
+ const popupKeyTipData = this.parent.keyTipElements[this.parent.selectedTab]['popupitem'];
10013
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['popupitem']).length; i++) {
10014
+ this.createKeyTipElement((popupKeyTipData[parseInt(i.toString(), 10)].id), popupKeyTipData[parseInt(i.toString(), 10)].keyTip, 'popupitem', 'left', 'top', false, true);
10015
+ }
10016
+ }
10017
+ }
10018
+ else if (key === 'backstageMenu') {
10019
+ if (this.parent.keyTipElements['backstageMenu']) {
10020
+ const backstageKeyTipData = this.parent.keyTipElements['backstageMenu'];
10021
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements['backstageMenu']).length; i++) {
10022
+ this.createKeyTipElement((backstageKeyTipData[parseInt(i.toString(), 10)].id), backstageKeyTipData[parseInt(i.toString(), 10)].keyTip, 'backstageMenu', 'left', 'center');
10023
+ }
10024
+ }
10025
+ }
10026
+ else if (key === 'grpoverflowpopup' && this.parent.activeLayout === 'Classic') {
10027
+ if (this.parent.keyTipElements[this.parent.selectedTab]['grpoverflowpopup']) {
10028
+ this.calculateItemPosition(key);
10029
+ }
10030
+ if (this.parent.keyTipElements[this.parent.selectedTab]['launcher']) {
10031
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['launcher']).length; i++) {
10032
+ keytipData = this.parent.keyTipElements[this.parent.selectedTab]['launcher'];
10033
+ this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'launcher', 'center', 'bottom', false, true);
10034
+ }
10035
+ }
10036
+ }
10037
+ else {
10038
+ this.calculateItemPosition(key);
10039
+ if (this.parent.activeLayout === 'Classic') {
10040
+ if (this.parent.keyTipElements[this.parent.selectedTab]['launcher']) {
10041
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['launcher']).length; i++) {
10042
+ keytipData = this.parent.keyTipElements[this.parent.selectedTab]['launcher'];
10043
+ this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'launcher');
10044
+ }
10045
+ }
10046
+ if (this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow']) {
10047
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow']).length; i++) {
10048
+ keytipData = this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow'];
10049
+ this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'grpoverflow');
10050
+ }
10051
+ }
10052
+ }
10053
+ if (this.parent.activeLayout === 'Simplified') {
10054
+ if (this.parent.keyTipElements['overflowbtn']) {
10055
+ keytipData = this.parent.keyTipElements['overflowbtn'];
10056
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'overflowbtn');
10057
+ }
10058
+ if (this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn']) {
10059
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn']).length; i++) {
10060
+ keytipData = this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn'];
10061
+ this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'grpofbtn');
10062
+ }
10063
+ }
10064
+ }
10065
+ }
10066
+ }
10067
+ }
10068
+ calculateItemPosition(key, isMethod = false, keyTip) {
10069
+ let xOffset;
10070
+ let yOffset;
10071
+ let keytipData;
10072
+ /* eslint-disable */
10073
+ keytipData = this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(), 10)][key];
10074
+ if (keytipData) {
10075
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(), 10)][key]).length; i++) {
10076
+ /* eslint-enable */
10077
+ if ((isMethod && (keytipData[parseInt(i.toString(), 10)].keyTip === keyTip)) || !isMethod) {
10078
+ let itemID = keytipData[parseInt(i.toString(), 10)].id;
10079
+ if (keytipData[parseInt(i.toString(), 10)].id.includes("_grpbtn")) {
10080
+ itemID = keytipData[parseInt(i.toString(), 10)].id.replace(/_grpbtn\d+/, '');
10081
+ }
10082
+ const itemProp = getItem(this.parent.tabs, itemID);
10083
+ if (itemProp && itemProp.group.orientation === 'Column' && itemProp.collection.items.length > 1 && this.parent.activeLayout !== 'Simplified') {
10084
+ if (itemProp.itemIndex === 0) {
10085
+ xOffset = 'center';
10086
+ yOffset = 'top';
10087
+ }
10088
+ else if (itemProp.itemIndex === 1) {
10089
+ xOffset = 'center';
10090
+ yOffset = 'center';
10091
+ }
10092
+ else {
10093
+ xOffset = 'center';
10094
+ yOffset = 'bottom';
10095
+ }
10096
+ }
10097
+ else if (itemProp && itemProp.group.orientation === 'Row' && itemProp.group.collections.length > 1 && this.parent.activeLayout !== 'Simplified') {
10098
+ if (itemProp.collectionIndex === 0) {
10099
+ xOffset = 'center';
10100
+ yOffset = 'top';
10101
+ }
10102
+ else {
10103
+ xOffset = 'center';
10104
+ yOffset = 'bottom';
10105
+ }
10106
+ }
10107
+ 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);
10108
+ }
10109
+ }
10110
+ }
10111
+ }
10112
+ createKeyTipElement(id, keyTip, type, xOffset = 'center', yOffset = 'bottom', isTab = false, isPopUpItem = false) {
10113
+ let keyEle = document.querySelector('#' + id);
10114
+ let isPopUpPresent = false;
10115
+ let splitBtnID;
10116
+ if (isTab) {
10117
+ keyEle = document.querySelector('#' + id + HEADER_ID);
10118
+ }
10119
+ if (keyEle) {
10120
+ if (keyEle.closest('.e-ribbon-group-overflow-ddb')) {
10121
+ isPopUpPresent = true;
10122
+ }
10123
+ if ((isTab && isPopUpItem) && keyEle.closest('.e-toolbar-pop')) {
10124
+ isPopUpPresent = true;
10125
+ }
10126
+ if (keyEle.closest('.e-split-btn-wrapper')) {
10127
+ let splitBtn = keyEle.closest('.e-split-btn-wrapper');
10128
+ splitBtnID = splitBtn.closest('.e-ribbon-item').id;
10129
+ }
10130
+ else {
10131
+ if (keyEle.closest('.e-colorpicker-wrapper')) {
10132
+ keyEle = keyEle.closest('.e-colorpicker-wrapper');
10133
+ splitBtnID = keyEle.closest('.e-ribbon-item').id;
10134
+ }
10135
+ }
10136
+ }
10137
+ if ((keyEle && keyEle.offsetParent) || (isTab && isPopUpItem)) {
10138
+ if ((isPopUpItem && isPopUpPresent) || !isPopUpItem) {
10139
+ const keytipElement = this.parent.createElement('div', {
10140
+ className: RIBBON_KEYTIP,
10141
+ id: id + RIBBON_KEYTIP_ID
10142
+ });
10143
+ document.body.append(keytipElement);
10144
+ const keytipPopup = new Popup(keytipElement, {
10145
+ relateTo: '#' + (isTab ? id + HEADER_ID : splitBtnID ? splitBtnID : id),
10146
+ content: keyTip,
10147
+ collision: { X: 'fit', Y: 'flip' },
10148
+ targetType: 'relative',
10149
+ position: { X: xOffset, Y: yOffset },
10150
+ enableRtl: this.parent.enableRtl
10151
+ });
10152
+ keytipPopup.show();
10153
+ this.calculateKeyTipPosition(keyEle, keytipElement, type, yOffset, (isTab && isPopUpItem));
10154
+ this.parent.isKeytipOpen = true;
10155
+ }
10156
+ }
10157
+ }
10158
+ calculateKeyTipPosition(itemEle, keytipElement, type, yOffset, isTabOverflow = false) {
10159
+ const position = itemEle.getBoundingClientRect();
10160
+ if (type === 'backstageMenu') {
10161
+ keytipElement.style.top = position.top + ((keytipElement.offsetHeight) / 2) + 'px';
10162
+ keytipElement.style.left = position.left + (itemEle.offsetWidth / 5) + 'px';
10163
+ }
10164
+ else {
10165
+ if (type !== 'popupitem') {
10166
+ keytipElement.style.left = position.left + (position.width - keytipElement.offsetWidth) / 2 + 'px';
10167
+ }
10168
+ }
10169
+ if (type === 'filemenu' || type === 'backstage') {
10170
+ keytipElement.style.top = position.top + ((itemEle.offsetHeight - (itemEle.offsetHeight / 3)) + (keytipElement.offsetHeight / 6)) + 'px';
10171
+ }
10172
+ else if ((type === 'item' && yOffset === 'top')) {
10173
+ keytipElement.style.top = (position.top - (itemEle.offsetHeight) / 2) + 'px';
10174
+ }
10175
+ }
10176
+ /**
10177
+ * Performs keytip action.
10178
+ *
10179
+ * @param {string} keyPress - Gets the keytip text.
10180
+ * @returns {void}
10181
+ * @hidden
10182
+ */
10183
+ keytipPress(keyPress, isMethod = false) {
10184
+ this.isKeytipPresent = false;
10185
+ for (let i = 0; ((i < Object.keys(this.parent.keyTipElements).length) && !this.isKeytipPresent); i++) {
10186
+ if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
10187
+ for (let j = 0; ((j < Object.keys(this.parent.keyTipElements[parseInt(i.toString(), 10)]).length) && !this.isKeytipPresent); j++) {
10188
+ let keytipData = this.parent.keyTipElements[parseInt(i.toString(), 10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(), 10)])[parseInt(j.toString(), 10)]];
10189
+ for (let k = 0; ((k < keytipData.length) && !this.isKeytipPresent); k++) {
10190
+ if (keyPress.toUpperCase() === keytipData[parseInt(k.toString(), 10)].keyTip) {
10191
+ const keyTipElement = document.querySelector('#' + keytipData[parseInt(k.toString(), 10)].id + RIBBON_KEYTIP_ID);
10192
+ if (keyTipElement || isMethod) {
10193
+ this.isKeytipPresent = true;
10194
+ this.removeKeytip();
10195
+ if (keytipData[parseInt(k.toString(), 10)].type === 'tab') {
10196
+ if (i !== this.parent.selectedTab) {
10197
+ this.parent.tabObj.select(i);
10198
+ setTimeout(() => {
10199
+ const tabOverflow = this.parent.tabObj.element.querySelector('.e-nav-active');
10200
+ if (tabOverflow)
10201
+ tabOverflow.click();
10202
+ this.createKeytip('item');
10203
+ }, 600);
10204
+ }
10205
+ else {
10206
+ this.createKeytip('item');
10207
+ }
10208
+ }
10209
+ else {
10210
+ if (keytipData[parseInt(k.toString(), 10)].type === 'item' || keytipData[parseInt(k.toString(), 10)].type === 'grpoverflowpopup' || keytipData[parseInt(k.toString(), 10)].type === 'popupitem') {
10211
+ if (document.getElementById(keytipData[parseInt(k.toString(), 10)].id) && document.getElementById(keytipData[parseInt(k.toString(), 10)].id).classList.contains('e-ribbon-group-button')) {
10212
+ document.getElementById(keytipData[parseInt(k.toString(), 10)].id).click();
10213
+ }
10214
+ else {
10215
+ let itemProp;
10216
+ if ((keytipData[parseInt(k.toString(), 10)].id).includes("_popupButton")) {
10217
+ const galleryID = keytipData[parseInt(k.toString(), 10)].id.replace(/_popupButton/g, '');
10218
+ itemProp = getItem(this.parent.tabs, galleryID);
10219
+ }
10220
+ else {
10221
+ itemProp = getItem(this.parent.tabs, keytipData[parseInt(k.toString(), 10)].id);
10222
+ }
10223
+ if (!isMethod || (isMethod && itemProp.tabIndex === this.parent.selectedTab)) {
10224
+ this.clickItems(itemProp, keytipData, k, false, isMethod);
10225
+ }
10226
+ }
10227
+ }
10228
+ else if (keytipData[parseInt(k.toString(), 10)].type === 'grpoverflow' || keytipData[parseInt(k.toString(), 10)].type === 'grpofbtn' || keytipData[parseInt(k.toString(), 10)].type === 'launcher') {
10229
+ const keyEle = document.querySelector('#' + keytipData[parseInt(k.toString(), 10)].id);
10230
+ this.removeKeytip();
10231
+ if (keyEle) {
10232
+ let groupID = keytipData[parseInt(k.toString(), 10)].id;
10233
+ if (isMethod) {
10234
+ 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")) {
10235
+ groupID = keytipData[parseInt(k.toString(), 10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g, '');
10236
+ const itemProp = getGroup(this.parent.tabs, groupID);
10237
+ if (itemProp.tabIndex === this.parent.selectedTab) {
10238
+ this.clickItems(itemProp, keytipData, k, true, isMethod, keyEle);
10239
+ }
10240
+ }
10241
+ }
10242
+ else {
10243
+ this.clickItems(null, keytipData, k, true, isMethod, keyEle);
10244
+ }
10245
+ }
10246
+ }
10247
+ }
10248
+ }
10249
+ }
10250
+ }
10251
+ }
10252
+ }
10253
+ else {
10254
+ if (this.parent.keyTipElements) {
10255
+ this.commonItemsKeyTipPress(keyPress, Object.keys(this.parent.keyTipElements)[parseInt(i.toString(), 10)], isMethod);
10256
+ }
10257
+ }
10258
+ }
10259
+ }
10260
+ clickItems(itemProp, keytipData, k, isGroupItems, isMethod, keyEle) {
10261
+ if (isGroupItems) {
10262
+ keyEle.click();
10263
+ if (!(keytipData[parseInt(k.toString(), 10)].type === 'launcher')) {
10264
+ this.isKeytipPopupOpen = true;
10265
+ keytipData[parseInt(k.toString(), 10)].type === 'grpoverflow' ? this.createKeytip('grpoverflowpopup') : this.createKeytip('popupitem');
10266
+ }
10267
+ }
10268
+ else {
10269
+ let itemID = keytipData[parseInt(k.toString(), 10)].id;
10270
+ if (document.querySelector('#' + itemID) && isMethod) {
10271
+ if (this.parent.activeLayout === 'Simplified') {
10272
+ 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')) {
10273
+ document.querySelector('#' + itemProp.group.id + '_sim_grp_overflow').click();
10274
+ }
10275
+ 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')) {
10276
+ document.querySelector('#' + this.parent.tabObj.element.id + OVRLOF_BUTTON_ID).click();
10277
+ }
10278
+ }
10279
+ else {
10280
+ 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')) {
10281
+ document.querySelector('#' + itemProp.group.id + OVERFLOW_ID + DROPDOWN_ID).click();
10282
+ }
10283
+ }
10284
+ }
10285
+ const itemType = this.parent.getItemModuleName(itemProp.item);
10286
+ switch (itemType) {
10287
+ case 'btn':
10288
+ this.parent.ribbonButtonModule.click(itemID);
10289
+ break;
10290
+ case 'dropdown-btn':
10291
+ this.parent.ribbonDropDownModule.toggle(itemID);
10292
+ break;
10293
+ case 'split-btn':
10294
+ this.parent.ribbonSplitButtonModule.toggle(itemID);
10295
+ break;
10296
+ case 'checkbox':
10297
+ this.parent.ribbonCheckBoxModule.click(itemID);
10298
+ break;
10299
+ case 'colorpicker':
10300
+ this.parent.ribbonColorPickerModule.toggle(itemID);
10301
+ break;
10302
+ case 'combobox':
10303
+ const itemEle = document.querySelector('#' + itemID);
10304
+ setTimeout(() => {
10305
+ itemEle.focus();
10306
+ }, 100);
10307
+ break;
10308
+ case 'gallery':
10309
+ const galleryEle = document.querySelector('#' + itemID);
10310
+ galleryEle.click();
10311
+ break;
10312
+ case 'template':
10313
+ const templateEle = document.querySelector('#' + itemID);
10314
+ templateEle.focus();
10315
+ break;
10316
+ case 'group-btn':
10317
+ const itemElement = document.querySelector('#' + itemID);
10318
+ if (itemElement) {
10319
+ const item = getInstance(itemElement, DropDownButton);
10320
+ item.toggle();
10321
+ for (let i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
10322
+ if (itemProp.item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip) {
10323
+ this.createKeyTipElement(itemID + (RIBBON_GROUP_BUTTON_ID + i), itemProp.item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip, 'item');
10324
+ }
10325
+ }
10326
+ }
10327
+ break;
10328
+ }
10329
+ }
10330
+ }
10331
+ commonItemsKeyTipPress(keyPress, key, isMethod) {
10332
+ /* eslint-disable */
10333
+ if (this.parent.keyTipElements[key]) {
10334
+ let isKeyPressed = false;
10335
+ let keytipData = this.parent.keyTipElements[key];
10336
+ let keyEle;
10337
+ let keytipElement;
10338
+ if (keytipData) {
10339
+ if (key === 'backstageMenu') {
10340
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements[key]).length; i++) {
10341
+ /* eslint-enable */
10342
+ if (keytipData[parseInt(i.toString(), 10)].keyTip === keyPress.toUpperCase()) {
10343
+ keyEle = document.querySelector('#' + keytipData[parseInt(i.toString(), 10)].id);
10344
+ keytipElement = document.querySelector('#' + keyEle.id + RIBBON_KEYTIP_ID);
10345
+ if (keytipElement || isMethod) {
10346
+ isKeyPressed = true;
10347
+ if (isMethod && document.querySelector('.e-ribbon-backstage-popup').classList.contains('e-popup-close')) {
10348
+ this.parent.tabObj.element.querySelector('.e-ribbon-backstage').click();
10349
+ }
10350
+ break;
10351
+ }
10352
+ }
10353
+ }
10354
+ }
10355
+ else {
10356
+ if (keytipData[0] && keytipData[0].keyTip === keyPress.toUpperCase()) {
10357
+ keyEle = document.querySelector('#' + keytipData[0].id);
10358
+ keytipElement = document.querySelector('#' + keytipData[0].id + RIBBON_KEYTIP_ID);
10359
+ if (keytipElement || isMethod) {
10360
+ isKeyPressed = true;
10361
+ }
10362
+ }
10363
+ }
10364
+ }
10365
+ if (isKeyPressed) {
10366
+ this.removeKeytip();
10367
+ this.isKeytipPresent = true;
10368
+ if (keyEle) {
10369
+ keyEle.click();
10370
+ if (key === 'backstage') {
10371
+ this.createKeytip('backstageMenu');
10372
+ }
10373
+ else if (key === 'overflowbtn') {
10374
+ this.isKeytipPopupOpen = true;
10375
+ this.createKeytip('popupitem');
10376
+ }
10377
+ else if (key === 'taboverflow') {
10378
+ setTimeout(() => {
10379
+ for (let i = 0; i < Object.keys(this.parent.keyTipElements).length; i++) {
10380
+ if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
10381
+ let keytipData = this.parent.keyTipElements[parseInt(i.toString(), 10)]['tab'];
10382
+ this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'tab', 'center', 'bottom', true, true);
10383
+ }
10384
+ }
10385
+ }, 600);
10386
+ }
10387
+ }
10388
+ }
10389
+ }
10390
+ }
10391
+ /**
10392
+ * Removes the keytip.
10393
+ *
10394
+ * @param {string} key - Gets the keyboard key element.
10395
+ * @returns {void}
10396
+ * @hidden
10397
+ */
10398
+ removeKeytip(key) {
10399
+ const keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
10400
+ let isKeyTipExist = false;
10401
+ this.parent.keysPress = '';
10402
+ for (let i = 0; i < keyTipItems.length; i++) {
10403
+ const keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
10404
+ if (key === 'Escape' && this.parent.keyTipElements && this.parent.keyTipElements[this.parent.selectedTab]) {
10405
+ /* eslint-disable */
10406
+ for (let j = 0; j < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]).length; j++) {
10407
+ let keyText = (Object.keys(this.parent.keyTipElements[this.parent.selectedTab]))[j];
10408
+ if (this.parent.keyTipElements[this.parent.selectedTab][keyText]) {
10409
+ const index = getIndex(this.parent.keyTipElements[this.parent.selectedTab][keyText], (e) => { return e.id + RIBBON_KEYTIP_ID === keyTipItems[parseInt(i.toString(), 10)].id; });
10410
+ /* eslint-enable */
10411
+ if (index !== -1) {
10412
+ if ((keyText === 'item' && !(this.isKeytipPopupOpen)) || (keyText === 'grpoverflow' && this.parent.activeLayout === 'Classic')) {
10413
+ this.createKeytip('tab');
10414
+ key = '';
10415
+ isKeyTipExist = true;
10416
+ break;
10417
+ }
10418
+ else if (this.isKeytipPopupOpen) {
10419
+ if ((keyText === 'popupitem' && this.parent.activeLayout === 'Simplified') || (keyText === 'grpoverflowpopup' && this.parent.activeLayout === 'Classic')) {
10420
+ this.createKeytip('item');
10421
+ key = '';
10422
+ isKeyTipExist = true;
10423
+ break;
10424
+ }
10425
+ }
10426
+ }
10427
+ }
10428
+ }
10429
+ for (let n = 0; n < Object.keys(this.parent.keyTipElements).length; n++) {
10430
+ if (this.parent.keyTipElements[parseInt(n.toString(), 10)]) {
10431
+ let keytipData = this.parent.keyTipElements[parseInt(n.toString(), 10)]['tab'];
10432
+ for (let j = 0; j < keytipData.length; j++) {
10433
+ if (keyTipItem.id === keytipData[0].id + RIBBON_KEYTIP_ID) {
10434
+ if (document.querySelector('#' + keytipData[0].id + HEADER_ID).closest('.e-toolbar-pop')) {
10435
+ const tabOverflow = this.parent.tabObj.element.querySelector('.e-nav-active');
10436
+ tabOverflow.click();
10437
+ setTimeout(() => {
10438
+ this.createKeytip('tab');
10439
+ }, 600);
10440
+ key = '';
10441
+ isKeyTipExist = true;
10442
+ break;
10443
+ }
10444
+ }
10445
+ }
10446
+ if (isKeyTipExist) {
10447
+ break;
10448
+ }
10449
+ }
10450
+ }
10451
+ if (!isKeyTipExist && this.parent.keyTipElements['backstageMenu']) {
10452
+ const index = getIndex(this.parent.keyTipElements['backstageMenu'], (e) => { return e.id + RIBBON_KEYTIP_ID === keyTipItems[parseInt(i.toString(), 10)].id; });
10453
+ if (index !== -1) {
10454
+ this.createKeytip('tab');
10455
+ key = '';
10456
+ isKeyTipExist = true;
10457
+ }
10458
+ }
10459
+ }
10460
+ if (keyTipItem) {
10461
+ remove(keyTipItem);
10462
+ }
10463
+ }
10464
+ this.isKeytipPopupOpen = false;
10465
+ if (!isKeyTipExist)
10466
+ this.parent.isKeytipOpen = false;
10467
+ }
10468
+ /**
10469
+ * Shows the Keytip dynamically.
10470
+ *
10471
+ * @param {string} keyAction - Item for which the tooltip is to be shown.
10472
+ * @returns {void}
10473
+ */
10474
+ showKeyTips(keyAction) {
10475
+ if (this.parent.enableKeyTips) {
10476
+ if (keyAction) {
10477
+ this.keytipPress(keyAction, true);
10478
+ }
10479
+ else {
10480
+ this.createKeytip('tab');
10481
+ }
10482
+ }
10483
+ }
10484
+ /**
10485
+ * Hides the Keytip dynamically.
10486
+ *
10487
+ * @returns {void}
10488
+ */
10489
+ hideKeyTips() {
10490
+ this.removeKeytip();
10491
+ }
10492
+ }
10493
+
8580
10494
  /**
8581
10495
  * Ribbon modules
8582
10496
  */
@@ -8584,5 +10498,5 @@ class RibbonBackstage extends Component {
8584
10498
  // export all modules from current location
8585
10499
  // example: export * from './module'
8586
10500
 
8587
- 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 };
10501
+ 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 };
8588
10502
  //# sourceMappingURL=ej2-ribbon.es2015.js.map