@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
|
@@ -1458,6 +1458,7 @@ let MenuBase = class MenuBase extends Component {
|
|
|
1458
1458
|
}
|
|
1459
1459
|
getUlByNavIdx(navIdxLen = this.navIdx.length) {
|
|
1460
1460
|
if (this.isMenu) {
|
|
1461
|
+
let popup = [this.getWrapper()].concat([].slice.call(selectAll('.' + POPUP)))[navIdxLen];
|
|
1461
1462
|
const popups = [];
|
|
1462
1463
|
const allPopup = selectAll('.' + POPUP);
|
|
1463
1464
|
allPopup.forEach((elem) => {
|
|
@@ -1465,7 +1466,7 @@ let MenuBase = class MenuBase extends Component {
|
|
|
1465
1466
|
popups.push(elem);
|
|
1466
1467
|
}
|
|
1467
1468
|
});
|
|
1468
|
-
|
|
1469
|
+
popup = [this.getWrapper()].concat([].slice.call(popups))[navIdxLen];
|
|
1469
1470
|
return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
|
|
1470
1471
|
}
|
|
1471
1472
|
else {
|
|
@@ -1833,7 +1834,6 @@ let MenuBase = class MenuBase extends Component {
|
|
|
1833
1834
|
}
|
|
1834
1835
|
}
|
|
1835
1836
|
}
|
|
1836
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1837
1837
|
copyObject(source, destination) {
|
|
1838
1838
|
for (const prop in source) {
|
|
1839
1839
|
destination[`${prop}`] = source[`${prop}`];
|
|
@@ -5778,7 +5778,7 @@ let Accordion = class Accordion extends Component {
|
|
|
5778
5778
|
templateParser(template) {
|
|
5779
5779
|
if (template) {
|
|
5780
5780
|
try {
|
|
5781
|
-
if (document.querySelectorAll(template).length) {
|
|
5781
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
5782
5782
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
5783
5783
|
}
|
|
5784
5784
|
else {
|
|
@@ -7067,7 +7067,7 @@ let Menu = class Menu extends MenuBase {
|
|
|
7067
7067
|
this.element.id = this.element.id || getUniqueID('ej2-menu');
|
|
7068
7068
|
if (this.template) {
|
|
7069
7069
|
try {
|
|
7070
|
-
if (document.querySelectorAll(this.template).length) {
|
|
7070
|
+
if (typeof this.template !== 'function' && document.querySelectorAll(this.template).length) {
|
|
7071
7071
|
this.template = document.querySelector(this.template).innerHTML.trim();
|
|
7072
7072
|
this.clearChanges();
|
|
7073
7073
|
}
|
|
@@ -9990,7 +9990,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
9990
9990
|
// eslint-disable-next-line
|
|
9991
9991
|
this.element.classList.add(INTERACTION);
|
|
9992
9992
|
try {
|
|
9993
|
-
if (document.querySelectorAll(template).length) {
|
|
9993
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
9994
9994
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
9995
9995
|
}
|
|
9996
9996
|
else {
|
|
@@ -16250,6 +16250,7 @@ const CLS_CAROUSEL = 'e-carousel';
|
|
|
16250
16250
|
const CLS_ACTIVE$2 = 'e-active';
|
|
16251
16251
|
const CLS_RTL$5 = 'e-rtl';
|
|
16252
16252
|
const CLS_PARTIAL = 'e-partial';
|
|
16253
|
+
const CLS_SWIPE = 'e-swipe';
|
|
16253
16254
|
const CLS_SLIDE_CONTAINER = 'e-carousel-slide-container';
|
|
16254
16255
|
const CLS_ITEMS$2 = 'e-carousel-items';
|
|
16255
16256
|
const CLS_CLONED = 'e-cloned';
|
|
@@ -16283,6 +16284,19 @@ const CLS_PREV_SLIDE = 'e-prev';
|
|
|
16283
16284
|
const CLS_NEXT_SLIDE = 'e-next';
|
|
16284
16285
|
const CLS_TRANSITION_START = 'e-transition-start';
|
|
16285
16286
|
const CLS_TRANSITION_END = 'e-transition-end';
|
|
16287
|
+
/**
|
|
16288
|
+
* Specifies the action (touch & mouse) which enables the slide swiping action in carousel.
|
|
16289
|
+
* * Touch - Enables or disables the swiping action in touch interaction.
|
|
16290
|
+
* * Mouse - Enables or disables the swiping action in mouse interaction.
|
|
16291
|
+
* @aspNumberEnum
|
|
16292
|
+
*/
|
|
16293
|
+
var CarouselSwipeMode;
|
|
16294
|
+
(function (CarouselSwipeMode) {
|
|
16295
|
+
/** Enables or disables the swiping action in touch interaction. */
|
|
16296
|
+
CarouselSwipeMode[CarouselSwipeMode["Touch"] = 1] = "Touch";
|
|
16297
|
+
/** Enables or disables the swiping action in mouse interaction. */
|
|
16298
|
+
CarouselSwipeMode[CarouselSwipeMode["Mouse"] = 2] = "Mouse";
|
|
16299
|
+
})(CarouselSwipeMode || (CarouselSwipeMode = {}));
|
|
16286
16300
|
/** Specifies the carousel individual item. */
|
|
16287
16301
|
class CarouselItem extends ChildProperty {
|
|
16288
16302
|
}
|
|
@@ -16307,6 +16321,7 @@ let Carousel = class Carousel extends Component {
|
|
|
16307
16321
|
*/
|
|
16308
16322
|
constructor(options, element) {
|
|
16309
16323
|
super(options, element);
|
|
16324
|
+
this.isSwipe = false;
|
|
16310
16325
|
}
|
|
16311
16326
|
getModuleName() {
|
|
16312
16327
|
return CLS_CAROUSEL.replace('e-', '');
|
|
@@ -16377,7 +16392,7 @@ let Carousel = class Carousel extends Component {
|
|
|
16377
16392
|
this.applySlideInterval();
|
|
16378
16393
|
}
|
|
16379
16394
|
this.handleNavigatorsActions(this.selectedIndex);
|
|
16380
|
-
if (this.partialVisible) {
|
|
16395
|
+
if (this.partialVisible || !(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
|
|
16381
16396
|
this.reRenderSlides();
|
|
16382
16397
|
}
|
|
16383
16398
|
break;
|
|
@@ -16391,11 +16406,10 @@ let Carousel = class Carousel extends Component {
|
|
|
16391
16406
|
else {
|
|
16392
16407
|
removeClass(rtlElement, CLS_RTL$5);
|
|
16393
16408
|
}
|
|
16394
|
-
if (this.partialVisible) {
|
|
16395
|
-
const
|
|
16396
|
-
const
|
|
16397
|
-
|
|
16398
|
-
itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
|
|
16409
|
+
if (this.partialVisible || !(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
|
|
16410
|
+
const cloneCount = this.loop ? this.getNumOfItems() : 0;
|
|
16411
|
+
const slideWidth = this.itemsContainer.firstElementChild.clientWidth;
|
|
16412
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
|
|
16399
16413
|
}
|
|
16400
16414
|
break;
|
|
16401
16415
|
case 'buttonsVisibility':
|
|
@@ -16435,8 +16449,9 @@ let Carousel = class Carousel extends Component {
|
|
|
16435
16449
|
this.autoSlide();
|
|
16436
16450
|
break;
|
|
16437
16451
|
case 'showIndicators':
|
|
16452
|
+
case 'indicatorsType':
|
|
16438
16453
|
target = this.element.querySelector(`.${CLS_INDICATORS}`);
|
|
16439
|
-
if (
|
|
16454
|
+
if (target) {
|
|
16440
16455
|
this.resetTemplates(['indicatorsTemplate']);
|
|
16441
16456
|
remove(target);
|
|
16442
16457
|
}
|
|
@@ -16463,6 +16478,13 @@ let Carousel = class Carousel extends Component {
|
|
|
16463
16478
|
}
|
|
16464
16479
|
this.reRenderSlides();
|
|
16465
16480
|
break;
|
|
16481
|
+
case 'swipeMode':
|
|
16482
|
+
EventHandler.remove(this.element, 'mousedown touchstart', this.swipeStart);
|
|
16483
|
+
EventHandler.remove(this.element, 'mousemove touchmove', this.swiping);
|
|
16484
|
+
EventHandler.remove(this.element, 'mouseup touchend', this.swipStop);
|
|
16485
|
+
this.swipeModehandlers();
|
|
16486
|
+
this.reRenderSlides();
|
|
16487
|
+
break;
|
|
16466
16488
|
}
|
|
16467
16489
|
}
|
|
16468
16490
|
}
|
|
@@ -16485,6 +16507,9 @@ let Carousel = class Carousel extends Component {
|
|
|
16485
16507
|
if (this.partialVisible) {
|
|
16486
16508
|
carouselClasses.push(CLS_PARTIAL);
|
|
16487
16509
|
}
|
|
16510
|
+
if (!(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
|
|
16511
|
+
carouselClasses.push(CLS_SWIPE);
|
|
16512
|
+
}
|
|
16488
16513
|
addClass([this.element], carouselClasses);
|
|
16489
16514
|
setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
|
|
16490
16515
|
attributes(this.element, { 'tabindex': '0', 'aria-roledescription': 'carousel', 'aria-label': this.localeObj.getConstant('slideShow') });
|
|
@@ -16498,52 +16523,52 @@ let Carousel = class Carousel extends Component {
|
|
|
16498
16523
|
slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER });
|
|
16499
16524
|
this.element.appendChild(slideContainer);
|
|
16500
16525
|
}
|
|
16501
|
-
|
|
16502
|
-
slideContainer.appendChild(itemsContainer);
|
|
16503
|
-
|
|
16526
|
+
this.itemsContainer = this.createElement('div', { className: CLS_ITEMS$2, attrs: { 'aria-live': this.autoPlay ? 'off' : 'polite' } });
|
|
16527
|
+
slideContainer.appendChild(this.itemsContainer);
|
|
16528
|
+
const numOfItems = this.getNumOfItems();
|
|
16529
|
+
if (numOfItems > 0 && this.loop) {
|
|
16504
16530
|
if (this.items.length > 0) {
|
|
16505
|
-
this.items.slice(-
|
|
16506
|
-
this.renderSlide(item, item.template, index, itemsContainer, true);
|
|
16531
|
+
this.items.slice(-numOfItems).forEach((item, index) => {
|
|
16532
|
+
this.renderSlide(item, item.template, index, this.itemsContainer, true);
|
|
16507
16533
|
});
|
|
16508
16534
|
}
|
|
16509
16535
|
else if (this.dataSource.length > 0) {
|
|
16510
|
-
this.dataSource.slice(-
|
|
16511
|
-
this.renderSlide(item, this.itemTemplate, index, itemsContainer, true);
|
|
16536
|
+
this.dataSource.slice(-numOfItems).forEach((item, index) => {
|
|
16537
|
+
this.renderSlide(item, this.itemTemplate, index, this.itemsContainer, true);
|
|
16512
16538
|
});
|
|
16513
16539
|
}
|
|
16514
16540
|
}
|
|
16515
16541
|
if (this.items.length > 0) {
|
|
16516
16542
|
this.slideItems = this.items;
|
|
16517
16543
|
this.items.forEach((item, index) => {
|
|
16518
|
-
this.renderSlide(item, item.template, index, itemsContainer);
|
|
16544
|
+
this.renderSlide(item, item.template, index, this.itemsContainer);
|
|
16519
16545
|
});
|
|
16520
16546
|
}
|
|
16521
16547
|
else if (this.dataSource.length > 0) {
|
|
16522
16548
|
this.slideItems = this.dataSource;
|
|
16523
16549
|
this.dataSource.forEach((item, index) => {
|
|
16524
|
-
this.renderSlide(item, this.itemTemplate, index, itemsContainer);
|
|
16550
|
+
this.renderSlide(item, this.itemTemplate, index, this.itemsContainer);
|
|
16525
16551
|
});
|
|
16526
16552
|
}
|
|
16527
|
-
if (
|
|
16553
|
+
if (numOfItems > 0 && this.loop) {
|
|
16528
16554
|
if (this.items.length > 0) {
|
|
16529
|
-
this.items.slice(0,
|
|
16530
|
-
this.renderSlide(item, item.template, index, itemsContainer, true);
|
|
16555
|
+
this.items.slice(0, numOfItems).forEach((item, index) => {
|
|
16556
|
+
this.renderSlide(item, item.template, index, this.itemsContainer, true);
|
|
16531
16557
|
});
|
|
16532
16558
|
}
|
|
16533
16559
|
else if (this.dataSource.length > 0) {
|
|
16534
|
-
this.dataSource.slice(0,
|
|
16535
|
-
this.renderSlide(item, this.itemTemplate, index, itemsContainer, true);
|
|
16560
|
+
this.dataSource.slice(0, numOfItems).forEach((item, index) => {
|
|
16561
|
+
this.renderSlide(item, this.itemTemplate, index, this.itemsContainer, true);
|
|
16536
16562
|
});
|
|
16537
16563
|
}
|
|
16538
16564
|
}
|
|
16539
16565
|
this.renderTemplates();
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
}
|
|
16566
|
+
this.itemsContainer.style.setProperty('--carousel-items-count', `${this.itemsContainer.children.length}`);
|
|
16567
|
+
const slideWidth = isNullOrUndefined(this.itemsContainer.firstElementChild) ? 0 :
|
|
16568
|
+
this.itemsContainer.firstElementChild.clientWidth;
|
|
16569
|
+
this.itemsContainer.style.transitionProperty = 'none';
|
|
16570
|
+
const cloneCount = this.loop ? numOfItems : 0;
|
|
16571
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
|
|
16547
16572
|
this.autoSlide();
|
|
16548
16573
|
this.renderTouchActions();
|
|
16549
16574
|
this.renderKeyboardActions();
|
|
@@ -16644,8 +16669,7 @@ let Carousel = class Carousel extends Component {
|
|
|
16644
16669
|
if (isLastSlide) {
|
|
16645
16670
|
this.setProperties({ autoPlay: false }, true);
|
|
16646
16671
|
playButton.setAttribute('aria-label', this.localeObj.getConstant('playSlideTransition'));
|
|
16647
|
-
|
|
16648
|
-
itemsContainer.setAttribute('aria-live', 'polite');
|
|
16672
|
+
this.itemsContainer.setAttribute('aria-live', 'polite');
|
|
16649
16673
|
}
|
|
16650
16674
|
buttonObj.appendTo(playButton);
|
|
16651
16675
|
playPauseWrap.appendChild(playButton);
|
|
@@ -16659,34 +16683,69 @@ let Carousel = class Carousel extends Component {
|
|
|
16659
16683
|
if (!this.showIndicators) {
|
|
16660
16684
|
return;
|
|
16661
16685
|
}
|
|
16662
|
-
|
|
16686
|
+
let indicatorClass = 'e-default';
|
|
16687
|
+
if (!this.indicatorsTemplate) {
|
|
16688
|
+
indicatorClass = `e-${this.indicatorsType.toLowerCase()}`;
|
|
16689
|
+
}
|
|
16690
|
+
const indicatorWrap = this.createElement('div', { className: `${CLS_INDICATORS} ${indicatorClass}` });
|
|
16663
16691
|
const indicatorBars = this.createElement('div', { className: CLS_INDICATOR_BARS });
|
|
16664
16692
|
indicatorWrap.appendChild(indicatorBars);
|
|
16693
|
+
let progress;
|
|
16665
16694
|
if (this.slideItems) {
|
|
16666
|
-
this.
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
|
|
16670
|
-
|
|
16671
|
-
|
|
16672
|
-
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
|
|
16676
|
-
|
|
16677
|
-
|
|
16678
|
-
|
|
16679
|
-
|
|
16680
|
-
|
|
16681
|
-
|
|
16682
|
-
|
|
16683
|
-
|
|
16684
|
-
|
|
16685
|
-
|
|
16686
|
-
|
|
16695
|
+
switch (this.indicatorsType) {
|
|
16696
|
+
case 'Fraction':
|
|
16697
|
+
if (this.indicatorsTemplate) {
|
|
16698
|
+
this.renderIndicatorTemplate(indicatorBars, this.selectedIndex + 1);
|
|
16699
|
+
}
|
|
16700
|
+
else {
|
|
16701
|
+
indicatorBars.innerText = `${this.selectedIndex + 1} / ${this.slideItems.length}`;
|
|
16702
|
+
}
|
|
16703
|
+
break;
|
|
16704
|
+
case 'Progress':
|
|
16705
|
+
if (this.indicatorsTemplate) {
|
|
16706
|
+
this.renderIndicatorTemplate(indicatorBars, this.selectedIndex + 1);
|
|
16707
|
+
}
|
|
16708
|
+
else {
|
|
16709
|
+
progress = this.createElement('div', { className: CLS_INDICATOR_BAR });
|
|
16710
|
+
progress.style.setProperty('--carousel-items-current', `${this.selectedIndex + 1}`);
|
|
16711
|
+
progress.style.setProperty('--carousel-items-count', `${this.slideItems.length}`);
|
|
16712
|
+
indicatorBars.appendChild(progress);
|
|
16713
|
+
}
|
|
16714
|
+
break;
|
|
16715
|
+
case 'Default':
|
|
16716
|
+
case 'Dynamic':
|
|
16717
|
+
this.slideItems.forEach((item, index) => {
|
|
16718
|
+
const indicatorBar = this.createElement('div', {
|
|
16719
|
+
className: CLS_INDICATOR_BAR + ' ' + (this.selectedIndex === index ? CLS_ACTIVE$2 : this.selectedIndex - 1 === index ? CLS_PREV_SLIDE : this.selectedIndex + 1 === index ? CLS_NEXT_SLIDE : ''),
|
|
16720
|
+
attrs: { 'data-index': index.toString(), 'aria-current': this.selectedIndex === index ? 'true' : 'false' }
|
|
16721
|
+
});
|
|
16722
|
+
indicatorBar.style.setProperty('--carousel-items-current', `${this.selectedIndex}`);
|
|
16723
|
+
if (this.indicatorsTemplate) {
|
|
16724
|
+
this.renderIndicatorTemplate(indicatorBar, index);
|
|
16725
|
+
}
|
|
16726
|
+
else if (this.indicatorsType === 'Default') {
|
|
16727
|
+
const 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 } });
|
|
16728
|
+
indicatorBar.appendChild(indicator);
|
|
16729
|
+
indicator.appendChild(this.createElement('div', {}));
|
|
16730
|
+
const buttonObj = new Button({ cssClass: 'e-flat e-small' });
|
|
16731
|
+
buttonObj.appendTo(indicator);
|
|
16732
|
+
}
|
|
16733
|
+
indicatorBars.appendChild(indicatorBar);
|
|
16734
|
+
if (this.indicatorsType === 'Default') {
|
|
16735
|
+
EventHandler.add(indicatorBar, 'click', this.indicatorClickHandler, this);
|
|
16736
|
+
}
|
|
16737
|
+
});
|
|
16738
|
+
break;
|
|
16739
|
+
}
|
|
16687
16740
|
}
|
|
16688
16741
|
this.element.appendChild(indicatorWrap);
|
|
16689
16742
|
}
|
|
16743
|
+
renderIndicatorTemplate(indicatorBar, index = 0) {
|
|
16744
|
+
addClass([indicatorBar], CLS_TEMPLATE$2);
|
|
16745
|
+
const templateId = this.element.id + '_indicatorsTemplate';
|
|
16746
|
+
const template = this.templateParser(this.indicatorsTemplate)({ index: index, selectedIndex: this.selectedIndex }, this, 'indicatorsTemplate', templateId, false);
|
|
16747
|
+
append(template, indicatorBar);
|
|
16748
|
+
}
|
|
16690
16749
|
renderKeyboardActions() {
|
|
16691
16750
|
this.keyModule = new KeyboardEvents(this.element, { keyAction: this.keyHandler.bind(this), keyConfigs: this.keyConfigs });
|
|
16692
16751
|
}
|
|
@@ -16801,13 +16860,7 @@ let Carousel = class Carousel extends Component {
|
|
|
16801
16860
|
this.setProperties({ selectedIndex: currentIndex }, true);
|
|
16802
16861
|
attributes(args.currentSlide, { 'aria-hidden': 'true' });
|
|
16803
16862
|
attributes(args.nextSlide, { 'aria-hidden': 'false' });
|
|
16804
|
-
|
|
16805
|
-
if (slideIndicators.length > 0) {
|
|
16806
|
-
attributes(slideIndicators[parseInt(activeIndex.toString(), 10)], { 'aria-current': 'false' });
|
|
16807
|
-
attributes(slideIndicators[parseInt(currentIndex.toString(), 10)], { 'aria-current': 'true' });
|
|
16808
|
-
removeClass(slideIndicators, CLS_ACTIVE$2);
|
|
16809
|
-
addClass([slideIndicators[parseInt(currentIndex.toString(), 10)]], CLS_ACTIVE$2);
|
|
16810
|
-
}
|
|
16863
|
+
this.refreshIndicators(activeIndex, currentIndex);
|
|
16811
16864
|
this.slideChangedEventArgs = {
|
|
16812
16865
|
currentIndex: args.nextIndex,
|
|
16813
16866
|
previousIndex: args.currentIndex,
|
|
@@ -16816,25 +16869,32 @@ let Carousel = class Carousel extends Component {
|
|
|
16816
16869
|
slideDirection: direction,
|
|
16817
16870
|
isSwiped: isSwiped
|
|
16818
16871
|
};
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16872
|
+
const slideWidth = allSlides[parseInt(currentIndex.toString(), 10)].clientWidth;
|
|
16873
|
+
const numOfItems = this.getNumOfItems();
|
|
16874
|
+
if (!this.isSwipe) {
|
|
16875
|
+
this.itemsContainer.style.transitionDuration = '0.6s';
|
|
16876
|
+
}
|
|
16877
|
+
this.isSwipe = false;
|
|
16878
|
+
if ((this.animationEffect === 'Fade')) {
|
|
16879
|
+
this.itemsContainer.classList.add('e-fade-in-out');
|
|
16880
|
+
}
|
|
16881
|
+
else {
|
|
16882
|
+
this.itemsContainer.style.transitionProperty = 'transform';
|
|
16883
|
+
}
|
|
16884
|
+
if (this.loop) {
|
|
16885
|
+
if (this.slideChangedEventArgs.currentIndex === 0 && this.slideChangedEventArgs.slideDirection === 'Next') {
|
|
16886
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, allSlides.length + numOfItems);
|
|
16887
|
+
}
|
|
16888
|
+
else if (this.slideChangedEventArgs.currentIndex === this.slideItems.length - 1 && this.slideChangedEventArgs.slideDirection === 'Previous') {
|
|
16889
|
+
this.itemsContainer.style.transform = this.partialVisible ? this.getTranslateX(slideWidth) : 'translateX(0px)';
|
|
16833
16890
|
}
|
|
16834
16891
|
else {
|
|
16835
|
-
|
|
16892
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, currentIndex + numOfItems);
|
|
16836
16893
|
}
|
|
16837
16894
|
}
|
|
16895
|
+
else {
|
|
16896
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, currentIndex);
|
|
16897
|
+
}
|
|
16838
16898
|
if (this.animationEffect === 'Slide') {
|
|
16839
16899
|
if (direction === 'Previous') {
|
|
16840
16900
|
addClass([args.nextSlide], CLS_PREV_SLIDE);
|
|
@@ -16868,13 +16928,14 @@ let Carousel = class Carousel extends Component {
|
|
|
16868
16928
|
});
|
|
16869
16929
|
}
|
|
16870
16930
|
onTransitionEnd() {
|
|
16931
|
+
removeClass(this.element.querySelectorAll(`.${CLS_ITEMS$2}`), 'e-fade-in-out');
|
|
16932
|
+
const numOfItems = this.getNumOfItems();
|
|
16871
16933
|
if (this.slideChangedEventArgs) {
|
|
16872
|
-
|
|
16934
|
+
this.itemsContainer.style.transitionProperty = 'none';
|
|
16935
|
+
if (this.loop && (this.slideChangedEventArgs.currentIndex === 0 && this.slideChangedEventArgs.slideDirection === 'Next' ||
|
|
16873
16936
|
this.slideChangedEventArgs.currentIndex === this.slideItems.length - 1 && this.slideChangedEventArgs.slideDirection === 'Previous')) {
|
|
16874
|
-
const container = this.element.querySelector('.' + CLS_ITEMS$2);
|
|
16875
16937
|
const slideWidth = this.slideChangedEventArgs.currentSlide.clientWidth;
|
|
16876
|
-
|
|
16877
|
-
container.style.transform = this.getTranslateX(slideWidth, this.slideChangedEventArgs.currentIndex + 2);
|
|
16938
|
+
this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.slideChangedEventArgs.currentIndex + numOfItems);
|
|
16878
16939
|
}
|
|
16879
16940
|
addClass([this.slideChangedEventArgs.currentSlide], CLS_ACTIVE$2);
|
|
16880
16941
|
removeClass([this.slideChangedEventArgs.previousSlide], CLS_ACTIVE$2);
|
|
@@ -16884,6 +16945,51 @@ let Carousel = class Carousel extends Component {
|
|
|
16884
16945
|
});
|
|
16885
16946
|
}
|
|
16886
16947
|
}
|
|
16948
|
+
refreshIndicators(activeIndex, currentIndex) {
|
|
16949
|
+
const slideIndicator = this.element.querySelector(`.${CLS_INDICATOR_BARS}`);
|
|
16950
|
+
if (isNullOrUndefined(slideIndicator)) {
|
|
16951
|
+
return;
|
|
16952
|
+
}
|
|
16953
|
+
const indicators = [].slice.call(slideIndicator.childNodes);
|
|
16954
|
+
switch (this.indicatorsType) {
|
|
16955
|
+
case 'Default':
|
|
16956
|
+
case 'Dynamic':
|
|
16957
|
+
attributes(indicators[parseInt(activeIndex.toString(), 10)], { 'aria-current': 'false' });
|
|
16958
|
+
attributes(indicators[parseInt(currentIndex.toString(), 10)], { 'aria-current': 'true' });
|
|
16959
|
+
removeClass(indicators, [CLS_ACTIVE$2, CLS_PREV_SLIDE, CLS_NEXT_SLIDE]);
|
|
16960
|
+
addClass([indicators[parseInt(currentIndex.toString(), 10)]], CLS_ACTIVE$2);
|
|
16961
|
+
if (indicators[currentIndex - 1]) {
|
|
16962
|
+
addClass([indicators[currentIndex - 1]], CLS_PREV_SLIDE);
|
|
16963
|
+
}
|
|
16964
|
+
if (indicators[currentIndex + 1]) {
|
|
16965
|
+
addClass([indicators[currentIndex + 1]], CLS_NEXT_SLIDE);
|
|
16966
|
+
}
|
|
16967
|
+
indicators.forEach((item) => item.style.setProperty('--carousel-items-current', `${this.selectedIndex}`));
|
|
16968
|
+
break;
|
|
16969
|
+
case 'Fraction':
|
|
16970
|
+
if (this.indicatorsTemplate) {
|
|
16971
|
+
if (slideIndicator.children.length > 0) {
|
|
16972
|
+
slideIndicator.removeChild(slideIndicator.firstElementChild);
|
|
16973
|
+
}
|
|
16974
|
+
this.renderIndicatorTemplate(slideIndicator, currentIndex + 1);
|
|
16975
|
+
}
|
|
16976
|
+
else {
|
|
16977
|
+
slideIndicator.innerText = `${this.selectedIndex + 1} / ${this.slideItems.length}`;
|
|
16978
|
+
}
|
|
16979
|
+
break;
|
|
16980
|
+
case 'Progress':
|
|
16981
|
+
if (this.indicatorsTemplate) {
|
|
16982
|
+
if (slideIndicator.children.length > 0) {
|
|
16983
|
+
slideIndicator.removeChild(slideIndicator.firstElementChild);
|
|
16984
|
+
}
|
|
16985
|
+
this.renderIndicatorTemplate(slideIndicator, currentIndex + 1);
|
|
16986
|
+
}
|
|
16987
|
+
else {
|
|
16988
|
+
slideIndicator.firstElementChild.style.setProperty('--carousel-items-current', `${this.selectedIndex + 1}`);
|
|
16989
|
+
}
|
|
16990
|
+
break;
|
|
16991
|
+
}
|
|
16992
|
+
}
|
|
16887
16993
|
setHtmlAttributes(attribute, element) {
|
|
16888
16994
|
const keys = Object.keys(attribute);
|
|
16889
16995
|
for (const key of keys) {
|
|
@@ -16898,7 +17004,7 @@ let Carousel = class Carousel extends Component {
|
|
|
16898
17004
|
templateParser(template) {
|
|
16899
17005
|
if (template) {
|
|
16900
17006
|
try {
|
|
16901
|
-
if (document.querySelectorAll(template).length) {
|
|
17007
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
16902
17008
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
16903
17009
|
}
|
|
16904
17010
|
else {
|
|
@@ -16947,8 +17053,7 @@ let Carousel = class Carousel extends Component {
|
|
|
16947
17053
|
playButton.setAttribute('aria-label', this.localeObj.getConstant(this.autoPlay ? 'pauseSlideTransition' : 'playSlideTransition'));
|
|
16948
17054
|
buttonObj.iconCss = CLS_ICON$1 + ' ' + (this.autoPlay ? CLS_PAUSE_ICON : CLS_PLAY_ICON);
|
|
16949
17055
|
buttonObj.dataBind();
|
|
16950
|
-
|
|
16951
|
-
itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
|
|
17056
|
+
this.itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
|
|
16952
17057
|
if (this.autoPlay && !this.loop && this.selectedIndex === this.slideItems.length - 1) {
|
|
16953
17058
|
this.setActiveSlide(0, 'Next');
|
|
16954
17059
|
}
|
|
@@ -17032,8 +17137,7 @@ let Carousel = class Carousel extends Component {
|
|
|
17032
17137
|
if (isButtonUpdate) {
|
|
17033
17138
|
this.setProperties({ autoPlay: !isLastSlide }, true);
|
|
17034
17139
|
playButton.setAttribute('aria-label', this.localeObj.getConstant(this.autoPlay ? 'pauseSlideTransition' : 'playSlideTransition'));
|
|
17035
|
-
|
|
17036
|
-
itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
|
|
17140
|
+
this.itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
|
|
17037
17141
|
const buttonObj = getInstance(playButton, Button);
|
|
17038
17142
|
buttonObj.iconCss = CLS_ICON$1 + ' ' + (this.autoPlay ? CLS_PAUSE_ICON : CLS_PLAY_ICON);
|
|
17039
17143
|
buttonObj.dataBind();
|
|
@@ -17092,7 +17196,94 @@ let Carousel = class Carousel extends Component {
|
|
|
17092
17196
|
}
|
|
17093
17197
|
}
|
|
17094
17198
|
}
|
|
17199
|
+
getNumOfItems() {
|
|
17200
|
+
return this.partialVisible ? 2 : 1;
|
|
17201
|
+
}
|
|
17202
|
+
getTranslateValue(element) {
|
|
17203
|
+
const style = getComputedStyle(element);
|
|
17204
|
+
return window.WebKitCSSMatrix ?
|
|
17205
|
+
new WebKitCSSMatrix(style.webkitTransform).m41 : 0;
|
|
17206
|
+
}
|
|
17207
|
+
swipeStart(e) {
|
|
17208
|
+
if (!this.timeStampStart) {
|
|
17209
|
+
this.timeStampStart = Date.now();
|
|
17210
|
+
}
|
|
17211
|
+
this.isSwipe = false;
|
|
17212
|
+
this.itemsContainer.classList.add('e-swipe-start');
|
|
17213
|
+
this.prevPageX = e.touches ? e.touches[0].pageX : e.pageX;
|
|
17214
|
+
this.initialTranslate = this.getTranslateValue(this.itemsContainer);
|
|
17215
|
+
}
|
|
17216
|
+
swiping(e) {
|
|
17217
|
+
if (!this.itemsContainer.classList.contains('e-swipe-start')) {
|
|
17218
|
+
return;
|
|
17219
|
+
}
|
|
17220
|
+
e.preventDefault();
|
|
17221
|
+
const pageX = e.touches ? e.touches[0].pageX : e.pageX;
|
|
17222
|
+
const positionDiff = this.prevPageX - (pageX);
|
|
17223
|
+
if (!this.loop && ((this.enableRtl && ((this.selectedIndex === 0 && positionDiff > 0) ||
|
|
17224
|
+
(this.selectedIndex === this.itemsContainer.childElementCount - 1 && positionDiff < 0))) ||
|
|
17225
|
+
(!this.enableRtl && ((this.selectedIndex === 0 && positionDiff < 0) ||
|
|
17226
|
+
(this.selectedIndex === this.itemsContainer.childElementCount - 1 && positionDiff > 0))))) {
|
|
17227
|
+
return;
|
|
17228
|
+
}
|
|
17229
|
+
this.itemsContainer.style.transform = `translateX(${this.initialTranslate + (this.enableRtl ? positionDiff : -positionDiff)}px)`;
|
|
17230
|
+
}
|
|
17231
|
+
swipStop() {
|
|
17232
|
+
this.isSwipe = true;
|
|
17233
|
+
const time = Date.now() - this.timeStampStart;
|
|
17234
|
+
let distanceX = this.getTranslateValue(this.itemsContainer) - this.initialTranslate;
|
|
17235
|
+
distanceX = distanceX < 0 ? distanceX * -1 : distanceX;
|
|
17236
|
+
if (this.isSwipe) {
|
|
17237
|
+
const offsetDist = distanceX * (Browser.isDevice ? 6 : 1.66);
|
|
17238
|
+
this.itemsContainer.style.transitionDuration = (((Browser.isDevice ? distanceX : offsetDist) / time) / 10) + 's';
|
|
17239
|
+
}
|
|
17240
|
+
const slideWidth = this.itemsContainer.firstElementChild.clientWidth;
|
|
17241
|
+
const threshold = slideWidth / 2;
|
|
17242
|
+
this.itemsContainer.classList.remove('e-swipe-start');
|
|
17243
|
+
const value = this.getTranslateValue(this.itemsContainer);
|
|
17244
|
+
if (value - this.initialTranslate < -threshold) {
|
|
17245
|
+
this.swipeNavigation(!this.enableRtl);
|
|
17246
|
+
}
|
|
17247
|
+
else if (value - this.initialTranslate > threshold) {
|
|
17248
|
+
this.swipeNavigation(this.enableRtl);
|
|
17249
|
+
}
|
|
17250
|
+
else {
|
|
17251
|
+
this.itemsContainer.style.transform = `translateX(${this.initialTranslate}px)`;
|
|
17252
|
+
if (this.animationEffect === 'Fade') {
|
|
17253
|
+
this.itemsContainer.classList.add('e-fade-in-out');
|
|
17254
|
+
}
|
|
17255
|
+
}
|
|
17256
|
+
}
|
|
17257
|
+
swipeNavigation(isRtl) {
|
|
17258
|
+
if (isRtl) {
|
|
17259
|
+
this.next();
|
|
17260
|
+
}
|
|
17261
|
+
else {
|
|
17262
|
+
this.prev();
|
|
17263
|
+
}
|
|
17264
|
+
}
|
|
17265
|
+
swipeModehandlers() {
|
|
17266
|
+
if ((this.swipeMode & CarouselSwipeMode.Touch) === CarouselSwipeMode.Touch) {
|
|
17267
|
+
EventHandler.add(this.itemsContainer, 'touchstart', this.swipeStart, this);
|
|
17268
|
+
EventHandler.add(this.itemsContainer, 'touchmove', this.swiping, this);
|
|
17269
|
+
EventHandler.add(this.itemsContainer, 'touchend', this.swipStop, this);
|
|
17270
|
+
}
|
|
17271
|
+
if ((this.swipeMode & CarouselSwipeMode.Mouse) === CarouselSwipeMode.Mouse) {
|
|
17272
|
+
EventHandler.add(this.itemsContainer, 'mousedown', this.swipeStart, this);
|
|
17273
|
+
EventHandler.add(this.itemsContainer, 'mousemove', this.swiping, this);
|
|
17274
|
+
EventHandler.add(this.itemsContainer, 'mouseup', this.swipStop, this);
|
|
17275
|
+
}
|
|
17276
|
+
if ((this.swipeMode === 0) && (this.swipeMode & CarouselSwipeMode.Mouse & CarouselSwipeMode.Touch) ===
|
|
17277
|
+
(CarouselSwipeMode.Mouse & CarouselSwipeMode.Touch)) {
|
|
17278
|
+
EventHandler.add(this.itemsContainer, 'mousedown touchstart', this.swipeStart, this);
|
|
17279
|
+
EventHandler.add(this.itemsContainer, 'mousemove touchmove', this.swiping, this);
|
|
17280
|
+
EventHandler.add(this.itemsContainer, 'mouseup touchend', this.swipStop, this);
|
|
17281
|
+
}
|
|
17282
|
+
}
|
|
17095
17283
|
wireEvents() {
|
|
17284
|
+
if (!(this.animationEffect === 'Custom')) {
|
|
17285
|
+
this.swipeModehandlers();
|
|
17286
|
+
}
|
|
17096
17287
|
EventHandler.add(this.element, 'focusin focusout', this.onFocusActions, this);
|
|
17097
17288
|
EventHandler.add(this.element, 'mouseenter mouseleave', this.onHoverActions, this);
|
|
17098
17289
|
EventHandler.add(this.element.firstElementChild, 'animationend', this.onTransitionEnd, this);
|
|
@@ -17154,8 +17345,7 @@ let Carousel = class Carousel extends Component {
|
|
|
17154
17345
|
playButton.setAttribute('aria-label', this.localeObj.getConstant('pauseSlideTransition'));
|
|
17155
17346
|
}
|
|
17156
17347
|
this.setProperties({ autoPlay: true }, true);
|
|
17157
|
-
|
|
17158
|
-
itemsContainer.setAttribute('aria-live', 'off');
|
|
17348
|
+
this.itemsContainer.setAttribute('aria-live', 'off');
|
|
17159
17349
|
this.applySlideInterval();
|
|
17160
17350
|
}
|
|
17161
17351
|
/**
|
|
@@ -17171,8 +17361,7 @@ let Carousel = class Carousel extends Component {
|
|
|
17171
17361
|
classList(pauseIcon, [CLS_PLAY_ICON], [CLS_PAUSE_ICON]);
|
|
17172
17362
|
}
|
|
17173
17363
|
this.setProperties({ autoPlay: false }, true);
|
|
17174
|
-
|
|
17175
|
-
itemsContainer.setAttribute('aria-live', 'off');
|
|
17364
|
+
this.itemsContainer.setAttribute('aria-live', 'off');
|
|
17176
17365
|
this.resetSlideInterval();
|
|
17177
17366
|
}
|
|
17178
17367
|
/**
|
|
@@ -17277,12 +17466,18 @@ __decorate$11([
|
|
|
17277
17466
|
__decorate$11([
|
|
17278
17467
|
Property(true)
|
|
17279
17468
|
], Carousel.prototype, "showIndicators", void 0);
|
|
17469
|
+
__decorate$11([
|
|
17470
|
+
Property('Default')
|
|
17471
|
+
], Carousel.prototype, "indicatorsType", void 0);
|
|
17280
17472
|
__decorate$11([
|
|
17281
17473
|
Property('Visible')
|
|
17282
17474
|
], Carousel.prototype, "buttonsVisibility", void 0);
|
|
17283
17475
|
__decorate$11([
|
|
17284
17476
|
Property(false)
|
|
17285
17477
|
], Carousel.prototype, "partialVisible", void 0);
|
|
17478
|
+
__decorate$11([
|
|
17479
|
+
Property(CarouselSwipeMode.Touch)
|
|
17480
|
+
], Carousel.prototype, "swipeMode", void 0);
|
|
17286
17481
|
__decorate$11([
|
|
17287
17482
|
Property()
|
|
17288
17483
|
], Carousel.prototype, "htmlAttributes", void 0);
|
|
@@ -17504,5 +17699,5 @@ AppBar = __decorate$12([
|
|
|
17504
17699
|
* Navigation all modules
|
|
17505
17700
|
*/
|
|
17506
17701
|
|
|
17507
|
-
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 };
|
|
17702
|
+
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 };
|
|
17508
17703
|
//# sourceMappingURL=ej2-navigations.es2015.js.map
|