@syncfusion/ej2-ribbon 24.2.8 → 25.1.41
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.
- package/CHANGELOG.md +8 -4
- package/README.md +3 -0
- package/dist/ej2-ribbon.umd.min.js +2 -2
- package/dist/ej2-ribbon.umd.min.js.map +1 -1
- package/dist/es6/ej2-ribbon.es2015.js +2164 -217
- package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
- package/dist/es6/ej2-ribbon.es5.js +2293 -226
- package/dist/es6/ej2-ribbon.es5.js.map +1 -1
- package/dist/global/ej2-ribbon.min.js +2 -2
- package/dist/global/ej2-ribbon.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/global.js +1 -1
- package/src/ribbon/base/constant.d.ts +8 -0
- package/src/ribbon/base/constant.js +8 -0
- package/src/ribbon/base/interface.d.ts +114 -1
- package/src/ribbon/base/interface.js +4 -0
- package/src/ribbon/base/ribbon-model.d.ts +22 -1
- package/src/ribbon/base/ribbon.d.ts +70 -5
- package/src/ribbon/base/ribbon.js +571 -157
- package/src/ribbon/base/utils.d.ts +3 -2
- package/src/ribbon/base/utils.js +3 -2
- package/src/ribbon/items/index.d.ts +1 -0
- package/src/ribbon/items/index.js +1 -0
- package/src/ribbon/items/ribbon-colorpicker.js +6 -1
- package/src/ribbon/items/ribbon-gallery.d.ts +87 -0
- package/src/ribbon/items/ribbon-gallery.js +712 -0
- package/src/ribbon/items/ribbon-groupbutton.js +3 -0
- package/src/ribbon/models/index.d.ts +8 -0
- package/src/ribbon/models/index.js +4 -0
- package/src/ribbon/models/ribbon-back-stage-settings-model.d.ts +7 -0
- package/src/ribbon/models/ribbon-back-stage-settings.d.ts +6 -0
- package/src/ribbon/models/ribbon-back-stage-settings.js +3 -0
- package/src/ribbon/models/ribbon-backstage-item-model.d.ts +7 -0
- package/src/ribbon/models/ribbon-backstage-item.d.ts +6 -0
- package/src/ribbon/models/ribbon-backstage-item.js +3 -0
- package/src/ribbon/models/ribbon-contextual-tab-settings-model.d.ts +30 -0
- package/src/ribbon/models/ribbon-contextual-tab-settings.d.ts +33 -0
- package/src/ribbon/models/ribbon-contextual-tab-settings.js +50 -0
- package/src/ribbon/models/ribbon-file-menu-settings-model.d.ts +7 -0
- package/src/ribbon/models/ribbon-file-menu-settings.d.ts +6 -0
- package/src/ribbon/models/ribbon-file-menu-settings.js +3 -0
- package/src/ribbon/models/ribbon-gallery-group-model.d.ts +44 -0
- package/src/ribbon/models/ribbon-gallery-group.d.ts +38 -0
- package/src/ribbon/models/ribbon-gallery-group.js +47 -0
- package/src/ribbon/models/ribbon-gallery-item-model.d.ts +43 -0
- package/src/ribbon/models/ribbon-gallery-item.d.ts +38 -0
- package/src/ribbon/models/ribbon-gallery-item.js +46 -0
- package/src/ribbon/models/ribbon-gallery-settings-model.d.ts +108 -0
- package/src/ribbon/models/ribbon-gallery-settings.d.ts +95 -0
- package/src/ribbon/models/ribbon-gallery-settings.js +71 -0
- package/src/ribbon/models/ribbon-group-button-item-model.d.ts +7 -0
- package/src/ribbon/models/ribbon-group-button-item.d.ts +6 -0
- package/src/ribbon/models/ribbon-group-button-item.js +3 -0
- package/src/ribbon/models/ribbon-group-model.d.ts +14 -0
- package/src/ribbon/models/ribbon-group.d.ts +12 -0
- package/src/ribbon/models/ribbon-group.js +6 -0
- package/src/ribbon/models/ribbon-item-model.d.ts +15 -1
- package/src/ribbon/models/ribbon-item.d.ts +13 -0
- package/src/ribbon/models/ribbon-item.js +7 -0
- package/src/ribbon/models/ribbon-tab-model.d.ts +7 -0
- package/src/ribbon/models/ribbon-tab.d.ts +6 -0
- package/src/ribbon/models/ribbon-tab.js +3 -0
- package/src/ribbon/modules/index.d.ts +2 -0
- package/src/ribbon/modules/index.js +2 -0
- package/src/ribbon/modules/ribbon-backstage.d.ts +2 -0
- package/src/ribbon/modules/ribbon-backstage.js +37 -0
- package/src/ribbon/modules/ribbon-contextualtab.d.ts +27 -0
- package/src/ribbon/modules/ribbon-contextualtab.js +90 -0
- package/src/ribbon/modules/ribbon-filemenu.d.ts +2 -0
- package/src/ribbon/modules/ribbon-filemenu.js +19 -0
- package/src/ribbon/modules/ribbon-keytip.d.ts +54 -0
- package/src/ribbon/modules/ribbon-keytip.js +554 -0
- package/styles/bootstrap-dark.css +398 -24
- package/styles/bootstrap.css +389 -15
- package/styles/bootstrap4.css +398 -24
- package/styles/bootstrap5-dark.css +391 -17
- package/styles/bootstrap5.css +391 -17
- package/styles/fabric-dark.css +388 -14
- package/styles/fabric.css +387 -13
- package/styles/fluent-dark.css +389 -15
- package/styles/fluent.css +389 -15
- package/styles/highcontrast-light.css +381 -7
- package/styles/highcontrast.css +390 -16
- package/styles/material-dark.css +391 -17
- package/styles/material.css +391 -17
- package/styles/material3-dark.css +389 -15
- package/styles/material3.css +389 -15
- package/styles/ribbon/_bds-definition.scss +360 -0
- package/styles/ribbon/_bootstrap-dark-definition.scss +81 -6
- package/styles/ribbon/_bootstrap-definition.scss +81 -6
- package/styles/ribbon/_bootstrap4-definition.scss +82 -7
- package/styles/ribbon/_bootstrap5-definition.scss +81 -6
- package/styles/ribbon/_fabric-dark-definition.scss +78 -3
- package/styles/ribbon/_fabric-definition.scss +78 -3
- package/styles/ribbon/_fluent-definition.scss +80 -5
- package/styles/ribbon/_fusionnew-definition.scss +76 -1
- package/styles/ribbon/_highcontrast-definition.scss +80 -5
- package/styles/ribbon/_highcontrast-light-definition.scss +76 -1
- package/styles/ribbon/_layout.scss +344 -38
- package/styles/ribbon/_material-dark-definition.scss +80 -5
- package/styles/ribbon/_material-definition.scss +81 -6
- package/styles/ribbon/_material3-definition.scss +80 -5
- package/styles/ribbon/_tailwind-definition.scss +80 -5
- package/styles/ribbon/_theme.scss +71 -0
- package/styles/ribbon/bootstrap-dark.css +398 -24
- package/styles/ribbon/bootstrap.css +389 -15
- package/styles/ribbon/bootstrap4.css +398 -24
- package/styles/ribbon/bootstrap5-dark.css +391 -17
- package/styles/ribbon/bootstrap5.css +391 -17
- package/styles/ribbon/fabric-dark.css +388 -14
- package/styles/ribbon/fabric.css +387 -13
- package/styles/ribbon/fluent-dark.css +389 -15
- package/styles/ribbon/fluent.css +389 -15
- package/styles/ribbon/highcontrast-light.css +381 -7
- package/styles/ribbon/highcontrast.css +390 -16
- package/styles/ribbon/icons/_bds.scss +9 -0
- package/styles/ribbon/material-dark.css +391 -17
- package/styles/ribbon/material.css +391 -17
- package/styles/ribbon/material3-dark.css +389 -15
- package/styles/ribbon/material3.css +389 -15
- package/styles/ribbon/tailwind-dark.css +390 -16
- package/styles/ribbon/tailwind.css +390 -16
- package/styles/tailwind-dark.css +390 -16
- 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$
|
|
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$
|
|
962
|
+
__decorate$17([
|
|
836
963
|
Property('File')
|
|
837
964
|
], FileMenuSettings.prototype, "text", void 0);
|
|
838
|
-
__decorate$
|
|
965
|
+
__decorate$17([
|
|
839
966
|
Property(false)
|
|
840
967
|
], FileMenuSettings.prototype, "visible", void 0);
|
|
841
|
-
__decorate$
|
|
968
|
+
__decorate$17([
|
|
842
969
|
Collection([], MenuItem)
|
|
843
970
|
], FileMenuSettings.prototype, "menuItems", void 0);
|
|
844
|
-
__decorate$
|
|
971
|
+
__decorate$17([
|
|
845
972
|
Property(false)
|
|
846
973
|
], FileMenuSettings.prototype, "showItemOnClick", void 0);
|
|
847
|
-
__decorate$
|
|
974
|
+
__decorate$17([
|
|
848
975
|
Complex({}, MenuAnimationSettings)
|
|
849
976
|
], FileMenuSettings.prototype, "animationSettings", void 0);
|
|
850
|
-
__decorate$
|
|
977
|
+
__decorate$17([
|
|
851
978
|
Property('')
|
|
852
979
|
], FileMenuSettings.prototype, "itemTemplate", void 0);
|
|
853
|
-
__decorate$
|
|
980
|
+
__decorate$17([
|
|
854
981
|
Property('')
|
|
855
982
|
], FileMenuSettings.prototype, "popupTemplate", void 0);
|
|
856
|
-
__decorate$
|
|
983
|
+
__decorate$17([
|
|
857
984
|
Complex({}, RibbonTooltip)
|
|
858
985
|
], FileMenuSettings.prototype, "ribbonTooltipSettings", void 0);
|
|
859
|
-
__decorate$
|
|
986
|
+
__decorate$17([
|
|
860
987
|
Event()
|
|
861
988
|
], FileMenuSettings.prototype, "beforeClose", void 0);
|
|
862
|
-
__decorate$
|
|
989
|
+
__decorate$17([
|
|
863
990
|
Event()
|
|
864
991
|
], FileMenuSettings.prototype, "beforeOpen", void 0);
|
|
865
|
-
__decorate$
|
|
992
|
+
__decorate$17([
|
|
866
993
|
Event()
|
|
867
994
|
], FileMenuSettings.prototype, "beforeItemRender", void 0);
|
|
868
|
-
__decorate$
|
|
995
|
+
__decorate$17([
|
|
869
996
|
Event()
|
|
870
997
|
], FileMenuSettings.prototype, "close", void 0);
|
|
871
|
-
__decorate$
|
|
998
|
+
__decorate$17([
|
|
872
999
|
Event()
|
|
873
1000
|
], FileMenuSettings.prototype, "open", void 0);
|
|
874
|
-
__decorate$
|
|
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$
|
|
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$
|
|
1019
|
+
__decorate$19([
|
|
890
1020
|
Property('')
|
|
891
1021
|
], BackstageBackButton.prototype, "text", void 0);
|
|
892
|
-
__decorate$
|
|
1022
|
+
__decorate$19([
|
|
893
1023
|
Property('')
|
|
894
1024
|
], BackstageBackButton.prototype, "iconCss", void 0);
|
|
895
|
-
__decorate$
|
|
1025
|
+
__decorate$19([
|
|
896
1026
|
Property(true)
|
|
897
1027
|
], BackstageBackButton.prototype, "visible", void 0);
|
|
898
1028
|
|
|
899
|
-
var __decorate$
|
|
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$
|
|
1040
|
+
__decorate$20([
|
|
911
1041
|
Property('')
|
|
912
1042
|
], BackstageItem.prototype, "text", void 0);
|
|
913
|
-
__decorate$
|
|
1043
|
+
__decorate$20([
|
|
914
1044
|
Property('')
|
|
915
1045
|
], BackstageItem.prototype, "id", void 0);
|
|
916
|
-
__decorate$
|
|
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$
|
|
1052
|
+
__decorate$20([
|
|
920
1053
|
Property('')
|
|
921
1054
|
], BackstageItem.prototype, "iconCss", void 0);
|
|
922
|
-
__decorate$
|
|
1055
|
+
__decorate$20([
|
|
923
1056
|
Property(false)
|
|
924
1057
|
], BackstageItem.prototype, "separator", void 0);
|
|
925
|
-
__decorate$
|
|
1058
|
+
__decorate$20([
|
|
926
1059
|
Property(false)
|
|
927
1060
|
], BackstageItem.prototype, "isFooter", void 0);
|
|
928
|
-
__decorate$
|
|
1061
|
+
__decorate$20([
|
|
929
1062
|
Event()
|
|
930
1063
|
], BackstageItem.prototype, "backStageItemClick", void 0);
|
|
931
1064
|
|
|
932
|
-
var __decorate$
|
|
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$
|
|
1085
|
+
__decorate$18([
|
|
953
1086
|
Property('File')
|
|
954
1087
|
], BackStageMenu.prototype, "text", void 0);
|
|
955
|
-
__decorate$
|
|
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$
|
|
1094
|
+
__decorate$18([
|
|
959
1095
|
Property('auto')
|
|
960
1096
|
], BackStageMenu.prototype, "height", void 0);
|
|
961
|
-
__decorate$
|
|
1097
|
+
__decorate$18([
|
|
962
1098
|
Property('auto')
|
|
963
1099
|
], BackStageMenu.prototype, "width", void 0);
|
|
964
|
-
__decorate$
|
|
1100
|
+
__decorate$18([
|
|
965
1101
|
Property(null)
|
|
966
1102
|
], BackStageMenu.prototype, "target", void 0);
|
|
967
|
-
__decorate$
|
|
1103
|
+
__decorate$18([
|
|
968
1104
|
Complex({}, BackstageBackButton)
|
|
969
1105
|
], BackStageMenu.prototype, "backButton", void 0);
|
|
970
|
-
__decorate$
|
|
1106
|
+
__decorate$18([
|
|
971
1107
|
Collection([], BackstageItem)
|
|
972
1108
|
], BackStageMenu.prototype, "items", void 0);
|
|
973
|
-
__decorate$
|
|
1109
|
+
__decorate$18([
|
|
974
1110
|
Property('')
|
|
975
1111
|
], BackStageMenu.prototype, "template", void 0);
|
|
976
|
-
__decorate$
|
|
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:
|
|
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,795 @@ 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
|
-
*
|
|
3563
|
+
* Defines the items of Ribbon.
|
|
3388
3564
|
*/
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
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 '
|
|
3573
|
+
return 'ribbonGallery';
|
|
3574
|
+
}
|
|
3575
|
+
destroy() {
|
|
3576
|
+
this.parent = null;
|
|
3439
3577
|
}
|
|
3440
3578
|
/**
|
|
3441
|
-
*
|
|
3579
|
+
* Creates gallery.
|
|
3442
3580
|
*
|
|
3443
|
-
* @
|
|
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
|
-
|
|
3447
|
-
const
|
|
3448
|
-
|
|
3449
|
-
|
|
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
|
-
|
|
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.itemsModel = [];
|
|
4292
|
+
this.targetTabs = {};
|
|
4293
|
+
this.isAddRemove = false;
|
|
4294
|
+
this.isUpdateItems = false;
|
|
4295
|
+
this.keyConfigs = {
|
|
4296
|
+
leftarrow: 'leftarrow',
|
|
4297
|
+
rightarrow: 'rightarrow',
|
|
4298
|
+
tab: 'tab',
|
|
4299
|
+
shiftTab: 'shift+tab'
|
|
4300
|
+
};
|
|
4301
|
+
}
|
|
4302
|
+
/**
|
|
4303
|
+
* Get the properties to be maintained in the persisted state.
|
|
4304
|
+
*
|
|
4305
|
+
* @returns {string} - Persist data
|
|
4306
|
+
*/
|
|
4307
|
+
getPersistData() {
|
|
4308
|
+
return this.addOnPersist(['activeLayout']);
|
|
4309
|
+
}
|
|
4310
|
+
/**
|
|
4311
|
+
* Get component name.
|
|
4312
|
+
*
|
|
4313
|
+
* @returns {string} - Module name
|
|
4314
|
+
* @private
|
|
4315
|
+
*/
|
|
4316
|
+
getModuleName() {
|
|
4317
|
+
return 'ribbon';
|
|
4318
|
+
}
|
|
4319
|
+
/**
|
|
4320
|
+
* To provide the array of modules needed for component rendering
|
|
4321
|
+
*
|
|
4322
|
+
* @returns {ModuleDeclaration[]} - returns module declaration.
|
|
4323
|
+
* @hidden
|
|
4324
|
+
*/
|
|
4325
|
+
requiredModules() {
|
|
4326
|
+
const modules = [];
|
|
4327
|
+
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' });
|
|
4328
|
+
const canInjectColorPickerModule = getItem(this.tabs, null, RibbonItemType.ColorPicker);
|
|
4329
|
+
const canInjectGalleryModule = getItem(this.tabs, null, RibbonItemType.Gallery);
|
|
4330
|
+
if (canInjectColorPickerModule) {
|
|
4331
|
+
modules.push({ member: 'ribbonColorPicker', args: [this], name: 'RibbonColorPicker' });
|
|
4332
|
+
}
|
|
4333
|
+
if (canInjectGalleryModule) {
|
|
4334
|
+
modules.push({ member: 'ribbonGallery', args: [this], name: 'RibbonGallery' });
|
|
4335
|
+
}
|
|
4336
|
+
if (this.backStageMenu.visible || this.backStageMenu.items.length) {
|
|
4337
|
+
modules.push({ member: 'ribbonBackstage', args: [this], name: 'RibbonBackstage' });
|
|
4338
|
+
}
|
|
4339
|
+
if (this.fileMenu.visible || this.fileMenu.menuItems.length) {
|
|
4340
|
+
modules.push({ member: 'ribbonFileMenu', args: [this], name: 'RibbonFileMenu' });
|
|
4341
|
+
}
|
|
4342
|
+
if (this.contextualTabs.length) {
|
|
4343
|
+
modules.push({ member: 'ribbonContextualTab', args: [this], name: 'RibbonContextualTab' });
|
|
4344
|
+
}
|
|
4345
|
+
if (this.enableKeyTips) {
|
|
4346
|
+
modules.push({ member: 'ribbonKeyTip', args: [this], name: 'RibbonKeyTip' });
|
|
4347
|
+
}
|
|
4348
|
+
return modules;
|
|
4349
|
+
}
|
|
4350
|
+
initialize() {
|
|
3452
4351
|
this.element.id = this.element.id || getUniqueID('e-' + this.getModuleName());
|
|
3453
4352
|
addClass([this.element], ['e-rbn', ...(this.cssClass ? this.cssClass.split(SPACE) : [])]);
|
|
3454
4353
|
if (this.enableRtl) {
|
|
@@ -3456,6 +4355,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3456
4355
|
}
|
|
3457
4356
|
this.element.style.width = formatUnit(this.width);
|
|
3458
4357
|
this.renderTabs();
|
|
4358
|
+
if (this.ribbonContextualTabModule) {
|
|
4359
|
+
this.ribbonContextualTabModule.addContextualTabs();
|
|
4360
|
+
}
|
|
3459
4361
|
if (this.ribbonFileMenuModule) {
|
|
3460
4362
|
this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
|
|
3461
4363
|
}
|
|
@@ -3465,13 +4367,18 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3465
4367
|
this.createHelpPaneTemplate();
|
|
3466
4368
|
const toolbar = this.tabObj['tbObj'];
|
|
3467
4369
|
toolbar.refreshOverflow();
|
|
4370
|
+
this.addTabOverflowKeyTip();
|
|
3468
4371
|
createTooltip(this.element, this);
|
|
4372
|
+
this.isKeytipOpen = false;
|
|
3469
4373
|
this.wireEvents();
|
|
3470
4374
|
this.wireKeyboardEvent();
|
|
3471
4375
|
this.currentControlIndex = 0;
|
|
3472
4376
|
}
|
|
3473
4377
|
wireEvents() {
|
|
3474
4378
|
EventHandler.add(window, 'resize', this.resizeHandler, this);
|
|
4379
|
+
EventHandler.add(document.body, 'keydown', this.keytipActionHandler, this);
|
|
4380
|
+
EventHandler.add(document, 'mousedown', this.mouseEventHandler, this);
|
|
4381
|
+
EventHandler.add(document, 'scroll', this.mouseEventHandler, this);
|
|
3475
4382
|
}
|
|
3476
4383
|
wireKeyboardEvent() {
|
|
3477
4384
|
this.keyboardModuleRibbon = new KeyboardEvents(this.element, {
|
|
@@ -3487,7 +4394,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3487
4394
|
const activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
|
|
3488
4395
|
const controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
|
|
3489
4396
|
const templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
|
|
3490
|
-
const
|
|
4397
|
+
const galleryElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-gallery-item'));
|
|
4398
|
+
const ribbonControls = controlElements.concat(templateElements, galleryElements);
|
|
3491
4399
|
const comboBoxElements = activeContent.querySelectorAll('.e-combobox');
|
|
3492
4400
|
let comboBoxEle;
|
|
3493
4401
|
if (comboBoxElements) {
|
|
@@ -3516,7 +4424,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3516
4424
|
if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
|
|
3517
4425
|
e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
|
|
3518
4426
|
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')) {
|
|
4427
|
+
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
4428
|
switch (e.action) {
|
|
3521
4429
|
case 'rightarrow':
|
|
3522
4430
|
this.handleNavigation(e, !this.enableRtl, ribbonControls);
|
|
@@ -3558,7 +4466,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3558
4466
|
}
|
|
3559
4467
|
}
|
|
3560
4468
|
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')) {
|
|
4469
|
+
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
4470
|
if (enableRtl) {
|
|
3563
4471
|
this.currentControlIndex++;
|
|
3564
4472
|
}
|
|
@@ -3717,6 +4625,111 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3717
4625
|
}
|
|
3718
4626
|
}
|
|
3719
4627
|
}
|
|
4628
|
+
let galleryPopupEle = document.querySelector('.e-ribbon-gallery-popup.e-popup-open');
|
|
4629
|
+
if (galleryPopupEle) {
|
|
4630
|
+
let popup = getComponent(galleryPopupEle, Popup);
|
|
4631
|
+
popup.hide();
|
|
4632
|
+
}
|
|
4633
|
+
if (this.ribbonKeyTipModule && this.enableKeyTips) {
|
|
4634
|
+
this.ribbonKeyTipModule.removeKeytip();
|
|
4635
|
+
}
|
|
4636
|
+
}
|
|
4637
|
+
mouseEventHandler(e) {
|
|
4638
|
+
if (this.ribbonKeyTipModule && this.enableKeyTips) {
|
|
4639
|
+
this.ribbonKeyTipModule.removeKeytip();
|
|
4640
|
+
}
|
|
4641
|
+
}
|
|
4642
|
+
keytipActionHandler(e) {
|
|
4643
|
+
if (this.enableKeyTips) {
|
|
4644
|
+
let isKeyTipPresent = false;
|
|
4645
|
+
const keyPress = e.key;
|
|
4646
|
+
if (e.altKey && e.key === 'Meta') {
|
|
4647
|
+
const activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
|
|
4648
|
+
if (activePopup.length) {
|
|
4649
|
+
for (let i = 0; i < activePopup.length; i++) {
|
|
4650
|
+
const dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
|
|
4651
|
+
dropDownBtn.toggle();
|
|
4652
|
+
}
|
|
4653
|
+
this.ribbonKeyTipModule.removeKeytip();
|
|
4654
|
+
}
|
|
4655
|
+
else {
|
|
4656
|
+
if (!this.isKeytipOpen) {
|
|
4657
|
+
const backstagePopup = document.querySelector('.e-ribbon-backstage-popup');
|
|
4658
|
+
if (backstagePopup && backstagePopup.classList.contains('e-popup-open')) {
|
|
4659
|
+
this.ribbonBackstageModule.hideBackstage();
|
|
4660
|
+
}
|
|
4661
|
+
this.ribbonKeyTipModule.createKeytip('tab');
|
|
4662
|
+
}
|
|
4663
|
+
else {
|
|
4664
|
+
this.ribbonKeyTipModule.removeKeytip();
|
|
4665
|
+
}
|
|
4666
|
+
}
|
|
4667
|
+
}
|
|
4668
|
+
else if (e.key === 'Escape' || e.key === 'Tab' || e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'ArrowRight' || e.key === 'ArrowDown') {
|
|
4669
|
+
this.ribbonKeyTipModule.removeKeytip(e.key);
|
|
4670
|
+
}
|
|
4671
|
+
else {
|
|
4672
|
+
const keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
|
|
4673
|
+
if (keyTipItems) {
|
|
4674
|
+
for (let i = 0; i < keyTipItems.length; i++) {
|
|
4675
|
+
const keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
|
|
4676
|
+
if (keyTipItem.innerHTML.toLowerCase() === keyPress) {
|
|
4677
|
+
isKeyTipPresent = true;
|
|
4678
|
+
this.ribbonKeyTipModule.keytipPress(keyPress);
|
|
4679
|
+
break;
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
if (!isKeyTipPresent) {
|
|
4683
|
+
this.checkKeyTipPresent(keyPress, this.keysPress.length);
|
|
4684
|
+
}
|
|
4685
|
+
}
|
|
4686
|
+
}
|
|
4687
|
+
}
|
|
4688
|
+
}
|
|
4689
|
+
checkKeyTipPresent(keyTip, length) {
|
|
4690
|
+
const keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
|
|
4691
|
+
for (let i = 0; i < keyTipItems.length; i++) {
|
|
4692
|
+
const keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
|
|
4693
|
+
if (keyTipItem.innerHTML.length > 1 && keyTipItem.innerHTML[parseInt(length.toString(), 10)].toLowerCase() === keyTip) {
|
|
4694
|
+
this.keysPress += keyTip;
|
|
4695
|
+
this.ribbonKeyTipModule.keytipPress(this.keysPress);
|
|
4696
|
+
this.removeKeytip(this.keysPress);
|
|
4697
|
+
break;
|
|
4698
|
+
}
|
|
4699
|
+
}
|
|
4700
|
+
}
|
|
4701
|
+
removeKeytip(keyTip) {
|
|
4702
|
+
const keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
|
|
4703
|
+
for (let i = 0; i < keyTipItems.length; i++) {
|
|
4704
|
+
const keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
|
|
4705
|
+
if (keyTipItem.innerHTML[0].toLowerCase() !== keyTip && keyTip !== '') {
|
|
4706
|
+
remove(keyTipItem);
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
}
|
|
4710
|
+
addKeyTip(tabIndex, keyTip, id, type) {
|
|
4711
|
+
if (this.keyTipElements && this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
|
|
4712
|
+
let isKeyTipExist = false;
|
|
4713
|
+
/* eslint-disable */
|
|
4714
|
+
if (!(this.keyTipElements[parseInt(tabIndex.toString(), 10)][type])) {
|
|
4715
|
+
this.keyTipElements[parseInt(tabIndex.toString(), 10)][type] = [];
|
|
4716
|
+
}
|
|
4717
|
+
if (Object.keys(this.keyTipElements[tabIndex][type]).length) {
|
|
4718
|
+
let keytipData = this.keyTipElements[tabIndex][type];
|
|
4719
|
+
for (let i = 0; i < Object.keys(this.keyTipElements[tabIndex][type]).length; i++) {
|
|
4720
|
+
if (keytipData[parseInt(i.toString(), 10)].id === id) {
|
|
4721
|
+
isKeyTipExist = true;
|
|
4722
|
+
}
|
|
4723
|
+
}
|
|
4724
|
+
if (!isKeyTipExist) {
|
|
4725
|
+
this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
|
|
4726
|
+
}
|
|
4727
|
+
}
|
|
4728
|
+
else {
|
|
4729
|
+
this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
|
|
4730
|
+
}
|
|
4731
|
+
/* eslint-enable */
|
|
4732
|
+
}
|
|
3720
4733
|
}
|
|
3721
4734
|
renderTabs() {
|
|
3722
4735
|
this.tabsInternal = this.tabs.slice();
|
|
@@ -3778,14 +4791,33 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3778
4791
|
this.renderInitialTab(this.selectedTab);
|
|
3779
4792
|
}
|
|
3780
4793
|
ribbonTabSelected(e) {
|
|
4794
|
+
e.preventFocus = true;
|
|
3781
4795
|
this.isAddRemove = false;
|
|
3782
4796
|
const selectedTabId = e.selectedItem.getAttribute('data-id');
|
|
3783
4797
|
let selectedIndex = getIndex(this.tabs, ((tab) => (tab.id === selectedTabId)));
|
|
3784
4798
|
selectedIndex = selectedIndex === -1 ? this.selectedTab : selectedIndex;
|
|
3785
|
-
|
|
4799
|
+
let isContextual = this.isContextualTab(selectedTabId);
|
|
4800
|
+
this.updateSelectedState(selectedTabId);
|
|
4801
|
+
const eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex, isContextual: isContextual };
|
|
3786
4802
|
this.setProperties({ selectedTab: selectedIndex }, true);
|
|
3787
4803
|
this.calculateHiddenElementsWidth(selectedIndex);
|
|
4804
|
+
if (this.isUpdateItems) {
|
|
4805
|
+
for (let i = 0; i < this.itemsModel.length; i++) {
|
|
4806
|
+
const item = this.itemsModel[parseInt(i.toString(), 10)];
|
|
4807
|
+
if (this.selectedTab === this.targetTabs[item.id]) {
|
|
4808
|
+
this.updateItem(item);
|
|
4809
|
+
this.itemsModel.splice(i, 1);
|
|
4810
|
+
i--;
|
|
4811
|
+
}
|
|
4812
|
+
}
|
|
4813
|
+
if (this.itemsModel.length === 0) {
|
|
4814
|
+
this.isUpdateItems = false;
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
3788
4817
|
this.checkOverflow(selectedIndex, e.selectedContent.firstChild);
|
|
4818
|
+
if (this.activeLayout === 'Classic' && this.ribbonGalleryModule) {
|
|
4819
|
+
this.ribbonGalleryModule.checkAvailableHeight(selectedIndex, e.selectedContent.firstChild);
|
|
4820
|
+
}
|
|
3789
4821
|
if (this.activeLayout === 'Simplified' && this.overflowDDB) {
|
|
3790
4822
|
const overflowTarget = this.overflowDDB.target;
|
|
3791
4823
|
const ofTabContainer = overflowTarget.querySelector('.' + RIBBON_TAB_ACTIVE);
|
|
@@ -3804,6 +4836,20 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3804
4836
|
}
|
|
3805
4837
|
this.trigger('tabSelected', eventArgs);
|
|
3806
4838
|
}
|
|
4839
|
+
updateSelectedState(tabID) {
|
|
4840
|
+
if (this.contextualTabs.length) {
|
|
4841
|
+
for (let i = 0; i < this.contextualTabs.length; i++) {
|
|
4842
|
+
let isSelected = false;
|
|
4843
|
+
for (let j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
|
|
4844
|
+
if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
|
|
4845
|
+
isSelected = true;
|
|
4846
|
+
break;
|
|
4847
|
+
}
|
|
4848
|
+
}
|
|
4849
|
+
this.contextualTabs[parseInt(i.toString(), 10)].setProperties({ isSelected: isSelected }, true);
|
|
4850
|
+
}
|
|
4851
|
+
}
|
|
4852
|
+
}
|
|
3807
4853
|
checkOverflow(tabIndex, activeContent) {
|
|
3808
4854
|
const tabContent = activeContent.closest('.' + TAB_CONTENT);
|
|
3809
4855
|
const isOverFlow = tabContent.offsetWidth < activeContent.offsetWidth;
|
|
@@ -3853,6 +4899,17 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3853
4899
|
}
|
|
3854
4900
|
}
|
|
3855
4901
|
}
|
|
4902
|
+
this.addTabOverflowKeyTip();
|
|
4903
|
+
}
|
|
4904
|
+
addTabOverflowKeyTip() {
|
|
4905
|
+
const tabOverflow = this.tabObj.element.querySelector('#_nav');
|
|
4906
|
+
if (tabOverflow) {
|
|
4907
|
+
this.keyTipElements['taboverflow'] = [];
|
|
4908
|
+
this.keyTipElements['taboverflow'].push({ id: tabOverflow.id, type: 'taboverflow', keyTip: '00' });
|
|
4909
|
+
}
|
|
4910
|
+
else {
|
|
4911
|
+
delete (this.keyTipElements['taboverflow']);
|
|
4912
|
+
}
|
|
3856
4913
|
}
|
|
3857
4914
|
checkSimplifiedItemShrinking(tabIndex, tabContent, activeContent) {
|
|
3858
4915
|
const tab = this.tabs[parseInt(tabIndex.toString(), 10)];
|
|
@@ -3987,7 +5044,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3987
5044
|
item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
|
|
3988
5045
|
this.setItemSize(itemEle, item);
|
|
3989
5046
|
}
|
|
3990
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
5047
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
3991
5048
|
this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, true);
|
|
3992
5049
|
}
|
|
3993
5050
|
}
|
|
@@ -4017,7 +5074,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4017
5074
|
return isEmptyCollection;
|
|
4018
5075
|
}
|
|
4019
5076
|
updatePopupItems(item, itemEle, isGroupOF, isMenu) {
|
|
4020
|
-
const dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
|
|
5077
|
+
const dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.Gallery || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
|
|
4021
5078
|
const dropDownPopup = dropdown.dropDown;
|
|
4022
5079
|
// popup is on right if (isGroupOF && isMenu)
|
|
4023
5080
|
// The position is reversed if RTL is enabled.
|
|
@@ -4082,7 +5139,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4082
5139
|
break;
|
|
4083
5140
|
}
|
|
4084
5141
|
const groupEle = tabContent.querySelector('#' + collection.id);
|
|
4085
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
5142
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
4086
5143
|
this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
|
|
4087
5144
|
}
|
|
4088
5145
|
groupEle.append(itemContainer);
|
|
@@ -4201,19 +5258,22 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4201
5258
|
}
|
|
4202
5259
|
createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
|
|
4203
5260
|
let overflowButton;
|
|
5261
|
+
let overflowtarget;
|
|
4204
5262
|
const itemProp = getGroup(this.tabs, groupId);
|
|
4205
5263
|
const contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
|
|
4206
5264
|
const groupEle = contentEle.querySelector('#' + groupId);
|
|
4207
5265
|
if (isGroupOF) {
|
|
4208
5266
|
const overflowDDB = groupContainer.querySelector('#' + groupId + GROUPOF_BUTTON_ID);
|
|
4209
5267
|
if (!overflowDDB) {
|
|
4210
|
-
overflowButton = this.addOverflowButton(groupId + GROUPOF_BUTTON_ID);
|
|
5268
|
+
overflowButton = this.addOverflowButton(groupId + GROUPOF_BUTTON_ID, isGroupOF);
|
|
4211
5269
|
overflowButton.element.classList.add(RIBBON_GROUP_OF_BUTTON);
|
|
4212
5270
|
groupContainer.appendChild(overflowButton.element);
|
|
4213
5271
|
}
|
|
4214
5272
|
else {
|
|
4215
5273
|
overflowButton = getInstance(overflowDDB, DropDownButton);
|
|
4216
5274
|
}
|
|
5275
|
+
this.addKeyTip(tabIndex, '0' + (itemProp.groupIndex + 1), overflowButton.element.id, 'grpofbtn');
|
|
5276
|
+
overflowtarget = overflowButton.target;
|
|
4217
5277
|
const overflowBtnTarget = overflowButton.target;
|
|
4218
5278
|
let headerEle = overflowBtnTarget.querySelector('#' + groupId + GROUPOF_BUTTON_ID + HEADER_ID);
|
|
4219
5279
|
if (!headerEle) {
|
|
@@ -4242,7 +5302,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4242
5302
|
}
|
|
4243
5303
|
else {
|
|
4244
5304
|
if (!this.overflowDDB) {
|
|
4245
|
-
this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + OVRLOF_BUTTON_ID);
|
|
5305
|
+
this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + OVRLOF_BUTTON_ID, isGroupOF);
|
|
4246
5306
|
this.tabObj.element.insertBefore(this.overflowDDB.element, this.collapseButton);
|
|
4247
5307
|
this.overflowDDB.element.classList.add(RIBBON_OVERALL_OF_BUTTON);
|
|
4248
5308
|
this.createOfTabContainer(groupId, groupHeader, itemEle, tabIndex);
|
|
@@ -4275,10 +5335,16 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4275
5335
|
}
|
|
4276
5336
|
}
|
|
4277
5337
|
overflowButton = this.overflowDDB;
|
|
5338
|
+
overflowtarget = this.overflowDDB ? this.overflowDDB.target : null;
|
|
4278
5339
|
}
|
|
4279
5340
|
if (itemEle !== null) {
|
|
4280
5341
|
this.addOverflowEvents(item, itemEle, overflowButton);
|
|
4281
5342
|
}
|
|
5343
|
+
if (overflowtarget) {
|
|
5344
|
+
if (item.keyTip) {
|
|
5345
|
+
this.addKeyTip(tabIndex, item.keyTip, item.id, 'popupitem');
|
|
5346
|
+
}
|
|
5347
|
+
}
|
|
4282
5348
|
}
|
|
4283
5349
|
addOverflowEvents(item, itemEle, overflowButton) {
|
|
4284
5350
|
switch (item.type) {
|
|
@@ -4300,6 +5366,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4300
5366
|
case 'ComboBox':
|
|
4301
5367
|
this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
|
|
4302
5368
|
break;
|
|
5369
|
+
case 'Gallery':
|
|
5370
|
+
if (this.activeLayout === 'Simplified') {
|
|
5371
|
+
this.ribbonGalleryModule.addOverFlowEvents(item, itemEle, overflowButton);
|
|
5372
|
+
}
|
|
5373
|
+
break;
|
|
4303
5374
|
case 'GroupButton':
|
|
4304
5375
|
if (this.activeLayout === 'Simplified') {
|
|
4305
5376
|
this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
|
|
@@ -4970,6 +6041,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4970
6041
|
this.checkSmallToMedium(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
|
|
4971
6042
|
this.checkMediumToLarge(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
|
|
4972
6043
|
const dropdown = this.ribbonDropDownModule.createOverFlowDropDown(group.id, group.header, group.groupIconCss, groupContainer, groupOverFlow, this.enableRtl);
|
|
6044
|
+
if (group.keyTip) {
|
|
6045
|
+
const overflowDDB = group.id + OVERFLOW_ID + DROPDOWN_ID;
|
|
6046
|
+
this.addKeyTip(tabIndex, group.keyTip, overflowDDB, 'grpoverflow');
|
|
6047
|
+
}
|
|
4973
6048
|
this.tabs[parseInt(tabIndex.toString(), 10)].
|
|
4974
6049
|
groups[parseInt(groupIndex.toString(), 10)].setProperties({ isCollapsed: true }, true);
|
|
4975
6050
|
for (let j = 0; j < group.collections.length; j++) {
|
|
@@ -4982,6 +6057,25 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4982
6057
|
this.handleContentSize(itemEle);
|
|
4983
6058
|
this.addOverflowEvents(item, itemEle, dropdown);
|
|
4984
6059
|
}
|
|
6060
|
+
const overflowDDB = document.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID);
|
|
6061
|
+
const overflowButton = getInstance(overflowDDB, DropDownButton);
|
|
6062
|
+
if (overflowButton) {
|
|
6063
|
+
const overflowtarget = overflowButton.target;
|
|
6064
|
+
if (overflowtarget) {
|
|
6065
|
+
if (this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
|
|
6066
|
+
if (item.type === RibbonItemType.GroupButton) {
|
|
6067
|
+
for (let i = 0; i < item.groupButtonSettings.items.length; i++) {
|
|
6068
|
+
if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip) {
|
|
6069
|
+
this.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip, item.id + (RIBBON_GROUP_BUTTON_ID + i), 'grpoverflowpopup');
|
|
6070
|
+
}
|
|
6071
|
+
}
|
|
6072
|
+
}
|
|
6073
|
+
if (item.keyTip) {
|
|
6074
|
+
this.addKeyTip(tabIndex, item.keyTip, item.id, 'grpoverflowpopup');
|
|
6075
|
+
}
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6078
|
+
}
|
|
4985
6079
|
}
|
|
4986
6080
|
}
|
|
4987
6081
|
}
|
|
@@ -5066,15 +6160,30 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5066
6160
|
this.removeOverflowDropdown(activeContent, tabContent, true, index);
|
|
5067
6161
|
}
|
|
5068
6162
|
}
|
|
6163
|
+
isContextualTab(tabID) {
|
|
6164
|
+
let isContextual = false;
|
|
6165
|
+
if (this.contextualTabs.length) {
|
|
6166
|
+
for (let i = 0; i < this.contextualTabs.length; i++) {
|
|
6167
|
+
for (let j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
|
|
6168
|
+
if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
|
|
6169
|
+
isContextual = true;
|
|
6170
|
+
break;
|
|
6171
|
+
}
|
|
6172
|
+
}
|
|
6173
|
+
}
|
|
6174
|
+
}
|
|
6175
|
+
return isContextual;
|
|
6176
|
+
}
|
|
5069
6177
|
ribbonTabSelecting(e) {
|
|
5070
6178
|
this.currentControlIndex = 0;
|
|
5071
6179
|
const nextTabId = e.selectingItem.getAttribute('data-id');
|
|
5072
6180
|
const previousTabId = e.previousItem.getAttribute('data-id');
|
|
5073
6181
|
let nextIndex = getIndex(this.tabs, ((tab) => (tab.id === nextTabId)));
|
|
6182
|
+
let isContextual = this.isContextualTab(nextTabId);
|
|
5074
6183
|
const previousIndex = getIndex(this.tabs, ((tab) => (tab.id === previousTabId)));
|
|
5075
6184
|
nextIndex = nextIndex === -1 ? this.selectedTab : nextIndex;
|
|
5076
6185
|
const eventArgs = {
|
|
5077
|
-
cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex
|
|
6186
|
+
cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex, isContextual: isContextual
|
|
5078
6187
|
};
|
|
5079
6188
|
this.trigger('tabSelecting', eventArgs, (args) => {
|
|
5080
6189
|
if (args.cancel) {
|
|
@@ -5099,6 +6208,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5099
6208
|
innerHTML: ribbonTab.header,
|
|
5100
6209
|
id: ribbonTab.id + HEADER_ID
|
|
5101
6210
|
});
|
|
6211
|
+
const tabIndex = getIndex(this.tabs, ((tab) => (tab.id === ribbonTab.id)));
|
|
6212
|
+
if (ribbonTab.keyTip) {
|
|
6213
|
+
if (!this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
|
|
6214
|
+
this.keyTipElements[parseInt(tabIndex.toString(), 10)] = {};
|
|
6215
|
+
}
|
|
6216
|
+
this.addKeyTip(tabIndex, ribbonTab.keyTip, ribbonTab.id, 'tab');
|
|
6217
|
+
}
|
|
5102
6218
|
header.onclick = () => { this.minimize(false); };
|
|
5103
6219
|
header.ondblclick = () => { this.minimize(true); };
|
|
5104
6220
|
const tab = { header: { text: header }, id: ribbonTab.id, cssClass: ribbonTab.cssClass };
|
|
@@ -5121,8 +6237,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5121
6237
|
}
|
|
5122
6238
|
const activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
|
|
5123
6239
|
this.checkOverflow(this.selectedTab, activeContent);
|
|
6240
|
+
if (this.activeLayout === 'Classic' && this.ribbonGalleryModule)
|
|
6241
|
+
this.ribbonGalleryModule.checkAvailableHeight(this.selectedTab, activeContent);
|
|
5124
6242
|
}
|
|
5125
|
-
addOverflowButton(btnId) {
|
|
6243
|
+
addOverflowButton(btnId, isGroupOF) {
|
|
5126
6244
|
const overflowButton = this.createElement('button', {
|
|
5127
6245
|
id: btnId
|
|
5128
6246
|
});
|
|
@@ -5158,6 +6276,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5158
6276
|
}, overflowButton);
|
|
5159
6277
|
this.element.classList.add(RIBBON_OVERFLOW);
|
|
5160
6278
|
createTooltip(overflowTarget, this);
|
|
6279
|
+
if (!isGroupOF) {
|
|
6280
|
+
this.keyTipElements['overflowbtn'] = [];
|
|
6281
|
+
this.keyTipElements['overflowbtn'].push({ id: btnId, type: 'overflowbtn', keyTip: '00' });
|
|
6282
|
+
}
|
|
5161
6283
|
let isGroupOf;
|
|
5162
6284
|
overflowButton.onkeydown = overflowButton.onclick = () => { this.itemIndex = -1; isGroupOf = overflowButton.classList.contains('e-ribbon-overall-of-btn') ? false : true; };
|
|
5163
6285
|
overflowTarget.onkeydown = (e) => (this.upDownKeyHandler(e, overflowTarget, isGroupOf), this);
|
|
@@ -5318,6 +6440,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5318
6440
|
case 'ComboBox':
|
|
5319
6441
|
this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
|
|
5320
6442
|
break;
|
|
6443
|
+
case 'Gallery':
|
|
6444
|
+
this.ribbonGalleryModule.removeOverFlowEvents(item, itemEle);
|
|
6445
|
+
break;
|
|
5321
6446
|
case 'GroupButton':
|
|
5322
6447
|
this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
|
|
5323
6448
|
break;
|
|
@@ -5354,6 +6479,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5354
6479
|
this.collapseButton.classList.add(RIBBON_EXPAND_BUTTON);
|
|
5355
6480
|
}
|
|
5356
6481
|
this.tabObj.element.appendChild(this.collapseButton);
|
|
6482
|
+
if (this.layoutSwitcherKeyTip) {
|
|
6483
|
+
this.keyTipElements['collapse'] = [];
|
|
6484
|
+
this.keyTipElements['collapse'].push({ id: this.collapseButton.id, type: 'collapse', keyTip: this.layoutSwitcherKeyTip });
|
|
6485
|
+
}
|
|
5357
6486
|
}
|
|
5358
6487
|
removeExpandCollapse() {
|
|
5359
6488
|
const index = getIndex(this.tooltipData, (e) => { return e.id === this.collapseButton.id; });
|
|
@@ -5513,7 +6642,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5513
6642
|
itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
|
|
5514
6643
|
if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
|
|
5515
6644
|
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)) {
|
|
6645
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
5517
6646
|
this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
|
|
5518
6647
|
}
|
|
5519
6648
|
}
|
|
@@ -5526,6 +6655,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5526
6655
|
this.setItemSize(ele, item);
|
|
5527
6656
|
}
|
|
5528
6657
|
}
|
|
6658
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
6659
|
+
this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
|
|
6660
|
+
}
|
|
5529
6661
|
}
|
|
5530
6662
|
}
|
|
5531
6663
|
if (!(group.enableGroupOverflow || groupEle.querySelector('.' + RIBBON_ITEM))) {
|
|
@@ -5609,7 +6741,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5609
6741
|
let itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
|
|
5610
6742
|
if (!itemEle && overflowtarget) {
|
|
5611
6743
|
itemEle = overflowtarget.querySelector('#' + item.id + CONTAINER_ID);
|
|
5612
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
6744
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
5613
6745
|
this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
|
|
5614
6746
|
}
|
|
5615
6747
|
this.removeOverflowEvent(item, itemEle);
|
|
@@ -5629,6 +6761,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5629
6761
|
(item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
|
|
5630
6762
|
item.setProperties({ activeSize: itemsize }, true);
|
|
5631
6763
|
this.setItemSize(ele, item);
|
|
6764
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
6765
|
+
this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
|
|
6766
|
+
}
|
|
5632
6767
|
}
|
|
5633
6768
|
if (group.enableGroupOverflow && overflowDDB) {
|
|
5634
6769
|
if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
|
|
@@ -5648,7 +6783,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5648
6783
|
this.overflowDDB = null;
|
|
5649
6784
|
}
|
|
5650
6785
|
}
|
|
5651
|
-
createLauncherIcon(groupId, groupContainer) {
|
|
6786
|
+
createLauncherIcon(groupId, groupContainer, tabIndex) {
|
|
5652
6787
|
const launcherIcon = this.createElement('div', {
|
|
5653
6788
|
className: RIBBON_LAUNCHER_ICON_ELE + ' ' + (this.launcherIconCss ? this.launcherIconCss : RIBBON_LAUNCHER_ICON),
|
|
5654
6789
|
id: groupId + LAUNCHER_ID,
|
|
@@ -5662,6 +6797,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5662
6797
|
this.launcherIconClicked(groupId);
|
|
5663
6798
|
}
|
|
5664
6799
|
}, this);
|
|
6800
|
+
const itemProp = getGroup(this.tabs, groupId);
|
|
6801
|
+
if (itemProp.group.launcherIconKeyTip) {
|
|
6802
|
+
this.addKeyTip(tabIndex, itemProp.group.launcherIconKeyTip, launcherIcon.id, 'launcher');
|
|
6803
|
+
}
|
|
5665
6804
|
}
|
|
5666
6805
|
launcherIconClicked(id) {
|
|
5667
6806
|
const eventArgs = { groupId: id };
|
|
@@ -5699,7 +6838,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5699
6838
|
groupContainer.appendChild(groupHeader);
|
|
5700
6839
|
}
|
|
5701
6840
|
if (group.showLauncherIcon) {
|
|
5702
|
-
this.createLauncherIcon(group.id, groupContainer);
|
|
6841
|
+
this.createLauncherIcon(group.id, groupContainer, tabIndex);
|
|
5703
6842
|
}
|
|
5704
6843
|
const elements = this.createCollection(group.collections, group.orientation, group.id, group.header, group.enableGroupOverflow, tabIndex, groupContainer);
|
|
5705
6844
|
append(elements, groupContent);
|
|
@@ -5826,6 +6965,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5826
6965
|
case 'GroupButton':
|
|
5827
6966
|
this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
|
|
5828
6967
|
break;
|
|
6968
|
+
case 'Gallery':
|
|
6969
|
+
this.ribbonGalleryModule.createGallery(item, itemEle);
|
|
6970
|
+
break;
|
|
5829
6971
|
}
|
|
5830
6972
|
}
|
|
5831
6973
|
createItems(itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
|
|
@@ -5858,17 +7000,34 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5858
7000
|
itemEle.classList.add(RIBBON_TOOLTIP_TARGET);
|
|
5859
7001
|
this.tooltipData.push({ id: itemEle.id, data: item.ribbonTooltipSettings });
|
|
5860
7002
|
}
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
7003
|
+
if (item.type === RibbonItemType.GroupButton) {
|
|
7004
|
+
for (let i = 0; i < item.groupButtonSettings.items.length; i++) {
|
|
7005
|
+
if (this.keyTipElements[parseInt(tabIndex.toString(), 10)] && item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip) {
|
|
7006
|
+
this.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip, item.id + (RIBBON_GROUP_BUTTON_ID + i), 'item');
|
|
7007
|
+
}
|
|
7008
|
+
}
|
|
5866
7009
|
}
|
|
5867
|
-
if (
|
|
5868
|
-
|
|
7010
|
+
if (item.keyTip) {
|
|
7011
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
7012
|
+
this.addKeyTip(tabIndex, item.keyTip, (item.id + '_popupButton'), 'item');
|
|
7013
|
+
}
|
|
7014
|
+
else {
|
|
7015
|
+
this.addKeyTip(tabIndex, item.keyTip, item.id, 'item');
|
|
7016
|
+
}
|
|
5869
7017
|
}
|
|
5870
|
-
|
|
5871
|
-
|
|
7018
|
+
let size = item.activeSize;
|
|
7019
|
+
if (!(item.type === RibbonItemType.Gallery)) {
|
|
7020
|
+
if (this.activeLayout === 'Simplified') {
|
|
7021
|
+
size = ((item.allowedSizes === RibbonItemSize.Large) || (item.allowedSizes & RibbonItemSize.Medium) ||
|
|
7022
|
+
(item.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
|
|
7023
|
+
item.setProperties({ activeSize: size }, true);
|
|
7024
|
+
}
|
|
7025
|
+
if (size & RibbonItemSize.Large) {
|
|
7026
|
+
itemEle.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
|
|
7027
|
+
}
|
|
7028
|
+
else {
|
|
7029
|
+
itemEle.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
|
|
7030
|
+
}
|
|
5872
7031
|
}
|
|
5873
7032
|
const initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
|
|
5874
7033
|
if (initialProps && initialProps.hiddenItems && initialProps.hiddenItems.length) {
|
|
@@ -5880,7 +7039,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5880
7039
|
this.createRibbonItem(item, itemEle);
|
|
5881
7040
|
if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
|
|
5882
7041
|
this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
|
|
5883
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
7042
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
5884
7043
|
this.updatePopupItems(item, itemEle, isGroupOF, true);
|
|
5885
7044
|
}
|
|
5886
7045
|
}
|
|
@@ -6071,12 +7230,18 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6071
7230
|
ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
|
|
6072
7231
|
contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
|
|
6073
7232
|
}
|
|
7233
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
7234
|
+
ele = contentEle.querySelector('#' + item.id + CONTAINER_ID);
|
|
7235
|
+
}
|
|
6074
7236
|
}
|
|
6075
7237
|
}
|
|
6076
7238
|
else {
|
|
6077
7239
|
//Checks for Simplified and Auto options (Auto = classic + simplified + popup)
|
|
6078
7240
|
ele = (item.displayOptions & DisplayMode.Simplified) ?
|
|
6079
7241
|
contentEle.querySelector('#' + item.id) : null;
|
|
7242
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
7243
|
+
ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id + CONTAINER_ID) : null;
|
|
7244
|
+
}
|
|
6080
7245
|
// element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
|
|
6081
7246
|
if (!ele) {
|
|
6082
7247
|
ele = dropdown ? dropdown.target.querySelector('#' + item.id) : null;
|
|
@@ -6127,6 +7292,30 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6127
7292
|
}
|
|
6128
7293
|
}
|
|
6129
7294
|
}
|
|
7295
|
+
else if (moduleName === 'gallery') {
|
|
7296
|
+
if (ele.closest('.e-ribbon-overflow-target')) {
|
|
7297
|
+
destroyControl(ele, 'dropdown-btn');
|
|
7298
|
+
let galleryPopupEle = Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '_galleryPopup'));
|
|
7299
|
+
galleryPopupEle.concat(Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '-popup')));
|
|
7300
|
+
for (let i = 0; i < galleryPopupEle.length; i++) {
|
|
7301
|
+
galleryPopupEle[parseInt(i.toString(), 10)].remove();
|
|
7302
|
+
}
|
|
7303
|
+
}
|
|
7304
|
+
else {
|
|
7305
|
+
let galleryEle = ele.querySelectorAll('.e-ribbon-gallery-item');
|
|
7306
|
+
let galleryPopupBtn = ele.querySelector('#' + item.id + '_popupButton');
|
|
7307
|
+
if (galleryPopupBtn) {
|
|
7308
|
+
galleryPopupBtn.remove();
|
|
7309
|
+
}
|
|
7310
|
+
for (let i = 0; i < galleryEle.length; i++) {
|
|
7311
|
+
galleryEle[parseInt(i.toString(), 10)].remove();
|
|
7312
|
+
}
|
|
7313
|
+
let galleryPopupEle = document.querySelectorAll('#' + item.id + '_galleryPopup');
|
|
7314
|
+
for (let i = 0; i < galleryPopupEle.length; i++) {
|
|
7315
|
+
galleryPopupEle[parseInt(i.toString(), 10)].remove();
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
}
|
|
6130
7319
|
else if (moduleName !== 'template') {
|
|
6131
7320
|
destroyControl(ele, moduleName);
|
|
6132
7321
|
}
|
|
@@ -6140,6 +7329,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6140
7329
|
this.ribbonGroupButtonModule.destroyDropDown(item);
|
|
6141
7330
|
}
|
|
6142
7331
|
}
|
|
7332
|
+
/**
|
|
7333
|
+
* Gets the item module name.
|
|
7334
|
+
*
|
|
7335
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
7336
|
+
* @returns {void}
|
|
7337
|
+
* @hidden
|
|
7338
|
+
*/
|
|
6143
7339
|
getItemModuleName(item) {
|
|
6144
7340
|
switch (item.type) {
|
|
6145
7341
|
case 'Button':
|
|
@@ -6156,6 +7352,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6156
7352
|
return 'combobox';
|
|
6157
7353
|
case 'GroupButton':
|
|
6158
7354
|
return 'group-btn';
|
|
7355
|
+
case 'Gallery':
|
|
7356
|
+
return 'gallery';
|
|
6159
7357
|
default:
|
|
6160
7358
|
return 'template';
|
|
6161
7359
|
}
|
|
@@ -6195,8 +7393,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6195
7393
|
* @param {string} tabId - The ID of the tab to be shown.
|
|
6196
7394
|
* @returns {void}
|
|
6197
7395
|
*/
|
|
6198
|
-
showTab(tabId) {
|
|
6199
|
-
this.showHideTab(tabId, false);
|
|
7396
|
+
showTab(tabId, isContextual = false) {
|
|
7397
|
+
this.showHideTab(tabId, false, isContextual);
|
|
6200
7398
|
}
|
|
6201
7399
|
/**
|
|
6202
7400
|
* Hides a specific tab in the ribbon.
|
|
@@ -6204,15 +7402,44 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6204
7402
|
* @param {string} tabId - The ID of the tab to be hidden.
|
|
6205
7403
|
* @returns {void}
|
|
6206
7404
|
*/
|
|
6207
|
-
hideTab(tabId) {
|
|
6208
|
-
this.showHideTab(tabId, true);
|
|
7405
|
+
hideTab(tabId, isContextual = false) {
|
|
7406
|
+
this.showHideTab(tabId, true, isContextual);
|
|
6209
7407
|
}
|
|
6210
|
-
showHideTab(tabId, value) {
|
|
7408
|
+
showHideTab(tabId, value, isContextual) {
|
|
6211
7409
|
const index = getIndex(this.tabs, (e) => { return e.id === tabId; });
|
|
6212
7410
|
if (index === -1) {
|
|
6213
7411
|
return;
|
|
6214
7412
|
}
|
|
6215
7413
|
this.tabObj.hideTab(index, value);
|
|
7414
|
+
if (isContextual) {
|
|
7415
|
+
let contextualTab;
|
|
7416
|
+
const tabEle = this.tabObj.element;
|
|
7417
|
+
for (let i = 0; i < this.contextualTabs.length; i++) {
|
|
7418
|
+
for (let j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
|
|
7419
|
+
if (tabId === this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id) {
|
|
7420
|
+
contextualTab = this.contextualTabs[parseInt(i.toString(), 10)];
|
|
7421
|
+
}
|
|
7422
|
+
}
|
|
7423
|
+
}
|
|
7424
|
+
if (contextualTab) {
|
|
7425
|
+
let isTabHidden = true;
|
|
7426
|
+
for (let i = 0; i < contextualTab.tabs.length; i++) {
|
|
7427
|
+
const index = getIndex(this.tabs, (e) => { return e.id === contextualTab.tabs[parseInt(i.toString(), 10)].id; });
|
|
7428
|
+
if (index !== -1) {
|
|
7429
|
+
const toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index.toString(), 10)];
|
|
7430
|
+
if (!(toolbarEle.classList.contains('e-hidden'))) {
|
|
7431
|
+
isTabHidden = false;
|
|
7432
|
+
}
|
|
7433
|
+
}
|
|
7434
|
+
}
|
|
7435
|
+
if (isTabHidden) {
|
|
7436
|
+
contextualTab.setProperties({ visible: false }, true);
|
|
7437
|
+
}
|
|
7438
|
+
else {
|
|
7439
|
+
contextualTab.setProperties({ visible: true }, true);
|
|
7440
|
+
}
|
|
7441
|
+
}
|
|
7442
|
+
}
|
|
6216
7443
|
}
|
|
6217
7444
|
/**
|
|
6218
7445
|
* Enables a specific tab in the ribbon.
|
|
@@ -7215,7 +8442,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7215
8442
|
if (contentEle.innerHTML !== '') {
|
|
7216
8443
|
// Check whether showLauncherIcon or orientation is passed by the user and sets the updated values.
|
|
7217
8444
|
if (group.showLauncherIcon) {
|
|
7218
|
-
this.createLauncherIcon(ribbongroup.id, groupContainer);
|
|
8445
|
+
this.createLauncherIcon(ribbongroup.id, groupContainer, itemProp.tabIndex);
|
|
7219
8446
|
}
|
|
7220
8447
|
// Check whether collections or orientation is passed by the user and sets the updated values.
|
|
7221
8448
|
if (group.collections || group.orientation) {
|
|
@@ -7334,96 +8561,111 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7334
8561
|
//Check whether the tab items are rendered
|
|
7335
8562
|
const contentEle = this.tabObj.items[itemProp.tabIndex].content;
|
|
7336
8563
|
const groupEle = contentEle.querySelector('#' + itemProp.group.id);
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
if (
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
collectionEle
|
|
8564
|
+
if (groupEle) {
|
|
8565
|
+
const groupContainer = groupEle.querySelector('#' + itemProp.group.id + CONTAINER_ID);
|
|
8566
|
+
let itemContainer = null;
|
|
8567
|
+
let itemEle = null;
|
|
8568
|
+
let dropdownElement;
|
|
8569
|
+
let dropdown;
|
|
8570
|
+
if (contentEle.innerHTML !== '') {
|
|
8571
|
+
if (this.activeLayout === RibbonLayout.Simplified) {
|
|
8572
|
+
dropdownElement = itemProp.group.enableGroupOverflow ?
|
|
8573
|
+
contentEle.querySelector('#' + itemProp.group.id + GROUPOF_BUTTON_ID) : null;
|
|
8574
|
+
dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
|
|
8575
|
+
}
|
|
8576
|
+
if (this.activeLayout === RibbonLayout.Simplified && itemProp.item.displayOptions === DisplayMode.Overflow) {
|
|
8577
|
+
itemContainer = dropdown.target.querySelector('#' + itemId + CONTAINER_ID);
|
|
8578
|
+
itemEle = dropdown.target.querySelector('#' + itemId);
|
|
8579
|
+
if (item.displayOptions && item.displayOptions !== DisplayMode.Overflow) {
|
|
8580
|
+
const collectionEle = groupContainer.querySelector('#' + itemProp.collection.id);
|
|
8581
|
+
if (collectionEle) {
|
|
8582
|
+
collectionEle.appendChild(itemContainer);
|
|
8583
|
+
}
|
|
7355
8584
|
}
|
|
7356
8585
|
}
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
8586
|
+
else {
|
|
8587
|
+
itemContainer = groupContainer.querySelector('#' + itemId + CONTAINER_ID);
|
|
8588
|
+
itemEle = contentEle.querySelector('#' + itemId);
|
|
8589
|
+
if (itemProp.item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Classic) {
|
|
8590
|
+
itemEle = contentEle.querySelector('#' + itemId + RIBBON_GROUP_BUTTON_ID);
|
|
8591
|
+
}
|
|
8592
|
+
if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
|
|
8593
|
+
this.createOverflowPopup(itemProp.item, itemProp.tabIndex, itemProp.group.enableGroupOverflow, itemProp.group.id, itemProp.group.header, itemContainer, groupContainer);
|
|
8594
|
+
if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) ||
|
|
8595
|
+
(item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
8596
|
+
this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
|
|
8597
|
+
}
|
|
8598
|
+
}
|
|
7363
8599
|
}
|
|
7364
|
-
if
|
|
7365
|
-
|
|
7366
|
-
if (
|
|
7367
|
-
|
|
8600
|
+
// Check whether cssClass is passed by the user, and if it is, then remove the old values.
|
|
8601
|
+
if (item.cssClass) {
|
|
8602
|
+
if (itemProp.item.cssClass) {
|
|
8603
|
+
itemContainer.classList.remove(itemProp.item.cssClass);
|
|
7368
8604
|
}
|
|
7369
8605
|
}
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
if (
|
|
7374
|
-
itemContainer
|
|
8606
|
+
this.destroyFunction(itemProp.item, itemEle);
|
|
8607
|
+
itemEle.remove();
|
|
8608
|
+
const removeCss = itemContainer.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g);
|
|
8609
|
+
if (removeCss) {
|
|
8610
|
+
removeClass([itemContainer], removeCss);
|
|
7375
8611
|
}
|
|
7376
8612
|
}
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
if (
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
}
|
|
7384
|
-
const ribbonItem = itemProp.item;
|
|
7385
|
-
ribbonItem.setProperties(item, true);
|
|
7386
|
-
this.validateItemSize();
|
|
7387
|
-
if (contentEle.innerHTML !== '') {
|
|
7388
|
-
if (!(this.activeLayout === RibbonLayout.Simplified && ribbonItem.displayOptions === DisplayMode.Overflow)) {
|
|
7389
|
-
itemContainer = groupContainer.querySelector('#' + itemId + CONTAINER_ID);
|
|
7390
|
-
}
|
|
7391
|
-
else {
|
|
7392
|
-
itemContainer = dropdown.target.querySelector('#' + itemId + CONTAINER_ID);
|
|
7393
|
-
}
|
|
7394
|
-
// To avoid undefined items condition is added
|
|
7395
|
-
if (ribbonItem.ribbonTooltipSettings && isTooltipPresent(ribbonItem.ribbonTooltipSettings)) {
|
|
7396
|
-
itemContainer.classList.add(RIBBON_TOOLTIP_TARGET);
|
|
7397
|
-
this.tooltipData.push({ id: itemContainer.id, data: ribbonItem.ribbonTooltipSettings });
|
|
7398
|
-
}
|
|
7399
|
-
let size = ribbonItem.activeSize;
|
|
7400
|
-
if (this.activeLayout === 'Simplified') {
|
|
7401
|
-
size = ((ribbonItem.allowedSizes === RibbonItemSize.Large) || (ribbonItem.allowedSizes & RibbonItemSize.Medium) ||
|
|
7402
|
-
(ribbonItem.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
|
|
7403
|
-
ribbonItem.setProperties({ activeSize: size }, true);
|
|
7404
|
-
}
|
|
7405
|
-
if (size & RibbonItemSize.Large) {
|
|
7406
|
-
itemContainer.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
|
|
7407
|
-
}
|
|
7408
|
-
else {
|
|
7409
|
-
itemContainer.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
|
|
7410
|
-
}
|
|
7411
|
-
this.createRibbonItem(ribbonItem, itemContainer);
|
|
7412
|
-
if (this.activeLayout === 'Simplified' && itemProp.group.enableGroupOverflow) {
|
|
7413
|
-
if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
7414
|
-
this.removeOverflowButton(dropdown);
|
|
8613
|
+
const ribbonItem = itemProp.item;
|
|
8614
|
+
ribbonItem.setProperties(item, true);
|
|
8615
|
+
this.validateItemSize();
|
|
8616
|
+
if (contentEle.innerHTML !== '') {
|
|
8617
|
+
if (!(this.activeLayout === RibbonLayout.Simplified && ribbonItem.displayOptions === DisplayMode.Overflow)) {
|
|
8618
|
+
itemContainer = groupContainer.querySelector('#' + itemId + CONTAINER_ID);
|
|
7415
8619
|
}
|
|
8620
|
+
else {
|
|
8621
|
+
itemContainer = dropdown.target.querySelector('#' + itemId + CONTAINER_ID);
|
|
8622
|
+
}
|
|
8623
|
+
// To avoid undefined items condition is added
|
|
8624
|
+
if (ribbonItem.ribbonTooltipSettings && isTooltipPresent(ribbonItem.ribbonTooltipSettings)) {
|
|
8625
|
+
itemContainer.classList.add(RIBBON_TOOLTIP_TARGET);
|
|
8626
|
+
this.tooltipData.push({ id: itemContainer.id, data: ribbonItem.ribbonTooltipSettings });
|
|
8627
|
+
}
|
|
8628
|
+
let size = ribbonItem.activeSize;
|
|
8629
|
+
if (this.activeLayout === 'Simplified') {
|
|
8630
|
+
size = ((ribbonItem.allowedSizes === RibbonItemSize.Large) || (ribbonItem.allowedSizes & RibbonItemSize.Medium) ||
|
|
8631
|
+
(ribbonItem.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
|
|
8632
|
+
ribbonItem.setProperties({ activeSize: size }, true);
|
|
8633
|
+
}
|
|
8634
|
+
if (size & RibbonItemSize.Large) {
|
|
8635
|
+
itemContainer.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
|
|
8636
|
+
}
|
|
8637
|
+
else {
|
|
8638
|
+
if (size & RibbonItemSize.Medium) {
|
|
8639
|
+
itemContainer.classList.add(RIBBON_MEDIUM_ITEM);
|
|
8640
|
+
}
|
|
8641
|
+
else {
|
|
8642
|
+
itemContainer.classList.add(RIBBON_SMALL_ITEM);
|
|
8643
|
+
}
|
|
8644
|
+
}
|
|
8645
|
+
this.createRibbonItem(ribbonItem, itemContainer);
|
|
8646
|
+
if (this.activeLayout === 'Simplified' && itemProp.group.enableGroupOverflow) {
|
|
8647
|
+
if (dropdown.target.childElementCount === 0 ||
|
|
8648
|
+
(dropdown.target.childElementCount === 1 &&
|
|
8649
|
+
this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
8650
|
+
this.removeOverflowButton(dropdown);
|
|
8651
|
+
}
|
|
8652
|
+
}
|
|
8653
|
+
if (this.selectedTab === itemProp.tabIndex) {
|
|
8654
|
+
this.refreshLayout();
|
|
8655
|
+
}
|
|
8656
|
+
if (item.cssClass) {
|
|
8657
|
+
itemContainer.classList.add(ribbonItem.cssClass);
|
|
8658
|
+
}
|
|
8659
|
+
if (!(ribbonItem.disabled) && itemContainer.classList.contains(DISABLED_CSS)) {
|
|
8660
|
+
itemContainer.classList.remove(DISABLED_CSS);
|
|
8661
|
+
}
|
|
8662
|
+
this.enableDisableItem(ribbonItem.id, ribbonItem.disabled);
|
|
7416
8663
|
}
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
}
|
|
7423
|
-
if (!(ribbonItem.disabled) && itemContainer.classList.contains(DISABLED_CSS)) {
|
|
7424
|
-
itemContainer.classList.remove(DISABLED_CSS);
|
|
7425
|
-
}
|
|
7426
|
-
this.enableDisableItem(ribbonItem.id, ribbonItem.disabled);
|
|
8664
|
+
}
|
|
8665
|
+
else {
|
|
8666
|
+
this.isUpdateItems = true;
|
|
8667
|
+
this.itemsModel.push(item);
|
|
8668
|
+
this.targetTabs[item.id] = itemProp.tabIndex;
|
|
7427
8669
|
}
|
|
7428
8670
|
}
|
|
7429
8671
|
removeItemElement(contentEle, item, dropdown) {
|
|
@@ -7470,6 +8712,15 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7470
8712
|
disableItem(itemId) {
|
|
7471
8713
|
this.enableDisableItem(itemId, true);
|
|
7472
8714
|
}
|
|
8715
|
+
/**
|
|
8716
|
+
* Gets the Ribbon item model associated with the specified item ID.
|
|
8717
|
+
*
|
|
8718
|
+
* @param {string} itemId - The unique ID of the Ribbon item.
|
|
8719
|
+
* @returns {RibbonItemModel}
|
|
8720
|
+
*/
|
|
8721
|
+
getItem(itemId) {
|
|
8722
|
+
return getItem(this.tabs, itemId).item;
|
|
8723
|
+
}
|
|
7473
8724
|
enableDisableItem(itemId, isDisabled) {
|
|
7474
8725
|
let isUpdated = false;
|
|
7475
8726
|
const itemProp = getItem(this.tabs, itemId);
|
|
@@ -7517,6 +8768,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7517
8768
|
}
|
|
7518
8769
|
unwireEvents() {
|
|
7519
8770
|
EventHandler.remove(window, 'resize', this.resizeHandler);
|
|
8771
|
+
EventHandler.remove(document.body, 'keydown', this.keytipActionHandler);
|
|
8772
|
+
EventHandler.remove(document, 'mousedown', this.mouseEventHandler);
|
|
8773
|
+
EventHandler.remove(document, 'scroll', this.mouseEventHandler);
|
|
7520
8774
|
}
|
|
7521
8775
|
destroy() {
|
|
7522
8776
|
this.keyboardModuleRibbon.destroy();
|
|
@@ -7544,6 +8798,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7544
8798
|
this.initialPropsData = {};
|
|
7545
8799
|
this.hiddenGroups = [];
|
|
7546
8800
|
this.hiddenElements = {};
|
|
8801
|
+
this.keyTipElements = {};
|
|
8802
|
+
this.itemsModel = [];
|
|
8803
|
+
this.targetTabs = {};
|
|
7547
8804
|
remove(this.element.querySelector('#' + this.element.id + TAB_ID));
|
|
7548
8805
|
this.element.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
|
|
7549
8806
|
this.element.style.removeProperty(RIBBON_HELP_PANE_TEMPLATE_WIDTH);
|
|
@@ -7620,7 +8877,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7620
8877
|
}
|
|
7621
8878
|
break;
|
|
7622
8879
|
case 'selectedTab':
|
|
7623
|
-
this.tabObj.
|
|
8880
|
+
const tabEle = this.tabObj.element;
|
|
8881
|
+
const toolbarItem = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(newProp.selectedTab.toString(), 10)];
|
|
8882
|
+
if (!(toolbarItem.classList.contains('e-hidden') || toolbarItem.classList.contains('e-disable'))) {
|
|
8883
|
+
this.tabObj.setProperties({ selectedItem: newProp.selectedTab });
|
|
8884
|
+
}
|
|
7624
8885
|
break;
|
|
7625
8886
|
case 'tabAnimation':
|
|
7626
8887
|
this.tabObj.setProperties({ animation: newProp.tabAnimation });
|
|
@@ -7628,6 +8889,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7628
8889
|
case 'tabs':
|
|
7629
8890
|
this.reRenderTabs(newProp.tabs);
|
|
7630
8891
|
break;
|
|
8892
|
+
case 'contextualTabs':
|
|
8893
|
+
for (let i = 0; i < this.contextualTabs.length; i++) {
|
|
8894
|
+
if (newProp.contextualTabs[parseInt(i.toString(), 10)]) {
|
|
8895
|
+
this.ribbonContextualTabModule.updateContextualTabs(newProp.contextualTabs[parseInt(i.toString(), 10)], this.contextualTabs[parseInt(i.toString(), 10)]);
|
|
8896
|
+
}
|
|
8897
|
+
}
|
|
8898
|
+
break;
|
|
7631
8899
|
case 'width':
|
|
7632
8900
|
this.element.style.width = formatUnit(newProp.width);
|
|
7633
8901
|
this.refreshLayout();
|
|
@@ -7671,6 +8939,12 @@ __decorate([
|
|
|
7671
8939
|
__decorate([
|
|
7672
8940
|
Property('')
|
|
7673
8941
|
], Ribbon.prototype, "cssClass", void 0);
|
|
8942
|
+
__decorate([
|
|
8943
|
+
Property(false)
|
|
8944
|
+
], Ribbon.prototype, "enableKeyTips", void 0);
|
|
8945
|
+
__decorate([
|
|
8946
|
+
Property('')
|
|
8947
|
+
], Ribbon.prototype, "layoutSwitcherKeyTip", void 0);
|
|
7674
8948
|
__decorate([
|
|
7675
8949
|
Complex({}, FileMenuSettings)
|
|
7676
8950
|
], Ribbon.prototype, "fileMenu", void 0);
|
|
@@ -7695,6 +8969,9 @@ __decorate([
|
|
|
7695
8969
|
__decorate([
|
|
7696
8970
|
Collection([], RibbonTab)
|
|
7697
8971
|
], Ribbon.prototype, "tabs", void 0);
|
|
8972
|
+
__decorate([
|
|
8973
|
+
Collection([], RibbonContextualTabSettings)
|
|
8974
|
+
], Ribbon.prototype, "contextualTabs", void 0);
|
|
7698
8975
|
__decorate([
|
|
7699
8976
|
Property('100%')
|
|
7700
8977
|
], Ribbon.prototype, "width", void 0);
|
|
@@ -7789,6 +9066,7 @@ class RibbonFileMenu {
|
|
|
7789
9066
|
}
|
|
7790
9067
|
this.parent.tabObj.refreshActiveTabBorder();
|
|
7791
9068
|
this.addFileMenuTooltip(fileMenuOptions);
|
|
9069
|
+
this.addFileMenuKeytip();
|
|
7792
9070
|
}
|
|
7793
9071
|
addFileMenuTooltip(fileMenuOptions) {
|
|
7794
9072
|
if (isTooltipPresent(fileMenuOptions.ribbonTooltipSettings)) {
|
|
@@ -7796,6 +9074,12 @@ class RibbonFileMenu {
|
|
|
7796
9074
|
this.parent.tooltipData.push({ id: this.ddbElement.id, data: fileMenuOptions.ribbonTooltipSettings });
|
|
7797
9075
|
}
|
|
7798
9076
|
}
|
|
9077
|
+
addFileMenuKeytip() {
|
|
9078
|
+
if (this.parent.fileMenu.keyTip) {
|
|
9079
|
+
this.parent.keyTipElements['filemenu'] = [];
|
|
9080
|
+
this.parent.keyTipElements['filemenu'].push({ id: this.ddbElement.id, type: 'filemenu', keyTip: this.parent.fileMenu.keyTip });
|
|
9081
|
+
}
|
|
9082
|
+
}
|
|
7799
9083
|
ddbBeforeEvent(isOpen, args) {
|
|
7800
9084
|
//args.event is null when dropdown button is closed using a method call
|
|
7801
9085
|
if (!isOpen && args.event && args.event.target.closest('.e-ribbon-menu')) {
|
|
@@ -7947,7 +9231,9 @@ class RibbonFileMenu {
|
|
|
7947
9231
|
}
|
|
7948
9232
|
}
|
|
7949
9233
|
this.removeFileMenuTooltip();
|
|
9234
|
+
this.removeFileMenuKeytip();
|
|
7950
9235
|
this.addFileMenuTooltip(fileMenuOptions);
|
|
9236
|
+
this.addFileMenuKeytip();
|
|
7951
9237
|
}
|
|
7952
9238
|
else {
|
|
7953
9239
|
this.createFileMenu(fileMenuOptions);
|
|
@@ -7966,6 +9252,7 @@ class RibbonFileMenu {
|
|
|
7966
9252
|
}
|
|
7967
9253
|
destroyDDB() {
|
|
7968
9254
|
this.removeFileMenuTooltip();
|
|
9255
|
+
this.removeFileMenuKeytip();
|
|
7969
9256
|
const tabEle = this.parent.tabObj.element;
|
|
7970
9257
|
tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
|
|
7971
9258
|
this.destroyMenu();
|
|
@@ -7981,6 +9268,14 @@ class RibbonFileMenu {
|
|
|
7981
9268
|
this.parent.tooltipData.splice(index, 1);
|
|
7982
9269
|
}
|
|
7983
9270
|
}
|
|
9271
|
+
removeFileMenuKeytip() {
|
|
9272
|
+
if (this.parent.keyTipElements['filemenu']) {
|
|
9273
|
+
const index = getIndex(this.parent.keyTipElements['filemenu'], (e) => { return e.id === this.ddbElement.id; });
|
|
9274
|
+
if (index !== -1) {
|
|
9275
|
+
this.parent.keyTipElements['filemenu'].splice(index, 1);
|
|
9276
|
+
}
|
|
9277
|
+
}
|
|
9278
|
+
}
|
|
7984
9279
|
/**
|
|
7985
9280
|
* Add items to FileMenu.
|
|
7986
9281
|
*
|
|
@@ -8170,6 +9465,7 @@ class RibbonBackstage extends Component {
|
|
|
8170
9465
|
};
|
|
8171
9466
|
this.parent.tabObj.refreshActiveTabBorder();
|
|
8172
9467
|
this.addBackStageMenuTooltip(backStageOptions);
|
|
9468
|
+
this.addBackStageMenuKeyTip(backStageOptions);
|
|
8173
9469
|
EventHandler.add(document, 'click', this.onClickEvent, this);
|
|
8174
9470
|
}
|
|
8175
9471
|
onClickEvent(e) {
|
|
@@ -8187,6 +9483,24 @@ class RibbonBackstage extends Component {
|
|
|
8187
9483
|
this.parent.tooltipData.push({ id: this.backstageButtonEle.id, data: backStageOptions.ribbonTooltipSettings });
|
|
8188
9484
|
}
|
|
8189
9485
|
}
|
|
9486
|
+
addBackStageMenuKeyTip(backStageOptions) {
|
|
9487
|
+
if (backStageOptions.keyTip) {
|
|
9488
|
+
if (!(this.parent.keyTipElements['backstage'])) {
|
|
9489
|
+
this.parent.keyTipElements['backstage'] = [];
|
|
9490
|
+
}
|
|
9491
|
+
this.parent.keyTipElements['backstage'].push({ id: this.backstageButtonEle.id, type: 'backstage', keyTip: backStageOptions.keyTip });
|
|
9492
|
+
}
|
|
9493
|
+
if (backStageOptions.items && backStageOptions.items.length) {
|
|
9494
|
+
if (!(this.parent.keyTipElements['backstageMenu'])) {
|
|
9495
|
+
this.parent.keyTipElements['backstageMenu'] = [];
|
|
9496
|
+
}
|
|
9497
|
+
for (let i = 0; i < backStageOptions.items.length; i++) {
|
|
9498
|
+
if (backStageOptions.items[parseInt(i.toString(), 10)].keyTip) {
|
|
9499
|
+
this.parent.keyTipElements['backstageMenu'].push({ id: backStageOptions.items[parseInt(i.toString(), 10)].id, type: 'backstageMenu', keyTip: backStageOptions.items[parseInt(i.toString(), 10)].keyTip });
|
|
9500
|
+
}
|
|
9501
|
+
}
|
|
9502
|
+
}
|
|
9503
|
+
}
|
|
8190
9504
|
checkMenuItems(backStageItems) {
|
|
8191
9505
|
for (let i = 0; i < backStageItems.length; i++) {
|
|
8192
9506
|
const item = backStageItems[parseInt(i.toString(), 10)];
|
|
@@ -8475,7 +9789,9 @@ class RibbonBackstage extends Component {
|
|
|
8475
9789
|
}
|
|
8476
9790
|
}
|
|
8477
9791
|
this.removeBackstageMenuTooltip();
|
|
9792
|
+
this.removeBackstageMenuKeyTip();
|
|
8478
9793
|
this.addBackStageMenuTooltip(backStageOptions);
|
|
9794
|
+
this.addBackStageMenuKeyTip(backStageOptions);
|
|
8479
9795
|
}
|
|
8480
9796
|
else {
|
|
8481
9797
|
this.createBackStage(backStageOptions);
|
|
@@ -8494,6 +9810,7 @@ class RibbonBackstage extends Component {
|
|
|
8494
9810
|
}
|
|
8495
9811
|
destroyDDB() {
|
|
8496
9812
|
this.removeBackstageMenuTooltip();
|
|
9813
|
+
this.removeBackstageMenuKeyTip();
|
|
8497
9814
|
const tabEle = this.parent.tabObj.element;
|
|
8498
9815
|
tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
|
|
8499
9816
|
this.destroyMenu();
|
|
@@ -8510,6 +9827,20 @@ class RibbonBackstage extends Component {
|
|
|
8510
9827
|
this.parent.tooltipData.splice(index, 1);
|
|
8511
9828
|
}
|
|
8512
9829
|
}
|
|
9830
|
+
removeBackstageMenuKeyTip() {
|
|
9831
|
+
if (this.parent.keyTipElements['backstage'] && this.parent.keyTipElements['backstage'].length) {
|
|
9832
|
+
const index = getIndex(this.parent.keyTipElements['backstage'], (e) => { return e.id === this.backstageButtonEle.id; });
|
|
9833
|
+
if (index !== -1) {
|
|
9834
|
+
this.parent.keyTipElements['backstage'].splice(index, 1);
|
|
9835
|
+
}
|
|
9836
|
+
}
|
|
9837
|
+
if (this.parent.keyTipElements['backstageMenu'] && this.parent.keyTipElements['backstageMenu'].length) {
|
|
9838
|
+
for (let i = 0; i < this.parent.keyTipElements['backstageMenu'].length; i++) {
|
|
9839
|
+
this.parent.keyTipElements['backstageMenu'].splice(i, 1);
|
|
9840
|
+
i--;
|
|
9841
|
+
}
|
|
9842
|
+
}
|
|
9843
|
+
}
|
|
8513
9844
|
/**
|
|
8514
9845
|
* Add items to Backstage Menu.
|
|
8515
9846
|
*
|
|
@@ -8577,6 +9908,622 @@ class RibbonBackstage extends Component {
|
|
|
8577
9908
|
}
|
|
8578
9909
|
}
|
|
8579
9910
|
|
|
9911
|
+
/**
|
|
9912
|
+
* Defines the ribbon contextual tab.
|
|
9913
|
+
*/
|
|
9914
|
+
class RibbonContextualTab {
|
|
9915
|
+
constructor(parent) {
|
|
9916
|
+
this.parent = parent;
|
|
9917
|
+
}
|
|
9918
|
+
getModuleName() {
|
|
9919
|
+
return 'ribbonContextualTab';
|
|
9920
|
+
}
|
|
9921
|
+
destroy() {
|
|
9922
|
+
this.parent = null;
|
|
9923
|
+
}
|
|
9924
|
+
/**
|
|
9925
|
+
* Creates Contextual tab.
|
|
9926
|
+
*
|
|
9927
|
+
* @returns {void}
|
|
9928
|
+
* @hidden
|
|
9929
|
+
*/
|
|
9930
|
+
addContextualTabs() {
|
|
9931
|
+
let isSelected = false;
|
|
9932
|
+
for (let n = 0; n < this.parent.contextualTabs.length; n++) {
|
|
9933
|
+
for (let i = 0; i < this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs.length; i++) {
|
|
9934
|
+
this.parent.addTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[parseInt(i.toString(), 10)]);
|
|
9935
|
+
const index = this.parent.tabs.length - 1;
|
|
9936
|
+
const tabEle = this.parent.tabObj.element;
|
|
9937
|
+
const toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index.toString(), 10)];
|
|
9938
|
+
toolbarEle.classList.add(RIBBON_CONTEXTUAL_TAB);
|
|
9939
|
+
toolbarEle.classList.add('e-hidden');
|
|
9940
|
+
if (this.parent.contextualTabs[parseInt(n.toString(), 10)].visible) {
|
|
9941
|
+
this.parent.showTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[parseInt(i.toString(), 10)].id, true);
|
|
9942
|
+
if (this.parent.contextualTabs[parseInt(n.toString(), 10)].isSelected && !isSelected) {
|
|
9943
|
+
this.parent.selectTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[0].id);
|
|
9944
|
+
isSelected = true;
|
|
9945
|
+
}
|
|
9946
|
+
}
|
|
9947
|
+
}
|
|
9948
|
+
}
|
|
9949
|
+
}
|
|
9950
|
+
/**
|
|
9951
|
+
* Updates Contextual tab.
|
|
9952
|
+
*
|
|
9953
|
+
* @param {RibbonContextualTabSettingsModel} newProp - Specifies new properties.
|
|
9954
|
+
* @param {RibbonContextualTabSettingsModel} contextualTab - Gets the property of contextual tab.
|
|
9955
|
+
* @returns {void}
|
|
9956
|
+
* @hidden
|
|
9957
|
+
*/
|
|
9958
|
+
updateContextualTabs(newProp, contextualTab) {
|
|
9959
|
+
if (!(isNullOrUndefined(newProp.visible))) {
|
|
9960
|
+
for (let i = 0; i < contextualTab.tabs.length; i++) {
|
|
9961
|
+
if (newProp.visible) {
|
|
9962
|
+
this.parent.showTab(contextualTab.tabs[parseInt(i.toString(), 10)].id, true);
|
|
9963
|
+
}
|
|
9964
|
+
else {
|
|
9965
|
+
this.parent.hideTab(contextualTab.tabs[parseInt(i.toString(), 10)].id, true);
|
|
9966
|
+
}
|
|
9967
|
+
}
|
|
9968
|
+
}
|
|
9969
|
+
if (!(isNullOrUndefined(newProp.isSelected))) {
|
|
9970
|
+
if (newProp.isSelected && contextualTab.visible) {
|
|
9971
|
+
this.parent.selectTab(contextualTab.tabs[0].id);
|
|
9972
|
+
}
|
|
9973
|
+
else {
|
|
9974
|
+
const tabEle = this.parent.tabObj.element;
|
|
9975
|
+
for (let i = 0; i < this.parent.tabs.length; i++) {
|
|
9976
|
+
const toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(i.toString(), 10)];
|
|
9977
|
+
if (!(toolbarEle.classList.contains('e-hidden') || toolbarEle.classList.contains('e-disable'))) {
|
|
9978
|
+
this.parent.selectTab(this.parent.tabs[parseInt(i.toString(), 10)].id);
|
|
9979
|
+
break;
|
|
9980
|
+
}
|
|
9981
|
+
}
|
|
9982
|
+
}
|
|
9983
|
+
}
|
|
9984
|
+
if (newProp.tabs) {
|
|
9985
|
+
for (const key in newProp.tabs) {
|
|
9986
|
+
let index = parseInt(key, 10);
|
|
9987
|
+
const tab = this.parent.tabs.filter((e) => e.id === contextualTab.tabs[parseInt(index.toString(), 10)].id)[0];
|
|
9988
|
+
this.parent.updateTab(tab);
|
|
9989
|
+
}
|
|
9990
|
+
}
|
|
9991
|
+
}
|
|
9992
|
+
}
|
|
9993
|
+
|
|
9994
|
+
/**
|
|
9995
|
+
* Defines the keytip of Ribbon.
|
|
9996
|
+
*/
|
|
9997
|
+
class RibbonKeyTip {
|
|
9998
|
+
constructor(parent) {
|
|
9999
|
+
this.isKeytipPopupOpen = false;
|
|
10000
|
+
this.parent = parent;
|
|
10001
|
+
}
|
|
10002
|
+
getModuleName() {
|
|
10003
|
+
return 'ribbonKeyTip';
|
|
10004
|
+
}
|
|
10005
|
+
destroy() {
|
|
10006
|
+
this.parent = null;
|
|
10007
|
+
}
|
|
10008
|
+
/**
|
|
10009
|
+
* Creates the keytips.
|
|
10010
|
+
*
|
|
10011
|
+
* @param {string} key - get's the keytip type.
|
|
10012
|
+
* @returns {void}
|
|
10013
|
+
* @hidden
|
|
10014
|
+
*/
|
|
10015
|
+
createKeytip(key) {
|
|
10016
|
+
if (this.parent.keyTipElements) {
|
|
10017
|
+
let keytipData;
|
|
10018
|
+
if (key === 'tab') {
|
|
10019
|
+
for (let i = 0; i < this.parent.tabs.length; i++) {
|
|
10020
|
+
if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
|
|
10021
|
+
// eslint-disable-next-line
|
|
10022
|
+
keytipData = this.parent.keyTipElements[i][key];
|
|
10023
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'tab', 'center', 'bottom', true);
|
|
10024
|
+
}
|
|
10025
|
+
}
|
|
10026
|
+
if (this.parent.keyTipElements['filemenu']) {
|
|
10027
|
+
keytipData = this.parent.keyTipElements['filemenu'];
|
|
10028
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'filemenu');
|
|
10029
|
+
}
|
|
10030
|
+
if (this.parent.keyTipElements['backstage']) {
|
|
10031
|
+
keytipData = this.parent.keyTipElements['backstage'];
|
|
10032
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'backstage');
|
|
10033
|
+
}
|
|
10034
|
+
if (this.parent.keyTipElements['collapse']) {
|
|
10035
|
+
keytipData = this.parent.keyTipElements['collapse'];
|
|
10036
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'collapse');
|
|
10037
|
+
}
|
|
10038
|
+
if (this.parent.keyTipElements['taboverflow']) {
|
|
10039
|
+
keytipData = this.parent.keyTipElements['taboverflow'];
|
|
10040
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'taboverflow');
|
|
10041
|
+
}
|
|
10042
|
+
}
|
|
10043
|
+
else if (key === 'popupitem') {
|
|
10044
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['popupitem']) {
|
|
10045
|
+
const popupKeyTipData = this.parent.keyTipElements[this.parent.selectedTab]['popupitem'];
|
|
10046
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['popupitem']).length; i++) {
|
|
10047
|
+
this.createKeyTipElement((popupKeyTipData[parseInt(i.toString(), 10)].id), popupKeyTipData[parseInt(i.toString(), 10)].keyTip, 'popupitem', 'left', 'top', false, true);
|
|
10048
|
+
}
|
|
10049
|
+
}
|
|
10050
|
+
}
|
|
10051
|
+
else if (key === 'backstageMenu') {
|
|
10052
|
+
if (this.parent.keyTipElements['backstageMenu']) {
|
|
10053
|
+
const backstageKeyTipData = this.parent.keyTipElements['backstageMenu'];
|
|
10054
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements['backstageMenu']).length; i++) {
|
|
10055
|
+
this.createKeyTipElement((backstageKeyTipData[parseInt(i.toString(), 10)].id), backstageKeyTipData[parseInt(i.toString(), 10)].keyTip, 'backstageMenu', 'left', 'center');
|
|
10056
|
+
}
|
|
10057
|
+
}
|
|
10058
|
+
}
|
|
10059
|
+
else if (key === 'grpoverflowpopup' && this.parent.activeLayout === 'Classic') {
|
|
10060
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['grpoverflowpopup']) {
|
|
10061
|
+
this.calculateItemPosition(key);
|
|
10062
|
+
}
|
|
10063
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['launcher']) {
|
|
10064
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['launcher']).length; i++) {
|
|
10065
|
+
keytipData = this.parent.keyTipElements[this.parent.selectedTab]['launcher'];
|
|
10066
|
+
this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'launcher', 'center', 'bottom', false, true);
|
|
10067
|
+
}
|
|
10068
|
+
}
|
|
10069
|
+
}
|
|
10070
|
+
else {
|
|
10071
|
+
this.calculateItemPosition(key);
|
|
10072
|
+
if (this.parent.activeLayout === 'Classic') {
|
|
10073
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['launcher']) {
|
|
10074
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['launcher']).length; i++) {
|
|
10075
|
+
keytipData = this.parent.keyTipElements[this.parent.selectedTab]['launcher'];
|
|
10076
|
+
this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'launcher');
|
|
10077
|
+
}
|
|
10078
|
+
}
|
|
10079
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow']) {
|
|
10080
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow']).length; i++) {
|
|
10081
|
+
keytipData = this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow'];
|
|
10082
|
+
this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'grpoverflow');
|
|
10083
|
+
}
|
|
10084
|
+
}
|
|
10085
|
+
}
|
|
10086
|
+
if (this.parent.activeLayout === 'Simplified') {
|
|
10087
|
+
if (this.parent.keyTipElements['overflowbtn']) {
|
|
10088
|
+
keytipData = this.parent.keyTipElements['overflowbtn'];
|
|
10089
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'overflowbtn');
|
|
10090
|
+
}
|
|
10091
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn']) {
|
|
10092
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn']).length; i++) {
|
|
10093
|
+
keytipData = this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn'];
|
|
10094
|
+
this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'grpofbtn');
|
|
10095
|
+
}
|
|
10096
|
+
}
|
|
10097
|
+
}
|
|
10098
|
+
}
|
|
10099
|
+
}
|
|
10100
|
+
}
|
|
10101
|
+
calculateItemPosition(key, isMethod = false, keyTip) {
|
|
10102
|
+
let xOffset;
|
|
10103
|
+
let yOffset;
|
|
10104
|
+
let keytipData;
|
|
10105
|
+
/* eslint-disable */
|
|
10106
|
+
keytipData = this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(), 10)][key];
|
|
10107
|
+
if (keytipData) {
|
|
10108
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(), 10)][key]).length; i++) {
|
|
10109
|
+
/* eslint-enable */
|
|
10110
|
+
if ((isMethod && (keytipData[parseInt(i.toString(), 10)].keyTip === keyTip)) || !isMethod) {
|
|
10111
|
+
let itemID = keytipData[parseInt(i.toString(), 10)].id;
|
|
10112
|
+
if (keytipData[parseInt(i.toString(), 10)].id.includes("_grpbtn")) {
|
|
10113
|
+
itemID = keytipData[parseInt(i.toString(), 10)].id.replace(/_grpbtn\d+/, '');
|
|
10114
|
+
}
|
|
10115
|
+
const itemProp = getItem(this.parent.tabs, itemID);
|
|
10116
|
+
if (itemProp && itemProp.group.orientation === 'Column' && itemProp.collection.items.length > 1 && this.parent.activeLayout !== 'Simplified') {
|
|
10117
|
+
if (itemProp.itemIndex === 0) {
|
|
10118
|
+
xOffset = 'center';
|
|
10119
|
+
yOffset = 'top';
|
|
10120
|
+
}
|
|
10121
|
+
else if (itemProp.itemIndex === 1) {
|
|
10122
|
+
xOffset = 'center';
|
|
10123
|
+
yOffset = 'center';
|
|
10124
|
+
}
|
|
10125
|
+
else {
|
|
10126
|
+
xOffset = 'center';
|
|
10127
|
+
yOffset = 'bottom';
|
|
10128
|
+
}
|
|
10129
|
+
}
|
|
10130
|
+
else if (itemProp && itemProp.group.orientation === 'Row' && itemProp.group.collections.length > 1 && this.parent.activeLayout !== 'Simplified') {
|
|
10131
|
+
if (itemProp.collectionIndex === 0) {
|
|
10132
|
+
xOffset = 'center';
|
|
10133
|
+
yOffset = 'top';
|
|
10134
|
+
}
|
|
10135
|
+
else {
|
|
10136
|
+
xOffset = 'center';
|
|
10137
|
+
yOffset = 'bottom';
|
|
10138
|
+
}
|
|
10139
|
+
}
|
|
10140
|
+
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);
|
|
10141
|
+
}
|
|
10142
|
+
}
|
|
10143
|
+
}
|
|
10144
|
+
}
|
|
10145
|
+
createKeyTipElement(id, keyTip, type, xOffset = 'center', yOffset = 'bottom', isTab = false, isPopUpItem = false) {
|
|
10146
|
+
let keyEle = document.querySelector('#' + id);
|
|
10147
|
+
let isPopUpPresent = false;
|
|
10148
|
+
let splitBtnID;
|
|
10149
|
+
if (isTab) {
|
|
10150
|
+
keyEle = document.querySelector('#' + id + HEADER_ID);
|
|
10151
|
+
}
|
|
10152
|
+
if (keyEle) {
|
|
10153
|
+
if (keyEle.closest('.e-ribbon-group-overflow-ddb')) {
|
|
10154
|
+
isPopUpPresent = true;
|
|
10155
|
+
}
|
|
10156
|
+
if ((isTab && isPopUpItem) && keyEle.closest('.e-toolbar-pop')) {
|
|
10157
|
+
isPopUpPresent = true;
|
|
10158
|
+
}
|
|
10159
|
+
if (keyEle.closest('.e-split-btn-wrapper')) {
|
|
10160
|
+
let splitBtn = keyEle.closest('.e-split-btn-wrapper');
|
|
10161
|
+
splitBtnID = splitBtn.closest('.e-ribbon-item').id;
|
|
10162
|
+
}
|
|
10163
|
+
else {
|
|
10164
|
+
if (keyEle.closest('.e-colorpicker-wrapper')) {
|
|
10165
|
+
keyEle = keyEle.closest('.e-colorpicker-wrapper');
|
|
10166
|
+
splitBtnID = keyEle.closest('.e-ribbon-item').id;
|
|
10167
|
+
}
|
|
10168
|
+
}
|
|
10169
|
+
}
|
|
10170
|
+
if ((keyEle && keyEle.offsetParent) || (isTab && isPopUpItem)) {
|
|
10171
|
+
if ((isPopUpItem && isPopUpPresent) || !isPopUpItem) {
|
|
10172
|
+
const keytipElement = this.parent.createElement('div', {
|
|
10173
|
+
className: RIBBON_KEYTIP,
|
|
10174
|
+
id: id + RIBBON_KEYTIP_ID
|
|
10175
|
+
});
|
|
10176
|
+
document.body.append(keytipElement);
|
|
10177
|
+
const keytipPopup = new Popup(keytipElement, {
|
|
10178
|
+
relateTo: '#' + (isTab ? id + HEADER_ID : splitBtnID ? splitBtnID : id),
|
|
10179
|
+
content: keyTip,
|
|
10180
|
+
collision: { X: 'fit', Y: 'flip' },
|
|
10181
|
+
targetType: 'relative',
|
|
10182
|
+
position: { X: xOffset, Y: yOffset },
|
|
10183
|
+
enableRtl: this.parent.enableRtl
|
|
10184
|
+
});
|
|
10185
|
+
keytipPopup.show();
|
|
10186
|
+
this.calculateKeyTipPosition(keyEle, keytipElement, type, yOffset, (isTab && isPopUpItem));
|
|
10187
|
+
this.parent.isKeytipOpen = true;
|
|
10188
|
+
}
|
|
10189
|
+
}
|
|
10190
|
+
}
|
|
10191
|
+
calculateKeyTipPosition(itemEle, keytipElement, type, yOffset, isTabOverflow = false) {
|
|
10192
|
+
const position = itemEle.getBoundingClientRect();
|
|
10193
|
+
if (type === 'backstageMenu') {
|
|
10194
|
+
keytipElement.style.top = position.top + ((keytipElement.offsetHeight) / 2) + 'px';
|
|
10195
|
+
keytipElement.style.left = position.left + (itemEle.offsetWidth / 5) + 'px';
|
|
10196
|
+
}
|
|
10197
|
+
else {
|
|
10198
|
+
if (type !== 'popupitem') {
|
|
10199
|
+
keytipElement.style.left = position.left + (position.width - keytipElement.offsetWidth) / 2 + 'px';
|
|
10200
|
+
}
|
|
10201
|
+
}
|
|
10202
|
+
if (type === 'filemenu' || type === 'backstage') {
|
|
10203
|
+
keytipElement.style.top = position.top + ((itemEle.offsetHeight - (itemEle.offsetHeight / 3)) + (keytipElement.offsetHeight / 6)) + 'px';
|
|
10204
|
+
}
|
|
10205
|
+
else if ((type === 'item' && yOffset === 'top')) {
|
|
10206
|
+
keytipElement.style.top = (position.top - (itemEle.offsetHeight) / 2) + 'px';
|
|
10207
|
+
}
|
|
10208
|
+
}
|
|
10209
|
+
/**
|
|
10210
|
+
* Performs keytip action.
|
|
10211
|
+
*
|
|
10212
|
+
* @param {string} keyPress - Gets the keytip text.
|
|
10213
|
+
* @returns {void}
|
|
10214
|
+
* @hidden
|
|
10215
|
+
*/
|
|
10216
|
+
keytipPress(keyPress, isMethod = false) {
|
|
10217
|
+
this.isKeytipPresent = false;
|
|
10218
|
+
for (let i = 0; ((i < Object.keys(this.parent.keyTipElements).length) && !this.isKeytipPresent); i++) {
|
|
10219
|
+
if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
|
|
10220
|
+
for (let j = 0; ((j < Object.keys(this.parent.keyTipElements[parseInt(i.toString(), 10)]).length) && !this.isKeytipPresent); j++) {
|
|
10221
|
+
let keytipData = this.parent.keyTipElements[parseInt(i.toString(), 10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(), 10)])[parseInt(j.toString(), 10)]];
|
|
10222
|
+
for (let k = 0; ((k < keytipData.length) && !this.isKeytipPresent); k++) {
|
|
10223
|
+
if (keyPress.toUpperCase() === keytipData[parseInt(k.toString(), 10)].keyTip) {
|
|
10224
|
+
const keyTipElement = document.querySelector('#' + keytipData[parseInt(k.toString(), 10)].id + RIBBON_KEYTIP_ID);
|
|
10225
|
+
if (keyTipElement || isMethod) {
|
|
10226
|
+
this.isKeytipPresent = true;
|
|
10227
|
+
this.removeKeytip();
|
|
10228
|
+
if (keytipData[parseInt(k.toString(), 10)].type === 'tab') {
|
|
10229
|
+
if (i !== this.parent.selectedTab) {
|
|
10230
|
+
this.parent.tabObj.select(i);
|
|
10231
|
+
setTimeout(() => {
|
|
10232
|
+
const tabOverflow = this.parent.tabObj.element.querySelector('.e-nav-active');
|
|
10233
|
+
if (tabOverflow)
|
|
10234
|
+
tabOverflow.click();
|
|
10235
|
+
this.createKeytip('item');
|
|
10236
|
+
}, 600);
|
|
10237
|
+
}
|
|
10238
|
+
else {
|
|
10239
|
+
this.createKeytip('item');
|
|
10240
|
+
}
|
|
10241
|
+
}
|
|
10242
|
+
else {
|
|
10243
|
+
if (keytipData[parseInt(k.toString(), 10)].type === 'item' || keytipData[parseInt(k.toString(), 10)].type === 'grpoverflowpopup' || keytipData[parseInt(k.toString(), 10)].type === 'popupitem') {
|
|
10244
|
+
if (document.getElementById(keytipData[parseInt(k.toString(), 10)].id) && document.getElementById(keytipData[parseInt(k.toString(), 10)].id).classList.contains('e-ribbon-group-button')) {
|
|
10245
|
+
document.getElementById(keytipData[parseInt(k.toString(), 10)].id).click();
|
|
10246
|
+
}
|
|
10247
|
+
else {
|
|
10248
|
+
let itemProp;
|
|
10249
|
+
if ((keytipData[parseInt(k.toString(), 10)].id).includes("_popupButton")) {
|
|
10250
|
+
const galleryID = keytipData[parseInt(k.toString(), 10)].id.replace(/_popupButton/g, '');
|
|
10251
|
+
itemProp = getItem(this.parent.tabs, galleryID);
|
|
10252
|
+
}
|
|
10253
|
+
else {
|
|
10254
|
+
itemProp = getItem(this.parent.tabs, keytipData[parseInt(k.toString(), 10)].id);
|
|
10255
|
+
}
|
|
10256
|
+
if (!isMethod || (isMethod && itemProp.tabIndex === this.parent.selectedTab)) {
|
|
10257
|
+
this.clickItems(itemProp, keytipData, k, false, isMethod);
|
|
10258
|
+
}
|
|
10259
|
+
}
|
|
10260
|
+
}
|
|
10261
|
+
else if (keytipData[parseInt(k.toString(), 10)].type === 'grpoverflow' || keytipData[parseInt(k.toString(), 10)].type === 'grpofbtn' || keytipData[parseInt(k.toString(), 10)].type === 'launcher') {
|
|
10262
|
+
const keyEle = document.querySelector('#' + keytipData[parseInt(k.toString(), 10)].id);
|
|
10263
|
+
this.removeKeytip();
|
|
10264
|
+
if (keyEle) {
|
|
10265
|
+
let groupID = keytipData[parseInt(k.toString(), 10)].id;
|
|
10266
|
+
if (isMethod) {
|
|
10267
|
+
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")) {
|
|
10268
|
+
groupID = keytipData[parseInt(k.toString(), 10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g, '');
|
|
10269
|
+
const itemProp = getGroup(this.parent.tabs, groupID);
|
|
10270
|
+
if (itemProp.tabIndex === this.parent.selectedTab) {
|
|
10271
|
+
this.clickItems(itemProp, keytipData, k, true, isMethod, keyEle);
|
|
10272
|
+
}
|
|
10273
|
+
}
|
|
10274
|
+
}
|
|
10275
|
+
else {
|
|
10276
|
+
this.clickItems(null, keytipData, k, true, isMethod, keyEle);
|
|
10277
|
+
}
|
|
10278
|
+
}
|
|
10279
|
+
}
|
|
10280
|
+
}
|
|
10281
|
+
}
|
|
10282
|
+
}
|
|
10283
|
+
}
|
|
10284
|
+
}
|
|
10285
|
+
}
|
|
10286
|
+
else {
|
|
10287
|
+
if (this.parent.keyTipElements) {
|
|
10288
|
+
this.commonItemsKeyTipPress(keyPress, Object.keys(this.parent.keyTipElements)[parseInt(i.toString(), 10)], isMethod);
|
|
10289
|
+
}
|
|
10290
|
+
}
|
|
10291
|
+
}
|
|
10292
|
+
}
|
|
10293
|
+
clickItems(itemProp, keytipData, k, isGroupItems, isMethod, keyEle) {
|
|
10294
|
+
if (isGroupItems) {
|
|
10295
|
+
keyEle.click();
|
|
10296
|
+
if (!(keytipData[parseInt(k.toString(), 10)].type === 'launcher')) {
|
|
10297
|
+
this.isKeytipPopupOpen = true;
|
|
10298
|
+
keytipData[parseInt(k.toString(), 10)].type === 'grpoverflow' ? this.createKeytip('grpoverflowpopup') : this.createKeytip('popupitem');
|
|
10299
|
+
}
|
|
10300
|
+
}
|
|
10301
|
+
else {
|
|
10302
|
+
let itemID = keytipData[parseInt(k.toString(), 10)].id;
|
|
10303
|
+
if (document.querySelector('#' + itemID) && isMethod) {
|
|
10304
|
+
if (this.parent.activeLayout === 'Simplified') {
|
|
10305
|
+
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')) {
|
|
10306
|
+
document.querySelector('#' + itemProp.group.id + '_sim_grp_overflow').click();
|
|
10307
|
+
}
|
|
10308
|
+
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')) {
|
|
10309
|
+
document.querySelector('#' + this.parent.tabObj.element.id + OVRLOF_BUTTON_ID).click();
|
|
10310
|
+
}
|
|
10311
|
+
}
|
|
10312
|
+
else {
|
|
10313
|
+
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')) {
|
|
10314
|
+
document.querySelector('#' + itemProp.group.id + OVERFLOW_ID + DROPDOWN_ID).click();
|
|
10315
|
+
}
|
|
10316
|
+
}
|
|
10317
|
+
}
|
|
10318
|
+
const itemType = this.parent.getItemModuleName(itemProp.item);
|
|
10319
|
+
switch (itemType) {
|
|
10320
|
+
case 'btn':
|
|
10321
|
+
this.parent.ribbonButtonModule.click(itemID);
|
|
10322
|
+
break;
|
|
10323
|
+
case 'dropdown-btn':
|
|
10324
|
+
this.parent.ribbonDropDownModule.toggle(itemID);
|
|
10325
|
+
break;
|
|
10326
|
+
case 'split-btn':
|
|
10327
|
+
this.parent.ribbonSplitButtonModule.toggle(itemID);
|
|
10328
|
+
break;
|
|
10329
|
+
case 'checkbox':
|
|
10330
|
+
this.parent.ribbonCheckBoxModule.click(itemID);
|
|
10331
|
+
break;
|
|
10332
|
+
case 'colorpicker':
|
|
10333
|
+
this.parent.ribbonColorPickerModule.toggle(itemID);
|
|
10334
|
+
break;
|
|
10335
|
+
case 'combobox':
|
|
10336
|
+
const itemEle = document.querySelector('#' + itemID);
|
|
10337
|
+
setTimeout(() => {
|
|
10338
|
+
itemEle.focus();
|
|
10339
|
+
}, 100);
|
|
10340
|
+
break;
|
|
10341
|
+
case 'gallery':
|
|
10342
|
+
const galleryEle = document.querySelector('#' + itemID);
|
|
10343
|
+
galleryEle.click();
|
|
10344
|
+
break;
|
|
10345
|
+
case 'template':
|
|
10346
|
+
const templateEle = document.querySelector('#' + itemID);
|
|
10347
|
+
templateEle.focus();
|
|
10348
|
+
break;
|
|
10349
|
+
case 'group-btn':
|
|
10350
|
+
const itemElement = document.querySelector('#' + itemID);
|
|
10351
|
+
if (itemElement) {
|
|
10352
|
+
const item = getInstance(itemElement, DropDownButton);
|
|
10353
|
+
item.toggle();
|
|
10354
|
+
for (let i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
|
|
10355
|
+
if (itemProp.item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip) {
|
|
10356
|
+
this.createKeyTipElement(itemID + (RIBBON_GROUP_BUTTON_ID + i), itemProp.item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip, 'item');
|
|
10357
|
+
}
|
|
10358
|
+
}
|
|
10359
|
+
}
|
|
10360
|
+
break;
|
|
10361
|
+
}
|
|
10362
|
+
}
|
|
10363
|
+
}
|
|
10364
|
+
commonItemsKeyTipPress(keyPress, key, isMethod) {
|
|
10365
|
+
/* eslint-disable */
|
|
10366
|
+
if (this.parent.keyTipElements[key]) {
|
|
10367
|
+
let isKeyPressed = false;
|
|
10368
|
+
let keytipData = this.parent.keyTipElements[key];
|
|
10369
|
+
let keyEle;
|
|
10370
|
+
let keytipElement;
|
|
10371
|
+
if (keytipData) {
|
|
10372
|
+
if (key === 'backstageMenu') {
|
|
10373
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements[key]).length; i++) {
|
|
10374
|
+
/* eslint-enable */
|
|
10375
|
+
if (keytipData[parseInt(i.toString(), 10)].keyTip === keyPress.toUpperCase()) {
|
|
10376
|
+
keyEle = document.querySelector('#' + keytipData[parseInt(i.toString(), 10)].id);
|
|
10377
|
+
keytipElement = document.querySelector('#' + keyEle.id + RIBBON_KEYTIP_ID);
|
|
10378
|
+
if (keytipElement || isMethod) {
|
|
10379
|
+
isKeyPressed = true;
|
|
10380
|
+
if (isMethod && document.querySelector('.e-ribbon-backstage-popup').classList.contains('e-popup-close')) {
|
|
10381
|
+
this.parent.tabObj.element.querySelector('.e-ribbon-backstage').click();
|
|
10382
|
+
}
|
|
10383
|
+
break;
|
|
10384
|
+
}
|
|
10385
|
+
}
|
|
10386
|
+
}
|
|
10387
|
+
}
|
|
10388
|
+
else {
|
|
10389
|
+
if (keytipData[0] && keytipData[0].keyTip === keyPress.toUpperCase()) {
|
|
10390
|
+
keyEle = document.querySelector('#' + keytipData[0].id);
|
|
10391
|
+
keytipElement = document.querySelector('#' + keytipData[0].id + RIBBON_KEYTIP_ID);
|
|
10392
|
+
if (keytipElement || isMethod) {
|
|
10393
|
+
isKeyPressed = true;
|
|
10394
|
+
}
|
|
10395
|
+
}
|
|
10396
|
+
}
|
|
10397
|
+
}
|
|
10398
|
+
if (isKeyPressed) {
|
|
10399
|
+
this.removeKeytip();
|
|
10400
|
+
this.isKeytipPresent = true;
|
|
10401
|
+
if (keyEle) {
|
|
10402
|
+
keyEle.click();
|
|
10403
|
+
if (key === 'backstage') {
|
|
10404
|
+
this.createKeytip('backstageMenu');
|
|
10405
|
+
}
|
|
10406
|
+
else if (key === 'overflowbtn') {
|
|
10407
|
+
this.isKeytipPopupOpen = true;
|
|
10408
|
+
this.createKeytip('popupitem');
|
|
10409
|
+
}
|
|
10410
|
+
else if (key === 'taboverflow') {
|
|
10411
|
+
setTimeout(() => {
|
|
10412
|
+
for (let i = 0; i < Object.keys(this.parent.keyTipElements).length; i++) {
|
|
10413
|
+
if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
|
|
10414
|
+
let keytipData = this.parent.keyTipElements[parseInt(i.toString(), 10)]['tab'];
|
|
10415
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'tab', 'center', 'bottom', true, true);
|
|
10416
|
+
}
|
|
10417
|
+
}
|
|
10418
|
+
}, 600);
|
|
10419
|
+
}
|
|
10420
|
+
}
|
|
10421
|
+
}
|
|
10422
|
+
}
|
|
10423
|
+
}
|
|
10424
|
+
/**
|
|
10425
|
+
* Removes the keytip.
|
|
10426
|
+
*
|
|
10427
|
+
* @param {string} key - Gets the keyboard key element.
|
|
10428
|
+
* @returns {void}
|
|
10429
|
+
* @hidden
|
|
10430
|
+
*/
|
|
10431
|
+
removeKeytip(key) {
|
|
10432
|
+
const keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
|
|
10433
|
+
let isKeyTipExist = false;
|
|
10434
|
+
this.parent.keysPress = '';
|
|
10435
|
+
for (let i = 0; i < keyTipItems.length; i++) {
|
|
10436
|
+
const keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
|
|
10437
|
+
if (key === 'Escape' && this.parent.keyTipElements && this.parent.keyTipElements[this.parent.selectedTab]) {
|
|
10438
|
+
/* eslint-disable */
|
|
10439
|
+
for (let j = 0; j < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]).length; j++) {
|
|
10440
|
+
let keyText = (Object.keys(this.parent.keyTipElements[this.parent.selectedTab]))[j];
|
|
10441
|
+
if (this.parent.keyTipElements[this.parent.selectedTab][keyText]) {
|
|
10442
|
+
const index = getIndex(this.parent.keyTipElements[this.parent.selectedTab][keyText], (e) => { return e.id + RIBBON_KEYTIP_ID === keyTipItems[parseInt(i.toString(), 10)].id; });
|
|
10443
|
+
/* eslint-enable */
|
|
10444
|
+
if (index !== -1) {
|
|
10445
|
+
if ((keyText === 'item' && !(this.isKeytipPopupOpen)) || (keyText === 'grpoverflow' && this.parent.activeLayout === 'Classic')) {
|
|
10446
|
+
this.createKeytip('tab');
|
|
10447
|
+
key = '';
|
|
10448
|
+
isKeyTipExist = true;
|
|
10449
|
+
break;
|
|
10450
|
+
}
|
|
10451
|
+
else if (this.isKeytipPopupOpen) {
|
|
10452
|
+
if ((keyText === 'popupitem' && this.parent.activeLayout === 'Simplified') || (keyText === 'grpoverflowpopup' && this.parent.activeLayout === 'Classic')) {
|
|
10453
|
+
this.createKeytip('item');
|
|
10454
|
+
key = '';
|
|
10455
|
+
isKeyTipExist = true;
|
|
10456
|
+
break;
|
|
10457
|
+
}
|
|
10458
|
+
}
|
|
10459
|
+
}
|
|
10460
|
+
}
|
|
10461
|
+
}
|
|
10462
|
+
for (let n = 0; n < Object.keys(this.parent.keyTipElements).length; n++) {
|
|
10463
|
+
if (this.parent.keyTipElements[parseInt(n.toString(), 10)]) {
|
|
10464
|
+
let keytipData = this.parent.keyTipElements[parseInt(n.toString(), 10)]['tab'];
|
|
10465
|
+
for (let j = 0; j < keytipData.length; j++) {
|
|
10466
|
+
if (keyTipItem.id === keytipData[0].id + RIBBON_KEYTIP_ID) {
|
|
10467
|
+
if (document.querySelector('#' + keytipData[0].id + HEADER_ID).closest('.e-toolbar-pop')) {
|
|
10468
|
+
const tabOverflow = this.parent.tabObj.element.querySelector('.e-nav-active');
|
|
10469
|
+
tabOverflow.click();
|
|
10470
|
+
setTimeout(() => {
|
|
10471
|
+
this.createKeytip('tab');
|
|
10472
|
+
}, 600);
|
|
10473
|
+
key = '';
|
|
10474
|
+
isKeyTipExist = true;
|
|
10475
|
+
break;
|
|
10476
|
+
}
|
|
10477
|
+
}
|
|
10478
|
+
}
|
|
10479
|
+
if (isKeyTipExist) {
|
|
10480
|
+
break;
|
|
10481
|
+
}
|
|
10482
|
+
}
|
|
10483
|
+
}
|
|
10484
|
+
if (!isKeyTipExist && this.parent.keyTipElements['backstageMenu']) {
|
|
10485
|
+
const index = getIndex(this.parent.keyTipElements['backstageMenu'], (e) => { return e.id + RIBBON_KEYTIP_ID === keyTipItems[parseInt(i.toString(), 10)].id; });
|
|
10486
|
+
if (index !== -1) {
|
|
10487
|
+
this.createKeytip('tab');
|
|
10488
|
+
key = '';
|
|
10489
|
+
isKeyTipExist = true;
|
|
10490
|
+
}
|
|
10491
|
+
}
|
|
10492
|
+
}
|
|
10493
|
+
if (keyTipItem) {
|
|
10494
|
+
remove(keyTipItem);
|
|
10495
|
+
}
|
|
10496
|
+
}
|
|
10497
|
+
this.isKeytipPopupOpen = false;
|
|
10498
|
+
if (!isKeyTipExist)
|
|
10499
|
+
this.parent.isKeytipOpen = false;
|
|
10500
|
+
}
|
|
10501
|
+
/**
|
|
10502
|
+
* Shows the Keytip dynamically.
|
|
10503
|
+
*
|
|
10504
|
+
* @param {string} keyAction - Item for which the tooltip is to be shown.
|
|
10505
|
+
* @returns {void}
|
|
10506
|
+
*/
|
|
10507
|
+
showKeyTips(keyAction) {
|
|
10508
|
+
if (this.parent.enableKeyTips) {
|
|
10509
|
+
if (keyAction) {
|
|
10510
|
+
this.keytipPress(keyAction, true);
|
|
10511
|
+
}
|
|
10512
|
+
else {
|
|
10513
|
+
this.createKeytip('tab');
|
|
10514
|
+
}
|
|
10515
|
+
}
|
|
10516
|
+
}
|
|
10517
|
+
/**
|
|
10518
|
+
* Hides the Keytip dynamically.
|
|
10519
|
+
*
|
|
10520
|
+
* @returns {void}
|
|
10521
|
+
*/
|
|
10522
|
+
hideKeyTips() {
|
|
10523
|
+
this.removeKeytip();
|
|
10524
|
+
}
|
|
10525
|
+
}
|
|
10526
|
+
|
|
8580
10527
|
/**
|
|
8581
10528
|
* Ribbon modules
|
|
8582
10529
|
*/
|
|
@@ -8584,5 +10531,5 @@ class RibbonBackstage extends Component {
|
|
|
8584
10531
|
// export all modules from current location
|
|
8585
10532
|
// example: export * from './module'
|
|
8586
10533
|
|
|
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 };
|
|
10534
|
+
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
10535
|
//# sourceMappingURL=ej2-ribbon.es2015.js.map
|