infinity-forge 2.4.0 → 2.4.2
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/dist/sites/components/default-pages/blog/components/blog-item/index.d.ts +1 -1
- package/dist/sites/components/default-pages/blog/components/blog-item/index.js +3 -3
- package/dist/sites/components/default-pages/blog/components/blog-item/intefaces.d.ts +1 -1
- package/dist/sites/components/default-pages/blog/components/featured-blog/index.d.ts +1 -1
- package/dist/sites/components/default-pages/blog/components/featured-blog/index.js +2 -2
- package/dist/sites/components/default-pages/blog/components/featured-blog/interfaces.d.ts +2 -2
- package/dist/sites/components/default-pages/blog/components/side-box-categories/index.d.ts +2 -2
- package/dist/sites/components/default-pages/blog/components/side-box-categories/index.js +2 -2
- package/dist/sites/components/default-pages/blog/components/side-box-categories/interfaces.d.ts +1 -1
- package/dist/sites/components/default-pages/blog/components/side-box-newsletter/index.d.ts +1 -1
- package/dist/sites/components/default-pages/blog/components/side-box-newsletter/index.js +3 -3
- package/dist/sites/components/default-pages/blog/components/title-blog/index.js +2 -2
- package/dist/system/domain/protocols/http/errors/http-errors/index.d.ts +7 -7
- package/dist/system/domain/protocols/http/errors/http-errors/index.js +7 -7
- package/dist/system/domain/protocols/http/errors/system-errors-model/index.d.ts +1 -1
- package/dist/system/domain/protocols/http/errors/system-errors-model/index.js +1 -1
- package/dist/system/domain/use-cases/auth/admin/index.js +0 -18
- package/dist/system/presentation/components/data/avatar/index.js +0 -59
- package/dist/system/presentation/components/data/buttons/index.d.ts +0 -1
- package/dist/system/presentation/components/data/buttons/index.js +0 -18
- package/dist/system/presentation/components/data/buttons/sidebar-button/index.js +3 -3
- package/dist/system/presentation/components/data/chat/card-message/index.d.ts +1 -1
- package/dist/system/presentation/components/data/chat/card-message/index.js +3 -3
- package/dist/system/presentation/components/data/chat/index.d.ts +0 -2
- package/dist/system/presentation/components/data/chat/index.js +0 -38
- package/dist/system/presentation/components/data/chat/interfaces.d.ts +0 -8
- package/dist/system/presentation/components/data/chat/loader/index.js +1 -1
- package/dist/system/presentation/components/data/detail-card/component.d.ts +0 -2
- package/dist/system/presentation/components/data/detail-card/component.js +0 -42
- package/dist/system/presentation/components/data/detail-card/index.d.ts +0 -2
- package/dist/system/presentation/components/data/detail-card/index.js +0 -19
- package/dist/system/presentation/components/data/detail-card/interfaces.d.ts +0 -19
- package/dist/system/presentation/components/data/highlight-icon/index.d.ts +0 -2
- package/dist/system/presentation/components/data/highlight-icon/index.js +0 -40
- package/dist/system/presentation/components/data/highlight-icon/interfaces.d.ts +0 -8
- package/dist/system/presentation/components/data/highlight-text/index.d.ts +0 -2
- package/dist/system/presentation/components/data/highlight-text/index.js +0 -43
- package/dist/system/presentation/components/data/input-search/index.d.ts +0 -2
- package/dist/system/presentation/components/data/input-search/index.js +0 -39
- package/dist/system/presentation/components/data/logo/index.js +0 -34
- package/dist/system/presentation/components/data/menu/component.js +0 -17
- package/dist/system/presentation/components/data/menu/components/index.d.ts +1 -1
- package/dist/system/presentation/components/data/menu/components/index.js +1 -1
- package/dist/system/presentation/components/data/menu/index.d.ts +0 -2
- package/dist/system/presentation/components/data/menu/index.js +0 -19
- package/dist/system/presentation/components/data/menu/modes/index.d.ts +2 -2
- package/dist/system/presentation/components/data/menu/modes/index.js +2 -2
- package/dist/system/presentation/components/data/notifications/card/index.d.ts +1 -1
- package/dist/system/presentation/components/data/notifications/card/index.js +2 -2
- package/dist/system/presentation/components/data/notifications/index.js +0 -155
- package/dist/system/presentation/components/data/page-wrapper/index.d.ts +0 -2
- package/dist/system/presentation/components/data/page-wrapper/index.js +0 -35
- package/dist/system/presentation/components/data/page-wrapper/interfaces.d.ts +0 -7
- package/dist/system/presentation/components/data/popover/index.d.ts +0 -2
- package/dist/system/presentation/components/data/profile-infos/index.d.ts +0 -2
- package/dist/system/presentation/components/data/profile-infos/index.js +0 -48
- package/dist/system/presentation/components/data/profile-infos/interfaces.d.ts +0 -6
- package/dist/system/presentation/components/data/profile-infos/profile/index.d.ts +1 -1
- package/dist/system/presentation/components/data/profile-infos/profile/index.js +3 -3
- package/dist/system/presentation/components/data/select-workspace/index.d.ts +0 -4
- package/dist/system/presentation/components/data/select-workspace/index.js +0 -69
- package/dist/system/presentation/components/data/tab/component.d.ts +0 -2
- package/dist/system/presentation/components/data/tab/component.js +0 -67
- package/dist/system/presentation/components/data/tab/index.d.ts +0 -2
- package/dist/system/presentation/components/data/tab/index.js +0 -19
- package/dist/system/presentation/components/data/tab/interfaces.d.ts +0 -29
- package/dist/system/presentation/components/data/tab/tab-item/index.d.ts +5 -0
- package/dist/system/presentation/components/data/tab/tab-item/index.js +46 -0
- package/dist/system/presentation/components/data/tab/tab-item/styles.d.ts +8 -0
- package/dist/system/presentation/components/layout/header/components/index.d.ts +2 -0
- package/dist/system/presentation/components/layout/header/components/index.js +19 -0
- package/dist/system/presentation/components/layout/header/index.d.ts +0 -2
- package/dist/system/presentation/components/layout/header/index.js +0 -25
- package/dist/system/presentation/components/layout/header/version-01/index.d.ts +2 -0
- package/dist/system/presentation/components/layout/header/version-01/index.js +45 -0
- package/dist/system/presentation/components/pages/menus/index.d.ts +0 -1
- package/dist/system/presentation/components/pages/menus/index.js +0 -18
- package/dist/system/presentation/components/pages/menus/page.js +0 -40
- package/dist/system/presentation/components/pages/menus/table/columns.d.ts +3 -0
- package/dist/system/presentation/components/pages/menus/table/columns.js +21 -0
- package/dist/system/presentation/components/pages/menus/table/create.d.ts +3 -0
- package/dist/system/presentation/components/pages/menus/table/create.js +72 -0
- package/dist/system/presentation/components/pages/menus/table/delete.js +71 -0
- package/dist/system/presentation/components/pages/menus/table/edit.d.ts +3 -0
- package/dist/system/presentation/components/pages/menus/table/edit.js +78 -0
- package/dist/system/presentation/components/pages/menus/table/index.d.ts +4 -0
- package/dist/system/presentation/components/pages/menus/table/index.js +21 -0
- package/dist/system/presentation/components/pages/users/index.d.ts +0 -1
- package/dist/system/presentation/components/pages/users/index.js +0 -18
- package/dist/system/presentation/components/pages/users/page.js +0 -40
- package/dist/system/presentation/components/pages/users/table/columns.d.ts +3 -0
- package/dist/system/presentation/components/pages/users/table/create.d.ts +3 -0
- package/dist/system/presentation/components/pages/users/table/create.js +75 -0
- package/dist/system/presentation/components/pages/users/table/delete.js +74 -0
- package/dist/system/presentation/components/pages/users/table/edit.d.ts +3 -0
- package/dist/system/presentation/components/pages/users/table/edit.js +83 -0
- package/dist/system/presentation/components/pages/users/table/index.d.ts +4 -0
- package/dist/system/presentation/components/pages/users/table/index.js +21 -0
- package/dist/system/presentation/context/auth/components/index.d.ts +0 -2
- package/dist/system/presentation/context/auth/components/index.js +0 -19
- package/dist/system/presentation/context/auth/components/login/index.js +38 -0
- package/dist/system/presentation/context/auth/components/private-page/index.d.ts +2 -0
- package/dist/system/presentation/context/auth/components/private-page/index.js +141 -0
- package/dist/system/presentation/hooks/notifications/use-load-all/index.d.ts +0 -1
- package/dist/system/presentation/hooks/notifications/use-load-all/index.js +0 -63
- package/dist/system/presentation/hooks/notifications/use-load-no-read/index.d.ts +0 -2
- package/dist/system/presentation/hooks/notifications/use-load-no-read/index.js +0 -60
- package/dist/system/presentation/hooks/ui/use-table/component.d.ts +0 -8
- package/dist/system/presentation/hooks/ui/use-table/component.js +0 -26
- package/dist/system/presentation/hooks/ui/use-table/components/index.d.ts +1 -0
- package/dist/system/presentation/hooks/ui/use-table/components/index.js +18 -0
- package/dist/system/presentation/hooks/ui/use-table/index.d.ts +0 -4
- package/dist/system/presentation/hooks/ui/use-table/index.js +0 -21
- package/dist/system/presentation/hooks/ui/use-table/interfaces.d.ts +0 -92
- package/dist/system/presentation/hooks/ui/use-table/query/get-query-arguments-table.d.ts +2 -0
- package/dist/system/presentation/hooks/ui/use-table/query/hook.d.ts +5 -0
- package/dist/system/presentation/hooks/ui/use-table/query/hook.js +52 -0
- package/dist/system/presentation/hooks/ui/use-table/query/index.d.ts +2 -0
- package/dist/system/presentation/hooks/ui/use-table/query/index.js +19 -0
- package/dist/ui/components/carousel/carousel-lib/components-shared/get-changed-params.js +0 -51
- package/dist/ui/components/carousel/carousel-lib/components-shared/get-element-params.js +0 -148
- package/dist/ui/components/carousel/carousel-lib/components-shared/get-params.js +0 -61
- package/dist/ui/components/carousel/carousel-lib/components-shared/mount-swiper.js +0 -24
- package/dist/ui/components/carousel/carousel-lib/components-shared/update-swiper.js +0 -208
- package/dist/ui/components/carousel/carousel-lib/core/breakpoints/getBreakpoint.js +35 -0
- package/dist/ui/components/carousel/carousel-lib/core/breakpoints/index.d.ts +7 -0
- package/dist/ui/components/carousel/carousel-lib/core/breakpoints/index.js +9 -0
- package/dist/ui/components/carousel/carousel-lib/core/breakpoints/setBreakpoint.js +94 -0
- package/dist/ui/components/carousel/carousel-lib/core/classes/index.d.ts +7 -0
- package/dist/ui/components/carousel/carousel-lib/core/classes/index.js +9 -0
- package/dist/ui/components/carousel/carousel-lib/core/core.js +0 -654
- package/dist/ui/components/carousel/carousel-lib/core/events/index.js +77 -0
- package/dist/ui/components/carousel/carousel-lib/core/events/onLoad.js +14 -0
- package/dist/ui/components/carousel/carousel-lib/core/events/onTouchEnd.js +194 -0
- package/dist/ui/components/carousel/carousel-lib/core/events/onTouchMove.js +314 -0
- package/dist/ui/components/carousel/carousel-lib/core/events/onTouchStart.js +154 -0
- package/dist/ui/components/carousel/carousel-lib/core/grab-cursor/index.d.ts +7 -0
- package/dist/ui/components/carousel/carousel-lib/core/grab-cursor/index.js +12 -0
- package/dist/ui/components/carousel/carousel-lib/core/loop/index.d.ts +9 -0
- package/dist/ui/components/carousel/carousel-lib/core/loop/index.js +14 -0
- package/dist/ui/components/carousel/carousel-lib/core/loop/loopCreate.js +57 -0
- package/dist/ui/components/carousel/carousel-lib/core/loop/loopFix.js +230 -0
- package/dist/ui/components/carousel/carousel-lib/core/moduleExtendParams.js +0 -42
- package/dist/ui/components/carousel/carousel-lib/core/slide/index.d.ts +17 -0
- package/dist/ui/components/carousel/carousel-lib/core/slide/index.js +22 -0
- package/dist/ui/components/carousel/carousel-lib/core/slide/slideTo.js +160 -0
- package/dist/ui/components/carousel/carousel-lib/core/slide/slideToClickedSlide.js +46 -0
- package/dist/ui/components/carousel/carousel-lib/core/transition/index.d.ts +9 -0
- package/dist/ui/components/carousel/carousel-lib/core/transition/index.js +14 -0
- package/dist/ui/components/carousel/carousel-lib/core/transition/transitionEnd.js +18 -0
- package/dist/ui/components/carousel/carousel-lib/core/transition/transitionStart.js +19 -0
- package/dist/ui/components/carousel/carousel-lib/core/translate/getTranslate.js +21 -0
- package/dist/ui/components/carousel/carousel-lib/core/translate/index.d.ts +13 -0
- package/dist/ui/components/carousel/carousel-lib/core/translate/index.js +18 -0
- package/dist/ui/components/carousel/carousel-lib/core/translate/translateTo.js +81 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/index.d.ts +21 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/index.js +26 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/updateActiveIndex.js +125 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/updateSize.js +45 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/updateSlides.js +306 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/updateSlidesClasses.js +69 -0
- package/dist/ui/components/carousel/carousel-lib/modules/autoplay.js +0 -336
- package/dist/ui/components/carousel/carousel-lib/modules/effect-fade.js +0 -63
- package/dist/ui/components/carousel/carousel-lib/modules/free-mode.js +0 -247
- package/dist/ui/components/carousel/carousel-lib/modules/index.d.ts +0 -6
- package/dist/ui/components/carousel/carousel-lib/modules/index.js +0 -23
- package/dist/ui/components/carousel/carousel-lib/modules/navigation.js +0 -223
- package/dist/ui/components/carousel/carousel-lib/modules/pagination.js +0 -514
- package/dist/ui/components/carousel/carousel-lib/modules/virtual.js +0 -379
- package/dist/ui/components/carousel/carousel-lib/react/swiper-slide.js +0 -88
- package/dist/ui/components/carousel/carousel-lib/react/swiper.js +0 -210
- package/dist/ui/components/carousel/carousel-lib/shared/create-element-if-not-defined.js +0 -22
- package/dist/ui/components/carousel/carousel-lib/shared/create-shadow.js +0 -15
- package/dist/ui/components/carousel/carousel-lib/shared/effect-target.js +0 -13
- package/dist/ui/components/carousel/carousel-lib/shared/effect-virtual-transition-end.js +0 -47
- package/dist/ui/components/carousel/carousel-lib/shared/get-browser.js +0 -43
- package/dist/ui/components/carousel/carousel-lib/shared/get-device.js +0 -69
- package/dist/ui/components/carousel/carousel-lib/shared/get-support.js +0 -25
- package/dist/ui/components/carousel/carousel-lib/shared/utils.js +0 -372
- package/dist/ui/components/carousel/carousel-lib/ssr-window/document.js +0 -65
- package/dist/ui/components/carousel/carousel-lib/ssr-window/ssr-window.d.ts +0 -4
- package/dist/ui/components/carousel/carousel-lib/ssr-window/ssr-window.js +0 -15
- package/dist/ui/components/carousel/carousel-lib/ssr-window/window.js +0 -71
- package/dist/ui/components/carousel/carousel-lib/types/index.d.ts +0 -5
- package/dist/ui/components/carousel/carousel-lib/types/index.js +0 -27
- package/dist/ui/components/carousel/carousel-lib/types/swiper-events.d.ts +0 -162
- package/dist/ui/components/form/handler/custom-submit/index.d.ts +0 -17
- package/dist/ui/components/form/handler/custom-submit/index.js +0 -25
- package/dist/ui/components/form/handler/dynamic_form_handler/component.d.ts +0 -2
- package/dist/ui/components/form/handler/dynamic_form_handler/component.js +0 -117
- package/dist/ui/components/form/handler/dynamic_form_handler/index.d.ts +0 -2
- package/dist/ui/components/form/handler/dynamic_form_handler/index.js +0 -19
- package/dist/ui/components/form/handler/dynamic_form_handler/interfaces.d.ts +0 -28
- package/dist/ui/components/form/handler/form-handler/generate-schemas.js +0 -111
- package/dist/ui/components/form/handler/form-handler/index.d.ts +0 -2
- package/dist/ui/components/form/handler/form-handler/index.js +0 -241
- package/dist/ui/components/form/handler/form-handler/use-schemas.d.ts +0 -2
- package/dist/ui/components/form/handler/form-handler/use-schemas.js +0 -115
- package/dist/ui/components/form/handler/form-handler/use-send-file.d.ts +0 -5
- package/dist/ui/components/form/handler/form-handler/use-send-file.js +0 -209
- package/dist/ui/components/form/handler/i18n/index.d.ts +0 -2
- package/dist/ui/components/form/handler/i18n/index.js +4 -4
- package/dist/ui/components/form/input-cep/use-cep/hook.d.ts +2 -2
- package/dist/ui/components/form/input-cep/use-cep/hook.js +1 -1
- package/dist/ui/components/form/input-cep/use-cep/index.d.ts +2 -2
- package/dist/ui/components/form/input-cep/use-cep/index.js +2 -2
- package/dist/ui/components/form/input-control/error/index.js +1 -1
- package/dist/ui/components/form/input-control/label/index.js +1 -1
- package/dist/ui/components/form/input-control/loader-input/index.js +2 -2
- package/dist/ui/components/form/input-currency/components/CurrencyInput.js +1 -1
- package/dist/ui/components/form/input-currency/components/index.d.ts +1 -1
- package/dist/ui/components/form/input-currency/components/index.js +1 -1
- package/dist/ui/components/form/input-date-picker/calendar/index.d.ts +1 -1
- package/dist/ui/components/form/input-date-picker/calendar/index.js +4 -4
- package/dist/ui/components/form/input-date-picker/calendar/interface.d.ts +2 -2
- package/dist/ui/components/form/input-date-picker/calendar/styles.d.ts +1 -1
- package/dist/ui/components/form/input-date-picker/mock/index.d.ts +1 -1
- package/dist/ui/components/form/input-date-picker/mock/index.js +1 -1
- package/dist/ui/components/form/input-file/hooks/index.d.ts +4 -4
- package/dist/ui/components/form/input-file/hooks/index.js +4 -4
- package/dist/ui/components/form/input-file/hooks/use-components-file.d.ts +2 -2
- package/dist/ui/components/form/input-file/hooks/use-components-file.js +2 -2
- package/dist/ui/components/form/input-file/hooks/use-file-elements.d.ts +1 -1
- package/dist/ui/components/form/input-file/hooks/use-file-elements.js +2 -2
- package/dist/ui/components/form/input-file/hooks/use-file.d.ts +2 -2
- package/dist/ui/components/form/input-file/hooks/use-file.js +2 -2
- package/dist/ui/components/form/input-file/hooks/use-rendered-file.d.ts +1 -1
- package/dist/ui/components/form/input-file/hooks/use-rendered-file.js +1 -1
- package/dist/ui/components/form/input-file/render-files/component.d.ts +1 -1
- package/dist/ui/components/form/input-file/render-files/component.js +2 -2
- package/dist/ui/components/form/input-file/render-files/index.d.ts +3 -3
- package/dist/ui/components/form/input-file/render-files/index.js +3 -3
- package/dist/ui/components/form/input-file/render-files/interfaces.d.ts +2 -2
- package/dist/ui/components/form/input-seo/input-meta-image/index.d.ts +1 -1
- package/dist/ui/components/form/input-seo/input-meta-image/index.js +2 -2
- package/dist/ui/components/menu-mobile/components/nav-links/index.d.ts +1 -1
- package/dist/ui/components/menu-mobile/components/nav-links/index.js +3 -3
- package/dist/ui/components/menu-mobile/components/nav-links/interfaces.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var utils_1 = require("../../shared/utils");
|
|
4
|
+
function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
5
|
+
var _a;
|
|
6
|
+
if (index === void 0) { index = 0; }
|
|
7
|
+
if (runCallbacks === void 0) { runCallbacks = true; }
|
|
8
|
+
if (typeof index === 'string') {
|
|
9
|
+
index = parseInt(index, 10);
|
|
10
|
+
}
|
|
11
|
+
var swiper = this;
|
|
12
|
+
var slideIndex = index;
|
|
13
|
+
if (slideIndex < 0)
|
|
14
|
+
slideIndex = 0;
|
|
15
|
+
var params = swiper.params, snapGrid = swiper.snapGrid, slidesGrid = swiper.slidesGrid, previousIndex = swiper.previousIndex, activeIndex = swiper.activeIndex, rtl = swiper.rtlTranslate, wrapperEl = swiper.wrapperEl, enabled = swiper.enabled;
|
|
16
|
+
if ((!enabled && !internal && !initial) ||
|
|
17
|
+
swiper.destroyed ||
|
|
18
|
+
(swiper.animating && params.preventInteractionOnTransition)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (typeof speed === 'undefined') {
|
|
22
|
+
speed = swiper.params.speed;
|
|
23
|
+
}
|
|
24
|
+
var skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
|
|
25
|
+
var snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
|
|
26
|
+
if (snapIndex >= snapGrid.length)
|
|
27
|
+
snapIndex = snapGrid.length - 1;
|
|
28
|
+
var translate = -snapGrid[snapIndex];
|
|
29
|
+
// Normalize slideIndex
|
|
30
|
+
if (params.normalizeSlideIndex) {
|
|
31
|
+
for (var i = 0; i < slidesGrid.length; i += 1) {
|
|
32
|
+
var normalizedTranslate = -Math.floor(translate * 100);
|
|
33
|
+
var normalizedGrid = Math.floor(slidesGrid[i] * 100);
|
|
34
|
+
var normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
|
|
35
|
+
if (typeof slidesGrid[i + 1] !== 'undefined') {
|
|
36
|
+
if (normalizedTranslate >= normalizedGrid &&
|
|
37
|
+
normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {
|
|
38
|
+
slideIndex = i;
|
|
39
|
+
}
|
|
40
|
+
else if (normalizedTranslate >= normalizedGrid &&
|
|
41
|
+
normalizedTranslate < normalizedGridNext) {
|
|
42
|
+
slideIndex = i + 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (normalizedTranslate >= normalizedGrid) {
|
|
46
|
+
slideIndex = i;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Directions locks
|
|
51
|
+
if (swiper.initialized && slideIndex !== activeIndex) {
|
|
52
|
+
if (!swiper.allowSlideNext &&
|
|
53
|
+
(rtl
|
|
54
|
+
? translate > swiper.translate && translate > swiper.minTranslate()
|
|
55
|
+
: translate < swiper.translate && translate < swiper.minTranslate())) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
if (!swiper.allowSlidePrev &&
|
|
59
|
+
translate > swiper.translate &&
|
|
60
|
+
translate > swiper.maxTranslate()) {
|
|
61
|
+
if ((activeIndex || 0) !== slideIndex) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (slideIndex !== (previousIndex || 0) && runCallbacks) {
|
|
67
|
+
swiper.emit('beforeSlideChangeStart');
|
|
68
|
+
}
|
|
69
|
+
// Update progress
|
|
70
|
+
swiper.updateProgress(translate);
|
|
71
|
+
var direction;
|
|
72
|
+
if (slideIndex > activeIndex)
|
|
73
|
+
direction = 'next';
|
|
74
|
+
else if (slideIndex < activeIndex)
|
|
75
|
+
direction = 'prev';
|
|
76
|
+
else
|
|
77
|
+
direction = 'reset';
|
|
78
|
+
// Update Index
|
|
79
|
+
if ((rtl && -translate === swiper.translate) || (!rtl && translate === swiper.translate)) {
|
|
80
|
+
swiper.updateActiveIndex(slideIndex);
|
|
81
|
+
// Update Height
|
|
82
|
+
if (params.autoHeight) {
|
|
83
|
+
swiper.updateAutoHeight();
|
|
84
|
+
}
|
|
85
|
+
swiper.updateSlidesClasses();
|
|
86
|
+
if (params.effect !== 'slide') {
|
|
87
|
+
swiper.setTranslate(translate);
|
|
88
|
+
}
|
|
89
|
+
if (direction !== 'reset') {
|
|
90
|
+
swiper.transitionStart(runCallbacks, direction);
|
|
91
|
+
swiper.transitionEnd(runCallbacks, direction);
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (params.cssMode) {
|
|
96
|
+
var isH_1 = swiper.isHorizontal();
|
|
97
|
+
var t_1 = rtl ? translate : -translate;
|
|
98
|
+
if (speed === 0) {
|
|
99
|
+
var isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
100
|
+
if (isVirtual) {
|
|
101
|
+
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
102
|
+
swiper._immediateVirtual = true;
|
|
103
|
+
}
|
|
104
|
+
if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) {
|
|
105
|
+
swiper._cssModeVirtualInitialSet = true;
|
|
106
|
+
requestAnimationFrame(function () {
|
|
107
|
+
wrapperEl[isH_1 ? 'scrollLeft' : 'scrollTop'] = t_1;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
wrapperEl[isH_1 ? 'scrollLeft' : 'scrollTop'] = t_1;
|
|
112
|
+
}
|
|
113
|
+
if (isVirtual) {
|
|
114
|
+
requestAnimationFrame(function () {
|
|
115
|
+
swiper.wrapperEl.style.scrollSnapType = '';
|
|
116
|
+
swiper._immediateVirtual = false;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
if (!swiper.support.smoothScroll) {
|
|
122
|
+
(0, utils_1.animateCSSModeScroll)({ swiper: swiper, targetPosition: t_1, side: isH_1 ? 'left' : 'top' });
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
wrapperEl.scrollTo((_a = {},
|
|
126
|
+
_a[isH_1 ? 'left' : 'top'] = t_1,
|
|
127
|
+
_a.behavior = 'smooth',
|
|
128
|
+
_a));
|
|
129
|
+
}
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
swiper.setTransition(speed);
|
|
133
|
+
swiper.setTranslate(translate);
|
|
134
|
+
swiper.updateActiveIndex(slideIndex);
|
|
135
|
+
swiper.updateSlidesClasses();
|
|
136
|
+
swiper.emit('beforeTransitionStart', speed, internal);
|
|
137
|
+
swiper.transitionStart(runCallbacks, direction);
|
|
138
|
+
if (speed === 0) {
|
|
139
|
+
swiper.transitionEnd(runCallbacks, direction);
|
|
140
|
+
}
|
|
141
|
+
else if (!swiper.animating) {
|
|
142
|
+
swiper.animating = true;
|
|
143
|
+
if (!swiper.onSlideToWrapperTransitionEnd) {
|
|
144
|
+
swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
|
|
145
|
+
if (!swiper || swiper.destroyed)
|
|
146
|
+
return;
|
|
147
|
+
if (e.target !== this)
|
|
148
|
+
return;
|
|
149
|
+
swiper.wrapperEl.removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
|
|
150
|
+
swiper.onSlideToWrapperTransitionEnd = null;
|
|
151
|
+
delete swiper.onSlideToWrapperTransitionEnd;
|
|
152
|
+
swiper.transitionEnd(runCallbacks, direction);
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
swiper.wrapperEl.addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
exports.default = slideTo;
|
|
160
|
+
//# sourceMappingURL=slideTo.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var utils_1 = require("../../shared/utils");
|
|
4
|
+
function slideToClickedSlide() {
|
|
5
|
+
var swiper = this;
|
|
6
|
+
if (swiper.destroyed)
|
|
7
|
+
return;
|
|
8
|
+
var params = swiper.params, slidesEl = swiper.slidesEl;
|
|
9
|
+
var slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
|
10
|
+
var slideToIndex = swiper.clickedIndex;
|
|
11
|
+
var realIndex;
|
|
12
|
+
var slideSelector = swiper.isElement ? "swiper-slide" : ".".concat(params.slideClass);
|
|
13
|
+
if (params.loop) {
|
|
14
|
+
if (swiper.animating)
|
|
15
|
+
return;
|
|
16
|
+
realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
|
|
17
|
+
if (params.centeredSlides) {
|
|
18
|
+
if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 ||
|
|
19
|
+
slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
|
|
20
|
+
swiper.loopFix();
|
|
21
|
+
slideToIndex = swiper.getSlideIndex((0, utils_1.elementChildren)(slidesEl, "".concat(slideSelector, "[data-swiper-slide-index=\"").concat(realIndex, "\"]"))[0]);
|
|
22
|
+
(0, utils_1.nextTick)(function () {
|
|
23
|
+
swiper.slideTo(slideToIndex);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
swiper.slideTo(slideToIndex);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
|
31
|
+
swiper.loopFix();
|
|
32
|
+
slideToIndex = swiper.getSlideIndex((0, utils_1.elementChildren)(slidesEl, "".concat(slideSelector, "[data-swiper-slide-index=\"").concat(realIndex, "\"]"))[0]);
|
|
33
|
+
(0, utils_1.nextTick)(function () {
|
|
34
|
+
swiper.slideTo(slideToIndex);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
swiper.slideTo(slideToIndex);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
swiper.slideTo(slideToIndex);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = slideToClickedSlide;
|
|
46
|
+
//# sourceMappingURL=slideToClickedSlide.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import setTransition from './setTransition';
|
|
2
|
+
import transitionStart from './transitionStart';
|
|
3
|
+
import transitionEnd from './transitionEnd';
|
|
4
|
+
declare const _default: {
|
|
5
|
+
setTransition: typeof setTransition;
|
|
6
|
+
transitionStart: typeof transitionStart;
|
|
7
|
+
transitionEnd: typeof transitionEnd;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var setTransition_1 = __importDefault(require("./setTransition"));
|
|
7
|
+
var transitionStart_1 = __importDefault(require("./transitionStart"));
|
|
8
|
+
var transitionEnd_1 = __importDefault(require("./transitionEnd"));
|
|
9
|
+
exports.default = {
|
|
10
|
+
setTransition: setTransition_1.default,
|
|
11
|
+
transitionStart: transitionStart_1.default,
|
|
12
|
+
transitionEnd: transitionEnd_1.default,
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var transitionEmit_1 = __importDefault(require("./transitionEmit"));
|
|
7
|
+
function transitionEnd(runCallbacks, direction) {
|
|
8
|
+
if (runCallbacks === void 0) { runCallbacks = true; }
|
|
9
|
+
var swiper = this;
|
|
10
|
+
var params = swiper.params;
|
|
11
|
+
swiper.animating = false;
|
|
12
|
+
if (params.cssMode)
|
|
13
|
+
return;
|
|
14
|
+
swiper.setTransition(0);
|
|
15
|
+
(0, transitionEmit_1.default)({ swiper: swiper, runCallbacks: runCallbacks, direction: direction, step: 'End' });
|
|
16
|
+
}
|
|
17
|
+
exports.default = transitionEnd;
|
|
18
|
+
//# sourceMappingURL=transitionEnd.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var transitionEmit_1 = __importDefault(require("./transitionEmit"));
|
|
7
|
+
function transitionStart(runCallbacks, direction) {
|
|
8
|
+
if (runCallbacks === void 0) { runCallbacks = true; }
|
|
9
|
+
var swiper = this;
|
|
10
|
+
var params = swiper.params;
|
|
11
|
+
if (params.cssMode)
|
|
12
|
+
return;
|
|
13
|
+
if (params.autoHeight) {
|
|
14
|
+
swiper.updateAutoHeight();
|
|
15
|
+
}
|
|
16
|
+
(0, transitionEmit_1.default)({ swiper: swiper, runCallbacks: runCallbacks, direction: direction, step: 'Start' });
|
|
17
|
+
}
|
|
18
|
+
exports.default = transitionStart;
|
|
19
|
+
//# sourceMappingURL=transitionStart.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var utils_1 = require("../../shared/utils");
|
|
4
|
+
function getSwiperTranslate(axis) {
|
|
5
|
+
if (axis === void 0) { axis = this.isHorizontal() ? 'x' : 'y'; }
|
|
6
|
+
var swiper = this;
|
|
7
|
+
var params = swiper.params, rtl = swiper.rtlTranslate, translate = swiper.translate, wrapperEl = swiper.wrapperEl;
|
|
8
|
+
if (params.virtualTranslate) {
|
|
9
|
+
return rtl ? -translate : translate;
|
|
10
|
+
}
|
|
11
|
+
if (params.cssMode) {
|
|
12
|
+
return translate;
|
|
13
|
+
}
|
|
14
|
+
var currentTranslate = (0, utils_1.getTranslate)(wrapperEl, axis);
|
|
15
|
+
currentTranslate += swiper.cssOverflowAdjustment();
|
|
16
|
+
if (rtl)
|
|
17
|
+
currentTranslate = -currentTranslate;
|
|
18
|
+
return currentTranslate || 0;
|
|
19
|
+
}
|
|
20
|
+
exports.default = getSwiperTranslate;
|
|
21
|
+
//# sourceMappingURL=getTranslate.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import getTranslate from './getTranslate';
|
|
2
|
+
import setTranslate from './setTranslate';
|
|
3
|
+
import minTranslate from './minTranslate';
|
|
4
|
+
import maxTranslate from './maxTranslate';
|
|
5
|
+
import translateTo from './translateTo';
|
|
6
|
+
declare const _default: {
|
|
7
|
+
getTranslate: typeof getTranslate;
|
|
8
|
+
setTranslate: typeof setTranslate;
|
|
9
|
+
minTranslate: typeof minTranslate;
|
|
10
|
+
maxTranslate: typeof maxTranslate;
|
|
11
|
+
translateTo: typeof translateTo;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var getTranslate_1 = __importDefault(require("./getTranslate"));
|
|
7
|
+
var setTranslate_1 = __importDefault(require("./setTranslate"));
|
|
8
|
+
var minTranslate_1 = __importDefault(require("./minTranslate"));
|
|
9
|
+
var maxTranslate_1 = __importDefault(require("./maxTranslate"));
|
|
10
|
+
var translateTo_1 = __importDefault(require("./translateTo"));
|
|
11
|
+
exports.default = {
|
|
12
|
+
getTranslate: getTranslate_1.default,
|
|
13
|
+
setTranslate: setTranslate_1.default,
|
|
14
|
+
minTranslate: minTranslate_1.default,
|
|
15
|
+
maxTranslate: maxTranslate_1.default,
|
|
16
|
+
translateTo: translateTo_1.default,
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var utils_1 = require("../../shared/utils");
|
|
4
|
+
function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
|
|
5
|
+
var _a;
|
|
6
|
+
if (translate === void 0) { translate = 0; }
|
|
7
|
+
if (speed === void 0) { speed = this.params.speed; }
|
|
8
|
+
if (runCallbacks === void 0) { runCallbacks = true; }
|
|
9
|
+
if (translateBounds === void 0) { translateBounds = true; }
|
|
10
|
+
var swiper = this;
|
|
11
|
+
var params = swiper.params, wrapperEl = swiper.wrapperEl;
|
|
12
|
+
if (swiper.animating && params.preventInteractionOnTransition) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
var minTranslate = swiper.minTranslate();
|
|
16
|
+
var maxTranslate = swiper.maxTranslate();
|
|
17
|
+
var newTranslate;
|
|
18
|
+
if (translateBounds && translate > minTranslate)
|
|
19
|
+
newTranslate = minTranslate;
|
|
20
|
+
else if (translateBounds && translate < maxTranslate)
|
|
21
|
+
newTranslate = maxTranslate;
|
|
22
|
+
else
|
|
23
|
+
newTranslate = translate;
|
|
24
|
+
// Update progress
|
|
25
|
+
swiper.updateProgress(newTranslate);
|
|
26
|
+
if (params.cssMode) {
|
|
27
|
+
var isH = swiper.isHorizontal();
|
|
28
|
+
if (speed === 0) {
|
|
29
|
+
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
if (!swiper.support.smoothScroll) {
|
|
33
|
+
(0, utils_1.animateCSSModeScroll)({ swiper: swiper, targetPosition: -newTranslate, side: isH ? 'left' : 'top' });
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
wrapperEl.scrollTo((_a = {},
|
|
37
|
+
_a[isH ? 'left' : 'top'] = -newTranslate,
|
|
38
|
+
_a.behavior = 'smooth',
|
|
39
|
+
_a));
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
if (speed === 0) {
|
|
44
|
+
swiper.setTransition(0);
|
|
45
|
+
swiper.setTranslate(newTranslate);
|
|
46
|
+
if (runCallbacks) {
|
|
47
|
+
swiper.emit('beforeTransitionStart', speed, internal);
|
|
48
|
+
swiper.emit('transitionEnd');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
swiper.setTransition(speed);
|
|
53
|
+
swiper.setTranslate(newTranslate);
|
|
54
|
+
if (runCallbacks) {
|
|
55
|
+
swiper.emit('beforeTransitionStart', speed, internal);
|
|
56
|
+
swiper.emit('transitionStart');
|
|
57
|
+
}
|
|
58
|
+
if (!swiper.animating) {
|
|
59
|
+
swiper.animating = true;
|
|
60
|
+
if (!swiper.onTranslateToWrapperTransitionEnd) {
|
|
61
|
+
swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
|
|
62
|
+
if (!swiper || swiper.destroyed)
|
|
63
|
+
return;
|
|
64
|
+
if (e.target !== this)
|
|
65
|
+
return;
|
|
66
|
+
swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
|
|
67
|
+
swiper.onTranslateToWrapperTransitionEnd = null;
|
|
68
|
+
delete swiper.onTranslateToWrapperTransitionEnd;
|
|
69
|
+
swiper.animating = false;
|
|
70
|
+
if (runCallbacks) {
|
|
71
|
+
swiper.emit('transitionEnd');
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
exports.default = translateTo;
|
|
81
|
+
//# sourceMappingURL=translateTo.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import updateSize from './updateSize';
|
|
2
|
+
import updateSlides from './updateSlides';
|
|
3
|
+
import updateAutoHeight from './updateAutoHeight';
|
|
4
|
+
import updateSlidesOffset from './updateSlidesOffset';
|
|
5
|
+
import updateSlidesProgress from './updateSlidesProgress';
|
|
6
|
+
import updateProgress from './updateProgress';
|
|
7
|
+
import updateSlidesClasses from './updateSlidesClasses';
|
|
8
|
+
import updateActiveIndex from './updateActiveIndex';
|
|
9
|
+
import updateClickedSlide from './updateClickedSlide';
|
|
10
|
+
declare const _default: {
|
|
11
|
+
updateSize: typeof updateSize;
|
|
12
|
+
updateSlides: typeof updateSlides;
|
|
13
|
+
updateAutoHeight: typeof updateAutoHeight;
|
|
14
|
+
updateSlidesOffset: typeof updateSlidesOffset;
|
|
15
|
+
updateSlidesProgress: typeof updateSlidesProgress;
|
|
16
|
+
updateProgress: typeof updateProgress;
|
|
17
|
+
updateSlidesClasses: typeof updateSlidesClasses;
|
|
18
|
+
updateActiveIndex: typeof updateActiveIndex;
|
|
19
|
+
updateClickedSlide: typeof updateClickedSlide;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var updateSize_1 = __importDefault(require("./updateSize"));
|
|
7
|
+
var updateSlides_1 = __importDefault(require("./updateSlides"));
|
|
8
|
+
var updateAutoHeight_1 = __importDefault(require("./updateAutoHeight"));
|
|
9
|
+
var updateSlidesOffset_1 = __importDefault(require("./updateSlidesOffset"));
|
|
10
|
+
var updateSlidesProgress_1 = __importDefault(require("./updateSlidesProgress"));
|
|
11
|
+
var updateProgress_1 = __importDefault(require("./updateProgress"));
|
|
12
|
+
var updateSlidesClasses_1 = __importDefault(require("./updateSlidesClasses"));
|
|
13
|
+
var updateActiveIndex_1 = __importDefault(require("./updateActiveIndex"));
|
|
14
|
+
var updateClickedSlide_1 = __importDefault(require("./updateClickedSlide"));
|
|
15
|
+
exports.default = {
|
|
16
|
+
updateSize: updateSize_1.default,
|
|
17
|
+
updateSlides: updateSlides_1.default,
|
|
18
|
+
updateAutoHeight: updateAutoHeight_1.default,
|
|
19
|
+
updateSlidesOffset: updateSlidesOffset_1.default,
|
|
20
|
+
updateSlidesProgress: updateSlidesProgress_1.default,
|
|
21
|
+
updateProgress: updateProgress_1.default,
|
|
22
|
+
updateSlidesClasses: updateSlidesClasses_1.default,
|
|
23
|
+
updateActiveIndex: updateActiveIndex_1.default,
|
|
24
|
+
updateClickedSlide: updateClickedSlide_1.default,
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getActiveIndexByTranslate = void 0;
|
|
4
|
+
var process_lazy_preloader_1 = require("../../shared/process-lazy-preloader");
|
|
5
|
+
function getActiveIndexByTranslate(swiper) {
|
|
6
|
+
var slidesGrid = swiper.slidesGrid, params = swiper.params;
|
|
7
|
+
var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
|
|
8
|
+
var activeIndex;
|
|
9
|
+
for (var i = 0; i < slidesGrid.length; i += 1) {
|
|
10
|
+
if (typeof slidesGrid[i + 1] !== 'undefined') {
|
|
11
|
+
if (translate >= slidesGrid[i] &&
|
|
12
|
+
translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
|
|
13
|
+
activeIndex = i;
|
|
14
|
+
}
|
|
15
|
+
else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
|
|
16
|
+
activeIndex = i + 1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else if (translate >= slidesGrid[i]) {
|
|
20
|
+
activeIndex = i;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Normalize slideIndex
|
|
24
|
+
if (params.normalizeSlideIndex) {
|
|
25
|
+
if (activeIndex < 0 || typeof activeIndex === 'undefined')
|
|
26
|
+
activeIndex = 0;
|
|
27
|
+
}
|
|
28
|
+
return activeIndex;
|
|
29
|
+
}
|
|
30
|
+
exports.getActiveIndexByTranslate = getActiveIndexByTranslate;
|
|
31
|
+
function updateActiveIndex(newActiveIndex) {
|
|
32
|
+
var swiper = this;
|
|
33
|
+
var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
|
|
34
|
+
var snapGrid = swiper.snapGrid, params = swiper.params, previousIndex = swiper.activeIndex, previousRealIndex = swiper.realIndex, previousSnapIndex = swiper.snapIndex;
|
|
35
|
+
var activeIndex = newActiveIndex;
|
|
36
|
+
var snapIndex;
|
|
37
|
+
var getVirtualRealIndex = function (aIndex) {
|
|
38
|
+
var realIndex = aIndex - swiper.virtual.slidesBefore;
|
|
39
|
+
if (realIndex < 0) {
|
|
40
|
+
realIndex = swiper.virtual.slides.length + realIndex;
|
|
41
|
+
}
|
|
42
|
+
if (realIndex >= swiper.virtual.slides.length) {
|
|
43
|
+
realIndex -= swiper.virtual.slides.length;
|
|
44
|
+
}
|
|
45
|
+
return realIndex;
|
|
46
|
+
};
|
|
47
|
+
if (typeof activeIndex === 'undefined') {
|
|
48
|
+
activeIndex = getActiveIndexByTranslate(swiper);
|
|
49
|
+
}
|
|
50
|
+
if (snapGrid.indexOf(translate) >= 0) {
|
|
51
|
+
snapIndex = snapGrid.indexOf(translate);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
var skip = Math.min(params.slidesPerGroupSkip, activeIndex);
|
|
55
|
+
snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
|
|
56
|
+
}
|
|
57
|
+
if (snapIndex >= snapGrid.length)
|
|
58
|
+
snapIndex = snapGrid.length - 1;
|
|
59
|
+
if (activeIndex === previousIndex && !swiper.params.loop) {
|
|
60
|
+
if (snapIndex !== previousSnapIndex) {
|
|
61
|
+
swiper.snapIndex = snapIndex;
|
|
62
|
+
swiper.emit('snapIndexChange');
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (activeIndex === previousIndex &&
|
|
67
|
+
swiper.params.loop &&
|
|
68
|
+
swiper.virtual &&
|
|
69
|
+
swiper.params.virtual.enabled) {
|
|
70
|
+
swiper.realIndex = getVirtualRealIndex(activeIndex);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
var gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
74
|
+
var normalizeSlideIndexToColumn = function (index) {
|
|
75
|
+
if (!gridEnabled)
|
|
76
|
+
return index;
|
|
77
|
+
return Math.floor(index / params.grid.rows);
|
|
78
|
+
};
|
|
79
|
+
// Get real index
|
|
80
|
+
var realIndex;
|
|
81
|
+
if (swiper.virtual && params.virtual.enabled && params.loop) {
|
|
82
|
+
realIndex = getVirtualRealIndex(activeIndex);
|
|
83
|
+
}
|
|
84
|
+
else if (gridEnabled) {
|
|
85
|
+
var firstSlideInColumn = swiper.slides.filter(function (slideEl) { return slideEl.column === activeIndex; })[0];
|
|
86
|
+
var activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
|
|
87
|
+
if (Number.isNaN(activeSlideIndex)) {
|
|
88
|
+
activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
|
|
89
|
+
}
|
|
90
|
+
realIndex = Math.floor(activeSlideIndex / params.grid.rows);
|
|
91
|
+
}
|
|
92
|
+
else if (swiper.slides[activeIndex]) {
|
|
93
|
+
var slideIndex = swiper.slides[activeIndex].getAttribute('data-swiper-slide-index');
|
|
94
|
+
if (slideIndex) {
|
|
95
|
+
realIndex = parseInt(slideIndex, 10);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
realIndex = activeIndex;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
realIndex = activeIndex;
|
|
103
|
+
}
|
|
104
|
+
Object.assign(swiper, {
|
|
105
|
+
previousSnapIndex: previousSnapIndex,
|
|
106
|
+
snapIndex: snapIndex,
|
|
107
|
+
previousRealIndex: previousRealIndex,
|
|
108
|
+
realIndex: realIndex,
|
|
109
|
+
previousIndex: previousIndex,
|
|
110
|
+
activeIndex: activeIndex,
|
|
111
|
+
});
|
|
112
|
+
if (swiper.initialized) {
|
|
113
|
+
(0, process_lazy_preloader_1.preload)(swiper);
|
|
114
|
+
}
|
|
115
|
+
swiper.emit('activeIndexChange');
|
|
116
|
+
swiper.emit('snapIndexChange');
|
|
117
|
+
if (swiper.initialized || swiper.params.runCallbacksOnInit) {
|
|
118
|
+
if (previousRealIndex !== realIndex) {
|
|
119
|
+
swiper.emit('realIndexChange');
|
|
120
|
+
}
|
|
121
|
+
swiper.emit('slideChange');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.default = updateActiveIndex;
|
|
125
|
+
//# sourceMappingURL=updateActiveIndex.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//@ts-nocheck
|
|
4
|
+
var utils_1 = require("../../shared/utils");
|
|
5
|
+
function updateSize() {
|
|
6
|
+
var swiper = this;
|
|
7
|
+
var width;
|
|
8
|
+
var height;
|
|
9
|
+
var el = swiper.el;
|
|
10
|
+
if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {
|
|
11
|
+
width = swiper.params.width;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
width = el.clientWidth;
|
|
15
|
+
}
|
|
16
|
+
if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {
|
|
17
|
+
height = swiper.params.height;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
height = el.clientHeight;
|
|
21
|
+
}
|
|
22
|
+
if ((width === 0 && swiper.isHorizontal()) || (height === 0 && swiper.isVertical())) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
// Subtract paddings
|
|
26
|
+
width =
|
|
27
|
+
width -
|
|
28
|
+
parseInt((0, utils_1.elementStyle)(el, 'padding-left') || 0, 10) -
|
|
29
|
+
parseInt((0, utils_1.elementStyle)(el, 'padding-right') || 0, 10);
|
|
30
|
+
height =
|
|
31
|
+
height -
|
|
32
|
+
parseInt((0, utils_1.elementStyle)(el, 'padding-top') || 0, 10) -
|
|
33
|
+
parseInt((0, utils_1.elementStyle)(el, 'padding-bottom') || 0, 10);
|
|
34
|
+
if (Number.isNaN(width))
|
|
35
|
+
width = 0;
|
|
36
|
+
if (Number.isNaN(height))
|
|
37
|
+
height = 0;
|
|
38
|
+
Object.assign(swiper, {
|
|
39
|
+
width: width,
|
|
40
|
+
height: height,
|
|
41
|
+
size: swiper.isHorizontal() ? width : height,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.default = updateSize;
|
|
45
|
+
//# sourceMappingURL=updateSize.js.map
|