@syncfusion/ej2-navigations 21.2.9 → 22.1.34
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/.eslintrc.json +1 -0
- package/CHANGELOG.md +9 -0
- package/dist/ej2-navigations.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js.map +1 -1
- package/dist/es6/ej2-navigations.es2015.js +288 -93
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +292 -94
- package/dist/es6/ej2-navigations.es5.js.map +1 -1
- package/dist/global/ej2-navigations.min.js +2 -2
- package/dist/global/ej2-navigations.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/accordion/accordion-model.d.ts +4 -2
- package/src/accordion/accordion.d.ts +4 -2
- package/src/accordion/accordion.js +1 -1
- package/src/breadcrumb/breadcrumb-model.d.ts +4 -2
- package/src/breadcrumb/breadcrumb.d.ts +4 -2
- package/src/carousel/carousel-model.d.ts +37 -8
- package/src/carousel/carousel.d.ts +69 -6
- package/src/carousel/carousel.js +287 -89
- package/src/common/menu-base-model.d.ts +2 -1
- package/src/common/menu-base.d.ts +2 -1
- package/src/common/menu-base.js +2 -2
- package/src/menu/menu-model.d.ts +3 -2
- package/src/menu/menu.d.ts +2 -1
- package/src/menu/menu.js +1 -1
- package/src/sidebar/sidebar.d.ts +12 -26
- package/src/tab/tab-model.d.ts +3 -2
- package/src/tab/tab.d.ts +3 -2
- package/src/toolbar/toolbar-model.d.ts +3 -1
- package/src/toolbar/toolbar.d.ts +3 -1
- package/src/treeview/treeview-model.d.ts +4 -1
- package/src/treeview/treeview.d.ts +17 -31
- package/src/treeview/treeview.js +1 -1
- package/styles/accordion/_bootstrap-dark-definition.scss +3 -1
- package/styles/accordion/_bootstrap-definition.scss +3 -1
- package/styles/accordion/_bootstrap4-definition.scss +2 -0
- package/styles/accordion/_bootstrap5-definition.scss +3 -1
- package/styles/accordion/_fabric-dark-definition.scss +2 -0
- package/styles/accordion/_fabric-definition.scss +2 -0
- package/styles/accordion/_fluent-definition.scss +2 -0
- package/styles/accordion/_fusionnew-definition.scss +2 -0
- package/styles/accordion/_highcontrast-definition.scss +2 -0
- package/styles/accordion/_highcontrast-light-definition.scss +2 -0
- package/styles/accordion/_layout.scss +9 -0
- package/styles/accordion/_material-dark-definition.scss +2 -0
- package/styles/accordion/_material-definition.scss +2 -0
- package/styles/accordion/_material3-dark-definition.scss +1 -0
- package/styles/accordion/_material3-definition.scss +182 -0
- package/styles/accordion/_tailwind-definition.scss +2 -0
- package/styles/accordion/_theme.scss +9 -0
- package/styles/accordion/bootstrap-dark.css +11 -1
- package/styles/accordion/bootstrap.css +11 -1
- package/styles/accordion/bootstrap4.css +10 -0
- package/styles/accordion/bootstrap5-dark.css +11 -1
- package/styles/accordion/bootstrap5.css +11 -1
- package/styles/accordion/fabric-dark.css +10 -0
- package/styles/accordion/fabric.css +10 -0
- package/styles/accordion/fluent-dark.css +10 -0
- package/styles/accordion/fluent.css +10 -0
- package/styles/accordion/highcontrast-light.css +10 -0
- package/styles/accordion/highcontrast.css +10 -0
- package/styles/accordion/icons/_material3-dark.scss +1 -0
- package/styles/accordion/material-dark.css +10 -0
- package/styles/accordion/material.css +10 -0
- package/styles/accordion/material3-dark.css +596 -0
- package/styles/accordion/material3-dark.scss +5 -0
- package/styles/accordion/material3.css +652 -0
- package/styles/accordion/material3.scss +5 -0
- package/styles/accordion/tailwind-dark.css +10 -0
- package/styles/accordion/tailwind.css +10 -0
- package/styles/appbar/_layout.scss +6 -1
- package/styles/appbar/_material3-dark-definition.scss +1 -0
- package/styles/appbar/_material3-definition.scss +8 -0
- package/styles/appbar/_theme.scss +12 -2
- package/styles/appbar/bootstrap-dark.css +7 -3
- package/styles/appbar/bootstrap.css +7 -3
- package/styles/appbar/bootstrap4.css +7 -3
- package/styles/appbar/bootstrap5-dark.css +7 -3
- package/styles/appbar/bootstrap5.css +7 -3
- package/styles/appbar/fabric-dark.css +7 -3
- package/styles/appbar/fabric.css +7 -3
- package/styles/appbar/fluent-dark.css +7 -3
- package/styles/appbar/fluent.css +7 -3
- package/styles/appbar/highcontrast-light.css +7 -3
- package/styles/appbar/highcontrast.css +7 -3
- package/styles/appbar/material-dark.css +7 -3
- package/styles/appbar/material.css +7 -3
- package/styles/appbar/material3-dark.css +307 -0
- package/styles/appbar/material3-dark.scss +4 -0
- package/styles/appbar/material3.css +363 -0
- package/styles/appbar/material3.scss +4 -0
- package/styles/appbar/tailwind-dark.css +7 -3
- package/styles/appbar/tailwind.css +7 -3
- package/styles/bootstrap-dark.css +185 -126
- package/styles/bootstrap.css +185 -126
- package/styles/bootstrap4.css +183 -124
- package/styles/bootstrap5-dark.css +179 -120
- package/styles/bootstrap5.css +179 -120
- package/styles/breadcrumb/_material3-dark-definition.scss +1 -0
- package/styles/breadcrumb/_material3-definition.scss +60 -0
- package/styles/breadcrumb/_theme.scss +13 -11
- package/styles/breadcrumb/bootstrap-dark.css +9 -9
- package/styles/breadcrumb/bootstrap.css +9 -9
- package/styles/breadcrumb/bootstrap4.css +9 -9
- package/styles/breadcrumb/bootstrap5-dark.css +8 -8
- package/styles/breadcrumb/bootstrap5.css +8 -8
- package/styles/breadcrumb/fabric-dark.css +7 -7
- package/styles/breadcrumb/fabric.css +7 -7
- package/styles/breadcrumb/fluent-dark.css +5 -5
- package/styles/breadcrumb/fluent.css +5 -5
- package/styles/breadcrumb/highcontrast-light.css +7 -7
- package/styles/breadcrumb/highcontrast.css +7 -7
- package/styles/breadcrumb/icons/_material3-dark.scss +1 -0
- package/styles/breadcrumb/icons/_material3.scss +0 -11
- package/styles/breadcrumb/material-dark.css +9 -9
- package/styles/breadcrumb/material.css +9 -9
- package/styles/breadcrumb/material3-dark.css +424 -0
- package/styles/breadcrumb/material3-dark.scss +5 -0
- package/styles/breadcrumb/material3.css +480 -0
- package/styles/breadcrumb/material3.scss +5 -0
- package/styles/breadcrumb/tailwind-dark.css +8 -8
- package/styles/breadcrumb/tailwind.css +8 -8
- package/styles/carousel/_bootstrap-dark-definition.scss +5 -0
- package/styles/carousel/_bootstrap-definition.scss +5 -0
- package/styles/carousel/_bootstrap4-definition.scss +5 -0
- package/styles/carousel/_bootstrap5-definition.scss +5 -0
- package/styles/carousel/_fabric-dark-definition.scss +5 -0
- package/styles/carousel/_fabric-definition.scss +5 -0
- package/styles/carousel/_fluent-definition.scss +5 -0
- package/styles/carousel/_fusionnew-definition.scss +5 -0
- package/styles/carousel/_highcontrast-definition.scss +5 -0
- package/styles/carousel/_highcontrast-light-definition.scss +5 -0
- package/styles/carousel/_layout.scss +96 -67
- package/styles/carousel/_material-dark-definition.scss +5 -0
- package/styles/carousel/_material-definition.scss +5 -0
- package/styles/carousel/_material3-dark-definition.scss +1 -0
- package/styles/carousel/_material3-definition.scss +28 -0
- package/styles/carousel/_tailwind-definition.scss +5 -0
- package/styles/carousel/_theme.scss +49 -20
- package/styles/carousel/bootstrap-dark.css +101 -62
- package/styles/carousel/bootstrap.css +101 -62
- package/styles/carousel/bootstrap4.css +101 -62
- package/styles/carousel/bootstrap5-dark.css +101 -62
- package/styles/carousel/bootstrap5.css +101 -62
- package/styles/carousel/fabric-dark.css +101 -62
- package/styles/carousel/fabric.css +101 -62
- package/styles/carousel/fluent-dark.css +101 -62
- package/styles/carousel/fluent.css +101 -62
- package/styles/carousel/highcontrast-light.css +101 -62
- package/styles/carousel/highcontrast.css +101 -62
- package/styles/carousel/icons/_material3-dark.scss +1 -0
- package/styles/carousel/material-dark.css +101 -62
- package/styles/carousel/material.css +101 -62
- package/styles/carousel/material3-dark.css +359 -0
- package/styles/carousel/material3-dark.scss +6 -0
- package/styles/carousel/material3.css +415 -0
- package/styles/carousel/material3.scss +6 -0
- package/styles/carousel/tailwind-dark.css +101 -62
- package/styles/carousel/tailwind.css +101 -62
- package/styles/context-menu/_layout.scss +2 -2
- package/styles/context-menu/_material3-dark-definition.scss +1 -0
- package/styles/context-menu/_material3-definition.scss +52 -0
- package/styles/context-menu/_theme.scss +6 -1
- package/styles/context-menu/icons/_material3-dark.scss +1 -0
- package/styles/context-menu/material3-dark.css +435 -0
- package/styles/context-menu/material3-dark.scss +8 -0
- package/styles/context-menu/material3.css +491 -0
- package/styles/context-menu/material3.scss +8 -0
- package/styles/fabric-dark.css +186 -127
- package/styles/fabric.css +185 -126
- package/styles/fluent-dark.css +179 -120
- package/styles/fluent.css +179 -120
- package/styles/h-scroll/_material3-dark-definition.scss +1 -0
- package/styles/h-scroll/_material3-definition.scss +83 -0
- package/styles/h-scroll/icons/_material3-dark.scss +1 -0
- package/styles/h-scroll/material3-dark.css +336 -0
- package/styles/h-scroll/material3-dark.scss +5 -0
- package/styles/h-scroll/material3.css +392 -0
- package/styles/h-scroll/material3.scss +5 -0
- package/styles/highcontrast-light.css +178 -119
- package/styles/highcontrast.css +182 -123
- package/styles/material-dark.css +189 -130
- package/styles/material.css +188 -129
- package/styles/material3-dark.css +10343 -0
- package/styles/material3-dark.scss +15 -0
- package/styles/material3.css +10399 -0
- package/styles/material3.scss +15 -0
- package/styles/menu/_layout.scss +7 -0
- package/styles/menu/_material3-dark-definition.scss +1 -0
- package/styles/menu/_material3-definition.scss +67 -0
- package/styles/menu/_theme.scss +5 -2
- package/styles/menu/bootstrap-dark.css +4 -0
- package/styles/menu/bootstrap.css +4 -0
- package/styles/menu/bootstrap4.css +4 -0
- package/styles/menu/bootstrap5-dark.css +4 -0
- package/styles/menu/bootstrap5.css +4 -0
- package/styles/menu/fabric-dark.css +4 -0
- package/styles/menu/fabric.css +4 -0
- package/styles/menu/fluent-dark.css +4 -0
- package/styles/menu/fluent.css +4 -0
- package/styles/menu/highcontrast-light.css +4 -0
- package/styles/menu/highcontrast.css +4 -0
- package/styles/menu/icons/_material3-dark.scss +1 -0
- package/styles/menu/material-dark.css +4 -0
- package/styles/menu/material.css +4 -0
- package/styles/menu/material3-dark.css +1162 -0
- package/styles/menu/material3-dark.scss +9 -0
- package/styles/menu/material3.css +1218 -0
- package/styles/menu/material3.scss +9 -0
- package/styles/menu/tailwind-dark.css +4 -0
- package/styles/menu/tailwind.css +4 -0
- package/styles/pager/_bootstrap-dark-definition.scss +9 -5
- package/styles/pager/_bootstrap-definition.scss +9 -5
- package/styles/pager/_bootstrap4-definition.scss +8 -4
- package/styles/pager/_bootstrap5-definition.scss +4 -0
- package/styles/pager/_fabric-dark-definition.scss +10 -6
- package/styles/pager/_fabric-definition.scss +10 -6
- package/styles/pager/_fluent-definition.scss +8 -4
- package/styles/pager/_fusionnew-definition.scss +4 -0
- package/styles/pager/_highcontrast-definition.scss +8 -4
- package/styles/pager/_highcontrast-light-definition.scss +4 -0
- package/styles/pager/_layout.scss +63 -48
- package/styles/pager/_material-dark-definition.scss +12 -8
- package/styles/pager/_material-definition.scss +11 -7
- package/styles/pager/_material3-dark-definition.scss +1 -0
- package/styles/pager/_material3-definition.scss +150 -0
- package/styles/pager/_tailwind-definition.scss +9 -5
- package/styles/pager/_theme.scss +12 -5
- package/styles/pager/bootstrap-dark.css +15 -43
- package/styles/pager/bootstrap.css +15 -43
- package/styles/pager/bootstrap4.css +14 -42
- package/styles/pager/bootstrap5-dark.css +10 -38
- package/styles/pager/bootstrap5.css +10 -38
- package/styles/pager/fabric-dark.css +17 -45
- package/styles/pager/fabric.css +16 -44
- package/styles/pager/fluent-dark.css +14 -42
- package/styles/pager/fluent.css +14 -42
- package/styles/pager/highcontrast-light.css +10 -38
- package/styles/pager/highcontrast.css +14 -42
- package/styles/pager/icons/_material3-dark.scss +1 -0
- package/styles/pager/icons/_material3.scss +4 -4
- package/styles/pager/material-dark.css +18 -46
- package/styles/pager/material.css +17 -45
- package/styles/pager/material3-dark.css +765 -0
- package/styles/pager/material3-dark.scss +5 -0
- package/styles/pager/material3.css +821 -0
- package/styles/pager/material3.scss +5 -0
- package/styles/pager/tailwind-dark.css +15 -43
- package/styles/pager/tailwind.css +15 -43
- package/styles/sidebar/_material3-dark-definition.scss +1 -0
- package/styles/sidebar/_material3-definition.scss +7 -0
- package/styles/sidebar/material3-dark.css +204 -0
- package/styles/sidebar/material3-dark.scss +4 -0
- package/styles/sidebar/material3.css +260 -0
- package/styles/sidebar/material3.scss +4 -0
- package/styles/tab/_bootstrap-dark-definition.scss +4 -0
- package/styles/tab/_bootstrap-definition.scss +4 -0
- package/styles/tab/_bootstrap4-definition.scss +4 -0
- package/styles/tab/_bootstrap5-definition.scss +4 -0
- package/styles/tab/_fabric-dark-definition.scss +4 -0
- package/styles/tab/_fabric-definition.scss +4 -0
- package/styles/tab/_fluent-definition.scss +4 -0
- package/styles/tab/_fusionnew-definition.scss +4 -0
- package/styles/tab/_highcontrast-definition.scss +4 -0
- package/styles/tab/_highcontrast-light-definition.scss +4 -0
- package/styles/tab/_layout.scss +37 -13
- package/styles/tab/_material-dark-definition.scss +4 -0
- package/styles/tab/_material-definition.scss +4 -0
- package/styles/tab/_material3-dark-definition.scss +1 -0
- package/styles/tab/_material3-definition.scss +661 -0
- package/styles/tab/_tailwind-definition.scss +4 -0
- package/styles/tab/_theme.scss +44 -1
- package/styles/tab/bootstrap-dark.css +30 -7
- package/styles/tab/bootstrap.css +30 -7
- package/styles/tab/bootstrap4.css +30 -7
- package/styles/tab/bootstrap5-dark.css +30 -7
- package/styles/tab/bootstrap5.css +30 -7
- package/styles/tab/fabric-dark.css +30 -7
- package/styles/tab/fabric.css +30 -7
- package/styles/tab/fluent-dark.css +30 -7
- package/styles/tab/fluent.css +30 -7
- package/styles/tab/highcontrast-light.css +30 -7
- package/styles/tab/highcontrast.css +30 -7
- package/styles/tab/icons/_material3-dark.scss +1 -0
- package/styles/tab/material-dark.css +30 -7
- package/styles/tab/material.css +30 -7
- package/styles/tab/material3-dark.css +4109 -0
- package/styles/tab/material3-dark.scss +6 -0
- package/styles/tab/material3.css +4165 -0
- package/styles/tab/material3.scss +6 -0
- package/styles/tab/tailwind-dark.css +29 -6
- package/styles/tab/tailwind.css +29 -6
- package/styles/tailwind-dark.css +185 -126
- package/styles/tailwind.css +185 -126
- package/styles/toolbar/_fabric-dark-definition.scss +3 -3
- package/styles/toolbar/_fabric-definition.scss +3 -3
- package/styles/toolbar/_highcontrast-definition.scss +1 -1
- package/styles/toolbar/_highcontrast-light-definition.scss +1 -1
- package/styles/toolbar/_layout.scss +8 -0
- package/styles/toolbar/_material-dark-definition.scss +3 -3
- package/styles/toolbar/_material-definition.scss +3 -3
- package/styles/toolbar/_material3-dark-definition.scss +1 -0
- package/styles/toolbar/_material3-definition.scss +220 -0
- package/styles/toolbar/_tailwind-definition.scss +3 -3
- package/styles/toolbar/_theme.scss +2 -1
- package/styles/toolbar/bootstrap-dark.css +8 -1
- package/styles/toolbar/bootstrap.css +8 -1
- package/styles/toolbar/bootstrap4.css +8 -1
- package/styles/toolbar/bootstrap5-dark.css +8 -1
- package/styles/toolbar/bootstrap5.css +8 -1
- package/styles/toolbar/fabric-dark.css +10 -3
- package/styles/toolbar/fabric.css +10 -3
- package/styles/toolbar/fluent-dark.css +8 -1
- package/styles/toolbar/fluent.css +8 -1
- package/styles/toolbar/highcontrast-light.css +9 -2
- package/styles/toolbar/highcontrast.css +9 -2
- package/styles/toolbar/icons/_material3-dark.scss +1 -0
- package/styles/toolbar/material-dark.css +10 -3
- package/styles/toolbar/material.css +10 -3
- package/styles/toolbar/material3-dark.css +1145 -0
- package/styles/toolbar/material3-dark.scss +9 -0
- package/styles/toolbar/material3.css +1201 -0
- package/styles/toolbar/material3.scss +9 -0
- package/styles/toolbar/tailwind-dark.css +11 -4
- package/styles/toolbar/tailwind.css +11 -4
- package/styles/treeview/_layout.scss +15 -2
- package/styles/treeview/_material3-dark-definition.scss +1 -0
- package/styles/treeview/_material3-definition.scss +121 -0
- package/styles/treeview/icons/_material3-dark.scss +1 -0
- package/styles/treeview/icons/_material3.scss +1 -1
- package/styles/treeview/material3-dark.css +903 -0
- package/styles/treeview/material3-dark.scss +7 -0
- package/styles/treeview/material3.css +959 -0
- package/styles/treeview/material3.scss +7 -0
- package/styles/v-scroll/_material3-dark-definition.scss +1 -0
- package/styles/v-scroll/_material3-definition.scss +49 -0
- package/styles/v-scroll/icons/_material3-dark.scss +1 -0
- package/styles/v-scroll/material3-dark.css +258 -0
- package/styles/v-scroll/material3-dark.scss +5 -0
- package/styles/v-scroll/material3.css +314 -0
- package/styles/v-scroll/material3.scss +5 -0
|
@@ -1536,6 +1536,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1536
1536
|
var _this = this;
|
|
1537
1537
|
if (navIdxLen === void 0) { navIdxLen = this.navIdx.length; }
|
|
1538
1538
|
if (this.isMenu) {
|
|
1539
|
+
var popup = [this.getWrapper()].concat([].slice.call(selectAll('.' + POPUP)))[navIdxLen];
|
|
1539
1540
|
var popups_1 = [];
|
|
1540
1541
|
var allPopup = selectAll('.' + POPUP);
|
|
1541
1542
|
allPopup.forEach(function (elem) {
|
|
@@ -1543,7 +1544,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1543
1544
|
popups_1.push(elem);
|
|
1544
1545
|
}
|
|
1545
1546
|
});
|
|
1546
|
-
|
|
1547
|
+
popup = [this.getWrapper()].concat([].slice.call(popups_1))[navIdxLen];
|
|
1547
1548
|
return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
|
|
1548
1549
|
}
|
|
1549
1550
|
else {
|
|
@@ -1920,7 +1921,6 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1920
1921
|
}
|
|
1921
1922
|
}
|
|
1922
1923
|
};
|
|
1923
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1924
1924
|
MenuBase.prototype.copyObject = function (source, destination) {
|
|
1925
1925
|
for (var prop in source) {
|
|
1926
1926
|
destination["" + prop] = source["" + prop];
|
|
@@ -5964,7 +5964,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
|
|
|
5964
5964
|
Accordion.prototype.templateParser = function (template) {
|
|
5965
5965
|
if (template) {
|
|
5966
5966
|
try {
|
|
5967
|
-
if (document.querySelectorAll(template).length) {
|
|
5967
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
5968
5968
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
5969
5969
|
}
|
|
5970
5970
|
else {
|
|
@@ -7296,7 +7296,7 @@ var Menu = /** @__PURE__ @class */ (function (_super) {
|
|
|
7296
7296
|
this.element.id = this.element.id || getUniqueID('ej2-menu');
|
|
7297
7297
|
if (this.template) {
|
|
7298
7298
|
try {
|
|
7299
|
-
if (document.querySelectorAll(this.template).length) {
|
|
7299
|
+
if (typeof this.template !== 'function' && document.querySelectorAll(this.template).length) {
|
|
7300
7300
|
this.template = document.querySelector(this.template).innerHTML.trim();
|
|
7301
7301
|
this.clearChanges();
|
|
7302
7302
|
}
|
|
@@ -10308,7 +10308,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
10308
10308
|
// eslint-disable-next-line
|
|
10309
10309
|
this.element.classList.add(INTERACTION);
|
|
10310
10310
|
try {
|
|
10311
|
-
if (document.querySelectorAll(template).length) {
|
|
10311
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
10312
10312
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
10313
10313
|
}
|
|
10314
10314
|
else {
|
|
@@ -16655,6 +16655,7 @@ var CLS_CAROUSEL = 'e-carousel';
|
|
|
16655
16655
|
var CLS_ACTIVE$2 = 'e-active';
|
|
16656
16656
|
var CLS_RTL$5 = 'e-rtl';
|
|
16657
16657
|
var CLS_PARTIAL = 'e-partial';
|
|
16658
|
+
var CLS_SWIPE = 'e-swipe';
|
|
16658
16659
|
var CLS_SLIDE_CONTAINER = 'e-carousel-slide-container';
|
|
16659
16660
|
var CLS_ITEMS$2 = 'e-carousel-items';
|
|
16660
16661
|
var CLS_CLONED = 'e-cloned';
|
|
@@ -16688,6 +16689,19 @@ var CLS_PREV_SLIDE = 'e-prev';
|
|
|
16688
16689
|
var CLS_NEXT_SLIDE = 'e-next';
|
|
16689
16690
|
var CLS_TRANSITION_START = 'e-transition-start';
|
|
16690
16691
|
var CLS_TRANSITION_END = 'e-transition-end';
|
|
16692
|
+
/**
|
|
16693
|
+
* Specifies the action (touch & mouse) which enables the slide swiping action in carousel.
|
|
16694
|
+
* * Touch - Enables or disables the swiping action in touch interaction.
|
|
16695
|
+
* * Mouse - Enables or disables the swiping action in mouse interaction.
|
|
16696
|
+
* @aspNumberEnum
|
|
16697
|
+
*/
|
|
16698
|
+
var CarouselSwipeMode;
|
|
16699
|
+
(function (CarouselSwipeMode) {
|
|
16700
|
+
/** Enables or disables the swiping action in touch interaction. */
|
|
16701
|
+
CarouselSwipeMode[CarouselSwipeMode["Touch"] = 1] = "Touch";
|
|
16702
|
+
/** Enables or disables the swiping action in mouse interaction. */
|
|
16703
|
+
CarouselSwipeMode[CarouselSwipeMode["Mouse"] = 2] = "Mouse";
|
|
16704
|
+
})(CarouselSwipeMode || (CarouselSwipeMode = {}));
|
|
16691
16705
|
/** Specifies the carousel individual item. */
|
|
16692
16706
|
var CarouselItem = /** @__PURE__ @class */ (function (_super) {
|
|
16693
16707
|
__extends$11(CarouselItem, _super);
|
|
@@ -16717,7 +16731,9 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
16717
16731
|
* @param {string | HTMLElement} element Accepts the DOM element reference
|
|
16718
16732
|
*/
|
|
16719
16733
|
function Carousel(options, element) {
|
|
16720
|
-
|
|
16734
|
+
var _this = _super.call(this, options, element) || this;
|
|
16735
|
+
_this.isSwipe = false;
|
|
16736
|
+
return _this;
|
|
16721
16737
|
}
|
|
16722
16738
|
Carousel.prototype.getModuleName = function () {
|
|
16723
16739
|
return CLS_CAROUSEL.replace('e-', '');
|
|
@@ -16789,7 +16805,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
16789
16805
|
this.applySlideInterval();
|
|
16790
16806
|
}
|
|
16791
16807
|
this.handleNavigatorsActions(this.selectedIndex);
|
|
16792
|
-
if (this.partialVisible) {
|
|
16808
|
+
if (this.partialVisible || !(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
|
|
16793
16809
|
this.reRenderSlides();
|
|
16794
16810
|
}
|
|
16795
16811
|
break;
|
|
@@ -16802,11 +16818,10 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
16802
16818
|
else {
|
|
16803
16819
|
removeClass(rtlElement, CLS_RTL$5);
|
|
16804
16820
|
}
|
|
16805
|
-
if (this.partialVisible) {
|
|
16806
|
-
var
|
|
16807
|
-
var
|
|
16808
|
-
|
|
16809
|
-
itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
|
|
16821
|
+
if (this.partialVisible || !(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
|
|
16822
|
+
var cloneCount = this.loop ? this.getNumOfItems() : 0;
|
|
16823
|
+
var slideWidth = this.itemsContainer.firstElementChild.clientWidth;
|
|
16824
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
|
|
16810
16825
|
}
|
|
16811
16826
|
break;
|
|
16812
16827
|
case 'buttonsVisibility':
|
|
@@ -16846,8 +16861,9 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
16846
16861
|
this.autoSlide();
|
|
16847
16862
|
break;
|
|
16848
16863
|
case 'showIndicators':
|
|
16864
|
+
case 'indicatorsType':
|
|
16849
16865
|
target = this.element.querySelector("." + CLS_INDICATORS);
|
|
16850
|
-
if (
|
|
16866
|
+
if (target) {
|
|
16851
16867
|
this.resetTemplates(['indicatorsTemplate']);
|
|
16852
16868
|
remove(target);
|
|
16853
16869
|
}
|
|
@@ -16874,6 +16890,13 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
16874
16890
|
}
|
|
16875
16891
|
this.reRenderSlides();
|
|
16876
16892
|
break;
|
|
16893
|
+
case 'swipeMode':
|
|
16894
|
+
EventHandler.remove(this.element, 'mousedown touchstart', this.swipeStart);
|
|
16895
|
+
EventHandler.remove(this.element, 'mousemove touchmove', this.swiping);
|
|
16896
|
+
EventHandler.remove(this.element, 'mouseup touchend', this.swipStop);
|
|
16897
|
+
this.swipeModehandlers();
|
|
16898
|
+
this.reRenderSlides();
|
|
16899
|
+
break;
|
|
16877
16900
|
}
|
|
16878
16901
|
}
|
|
16879
16902
|
};
|
|
@@ -16896,6 +16919,9 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
16896
16919
|
if (this.partialVisible) {
|
|
16897
16920
|
carouselClasses.push(CLS_PARTIAL);
|
|
16898
16921
|
}
|
|
16922
|
+
if (!(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
|
|
16923
|
+
carouselClasses.push(CLS_SWIPE);
|
|
16924
|
+
}
|
|
16899
16925
|
addClass([this.element], carouselClasses);
|
|
16900
16926
|
setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
|
|
16901
16927
|
attributes(this.element, { 'tabindex': '0', 'aria-roledescription': 'carousel', 'aria-label': this.localeObj.getConstant('slideShow') });
|
|
@@ -16910,52 +16936,52 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
16910
16936
|
slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER });
|
|
16911
16937
|
this.element.appendChild(slideContainer);
|
|
16912
16938
|
}
|
|
16913
|
-
|
|
16914
|
-
slideContainer.appendChild(itemsContainer);
|
|
16915
|
-
|
|
16939
|
+
this.itemsContainer = this.createElement('div', { className: CLS_ITEMS$2, attrs: { 'aria-live': this.autoPlay ? 'off' : 'polite' } });
|
|
16940
|
+
slideContainer.appendChild(this.itemsContainer);
|
|
16941
|
+
var numOfItems = this.getNumOfItems();
|
|
16942
|
+
if (numOfItems > 0 && this.loop) {
|
|
16916
16943
|
if (this.items.length > 0) {
|
|
16917
|
-
this.items.slice(-
|
|
16918
|
-
_this.renderSlide(item, item.template, index, itemsContainer, true);
|
|
16944
|
+
this.items.slice(-numOfItems).forEach(function (item, index) {
|
|
16945
|
+
_this.renderSlide(item, item.template, index, _this.itemsContainer, true);
|
|
16919
16946
|
});
|
|
16920
16947
|
}
|
|
16921
16948
|
else if (this.dataSource.length > 0) {
|
|
16922
|
-
this.dataSource.slice(-
|
|
16923
|
-
_this.renderSlide(item, _this.itemTemplate, index, itemsContainer, true);
|
|
16949
|
+
this.dataSource.slice(-numOfItems).forEach(function (item, index) {
|
|
16950
|
+
_this.renderSlide(item, _this.itemTemplate, index, _this.itemsContainer, true);
|
|
16924
16951
|
});
|
|
16925
16952
|
}
|
|
16926
16953
|
}
|
|
16927
16954
|
if (this.items.length > 0) {
|
|
16928
16955
|
this.slideItems = this.items;
|
|
16929
16956
|
this.items.forEach(function (item, index) {
|
|
16930
|
-
_this.renderSlide(item, item.template, index, itemsContainer);
|
|
16957
|
+
_this.renderSlide(item, item.template, index, _this.itemsContainer);
|
|
16931
16958
|
});
|
|
16932
16959
|
}
|
|
16933
16960
|
else if (this.dataSource.length > 0) {
|
|
16934
16961
|
this.slideItems = this.dataSource;
|
|
16935
16962
|
this.dataSource.forEach(function (item, index) {
|
|
16936
|
-
_this.renderSlide(item, _this.itemTemplate, index, itemsContainer);
|
|
16963
|
+
_this.renderSlide(item, _this.itemTemplate, index, _this.itemsContainer);
|
|
16937
16964
|
});
|
|
16938
16965
|
}
|
|
16939
|
-
if (
|
|
16966
|
+
if (numOfItems > 0 && this.loop) {
|
|
16940
16967
|
if (this.items.length > 0) {
|
|
16941
|
-
this.items.slice(0,
|
|
16942
|
-
_this.renderSlide(item, item.template, index, itemsContainer, true);
|
|
16968
|
+
this.items.slice(0, numOfItems).forEach(function (item, index) {
|
|
16969
|
+
_this.renderSlide(item, item.template, index, _this.itemsContainer, true);
|
|
16943
16970
|
});
|
|
16944
16971
|
}
|
|
16945
16972
|
else if (this.dataSource.length > 0) {
|
|
16946
|
-
this.dataSource.slice(0,
|
|
16947
|
-
_this.renderSlide(item, _this.itemTemplate, index, itemsContainer, true);
|
|
16973
|
+
this.dataSource.slice(0, numOfItems).forEach(function (item, index) {
|
|
16974
|
+
_this.renderSlide(item, _this.itemTemplate, index, _this.itemsContainer, true);
|
|
16948
16975
|
});
|
|
16949
16976
|
}
|
|
16950
16977
|
}
|
|
16951
16978
|
this.renderTemplates();
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
}
|
|
16979
|
+
this.itemsContainer.style.setProperty('--carousel-items-count', "" + this.itemsContainer.children.length);
|
|
16980
|
+
var slideWidth = isNullOrUndefined(this.itemsContainer.firstElementChild) ? 0 :
|
|
16981
|
+
this.itemsContainer.firstElementChild.clientWidth;
|
|
16982
|
+
this.itemsContainer.style.transitionProperty = 'none';
|
|
16983
|
+
var cloneCount = this.loop ? numOfItems : 0;
|
|
16984
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
|
|
16959
16985
|
this.autoSlide();
|
|
16960
16986
|
this.renderTouchActions();
|
|
16961
16987
|
this.renderKeyboardActions();
|
|
@@ -17058,8 +17084,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17058
17084
|
if (isLastSlide) {
|
|
17059
17085
|
this.setProperties({ autoPlay: false }, true);
|
|
17060
17086
|
playButton.setAttribute('aria-label', this.localeObj.getConstant('playSlideTransition'));
|
|
17061
|
-
|
|
17062
|
-
itemsContainer.setAttribute('aria-live', 'polite');
|
|
17087
|
+
this.itemsContainer.setAttribute('aria-live', 'polite');
|
|
17063
17088
|
}
|
|
17064
17089
|
buttonObj.appendTo(playButton);
|
|
17065
17090
|
playPauseWrap.appendChild(playButton);
|
|
@@ -17074,34 +17099,70 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17074
17099
|
if (!this.showIndicators) {
|
|
17075
17100
|
return;
|
|
17076
17101
|
}
|
|
17077
|
-
var
|
|
17102
|
+
var indicatorClass = 'e-default';
|
|
17103
|
+
if (!this.indicatorsTemplate) {
|
|
17104
|
+
indicatorClass = "e-" + this.indicatorsType.toLowerCase();
|
|
17105
|
+
}
|
|
17106
|
+
var indicatorWrap = this.createElement('div', { className: CLS_INDICATORS + " " + indicatorClass });
|
|
17078
17107
|
var indicatorBars = this.createElement('div', { className: CLS_INDICATOR_BARS });
|
|
17079
17108
|
indicatorWrap.appendChild(indicatorBars);
|
|
17109
|
+
var progress;
|
|
17080
17110
|
if (this.slideItems) {
|
|
17081
|
-
this.
|
|
17082
|
-
|
|
17083
|
-
|
|
17084
|
-
|
|
17085
|
-
|
|
17086
|
-
|
|
17087
|
-
|
|
17088
|
-
|
|
17089
|
-
|
|
17090
|
-
|
|
17091
|
-
|
|
17092
|
-
|
|
17093
|
-
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
|
|
17099
|
-
|
|
17100
|
-
|
|
17101
|
-
|
|
17111
|
+
switch (this.indicatorsType) {
|
|
17112
|
+
case 'Fraction':
|
|
17113
|
+
if (this.indicatorsTemplate) {
|
|
17114
|
+
this.renderIndicatorTemplate(indicatorBars, this.selectedIndex + 1);
|
|
17115
|
+
}
|
|
17116
|
+
else {
|
|
17117
|
+
indicatorBars.innerText = this.selectedIndex + 1 + " / " + this.slideItems.length;
|
|
17118
|
+
}
|
|
17119
|
+
break;
|
|
17120
|
+
case 'Progress':
|
|
17121
|
+
if (this.indicatorsTemplate) {
|
|
17122
|
+
this.renderIndicatorTemplate(indicatorBars, this.selectedIndex + 1);
|
|
17123
|
+
}
|
|
17124
|
+
else {
|
|
17125
|
+
progress = this.createElement('div', { className: CLS_INDICATOR_BAR });
|
|
17126
|
+
progress.style.setProperty('--carousel-items-current', "" + (this.selectedIndex + 1));
|
|
17127
|
+
progress.style.setProperty('--carousel-items-count', "" + this.slideItems.length);
|
|
17128
|
+
indicatorBars.appendChild(progress);
|
|
17129
|
+
}
|
|
17130
|
+
break;
|
|
17131
|
+
case 'Default':
|
|
17132
|
+
case 'Dynamic':
|
|
17133
|
+
this.slideItems.forEach(function (item, index) {
|
|
17134
|
+
var indicatorBar = _this.createElement('div', {
|
|
17135
|
+
className: CLS_INDICATOR_BAR + ' ' + (_this.selectedIndex === index ? CLS_ACTIVE$2 : _this.selectedIndex - 1 === index ? CLS_PREV_SLIDE : _this.selectedIndex + 1 === index ? CLS_NEXT_SLIDE : ''),
|
|
17136
|
+
attrs: { 'data-index': index.toString(), 'aria-current': _this.selectedIndex === index ? 'true' : 'false' }
|
|
17137
|
+
});
|
|
17138
|
+
indicatorBar.style.setProperty('--carousel-items-current', "" + _this.selectedIndex);
|
|
17139
|
+
if (_this.indicatorsTemplate) {
|
|
17140
|
+
_this.renderIndicatorTemplate(indicatorBar, index);
|
|
17141
|
+
}
|
|
17142
|
+
else if (_this.indicatorsType === 'Default') {
|
|
17143
|
+
var indicator = _this.createElement('button', { className: CLS_INDICATOR$1, attrs: { 'type': 'button', 'aria-label': _this.localeObj.getConstant('slide') + ' ' + (index + 1) + ' ' + _this.localeObj.getConstant('of') + ' ' + _this.slideItems.length } });
|
|
17144
|
+
indicatorBar.appendChild(indicator);
|
|
17145
|
+
indicator.appendChild(_this.createElement('div', {}));
|
|
17146
|
+
var buttonObj = new Button({ cssClass: 'e-flat e-small' });
|
|
17147
|
+
buttonObj.appendTo(indicator);
|
|
17148
|
+
}
|
|
17149
|
+
indicatorBars.appendChild(indicatorBar);
|
|
17150
|
+
if (_this.indicatorsType === 'Default') {
|
|
17151
|
+
EventHandler.add(indicatorBar, 'click', _this.indicatorClickHandler, _this);
|
|
17152
|
+
}
|
|
17153
|
+
});
|
|
17154
|
+
break;
|
|
17155
|
+
}
|
|
17102
17156
|
}
|
|
17103
17157
|
this.element.appendChild(indicatorWrap);
|
|
17104
17158
|
};
|
|
17159
|
+
Carousel.prototype.renderIndicatorTemplate = function (indicatorBar, index) {
|
|
17160
|
+
if (index === void 0) { index = 0; }
|
|
17161
|
+
addClass([indicatorBar], CLS_TEMPLATE$2);
|
|
17162
|
+
var templateId = this.element.id + '_indicatorsTemplate';
|
|
17163
|
+
var template = this.templateParser(this.indicatorsTemplate)({ index: index, selectedIndex: this.selectedIndex }, this, 'indicatorsTemplate', templateId, false);
|
|
17164
|
+
append(template, indicatorBar);
|
|
17165
|
+
};
|
|
17105
17166
|
Carousel.prototype.renderKeyboardActions = function () {
|
|
17106
17167
|
this.keyModule = new KeyboardEvents(this.element, { keyAction: this.keyHandler.bind(this), keyConfigs: this.keyConfigs });
|
|
17107
17168
|
};
|
|
@@ -17219,13 +17280,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17219
17280
|
_this.setProperties({ selectedIndex: currentIndex }, true);
|
|
17220
17281
|
attributes(args.currentSlide, { 'aria-hidden': 'true' });
|
|
17221
17282
|
attributes(args.nextSlide, { 'aria-hidden': 'false' });
|
|
17222
|
-
|
|
17223
|
-
if (slideIndicators.length > 0) {
|
|
17224
|
-
attributes(slideIndicators[parseInt(activeIndex.toString(), 10)], { 'aria-current': 'false' });
|
|
17225
|
-
attributes(slideIndicators[parseInt(currentIndex.toString(), 10)], { 'aria-current': 'true' });
|
|
17226
|
-
removeClass(slideIndicators, CLS_ACTIVE$2);
|
|
17227
|
-
addClass([slideIndicators[parseInt(currentIndex.toString(), 10)]], CLS_ACTIVE$2);
|
|
17228
|
-
}
|
|
17283
|
+
_this.refreshIndicators(activeIndex, currentIndex);
|
|
17229
17284
|
_this.slideChangedEventArgs = {
|
|
17230
17285
|
currentIndex: args.nextIndex,
|
|
17231
17286
|
previousIndex: args.currentIndex,
|
|
@@ -17234,25 +17289,32 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17234
17289
|
slideDirection: direction,
|
|
17235
17290
|
isSwiped: isSwiped
|
|
17236
17291
|
};
|
|
17237
|
-
|
|
17238
|
-
|
|
17239
|
-
|
|
17240
|
-
|
|
17241
|
-
|
|
17242
|
-
|
|
17243
|
-
|
|
17244
|
-
|
|
17245
|
-
|
|
17246
|
-
|
|
17247
|
-
|
|
17248
|
-
|
|
17249
|
-
|
|
17250
|
-
|
|
17292
|
+
var slideWidth = allSlides[parseInt(currentIndex.toString(), 10)].clientWidth;
|
|
17293
|
+
var numOfItems = _this.getNumOfItems();
|
|
17294
|
+
if (!_this.isSwipe) {
|
|
17295
|
+
_this.itemsContainer.style.transitionDuration = '0.6s';
|
|
17296
|
+
}
|
|
17297
|
+
_this.isSwipe = false;
|
|
17298
|
+
if ((_this.animationEffect === 'Fade')) {
|
|
17299
|
+
_this.itemsContainer.classList.add('e-fade-in-out');
|
|
17300
|
+
}
|
|
17301
|
+
else {
|
|
17302
|
+
_this.itemsContainer.style.transitionProperty = 'transform';
|
|
17303
|
+
}
|
|
17304
|
+
if (_this.loop) {
|
|
17305
|
+
if (_this.slideChangedEventArgs.currentIndex === 0 && _this.slideChangedEventArgs.slideDirection === 'Next') {
|
|
17306
|
+
_this.itemsContainer.style.transform = _this.getTranslateX(slideWidth, allSlides.length + numOfItems);
|
|
17307
|
+
}
|
|
17308
|
+
else if (_this.slideChangedEventArgs.currentIndex === _this.slideItems.length - 1 && _this.slideChangedEventArgs.slideDirection === 'Previous') {
|
|
17309
|
+
_this.itemsContainer.style.transform = _this.partialVisible ? _this.getTranslateX(slideWidth) : 'translateX(0px)';
|
|
17251
17310
|
}
|
|
17252
17311
|
else {
|
|
17253
|
-
|
|
17312
|
+
_this.itemsContainer.style.transform = _this.getTranslateX(slideWidth, currentIndex + numOfItems);
|
|
17254
17313
|
}
|
|
17255
17314
|
}
|
|
17315
|
+
else {
|
|
17316
|
+
_this.itemsContainer.style.transform = _this.getTranslateX(slideWidth, currentIndex);
|
|
17317
|
+
}
|
|
17256
17318
|
if (_this.animationEffect === 'Slide') {
|
|
17257
17319
|
if (direction === 'Previous') {
|
|
17258
17320
|
addClass([args.nextSlide], CLS_PREV_SLIDE);
|
|
@@ -17287,13 +17349,14 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17287
17349
|
};
|
|
17288
17350
|
Carousel.prototype.onTransitionEnd = function () {
|
|
17289
17351
|
var _this = this;
|
|
17352
|
+
removeClass(this.element.querySelectorAll("." + CLS_ITEMS$2), 'e-fade-in-out');
|
|
17353
|
+
var numOfItems = this.getNumOfItems();
|
|
17290
17354
|
if (this.slideChangedEventArgs) {
|
|
17291
|
-
|
|
17355
|
+
this.itemsContainer.style.transitionProperty = 'none';
|
|
17356
|
+
if (this.loop && (this.slideChangedEventArgs.currentIndex === 0 && this.slideChangedEventArgs.slideDirection === 'Next' ||
|
|
17292
17357
|
this.slideChangedEventArgs.currentIndex === this.slideItems.length - 1 && this.slideChangedEventArgs.slideDirection === 'Previous')) {
|
|
17293
|
-
var container = this.element.querySelector('.' + CLS_ITEMS$2);
|
|
17294
17358
|
var slideWidth = this.slideChangedEventArgs.currentSlide.clientWidth;
|
|
17295
|
-
|
|
17296
|
-
container.style.transform = this.getTranslateX(slideWidth, this.slideChangedEventArgs.currentIndex + 2);
|
|
17359
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.slideChangedEventArgs.currentIndex + numOfItems);
|
|
17297
17360
|
}
|
|
17298
17361
|
addClass([this.slideChangedEventArgs.currentSlide], CLS_ACTIVE$2);
|
|
17299
17362
|
removeClass([this.slideChangedEventArgs.previousSlide], CLS_ACTIVE$2);
|
|
@@ -17303,6 +17366,52 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17303
17366
|
});
|
|
17304
17367
|
}
|
|
17305
17368
|
};
|
|
17369
|
+
Carousel.prototype.refreshIndicators = function (activeIndex, currentIndex) {
|
|
17370
|
+
var _this = this;
|
|
17371
|
+
var slideIndicator = this.element.querySelector("." + CLS_INDICATOR_BARS);
|
|
17372
|
+
if (isNullOrUndefined(slideIndicator)) {
|
|
17373
|
+
return;
|
|
17374
|
+
}
|
|
17375
|
+
var indicators = [].slice.call(slideIndicator.childNodes);
|
|
17376
|
+
switch (this.indicatorsType) {
|
|
17377
|
+
case 'Default':
|
|
17378
|
+
case 'Dynamic':
|
|
17379
|
+
attributes(indicators[parseInt(activeIndex.toString(), 10)], { 'aria-current': 'false' });
|
|
17380
|
+
attributes(indicators[parseInt(currentIndex.toString(), 10)], { 'aria-current': 'true' });
|
|
17381
|
+
removeClass(indicators, [CLS_ACTIVE$2, CLS_PREV_SLIDE, CLS_NEXT_SLIDE]);
|
|
17382
|
+
addClass([indicators[parseInt(currentIndex.toString(), 10)]], CLS_ACTIVE$2);
|
|
17383
|
+
if (indicators[currentIndex - 1]) {
|
|
17384
|
+
addClass([indicators[currentIndex - 1]], CLS_PREV_SLIDE);
|
|
17385
|
+
}
|
|
17386
|
+
if (indicators[currentIndex + 1]) {
|
|
17387
|
+
addClass([indicators[currentIndex + 1]], CLS_NEXT_SLIDE);
|
|
17388
|
+
}
|
|
17389
|
+
indicators.forEach(function (item) { return item.style.setProperty('--carousel-items-current', "" + _this.selectedIndex); });
|
|
17390
|
+
break;
|
|
17391
|
+
case 'Fraction':
|
|
17392
|
+
if (this.indicatorsTemplate) {
|
|
17393
|
+
if (slideIndicator.children.length > 0) {
|
|
17394
|
+
slideIndicator.removeChild(slideIndicator.firstElementChild);
|
|
17395
|
+
}
|
|
17396
|
+
this.renderIndicatorTemplate(slideIndicator, currentIndex + 1);
|
|
17397
|
+
}
|
|
17398
|
+
else {
|
|
17399
|
+
slideIndicator.innerText = this.selectedIndex + 1 + " / " + this.slideItems.length;
|
|
17400
|
+
}
|
|
17401
|
+
break;
|
|
17402
|
+
case 'Progress':
|
|
17403
|
+
if (this.indicatorsTemplate) {
|
|
17404
|
+
if (slideIndicator.children.length > 0) {
|
|
17405
|
+
slideIndicator.removeChild(slideIndicator.firstElementChild);
|
|
17406
|
+
}
|
|
17407
|
+
this.renderIndicatorTemplate(slideIndicator, currentIndex + 1);
|
|
17408
|
+
}
|
|
17409
|
+
else {
|
|
17410
|
+
slideIndicator.firstElementChild.style.setProperty('--carousel-items-current', "" + (this.selectedIndex + 1));
|
|
17411
|
+
}
|
|
17412
|
+
break;
|
|
17413
|
+
}
|
|
17414
|
+
};
|
|
17306
17415
|
Carousel.prototype.setHtmlAttributes = function (attribute, element) {
|
|
17307
17416
|
var keys = Object.keys(attribute);
|
|
17308
17417
|
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
@@ -17318,7 +17427,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17318
17427
|
Carousel.prototype.templateParser = function (template) {
|
|
17319
17428
|
if (template) {
|
|
17320
17429
|
try {
|
|
17321
|
-
if (document.querySelectorAll(template).length) {
|
|
17430
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
17322
17431
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
17323
17432
|
}
|
|
17324
17433
|
else {
|
|
@@ -17368,8 +17477,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17368
17477
|
playButton.setAttribute('aria-label', this.localeObj.getConstant(this.autoPlay ? 'pauseSlideTransition' : 'playSlideTransition'));
|
|
17369
17478
|
buttonObj.iconCss = CLS_ICON$1 + ' ' + (this.autoPlay ? CLS_PAUSE_ICON : CLS_PLAY_ICON);
|
|
17370
17479
|
buttonObj.dataBind();
|
|
17371
|
-
|
|
17372
|
-
itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
|
|
17480
|
+
this.itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
|
|
17373
17481
|
if (this.autoPlay && !this.loop && this.selectedIndex === this.slideItems.length - 1) {
|
|
17374
17482
|
this.setActiveSlide(0, 'Next');
|
|
17375
17483
|
}
|
|
@@ -17453,8 +17561,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17453
17561
|
if (isButtonUpdate) {
|
|
17454
17562
|
this.setProperties({ autoPlay: !isLastSlide }, true);
|
|
17455
17563
|
playButton.setAttribute('aria-label', this.localeObj.getConstant(this.autoPlay ? 'pauseSlideTransition' : 'playSlideTransition'));
|
|
17456
|
-
|
|
17457
|
-
itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
|
|
17564
|
+
this.itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
|
|
17458
17565
|
var buttonObj = getInstance(playButton, Button);
|
|
17459
17566
|
buttonObj.iconCss = CLS_ICON$1 + ' ' + (this.autoPlay ? CLS_PAUSE_ICON : CLS_PLAY_ICON);
|
|
17460
17567
|
buttonObj.dataBind();
|
|
@@ -17514,7 +17621,94 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17514
17621
|
}
|
|
17515
17622
|
}
|
|
17516
17623
|
};
|
|
17624
|
+
Carousel.prototype.getNumOfItems = function () {
|
|
17625
|
+
return this.partialVisible ? 2 : 1;
|
|
17626
|
+
};
|
|
17627
|
+
Carousel.prototype.getTranslateValue = function (element) {
|
|
17628
|
+
var style = getComputedStyle(element);
|
|
17629
|
+
return window.WebKitCSSMatrix ?
|
|
17630
|
+
new WebKitCSSMatrix(style.webkitTransform).m41 : 0;
|
|
17631
|
+
};
|
|
17632
|
+
Carousel.prototype.swipeStart = function (e) {
|
|
17633
|
+
if (!this.timeStampStart) {
|
|
17634
|
+
this.timeStampStart = Date.now();
|
|
17635
|
+
}
|
|
17636
|
+
this.isSwipe = false;
|
|
17637
|
+
this.itemsContainer.classList.add('e-swipe-start');
|
|
17638
|
+
this.prevPageX = e.touches ? e.touches[0].pageX : e.pageX;
|
|
17639
|
+
this.initialTranslate = this.getTranslateValue(this.itemsContainer);
|
|
17640
|
+
};
|
|
17641
|
+
Carousel.prototype.swiping = function (e) {
|
|
17642
|
+
if (!this.itemsContainer.classList.contains('e-swipe-start')) {
|
|
17643
|
+
return;
|
|
17644
|
+
}
|
|
17645
|
+
e.preventDefault();
|
|
17646
|
+
var pageX = e.touches ? e.touches[0].pageX : e.pageX;
|
|
17647
|
+
var positionDiff = this.prevPageX - (pageX);
|
|
17648
|
+
if (!this.loop && ((this.enableRtl && ((this.selectedIndex === 0 && positionDiff > 0) ||
|
|
17649
|
+
(this.selectedIndex === this.itemsContainer.childElementCount - 1 && positionDiff < 0))) ||
|
|
17650
|
+
(!this.enableRtl && ((this.selectedIndex === 0 && positionDiff < 0) ||
|
|
17651
|
+
(this.selectedIndex === this.itemsContainer.childElementCount - 1 && positionDiff > 0))))) {
|
|
17652
|
+
return;
|
|
17653
|
+
}
|
|
17654
|
+
this.itemsContainer.style.transform = "translateX(" + (this.initialTranslate + (this.enableRtl ? positionDiff : -positionDiff)) + "px)";
|
|
17655
|
+
};
|
|
17656
|
+
Carousel.prototype.swipStop = function () {
|
|
17657
|
+
this.isSwipe = true;
|
|
17658
|
+
var time = Date.now() - this.timeStampStart;
|
|
17659
|
+
var distanceX = this.getTranslateValue(this.itemsContainer) - this.initialTranslate;
|
|
17660
|
+
distanceX = distanceX < 0 ? distanceX * -1 : distanceX;
|
|
17661
|
+
if (this.isSwipe) {
|
|
17662
|
+
var offsetDist = distanceX * (Browser.isDevice ? 6 : 1.66);
|
|
17663
|
+
this.itemsContainer.style.transitionDuration = (((Browser.isDevice ? distanceX : offsetDist) / time) / 10) + 's';
|
|
17664
|
+
}
|
|
17665
|
+
var slideWidth = this.itemsContainer.firstElementChild.clientWidth;
|
|
17666
|
+
var threshold = slideWidth / 2;
|
|
17667
|
+
this.itemsContainer.classList.remove('e-swipe-start');
|
|
17668
|
+
var value = this.getTranslateValue(this.itemsContainer);
|
|
17669
|
+
if (value - this.initialTranslate < -threshold) {
|
|
17670
|
+
this.swipeNavigation(!this.enableRtl);
|
|
17671
|
+
}
|
|
17672
|
+
else if (value - this.initialTranslate > threshold) {
|
|
17673
|
+
this.swipeNavigation(this.enableRtl);
|
|
17674
|
+
}
|
|
17675
|
+
else {
|
|
17676
|
+
this.itemsContainer.style.transform = "translateX(" + this.initialTranslate + "px)";
|
|
17677
|
+
if (this.animationEffect === 'Fade') {
|
|
17678
|
+
this.itemsContainer.classList.add('e-fade-in-out');
|
|
17679
|
+
}
|
|
17680
|
+
}
|
|
17681
|
+
};
|
|
17682
|
+
Carousel.prototype.swipeNavigation = function (isRtl) {
|
|
17683
|
+
if (isRtl) {
|
|
17684
|
+
this.next();
|
|
17685
|
+
}
|
|
17686
|
+
else {
|
|
17687
|
+
this.prev();
|
|
17688
|
+
}
|
|
17689
|
+
};
|
|
17690
|
+
Carousel.prototype.swipeModehandlers = function () {
|
|
17691
|
+
if ((this.swipeMode & CarouselSwipeMode.Touch) === CarouselSwipeMode.Touch) {
|
|
17692
|
+
EventHandler.add(this.itemsContainer, 'touchstart', this.swipeStart, this);
|
|
17693
|
+
EventHandler.add(this.itemsContainer, 'touchmove', this.swiping, this);
|
|
17694
|
+
EventHandler.add(this.itemsContainer, 'touchend', this.swipStop, this);
|
|
17695
|
+
}
|
|
17696
|
+
if ((this.swipeMode & CarouselSwipeMode.Mouse) === CarouselSwipeMode.Mouse) {
|
|
17697
|
+
EventHandler.add(this.itemsContainer, 'mousedown', this.swipeStart, this);
|
|
17698
|
+
EventHandler.add(this.itemsContainer, 'mousemove', this.swiping, this);
|
|
17699
|
+
EventHandler.add(this.itemsContainer, 'mouseup', this.swipStop, this);
|
|
17700
|
+
}
|
|
17701
|
+
if ((this.swipeMode === 0) && (this.swipeMode & CarouselSwipeMode.Mouse & CarouselSwipeMode.Touch) ===
|
|
17702
|
+
(CarouselSwipeMode.Mouse & CarouselSwipeMode.Touch)) {
|
|
17703
|
+
EventHandler.add(this.itemsContainer, 'mousedown touchstart', this.swipeStart, this);
|
|
17704
|
+
EventHandler.add(this.itemsContainer, 'mousemove touchmove', this.swiping, this);
|
|
17705
|
+
EventHandler.add(this.itemsContainer, 'mouseup touchend', this.swipStop, this);
|
|
17706
|
+
}
|
|
17707
|
+
};
|
|
17517
17708
|
Carousel.prototype.wireEvents = function () {
|
|
17709
|
+
if (!(this.animationEffect === 'Custom')) {
|
|
17710
|
+
this.swipeModehandlers();
|
|
17711
|
+
}
|
|
17518
17712
|
EventHandler.add(this.element, 'focusin focusout', this.onFocusActions, this);
|
|
17519
17713
|
EventHandler.add(this.element, 'mouseenter mouseleave', this.onHoverActions, this);
|
|
17520
17714
|
EventHandler.add(this.element.firstElementChild, 'animationend', this.onTransitionEnd, this);
|
|
@@ -17577,8 +17771,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17577
17771
|
playButton.setAttribute('aria-label', this.localeObj.getConstant('pauseSlideTransition'));
|
|
17578
17772
|
}
|
|
17579
17773
|
this.setProperties({ autoPlay: true }, true);
|
|
17580
|
-
|
|
17581
|
-
itemsContainer.setAttribute('aria-live', 'off');
|
|
17774
|
+
this.itemsContainer.setAttribute('aria-live', 'off');
|
|
17582
17775
|
this.applySlideInterval();
|
|
17583
17776
|
};
|
|
17584
17777
|
/**
|
|
@@ -17594,8 +17787,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17594
17787
|
classList(pauseIcon, [CLS_PLAY_ICON], [CLS_PAUSE_ICON]);
|
|
17595
17788
|
}
|
|
17596
17789
|
this.setProperties({ autoPlay: false }, true);
|
|
17597
|
-
|
|
17598
|
-
itemsContainer.setAttribute('aria-live', 'off');
|
|
17790
|
+
this.itemsContainer.setAttribute('aria-live', 'off');
|
|
17599
17791
|
this.resetSlideInterval();
|
|
17600
17792
|
};
|
|
17601
17793
|
/**
|
|
@@ -17700,12 +17892,18 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17700
17892
|
__decorate$11([
|
|
17701
17893
|
Property(true)
|
|
17702
17894
|
], Carousel.prototype, "showIndicators", void 0);
|
|
17895
|
+
__decorate$11([
|
|
17896
|
+
Property('Default')
|
|
17897
|
+
], Carousel.prototype, "indicatorsType", void 0);
|
|
17703
17898
|
__decorate$11([
|
|
17704
17899
|
Property('Visible')
|
|
17705
17900
|
], Carousel.prototype, "buttonsVisibility", void 0);
|
|
17706
17901
|
__decorate$11([
|
|
17707
17902
|
Property(false)
|
|
17708
17903
|
], Carousel.prototype, "partialVisible", void 0);
|
|
17904
|
+
__decorate$11([
|
|
17905
|
+
Property(CarouselSwipeMode.Touch)
|
|
17906
|
+
], Carousel.prototype, "swipeMode", void 0);
|
|
17709
17907
|
__decorate$11([
|
|
17710
17908
|
Property()
|
|
17711
17909
|
], Carousel.prototype, "htmlAttributes", void 0);
|
|
@@ -17947,5 +18145,5 @@ var AppBar = /** @__PURE__ @class */ (function (_super) {
|
|
|
17947
18145
|
* Navigation all modules
|
|
17948
18146
|
*/
|
|
17949
18147
|
|
|
17950
|
-
export { MenuAnimationSettings, MenuItem, FieldSettings, HScroll, VScroll, addScrolling, destroyScroll, Item, Toolbar, AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion, ContextMenu, Menu, TabActionSettings, TabAnimationSettings, Header, TabItem, Tab, FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView, Sidebar, BreadcrumbOverflowMode, BreadcrumbItem, Breadcrumb, CarouselItem, Carousel, AppBar };
|
|
18148
|
+
export { MenuAnimationSettings, MenuItem, FieldSettings, HScroll, VScroll, addScrolling, destroyScroll, Item, Toolbar, AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion, ContextMenu, Menu, TabActionSettings, TabAnimationSettings, Header, TabItem, Tab, FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView, Sidebar, BreadcrumbOverflowMode, BreadcrumbItem, Breadcrumb, CarouselSwipeMode, CarouselItem, Carousel, AppBar };
|
|
17951
18149
|
//# sourceMappingURL=ej2-navigations.es5.js.map
|