@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
|
*/
|
|
@@ -728,6 +732,9 @@ var RibbonGroupButtonItem = /** @__PURE__ @class */ (function (_super) {
|
|
|
728
732
|
__decorate$13([
|
|
729
733
|
Property('')
|
|
730
734
|
], RibbonGroupButtonItem.prototype, "iconCss", void 0);
|
|
735
|
+
__decorate$13([
|
|
736
|
+
Property('')
|
|
737
|
+
], RibbonGroupButtonItem.prototype, "keyTip", void 0);
|
|
731
738
|
__decorate$13([
|
|
732
739
|
Complex({}, RibbonTooltip)
|
|
733
740
|
], RibbonGroupButtonItem.prototype, "ribbonTooltipSettings", void 0);
|
|
@@ -785,6 +792,165 @@ var RibbonGroupButtonSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
785
792
|
return RibbonGroupButtonSettings;
|
|
786
793
|
}(ChildProperty));
|
|
787
794
|
|
|
795
|
+
var __extends$16 = (undefined && undefined.__extends) || (function () {
|
|
796
|
+
var extendStatics = function (d, b) {
|
|
797
|
+
extendStatics = Object.setPrototypeOf ||
|
|
798
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
799
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
800
|
+
return extendStatics(d, b);
|
|
801
|
+
};
|
|
802
|
+
return function (d, b) {
|
|
803
|
+
extendStatics(d, b);
|
|
804
|
+
function __() { this.constructor = d; }
|
|
805
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
806
|
+
};
|
|
807
|
+
})();
|
|
808
|
+
var __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
809
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
810
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
811
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
812
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
813
|
+
};
|
|
814
|
+
/**
|
|
815
|
+
* Defines the ribbon gallery item.
|
|
816
|
+
*/
|
|
817
|
+
var RibbonGalleryItem = /** @__PURE__ @class */ (function (_super) {
|
|
818
|
+
__extends$16(RibbonGalleryItem, _super);
|
|
819
|
+
function RibbonGalleryItem() {
|
|
820
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
821
|
+
}
|
|
822
|
+
__decorate$16([
|
|
823
|
+
Property('')
|
|
824
|
+
], RibbonGalleryItem.prototype, "content", void 0);
|
|
825
|
+
__decorate$16([
|
|
826
|
+
Property('')
|
|
827
|
+
], RibbonGalleryItem.prototype, "iconCss", void 0);
|
|
828
|
+
__decorate$16([
|
|
829
|
+
Property({})
|
|
830
|
+
], RibbonGalleryItem.prototype, "htmlAttributes", void 0);
|
|
831
|
+
__decorate$16([
|
|
832
|
+
Property('')
|
|
833
|
+
], RibbonGalleryItem.prototype, "cssClass", void 0);
|
|
834
|
+
__decorate$16([
|
|
835
|
+
Property(false)
|
|
836
|
+
], RibbonGalleryItem.prototype, "disabled", void 0);
|
|
837
|
+
return RibbonGalleryItem;
|
|
838
|
+
}(ChildProperty));
|
|
839
|
+
|
|
840
|
+
var __extends$15 = (undefined && undefined.__extends) || (function () {
|
|
841
|
+
var extendStatics = function (d, b) {
|
|
842
|
+
extendStatics = Object.setPrototypeOf ||
|
|
843
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
844
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
845
|
+
return extendStatics(d, b);
|
|
846
|
+
};
|
|
847
|
+
return function (d, b) {
|
|
848
|
+
extendStatics(d, b);
|
|
849
|
+
function __() { this.constructor = d; }
|
|
850
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
851
|
+
};
|
|
852
|
+
})();
|
|
853
|
+
var __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
854
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
855
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
856
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
857
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
858
|
+
};
|
|
859
|
+
/**
|
|
860
|
+
* Defines the ribbon gallery group.
|
|
861
|
+
*/
|
|
862
|
+
var RibbonGalleryGroup = /** @__PURE__ @class */ (function (_super) {
|
|
863
|
+
__extends$15(RibbonGalleryGroup, _super);
|
|
864
|
+
function RibbonGalleryGroup() {
|
|
865
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
866
|
+
}
|
|
867
|
+
__decorate$15([
|
|
868
|
+
Collection([], RibbonGalleryItem)
|
|
869
|
+
], RibbonGalleryGroup.prototype, "items", void 0);
|
|
870
|
+
__decorate$15([
|
|
871
|
+
Property('')
|
|
872
|
+
], RibbonGalleryGroup.prototype, "header", void 0);
|
|
873
|
+
__decorate$15([
|
|
874
|
+
Property('auto')
|
|
875
|
+
], RibbonGalleryGroup.prototype, "itemWidth", void 0);
|
|
876
|
+
__decorate$15([
|
|
877
|
+
Property('auto')
|
|
878
|
+
], RibbonGalleryGroup.prototype, "itemHeight", void 0);
|
|
879
|
+
__decorate$15([
|
|
880
|
+
Property('')
|
|
881
|
+
], RibbonGalleryGroup.prototype, "cssClass", void 0);
|
|
882
|
+
return RibbonGalleryGroup;
|
|
883
|
+
}(ChildProperty));
|
|
884
|
+
|
|
885
|
+
var __extends$14 = (undefined && undefined.__extends) || (function () {
|
|
886
|
+
var extendStatics = function (d, b) {
|
|
887
|
+
extendStatics = Object.setPrototypeOf ||
|
|
888
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
889
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
890
|
+
return extendStatics(d, b);
|
|
891
|
+
};
|
|
892
|
+
return function (d, b) {
|
|
893
|
+
extendStatics(d, b);
|
|
894
|
+
function __() { this.constructor = d; }
|
|
895
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
896
|
+
};
|
|
897
|
+
})();
|
|
898
|
+
var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
899
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
900
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
901
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
902
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
903
|
+
};
|
|
904
|
+
/**
|
|
905
|
+
* Defines the ribbon gallery settings.
|
|
906
|
+
*/
|
|
907
|
+
var RibbonGallerySettings = /** @__PURE__ @class */ (function (_super) {
|
|
908
|
+
__extends$14(RibbonGallerySettings, _super);
|
|
909
|
+
function RibbonGallerySettings() {
|
|
910
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
911
|
+
}
|
|
912
|
+
__decorate$14([
|
|
913
|
+
Collection([], RibbonGalleryGroup)
|
|
914
|
+
], RibbonGallerySettings.prototype, "groups", void 0);
|
|
915
|
+
__decorate$14([
|
|
916
|
+
Property(3)
|
|
917
|
+
], RibbonGallerySettings.prototype, "itemCount", void 0);
|
|
918
|
+
__decorate$14([
|
|
919
|
+
Property(null)
|
|
920
|
+
], RibbonGallerySettings.prototype, "selectedItemIndex", void 0);
|
|
921
|
+
__decorate$14([
|
|
922
|
+
Property('auto')
|
|
923
|
+
], RibbonGallerySettings.prototype, "popupHeight", void 0);
|
|
924
|
+
__decorate$14([
|
|
925
|
+
Property('auto')
|
|
926
|
+
], RibbonGallerySettings.prototype, "popupWidth", void 0);
|
|
927
|
+
__decorate$14([
|
|
928
|
+
Property('')
|
|
929
|
+
], RibbonGallerySettings.prototype, "template", void 0);
|
|
930
|
+
__decorate$14([
|
|
931
|
+
Property('')
|
|
932
|
+
], RibbonGallerySettings.prototype, "popupTemplate", void 0);
|
|
933
|
+
__decorate$14([
|
|
934
|
+
Event()
|
|
935
|
+
], RibbonGallerySettings.prototype, "popupOpen", void 0);
|
|
936
|
+
__decorate$14([
|
|
937
|
+
Event()
|
|
938
|
+
], RibbonGallerySettings.prototype, "popupClose", void 0);
|
|
939
|
+
__decorate$14([
|
|
940
|
+
Event()
|
|
941
|
+
], RibbonGallerySettings.prototype, "itemHover", void 0);
|
|
942
|
+
__decorate$14([
|
|
943
|
+
Event()
|
|
944
|
+
], RibbonGallerySettings.prototype, "beforeItemRender", void 0);
|
|
945
|
+
__decorate$14([
|
|
946
|
+
Event()
|
|
947
|
+
], RibbonGallerySettings.prototype, "beforeSelect", void 0);
|
|
948
|
+
__decorate$14([
|
|
949
|
+
Event()
|
|
950
|
+
], RibbonGallerySettings.prototype, "select", void 0);
|
|
951
|
+
return RibbonGallerySettings;
|
|
952
|
+
}(ChildProperty));
|
|
953
|
+
|
|
788
954
|
var __extends$4 = (undefined && undefined.__extends) || (function () {
|
|
789
955
|
var extendStatics = function (d, b) {
|
|
790
956
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -821,6 +987,9 @@ var RibbonItem = /** @__PURE__ @class */ (function (_super) {
|
|
|
821
987
|
RibbonItem.prototype.setProperties = function (prop, muteOnChange) {
|
|
822
988
|
_super.prototype.setProperties.call(this, prop, muteOnChange);
|
|
823
989
|
};
|
|
990
|
+
__decorate$4([
|
|
991
|
+
Property('')
|
|
992
|
+
], RibbonItem.prototype, "keyTip", void 0);
|
|
824
993
|
__decorate$4([
|
|
825
994
|
Property(RibbonItemSize.Medium)
|
|
826
995
|
], RibbonItem.prototype, "activeSize", void 0);
|
|
@@ -869,6 +1038,9 @@ var RibbonItem = /** @__PURE__ @class */ (function (_super) {
|
|
|
869
1038
|
__decorate$4([
|
|
870
1039
|
Complex({}, RibbonGroupButtonSettings)
|
|
871
1040
|
], RibbonItem.prototype, "groupButtonSettings", void 0);
|
|
1041
|
+
__decorate$4([
|
|
1042
|
+
Complex({}, RibbonGallerySettings)
|
|
1043
|
+
], RibbonItem.prototype, "gallerySettings", void 0);
|
|
872
1044
|
return RibbonItem;
|
|
873
1045
|
}(ChildProperty));
|
|
874
1046
|
|
|
@@ -956,6 +1128,12 @@ var RibbonGroup = /** @__PURE__ @class */ (function (_super) {
|
|
|
956
1128
|
RibbonGroup.prototype.setProperties = function (prop, muteOnChange) {
|
|
957
1129
|
_super.prototype.setProperties.call(this, prop, muteOnChange);
|
|
958
1130
|
};
|
|
1131
|
+
__decorate$2([
|
|
1132
|
+
Property('')
|
|
1133
|
+
], RibbonGroup.prototype, "keyTip", void 0);
|
|
1134
|
+
__decorate$2([
|
|
1135
|
+
Property('')
|
|
1136
|
+
], RibbonGroup.prototype, "launcherIconKeyTip", void 0);
|
|
959
1137
|
__decorate$2([
|
|
960
1138
|
Collection([], RibbonCollection)
|
|
961
1139
|
], RibbonGroup.prototype, "collections", void 0);
|
|
@@ -1031,6 +1209,9 @@ var RibbonTab = /** @__PURE__ @class */ (function (_super) {
|
|
|
1031
1209
|
RibbonTab.prototype.setProperties = function (prop, muteOnChange) {
|
|
1032
1210
|
_super.prototype.setProperties.call(this, prop, muteOnChange);
|
|
1033
1211
|
};
|
|
1212
|
+
__decorate$1([
|
|
1213
|
+
Property('')
|
|
1214
|
+
], RibbonTab.prototype, "keyTip", void 0);
|
|
1034
1215
|
__decorate$1([
|
|
1035
1216
|
Property('')
|
|
1036
1217
|
], RibbonTab.prototype, "id", void 0);
|
|
@@ -1046,7 +1227,7 @@ var RibbonTab = /** @__PURE__ @class */ (function (_super) {
|
|
|
1046
1227
|
return RibbonTab;
|
|
1047
1228
|
}(ChildProperty));
|
|
1048
1229
|
|
|
1049
|
-
var __extends$
|
|
1230
|
+
var __extends$17 = (undefined && undefined.__extends) || (function () {
|
|
1050
1231
|
var extendStatics = function (d, b) {
|
|
1051
1232
|
extendStatics = Object.setPrototypeOf ||
|
|
1052
1233
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -1059,7 +1240,7 @@ var __extends$14 = (undefined && undefined.__extends) || (function () {
|
|
|
1059
1240
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1060
1241
|
};
|
|
1061
1242
|
})();
|
|
1062
|
-
var __decorate$
|
|
1243
|
+
var __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1063
1244
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1064
1245
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1065
1246
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -1069,7 +1250,7 @@ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
1069
1250
|
* Defines the ribbon file menu settings.
|
|
1070
1251
|
*/
|
|
1071
1252
|
var FileMenuSettings = /** @__PURE__ @class */ (function (_super) {
|
|
1072
|
-
__extends$
|
|
1253
|
+
__extends$17(FileMenuSettings, _super);
|
|
1073
1254
|
function FileMenuSettings() {
|
|
1074
1255
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1075
1256
|
}
|
|
@@ -1082,52 +1263,55 @@ var FileMenuSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
1082
1263
|
FileMenuSettings.prototype.setProperties = function (prop, muteOnChange) {
|
|
1083
1264
|
_super.prototype.setProperties.call(this, prop, muteOnChange);
|
|
1084
1265
|
};
|
|
1085
|
-
__decorate$
|
|
1266
|
+
__decorate$17([
|
|
1086
1267
|
Property('File')
|
|
1087
1268
|
], FileMenuSettings.prototype, "text", void 0);
|
|
1088
|
-
__decorate$
|
|
1269
|
+
__decorate$17([
|
|
1089
1270
|
Property(false)
|
|
1090
1271
|
], FileMenuSettings.prototype, "visible", void 0);
|
|
1091
|
-
__decorate$
|
|
1272
|
+
__decorate$17([
|
|
1092
1273
|
Collection([], MenuItem)
|
|
1093
1274
|
], FileMenuSettings.prototype, "menuItems", void 0);
|
|
1094
|
-
__decorate$
|
|
1275
|
+
__decorate$17([
|
|
1095
1276
|
Property(false)
|
|
1096
1277
|
], FileMenuSettings.prototype, "showItemOnClick", void 0);
|
|
1097
|
-
__decorate$
|
|
1278
|
+
__decorate$17([
|
|
1098
1279
|
Complex({}, MenuAnimationSettings)
|
|
1099
1280
|
], FileMenuSettings.prototype, "animationSettings", void 0);
|
|
1100
|
-
__decorate$
|
|
1281
|
+
__decorate$17([
|
|
1101
1282
|
Property('')
|
|
1102
1283
|
], FileMenuSettings.prototype, "itemTemplate", void 0);
|
|
1103
|
-
__decorate$
|
|
1284
|
+
__decorate$17([
|
|
1104
1285
|
Property('')
|
|
1105
1286
|
], FileMenuSettings.prototype, "popupTemplate", void 0);
|
|
1106
|
-
__decorate$
|
|
1287
|
+
__decorate$17([
|
|
1107
1288
|
Complex({}, RibbonTooltip)
|
|
1108
1289
|
], FileMenuSettings.prototype, "ribbonTooltipSettings", void 0);
|
|
1109
|
-
__decorate$
|
|
1290
|
+
__decorate$17([
|
|
1110
1291
|
Event()
|
|
1111
1292
|
], FileMenuSettings.prototype, "beforeClose", void 0);
|
|
1112
|
-
__decorate$
|
|
1293
|
+
__decorate$17([
|
|
1113
1294
|
Event()
|
|
1114
1295
|
], FileMenuSettings.prototype, "beforeOpen", void 0);
|
|
1115
|
-
__decorate$
|
|
1296
|
+
__decorate$17([
|
|
1116
1297
|
Event()
|
|
1117
1298
|
], FileMenuSettings.prototype, "beforeItemRender", void 0);
|
|
1118
|
-
__decorate$
|
|
1299
|
+
__decorate$17([
|
|
1119
1300
|
Event()
|
|
1120
1301
|
], FileMenuSettings.prototype, "close", void 0);
|
|
1121
|
-
__decorate$
|
|
1302
|
+
__decorate$17([
|
|
1122
1303
|
Event()
|
|
1123
1304
|
], FileMenuSettings.prototype, "open", void 0);
|
|
1124
|
-
__decorate$
|
|
1305
|
+
__decorate$17([
|
|
1125
1306
|
Event()
|
|
1126
1307
|
], FileMenuSettings.prototype, "select", void 0);
|
|
1308
|
+
__decorate$17([
|
|
1309
|
+
Property('')
|
|
1310
|
+
], FileMenuSettings.prototype, "keyTip", void 0);
|
|
1127
1311
|
return FileMenuSettings;
|
|
1128
1312
|
}(ChildProperty));
|
|
1129
1313
|
|
|
1130
|
-
var __extends$
|
|
1314
|
+
var __extends$19 = (undefined && undefined.__extends) || (function () {
|
|
1131
1315
|
var extendStatics = function (d, b) {
|
|
1132
1316
|
extendStatics = Object.setPrototypeOf ||
|
|
1133
1317
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -1140,7 +1324,7 @@ var __extends$16 = (undefined && undefined.__extends) || (function () {
|
|
|
1140
1324
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1141
1325
|
};
|
|
1142
1326
|
})();
|
|
1143
|
-
var __decorate$
|
|
1327
|
+
var __decorate$19 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1144
1328
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1145
1329
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1146
1330
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -1150,23 +1334,23 @@ var __decorate$16 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
1150
1334
|
* Defines the ribbon backstage back button.
|
|
1151
1335
|
*/
|
|
1152
1336
|
var BackstageBackButton = /** @__PURE__ @class */ (function (_super) {
|
|
1153
|
-
__extends$
|
|
1337
|
+
__extends$19(BackstageBackButton, _super);
|
|
1154
1338
|
function BackstageBackButton() {
|
|
1155
1339
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1156
1340
|
}
|
|
1157
|
-
__decorate$
|
|
1341
|
+
__decorate$19([
|
|
1158
1342
|
Property('')
|
|
1159
1343
|
], BackstageBackButton.prototype, "text", void 0);
|
|
1160
|
-
__decorate$
|
|
1344
|
+
__decorate$19([
|
|
1161
1345
|
Property('')
|
|
1162
1346
|
], BackstageBackButton.prototype, "iconCss", void 0);
|
|
1163
|
-
__decorate$
|
|
1347
|
+
__decorate$19([
|
|
1164
1348
|
Property(true)
|
|
1165
1349
|
], BackstageBackButton.prototype, "visible", void 0);
|
|
1166
1350
|
return BackstageBackButton;
|
|
1167
1351
|
}(ChildProperty));
|
|
1168
1352
|
|
|
1169
|
-
var __extends$
|
|
1353
|
+
var __extends$20 = (undefined && undefined.__extends) || (function () {
|
|
1170
1354
|
var extendStatics = function (d, b) {
|
|
1171
1355
|
extendStatics = Object.setPrototypeOf ||
|
|
1172
1356
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -1179,7 +1363,7 @@ var __extends$17 = (undefined && undefined.__extends) || (function () {
|
|
|
1179
1363
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1180
1364
|
};
|
|
1181
1365
|
})();
|
|
1182
|
-
var __decorate$
|
|
1366
|
+
var __decorate$20 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1183
1367
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1184
1368
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1185
1369
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -1189,35 +1373,38 @@ var __decorate$17 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
1189
1373
|
* Defines the ribbon backstage back button.
|
|
1190
1374
|
*/
|
|
1191
1375
|
var BackstageItem = /** @__PURE__ @class */ (function (_super) {
|
|
1192
|
-
__extends$
|
|
1376
|
+
__extends$20(BackstageItem, _super);
|
|
1193
1377
|
function BackstageItem() {
|
|
1194
1378
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1195
1379
|
}
|
|
1196
|
-
__decorate$
|
|
1380
|
+
__decorate$20([
|
|
1197
1381
|
Property('')
|
|
1198
1382
|
], BackstageItem.prototype, "text", void 0);
|
|
1199
|
-
__decorate$
|
|
1383
|
+
__decorate$20([
|
|
1200
1384
|
Property('')
|
|
1201
1385
|
], BackstageItem.prototype, "id", void 0);
|
|
1202
|
-
__decorate$
|
|
1386
|
+
__decorate$20([
|
|
1387
|
+
Property('')
|
|
1388
|
+
], BackstageItem.prototype, "keyTip", void 0);
|
|
1389
|
+
__decorate$20([
|
|
1203
1390
|
Property('')
|
|
1204
1391
|
], BackstageItem.prototype, "content", void 0);
|
|
1205
|
-
__decorate$
|
|
1392
|
+
__decorate$20([
|
|
1206
1393
|
Property('')
|
|
1207
1394
|
], BackstageItem.prototype, "iconCss", void 0);
|
|
1208
|
-
__decorate$
|
|
1395
|
+
__decorate$20([
|
|
1209
1396
|
Property(false)
|
|
1210
1397
|
], BackstageItem.prototype, "separator", void 0);
|
|
1211
|
-
__decorate$
|
|
1398
|
+
__decorate$20([
|
|
1212
1399
|
Property(false)
|
|
1213
1400
|
], BackstageItem.prototype, "isFooter", void 0);
|
|
1214
|
-
__decorate$
|
|
1401
|
+
__decorate$20([
|
|
1215
1402
|
Event()
|
|
1216
1403
|
], BackstageItem.prototype, "backStageItemClick", void 0);
|
|
1217
1404
|
return BackstageItem;
|
|
1218
1405
|
}(ChildProperty));
|
|
1219
1406
|
|
|
1220
|
-
var __extends$
|
|
1407
|
+
var __extends$18 = (undefined && undefined.__extends) || (function () {
|
|
1221
1408
|
var extendStatics = function (d, b) {
|
|
1222
1409
|
extendStatics = Object.setPrototypeOf ||
|
|
1223
1410
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -1230,7 +1417,7 @@ var __extends$15 = (undefined && undefined.__extends) || (function () {
|
|
|
1230
1417
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1231
1418
|
};
|
|
1232
1419
|
})();
|
|
1233
|
-
var __decorate$
|
|
1420
|
+
var __decorate$18 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1234
1421
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1235
1422
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1236
1423
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -1240,7 +1427,7 @@ var __decorate$15 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
1240
1427
|
* Defines the ribbon file menu settings.
|
|
1241
1428
|
*/
|
|
1242
1429
|
var BackStageMenu = /** @__PURE__ @class */ (function (_super) {
|
|
1243
|
-
__extends$
|
|
1430
|
+
__extends$18(BackStageMenu, _super);
|
|
1244
1431
|
function BackStageMenu() {
|
|
1245
1432
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1246
1433
|
}
|
|
@@ -1253,36 +1440,87 @@ var BackStageMenu = /** @__PURE__ @class */ (function (_super) {
|
|
|
1253
1440
|
BackStageMenu.prototype.setProperties = function (prop, muteOnChange) {
|
|
1254
1441
|
_super.prototype.setProperties.call(this, prop, muteOnChange);
|
|
1255
1442
|
};
|
|
1256
|
-
__decorate$
|
|
1443
|
+
__decorate$18([
|
|
1257
1444
|
Property('File')
|
|
1258
1445
|
], BackStageMenu.prototype, "text", void 0);
|
|
1259
|
-
__decorate$
|
|
1446
|
+
__decorate$18([
|
|
1447
|
+
Property('')
|
|
1448
|
+
], BackStageMenu.prototype, "keyTip", void 0);
|
|
1449
|
+
__decorate$18([
|
|
1260
1450
|
Property(false)
|
|
1261
1451
|
], BackStageMenu.prototype, "visible", void 0);
|
|
1262
|
-
__decorate$
|
|
1452
|
+
__decorate$18([
|
|
1263
1453
|
Property('auto')
|
|
1264
1454
|
], BackStageMenu.prototype, "height", void 0);
|
|
1265
|
-
__decorate$
|
|
1455
|
+
__decorate$18([
|
|
1266
1456
|
Property('auto')
|
|
1267
1457
|
], BackStageMenu.prototype, "width", void 0);
|
|
1268
|
-
__decorate$
|
|
1458
|
+
__decorate$18([
|
|
1269
1459
|
Property(null)
|
|
1270
1460
|
], BackStageMenu.prototype, "target", void 0);
|
|
1271
|
-
__decorate$
|
|
1461
|
+
__decorate$18([
|
|
1272
1462
|
Complex({}, BackstageBackButton)
|
|
1273
1463
|
], BackStageMenu.prototype, "backButton", void 0);
|
|
1274
|
-
__decorate$
|
|
1464
|
+
__decorate$18([
|
|
1275
1465
|
Collection([], BackstageItem)
|
|
1276
1466
|
], BackStageMenu.prototype, "items", void 0);
|
|
1277
|
-
__decorate$
|
|
1467
|
+
__decorate$18([
|
|
1278
1468
|
Property('')
|
|
1279
1469
|
], BackStageMenu.prototype, "template", void 0);
|
|
1280
|
-
__decorate$
|
|
1470
|
+
__decorate$18([
|
|
1281
1471
|
Complex({}, RibbonTooltip)
|
|
1282
1472
|
], BackStageMenu.prototype, "ribbonTooltipSettings", void 0);
|
|
1283
1473
|
return BackStageMenu;
|
|
1284
1474
|
}(ChildProperty));
|
|
1285
1475
|
|
|
1476
|
+
var __extends$21 = (undefined && undefined.__extends) || (function () {
|
|
1477
|
+
var extendStatics = function (d, b) {
|
|
1478
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1479
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1480
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
1481
|
+
return extendStatics(d, b);
|
|
1482
|
+
};
|
|
1483
|
+
return function (d, b) {
|
|
1484
|
+
extendStatics(d, b);
|
|
1485
|
+
function __() { this.constructor = d; }
|
|
1486
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1487
|
+
};
|
|
1488
|
+
})();
|
|
1489
|
+
var __decorate$21 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1490
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1491
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1492
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1493
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1494
|
+
};
|
|
1495
|
+
/**
|
|
1496
|
+
* Defines the ribbon contextual tab.
|
|
1497
|
+
*/
|
|
1498
|
+
var RibbonContextualTabSettings = /** @__PURE__ @class */ (function (_super) {
|
|
1499
|
+
__extends$21(RibbonContextualTabSettings, _super);
|
|
1500
|
+
function RibbonContextualTabSettings() {
|
|
1501
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* @param {Object} prop - Gets the property of contextual tab.
|
|
1505
|
+
* @param {boolean} muteOnChange - Gets the boolean value of muteOnChange.
|
|
1506
|
+
* @returns {void}
|
|
1507
|
+
* @private
|
|
1508
|
+
*/
|
|
1509
|
+
RibbonContextualTabSettings.prototype.setProperties = function (prop, muteOnChange) {
|
|
1510
|
+
_super.prototype.setProperties.call(this, prop, muteOnChange);
|
|
1511
|
+
};
|
|
1512
|
+
__decorate$21([
|
|
1513
|
+
Property(false)
|
|
1514
|
+
], RibbonContextualTabSettings.prototype, "visible", void 0);
|
|
1515
|
+
__decorate$21([
|
|
1516
|
+
Property(false)
|
|
1517
|
+
], RibbonContextualTabSettings.prototype, "isSelected", void 0);
|
|
1518
|
+
__decorate$21([
|
|
1519
|
+
Collection([], RibbonTab)
|
|
1520
|
+
], RibbonContextualTabSettings.prototype, "tabs", void 0);
|
|
1521
|
+
return RibbonContextualTabSettings;
|
|
1522
|
+
}(ChildProperty));
|
|
1523
|
+
|
|
1286
1524
|
// export * from './file-menu';
|
|
1287
1525
|
|
|
1288
1526
|
/**
|
|
@@ -1311,6 +1549,8 @@ var RIBBON_POPUP_CONTROL = 'e-ribbon-popup-control';
|
|
|
1311
1549
|
/** @hidden */
|
|
1312
1550
|
var RIBBON_POPUP_OPEN = 'e-ribbon-open';
|
|
1313
1551
|
/** @hidden */
|
|
1552
|
+
var RIBBON_KEYTIP = 'e-ribbon-keytip';
|
|
1553
|
+
/** @hidden */
|
|
1314
1554
|
var SPACE = ' ';
|
|
1315
1555
|
/** @hidden */
|
|
1316
1556
|
var HORIZONTAL_SCROLLBAR = 'e-hscroll-bar';
|
|
@@ -1319,6 +1559,8 @@ var HIDE_CSS = 'e-ribbon-hide';
|
|
|
1319
1559
|
/** @hidden */
|
|
1320
1560
|
var RIBBON_TAB = 'e-ribbon-tab';
|
|
1321
1561
|
/** @hidden */
|
|
1562
|
+
var RIBBON_CONTEXTUAL_TAB = 'e-ribbon-contextual-tab';
|
|
1563
|
+
/** @hidden */
|
|
1322
1564
|
var RIBBON_TAB_ACTIVE = 'e-ribbon-active';
|
|
1323
1565
|
/** @hidden */
|
|
1324
1566
|
var RIBBON_TAB_ITEM = 'e-ribbon-tab-item';
|
|
@@ -1351,6 +1593,8 @@ var RIBBON_GROUP_BUTTON = 'e-ribbon-group-button';
|
|
|
1351
1593
|
/** @hidden */
|
|
1352
1594
|
var RIBBON_GROUP_BUTTON_OVERFLOW_POPUP = 'e-ribbon-group-button-overflow-popup';
|
|
1353
1595
|
/** @hidden */
|
|
1596
|
+
var RIBBON_GROUP_BUTTON_CONTENT = 'e-ribbon-group-button-content';
|
|
1597
|
+
/** @hidden */
|
|
1354
1598
|
var RIBBON_GROUP_CONTAINER = 'e-ribbon-group-container';
|
|
1355
1599
|
/** @hidden */
|
|
1356
1600
|
var RIBBON_OF_TAB_CONTAINER = 'e-ribbon-of-tab';
|
|
@@ -1475,6 +1719,8 @@ var RIBBON_HELP_PANE_TEMPLATE_ID = '_helppanetemplate';
|
|
|
1475
1719
|
/** @hidden */
|
|
1476
1720
|
var RIBBON_GROUP_BUTTON_ID = '_grpbtn';
|
|
1477
1721
|
/** @hidden */
|
|
1722
|
+
var RIBBON_KEYTIP_ID = '_keytip';
|
|
1723
|
+
/** @hidden */
|
|
1478
1724
|
var RIBBON_FILE_MENU_WIDTH = '--fileMenuWidth';
|
|
1479
1725
|
/** @hidden */
|
|
1480
1726
|
var RIBBON_HELP_PANE_TEMPLATE_WIDTH = '--helpTemplateWidth';
|
|
@@ -1819,7 +2065,12 @@ var RibbonColorPicker = /** @__PURE__ @class */ (function () {
|
|
|
1819
2065
|
beforeOpen: colorPickerSettings.beforeOpen,
|
|
1820
2066
|
beforeTileRender: colorPickerSettings.beforeTileRender,
|
|
1821
2067
|
created: colorPickerSettings.created,
|
|
1822
|
-
change:
|
|
2068
|
+
change: function (e) {
|
|
2069
|
+
colorPickerSettings.value = e.value.toString();
|
|
2070
|
+
if (colorPickerSettings.change) {
|
|
2071
|
+
colorPickerSettings.change.call(_this, e);
|
|
2072
|
+
}
|
|
2073
|
+
},
|
|
1823
2074
|
open: function () {
|
|
1824
2075
|
colorPicker.element.parentElement.classList.add(RIBBON_POPUP_OPEN);
|
|
1825
2076
|
if (colorPickerSettings.open) {
|
|
@@ -2942,10 +3193,11 @@ function getTemplateFunction(template) {
|
|
|
2942
3193
|
*
|
|
2943
3194
|
* @param {RibbonTabModel} tabs - Gets the ribbon tab model.
|
|
2944
3195
|
* @param {string} id - Gets the ID of the tab.
|
|
3196
|
+
* @param {RibbonItemType} type - Gets the type of the item.
|
|
2945
3197
|
* @returns {itemProps} - Gets the ribbon item.
|
|
2946
3198
|
* @hidden
|
|
2947
3199
|
*/
|
|
2948
|
-
function getItem(tabs, id) {
|
|
3200
|
+
function getItem(tabs, id, type) {
|
|
2949
3201
|
for (var i = 0; i < tabs.length; i++) {
|
|
2950
3202
|
var tab = tabs[parseInt(i.toString(), 10)];
|
|
2951
3203
|
for (var j = 0; j < tab.groups.length; j++) {
|
|
@@ -2954,7 +3206,7 @@ function getItem(tabs, id) {
|
|
|
2954
3206
|
var collection = group.collections[parseInt(k.toString(), 10)];
|
|
2955
3207
|
for (var l = 0; l < collection.items.length; l++) {
|
|
2956
3208
|
var item = collection.items[parseInt(l.toString(), 10)];
|
|
2957
|
-
if (item.id === id) {
|
|
3209
|
+
if ((id && item.id === id) || (type && item.type === type)) {
|
|
2958
3210
|
return {
|
|
2959
3211
|
item: item, collection: collection, group: group,
|
|
2960
3212
|
tabIndex: i, groupIndex: j, collectionIndex: k, itemIndex: l
|
|
@@ -3270,6 +3522,9 @@ var RibbonGroupButton = /** @__PURE__ @class */ (function () {
|
|
|
3270
3522
|
if (groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes) {
|
|
3271
3523
|
setCustomAttributes(groupButtonEle, groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes);
|
|
3272
3524
|
}
|
|
3525
|
+
if (groupBtnSettings.items[parseInt(i.toString(), 10)].content) {
|
|
3526
|
+
groupButtonEle.classList.add(RIBBON_GROUP_BUTTON_CONTENT);
|
|
3527
|
+
}
|
|
3273
3528
|
var buttonEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
|
|
3274
3529
|
if (groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
|
|
3275
3530
|
btnContainerEle.classList.add(RIBBON_SINGLE_BUTTON_SELECTION);
|
|
@@ -3711,27 +3966,734 @@ var RibbonGroupButton = /** @__PURE__ @class */ (function () {
|
|
|
3711
3966
|
return RibbonGroupButton;
|
|
3712
3967
|
}());
|
|
3713
3968
|
|
|
3714
|
-
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3715
|
-
var extendStatics = function (d, b) {
|
|
3716
|
-
extendStatics = Object.setPrototypeOf ||
|
|
3717
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3718
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3719
|
-
return extendStatics(d, b);
|
|
3720
|
-
};
|
|
3721
|
-
return function (d, b) {
|
|
3722
|
-
extendStatics(d, b);
|
|
3723
|
-
function __() { this.constructor = d; }
|
|
3724
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3725
|
-
};
|
|
3726
|
-
})();
|
|
3727
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
3728
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3729
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3730
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3731
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3732
|
-
};
|
|
3733
3969
|
/**
|
|
3734
|
-
*
|
|
3970
|
+
* Defines the items of Ribbon.
|
|
3971
|
+
*/
|
|
3972
|
+
var RibbonGallery = /** @__PURE__ @class */ (function () {
|
|
3973
|
+
function RibbonGallery(parent) {
|
|
3974
|
+
this.count = 0;
|
|
3975
|
+
this.isAdded = false;
|
|
3976
|
+
this.galleryItemsIndex = 0;
|
|
3977
|
+
this.parent = parent;
|
|
3978
|
+
}
|
|
3979
|
+
RibbonGallery.prototype.getModuleName = function () {
|
|
3980
|
+
return 'ribbonGallery';
|
|
3981
|
+
};
|
|
3982
|
+
RibbonGallery.prototype.destroy = function () {
|
|
3983
|
+
this.parent = null;
|
|
3984
|
+
};
|
|
3985
|
+
/**
|
|
3986
|
+
* Creates gallery.
|
|
3987
|
+
*
|
|
3988
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
3989
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
3990
|
+
* @returns {void}
|
|
3991
|
+
* @hidden
|
|
3992
|
+
*/
|
|
3993
|
+
RibbonGallery.prototype.createGallery = function (item, itemEle) {
|
|
3994
|
+
var _this = this;
|
|
3995
|
+
var gallerySettings = item.gallerySettings;
|
|
3996
|
+
this.renderGalleryItems(gallerySettings, false, item.id, itemEle);
|
|
3997
|
+
var buttonEle = this.parent.createElement('button', {
|
|
3998
|
+
id: item.id + '_popupButton',
|
|
3999
|
+
className: 'e-ribbon-gallery-button e-icons e-drop-icon'
|
|
4000
|
+
});
|
|
4001
|
+
itemEle.appendChild(buttonEle);
|
|
4002
|
+
this.createPopup(item, buttonEle);
|
|
4003
|
+
buttonEle.onclick = function (args) {
|
|
4004
|
+
var popupEle = document.querySelector('#' + item.id + '_galleryPopup');
|
|
4005
|
+
if (popupEle) {
|
|
4006
|
+
var popup = getComponent(popupEle, Popup);
|
|
4007
|
+
popupEle.classList.contains('e-popup-close') ? _this.showPopup(popup, popupEle, args, gallerySettings, item.id) : _this.hidePopup(popup, popupEle, args, gallerySettings, item.id);
|
|
4008
|
+
}
|
|
4009
|
+
};
|
|
4010
|
+
document.onclick = function (args) {
|
|
4011
|
+
var popupEle = document.querySelectorAll('.e-ribbon-gallery-popup.e-popup-open');
|
|
4012
|
+
var popupID;
|
|
4013
|
+
var itemProp;
|
|
4014
|
+
for (var i = 0; i < popupEle.length; i++) {
|
|
4015
|
+
var popup = getComponent(popupEle[parseInt(i.toString(), 10)], Popup);
|
|
4016
|
+
if (args.target.classList.contains('e-ribbon-gallery-button')) {
|
|
4017
|
+
popupID = (popupEle[parseInt(i.toString(), 10)].id).replace(/_galleryPopup/g, '');
|
|
4018
|
+
if ((args.target.id).replace(/_popupButton/g, '') !== popupID) {
|
|
4019
|
+
itemProp = getItem(_this.parent.tabs, popupID);
|
|
4020
|
+
_this.hidePopup(popup, popupEle[parseInt(i.toString(), 10)], args, itemProp.item.gallerySettings, popupID);
|
|
4021
|
+
break;
|
|
4022
|
+
}
|
|
4023
|
+
}
|
|
4024
|
+
else {
|
|
4025
|
+
popupID = (popupEle[parseInt(i.toString(), 10)].id).replace(/_galleryPopup/g, '');
|
|
4026
|
+
itemProp = getItem(_this.parent.tabs, popupID);
|
|
4027
|
+
_this.hidePopup(popup, popupEle[parseInt(i.toString(), 10)], args, itemProp.item.gallerySettings, popupID);
|
|
4028
|
+
break;
|
|
4029
|
+
}
|
|
4030
|
+
}
|
|
4031
|
+
};
|
|
4032
|
+
};
|
|
4033
|
+
RibbonGallery.prototype.renderGalleryItems = function (gallerySettings, isPopup, id, itemEle) {
|
|
4034
|
+
var _this = this;
|
|
4035
|
+
var galleryContainerEle;
|
|
4036
|
+
var galleryEle;
|
|
4037
|
+
var itemProp = getItem(this.parent.tabs, id);
|
|
4038
|
+
if (itemProp && itemProp.group) {
|
|
4039
|
+
itemProp.group.isCollapsible = false;
|
|
4040
|
+
}
|
|
4041
|
+
var galleryWrapper = this.parent.createElement('div', {
|
|
4042
|
+
className: 'e-ribbon-gallery-wrapper',
|
|
4043
|
+
id: id + '_galleryWrapper'
|
|
4044
|
+
});
|
|
4045
|
+
if (!isPopup) {
|
|
4046
|
+
itemEle.appendChild(galleryWrapper);
|
|
4047
|
+
}
|
|
4048
|
+
var _loop_1 = function (i) {
|
|
4049
|
+
var isHeightDefined = false;
|
|
4050
|
+
galleryContainerEle = this_1.parent.createElement('ol', {
|
|
4051
|
+
className: 'e-ribbon-gallery-container',
|
|
4052
|
+
id: id + '_galleryContainer' + i
|
|
4053
|
+
});
|
|
4054
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
|
|
4055
|
+
isHeightDefined = true;
|
|
4056
|
+
}
|
|
4057
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].cssClass) {
|
|
4058
|
+
galleryContainerEle.classList.add(gallerySettings.groups[parseInt(i.toString(), 10)].cssClass);
|
|
4059
|
+
}
|
|
4060
|
+
var _loop_2 = function (j) {
|
|
4061
|
+
galleryEle = this_1.parent.createElement('li', {
|
|
4062
|
+
className: 'e-ribbon-gallery-item',
|
|
4063
|
+
id: galleryContainerEle.id + '_gallery' + j,
|
|
4064
|
+
attrs: { 'tabindex': '0' }
|
|
4065
|
+
});
|
|
4066
|
+
var itemEventArgs = { name: 'beforeItemRender', item: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)] };
|
|
4067
|
+
if (gallerySettings.beforeItemRender) {
|
|
4068
|
+
gallerySettings.beforeItemRender.call(this_1, itemEventArgs);
|
|
4069
|
+
}
|
|
4070
|
+
galleryContainerEle.appendChild(galleryEle);
|
|
4071
|
+
if (gallerySettings.selectedItemIndex && gallerySettings.selectedItemIndex === this_1.count) {
|
|
4072
|
+
galleryEle.classList.add('e-ribbon-gallery-selected');
|
|
4073
|
+
}
|
|
4074
|
+
else {
|
|
4075
|
+
if (!gallerySettings.selectedItemIndex && this_1.count === 0) {
|
|
4076
|
+
galleryEle.classList.add('e-ribbon-gallery-selected');
|
|
4077
|
+
gallerySettings.selectedItemIndex = this_1.count;
|
|
4078
|
+
}
|
|
4079
|
+
}
|
|
4080
|
+
this_1.count = this_1.count + 1;
|
|
4081
|
+
galleryEle.onclick = function (e) {
|
|
4082
|
+
_this.setActiveState(e.currentTarget, gallerySettings, id, true, e);
|
|
4083
|
+
};
|
|
4084
|
+
galleryEle.onkeydown = function (e) {
|
|
4085
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
4086
|
+
_this.setActiveState(e.currentTarget, gallerySettings, id, true, e);
|
|
4087
|
+
}
|
|
4088
|
+
};
|
|
4089
|
+
galleryEle.onmouseover = function (e) {
|
|
4090
|
+
var hoverEventArgs = { event: e, name: 'itemHover', item: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)] };
|
|
4091
|
+
if (gallerySettings.itemHover) {
|
|
4092
|
+
gallerySettings.itemHover.call(_this, hoverEventArgs);
|
|
4093
|
+
}
|
|
4094
|
+
};
|
|
4095
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth && gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth !== 'auto') {
|
|
4096
|
+
galleryEle.style.width = gallerySettings.groups[parseInt(i.toString(), 10)].itemWidth + 'px';
|
|
4097
|
+
}
|
|
4098
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
|
|
4099
|
+
galleryEle.style.height = gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight + 'px';
|
|
4100
|
+
galleryEle.style.paddingTop = '0px';
|
|
4101
|
+
galleryEle.style.paddingBottom = '0px';
|
|
4102
|
+
if (this_1.parent.activeLayout !== 'Simplified' && !isPopup) {
|
|
4103
|
+
galleryContainerEle.style.flexFlow = 'wrap';
|
|
4104
|
+
}
|
|
4105
|
+
}
|
|
4106
|
+
if ((!gallerySettings.template && !gallerySettings.popupTemplate) || ((gallerySettings.template && !gallerySettings.popupTemplate) && isPopup) || ((gallerySettings.popupTemplate && !gallerySettings.template) && !isPopup)) {
|
|
4107
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].htmlAttributes) {
|
|
4108
|
+
setCustomAttributes(galleryEle, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].htmlAttributes);
|
|
4109
|
+
}
|
|
4110
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss) {
|
|
4111
|
+
var iconEle = this_1.parent.createElement('span', {
|
|
4112
|
+
className: 'e-ribbon-gallery-icons' + ' ' + gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss
|
|
4113
|
+
});
|
|
4114
|
+
galleryEle.appendChild(iconEle);
|
|
4115
|
+
if (this_1.parent.activeLayout === 'Simplified' && !isPopup) {
|
|
4116
|
+
iconEle.classList.add('e-hidden');
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
4119
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].content) {
|
|
4120
|
+
galleryEle.appendChild(this_1.parent.createElement('span', {
|
|
4121
|
+
innerHTML: gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].content,
|
|
4122
|
+
className: 'e-ribbon-gallery-text'
|
|
4123
|
+
}));
|
|
4124
|
+
}
|
|
4125
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].disabled) {
|
|
4126
|
+
galleryEle.classList.add('e-disabled');
|
|
4127
|
+
}
|
|
4128
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].cssClass) {
|
|
4129
|
+
galleryEle.classList.add(gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].cssClass);
|
|
4130
|
+
}
|
|
4131
|
+
}
|
|
4132
|
+
if (gallerySettings.template && !isPopup) {
|
|
4133
|
+
this_1.createGalleryTemplate(galleryEle, gallerySettings, id, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)]);
|
|
4134
|
+
}
|
|
4135
|
+
if (gallerySettings.popupTemplate && isPopup) {
|
|
4136
|
+
this_1.createGalleryPopupTemplate(galleryEle, gallerySettings, id, gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)]);
|
|
4137
|
+
}
|
|
4138
|
+
if ((!isPopup && !isHeightDefined && (gallerySettings.itemCount === this_1.count))) {
|
|
4139
|
+
galleryWrapper.appendChild(galleryContainerEle);
|
|
4140
|
+
this_1.isAdded = true;
|
|
4141
|
+
return "break";
|
|
4142
|
+
}
|
|
4143
|
+
};
|
|
4144
|
+
for (var j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
|
|
4145
|
+
var state_2 = _loop_2(j);
|
|
4146
|
+
if (state_2 === "break")
|
|
4147
|
+
break;
|
|
4148
|
+
}
|
|
4149
|
+
if (this_1.isAdded && !isPopup) {
|
|
4150
|
+
return "break";
|
|
4151
|
+
}
|
|
4152
|
+
!isPopup ? galleryWrapper.appendChild(galleryContainerEle) : itemEle.appendChild(galleryContainerEle);
|
|
4153
|
+
if (isPopup && gallerySettings.groups[parseInt(i.toString(), 10)].header) {
|
|
4154
|
+
var headerEle = (this_1.parent.createElement('div', {
|
|
4155
|
+
className: 'e-ribbon-gallery-header',
|
|
4156
|
+
innerHTML: gallerySettings.groups[parseInt(i.toString(), 10)].header
|
|
4157
|
+
}));
|
|
4158
|
+
itemEle.insertBefore(headerEle, galleryContainerEle);
|
|
4159
|
+
}
|
|
4160
|
+
};
|
|
4161
|
+
var this_1 = this;
|
|
4162
|
+
for (var i = 0; i < gallerySettings.groups.length; i++) {
|
|
4163
|
+
var state_1 = _loop_1(i);
|
|
4164
|
+
if (state_1 === "break")
|
|
4165
|
+
break;
|
|
4166
|
+
}
|
|
4167
|
+
this.count = 0;
|
|
4168
|
+
this.isAdded = false;
|
|
4169
|
+
};
|
|
4170
|
+
RibbonGallery.prototype.setWrapperWidth = function (itemCount, galleryWrapper, gallerySettings, itemID) {
|
|
4171
|
+
var count = 1;
|
|
4172
|
+
var itemsWidth = 0;
|
|
4173
|
+
var isWidthApplied = false;
|
|
4174
|
+
for (var i = 0; i < gallerySettings.groups.length; i++) {
|
|
4175
|
+
for (var j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
|
|
4176
|
+
if (gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
|
|
4177
|
+
if (itemCount >= count) {
|
|
4178
|
+
var galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + i + '_gallery' + j);
|
|
4179
|
+
if (galleryItemEle) {
|
|
4180
|
+
itemsWidth += galleryItemEle.offsetWidth;
|
|
4181
|
+
var itemStyles = window.getComputedStyle(galleryItemEle);
|
|
4182
|
+
if (itemStyles) {
|
|
4183
|
+
var paddingWidth = parseFloat(itemStyles.paddingLeft) + parseFloat(itemStyles.paddingRight);
|
|
4184
|
+
if (!(isNullOrUndefined(paddingWidth)))
|
|
4185
|
+
itemsWidth += paddingWidth;
|
|
4186
|
+
var marginWidth = parseFloat(itemStyles.marginLeft) + parseFloat(itemStyles.marginRight);
|
|
4187
|
+
if (!(isNullOrUndefined(marginWidth)))
|
|
4188
|
+
itemsWidth += marginWidth;
|
|
4189
|
+
}
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
else {
|
|
4193
|
+
isWidthApplied = true;
|
|
4194
|
+
break;
|
|
4195
|
+
}
|
|
4196
|
+
count++;
|
|
4197
|
+
}
|
|
4198
|
+
}
|
|
4199
|
+
if (isWidthApplied) {
|
|
4200
|
+
break;
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
if (itemsWidth > 0)
|
|
4204
|
+
galleryWrapper.style.width = itemsWidth + 'px';
|
|
4205
|
+
};
|
|
4206
|
+
/**
|
|
4207
|
+
* Checks the gallery items height.
|
|
4208
|
+
*
|
|
4209
|
+
* @param {number} selectedTab - Gets the current selected tab.
|
|
4210
|
+
* @param {HTMLElement} activeContent - Gets the current active content.
|
|
4211
|
+
* @returns {void}
|
|
4212
|
+
* @hidden
|
|
4213
|
+
*/
|
|
4214
|
+
RibbonGallery.prototype.checkAvailableHeight = function (selectedTab, activeContent) {
|
|
4215
|
+
var galleryWrapperItems = activeContent.querySelectorAll('.e-ribbon-gallery-wrapper');
|
|
4216
|
+
for (var n = 0; n < galleryWrapperItems.length; n++) {
|
|
4217
|
+
var isHeight = false;
|
|
4218
|
+
var itemsCount = 0;
|
|
4219
|
+
var galleryWrapper = galleryWrapperItems[parseInt(n.toString(), 10)];
|
|
4220
|
+
var galleryWrapperHeight = galleryWrapper.offsetHeight;
|
|
4221
|
+
var itemID = galleryWrapper.id.replace(/_galleryWrapper/g, '');
|
|
4222
|
+
var itemProp = getItem(this.parent.tabs, itemID);
|
|
4223
|
+
if (itemProp) {
|
|
4224
|
+
this.setWrapperWidth(itemProp.item.gallerySettings.itemCount, galleryWrapper, itemProp.item.gallerySettings, itemID);
|
|
4225
|
+
for (var i = 0; i < itemProp.item.gallerySettings.groups.length; i++) {
|
|
4226
|
+
if (itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight && itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].itemHeight !== 'auto') {
|
|
4227
|
+
for (var j = 0; j < itemProp.item.gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
|
|
4228
|
+
var galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + i + '_gallery' + j);
|
|
4229
|
+
if (galleryItemEle) {
|
|
4230
|
+
itemsCount++;
|
|
4231
|
+
if (!isHeight) {
|
|
4232
|
+
if (itemsCount === 1) {
|
|
4233
|
+
var itemsValues = 0;
|
|
4234
|
+
var itemStyles = window.getComputedStyle(galleryItemEle);
|
|
4235
|
+
if (itemStyles) {
|
|
4236
|
+
var paddingWidth = parseFloat(itemStyles.paddingTop) + parseFloat(itemStyles.paddingBottom);
|
|
4237
|
+
if (!(isNullOrUndefined(paddingWidth)))
|
|
4238
|
+
itemsValues += paddingWidth;
|
|
4239
|
+
var marginWidth = parseFloat(itemStyles.marginTop) + parseFloat(itemStyles.marginBottom);
|
|
4240
|
+
if (!(isNullOrUndefined(marginWidth)))
|
|
4241
|
+
itemsValues += marginWidth;
|
|
4242
|
+
}
|
|
4243
|
+
if (galleryWrapperHeight > (galleryItemEle.offsetHeight + itemsValues)) {
|
|
4244
|
+
galleryWrapperHeight -= (galleryItemEle.offsetHeight + itemsValues);
|
|
4245
|
+
}
|
|
4246
|
+
else {
|
|
4247
|
+
isHeight = true;
|
|
4248
|
+
galleryItemEle.remove();
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
if (itemsCount === itemProp.item.gallerySettings.itemCount) {
|
|
4252
|
+
itemsCount = 0;
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
else {
|
|
4256
|
+
galleryItemEle.remove();
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
}
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
}
|
|
4264
|
+
};
|
|
4265
|
+
RibbonGallery.prototype.checkCollision = function (popup, popupEle) {
|
|
4266
|
+
var paddingWidth = 0;
|
|
4267
|
+
var marginWidth = 0;
|
|
4268
|
+
if (popupEle) {
|
|
4269
|
+
var screenWidth = window.innerWidth;
|
|
4270
|
+
var paddingStyles = window.getComputedStyle(popupEle);
|
|
4271
|
+
if (paddingStyles) {
|
|
4272
|
+
paddingWidth = parseFloat(paddingStyles.paddingLeft) + parseFloat(paddingStyles.paddingRight);
|
|
4273
|
+
if (!(isNullOrUndefined(paddingWidth)))
|
|
4274
|
+
screenWidth = screenWidth - paddingWidth;
|
|
4275
|
+
}
|
|
4276
|
+
var popupContainerItems = popupEle.querySelectorAll('.e-ribbon-gallery-container');
|
|
4277
|
+
if (popup.width !== 'auto') {
|
|
4278
|
+
popupContainerItems.forEach(function (ele) {
|
|
4279
|
+
ele.style.flexFlow = 'wrap';
|
|
4280
|
+
});
|
|
4281
|
+
}
|
|
4282
|
+
var isCollideOccurs = false;
|
|
4283
|
+
for (var i = 0; i < popupContainerItems.length; i++) {
|
|
4284
|
+
var itemsWidth = 0;
|
|
4285
|
+
for (var j = 0; j < popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item').length; j++) {
|
|
4286
|
+
var marginStyles = window.getComputedStyle(popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)]);
|
|
4287
|
+
if (marginStyles) {
|
|
4288
|
+
marginWidth = parseFloat(marginStyles.marginLeft) + parseFloat(marginStyles.marginRight);
|
|
4289
|
+
if (!(isNullOrUndefined(marginWidth)))
|
|
4290
|
+
itemsWidth += marginWidth;
|
|
4291
|
+
}
|
|
4292
|
+
itemsWidth += popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)].offsetWidth;
|
|
4293
|
+
if (((screenWidth <= itemsWidth) && popup.width === 'auto') || ((popup.width !== 'auto') && (screenWidth <= parseInt(popup.width.toString(), 10)) && (screenWidth <= itemsWidth))) {
|
|
4294
|
+
popupEle.style.width = ((itemsWidth + Math.abs(paddingWidth - marginWidth)) - popupContainerItems[parseInt(i.toString(), 10)].querySelectorAll('.e-ribbon-gallery-item')[parseInt(j.toString(), 10)].offsetWidth) + 'px';
|
|
4295
|
+
isCollideOccurs = true;
|
|
4296
|
+
break;
|
|
4297
|
+
}
|
|
4298
|
+
}
|
|
4299
|
+
if (isCollideOccurs) {
|
|
4300
|
+
popupContainerItems.forEach(function (ele) {
|
|
4301
|
+
ele.style.flexFlow = 'wrap';
|
|
4302
|
+
});
|
|
4303
|
+
break;
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4306
|
+
if (!isCollideOccurs) {
|
|
4307
|
+
if (popup.width === 'auto') {
|
|
4308
|
+
popupContainerItems.forEach(function (ele) {
|
|
4309
|
+
ele.style.flexFlow = 'nowrap';
|
|
4310
|
+
});
|
|
4311
|
+
popupEle.style.width = 'auto';
|
|
4312
|
+
}
|
|
4313
|
+
else {
|
|
4314
|
+
popupEle.style.width = (popup.width).toString();
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
};
|
|
4319
|
+
RibbonGallery.prototype.createPopup = function (item, buttonEle) {
|
|
4320
|
+
var popupContainer = this.parent.createElement('div', {
|
|
4321
|
+
className: 'e-ribbon-popup-container',
|
|
4322
|
+
id: item.id + '_popupContainer'
|
|
4323
|
+
});
|
|
4324
|
+
this.renderGalleryItems(item.gallerySettings, true, item.id, popupContainer);
|
|
4325
|
+
var gallerypopupElement = this.parent.createElement('div', {
|
|
4326
|
+
className: 'e-ribbon-gallery-popup',
|
|
4327
|
+
id: item.id + '_galleryPopup'
|
|
4328
|
+
});
|
|
4329
|
+
document.body.append(gallerypopupElement);
|
|
4330
|
+
var galleryPopup = new Popup(gallerypopupElement, {
|
|
4331
|
+
relateTo: buttonEle,
|
|
4332
|
+
content: popupContainer,
|
|
4333
|
+
collision: { X: 'fit', Y: 'flip' },
|
|
4334
|
+
actionOnScroll: 'hide',
|
|
4335
|
+
targetType: 'relative',
|
|
4336
|
+
position: { X: 'left', Y: 'bottom' },
|
|
4337
|
+
enableRtl: this.parent.enableRtl,
|
|
4338
|
+
width: item.gallerySettings.popupWidth,
|
|
4339
|
+
height: item.gallerySettings.popupHeight
|
|
4340
|
+
});
|
|
4341
|
+
galleryPopup.hide();
|
|
4342
|
+
};
|
|
4343
|
+
/**
|
|
4344
|
+
* Updates gallery in mode switching.
|
|
4345
|
+
*
|
|
4346
|
+
* @param {string} activeLayout - Gets the current active layout.
|
|
4347
|
+
* @param {string} itemID - Gets the ribbon item id.
|
|
4348
|
+
* @returns {void}
|
|
4349
|
+
* @hidden
|
|
4350
|
+
*/
|
|
4351
|
+
RibbonGallery.prototype.switchGalleryItems = function (activeLayout, itemID) {
|
|
4352
|
+
var itemEle = this.parent.element.querySelector('#' + itemID + CONTAINER_ID);
|
|
4353
|
+
var count = 0;
|
|
4354
|
+
var itemProp = getItem(this.parent.tabs, itemID);
|
|
4355
|
+
if (itemEle) {
|
|
4356
|
+
var galleryWrapper = itemEle.querySelector('.e-ribbon-gallery-wrapper');
|
|
4357
|
+
var galleryIcons = itemEle.querySelectorAll('.e-ribbon-gallery-icons');
|
|
4358
|
+
var galleryContainer = itemEle.querySelectorAll('.e-ribbon-gallery-container');
|
|
4359
|
+
if (galleryIcons.length) {
|
|
4360
|
+
for (var i = 0; i < galleryIcons.length; i++) {
|
|
4361
|
+
activeLayout === 'Simplified' ? galleryIcons[parseInt(i.toString(), 10)].classList.add('e-hidden') : galleryIcons[parseInt(i.toString(), 10)].classList.remove('e-hidden');
|
|
4362
|
+
}
|
|
4363
|
+
}
|
|
4364
|
+
if (galleryContainer.length && itemProp) {
|
|
4365
|
+
for (var n = 0; n < itemProp.item.gallerySettings.groups.length; n++) {
|
|
4366
|
+
for (var i = 0; i < galleryContainer.length; i++) {
|
|
4367
|
+
if (itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].itemHeight && itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].itemHeight !== 'auto') {
|
|
4368
|
+
if (itemID + '_galleryContainer' + n === galleryContainer[parseInt(i.toString(), 10)].id) {
|
|
4369
|
+
activeLayout === 'Simplified' ? galleryContainer[parseInt(i.toString(), 10)].style.flexFlow = 'nowrap' : galleryContainer[parseInt(i.toString(), 10)].style.flexFlow = 'wrap';
|
|
4370
|
+
}
|
|
4371
|
+
}
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4374
|
+
}
|
|
4375
|
+
if (galleryWrapper) {
|
|
4376
|
+
for (var n = 0; n < itemProp.item.gallerySettings.groups.length; n++) {
|
|
4377
|
+
for (var i = 0; i < itemProp.item.gallerySettings.groups[parseInt(n.toString(), 10)].items.length; i++) {
|
|
4378
|
+
count++;
|
|
4379
|
+
if (count > itemProp.item.gallerySettings.itemCount) {
|
|
4380
|
+
var galleryItemEle = galleryWrapper.querySelector('#' + itemID + '_galleryContainer' + n + '_gallery' + i);
|
|
4381
|
+
if (galleryItemEle) {
|
|
4382
|
+
activeLayout === 'Simplified' ? galleryItemEle.classList.add('e-hidden') : galleryItemEle.classList.remove('e-hidden');
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
}
|
|
4388
|
+
}
|
|
4389
|
+
};
|
|
4390
|
+
/**
|
|
4391
|
+
* Adds the additional event handlers as the item moved into overflow popup.
|
|
4392
|
+
*
|
|
4393
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
4394
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
4395
|
+
* @param {DropDownButton} overflowButton - Gets the overflow button.
|
|
4396
|
+
* @returns {void}
|
|
4397
|
+
* @hidden
|
|
4398
|
+
*/
|
|
4399
|
+
RibbonGallery.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
|
|
4400
|
+
var _this = this;
|
|
4401
|
+
if (itemEle.closest('.e-ribbon-overflow-target')) {
|
|
4402
|
+
var buttonEle = this.parent.createElement('button', {
|
|
4403
|
+
id: item.id,
|
|
4404
|
+
});
|
|
4405
|
+
itemEle.appendChild(buttonEle);
|
|
4406
|
+
itemEle.querySelector('.e-ribbon-gallery-wrapper').classList.add('e-hidden');
|
|
4407
|
+
itemEle.querySelectorAll('.e-ribbon-gallery-container').forEach(function (ele) {
|
|
4408
|
+
ele.classList.add('e-hidden');
|
|
4409
|
+
});
|
|
4410
|
+
var popupButton = itemEle.querySelector('#' + item.id + '_popupButton');
|
|
4411
|
+
if (popupButton)
|
|
4412
|
+
popupButton.classList.add('e-hidden');
|
|
4413
|
+
var itemProp = getItem(this.parent.tabs, item.id);
|
|
4414
|
+
var iconCss = itemProp && itemProp.group.groupIconCss ? itemProp.group.groupIconCss : '';
|
|
4415
|
+
var content = itemProp && itemProp.group.header ? itemProp.group.header : '';
|
|
4416
|
+
if (!iconCss) {
|
|
4417
|
+
for (var i = 0; i < item.gallerySettings.groups.length; i++) {
|
|
4418
|
+
for (var j = 0; j < item.gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
|
|
4419
|
+
if (item.gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss) {
|
|
4420
|
+
iconCss = item.gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)].iconCss;
|
|
4421
|
+
break;
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
if (iconCss) {
|
|
4425
|
+
break;
|
|
4426
|
+
}
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4429
|
+
var popupEle = document.querySelector('#' + item.id + '_galleryPopup');
|
|
4430
|
+
var popup = getComponent(popupEle, Popup);
|
|
4431
|
+
var popupContainerEle_1 = document.querySelector('#' + item.id + '_galleryPopup .e-ribbon-popup-container');
|
|
4432
|
+
var dropdown_1 = new DropDownButton({
|
|
4433
|
+
iconCss: iconCss,
|
|
4434
|
+
content: content,
|
|
4435
|
+
target: popupContainerEle_1,
|
|
4436
|
+
enableRtl: this.parent.enableRtl,
|
|
4437
|
+
cssClass: 'e-ribbon-gallery-dropdown',
|
|
4438
|
+
disabled: item.disabled,
|
|
4439
|
+
open: function () {
|
|
4440
|
+
_this.setFoucsToFirstItem(popupContainerEle_1, true, item.id);
|
|
4441
|
+
_this.checkCollision(dropdown_1.dropDown, dropdown_1.dropDown.element);
|
|
4442
|
+
},
|
|
4443
|
+
beforeClose: function (args) {
|
|
4444
|
+
var isCancelled = _this.popupEvents(args.event, item.gallerySettings, 'popupClose', false);
|
|
4445
|
+
if (isCancelled) {
|
|
4446
|
+
args.cancel = true;
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4449
|
+
}, buttonEle);
|
|
4450
|
+
if (popup.width !== 'auto') {
|
|
4451
|
+
dropdown_1.dropDown.width = formatUnit(popup.width);
|
|
4452
|
+
}
|
|
4453
|
+
if (popup.height !== 'auto') {
|
|
4454
|
+
dropdown_1.dropDown.height = formatUnit(popup.height);
|
|
4455
|
+
dropdown_1.dropDown.element.style.height = (popup.height).toString();
|
|
4456
|
+
}
|
|
4457
|
+
}
|
|
4458
|
+
};
|
|
4459
|
+
/**
|
|
4460
|
+
* Removes the additional event handlers as the item moved into overflow popup.
|
|
4461
|
+
*
|
|
4462
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
4463
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
4464
|
+
* @returns {void}
|
|
4465
|
+
* @hidden
|
|
4466
|
+
*/
|
|
4467
|
+
RibbonGallery.prototype.removeOverFlowEvents = function (item, itemEle) {
|
|
4468
|
+
var popupButton = itemEle.querySelector('#' + item.id + '_popupButton');
|
|
4469
|
+
if (popupButton) {
|
|
4470
|
+
popupButton.classList.remove('e-hidden');
|
|
4471
|
+
}
|
|
4472
|
+
itemEle.querySelector('.e-ribbon-gallery-wrapper').classList.remove('e-hidden');
|
|
4473
|
+
itemEle.querySelectorAll('.e-ribbon-gallery-container').forEach(function (ele) {
|
|
4474
|
+
ele.classList.remove('e-hidden');
|
|
4475
|
+
});
|
|
4476
|
+
var galleryDDBEle = document.querySelector('#' + item.id);
|
|
4477
|
+
if (galleryDDBEle) {
|
|
4478
|
+
var popupEle = document.querySelector('#' + item.id + '_galleryPopup');
|
|
4479
|
+
var dropdown = getComponent(galleryDDBEle, DropDownButton);
|
|
4480
|
+
popupEle.appendChild(dropdown.target);
|
|
4481
|
+
dropdown.destroy();
|
|
4482
|
+
remove(galleryDDBEle);
|
|
4483
|
+
}
|
|
4484
|
+
};
|
|
4485
|
+
RibbonGallery.prototype.setActiveState = function (galleryEle, gallerySettings, itemID, isInteracted, event) {
|
|
4486
|
+
var previousItem;
|
|
4487
|
+
var currentItem;
|
|
4488
|
+
var itemEle = document.querySelector('#' + itemID + CONTAINER_ID);
|
|
4489
|
+
var selctedGalleryItem = Array.prototype.slice.call(itemEle.querySelectorAll('.e-ribbon-gallery-selected'));
|
|
4490
|
+
var popupEle = document.querySelector('#' + itemID + '_popupContainer');
|
|
4491
|
+
var popupGalleryItem = Array.prototype.slice.call(popupEle.querySelectorAll('.e-ribbon-gallery-selected'));
|
|
4492
|
+
if (popupGalleryItem.length) {
|
|
4493
|
+
selctedGalleryItem = selctedGalleryItem.concat(popupGalleryItem);
|
|
4494
|
+
}
|
|
4495
|
+
for (var i = 0; i < gallerySettings.groups.length; i++) {
|
|
4496
|
+
for (var j = 0; j < gallerySettings.groups[parseInt(i.toString(), 10)].items.length; j++) {
|
|
4497
|
+
if (selctedGalleryItem[0].id === itemID + '_galleryContainer' + i + '_gallery' + j) {
|
|
4498
|
+
previousItem = gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)];
|
|
4499
|
+
}
|
|
4500
|
+
if (galleryEle.id === itemID + '_galleryContainer' + i + '_gallery' + j) {
|
|
4501
|
+
currentItem = gallerySettings.groups[parseInt(i.toString(), 10)].items[parseInt(j.toString(), 10)];
|
|
4502
|
+
}
|
|
4503
|
+
}
|
|
4504
|
+
}
|
|
4505
|
+
var galleryItem = document.querySelectorAll('#' + galleryEle.id);
|
|
4506
|
+
var selectingEventArgs = { cancel: false, name: 'beforeSelect', previousItem: previousItem, currentItem: currentItem, isInteracted: isInteracted, event: event };
|
|
4507
|
+
if (gallerySettings.beforeSelect) {
|
|
4508
|
+
gallerySettings.beforeSelect.call(this, selectingEventArgs);
|
|
4509
|
+
}
|
|
4510
|
+
if (selectingEventArgs.cancel) {
|
|
4511
|
+
return;
|
|
4512
|
+
}
|
|
4513
|
+
else {
|
|
4514
|
+
for (var i = 0; i < selctedGalleryItem.length; i++) {
|
|
4515
|
+
selctedGalleryItem[parseInt(i.toString(), 10)].classList.remove('e-ribbon-gallery-selected');
|
|
4516
|
+
}
|
|
4517
|
+
for (var i = 0; i < galleryItem.length; i++) {
|
|
4518
|
+
galleryItem[parseInt(i.toString(), 10)].classList.add('e-ribbon-gallery-selected');
|
|
4519
|
+
}
|
|
4520
|
+
var selectedEventArgs = { previousItem: previousItem, currentItem: currentItem, name: 'select', isInteracted: isInteracted, event: event };
|
|
4521
|
+
var galleryPopupItems = document.querySelectorAll('#' + itemID + '_popupContainer .e-ribbon-gallery-item');
|
|
4522
|
+
for (var i = 0; i < galleryPopupItems.length; i++) {
|
|
4523
|
+
if (galleryPopupItems[parseInt(i.toString(), 10)].id === galleryEle.id) {
|
|
4524
|
+
gallerySettings.selectedItemIndex = i;
|
|
4525
|
+
break;
|
|
4526
|
+
}
|
|
4527
|
+
}
|
|
4528
|
+
if (gallerySettings.select) {
|
|
4529
|
+
gallerySettings.select.call(this, selectedEventArgs);
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4532
|
+
};
|
|
4533
|
+
RibbonGallery.prototype.popupEvents = function (args, gallerySettings, name, isOpen) {
|
|
4534
|
+
var popupEventArgs = { cancel: false, event: args, name: name };
|
|
4535
|
+
if (isOpen && gallerySettings.popupOpen) {
|
|
4536
|
+
gallerySettings.popupOpen.call(this, popupEventArgs);
|
|
4537
|
+
}
|
|
4538
|
+
else if (!isOpen && gallerySettings.popupClose) {
|
|
4539
|
+
gallerySettings.popupClose.call(this, popupEventArgs);
|
|
4540
|
+
}
|
|
4541
|
+
if (popupEventArgs.cancel) {
|
|
4542
|
+
return true;
|
|
4543
|
+
}
|
|
4544
|
+
return false;
|
|
4545
|
+
};
|
|
4546
|
+
RibbonGallery.prototype.showPopup = function (popup, popupEle, args, gallerySettings, itemID) {
|
|
4547
|
+
var isCancelled = this.popupEvents(args, gallerySettings, 'popupOpen', true);
|
|
4548
|
+
if (isCancelled) {
|
|
4549
|
+
return;
|
|
4550
|
+
}
|
|
4551
|
+
popup.show();
|
|
4552
|
+
this.checkCollision(popup, popupEle);
|
|
4553
|
+
var buttonEle = document.querySelector('#' + itemID + '_popupButton');
|
|
4554
|
+
buttonEle.classList.add('e-gallery-button-active');
|
|
4555
|
+
var buttonPosition = buttonEle.getBoundingClientRect();
|
|
4556
|
+
var offsetX = Math.abs((popupEle.offsetWidth - buttonPosition.left)) + buttonEle.offsetWidth;
|
|
4557
|
+
popupEle.style.left = offsetX + 'px';
|
|
4558
|
+
popupEle.style.top = popupEle.getBoundingClientRect().top + 2 + 'px';
|
|
4559
|
+
this.setFoucsToFirstItem(popupEle, false, itemID, popup, gallerySettings);
|
|
4560
|
+
};
|
|
4561
|
+
RibbonGallery.prototype.hidePopup = function (popup, popupEle, args, gallerySettings, itemID) {
|
|
4562
|
+
var isCancelled = this.popupEvents(args, gallerySettings, 'popupClose', false);
|
|
4563
|
+
if (isCancelled) {
|
|
4564
|
+
return;
|
|
4565
|
+
}
|
|
4566
|
+
popup.hide();
|
|
4567
|
+
var buttonEle = document.querySelector('#' + itemID + '_popupButton');
|
|
4568
|
+
buttonEle.classList.remove('e-gallery-button-active');
|
|
4569
|
+
};
|
|
4570
|
+
/**
|
|
4571
|
+
* Shows a specific gallery popup in the ribbon.
|
|
4572
|
+
*
|
|
4573
|
+
* @param {string} id - Gets the ribbon item id.
|
|
4574
|
+
* @returns {void}
|
|
4575
|
+
*/
|
|
4576
|
+
RibbonGallery.prototype.showGalleryPopup = function (id) {
|
|
4577
|
+
var itemProp = getItem(this.parent.tabs, id);
|
|
4578
|
+
var popupEle = document.querySelector('#' + id + '_galleryPopup');
|
|
4579
|
+
var popup = getComponent(popupEle, Popup);
|
|
4580
|
+
this.showPopup(popup, popupEle, null, itemProp.item.gallerySettings, id);
|
|
4581
|
+
};
|
|
4582
|
+
/**
|
|
4583
|
+
* Hides a specific gallery popup in the ribbon.
|
|
4584
|
+
*
|
|
4585
|
+
* @param {string} id - Gets the ribbon item id.
|
|
4586
|
+
* @returns {void}
|
|
4587
|
+
*/
|
|
4588
|
+
RibbonGallery.prototype.hideGalleryPopup = function (id) {
|
|
4589
|
+
var itemProp = getItem(this.parent.tabs, id);
|
|
4590
|
+
var popupEle = document.querySelector('#' + id + '_galleryPopup');
|
|
4591
|
+
var popup = getComponent(popupEle, Popup);
|
|
4592
|
+
this.hidePopup(popup, popupEle, null, itemProp.item.gallerySettings, id);
|
|
4593
|
+
};
|
|
4594
|
+
RibbonGallery.prototype.setFoucsToFirstItem = function (popupEle, isDropdown, itemID, popup, gallerySettings) {
|
|
4595
|
+
var _this = this;
|
|
4596
|
+
popupEle.querySelectorAll('.e-ribbon-gallery-item')[0].focus();
|
|
4597
|
+
this.galleryItemsIndex = 0;
|
|
4598
|
+
popupEle.onkeydown = function (e) {
|
|
4599
|
+
_this.handleGalleryPopupNavigation(e, popupEle, isDropdown, itemID, popup, gallerySettings);
|
|
4600
|
+
};
|
|
4601
|
+
};
|
|
4602
|
+
RibbonGallery.prototype.handleGalleryPopupNavigation = function (e, popupEle, isDropdown, itemID, popup, gallerySettings) {
|
|
4603
|
+
var galleryPopupEle = popupEle.querySelectorAll('.e-ribbon-gallery-item');
|
|
4604
|
+
if (galleryPopupEle) {
|
|
4605
|
+
if (e.key === 'Home') {
|
|
4606
|
+
this.galleryItemsIndex = 0;
|
|
4607
|
+
galleryPopupEle[this.galleryItemsIndex].focus();
|
|
4608
|
+
}
|
|
4609
|
+
else if (e.key === 'End') {
|
|
4610
|
+
this.galleryItemsIndex = galleryPopupEle.length - 1;
|
|
4611
|
+
galleryPopupEle[this.galleryItemsIndex].focus();
|
|
4612
|
+
}
|
|
4613
|
+
else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
|
|
4614
|
+
this.galleryItemsIndex++;
|
|
4615
|
+
if (this.galleryItemsIndex !== galleryPopupEle.length) {
|
|
4616
|
+
if (galleryPopupEle && (galleryPopupEle[this.galleryItemsIndex])) {
|
|
4617
|
+
galleryPopupEle[this.galleryItemsIndex].focus();
|
|
4618
|
+
}
|
|
4619
|
+
}
|
|
4620
|
+
else {
|
|
4621
|
+
this.galleryItemsIndex = 0;
|
|
4622
|
+
galleryPopupEle[this.galleryItemsIndex].focus();
|
|
4623
|
+
}
|
|
4624
|
+
}
|
|
4625
|
+
else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
|
|
4626
|
+
if (this.galleryItemsIndex !== 0) {
|
|
4627
|
+
this.galleryItemsIndex--;
|
|
4628
|
+
if (galleryPopupEle && (galleryPopupEle[this.galleryItemsIndex])) {
|
|
4629
|
+
galleryPopupEle[this.galleryItemsIndex].focus();
|
|
4630
|
+
}
|
|
4631
|
+
}
|
|
4632
|
+
else {
|
|
4633
|
+
this.galleryItemsIndex = galleryPopupEle.length - 1;
|
|
4634
|
+
galleryPopupEle[this.galleryItemsIndex].focus();
|
|
4635
|
+
}
|
|
4636
|
+
}
|
|
4637
|
+
else if (e.key === 'Enter' || e.code === 'Space') {
|
|
4638
|
+
galleryPopupEle[this.galleryItemsIndex].click();
|
|
4639
|
+
}
|
|
4640
|
+
else if (e.key === 'Escape' && !isDropdown) {
|
|
4641
|
+
this.hidePopup(popup, popupEle, e, gallerySettings, itemID);
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4644
|
+
};
|
|
4645
|
+
RibbonGallery.prototype.createGalleryTemplate = function (galleryItemEle, gallerySettings, id, items) {
|
|
4646
|
+
galleryItemEle.classList.add('e-ribbon-gallery-template');
|
|
4647
|
+
var templateName = 'ribbon' + id + 'galleryTemplate';
|
|
4648
|
+
this.parent['clearTemplate']([templateName]);
|
|
4649
|
+
var templateFunction = getTemplateFunction(gallerySettings.template);
|
|
4650
|
+
if (items.disabled) {
|
|
4651
|
+
galleryItemEle.classList.add('e-disabled');
|
|
4652
|
+
}
|
|
4653
|
+
if (items.cssClass) {
|
|
4654
|
+
galleryItemEle.classList.add(items.cssClass);
|
|
4655
|
+
}
|
|
4656
|
+
append(templateFunction({ items: items }, this, templateName, (id + 'galleryTemplate'), this.parent.isStringTemplate), galleryItemEle);
|
|
4657
|
+
this.parent['renderReactTemplates']();
|
|
4658
|
+
};
|
|
4659
|
+
RibbonGallery.prototype.createGalleryPopupTemplate = function (galleryItemEle, gallerySettings, id, items) {
|
|
4660
|
+
galleryItemEle.classList.add('e-ribbon-gallery-popup-template');
|
|
4661
|
+
var templateName = 'ribbon' + id + 'galleryPopupTemplate';
|
|
4662
|
+
this.parent['clearTemplate']([templateName]);
|
|
4663
|
+
var templateFunction = getTemplateFunction(gallerySettings.popupTemplate);
|
|
4664
|
+
if (items.disabled) {
|
|
4665
|
+
galleryItemEle.classList.add('e-disabled');
|
|
4666
|
+
}
|
|
4667
|
+
if (items.cssClass) {
|
|
4668
|
+
galleryItemEle.classList.add(items.cssClass);
|
|
4669
|
+
}
|
|
4670
|
+
append(templateFunction({ items: items }, this, templateName, (id + 'galleryPopupTemplate'), this.parent.isStringTemplate), galleryItemEle);
|
|
4671
|
+
this.parent['renderReactTemplates']();
|
|
4672
|
+
};
|
|
4673
|
+
return RibbonGallery;
|
|
4674
|
+
}());
|
|
4675
|
+
|
|
4676
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
4677
|
+
var extendStatics = function (d, b) {
|
|
4678
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4679
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
4680
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4681
|
+
return extendStatics(d, b);
|
|
4682
|
+
};
|
|
4683
|
+
return function (d, b) {
|
|
4684
|
+
extendStatics(d, b);
|
|
4685
|
+
function __() { this.constructor = d; }
|
|
4686
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4687
|
+
};
|
|
4688
|
+
})();
|
|
4689
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
4690
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4691
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4692
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4693
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4694
|
+
};
|
|
4695
|
+
/**
|
|
4696
|
+
* The Ribbon Component is a structured layout to manage tools with tabs and groups.
|
|
3735
4697
|
*/
|
|
3736
4698
|
var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
3737
4699
|
__extends(Ribbon, _super);
|
|
@@ -3758,12 +4720,17 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
3758
4720
|
this.initialize();
|
|
3759
4721
|
};
|
|
3760
4722
|
Ribbon.prototype.preRender = function () {
|
|
4723
|
+
this.keysPress = '';
|
|
3761
4724
|
this.idIndex = 0;
|
|
3762
4725
|
this.tooltipData = [];
|
|
3763
4726
|
this.initialPropsData = {};
|
|
3764
4727
|
this.hiddenElements = {};
|
|
4728
|
+
this.keyTipElements = {};
|
|
3765
4729
|
this.hiddenGroups = [];
|
|
4730
|
+
this.itemsModel = [];
|
|
4731
|
+
this.targetTabs = {};
|
|
3766
4732
|
this.isAddRemove = false;
|
|
4733
|
+
this.isUpdateItems = false;
|
|
3767
4734
|
this.keyConfigs = {
|
|
3768
4735
|
leftarrow: 'leftarrow',
|
|
3769
4736
|
rightarrow: 'rightarrow',
|
|
@@ -3796,7 +4763,27 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
3796
4763
|
*/
|
|
3797
4764
|
Ribbon.prototype.requiredModules = function () {
|
|
3798
4765
|
var modules = [];
|
|
3799
|
-
modules.push({ member: 'ribbonButton', args: [this] }, { member: 'ribbonDropDown', args: [this] }, { member: 'ribbonSplitButton', args: [this] }, { member: 'ribbonCheckBox', args: [this]
|
|
4766
|
+
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' });
|
|
4767
|
+
var canInjectColorPickerModule = getItem(this.tabs, null, RibbonItemType.ColorPicker);
|
|
4768
|
+
var canInjectGalleryModule = getItem(this.tabs, null, RibbonItemType.Gallery);
|
|
4769
|
+
if (canInjectColorPickerModule) {
|
|
4770
|
+
modules.push({ member: 'ribbonColorPicker', args: [this], name: 'RibbonColorPicker' });
|
|
4771
|
+
}
|
|
4772
|
+
if (canInjectGalleryModule) {
|
|
4773
|
+
modules.push({ member: 'ribbonGallery', args: [this], name: 'RibbonGallery' });
|
|
4774
|
+
}
|
|
4775
|
+
if (this.backStageMenu.visible || this.backStageMenu.items.length) {
|
|
4776
|
+
modules.push({ member: 'ribbonBackstage', args: [this], name: 'RibbonBackstage' });
|
|
4777
|
+
}
|
|
4778
|
+
if (this.fileMenu.visible || this.fileMenu.menuItems.length) {
|
|
4779
|
+
modules.push({ member: 'ribbonFileMenu', args: [this], name: 'RibbonFileMenu' });
|
|
4780
|
+
}
|
|
4781
|
+
if (this.contextualTabs.length) {
|
|
4782
|
+
modules.push({ member: 'ribbonContextualTab', args: [this], name: 'RibbonContextualTab' });
|
|
4783
|
+
}
|
|
4784
|
+
if (this.enableKeyTips) {
|
|
4785
|
+
modules.push({ member: 'ribbonKeyTip', args: [this], name: 'RibbonKeyTip' });
|
|
4786
|
+
}
|
|
3800
4787
|
return modules;
|
|
3801
4788
|
};
|
|
3802
4789
|
Ribbon.prototype.initialize = function () {
|
|
@@ -3807,6 +4794,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
3807
4794
|
}
|
|
3808
4795
|
this.element.style.width = formatUnit(this.width);
|
|
3809
4796
|
this.renderTabs();
|
|
4797
|
+
if (this.ribbonContextualTabModule) {
|
|
4798
|
+
this.ribbonContextualTabModule.addContextualTabs();
|
|
4799
|
+
}
|
|
3810
4800
|
if (this.ribbonFileMenuModule) {
|
|
3811
4801
|
this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
|
|
3812
4802
|
}
|
|
@@ -3816,13 +4806,18 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
3816
4806
|
this.createHelpPaneTemplate();
|
|
3817
4807
|
var toolbar = this.tabObj['tbObj'];
|
|
3818
4808
|
toolbar.refreshOverflow();
|
|
4809
|
+
this.addTabOverflowKeyTip();
|
|
3819
4810
|
createTooltip(this.element, this);
|
|
4811
|
+
this.isKeytipOpen = false;
|
|
3820
4812
|
this.wireEvents();
|
|
3821
4813
|
this.wireKeyboardEvent();
|
|
3822
4814
|
this.currentControlIndex = 0;
|
|
3823
4815
|
};
|
|
3824
4816
|
Ribbon.prototype.wireEvents = function () {
|
|
3825
4817
|
EventHandler.add(window, 'resize', this.resizeHandler, this);
|
|
4818
|
+
EventHandler.add(document.body, 'keydown', this.keytipActionHandler, this);
|
|
4819
|
+
EventHandler.add(document, 'mousedown', this.mouseEventHandler, this);
|
|
4820
|
+
EventHandler.add(document, 'scroll', this.mouseEventHandler, this);
|
|
3826
4821
|
};
|
|
3827
4822
|
Ribbon.prototype.wireKeyboardEvent = function () {
|
|
3828
4823
|
this.keyboardModuleRibbon = new KeyboardEvents(this.element, {
|
|
@@ -3838,7 +4833,8 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
3838
4833
|
var activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
|
|
3839
4834
|
var controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
|
|
3840
4835
|
var templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
|
|
3841
|
-
var
|
|
4836
|
+
var galleryElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-gallery-item'));
|
|
4837
|
+
var ribbonControls = controlElements.concat(templateElements, galleryElements);
|
|
3842
4838
|
var comboBoxElements = activeContent.querySelectorAll('.e-combobox');
|
|
3843
4839
|
var comboBoxEle;
|
|
3844
4840
|
if (comboBoxElements) {
|
|
@@ -3867,7 +4863,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
3867
4863
|
if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
|
|
3868
4864
|
e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
|
|
3869
4865
|
e.target.classList.contains('e-ribbon-first-item') || e.target.classList.contains('e-ribbon-group-of-btn') ||
|
|
3870
|
-
e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template')) {
|
|
4866
|
+
e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-gallery-item')) {
|
|
3871
4867
|
switch (e.action) {
|
|
3872
4868
|
case 'rightarrow':
|
|
3873
4869
|
this.handleNavigation(e, !this.enableRtl, ribbonControls);
|
|
@@ -3909,7 +4905,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
3909
4905
|
}
|
|
3910
4906
|
}
|
|
3911
4907
|
if ((!enableRtl && (this.currentControlIndex > 0)) || (enableRtl && (this.currentControlIndex < ribbonControls.length - 1))) {
|
|
3912
|
-
if (!e.target.classList.contains('e-combobox') && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template')) && !e.target.classList.contains('e-ribbon-last-item')) {
|
|
4908
|
+
if (!e.target.classList.contains('e-combobox') && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-gallery-item')) && !e.target.classList.contains('e-ribbon-last-item')) {
|
|
3913
4909
|
if (enableRtl) {
|
|
3914
4910
|
this.currentControlIndex++;
|
|
3915
4911
|
}
|
|
@@ -4068,6 +5064,111 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4068
5064
|
}
|
|
4069
5065
|
}
|
|
4070
5066
|
}
|
|
5067
|
+
var galleryPopupEle = document.querySelector('.e-ribbon-gallery-popup.e-popup-open');
|
|
5068
|
+
if (galleryPopupEle) {
|
|
5069
|
+
var popup = getComponent(galleryPopupEle, Popup);
|
|
5070
|
+
popup.hide();
|
|
5071
|
+
}
|
|
5072
|
+
if (this.ribbonKeyTipModule && this.enableKeyTips) {
|
|
5073
|
+
this.ribbonKeyTipModule.removeKeytip();
|
|
5074
|
+
}
|
|
5075
|
+
};
|
|
5076
|
+
Ribbon.prototype.mouseEventHandler = function (e) {
|
|
5077
|
+
if (this.ribbonKeyTipModule && this.enableKeyTips) {
|
|
5078
|
+
this.ribbonKeyTipModule.removeKeytip();
|
|
5079
|
+
}
|
|
5080
|
+
};
|
|
5081
|
+
Ribbon.prototype.keytipActionHandler = function (e) {
|
|
5082
|
+
if (this.enableKeyTips) {
|
|
5083
|
+
var isKeyTipPresent = false;
|
|
5084
|
+
var keyPress = e.key;
|
|
5085
|
+
if (e.altKey && e.key === 'Meta') {
|
|
5086
|
+
var activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
|
|
5087
|
+
if (activePopup.length) {
|
|
5088
|
+
for (var i = 0; i < activePopup.length; i++) {
|
|
5089
|
+
var dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
|
|
5090
|
+
dropDownBtn.toggle();
|
|
5091
|
+
}
|
|
5092
|
+
this.ribbonKeyTipModule.removeKeytip();
|
|
5093
|
+
}
|
|
5094
|
+
else {
|
|
5095
|
+
if (!this.isKeytipOpen) {
|
|
5096
|
+
var backstagePopup = document.querySelector('.e-ribbon-backstage-popup');
|
|
5097
|
+
if (backstagePopup && backstagePopup.classList.contains('e-popup-open')) {
|
|
5098
|
+
this.ribbonBackstageModule.hideBackstage();
|
|
5099
|
+
}
|
|
5100
|
+
this.ribbonKeyTipModule.createKeytip('tab');
|
|
5101
|
+
}
|
|
5102
|
+
else {
|
|
5103
|
+
this.ribbonKeyTipModule.removeKeytip();
|
|
5104
|
+
}
|
|
5105
|
+
}
|
|
5106
|
+
}
|
|
5107
|
+
else if (e.key === 'Escape' || e.key === 'Tab' || e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'ArrowRight' || e.key === 'ArrowDown') {
|
|
5108
|
+
this.ribbonKeyTipModule.removeKeytip(e.key);
|
|
5109
|
+
}
|
|
5110
|
+
else {
|
|
5111
|
+
var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
|
|
5112
|
+
if (keyTipItems) {
|
|
5113
|
+
for (var i = 0; i < keyTipItems.length; i++) {
|
|
5114
|
+
var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
|
|
5115
|
+
if (keyTipItem.innerHTML.toLowerCase() === keyPress) {
|
|
5116
|
+
isKeyTipPresent = true;
|
|
5117
|
+
this.ribbonKeyTipModule.keytipPress(keyPress);
|
|
5118
|
+
break;
|
|
5119
|
+
}
|
|
5120
|
+
}
|
|
5121
|
+
if (!isKeyTipPresent) {
|
|
5122
|
+
this.checkKeyTipPresent(keyPress, this.keysPress.length);
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
}
|
|
5126
|
+
}
|
|
5127
|
+
};
|
|
5128
|
+
Ribbon.prototype.checkKeyTipPresent = function (keyTip, length) {
|
|
5129
|
+
var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
|
|
5130
|
+
for (var i = 0; i < keyTipItems.length; i++) {
|
|
5131
|
+
var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
|
|
5132
|
+
if (keyTipItem.innerHTML.length > 1 && keyTipItem.innerHTML[parseInt(length.toString(), 10)].toLowerCase() === keyTip) {
|
|
5133
|
+
this.keysPress += keyTip;
|
|
5134
|
+
this.ribbonKeyTipModule.keytipPress(this.keysPress);
|
|
5135
|
+
this.removeKeytip(this.keysPress);
|
|
5136
|
+
break;
|
|
5137
|
+
}
|
|
5138
|
+
}
|
|
5139
|
+
};
|
|
5140
|
+
Ribbon.prototype.removeKeytip = function (keyTip) {
|
|
5141
|
+
var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
|
|
5142
|
+
for (var i = 0; i < keyTipItems.length; i++) {
|
|
5143
|
+
var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
|
|
5144
|
+
if (keyTipItem.innerHTML[0].toLowerCase() !== keyTip && keyTip !== '') {
|
|
5145
|
+
remove(keyTipItem);
|
|
5146
|
+
}
|
|
5147
|
+
}
|
|
5148
|
+
};
|
|
5149
|
+
Ribbon.prototype.addKeyTip = function (tabIndex, keyTip, id, type) {
|
|
5150
|
+
if (this.keyTipElements && this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
|
|
5151
|
+
var isKeyTipExist = false;
|
|
5152
|
+
/* eslint-disable */
|
|
5153
|
+
if (!(this.keyTipElements[parseInt(tabIndex.toString(), 10)][type])) {
|
|
5154
|
+
this.keyTipElements[parseInt(tabIndex.toString(), 10)][type] = [];
|
|
5155
|
+
}
|
|
5156
|
+
if (Object.keys(this.keyTipElements[tabIndex][type]).length) {
|
|
5157
|
+
var keytipData = this.keyTipElements[tabIndex][type];
|
|
5158
|
+
for (var i = 0; i < Object.keys(this.keyTipElements[tabIndex][type]).length; i++) {
|
|
5159
|
+
if (keytipData[parseInt(i.toString(), 10)].id === id) {
|
|
5160
|
+
isKeyTipExist = true;
|
|
5161
|
+
}
|
|
5162
|
+
}
|
|
5163
|
+
if (!isKeyTipExist) {
|
|
5164
|
+
this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
|
|
5165
|
+
}
|
|
5166
|
+
}
|
|
5167
|
+
else {
|
|
5168
|
+
this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
|
|
5169
|
+
}
|
|
5170
|
+
/* eslint-enable */
|
|
5171
|
+
}
|
|
4071
5172
|
};
|
|
4072
5173
|
Ribbon.prototype.renderTabs = function () {
|
|
4073
5174
|
this.tabsInternal = this.tabs.slice();
|
|
@@ -4130,14 +5231,33 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4130
5231
|
this.renderInitialTab(this.selectedTab);
|
|
4131
5232
|
};
|
|
4132
5233
|
Ribbon.prototype.ribbonTabSelected = function (e) {
|
|
5234
|
+
e.preventFocus = true;
|
|
4133
5235
|
this.isAddRemove = false;
|
|
4134
5236
|
var selectedTabId = e.selectedItem.getAttribute('data-id');
|
|
4135
5237
|
var selectedIndex = getIndex(this.tabs, (function (tab) { return (tab.id === selectedTabId); }));
|
|
4136
5238
|
selectedIndex = selectedIndex === -1 ? this.selectedTab : selectedIndex;
|
|
4137
|
-
var
|
|
5239
|
+
var isContextual = this.isContextualTab(selectedTabId);
|
|
5240
|
+
this.updateSelectedState(selectedTabId);
|
|
5241
|
+
var eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex, isContextual: isContextual };
|
|
4138
5242
|
this.setProperties({ selectedTab: selectedIndex }, true);
|
|
4139
5243
|
this.calculateHiddenElementsWidth(selectedIndex);
|
|
5244
|
+
if (this.isUpdateItems) {
|
|
5245
|
+
for (var i = 0; i < this.itemsModel.length; i++) {
|
|
5246
|
+
var item = this.itemsModel[parseInt(i.toString(), 10)];
|
|
5247
|
+
if (this.selectedTab === this.targetTabs[item.id]) {
|
|
5248
|
+
this.updateItem(item);
|
|
5249
|
+
this.itemsModel.splice(i, 1);
|
|
5250
|
+
i--;
|
|
5251
|
+
}
|
|
5252
|
+
}
|
|
5253
|
+
if (this.itemsModel.length === 0) {
|
|
5254
|
+
this.isUpdateItems = false;
|
|
5255
|
+
}
|
|
5256
|
+
}
|
|
4140
5257
|
this.checkOverflow(selectedIndex, e.selectedContent.firstChild);
|
|
5258
|
+
if (this.activeLayout === 'Classic' && this.ribbonGalleryModule) {
|
|
5259
|
+
this.ribbonGalleryModule.checkAvailableHeight(selectedIndex, e.selectedContent.firstChild);
|
|
5260
|
+
}
|
|
4141
5261
|
if (this.activeLayout === 'Simplified' && this.overflowDDB) {
|
|
4142
5262
|
var overflowTarget = this.overflowDDB.target;
|
|
4143
5263
|
var ofTabContainer = overflowTarget.querySelector('.' + RIBBON_TAB_ACTIVE);
|
|
@@ -4156,6 +5276,20 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4156
5276
|
}
|
|
4157
5277
|
this.trigger('tabSelected', eventArgs);
|
|
4158
5278
|
};
|
|
5279
|
+
Ribbon.prototype.updateSelectedState = function (tabID) {
|
|
5280
|
+
if (this.contextualTabs.length) {
|
|
5281
|
+
for (var i = 0; i < this.contextualTabs.length; i++) {
|
|
5282
|
+
var isSelected = false;
|
|
5283
|
+
for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
|
|
5284
|
+
if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
|
|
5285
|
+
isSelected = true;
|
|
5286
|
+
break;
|
|
5287
|
+
}
|
|
5288
|
+
}
|
|
5289
|
+
this.contextualTabs[parseInt(i.toString(), 10)].setProperties({ isSelected: isSelected }, true);
|
|
5290
|
+
}
|
|
5291
|
+
}
|
|
5292
|
+
};
|
|
4159
5293
|
Ribbon.prototype.checkOverflow = function (tabIndex, activeContent) {
|
|
4160
5294
|
var tabContent = activeContent.closest('.' + TAB_CONTENT);
|
|
4161
5295
|
var isOverFlow = tabContent.offsetWidth < activeContent.offsetWidth;
|
|
@@ -4205,6 +5339,17 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4205
5339
|
}
|
|
4206
5340
|
}
|
|
4207
5341
|
}
|
|
5342
|
+
this.addTabOverflowKeyTip();
|
|
5343
|
+
};
|
|
5344
|
+
Ribbon.prototype.addTabOverflowKeyTip = function () {
|
|
5345
|
+
var tabOverflow = this.tabObj.element.querySelector('#_nav');
|
|
5346
|
+
if (tabOverflow) {
|
|
5347
|
+
this.keyTipElements['taboverflow'] = [];
|
|
5348
|
+
this.keyTipElements['taboverflow'].push({ id: tabOverflow.id, type: 'taboverflow', keyTip: '00' });
|
|
5349
|
+
}
|
|
5350
|
+
else {
|
|
5351
|
+
delete (this.keyTipElements['taboverflow']);
|
|
5352
|
+
}
|
|
4208
5353
|
};
|
|
4209
5354
|
Ribbon.prototype.checkSimplifiedItemShrinking = function (tabIndex, tabContent, activeContent) {
|
|
4210
5355
|
var tab = this.tabs[parseInt(tabIndex.toString(), 10)];
|
|
@@ -4339,7 +5484,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4339
5484
|
item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
|
|
4340
5485
|
this.setItemSize(itemEle, item);
|
|
4341
5486
|
}
|
|
4342
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
5487
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
4343
5488
|
this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, true);
|
|
4344
5489
|
}
|
|
4345
5490
|
}
|
|
@@ -4369,7 +5514,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4369
5514
|
return isEmptyCollection;
|
|
4370
5515
|
};
|
|
4371
5516
|
Ribbon.prototype.updatePopupItems = function (item, itemEle, isGroupOF, isMenu) {
|
|
4372
|
-
var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
|
|
5517
|
+
var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.Gallery || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
|
|
4373
5518
|
var dropDownPopup = dropdown.dropDown;
|
|
4374
5519
|
// popup is on right if (isGroupOF && isMenu)
|
|
4375
5520
|
// The position is reversed if RTL is enabled.
|
|
@@ -4435,7 +5580,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4435
5580
|
break;
|
|
4436
5581
|
}
|
|
4437
5582
|
var groupEle = tabContent.querySelector('#' + collection.id);
|
|
4438
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
5583
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
4439
5584
|
this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
|
|
4440
5585
|
}
|
|
4441
5586
|
groupEle.append(itemContainer);
|
|
@@ -4554,19 +5699,22 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4554
5699
|
};
|
|
4555
5700
|
Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
|
|
4556
5701
|
var overflowButton;
|
|
5702
|
+
var overflowtarget;
|
|
4557
5703
|
var itemProp = getGroup(this.tabs, groupId);
|
|
4558
5704
|
var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
|
|
4559
5705
|
var groupEle = contentEle.querySelector('#' + groupId);
|
|
4560
5706
|
if (isGroupOF) {
|
|
4561
5707
|
var overflowDDB = groupContainer.querySelector('#' + groupId + GROUPOF_BUTTON_ID);
|
|
4562
5708
|
if (!overflowDDB) {
|
|
4563
|
-
overflowButton = this.addOverflowButton(groupId + GROUPOF_BUTTON_ID);
|
|
5709
|
+
overflowButton = this.addOverflowButton(groupId + GROUPOF_BUTTON_ID, isGroupOF);
|
|
4564
5710
|
overflowButton.element.classList.add(RIBBON_GROUP_OF_BUTTON);
|
|
4565
5711
|
groupContainer.appendChild(overflowButton.element);
|
|
4566
5712
|
}
|
|
4567
5713
|
else {
|
|
4568
5714
|
overflowButton = getInstance(overflowDDB, DropDownButton);
|
|
4569
5715
|
}
|
|
5716
|
+
this.addKeyTip(tabIndex, '0' + (itemProp.groupIndex + 1), overflowButton.element.id, 'grpofbtn');
|
|
5717
|
+
overflowtarget = overflowButton.target;
|
|
4570
5718
|
var overflowBtnTarget = overflowButton.target;
|
|
4571
5719
|
var headerEle = overflowBtnTarget.querySelector('#' + groupId + GROUPOF_BUTTON_ID + HEADER_ID);
|
|
4572
5720
|
if (!headerEle) {
|
|
@@ -4595,7 +5743,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4595
5743
|
}
|
|
4596
5744
|
else {
|
|
4597
5745
|
if (!this.overflowDDB) {
|
|
4598
|
-
this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + OVRLOF_BUTTON_ID);
|
|
5746
|
+
this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + OVRLOF_BUTTON_ID, isGroupOF);
|
|
4599
5747
|
this.tabObj.element.insertBefore(this.overflowDDB.element, this.collapseButton);
|
|
4600
5748
|
this.overflowDDB.element.classList.add(RIBBON_OVERALL_OF_BUTTON);
|
|
4601
5749
|
this.createOfTabContainer(groupId, groupHeader, itemEle, tabIndex);
|
|
@@ -4628,10 +5776,16 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4628
5776
|
}
|
|
4629
5777
|
}
|
|
4630
5778
|
overflowButton = this.overflowDDB;
|
|
5779
|
+
overflowtarget = this.overflowDDB ? this.overflowDDB.target : null;
|
|
4631
5780
|
}
|
|
4632
5781
|
if (itemEle !== null) {
|
|
4633
5782
|
this.addOverflowEvents(item, itemEle, overflowButton);
|
|
4634
5783
|
}
|
|
5784
|
+
if (overflowtarget) {
|
|
5785
|
+
if (item.keyTip) {
|
|
5786
|
+
this.addKeyTip(tabIndex, item.keyTip, item.id, 'popupitem');
|
|
5787
|
+
}
|
|
5788
|
+
}
|
|
4635
5789
|
};
|
|
4636
5790
|
Ribbon.prototype.addOverflowEvents = function (item, itemEle, overflowButton) {
|
|
4637
5791
|
switch (item.type) {
|
|
@@ -4653,6 +5807,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4653
5807
|
case 'ComboBox':
|
|
4654
5808
|
this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
|
|
4655
5809
|
break;
|
|
5810
|
+
case 'Gallery':
|
|
5811
|
+
if (this.activeLayout === 'Simplified') {
|
|
5812
|
+
this.ribbonGalleryModule.addOverFlowEvents(item, itemEle, overflowButton);
|
|
5813
|
+
}
|
|
5814
|
+
break;
|
|
4656
5815
|
case 'GroupButton':
|
|
4657
5816
|
if (this.activeLayout === 'Simplified') {
|
|
4658
5817
|
this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
|
|
@@ -5331,6 +6490,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5331
6490
|
this_1.checkSmallToMedium(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
|
|
5332
6491
|
this_1.checkMediumToLarge(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
|
|
5333
6492
|
var dropdown = this_1.ribbonDropDownModule.createOverFlowDropDown(group.id, group.header, group.groupIconCss, groupContainer, groupOverFlow, this_1.enableRtl);
|
|
6493
|
+
if (group.keyTip) {
|
|
6494
|
+
var overflowDDB = group.id + OVERFLOW_ID + DROPDOWN_ID;
|
|
6495
|
+
this_1.addKeyTip(tabIndex, group.keyTip, overflowDDB, 'grpoverflow');
|
|
6496
|
+
}
|
|
5334
6497
|
this_1.tabs[parseInt(tabIndex.toString(), 10)].
|
|
5335
6498
|
groups[parseInt(groupIndex.toString(), 10)].setProperties({ isCollapsed: true }, true);
|
|
5336
6499
|
for (var j = 0; j < group.collections.length; j++) {
|
|
@@ -5343,6 +6506,25 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5343
6506
|
this_1.handleContentSize(itemEle);
|
|
5344
6507
|
this_1.addOverflowEvents(item, itemEle, dropdown);
|
|
5345
6508
|
}
|
|
6509
|
+
var overflowDDB = document.querySelector('#' + group.id + OVERFLOW_ID + DROPDOWN_ID);
|
|
6510
|
+
var overflowButton = getInstance(overflowDDB, DropDownButton);
|
|
6511
|
+
if (overflowButton) {
|
|
6512
|
+
var overflowtarget = overflowButton.target;
|
|
6513
|
+
if (overflowtarget) {
|
|
6514
|
+
if (this_1.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
|
|
6515
|
+
if (item.type === RibbonItemType.GroupButton) {
|
|
6516
|
+
for (var i_3 = 0; i_3 < item.groupButtonSettings.items.length; i_3++) {
|
|
6517
|
+
if (item.groupButtonSettings.items[parseInt(i_3.toString(), 10)].keyTip) {
|
|
6518
|
+
this_1.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i_3.toString(), 10)].keyTip, item.id + (RIBBON_GROUP_BUTTON_ID + i_3), 'grpoverflowpopup');
|
|
6519
|
+
}
|
|
6520
|
+
}
|
|
6521
|
+
}
|
|
6522
|
+
if (item.keyTip) {
|
|
6523
|
+
this_1.addKeyTip(tabIndex, item.keyTip, item.id, 'grpoverflowpopup');
|
|
6524
|
+
}
|
|
6525
|
+
}
|
|
6526
|
+
}
|
|
6527
|
+
}
|
|
5346
6528
|
}
|
|
5347
6529
|
}
|
|
5348
6530
|
};
|
|
@@ -5441,16 +6623,31 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5441
6623
|
this.removeOverflowDropdown(activeContent, tabContent, true, index);
|
|
5442
6624
|
}
|
|
5443
6625
|
};
|
|
6626
|
+
Ribbon.prototype.isContextualTab = function (tabID) {
|
|
6627
|
+
var isContextual = false;
|
|
6628
|
+
if (this.contextualTabs.length) {
|
|
6629
|
+
for (var i = 0; i < this.contextualTabs.length; i++) {
|
|
6630
|
+
for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
|
|
6631
|
+
if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
|
|
6632
|
+
isContextual = true;
|
|
6633
|
+
break;
|
|
6634
|
+
}
|
|
6635
|
+
}
|
|
6636
|
+
}
|
|
6637
|
+
}
|
|
6638
|
+
return isContextual;
|
|
6639
|
+
};
|
|
5444
6640
|
Ribbon.prototype.ribbonTabSelecting = function (e) {
|
|
5445
6641
|
var _this = this;
|
|
5446
6642
|
this.currentControlIndex = 0;
|
|
5447
6643
|
var nextTabId = e.selectingItem.getAttribute('data-id');
|
|
5448
6644
|
var previousTabId = e.previousItem.getAttribute('data-id');
|
|
5449
6645
|
var nextIndex = getIndex(this.tabs, (function (tab) { return (tab.id === nextTabId); }));
|
|
6646
|
+
var isContextual = this.isContextualTab(nextTabId);
|
|
5450
6647
|
var previousIndex = getIndex(this.tabs, (function (tab) { return (tab.id === previousTabId); }));
|
|
5451
6648
|
nextIndex = nextIndex === -1 ? this.selectedTab : nextIndex;
|
|
5452
6649
|
var eventArgs = {
|
|
5453
|
-
cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex
|
|
6650
|
+
cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex, isContextual: isContextual
|
|
5454
6651
|
};
|
|
5455
6652
|
this.trigger('tabSelecting', eventArgs, function (args) {
|
|
5456
6653
|
if (args.cancel) {
|
|
@@ -5470,22 +6667,33 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5470
6667
|
Ribbon.prototype.createTabItems = function (tabs) {
|
|
5471
6668
|
var _this = this;
|
|
5472
6669
|
var tabItems = [];
|
|
5473
|
-
|
|
6670
|
+
var _loop_3 = function (i) {
|
|
5474
6671
|
var ribbonTab = tabs[parseInt(i.toString(), 10)];
|
|
5475
|
-
var header =
|
|
6672
|
+
var header = this_3.createElement('span', {
|
|
5476
6673
|
innerHTML: ribbonTab.header,
|
|
5477
6674
|
id: ribbonTab.id + HEADER_ID
|
|
5478
6675
|
});
|
|
6676
|
+
var tabIndex = getIndex(this_3.tabs, (function (tab) { return (tab.id === ribbonTab.id); }));
|
|
6677
|
+
if (ribbonTab.keyTip) {
|
|
6678
|
+
if (!this_3.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
|
|
6679
|
+
this_3.keyTipElements[parseInt(tabIndex.toString(), 10)] = {};
|
|
6680
|
+
}
|
|
6681
|
+
this_3.addKeyTip(tabIndex, ribbonTab.keyTip, ribbonTab.id, 'tab');
|
|
6682
|
+
}
|
|
5479
6683
|
header.onclick = function () { _this.minimize(false); };
|
|
5480
6684
|
header.ondblclick = function () { _this.minimize(true); };
|
|
5481
6685
|
var tab = { header: { text: header }, id: ribbonTab.id, cssClass: ribbonTab.cssClass };
|
|
5482
|
-
var content =
|
|
6686
|
+
var content = this_3.createElement('div', {
|
|
5483
6687
|
className: tab.cssClass,
|
|
5484
6688
|
id: ribbonTab.id + CONTENT_ID
|
|
5485
6689
|
});
|
|
5486
6690
|
content.classList.add(RIBBON_TAB_ITEM);
|
|
5487
6691
|
tab.content = content;
|
|
5488
6692
|
tabItems.push(tab);
|
|
6693
|
+
};
|
|
6694
|
+
var this_3 = this;
|
|
6695
|
+
for (var i = 0; i < tabs.length; i++) {
|
|
6696
|
+
_loop_3(i);
|
|
5489
6697
|
}
|
|
5490
6698
|
return tabItems;
|
|
5491
6699
|
};
|
|
@@ -5498,8 +6706,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5498
6706
|
}
|
|
5499
6707
|
var activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
|
|
5500
6708
|
this.checkOverflow(this.selectedTab, activeContent);
|
|
6709
|
+
if (this.activeLayout === 'Classic' && this.ribbonGalleryModule)
|
|
6710
|
+
this.ribbonGalleryModule.checkAvailableHeight(this.selectedTab, activeContent);
|
|
5501
6711
|
};
|
|
5502
|
-
Ribbon.prototype.addOverflowButton = function (btnId) {
|
|
6712
|
+
Ribbon.prototype.addOverflowButton = function (btnId, isGroupOF) {
|
|
5503
6713
|
var _this = this;
|
|
5504
6714
|
var overflowButton = this.createElement('button', {
|
|
5505
6715
|
id: btnId
|
|
@@ -5536,6 +6746,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5536
6746
|
}, overflowButton);
|
|
5537
6747
|
this.element.classList.add(RIBBON_OVERFLOW);
|
|
5538
6748
|
createTooltip(overflowTarget, this);
|
|
6749
|
+
if (!isGroupOF) {
|
|
6750
|
+
this.keyTipElements['overflowbtn'] = [];
|
|
6751
|
+
this.keyTipElements['overflowbtn'].push({ id: btnId, type: 'overflowbtn', keyTip: '00' });
|
|
6752
|
+
}
|
|
5539
6753
|
var isGroupOf;
|
|
5540
6754
|
overflowButton.onkeydown = overflowButton.onclick = function () { _this.itemIndex = -1; isGroupOf = overflowButton.classList.contains('e-ribbon-overall-of-btn') ? false : true; };
|
|
5541
6755
|
overflowTarget.onkeydown = function (e) { return (_this.upDownKeyHandler(e, overflowTarget, isGroupOf), _this); };
|
|
@@ -5696,6 +6910,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5696
6910
|
case 'ComboBox':
|
|
5697
6911
|
this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
|
|
5698
6912
|
break;
|
|
6913
|
+
case 'Gallery':
|
|
6914
|
+
this.ribbonGalleryModule.removeOverFlowEvents(item, itemEle);
|
|
6915
|
+
break;
|
|
5699
6916
|
case 'GroupButton':
|
|
5700
6917
|
this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
|
|
5701
6918
|
break;
|
|
@@ -5733,6 +6950,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5733
6950
|
this.collapseButton.classList.add(RIBBON_EXPAND_BUTTON);
|
|
5734
6951
|
}
|
|
5735
6952
|
this.tabObj.element.appendChild(this.collapseButton);
|
|
6953
|
+
if (this.layoutSwitcherKeyTip) {
|
|
6954
|
+
this.keyTipElements['collapse'] = [];
|
|
6955
|
+
this.keyTipElements['collapse'].push({ id: this.collapseButton.id, type: 'collapse', keyTip: this.layoutSwitcherKeyTip });
|
|
6956
|
+
}
|
|
5736
6957
|
};
|
|
5737
6958
|
Ribbon.prototype.removeExpandCollapse = function () {
|
|
5738
6959
|
var _this = this;
|
|
@@ -5835,22 +7056,22 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5835
7056
|
var activeContent = this.tabObj.element.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + CONTENT_ID);
|
|
5836
7057
|
var tabContent = activeContent.closest('.' + TAB_CONTENT);
|
|
5837
7058
|
if (this.activeLayout === 'Simplified') {
|
|
5838
|
-
for (var
|
|
5839
|
-
var group = groupList[parseInt(
|
|
5840
|
-
var alignType = groupList[parseInt(
|
|
7059
|
+
for (var i_4 = 0; i_4 < groupList.length; i_4++) {
|
|
7060
|
+
var group = groupList[parseInt(i_4.toString(), 10)];
|
|
7061
|
+
var alignType = groupList[parseInt(i_4.toString(), 10)].orientation;
|
|
5841
7062
|
if (group.isCollapsed) {
|
|
5842
7063
|
group.setProperties({ isCollapsed: false }, true);
|
|
5843
7064
|
this.removeDropdown(group.id);
|
|
5844
7065
|
}
|
|
5845
7066
|
else {
|
|
5846
|
-
this.checkSmallToMedium(tabIndex, tab,
|
|
5847
|
-
this.checkMediumToLarge(tabIndex, tab,
|
|
7067
|
+
this.checkSmallToMedium(tabIndex, tab, i_4, tabContent, activeContent, true, false);
|
|
7068
|
+
this.checkMediumToLarge(tabIndex, tab, i_4, tabContent, activeContent, true, false);
|
|
5848
7069
|
}
|
|
5849
7070
|
var groupEle = tabContent.querySelector('#' + group.id);
|
|
5850
7071
|
var groupContainer = groupEle.querySelector('#' + group.id + CONTAINER_ID);
|
|
5851
7072
|
var shrinkColumns = groupContainer.querySelectorAll('.' + 'e-ribbon-shrink');
|
|
5852
|
-
for (var
|
|
5853
|
-
shrinkColumns[parseInt(
|
|
7073
|
+
for (var i_5 = 0; i_5 < shrinkColumns.length; i_5++) {
|
|
7074
|
+
shrinkColumns[parseInt(i_5.toString(), 10)].remove();
|
|
5854
7075
|
}
|
|
5855
7076
|
var groupHeader = groupContainer.querySelector('#' + group.id + HEADER_ID);
|
|
5856
7077
|
groupHeader.remove();
|
|
@@ -5896,7 +7117,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5896
7117
|
itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
|
|
5897
7118
|
if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
|
|
5898
7119
|
this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemEle, groupContainer);
|
|
5899
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
7120
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
5900
7121
|
this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
|
|
5901
7122
|
}
|
|
5902
7123
|
}
|
|
@@ -5909,6 +7130,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5909
7130
|
this.setItemSize(ele, item);
|
|
5910
7131
|
}
|
|
5911
7132
|
}
|
|
7133
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
7134
|
+
this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
|
|
7135
|
+
}
|
|
5912
7136
|
}
|
|
5913
7137
|
}
|
|
5914
7138
|
if (!(group.enableGroupOverflow || groupEle.querySelector('.' + RIBBON_ITEM))) {
|
|
@@ -5918,9 +7142,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5918
7142
|
}
|
|
5919
7143
|
else {
|
|
5920
7144
|
this.element.classList.remove(RIBBON_OVERFLOW);
|
|
5921
|
-
for (var
|
|
5922
|
-
var group = groupList[parseInt(
|
|
5923
|
-
var alignType = groupList[parseInt(
|
|
7145
|
+
for (var i_6 = 0; i_6 < groupList.length; i_6++) {
|
|
7146
|
+
var group = groupList[parseInt(i_6.toString(), 10)];
|
|
7147
|
+
var alignType = groupList[parseInt(i_6.toString(), 10)].orientation;
|
|
5924
7148
|
var groupContainer = tabContent.querySelector('#' + group.id + CONTAINER_ID);
|
|
5925
7149
|
var groupContent = groupContainer.querySelector('#' + group.id + CONTENT_ID);
|
|
5926
7150
|
var groupHeader = this.createElement('div', {
|
|
@@ -5992,7 +7216,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5992
7216
|
var itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
|
|
5993
7217
|
if (!itemEle && overflowtarget) {
|
|
5994
7218
|
itemEle = overflowtarget.querySelector('#' + item.id + CONTAINER_ID);
|
|
5995
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
7219
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
5996
7220
|
this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
|
|
5997
7221
|
}
|
|
5998
7222
|
this.removeOverflowEvent(item, itemEle);
|
|
@@ -6012,6 +7236,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6012
7236
|
(item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
|
|
6013
7237
|
item.setProperties({ activeSize: itemsize }, true);
|
|
6014
7238
|
this.setItemSize(ele, item);
|
|
7239
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
7240
|
+
this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
|
|
7241
|
+
}
|
|
6015
7242
|
}
|
|
6016
7243
|
if (group.enableGroupOverflow && overflowDDB) {
|
|
6017
7244
|
if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
|
|
@@ -6031,7 +7258,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6031
7258
|
this.overflowDDB = null;
|
|
6032
7259
|
}
|
|
6033
7260
|
};
|
|
6034
|
-
Ribbon.prototype.createLauncherIcon = function (groupId, groupContainer) {
|
|
7261
|
+
Ribbon.prototype.createLauncherIcon = function (groupId, groupContainer, tabIndex) {
|
|
6035
7262
|
var _this = this;
|
|
6036
7263
|
var launcherIcon = this.createElement('div', {
|
|
6037
7264
|
className: RIBBON_LAUNCHER_ICON_ELE + ' ' + (this.launcherIconCss ? this.launcherIconCss : RIBBON_LAUNCHER_ICON),
|
|
@@ -6046,6 +7273,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6046
7273
|
_this.launcherIconClicked(groupId);
|
|
6047
7274
|
}
|
|
6048
7275
|
}, this);
|
|
7276
|
+
var itemProp = getGroup(this.tabs, groupId);
|
|
7277
|
+
if (itemProp.group.launcherIconKeyTip) {
|
|
7278
|
+
this.addKeyTip(tabIndex, itemProp.group.launcherIconKeyTip, launcherIcon.id, 'launcher');
|
|
7279
|
+
}
|
|
6049
7280
|
};
|
|
6050
7281
|
Ribbon.prototype.launcherIconClicked = function (id) {
|
|
6051
7282
|
var eventArgs = { groupId: id };
|
|
@@ -6083,7 +7314,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6083
7314
|
groupContainer.appendChild(groupHeader);
|
|
6084
7315
|
}
|
|
6085
7316
|
if (group.showLauncherIcon) {
|
|
6086
|
-
this.createLauncherIcon(group.id, groupContainer);
|
|
7317
|
+
this.createLauncherIcon(group.id, groupContainer, tabIndex);
|
|
6087
7318
|
}
|
|
6088
7319
|
var elements = this.createCollection(group.collections, group.orientation, group.id, group.header, group.enableGroupOverflow, tabIndex, groupContainer);
|
|
6089
7320
|
append(elements, groupContent);
|
|
@@ -6210,6 +7441,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6210
7441
|
case 'GroupButton':
|
|
6211
7442
|
this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
|
|
6212
7443
|
break;
|
|
7444
|
+
case 'Gallery':
|
|
7445
|
+
this.ribbonGalleryModule.createGallery(item, itemEle);
|
|
7446
|
+
break;
|
|
6213
7447
|
}
|
|
6214
7448
|
};
|
|
6215
7449
|
Ribbon.prototype.createItems = function (itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
|
|
@@ -6243,17 +7477,34 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6243
7477
|
itemEle.classList.add(RIBBON_TOOLTIP_TARGET);
|
|
6244
7478
|
this.tooltipData.push({ id: itemEle.id, data: item.ribbonTooltipSettings });
|
|
6245
7479
|
}
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
7480
|
+
if (item.type === RibbonItemType.GroupButton) {
|
|
7481
|
+
for (var i_7 = 0; i_7 < item.groupButtonSettings.items.length; i_7++) {
|
|
7482
|
+
if (this.keyTipElements[parseInt(tabIndex.toString(), 10)] && item.groupButtonSettings.items[parseInt(i_7.toString(), 10)].keyTip) {
|
|
7483
|
+
this.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i_7.toString(), 10)].keyTip, item.id + (RIBBON_GROUP_BUTTON_ID + i_7), 'item');
|
|
7484
|
+
}
|
|
7485
|
+
}
|
|
6251
7486
|
}
|
|
6252
|
-
if (
|
|
6253
|
-
|
|
7487
|
+
if (item.keyTip) {
|
|
7488
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
7489
|
+
this.addKeyTip(tabIndex, item.keyTip, (item.id + '_popupButton'), 'item');
|
|
7490
|
+
}
|
|
7491
|
+
else {
|
|
7492
|
+
this.addKeyTip(tabIndex, item.keyTip, item.id, 'item');
|
|
7493
|
+
}
|
|
6254
7494
|
}
|
|
6255
|
-
|
|
6256
|
-
|
|
7495
|
+
var size = item.activeSize;
|
|
7496
|
+
if (!(item.type === RibbonItemType.Gallery)) {
|
|
7497
|
+
if (this.activeLayout === 'Simplified') {
|
|
7498
|
+
size = ((item.allowedSizes === RibbonItemSize.Large) || (item.allowedSizes & RibbonItemSize.Medium) ||
|
|
7499
|
+
(item.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
|
|
7500
|
+
item.setProperties({ activeSize: size }, true);
|
|
7501
|
+
}
|
|
7502
|
+
if (size & RibbonItemSize.Large) {
|
|
7503
|
+
itemEle.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
|
|
7504
|
+
}
|
|
7505
|
+
else {
|
|
7506
|
+
itemEle.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
|
|
7507
|
+
}
|
|
6257
7508
|
}
|
|
6258
7509
|
var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
|
|
6259
7510
|
if (initialProps && initialProps.hiddenItems && initialProps.hiddenItems.length) {
|
|
@@ -6265,7 +7516,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6265
7516
|
this.createRibbonItem(item, itemEle);
|
|
6266
7517
|
if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
|
|
6267
7518
|
this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
|
|
6268
|
-
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
7519
|
+
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
6269
7520
|
this.updatePopupItems(item, itemEle, isGroupOF, true);
|
|
6270
7521
|
}
|
|
6271
7522
|
}
|
|
@@ -6394,15 +7645,15 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6394
7645
|
var moduleName = this.getItemModuleName(item);
|
|
6395
7646
|
if (moduleName !== 'template') {
|
|
6396
7647
|
if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
|
|
6397
|
-
for (var
|
|
6398
|
-
var btnEle = ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID +
|
|
7648
|
+
for (var i_8 = 0; i_8 < item.groupButtonSettings.items.length; i_8++) {
|
|
7649
|
+
var btnEle = ele.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i_8);
|
|
6399
7650
|
updateCommonProperty(btnEle, 'btn', commonProp);
|
|
6400
7651
|
}
|
|
6401
7652
|
}
|
|
6402
7653
|
else if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
|
|
6403
7654
|
updateCommonProperty(ele, 'dropdown-btn', commonProp);
|
|
6404
|
-
for (var
|
|
6405
|
-
var btnEle = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID +
|
|
7655
|
+
for (var i_9 = 0; i_9 < item.groupButtonSettings.items.length; i_9++) {
|
|
7656
|
+
var btnEle = document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i_9);
|
|
6406
7657
|
updateCommonProperty(btnEle, 'btn', commonProp);
|
|
6407
7658
|
}
|
|
6408
7659
|
}
|
|
@@ -6462,12 +7713,18 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6462
7713
|
ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + RIBBON_GROUP_BUTTON_ID) :
|
|
6463
7714
|
contentEle.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID);
|
|
6464
7715
|
}
|
|
7716
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
7717
|
+
ele = contentEle.querySelector('#' + item.id + CONTAINER_ID);
|
|
7718
|
+
}
|
|
6465
7719
|
}
|
|
6466
7720
|
}
|
|
6467
7721
|
else {
|
|
6468
7722
|
//Checks for Simplified and Auto options (Auto = classic + simplified + popup)
|
|
6469
7723
|
ele = (item.displayOptions & DisplayMode.Simplified) ?
|
|
6470
7724
|
contentEle.querySelector('#' + item.id) : null;
|
|
7725
|
+
if (item.type === RibbonItemType.Gallery) {
|
|
7726
|
+
ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id + CONTAINER_ID) : null;
|
|
7727
|
+
}
|
|
6471
7728
|
// element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
|
|
6472
7729
|
if (!ele) {
|
|
6473
7730
|
ele = dropdown ? dropdown.target.querySelector('#' + item.id) : null;
|
|
@@ -6508,18 +7765,42 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6508
7765
|
else {
|
|
6509
7766
|
this.ribbonGroupButtonModule.destroyDropDown(item);
|
|
6510
7767
|
}
|
|
6511
|
-
var
|
|
7768
|
+
var _loop_4 = function (i) {
|
|
6512
7769
|
if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings) {
|
|
6513
7770
|
var groupButtonID_1 = item.id + RIBBON_GROUP_BUTTON_ID + i;
|
|
6514
|
-
var index = getIndex(
|
|
7771
|
+
var index = getIndex(this_4.tooltipData, function (e) { return e.id === groupButtonID_1; });
|
|
6515
7772
|
if (index !== -1) {
|
|
6516
|
-
|
|
7773
|
+
this_4.tooltipData.splice(index, 1);
|
|
6517
7774
|
}
|
|
6518
7775
|
}
|
|
6519
7776
|
};
|
|
6520
|
-
var
|
|
7777
|
+
var this_4 = this;
|
|
6521
7778
|
for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
|
|
6522
|
-
|
|
7779
|
+
_loop_4(i);
|
|
7780
|
+
}
|
|
7781
|
+
}
|
|
7782
|
+
else if (moduleName === 'gallery') {
|
|
7783
|
+
if (ele.closest('.e-ribbon-overflow-target')) {
|
|
7784
|
+
destroyControl(ele, 'dropdown-btn');
|
|
7785
|
+
var galleryPopupEle = Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '_galleryPopup'));
|
|
7786
|
+
galleryPopupEle.concat(Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '-popup')));
|
|
7787
|
+
for (var i = 0; i < galleryPopupEle.length; i++) {
|
|
7788
|
+
galleryPopupEle[parseInt(i.toString(), 10)].remove();
|
|
7789
|
+
}
|
|
7790
|
+
}
|
|
7791
|
+
else {
|
|
7792
|
+
var galleryEle = ele.querySelectorAll('.e-ribbon-gallery-item');
|
|
7793
|
+
var galleryPopupBtn = ele.querySelector('#' + item.id + '_popupButton');
|
|
7794
|
+
if (galleryPopupBtn) {
|
|
7795
|
+
galleryPopupBtn.remove();
|
|
7796
|
+
}
|
|
7797
|
+
for (var i = 0; i < galleryEle.length; i++) {
|
|
7798
|
+
galleryEle[parseInt(i.toString(), 10)].remove();
|
|
7799
|
+
}
|
|
7800
|
+
var galleryPopupEle = document.querySelectorAll('#' + item.id + '_galleryPopup');
|
|
7801
|
+
for (var i = 0; i < galleryPopupEle.length; i++) {
|
|
7802
|
+
galleryPopupEle[parseInt(i.toString(), 10)].remove();
|
|
7803
|
+
}
|
|
6523
7804
|
}
|
|
6524
7805
|
}
|
|
6525
7806
|
else if (moduleName !== 'template') {
|
|
@@ -6535,6 +7816,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6535
7816
|
this.ribbonGroupButtonModule.destroyDropDown(item);
|
|
6536
7817
|
}
|
|
6537
7818
|
};
|
|
7819
|
+
/**
|
|
7820
|
+
* Gets the item module name.
|
|
7821
|
+
*
|
|
7822
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
7823
|
+
* @returns {void}
|
|
7824
|
+
* @hidden
|
|
7825
|
+
*/
|
|
6538
7826
|
Ribbon.prototype.getItemModuleName = function (item) {
|
|
6539
7827
|
switch (item.type) {
|
|
6540
7828
|
case 'Button':
|
|
@@ -6551,6 +7839,8 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6551
7839
|
return 'combobox';
|
|
6552
7840
|
case 'GroupButton':
|
|
6553
7841
|
return 'group-btn';
|
|
7842
|
+
case 'Gallery':
|
|
7843
|
+
return 'gallery';
|
|
6554
7844
|
default:
|
|
6555
7845
|
return 'template';
|
|
6556
7846
|
}
|
|
@@ -6590,8 +7880,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6590
7880
|
* @param {string} tabId - The ID of the tab to be shown.
|
|
6591
7881
|
* @returns {void}
|
|
6592
7882
|
*/
|
|
6593
|
-
Ribbon.prototype.showTab = function (tabId) {
|
|
6594
|
-
|
|
7883
|
+
Ribbon.prototype.showTab = function (tabId, isContextual) {
|
|
7884
|
+
if (isContextual === void 0) { isContextual = false; }
|
|
7885
|
+
this.showHideTab(tabId, false, isContextual);
|
|
6595
7886
|
};
|
|
6596
7887
|
/**
|
|
6597
7888
|
* Hides a specific tab in the ribbon.
|
|
@@ -6599,15 +7890,49 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6599
7890
|
* @param {string} tabId - The ID of the tab to be hidden.
|
|
6600
7891
|
* @returns {void}
|
|
6601
7892
|
*/
|
|
6602
|
-
Ribbon.prototype.hideTab = function (tabId) {
|
|
6603
|
-
|
|
7893
|
+
Ribbon.prototype.hideTab = function (tabId, isContextual) {
|
|
7894
|
+
if (isContextual === void 0) { isContextual = false; }
|
|
7895
|
+
this.showHideTab(tabId, true, isContextual);
|
|
6604
7896
|
};
|
|
6605
|
-
Ribbon.prototype.showHideTab = function (tabId, value) {
|
|
7897
|
+
Ribbon.prototype.showHideTab = function (tabId, value, isContextual) {
|
|
6606
7898
|
var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
|
|
6607
7899
|
if (index === -1) {
|
|
6608
7900
|
return;
|
|
6609
7901
|
}
|
|
6610
7902
|
this.tabObj.hideTab(index, value);
|
|
7903
|
+
if (isContextual) {
|
|
7904
|
+
var contextualTab_1;
|
|
7905
|
+
var tabEle = this.tabObj.element;
|
|
7906
|
+
for (var i = 0; i < this.contextualTabs.length; i++) {
|
|
7907
|
+
for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
|
|
7908
|
+
if (tabId === this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id) {
|
|
7909
|
+
contextualTab_1 = this.contextualTabs[parseInt(i.toString(), 10)];
|
|
7910
|
+
}
|
|
7911
|
+
}
|
|
7912
|
+
}
|
|
7913
|
+
if (contextualTab_1) {
|
|
7914
|
+
var isTabHidden = true;
|
|
7915
|
+
var _loop_5 = function (i) {
|
|
7916
|
+
var index_1 = getIndex(this_5.tabs, function (e) { return e.id === contextualTab_1.tabs[parseInt(i.toString(), 10)].id; });
|
|
7917
|
+
if (index_1 !== -1) {
|
|
7918
|
+
var toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index_1.toString(), 10)];
|
|
7919
|
+
if (!(toolbarEle.classList.contains('e-hidden'))) {
|
|
7920
|
+
isTabHidden = false;
|
|
7921
|
+
}
|
|
7922
|
+
}
|
|
7923
|
+
};
|
|
7924
|
+
var this_5 = this;
|
|
7925
|
+
for (var i = 0; i < contextualTab_1.tabs.length; i++) {
|
|
7926
|
+
_loop_5(i);
|
|
7927
|
+
}
|
|
7928
|
+
if (isTabHidden) {
|
|
7929
|
+
contextualTab_1.setProperties({ visible: false }, true);
|
|
7930
|
+
}
|
|
7931
|
+
else {
|
|
7932
|
+
contextualTab_1.setProperties({ visible: true }, true);
|
|
7933
|
+
}
|
|
7934
|
+
}
|
|
7935
|
+
}
|
|
6611
7936
|
};
|
|
6612
7937
|
/**
|
|
6613
7938
|
* Enables a specific tab in the ribbon.
|
|
@@ -6914,8 +8239,8 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6914
8239
|
var hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
|
|
6915
8240
|
/* eslint-disable */
|
|
6916
8241
|
if (hiddenProps && hiddenProps[key] && hiddenProps[key].length) {
|
|
6917
|
-
var
|
|
6918
|
-
var contentEle =
|
|
8242
|
+
var _loop_6 = function (i) {
|
|
8243
|
+
var contentEle = this_6.tabObj.items[tabIndex].content;
|
|
6919
8244
|
var hiddenEle;
|
|
6920
8245
|
var groupEle = void 0;
|
|
6921
8246
|
var isGroupHidden = false;
|
|
@@ -6937,11 +8262,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6937
8262
|
groupEle = hiddenEle.closest('.e-ribbon-group');
|
|
6938
8263
|
if (groupEle.classList.contains('e-hide-group')) {
|
|
6939
8264
|
isGroupHidden = true;
|
|
6940
|
-
widthDifference =
|
|
8265
|
+
widthDifference = this_6.checkWidthDifference(hiddenEle, groupEle);
|
|
6941
8266
|
}
|
|
6942
8267
|
}
|
|
6943
|
-
|
|
6944
|
-
|
|
8268
|
+
this_6.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, true, tabIndex);
|
|
8269
|
+
this_6.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, true);
|
|
6945
8270
|
if (isHidden) {
|
|
6946
8271
|
hiddenEle.classList.add('e-hidden');
|
|
6947
8272
|
}
|
|
@@ -6954,12 +8279,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6954
8279
|
groupEle.classList.remove('e-hide-group');
|
|
6955
8280
|
groupEle.classList.remove('e-ribbon-emptyCollection');
|
|
6956
8281
|
widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
|
|
6957
|
-
if (
|
|
6958
|
-
|
|
8282
|
+
if (this_6.hiddenGroups.indexOf(groupEle.id) !== -1) {
|
|
8283
|
+
this_6.hiddenGroups.splice(this_6.hiddenGroups.indexOf(groupEle.id), 1);
|
|
6959
8284
|
}
|
|
6960
8285
|
}
|
|
6961
8286
|
else {
|
|
6962
|
-
if (
|
|
8287
|
+
if (this_6.hiddenGroups.indexOf(groupEle.id) !== -1) {
|
|
6963
8288
|
var hiddenItems = groupEle.querySelectorAll('.e-ribbon-item:not(.e-hidden)');
|
|
6964
8289
|
hiddenItems.forEach(function (item) {
|
|
6965
8290
|
if (item.id !== hiddenEle.id) {
|
|
@@ -6972,12 +8297,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6972
8297
|
item.classList.remove('e-hidden');
|
|
6973
8298
|
}
|
|
6974
8299
|
});
|
|
6975
|
-
|
|
8300
|
+
this_6.hiddenGroups.splice(this_6.hiddenGroups.indexOf(groupEle.id), 1);
|
|
6976
8301
|
}
|
|
6977
8302
|
}
|
|
6978
8303
|
}
|
|
6979
|
-
|
|
6980
|
-
|
|
8304
|
+
this_6.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, false, tabIndex);
|
|
8305
|
+
this_6.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, false);
|
|
6981
8306
|
}
|
|
6982
8307
|
if (isGroupHidden) {
|
|
6983
8308
|
groupEle.classList.add('e-hide-group');
|
|
@@ -6991,9 +8316,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6991
8316
|
}
|
|
6992
8317
|
out_i_1 = i;
|
|
6993
8318
|
};
|
|
6994
|
-
var
|
|
8319
|
+
var this_6 = this, out_i_1;
|
|
6995
8320
|
for (var i = 0; i < hiddenProps[key].length; i++) {
|
|
6996
|
-
|
|
8321
|
+
_loop_6(i);
|
|
6997
8322
|
i = out_i_1;
|
|
6998
8323
|
}
|
|
6999
8324
|
}
|
|
@@ -7044,9 +8369,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
7044
8369
|
var overflowButton = getInstance(groupOFButton[parseInt(i.toString(), 10)], DropDownButton);
|
|
7045
8370
|
var overflowBtnTarget = overflowButton.target;
|
|
7046
8371
|
var overflowItems = overflowBtnTarget.querySelectorAll('.e-ribbon-item');
|
|
7047
|
-
for (var
|
|
7048
|
-
if (overflowItems[parseInt(
|
|
7049
|
-
mediumDataItems.push(overflowItems[parseInt(
|
|
8372
|
+
for (var i_10 = 0; i_10 < overflowItems.length; i_10++) {
|
|
8373
|
+
if (overflowItems[parseInt(i_10.toString(), 10)].hasAttribute('data-medium-width')) {
|
|
8374
|
+
mediumDataItems.push(overflowItems[parseInt(i_10.toString(), 10)]);
|
|
7050
8375
|
}
|
|
7051
8376
|
}
|
|
7052
8377
|
}
|
|
@@ -7073,10 +8398,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
7073
8398
|
if (overflowButton) {
|
|
7074
8399
|
var overflowEle = overflowButton.target;
|
|
7075
8400
|
var overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
|
|
7076
|
-
for (var
|
|
7077
|
-
var previousWidth = parseInt(overflowItems[parseInt(
|
|
8401
|
+
for (var i_11 = 0; i_11 < overflowItems.length; i_11++) {
|
|
8402
|
+
var previousWidth = parseInt(overflowItems[parseInt(i_11.toString(), 10)].getAttribute('data-simplified-width'), 10);
|
|
7078
8403
|
if (previousWidth) {
|
|
7079
|
-
overflowItems[parseInt(
|
|
8404
|
+
overflowItems[parseInt(i_11.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
|
|
7080
8405
|
}
|
|
7081
8406
|
}
|
|
7082
8407
|
}
|
|
@@ -7626,7 +8951,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
7626
8951
|
if (contentEle.innerHTML !== '') {
|
|
7627
8952
|
// Check whether showLauncherIcon or orientation is passed by the user and sets the updated values.
|
|
7628
8953
|
if (group.showLauncherIcon) {
|
|
7629
|
-
this.createLauncherIcon(ribbongroup.id, groupContainer);
|
|
8954
|
+
this.createLauncherIcon(ribbongroup.id, groupContainer, itemProp.tabIndex);
|
|
7630
8955
|
}
|
|
7631
8956
|
// Check whether collections or orientation is passed by the user and sets the updated values.
|
|
7632
8957
|
if (group.collections || group.orientation) {
|
|
@@ -7746,96 +9071,111 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
7746
9071
|
//Check whether the tab items are rendered
|
|
7747
9072
|
var contentEle = this.tabObj.items[itemProp.tabIndex].content;
|
|
7748
9073
|
var groupEle = contentEle.querySelector('#' + itemProp.group.id);
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
if (
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
collectionEle
|
|
9074
|
+
if (groupEle) {
|
|
9075
|
+
var groupContainer = groupEle.querySelector('#' + itemProp.group.id + CONTAINER_ID);
|
|
9076
|
+
var itemContainer = null;
|
|
9077
|
+
var itemEle = null;
|
|
9078
|
+
var dropdownElement = void 0;
|
|
9079
|
+
var dropdown = void 0;
|
|
9080
|
+
if (contentEle.innerHTML !== '') {
|
|
9081
|
+
if (this.activeLayout === RibbonLayout.Simplified) {
|
|
9082
|
+
dropdownElement = itemProp.group.enableGroupOverflow ?
|
|
9083
|
+
contentEle.querySelector('#' + itemProp.group.id + GROUPOF_BUTTON_ID) : null;
|
|
9084
|
+
dropdown = dropdownElement ? getComponent(dropdownElement, DropDownButton) : this.overflowDDB;
|
|
9085
|
+
}
|
|
9086
|
+
if (this.activeLayout === RibbonLayout.Simplified && itemProp.item.displayOptions === DisplayMode.Overflow) {
|
|
9087
|
+
itemContainer = dropdown.target.querySelector('#' + itemId + CONTAINER_ID);
|
|
9088
|
+
itemEle = dropdown.target.querySelector('#' + itemId);
|
|
9089
|
+
if (item.displayOptions && item.displayOptions !== DisplayMode.Overflow) {
|
|
9090
|
+
var collectionEle = groupContainer.querySelector('#' + itemProp.collection.id);
|
|
9091
|
+
if (collectionEle) {
|
|
9092
|
+
collectionEle.appendChild(itemContainer);
|
|
9093
|
+
}
|
|
7767
9094
|
}
|
|
7768
9095
|
}
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
9096
|
+
else {
|
|
9097
|
+
itemContainer = groupContainer.querySelector('#' + itemId + CONTAINER_ID);
|
|
9098
|
+
itemEle = contentEle.querySelector('#' + itemId);
|
|
9099
|
+
if (itemProp.item.type === 'GroupButton' && this.activeLayout === RibbonLayout.Classic) {
|
|
9100
|
+
itemEle = contentEle.querySelector('#' + itemId + RIBBON_GROUP_BUTTON_ID);
|
|
9101
|
+
}
|
|
9102
|
+
if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
|
|
9103
|
+
this.createOverflowPopup(itemProp.item, itemProp.tabIndex, itemProp.group.enableGroupOverflow, itemProp.group.id, itemProp.group.header, itemContainer, groupContainer);
|
|
9104
|
+
if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) ||
|
|
9105
|
+
(item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
|
|
9106
|
+
this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
|
|
9107
|
+
}
|
|
9108
|
+
}
|
|
7775
9109
|
}
|
|
7776
|
-
if
|
|
7777
|
-
|
|
7778
|
-
if (
|
|
7779
|
-
|
|
9110
|
+
// Check whether cssClass is passed by the user, and if it is, then remove the old values.
|
|
9111
|
+
if (item.cssClass) {
|
|
9112
|
+
if (itemProp.item.cssClass) {
|
|
9113
|
+
itemContainer.classList.remove(itemProp.item.cssClass);
|
|
7780
9114
|
}
|
|
7781
9115
|
}
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
if (
|
|
7786
|
-
itemContainer
|
|
9116
|
+
this.destroyFunction(itemProp.item, itemEle);
|
|
9117
|
+
itemEle.remove();
|
|
9118
|
+
var removeCss = itemContainer.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g);
|
|
9119
|
+
if (removeCss) {
|
|
9120
|
+
removeClass([itemContainer], removeCss);
|
|
7787
9121
|
}
|
|
7788
9122
|
}
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
if (
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
}
|
|
7796
|
-
var ribbonItem = itemProp.item;
|
|
7797
|
-
ribbonItem.setProperties(item, true);
|
|
7798
|
-
this.validateItemSize();
|
|
7799
|
-
if (contentEle.innerHTML !== '') {
|
|
7800
|
-
if (!(this.activeLayout === RibbonLayout.Simplified && ribbonItem.displayOptions === DisplayMode.Overflow)) {
|
|
7801
|
-
itemContainer = groupContainer.querySelector('#' + itemId + CONTAINER_ID);
|
|
7802
|
-
}
|
|
7803
|
-
else {
|
|
7804
|
-
itemContainer = dropdown.target.querySelector('#' + itemId + CONTAINER_ID);
|
|
7805
|
-
}
|
|
7806
|
-
// To avoid undefined items condition is added
|
|
7807
|
-
if (ribbonItem.ribbonTooltipSettings && isTooltipPresent(ribbonItem.ribbonTooltipSettings)) {
|
|
7808
|
-
itemContainer.classList.add(RIBBON_TOOLTIP_TARGET);
|
|
7809
|
-
this.tooltipData.push({ id: itemContainer.id, data: ribbonItem.ribbonTooltipSettings });
|
|
7810
|
-
}
|
|
7811
|
-
var size = ribbonItem.activeSize;
|
|
7812
|
-
if (this.activeLayout === 'Simplified') {
|
|
7813
|
-
size = ((ribbonItem.allowedSizes === RibbonItemSize.Large) || (ribbonItem.allowedSizes & RibbonItemSize.Medium) ||
|
|
7814
|
-
(ribbonItem.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
|
|
7815
|
-
ribbonItem.setProperties({ activeSize: size }, true);
|
|
7816
|
-
}
|
|
7817
|
-
if (size & RibbonItemSize.Large) {
|
|
7818
|
-
itemContainer.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
|
|
7819
|
-
}
|
|
7820
|
-
else {
|
|
7821
|
-
itemContainer.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
|
|
7822
|
-
}
|
|
7823
|
-
this.createRibbonItem(ribbonItem, itemContainer);
|
|
7824
|
-
if (this.activeLayout === 'Simplified' && itemProp.group.enableGroupOverflow) {
|
|
7825
|
-
if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
7826
|
-
this.removeOverflowButton(dropdown);
|
|
9123
|
+
var ribbonItem = itemProp.item;
|
|
9124
|
+
ribbonItem.setProperties(item, true);
|
|
9125
|
+
this.validateItemSize();
|
|
9126
|
+
if (contentEle.innerHTML !== '') {
|
|
9127
|
+
if (!(this.activeLayout === RibbonLayout.Simplified && ribbonItem.displayOptions === DisplayMode.Overflow)) {
|
|
9128
|
+
itemContainer = groupContainer.querySelector('#' + itemId + CONTAINER_ID);
|
|
7827
9129
|
}
|
|
9130
|
+
else {
|
|
9131
|
+
itemContainer = dropdown.target.querySelector('#' + itemId + CONTAINER_ID);
|
|
9132
|
+
}
|
|
9133
|
+
// To avoid undefined items condition is added
|
|
9134
|
+
if (ribbonItem.ribbonTooltipSettings && isTooltipPresent(ribbonItem.ribbonTooltipSettings)) {
|
|
9135
|
+
itemContainer.classList.add(RIBBON_TOOLTIP_TARGET);
|
|
9136
|
+
this.tooltipData.push({ id: itemContainer.id, data: ribbonItem.ribbonTooltipSettings });
|
|
9137
|
+
}
|
|
9138
|
+
var size = ribbonItem.activeSize;
|
|
9139
|
+
if (this.activeLayout === 'Simplified') {
|
|
9140
|
+
size = ((ribbonItem.allowedSizes === RibbonItemSize.Large) || (ribbonItem.allowedSizes & RibbonItemSize.Medium) ||
|
|
9141
|
+
(ribbonItem.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
|
|
9142
|
+
ribbonItem.setProperties({ activeSize: size }, true);
|
|
9143
|
+
}
|
|
9144
|
+
if (size & RibbonItemSize.Large) {
|
|
9145
|
+
itemContainer.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
|
|
9146
|
+
}
|
|
9147
|
+
else {
|
|
9148
|
+
if (size & RibbonItemSize.Medium) {
|
|
9149
|
+
itemContainer.classList.add(RIBBON_MEDIUM_ITEM);
|
|
9150
|
+
}
|
|
9151
|
+
else {
|
|
9152
|
+
itemContainer.classList.add(RIBBON_SMALL_ITEM);
|
|
9153
|
+
}
|
|
9154
|
+
}
|
|
9155
|
+
this.createRibbonItem(ribbonItem, itemContainer);
|
|
9156
|
+
if (this.activeLayout === 'Simplified' && itemProp.group.enableGroupOverflow) {
|
|
9157
|
+
if (dropdown.target.childElementCount === 0 ||
|
|
9158
|
+
(dropdown.target.childElementCount === 1 &&
|
|
9159
|
+
this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
9160
|
+
this.removeOverflowButton(dropdown);
|
|
9161
|
+
}
|
|
9162
|
+
}
|
|
9163
|
+
if (this.selectedTab === itemProp.tabIndex) {
|
|
9164
|
+
this.refreshLayout();
|
|
9165
|
+
}
|
|
9166
|
+
if (item.cssClass) {
|
|
9167
|
+
itemContainer.classList.add(ribbonItem.cssClass);
|
|
9168
|
+
}
|
|
9169
|
+
if (!(ribbonItem.disabled) && itemContainer.classList.contains(DISABLED_CSS)) {
|
|
9170
|
+
itemContainer.classList.remove(DISABLED_CSS);
|
|
9171
|
+
}
|
|
9172
|
+
this.enableDisableItem(ribbonItem.id, ribbonItem.disabled);
|
|
7828
9173
|
}
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
}
|
|
7835
|
-
if (!(ribbonItem.disabled) && itemContainer.classList.contains(DISABLED_CSS)) {
|
|
7836
|
-
itemContainer.classList.remove(DISABLED_CSS);
|
|
7837
|
-
}
|
|
7838
|
-
this.enableDisableItem(ribbonItem.id, ribbonItem.disabled);
|
|
9174
|
+
}
|
|
9175
|
+
else {
|
|
9176
|
+
this.isUpdateItems = true;
|
|
9177
|
+
this.itemsModel.push(item);
|
|
9178
|
+
this.targetTabs[item.id] = itemProp.tabIndex;
|
|
7839
9179
|
}
|
|
7840
9180
|
};
|
|
7841
9181
|
Ribbon.prototype.removeItemElement = function (contentEle, item, dropdown) {
|
|
@@ -7882,6 +9222,15 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
7882
9222
|
Ribbon.prototype.disableItem = function (itemId) {
|
|
7883
9223
|
this.enableDisableItem(itemId, true);
|
|
7884
9224
|
};
|
|
9225
|
+
/**
|
|
9226
|
+
* Gets the Ribbon item model associated with the specified item ID.
|
|
9227
|
+
*
|
|
9228
|
+
* @param {string} itemId - The unique ID of the Ribbon item.
|
|
9229
|
+
* @returns {RibbonItemModel}
|
|
9230
|
+
*/
|
|
9231
|
+
Ribbon.prototype.getItem = function (itemId) {
|
|
9232
|
+
return getItem(this.tabs, itemId).item;
|
|
9233
|
+
};
|
|
7885
9234
|
Ribbon.prototype.enableDisableItem = function (itemId, isDisabled) {
|
|
7886
9235
|
var isUpdated = false;
|
|
7887
9236
|
var itemProp = getItem(this.tabs, itemId);
|
|
@@ -7929,6 +9278,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
7929
9278
|
};
|
|
7930
9279
|
Ribbon.prototype.unwireEvents = function () {
|
|
7931
9280
|
EventHandler.remove(window, 'resize', this.resizeHandler);
|
|
9281
|
+
EventHandler.remove(document.body, 'keydown', this.keytipActionHandler);
|
|
9282
|
+
EventHandler.remove(document, 'mousedown', this.mouseEventHandler);
|
|
9283
|
+
EventHandler.remove(document, 'scroll', this.mouseEventHandler);
|
|
7932
9284
|
};
|
|
7933
9285
|
Ribbon.prototype.destroy = function () {
|
|
7934
9286
|
this.keyboardModuleRibbon.destroy();
|
|
@@ -7956,6 +9308,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
7956
9308
|
this.initialPropsData = {};
|
|
7957
9309
|
this.hiddenGroups = [];
|
|
7958
9310
|
this.hiddenElements = {};
|
|
9311
|
+
this.keyTipElements = {};
|
|
9312
|
+
this.itemsModel = [];
|
|
9313
|
+
this.targetTabs = {};
|
|
7959
9314
|
remove(this.element.querySelector('#' + this.element.id + TAB_ID));
|
|
7960
9315
|
this.element.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
|
|
7961
9316
|
this.element.style.removeProperty(RIBBON_HELP_PANE_TEMPLATE_WIDTH);
|
|
@@ -8035,7 +9390,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
8035
9390
|
}
|
|
8036
9391
|
break;
|
|
8037
9392
|
case 'selectedTab':
|
|
8038
|
-
this.tabObj.
|
|
9393
|
+
var tabEle = this.tabObj.element;
|
|
9394
|
+
var toolbarItem = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(newProp.selectedTab.toString(), 10)];
|
|
9395
|
+
if (!(toolbarItem.classList.contains('e-hidden') || toolbarItem.classList.contains('e-disable'))) {
|
|
9396
|
+
this.tabObj.setProperties({ selectedItem: newProp.selectedTab });
|
|
9397
|
+
}
|
|
8039
9398
|
break;
|
|
8040
9399
|
case 'tabAnimation':
|
|
8041
9400
|
this.tabObj.setProperties({ animation: newProp.tabAnimation });
|
|
@@ -8043,6 +9402,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
8043
9402
|
case 'tabs':
|
|
8044
9403
|
this.reRenderTabs(newProp.tabs);
|
|
8045
9404
|
break;
|
|
9405
|
+
case 'contextualTabs':
|
|
9406
|
+
for (var i = 0; i < this.contextualTabs.length; i++) {
|
|
9407
|
+
if (newProp.contextualTabs[parseInt(i.toString(), 10)]) {
|
|
9408
|
+
this.ribbonContextualTabModule.updateContextualTabs(newProp.contextualTabs[parseInt(i.toString(), 10)], this.contextualTabs[parseInt(i.toString(), 10)]);
|
|
9409
|
+
}
|
|
9410
|
+
}
|
|
9411
|
+
break;
|
|
8046
9412
|
case 'width':
|
|
8047
9413
|
this.element.style.width = formatUnit(newProp.width);
|
|
8048
9414
|
this.refreshLayout();
|
|
@@ -8086,6 +9452,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
8086
9452
|
__decorate([
|
|
8087
9453
|
Property('')
|
|
8088
9454
|
], Ribbon.prototype, "cssClass", void 0);
|
|
9455
|
+
__decorate([
|
|
9456
|
+
Property(false)
|
|
9457
|
+
], Ribbon.prototype, "enableKeyTips", void 0);
|
|
9458
|
+
__decorate([
|
|
9459
|
+
Property('')
|
|
9460
|
+
], Ribbon.prototype, "layoutSwitcherKeyTip", void 0);
|
|
8089
9461
|
__decorate([
|
|
8090
9462
|
Complex({}, FileMenuSettings)
|
|
8091
9463
|
], Ribbon.prototype, "fileMenu", void 0);
|
|
@@ -8110,6 +9482,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
8110
9482
|
__decorate([
|
|
8111
9483
|
Collection([], RibbonTab)
|
|
8112
9484
|
], Ribbon.prototype, "tabs", void 0);
|
|
9485
|
+
__decorate([
|
|
9486
|
+
Collection([], RibbonContextualTabSettings)
|
|
9487
|
+
], Ribbon.prototype, "contextualTabs", void 0);
|
|
8113
9488
|
__decorate([
|
|
8114
9489
|
Property('100%')
|
|
8115
9490
|
], Ribbon.prototype, "width", void 0);
|
|
@@ -8207,6 +9582,7 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
|
|
|
8207
9582
|
}
|
|
8208
9583
|
this.parent.tabObj.refreshActiveTabBorder();
|
|
8209
9584
|
this.addFileMenuTooltip(fileMenuOptions);
|
|
9585
|
+
this.addFileMenuKeytip();
|
|
8210
9586
|
};
|
|
8211
9587
|
RibbonFileMenu.prototype.addFileMenuTooltip = function (fileMenuOptions) {
|
|
8212
9588
|
if (isTooltipPresent(fileMenuOptions.ribbonTooltipSettings)) {
|
|
@@ -8214,6 +9590,12 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
|
|
|
8214
9590
|
this.parent.tooltipData.push({ id: this.ddbElement.id, data: fileMenuOptions.ribbonTooltipSettings });
|
|
8215
9591
|
}
|
|
8216
9592
|
};
|
|
9593
|
+
RibbonFileMenu.prototype.addFileMenuKeytip = function () {
|
|
9594
|
+
if (this.parent.fileMenu.keyTip) {
|
|
9595
|
+
this.parent.keyTipElements['filemenu'] = [];
|
|
9596
|
+
this.parent.keyTipElements['filemenu'].push({ id: this.ddbElement.id, type: 'filemenu', keyTip: this.parent.fileMenu.keyTip });
|
|
9597
|
+
}
|
|
9598
|
+
};
|
|
8217
9599
|
RibbonFileMenu.prototype.ddbBeforeEvent = function (isOpen, args) {
|
|
8218
9600
|
//args.event is null when dropdown button is closed using a method call
|
|
8219
9601
|
if (!isOpen && args.event && args.event.target.closest('.e-ribbon-menu')) {
|
|
@@ -8366,7 +9748,9 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
|
|
|
8366
9748
|
}
|
|
8367
9749
|
}
|
|
8368
9750
|
this.removeFileMenuTooltip();
|
|
9751
|
+
this.removeFileMenuKeytip();
|
|
8369
9752
|
this.addFileMenuTooltip(fileMenuOptions);
|
|
9753
|
+
this.addFileMenuKeytip();
|
|
8370
9754
|
}
|
|
8371
9755
|
else {
|
|
8372
9756
|
this.createFileMenu(fileMenuOptions);
|
|
@@ -8385,6 +9769,7 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
|
|
|
8385
9769
|
};
|
|
8386
9770
|
RibbonFileMenu.prototype.destroyDDB = function () {
|
|
8387
9771
|
this.removeFileMenuTooltip();
|
|
9772
|
+
this.removeFileMenuKeytip();
|
|
8388
9773
|
var tabEle = this.parent.tabObj.element;
|
|
8389
9774
|
tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
|
|
8390
9775
|
this.destroyMenu();
|
|
@@ -8401,6 +9786,15 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
|
|
|
8401
9786
|
this.parent.tooltipData.splice(index, 1);
|
|
8402
9787
|
}
|
|
8403
9788
|
};
|
|
9789
|
+
RibbonFileMenu.prototype.removeFileMenuKeytip = function () {
|
|
9790
|
+
var _this = this;
|
|
9791
|
+
if (this.parent.keyTipElements['filemenu']) {
|
|
9792
|
+
var index = getIndex(this.parent.keyTipElements['filemenu'], function (e) { return e.id === _this.ddbElement.id; });
|
|
9793
|
+
if (index !== -1) {
|
|
9794
|
+
this.parent.keyTipElements['filemenu'].splice(index, 1);
|
|
9795
|
+
}
|
|
9796
|
+
}
|
|
9797
|
+
};
|
|
8404
9798
|
/**
|
|
8405
9799
|
* Add items to FileMenu.
|
|
8406
9800
|
*
|
|
@@ -8468,7 +9862,7 @@ var RibbonFileMenu = /** @__PURE__ @class */ (function () {
|
|
|
8468
9862
|
return RibbonFileMenu;
|
|
8469
9863
|
}());
|
|
8470
9864
|
|
|
8471
|
-
var __extends$
|
|
9865
|
+
var __extends$22 = (undefined && undefined.__extends) || (function () {
|
|
8472
9866
|
var extendStatics = function (d, b) {
|
|
8473
9867
|
extendStatics = Object.setPrototypeOf ||
|
|
8474
9868
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -8485,7 +9879,7 @@ var __extends$18 = (undefined && undefined.__extends) || (function () {
|
|
|
8485
9879
|
* Defines the items of Ribbon.
|
|
8486
9880
|
*/
|
|
8487
9881
|
var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
|
|
8488
|
-
__extends$
|
|
9882
|
+
__extends$22(RibbonBackstage, _super);
|
|
8489
9883
|
function RibbonBackstage(parent) {
|
|
8490
9884
|
var _this = _super.call(this) || this;
|
|
8491
9885
|
_this.parent = parent;
|
|
@@ -8607,6 +10001,7 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
|
|
|
8607
10001
|
};
|
|
8608
10002
|
this.parent.tabObj.refreshActiveTabBorder();
|
|
8609
10003
|
this.addBackStageMenuTooltip(backStageOptions);
|
|
10004
|
+
this.addBackStageMenuKeyTip(backStageOptions);
|
|
8610
10005
|
EventHandler.add(document, 'click', this.onClickEvent, this);
|
|
8611
10006
|
};
|
|
8612
10007
|
RibbonBackstage.prototype.onClickEvent = function (e) {
|
|
@@ -8624,6 +10019,24 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
|
|
|
8624
10019
|
this.parent.tooltipData.push({ id: this.backstageButtonEle.id, data: backStageOptions.ribbonTooltipSettings });
|
|
8625
10020
|
}
|
|
8626
10021
|
};
|
|
10022
|
+
RibbonBackstage.prototype.addBackStageMenuKeyTip = function (backStageOptions) {
|
|
10023
|
+
if (backStageOptions.keyTip) {
|
|
10024
|
+
if (!(this.parent.keyTipElements['backstage'])) {
|
|
10025
|
+
this.parent.keyTipElements['backstage'] = [];
|
|
10026
|
+
}
|
|
10027
|
+
this.parent.keyTipElements['backstage'].push({ id: this.backstageButtonEle.id, type: 'backstage', keyTip: backStageOptions.keyTip });
|
|
10028
|
+
}
|
|
10029
|
+
if (backStageOptions.items && backStageOptions.items.length) {
|
|
10030
|
+
if (!(this.parent.keyTipElements['backstageMenu'])) {
|
|
10031
|
+
this.parent.keyTipElements['backstageMenu'] = [];
|
|
10032
|
+
}
|
|
10033
|
+
for (var i = 0; i < backStageOptions.items.length; i++) {
|
|
10034
|
+
if (backStageOptions.items[parseInt(i.toString(), 10)].keyTip) {
|
|
10035
|
+
this.parent.keyTipElements['backstageMenu'].push({ id: backStageOptions.items[parseInt(i.toString(), 10)].id, type: 'backstageMenu', keyTip: backStageOptions.items[parseInt(i.toString(), 10)].keyTip });
|
|
10036
|
+
}
|
|
10037
|
+
}
|
|
10038
|
+
}
|
|
10039
|
+
};
|
|
8627
10040
|
RibbonBackstage.prototype.checkMenuItems = function (backStageItems) {
|
|
8628
10041
|
for (var i = 0; i < backStageItems.length; i++) {
|
|
8629
10042
|
var item = backStageItems[parseInt(i.toString(), 10)];
|
|
@@ -8914,7 +10327,9 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
|
|
|
8914
10327
|
}
|
|
8915
10328
|
}
|
|
8916
10329
|
this.removeBackstageMenuTooltip();
|
|
10330
|
+
this.removeBackstageMenuKeyTip();
|
|
8917
10331
|
this.addBackStageMenuTooltip(backStageOptions);
|
|
10332
|
+
this.addBackStageMenuKeyTip(backStageOptions);
|
|
8918
10333
|
}
|
|
8919
10334
|
else {
|
|
8920
10335
|
this.createBackStage(backStageOptions);
|
|
@@ -8933,6 +10348,7 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
|
|
|
8933
10348
|
};
|
|
8934
10349
|
RibbonBackstage.prototype.destroyDDB = function () {
|
|
8935
10350
|
this.removeBackstageMenuTooltip();
|
|
10351
|
+
this.removeBackstageMenuKeyTip();
|
|
8936
10352
|
var tabEle = this.parent.tabObj.element;
|
|
8937
10353
|
tabEle.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
|
|
8938
10354
|
this.destroyMenu();
|
|
@@ -8950,6 +10366,21 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
|
|
|
8950
10366
|
this.parent.tooltipData.splice(index, 1);
|
|
8951
10367
|
}
|
|
8952
10368
|
};
|
|
10369
|
+
RibbonBackstage.prototype.removeBackstageMenuKeyTip = function () {
|
|
10370
|
+
var _this = this;
|
|
10371
|
+
if (this.parent.keyTipElements['backstage'] && this.parent.keyTipElements['backstage'].length) {
|
|
10372
|
+
var index = getIndex(this.parent.keyTipElements['backstage'], function (e) { return e.id === _this.backstageButtonEle.id; });
|
|
10373
|
+
if (index !== -1) {
|
|
10374
|
+
this.parent.keyTipElements['backstage'].splice(index, 1);
|
|
10375
|
+
}
|
|
10376
|
+
}
|
|
10377
|
+
if (this.parent.keyTipElements['backstageMenu'] && this.parent.keyTipElements['backstageMenu'].length) {
|
|
10378
|
+
for (var i = 0; i < this.parent.keyTipElements['backstageMenu'].length; i++) {
|
|
10379
|
+
this.parent.keyTipElements['backstageMenu'].splice(i, 1);
|
|
10380
|
+
i--;
|
|
10381
|
+
}
|
|
10382
|
+
}
|
|
10383
|
+
};
|
|
8953
10384
|
/**
|
|
8954
10385
|
* Add items to Backstage Menu.
|
|
8955
10386
|
*
|
|
@@ -9018,6 +10449,642 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
|
|
|
9018
10449
|
return RibbonBackstage;
|
|
9019
10450
|
}(Component));
|
|
9020
10451
|
|
|
10452
|
+
/**
|
|
10453
|
+
* Defines the ribbon contextual tab.
|
|
10454
|
+
*/
|
|
10455
|
+
var RibbonContextualTab = /** @__PURE__ @class */ (function () {
|
|
10456
|
+
function RibbonContextualTab(parent) {
|
|
10457
|
+
this.parent = parent;
|
|
10458
|
+
}
|
|
10459
|
+
RibbonContextualTab.prototype.getModuleName = function () {
|
|
10460
|
+
return 'ribbonContextualTab';
|
|
10461
|
+
};
|
|
10462
|
+
RibbonContextualTab.prototype.destroy = function () {
|
|
10463
|
+
this.parent = null;
|
|
10464
|
+
};
|
|
10465
|
+
/**
|
|
10466
|
+
* Creates Contextual tab.
|
|
10467
|
+
*
|
|
10468
|
+
* @returns {void}
|
|
10469
|
+
* @hidden
|
|
10470
|
+
*/
|
|
10471
|
+
RibbonContextualTab.prototype.addContextualTabs = function () {
|
|
10472
|
+
var isSelected = false;
|
|
10473
|
+
for (var n = 0; n < this.parent.contextualTabs.length; n++) {
|
|
10474
|
+
for (var i = 0; i < this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs.length; i++) {
|
|
10475
|
+
this.parent.addTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[parseInt(i.toString(), 10)]);
|
|
10476
|
+
var index = this.parent.tabs.length - 1;
|
|
10477
|
+
var tabEle = this.parent.tabObj.element;
|
|
10478
|
+
var toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index.toString(), 10)];
|
|
10479
|
+
toolbarEle.classList.add(RIBBON_CONTEXTUAL_TAB);
|
|
10480
|
+
toolbarEle.classList.add('e-hidden');
|
|
10481
|
+
if (this.parent.contextualTabs[parseInt(n.toString(), 10)].visible) {
|
|
10482
|
+
this.parent.showTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[parseInt(i.toString(), 10)].id, true);
|
|
10483
|
+
if (this.parent.contextualTabs[parseInt(n.toString(), 10)].isSelected && !isSelected) {
|
|
10484
|
+
this.parent.selectTab(this.parent.contextualTabs[parseInt(n.toString(), 10)].tabs[0].id);
|
|
10485
|
+
isSelected = true;
|
|
10486
|
+
}
|
|
10487
|
+
}
|
|
10488
|
+
}
|
|
10489
|
+
}
|
|
10490
|
+
};
|
|
10491
|
+
/**
|
|
10492
|
+
* Updates Contextual tab.
|
|
10493
|
+
*
|
|
10494
|
+
* @param {RibbonContextualTabSettingsModel} newProp - Specifies new properties.
|
|
10495
|
+
* @param {RibbonContextualTabSettingsModel} contextualTab - Gets the property of contextual tab.
|
|
10496
|
+
* @returns {void}
|
|
10497
|
+
* @hidden
|
|
10498
|
+
*/
|
|
10499
|
+
RibbonContextualTab.prototype.updateContextualTabs = function (newProp, contextualTab) {
|
|
10500
|
+
if (!(isNullOrUndefined(newProp.visible))) {
|
|
10501
|
+
for (var i = 0; i < contextualTab.tabs.length; i++) {
|
|
10502
|
+
if (newProp.visible) {
|
|
10503
|
+
this.parent.showTab(contextualTab.tabs[parseInt(i.toString(), 10)].id, true);
|
|
10504
|
+
}
|
|
10505
|
+
else {
|
|
10506
|
+
this.parent.hideTab(contextualTab.tabs[parseInt(i.toString(), 10)].id, true);
|
|
10507
|
+
}
|
|
10508
|
+
}
|
|
10509
|
+
}
|
|
10510
|
+
if (!(isNullOrUndefined(newProp.isSelected))) {
|
|
10511
|
+
if (newProp.isSelected && contextualTab.visible) {
|
|
10512
|
+
this.parent.selectTab(contextualTab.tabs[0].id);
|
|
10513
|
+
}
|
|
10514
|
+
else {
|
|
10515
|
+
var tabEle = this.parent.tabObj.element;
|
|
10516
|
+
for (var i = 0; i < this.parent.tabs.length; i++) {
|
|
10517
|
+
var toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(i.toString(), 10)];
|
|
10518
|
+
if (!(toolbarEle.classList.contains('e-hidden') || toolbarEle.classList.contains('e-disable'))) {
|
|
10519
|
+
this.parent.selectTab(this.parent.tabs[parseInt(i.toString(), 10)].id);
|
|
10520
|
+
break;
|
|
10521
|
+
}
|
|
10522
|
+
}
|
|
10523
|
+
}
|
|
10524
|
+
}
|
|
10525
|
+
if (newProp.tabs) {
|
|
10526
|
+
var _loop_1 = function (key) {
|
|
10527
|
+
var index = parseInt(key, 10);
|
|
10528
|
+
var tab = this_1.parent.tabs.filter(function (e) { return e.id === contextualTab.tabs[parseInt(index.toString(), 10)].id; })[0];
|
|
10529
|
+
this_1.parent.updateTab(tab);
|
|
10530
|
+
};
|
|
10531
|
+
var this_1 = this;
|
|
10532
|
+
for (var key in newProp.tabs) {
|
|
10533
|
+
_loop_1(key);
|
|
10534
|
+
}
|
|
10535
|
+
}
|
|
10536
|
+
};
|
|
10537
|
+
return RibbonContextualTab;
|
|
10538
|
+
}());
|
|
10539
|
+
|
|
10540
|
+
/**
|
|
10541
|
+
* Defines the keytip of Ribbon.
|
|
10542
|
+
*/
|
|
10543
|
+
var RibbonKeyTip = /** @__PURE__ @class */ (function () {
|
|
10544
|
+
function RibbonKeyTip(parent) {
|
|
10545
|
+
this.isKeytipPopupOpen = false;
|
|
10546
|
+
this.parent = parent;
|
|
10547
|
+
}
|
|
10548
|
+
RibbonKeyTip.prototype.getModuleName = function () {
|
|
10549
|
+
return 'ribbonKeyTip';
|
|
10550
|
+
};
|
|
10551
|
+
RibbonKeyTip.prototype.destroy = function () {
|
|
10552
|
+
this.parent = null;
|
|
10553
|
+
};
|
|
10554
|
+
/**
|
|
10555
|
+
* Creates the keytips.
|
|
10556
|
+
*
|
|
10557
|
+
* @param {string} key - get's the keytip type.
|
|
10558
|
+
* @returns {void}
|
|
10559
|
+
* @hidden
|
|
10560
|
+
*/
|
|
10561
|
+
RibbonKeyTip.prototype.createKeytip = function (key) {
|
|
10562
|
+
if (this.parent.keyTipElements) {
|
|
10563
|
+
var keytipData = void 0;
|
|
10564
|
+
if (key === 'tab') {
|
|
10565
|
+
for (var i = 0; i < this.parent.tabs.length; i++) {
|
|
10566
|
+
if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
|
|
10567
|
+
// eslint-disable-next-line
|
|
10568
|
+
keytipData = this.parent.keyTipElements[i][key];
|
|
10569
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'tab', 'center', 'bottom', true);
|
|
10570
|
+
}
|
|
10571
|
+
}
|
|
10572
|
+
if (this.parent.keyTipElements['filemenu']) {
|
|
10573
|
+
keytipData = this.parent.keyTipElements['filemenu'];
|
|
10574
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'filemenu');
|
|
10575
|
+
}
|
|
10576
|
+
if (this.parent.keyTipElements['backstage']) {
|
|
10577
|
+
keytipData = this.parent.keyTipElements['backstage'];
|
|
10578
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'backstage');
|
|
10579
|
+
}
|
|
10580
|
+
if (this.parent.keyTipElements['collapse']) {
|
|
10581
|
+
keytipData = this.parent.keyTipElements['collapse'];
|
|
10582
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'collapse');
|
|
10583
|
+
}
|
|
10584
|
+
if (this.parent.keyTipElements['taboverflow']) {
|
|
10585
|
+
keytipData = this.parent.keyTipElements['taboverflow'];
|
|
10586
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'taboverflow');
|
|
10587
|
+
}
|
|
10588
|
+
}
|
|
10589
|
+
else if (key === 'popupitem') {
|
|
10590
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['popupitem']) {
|
|
10591
|
+
var popupKeyTipData = this.parent.keyTipElements[this.parent.selectedTab]['popupitem'];
|
|
10592
|
+
for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['popupitem']).length; i++) {
|
|
10593
|
+
this.createKeyTipElement((popupKeyTipData[parseInt(i.toString(), 10)].id), popupKeyTipData[parseInt(i.toString(), 10)].keyTip, 'popupitem', 'left', 'top', false, true);
|
|
10594
|
+
}
|
|
10595
|
+
}
|
|
10596
|
+
}
|
|
10597
|
+
else if (key === 'backstageMenu') {
|
|
10598
|
+
if (this.parent.keyTipElements['backstageMenu']) {
|
|
10599
|
+
var backstageKeyTipData = this.parent.keyTipElements['backstageMenu'];
|
|
10600
|
+
for (var i = 0; i < Object.keys(this.parent.keyTipElements['backstageMenu']).length; i++) {
|
|
10601
|
+
this.createKeyTipElement((backstageKeyTipData[parseInt(i.toString(), 10)].id), backstageKeyTipData[parseInt(i.toString(), 10)].keyTip, 'backstageMenu', 'left', 'center');
|
|
10602
|
+
}
|
|
10603
|
+
}
|
|
10604
|
+
}
|
|
10605
|
+
else if (key === 'grpoverflowpopup' && this.parent.activeLayout === 'Classic') {
|
|
10606
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['grpoverflowpopup']) {
|
|
10607
|
+
this.calculateItemPosition(key);
|
|
10608
|
+
}
|
|
10609
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['launcher']) {
|
|
10610
|
+
for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['launcher']).length; i++) {
|
|
10611
|
+
keytipData = this.parent.keyTipElements[this.parent.selectedTab]['launcher'];
|
|
10612
|
+
this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'launcher', 'center', 'bottom', false, true);
|
|
10613
|
+
}
|
|
10614
|
+
}
|
|
10615
|
+
}
|
|
10616
|
+
else {
|
|
10617
|
+
this.calculateItemPosition(key);
|
|
10618
|
+
if (this.parent.activeLayout === 'Classic') {
|
|
10619
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['launcher']) {
|
|
10620
|
+
for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['launcher']).length; i++) {
|
|
10621
|
+
keytipData = this.parent.keyTipElements[this.parent.selectedTab]['launcher'];
|
|
10622
|
+
this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'launcher');
|
|
10623
|
+
}
|
|
10624
|
+
}
|
|
10625
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow']) {
|
|
10626
|
+
for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow']).length; i++) {
|
|
10627
|
+
keytipData = this.parent.keyTipElements[this.parent.selectedTab]['grpoverflow'];
|
|
10628
|
+
this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'grpoverflow');
|
|
10629
|
+
}
|
|
10630
|
+
}
|
|
10631
|
+
}
|
|
10632
|
+
if (this.parent.activeLayout === 'Simplified') {
|
|
10633
|
+
if (this.parent.keyTipElements['overflowbtn']) {
|
|
10634
|
+
keytipData = this.parent.keyTipElements['overflowbtn'];
|
|
10635
|
+
this.createKeyTipElement((keytipData[0].id), keytipData[0].keyTip, 'overflowbtn');
|
|
10636
|
+
}
|
|
10637
|
+
if (this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn']) {
|
|
10638
|
+
for (var i = 0; i < Object.keys(this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn']).length; i++) {
|
|
10639
|
+
keytipData = this.parent.keyTipElements[this.parent.selectedTab]['grpofbtn'];
|
|
10640
|
+
this.createKeyTipElement((keytipData[parseInt(i.toString(), 10)].id), keytipData[parseInt(i.toString(), 10)].keyTip, 'grpofbtn');
|
|
10641
|
+
}
|
|
10642
|
+
}
|
|
10643
|
+
}
|
|
10644
|
+
}
|
|
10645
|
+
}
|
|
10646
|
+
};
|
|
10647
|
+
RibbonKeyTip.prototype.calculateItemPosition = function (key, isMethod, keyTip) {
|
|
10648
|
+
if (isMethod === void 0) { isMethod = false; }
|
|
10649
|
+
var xOffset;
|
|
10650
|
+
var yOffset;
|
|
10651
|
+
var keytipData;
|
|
10652
|
+
/* eslint-disable */
|
|
10653
|
+
keytipData = this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(), 10)][key];
|
|
10654
|
+
if (keytipData) {
|
|
10655
|
+
for (var i = 0; i < Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(), 10)][key]).length; i++) {
|
|
10656
|
+
/* eslint-enable */
|
|
10657
|
+
if ((isMethod && (keytipData[parseInt(i.toString(), 10)].keyTip === keyTip)) || !isMethod) {
|
|
10658
|
+
var itemID = keytipData[parseInt(i.toString(), 10)].id;
|
|
10659
|
+
if (keytipData[parseInt(i.toString(), 10)].id.includes("_grpbtn")) {
|
|
10660
|
+
itemID = keytipData[parseInt(i.toString(), 10)].id.replace(/_grpbtn\d+/, '');
|
|
10661
|
+
}
|
|
10662
|
+
var itemProp = getItem(this.parent.tabs, itemID);
|
|
10663
|
+
if (itemProp && itemProp.group.orientation === 'Column' && itemProp.collection.items.length > 1 && this.parent.activeLayout !== 'Simplified') {
|
|
10664
|
+
if (itemProp.itemIndex === 0) {
|
|
10665
|
+
xOffset = 'center';
|
|
10666
|
+
yOffset = 'top';
|
|
10667
|
+
}
|
|
10668
|
+
else if (itemProp.itemIndex === 1) {
|
|
10669
|
+
xOffset = 'center';
|
|
10670
|
+
yOffset = 'center';
|
|
10671
|
+
}
|
|
10672
|
+
else {
|
|
10673
|
+
xOffset = 'center';
|
|
10674
|
+
yOffset = 'bottom';
|
|
10675
|
+
}
|
|
10676
|
+
}
|
|
10677
|
+
else if (itemProp && itemProp.group.orientation === 'Row' && itemProp.group.collections.length > 1 && this.parent.activeLayout !== 'Simplified') {
|
|
10678
|
+
if (itemProp.collectionIndex === 0) {
|
|
10679
|
+
xOffset = 'center';
|
|
10680
|
+
yOffset = 'top';
|
|
10681
|
+
}
|
|
10682
|
+
else {
|
|
10683
|
+
xOffset = 'center';
|
|
10684
|
+
yOffset = 'bottom';
|
|
10685
|
+
}
|
|
10686
|
+
}
|
|
10687
|
+
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);
|
|
10688
|
+
}
|
|
10689
|
+
}
|
|
10690
|
+
}
|
|
10691
|
+
};
|
|
10692
|
+
RibbonKeyTip.prototype.createKeyTipElement = function (id, keyTip, type, xOffset, yOffset, isTab, isPopUpItem) {
|
|
10693
|
+
if (xOffset === void 0) { xOffset = 'center'; }
|
|
10694
|
+
if (yOffset === void 0) { yOffset = 'bottom'; }
|
|
10695
|
+
if (isTab === void 0) { isTab = false; }
|
|
10696
|
+
if (isPopUpItem === void 0) { isPopUpItem = false; }
|
|
10697
|
+
var keyEle = document.querySelector('#' + id);
|
|
10698
|
+
var isPopUpPresent = false;
|
|
10699
|
+
var splitBtnID;
|
|
10700
|
+
if (isTab) {
|
|
10701
|
+
keyEle = document.querySelector('#' + id + HEADER_ID);
|
|
10702
|
+
}
|
|
10703
|
+
if (keyEle) {
|
|
10704
|
+
if (keyEle.closest('.e-ribbon-group-overflow-ddb')) {
|
|
10705
|
+
isPopUpPresent = true;
|
|
10706
|
+
}
|
|
10707
|
+
if ((isTab && isPopUpItem) && keyEle.closest('.e-toolbar-pop')) {
|
|
10708
|
+
isPopUpPresent = true;
|
|
10709
|
+
}
|
|
10710
|
+
if (keyEle.closest('.e-split-btn-wrapper')) {
|
|
10711
|
+
var splitBtn = keyEle.closest('.e-split-btn-wrapper');
|
|
10712
|
+
splitBtnID = splitBtn.closest('.e-ribbon-item').id;
|
|
10713
|
+
}
|
|
10714
|
+
else {
|
|
10715
|
+
if (keyEle.closest('.e-colorpicker-wrapper')) {
|
|
10716
|
+
keyEle = keyEle.closest('.e-colorpicker-wrapper');
|
|
10717
|
+
splitBtnID = keyEle.closest('.e-ribbon-item').id;
|
|
10718
|
+
}
|
|
10719
|
+
}
|
|
10720
|
+
}
|
|
10721
|
+
if ((keyEle && keyEle.offsetParent) || (isTab && isPopUpItem)) {
|
|
10722
|
+
if ((isPopUpItem && isPopUpPresent) || !isPopUpItem) {
|
|
10723
|
+
var keytipElement = this.parent.createElement('div', {
|
|
10724
|
+
className: RIBBON_KEYTIP,
|
|
10725
|
+
id: id + RIBBON_KEYTIP_ID
|
|
10726
|
+
});
|
|
10727
|
+
document.body.append(keytipElement);
|
|
10728
|
+
var keytipPopup = new Popup(keytipElement, {
|
|
10729
|
+
relateTo: '#' + (isTab ? id + HEADER_ID : splitBtnID ? splitBtnID : id),
|
|
10730
|
+
content: keyTip,
|
|
10731
|
+
collision: { X: 'fit', Y: 'flip' },
|
|
10732
|
+
targetType: 'relative',
|
|
10733
|
+
position: { X: xOffset, Y: yOffset },
|
|
10734
|
+
enableRtl: this.parent.enableRtl
|
|
10735
|
+
});
|
|
10736
|
+
keytipPopup.show();
|
|
10737
|
+
this.calculateKeyTipPosition(keyEle, keytipElement, type, yOffset, (isTab && isPopUpItem));
|
|
10738
|
+
this.parent.isKeytipOpen = true;
|
|
10739
|
+
}
|
|
10740
|
+
}
|
|
10741
|
+
};
|
|
10742
|
+
RibbonKeyTip.prototype.calculateKeyTipPosition = function (itemEle, keytipElement, type, yOffset, isTabOverflow) {
|
|
10743
|
+
if (isTabOverflow === void 0) { isTabOverflow = false; }
|
|
10744
|
+
var position = itemEle.getBoundingClientRect();
|
|
10745
|
+
if (type === 'backstageMenu') {
|
|
10746
|
+
keytipElement.style.top = position.top + ((keytipElement.offsetHeight) / 2) + 'px';
|
|
10747
|
+
keytipElement.style.left = position.left + (itemEle.offsetWidth / 5) + 'px';
|
|
10748
|
+
}
|
|
10749
|
+
else {
|
|
10750
|
+
if (type !== 'popupitem') {
|
|
10751
|
+
keytipElement.style.left = position.left + (position.width - keytipElement.offsetWidth) / 2 + 'px';
|
|
10752
|
+
}
|
|
10753
|
+
}
|
|
10754
|
+
if (type === 'filemenu' || type === 'backstage') {
|
|
10755
|
+
keytipElement.style.top = position.top + ((itemEle.offsetHeight - (itemEle.offsetHeight / 3)) + (keytipElement.offsetHeight / 6)) + 'px';
|
|
10756
|
+
}
|
|
10757
|
+
else if ((type === 'item' && yOffset === 'top')) {
|
|
10758
|
+
keytipElement.style.top = (position.top - (itemEle.offsetHeight) / 2) + 'px';
|
|
10759
|
+
}
|
|
10760
|
+
};
|
|
10761
|
+
/**
|
|
10762
|
+
* Performs keytip action.
|
|
10763
|
+
*
|
|
10764
|
+
* @param {string} keyPress - Gets the keytip text.
|
|
10765
|
+
* @returns {void}
|
|
10766
|
+
* @hidden
|
|
10767
|
+
*/
|
|
10768
|
+
RibbonKeyTip.prototype.keytipPress = function (keyPress, isMethod) {
|
|
10769
|
+
var _this = this;
|
|
10770
|
+
if (isMethod === void 0) { isMethod = false; }
|
|
10771
|
+
this.isKeytipPresent = false;
|
|
10772
|
+
for (var i = 0; ((i < Object.keys(this.parent.keyTipElements).length) && !this.isKeytipPresent); i++) {
|
|
10773
|
+
if (this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
|
|
10774
|
+
for (var j = 0; ((j < Object.keys(this.parent.keyTipElements[parseInt(i.toString(), 10)]).length) && !this.isKeytipPresent); j++) {
|
|
10775
|
+
var keytipData = this.parent.keyTipElements[parseInt(i.toString(), 10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(), 10)])[parseInt(j.toString(), 10)]];
|
|
10776
|
+
for (var k = 0; ((k < keytipData.length) && !this.isKeytipPresent); k++) {
|
|
10777
|
+
if (keyPress.toUpperCase() === keytipData[parseInt(k.toString(), 10)].keyTip) {
|
|
10778
|
+
var keyTipElement = document.querySelector('#' + keytipData[parseInt(k.toString(), 10)].id + RIBBON_KEYTIP_ID);
|
|
10779
|
+
if (keyTipElement || isMethod) {
|
|
10780
|
+
this.isKeytipPresent = true;
|
|
10781
|
+
this.removeKeytip();
|
|
10782
|
+
if (keytipData[parseInt(k.toString(), 10)].type === 'tab') {
|
|
10783
|
+
if (i !== this.parent.selectedTab) {
|
|
10784
|
+
this.parent.tabObj.select(i);
|
|
10785
|
+
setTimeout(function () {
|
|
10786
|
+
var tabOverflow = _this.parent.tabObj.element.querySelector('.e-nav-active');
|
|
10787
|
+
if (tabOverflow)
|
|
10788
|
+
tabOverflow.click();
|
|
10789
|
+
_this.createKeytip('item');
|
|
10790
|
+
}, 600);
|
|
10791
|
+
}
|
|
10792
|
+
else {
|
|
10793
|
+
this.createKeytip('item');
|
|
10794
|
+
}
|
|
10795
|
+
}
|
|
10796
|
+
else {
|
|
10797
|
+
if (keytipData[parseInt(k.toString(), 10)].type === 'item' || keytipData[parseInt(k.toString(), 10)].type === 'grpoverflowpopup' || keytipData[parseInt(k.toString(), 10)].type === 'popupitem') {
|
|
10798
|
+
if (document.getElementById(keytipData[parseInt(k.toString(), 10)].id) && document.getElementById(keytipData[parseInt(k.toString(), 10)].id).classList.contains('e-ribbon-group-button')) {
|
|
10799
|
+
document.getElementById(keytipData[parseInt(k.toString(), 10)].id).click();
|
|
10800
|
+
}
|
|
10801
|
+
else {
|
|
10802
|
+
var itemProp = void 0;
|
|
10803
|
+
if ((keytipData[parseInt(k.toString(), 10)].id).includes("_popupButton")) {
|
|
10804
|
+
var galleryID = keytipData[parseInt(k.toString(), 10)].id.replace(/_popupButton/g, '');
|
|
10805
|
+
itemProp = getItem(this.parent.tabs, galleryID);
|
|
10806
|
+
}
|
|
10807
|
+
else {
|
|
10808
|
+
itemProp = getItem(this.parent.tabs, keytipData[parseInt(k.toString(), 10)].id);
|
|
10809
|
+
}
|
|
10810
|
+
if (!isMethod || (isMethod && itemProp.tabIndex === this.parent.selectedTab)) {
|
|
10811
|
+
this.clickItems(itemProp, keytipData, k, false, isMethod);
|
|
10812
|
+
}
|
|
10813
|
+
}
|
|
10814
|
+
}
|
|
10815
|
+
else if (keytipData[parseInt(k.toString(), 10)].type === 'grpoverflow' || keytipData[parseInt(k.toString(), 10)].type === 'grpofbtn' || keytipData[parseInt(k.toString(), 10)].type === 'launcher') {
|
|
10816
|
+
var keyEle = document.querySelector('#' + keytipData[parseInt(k.toString(), 10)].id);
|
|
10817
|
+
this.removeKeytip();
|
|
10818
|
+
if (keyEle) {
|
|
10819
|
+
var groupID = keytipData[parseInt(k.toString(), 10)].id;
|
|
10820
|
+
if (isMethod) {
|
|
10821
|
+
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")) {
|
|
10822
|
+
groupID = keytipData[parseInt(k.toString(), 10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g, '');
|
|
10823
|
+
var itemProp = getGroup(this.parent.tabs, groupID);
|
|
10824
|
+
if (itemProp.tabIndex === this.parent.selectedTab) {
|
|
10825
|
+
this.clickItems(itemProp, keytipData, k, true, isMethod, keyEle);
|
|
10826
|
+
}
|
|
10827
|
+
}
|
|
10828
|
+
}
|
|
10829
|
+
else {
|
|
10830
|
+
this.clickItems(null, keytipData, k, true, isMethod, keyEle);
|
|
10831
|
+
}
|
|
10832
|
+
}
|
|
10833
|
+
}
|
|
10834
|
+
}
|
|
10835
|
+
}
|
|
10836
|
+
}
|
|
10837
|
+
}
|
|
10838
|
+
}
|
|
10839
|
+
}
|
|
10840
|
+
else {
|
|
10841
|
+
if (this.parent.keyTipElements) {
|
|
10842
|
+
this.commonItemsKeyTipPress(keyPress, Object.keys(this.parent.keyTipElements)[parseInt(i.toString(), 10)], isMethod);
|
|
10843
|
+
}
|
|
10844
|
+
}
|
|
10845
|
+
}
|
|
10846
|
+
};
|
|
10847
|
+
RibbonKeyTip.prototype.clickItems = function (itemProp, keytipData, k, isGroupItems, isMethod, keyEle) {
|
|
10848
|
+
if (isGroupItems) {
|
|
10849
|
+
keyEle.click();
|
|
10850
|
+
if (!(keytipData[parseInt(k.toString(), 10)].type === 'launcher')) {
|
|
10851
|
+
this.isKeytipPopupOpen = true;
|
|
10852
|
+
keytipData[parseInt(k.toString(), 10)].type === 'grpoverflow' ? this.createKeytip('grpoverflowpopup') : this.createKeytip('popupitem');
|
|
10853
|
+
}
|
|
10854
|
+
}
|
|
10855
|
+
else {
|
|
10856
|
+
var itemID = keytipData[parseInt(k.toString(), 10)].id;
|
|
10857
|
+
if (document.querySelector('#' + itemID) && isMethod) {
|
|
10858
|
+
if (this.parent.activeLayout === 'Simplified') {
|
|
10859
|
+
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')) {
|
|
10860
|
+
document.querySelector('#' + itemProp.group.id + '_sim_grp_overflow').click();
|
|
10861
|
+
}
|
|
10862
|
+
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')) {
|
|
10863
|
+
document.querySelector('#' + this.parent.tabObj.element.id + OVRLOF_BUTTON_ID).click();
|
|
10864
|
+
}
|
|
10865
|
+
}
|
|
10866
|
+
else {
|
|
10867
|
+
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')) {
|
|
10868
|
+
document.querySelector('#' + itemProp.group.id + OVERFLOW_ID + DROPDOWN_ID).click();
|
|
10869
|
+
}
|
|
10870
|
+
}
|
|
10871
|
+
}
|
|
10872
|
+
var itemType = this.parent.getItemModuleName(itemProp.item);
|
|
10873
|
+
switch (itemType) {
|
|
10874
|
+
case 'btn':
|
|
10875
|
+
this.parent.ribbonButtonModule.click(itemID);
|
|
10876
|
+
break;
|
|
10877
|
+
case 'dropdown-btn':
|
|
10878
|
+
this.parent.ribbonDropDownModule.toggle(itemID);
|
|
10879
|
+
break;
|
|
10880
|
+
case 'split-btn':
|
|
10881
|
+
this.parent.ribbonSplitButtonModule.toggle(itemID);
|
|
10882
|
+
break;
|
|
10883
|
+
case 'checkbox':
|
|
10884
|
+
this.parent.ribbonCheckBoxModule.click(itemID);
|
|
10885
|
+
break;
|
|
10886
|
+
case 'colorpicker':
|
|
10887
|
+
this.parent.ribbonColorPickerModule.toggle(itemID);
|
|
10888
|
+
break;
|
|
10889
|
+
case 'combobox':
|
|
10890
|
+
var itemEle_1 = document.querySelector('#' + itemID);
|
|
10891
|
+
setTimeout(function () {
|
|
10892
|
+
itemEle_1.focus();
|
|
10893
|
+
}, 100);
|
|
10894
|
+
break;
|
|
10895
|
+
case 'gallery':
|
|
10896
|
+
var galleryEle = document.querySelector('#' + itemID);
|
|
10897
|
+
galleryEle.click();
|
|
10898
|
+
break;
|
|
10899
|
+
case 'template':
|
|
10900
|
+
var templateEle = document.querySelector('#' + itemID);
|
|
10901
|
+
templateEle.focus();
|
|
10902
|
+
break;
|
|
10903
|
+
case 'group-btn':
|
|
10904
|
+
var itemElement = document.querySelector('#' + itemID);
|
|
10905
|
+
if (itemElement) {
|
|
10906
|
+
var item = getInstance(itemElement, DropDownButton);
|
|
10907
|
+
item.toggle();
|
|
10908
|
+
for (var i = 0; i < itemProp.item.groupButtonSettings.items.length; i++) {
|
|
10909
|
+
if (itemProp.item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip) {
|
|
10910
|
+
this.createKeyTipElement(itemID + (RIBBON_GROUP_BUTTON_ID + i), itemProp.item.groupButtonSettings.items[parseInt(i.toString(), 10)].keyTip, 'item');
|
|
10911
|
+
}
|
|
10912
|
+
}
|
|
10913
|
+
}
|
|
10914
|
+
break;
|
|
10915
|
+
}
|
|
10916
|
+
}
|
|
10917
|
+
};
|
|
10918
|
+
RibbonKeyTip.prototype.commonItemsKeyTipPress = function (keyPress, key, isMethod) {
|
|
10919
|
+
var _this = this;
|
|
10920
|
+
/* eslint-disable */
|
|
10921
|
+
if (this.parent.keyTipElements[key]) {
|
|
10922
|
+
var isKeyPressed = false;
|
|
10923
|
+
var keytipData = this.parent.keyTipElements[key];
|
|
10924
|
+
var keyEle = void 0;
|
|
10925
|
+
var keytipElement = void 0;
|
|
10926
|
+
if (keytipData) {
|
|
10927
|
+
if (key === 'backstageMenu') {
|
|
10928
|
+
for (var i = 0; i < Object.keys(this.parent.keyTipElements[key]).length; i++) {
|
|
10929
|
+
/* eslint-enable */
|
|
10930
|
+
if (keytipData[parseInt(i.toString(), 10)].keyTip === keyPress.toUpperCase()) {
|
|
10931
|
+
keyEle = document.querySelector('#' + keytipData[parseInt(i.toString(), 10)].id);
|
|
10932
|
+
keytipElement = document.querySelector('#' + keyEle.id + RIBBON_KEYTIP_ID);
|
|
10933
|
+
if (keytipElement || isMethod) {
|
|
10934
|
+
isKeyPressed = true;
|
|
10935
|
+
if (isMethod && document.querySelector('.e-ribbon-backstage-popup').classList.contains('e-popup-close')) {
|
|
10936
|
+
this.parent.tabObj.element.querySelector('.e-ribbon-backstage').click();
|
|
10937
|
+
}
|
|
10938
|
+
break;
|
|
10939
|
+
}
|
|
10940
|
+
}
|
|
10941
|
+
}
|
|
10942
|
+
}
|
|
10943
|
+
else {
|
|
10944
|
+
if (keytipData[0] && keytipData[0].keyTip === keyPress.toUpperCase()) {
|
|
10945
|
+
keyEle = document.querySelector('#' + keytipData[0].id);
|
|
10946
|
+
keytipElement = document.querySelector('#' + keytipData[0].id + RIBBON_KEYTIP_ID);
|
|
10947
|
+
if (keytipElement || isMethod) {
|
|
10948
|
+
isKeyPressed = true;
|
|
10949
|
+
}
|
|
10950
|
+
}
|
|
10951
|
+
}
|
|
10952
|
+
}
|
|
10953
|
+
if (isKeyPressed) {
|
|
10954
|
+
this.removeKeytip();
|
|
10955
|
+
this.isKeytipPresent = true;
|
|
10956
|
+
if (keyEle) {
|
|
10957
|
+
keyEle.click();
|
|
10958
|
+
if (key === 'backstage') {
|
|
10959
|
+
this.createKeytip('backstageMenu');
|
|
10960
|
+
}
|
|
10961
|
+
else if (key === 'overflowbtn') {
|
|
10962
|
+
this.isKeytipPopupOpen = true;
|
|
10963
|
+
this.createKeytip('popupitem');
|
|
10964
|
+
}
|
|
10965
|
+
else if (key === 'taboverflow') {
|
|
10966
|
+
setTimeout(function () {
|
|
10967
|
+
for (var i = 0; i < Object.keys(_this.parent.keyTipElements).length; i++) {
|
|
10968
|
+
if (_this.parent.keyTipElements[parseInt(i.toString(), 10)]) {
|
|
10969
|
+
var keytipData_1 = _this.parent.keyTipElements[parseInt(i.toString(), 10)]['tab'];
|
|
10970
|
+
_this.createKeyTipElement((keytipData_1[0].id), keytipData_1[0].keyTip, 'tab', 'center', 'bottom', true, true);
|
|
10971
|
+
}
|
|
10972
|
+
}
|
|
10973
|
+
}, 600);
|
|
10974
|
+
}
|
|
10975
|
+
}
|
|
10976
|
+
}
|
|
10977
|
+
}
|
|
10978
|
+
};
|
|
10979
|
+
/**
|
|
10980
|
+
* Removes the keytip.
|
|
10981
|
+
*
|
|
10982
|
+
* @param {string} key - Gets the keyboard key element.
|
|
10983
|
+
* @returns {void}
|
|
10984
|
+
* @hidden
|
|
10985
|
+
*/
|
|
10986
|
+
RibbonKeyTip.prototype.removeKeytip = function (key) {
|
|
10987
|
+
var _this = this;
|
|
10988
|
+
var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
|
|
10989
|
+
var isKeyTipExist = false;
|
|
10990
|
+
this.parent.keysPress = '';
|
|
10991
|
+
var _loop_1 = function (i) {
|
|
10992
|
+
var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
|
|
10993
|
+
if (key === 'Escape' && this_1.parent.keyTipElements && this_1.parent.keyTipElements[this_1.parent.selectedTab]) {
|
|
10994
|
+
/* eslint-disable */
|
|
10995
|
+
for (var j = 0; j < Object.keys(this_1.parent.keyTipElements[this_1.parent.selectedTab]).length; j++) {
|
|
10996
|
+
var keyText = (Object.keys(this_1.parent.keyTipElements[this_1.parent.selectedTab]))[j];
|
|
10997
|
+
if (this_1.parent.keyTipElements[this_1.parent.selectedTab][keyText]) {
|
|
10998
|
+
var index = getIndex(this_1.parent.keyTipElements[this_1.parent.selectedTab][keyText], function (e) { return e.id + RIBBON_KEYTIP_ID === keyTipItems[parseInt(i.toString(), 10)].id; });
|
|
10999
|
+
/* eslint-enable */
|
|
11000
|
+
if (index !== -1) {
|
|
11001
|
+
if ((keyText === 'item' && !(this_1.isKeytipPopupOpen)) || (keyText === 'grpoverflow' && this_1.parent.activeLayout === 'Classic')) {
|
|
11002
|
+
this_1.createKeytip('tab');
|
|
11003
|
+
key = '';
|
|
11004
|
+
isKeyTipExist = true;
|
|
11005
|
+
break;
|
|
11006
|
+
}
|
|
11007
|
+
else if (this_1.isKeytipPopupOpen) {
|
|
11008
|
+
if ((keyText === 'popupitem' && this_1.parent.activeLayout === 'Simplified') || (keyText === 'grpoverflowpopup' && this_1.parent.activeLayout === 'Classic')) {
|
|
11009
|
+
this_1.createKeytip('item');
|
|
11010
|
+
key = '';
|
|
11011
|
+
isKeyTipExist = true;
|
|
11012
|
+
break;
|
|
11013
|
+
}
|
|
11014
|
+
}
|
|
11015
|
+
}
|
|
11016
|
+
}
|
|
11017
|
+
}
|
|
11018
|
+
for (var n = 0; n < Object.keys(this_1.parent.keyTipElements).length; n++) {
|
|
11019
|
+
if (this_1.parent.keyTipElements[parseInt(n.toString(), 10)]) {
|
|
11020
|
+
var keytipData = this_1.parent.keyTipElements[parseInt(n.toString(), 10)]['tab'];
|
|
11021
|
+
for (var j = 0; j < keytipData.length; j++) {
|
|
11022
|
+
if (keyTipItem.id === keytipData[0].id + RIBBON_KEYTIP_ID) {
|
|
11023
|
+
if (document.querySelector('#' + keytipData[0].id + HEADER_ID).closest('.e-toolbar-pop')) {
|
|
11024
|
+
var tabOverflow = this_1.parent.tabObj.element.querySelector('.e-nav-active');
|
|
11025
|
+
tabOverflow.click();
|
|
11026
|
+
setTimeout(function () {
|
|
11027
|
+
_this.createKeytip('tab');
|
|
11028
|
+
}, 600);
|
|
11029
|
+
key = '';
|
|
11030
|
+
isKeyTipExist = true;
|
|
11031
|
+
break;
|
|
11032
|
+
}
|
|
11033
|
+
}
|
|
11034
|
+
}
|
|
11035
|
+
if (isKeyTipExist) {
|
|
11036
|
+
break;
|
|
11037
|
+
}
|
|
11038
|
+
}
|
|
11039
|
+
}
|
|
11040
|
+
if (!isKeyTipExist && this_1.parent.keyTipElements['backstageMenu']) {
|
|
11041
|
+
var index = getIndex(this_1.parent.keyTipElements['backstageMenu'], function (e) { return e.id + RIBBON_KEYTIP_ID === keyTipItems[parseInt(i.toString(), 10)].id; });
|
|
11042
|
+
if (index !== -1) {
|
|
11043
|
+
this_1.createKeytip('tab');
|
|
11044
|
+
key = '';
|
|
11045
|
+
isKeyTipExist = true;
|
|
11046
|
+
}
|
|
11047
|
+
}
|
|
11048
|
+
}
|
|
11049
|
+
if (keyTipItem) {
|
|
11050
|
+
remove(keyTipItem);
|
|
11051
|
+
}
|
|
11052
|
+
};
|
|
11053
|
+
var this_1 = this;
|
|
11054
|
+
for (var i = 0; i < keyTipItems.length; i++) {
|
|
11055
|
+
_loop_1(i);
|
|
11056
|
+
}
|
|
11057
|
+
this.isKeytipPopupOpen = false;
|
|
11058
|
+
if (!isKeyTipExist)
|
|
11059
|
+
this.parent.isKeytipOpen = false;
|
|
11060
|
+
};
|
|
11061
|
+
/**
|
|
11062
|
+
* Shows the Keytip dynamically.
|
|
11063
|
+
*
|
|
11064
|
+
* @param {string} keyAction - Item for which the tooltip is to be shown.
|
|
11065
|
+
* @returns {void}
|
|
11066
|
+
*/
|
|
11067
|
+
RibbonKeyTip.prototype.showKeyTips = function (keyAction) {
|
|
11068
|
+
if (this.parent.enableKeyTips) {
|
|
11069
|
+
if (keyAction) {
|
|
11070
|
+
this.keytipPress(keyAction, true);
|
|
11071
|
+
}
|
|
11072
|
+
else {
|
|
11073
|
+
this.createKeytip('tab');
|
|
11074
|
+
}
|
|
11075
|
+
}
|
|
11076
|
+
};
|
|
11077
|
+
/**
|
|
11078
|
+
* Hides the Keytip dynamically.
|
|
11079
|
+
*
|
|
11080
|
+
* @returns {void}
|
|
11081
|
+
*/
|
|
11082
|
+
RibbonKeyTip.prototype.hideKeyTips = function () {
|
|
11083
|
+
this.removeKeytip();
|
|
11084
|
+
};
|
|
11085
|
+
return RibbonKeyTip;
|
|
11086
|
+
}());
|
|
11087
|
+
|
|
9021
11088
|
/**
|
|
9022
11089
|
* Ribbon modules
|
|
9023
11090
|
*/
|
|
@@ -9025,5 +11092,5 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
|
|
|
9025
11092
|
// export all modules from current location
|
|
9026
11093
|
// example: export * from './module'
|
|
9027
11094
|
|
|
9028
|
-
export { Ribbon, RibbonLayout, ItemOrientation, RibbonItemSize, DisplayMode, RibbonItemType, RibbonGroupButtonSelection, ITEM_VERTICAL_CENTER, EXPAND_COLLAPSE_ICON, BACKSTAGE_CLOSE_ICON, OVERFLOW_ICON, VERTICAL_DDB, DISABLED_CSS, RTL_CSS, RIBBON_HOVER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_TAB_ACTIVE, RIBBON_TAB_ITEM, RIBBON_COLLAPSE_BUTTON, RIBBON_EXPAND_BUTTON, RIBBON_COLLAPSIBLE, RIBBON_OVERALL_OF_BUTTON, RIBBON_GROUP_OF_BUTTON, RIBBON_OVERFLOW_TARGET, RIBBON_OVERFLOW, TAB_CONTENT, RIBBON_MINIMIZE, RIBBON_GROUP, RIBBON_SINGLE_BUTTON_SELECTION, RIBBON_MULTIPLE_BUTTON_SELECTION, RIBBON_GROUP_BUTTON, RIBBON_GROUP_BUTTON_OVERFLOW_POPUP, RIBBON_GROUP_CONTAINER, RIBBON_OF_TAB_CONTAINER, RIBBON_OF_GROUP_CONTAINER, RIBBON_GROUP_CONTENT, RIBBON_GROUP_HEADER, RIBBON_OVERFLOW_HEADER, RIBBON_GROUP_OVERFLOW, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_LAUNCHER, RIBBON_LAUNCHER_ICON_ELE, RIBBON_LAUNCHER_ICON, RIBBON_COLLECTION, RIBBON_ITEM, RIBBON_ROW, RIBBON_COLUMN, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM, RIBBON_CONTENT_HEIGHT, DROPDOWNBUTTON, DROPDOWNBUTTON_HIDE, RIBBON_TEMPLATE, RIBBON_HELP_TEMPLATE, RIBBON_TOOLTIP, RIBBON_TOOLTIP_TARGET, RIBBON_TOOLTIP_TITLE, RIBBON_TOOLTIP_CONTENT, RIBBON_TOOLTIP_ICON, RIBBON_TOOLTIP_CONTAINER, RIBBON_TEXT_CONTAINER, RIBBON_SIMPLIFIED_MODE, RIBBON_BACKSTAGE_POPUP, RIBBON_BACKSTAGE_OPEN, RIBBON_BACKSTAGE_CONTENT, RIBBON_SELECTED_CONTENT, RIBBON_BACKSTAGE, RIBBON_BACKSTAGE_MENU, RIBBON_BACKSTAGE_TEMPLATE, RIBBON_BACKSTAGE_MENU_WRAPPER, RIBBON_BACKSTAGE_ITEMS_WRAPPER, RIBBON_BACKSTAGE_TEXT_MENU, TAB_ID, GROUP_ID, COLLECTION_ID, ITEM_ID, COLLAPSE_BUTTON_ID, OVRLOF_BUTTON_ID, GROUPOF_BUTTON_ID, HEADER_ID, LAUNCHER_ID, CONTENT_ID, CONTAINER_ID, OVERFLOW_ID, DROPDOWN_ID, RIBBON_FILE_MENU_ID, RIBBON_BACKSTAGE_MENU_ID, RIBBON_BACKSTAGE_POPUP_ID, RIBBON_FILE_MENU_LIST, RIBBON_MENU_LIST, RIBBON_FOOTER_MENU_LIST, RIBBON_HELP_PANE_TEMPLATE_ID, RIBBON_GROUP_BUTTON_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, setCustomAttributes, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, BackStageMenu, BackstageBackButton, BackstageItem, RibbonTooltip, RibbonGroupButtonSettings, RibbonGroupButtonItem, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonGroupButton, RibbonFileMenu, RibbonBackstage };
|
|
11095
|
+
export { Ribbon, RibbonLayout, ItemOrientation, RibbonItemSize, DisplayMode, RibbonItemType, RibbonGroupButtonSelection, ITEM_VERTICAL_CENTER, EXPAND_COLLAPSE_ICON, BACKSTAGE_CLOSE_ICON, OVERFLOW_ICON, VERTICAL_DDB, DISABLED_CSS, RTL_CSS, RIBBON_HOVER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, RIBBON_KEYTIP, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_CONTEXTUAL_TAB, RIBBON_TAB_ACTIVE, RIBBON_TAB_ITEM, RIBBON_COLLAPSE_BUTTON, RIBBON_EXPAND_BUTTON, RIBBON_COLLAPSIBLE, RIBBON_OVERALL_OF_BUTTON, RIBBON_GROUP_OF_BUTTON, RIBBON_OVERFLOW_TARGET, RIBBON_OVERFLOW, TAB_CONTENT, RIBBON_MINIMIZE, RIBBON_GROUP, RIBBON_SINGLE_BUTTON_SELECTION, RIBBON_MULTIPLE_BUTTON_SELECTION, RIBBON_GROUP_BUTTON, RIBBON_GROUP_BUTTON_OVERFLOW_POPUP, RIBBON_GROUP_BUTTON_CONTENT, RIBBON_GROUP_CONTAINER, RIBBON_OF_TAB_CONTAINER, RIBBON_OF_GROUP_CONTAINER, RIBBON_GROUP_CONTENT, RIBBON_GROUP_HEADER, RIBBON_OVERFLOW_HEADER, RIBBON_GROUP_OVERFLOW, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_LAUNCHER, RIBBON_LAUNCHER_ICON_ELE, RIBBON_LAUNCHER_ICON, RIBBON_COLLECTION, RIBBON_ITEM, RIBBON_ROW, RIBBON_COLUMN, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM, RIBBON_CONTENT_HEIGHT, DROPDOWNBUTTON, DROPDOWNBUTTON_HIDE, RIBBON_TEMPLATE, RIBBON_HELP_TEMPLATE, RIBBON_TOOLTIP, RIBBON_TOOLTIP_TARGET, RIBBON_TOOLTIP_TITLE, RIBBON_TOOLTIP_CONTENT, RIBBON_TOOLTIP_ICON, RIBBON_TOOLTIP_CONTAINER, RIBBON_TEXT_CONTAINER, RIBBON_SIMPLIFIED_MODE, RIBBON_BACKSTAGE_POPUP, RIBBON_BACKSTAGE_OPEN, RIBBON_BACKSTAGE_CONTENT, RIBBON_SELECTED_CONTENT, RIBBON_BACKSTAGE, RIBBON_BACKSTAGE_MENU, RIBBON_BACKSTAGE_TEMPLATE, RIBBON_BACKSTAGE_MENU_WRAPPER, RIBBON_BACKSTAGE_ITEMS_WRAPPER, RIBBON_BACKSTAGE_TEXT_MENU, TAB_ID, GROUP_ID, COLLECTION_ID, ITEM_ID, COLLAPSE_BUTTON_ID, OVRLOF_BUTTON_ID, GROUPOF_BUTTON_ID, HEADER_ID, LAUNCHER_ID, CONTENT_ID, CONTAINER_ID, OVERFLOW_ID, DROPDOWN_ID, RIBBON_FILE_MENU_ID, RIBBON_BACKSTAGE_MENU_ID, RIBBON_BACKSTAGE_POPUP_ID, RIBBON_FILE_MENU_LIST, RIBBON_MENU_LIST, RIBBON_FOOTER_MENU_LIST, RIBBON_HELP_PANE_TEMPLATE_ID, RIBBON_GROUP_BUTTON_ID, RIBBON_KEYTIP_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, setCustomAttributes, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, BackStageMenu, BackstageBackButton, BackstageItem, RibbonTooltip, RibbonGroupButtonSettings, RibbonGroupButtonItem, RibbonContextualTabSettings, RibbonGalleryGroup, RibbonGalleryItem, RibbonGallerySettings, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonGroupButton, RibbonGallery, RibbonFileMenu, RibbonBackstage, RibbonContextualTab, RibbonKeyTip };
|
|
9029
11096
|
//# sourceMappingURL=ej2-ribbon.es5.js.map
|