infinity-forge 2.4.0 → 2.4.1
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/share/index.js +2 -2
- package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.d.ts +1 -1
- package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.js +2 -2
- package/dist/system/presentation/components/data/menu/components/menu-item/index.js +3 -3
- package/dist/system/presentation/components/data/menu/modes/collapsed-menu/index.js +5 -5
- package/dist/system/presentation/components/data/menu/modes/collapsed-menu/styles.js +1 -1
- package/dist/system/presentation/components/data/menu/modes/opened/index.js +3 -3
- package/dist/system/presentation/components/data/menu/modes/opened/styles.js +1 -1
- 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/components/menu-right/index.d.ts +1 -1
- package/dist/system/presentation/components/layout/header/components/menu-right/index.js +4 -4
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/index.js +0 -36
- package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js +0 -38
- package/dist/system/presentation/components/layout/header/components/menu-right/settings/index.js +0 -42
- package/dist/system/presentation/components/layout/header/components/search-modal/index.js +4 -4
- 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/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/icon/index.js +1 -1
- 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/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/login/form-login/index.js +2 -2
- 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/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/components/table/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/index.js +10 -10
- package/dist/system/presentation/hooks/ui/use-table/components/table/interfaces.d.ts +2 -2
- 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/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/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/modules/observer/observer.js +2 -2
- package/dist/ui/components/carousel/carousel-lib/core/modules/resize/resize.js +1 -1
- 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/form/handler/i18n/capture-i18n-errors/index.d.ts +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.d.ts +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.js +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.d.ts +3 -3
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.js +3 -3
- package/dist/ui/components/form/input-cep/use-cep/providers/index.d.ts +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/index.js +1 -1
- package/dist/ui/components/form/input-currency/components/utils/cleanValue.d.ts +1 -1
- package/dist/ui/components/form/input-currency/components/utils/cleanValue.js +4 -4
- package/dist/ui/components/form/input-currency/components/utils/formatValue.d.ts +1 -1
- package/dist/ui/components/form/input-currency/components/utils/formatValue.js +2 -2
- package/dist/ui/components/form/input-currency/components/utils/getLocaleConfig.d.ts +1 -1
- package/dist/ui/components/form/input-currency/components/utils/getSuffix.js +1 -1
- package/dist/ui/components/form/input-currency/components/utils/index.d.ts +8 -8
- package/dist/ui/components/form/input-currency/components/utils/index.js +8 -8
- package/dist/ui/components/form/input-currency/components/utils/parseAbbrValue.js +1 -1
- package/dist/ui/components/form/input-currency/components/utils/removeInvalidChars.js +1 -1
- package/dist/ui/components/form/input-currency/components/utils/removeSeparators.js +1 -1
- package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.d.ts +1 -1
- package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.js +3 -3
- package/dist/ui/components/form/input-date-picker/calendar/days/index.d.ts +1 -1
- package/dist/ui/components/form/input-date-picker/calendar/days/index.js +2 -2
- package/dist/ui/components/form/input-date-picker/calendar/months/index.d.ts +1 -1
- package/dist/ui/components/form/input-date-picker/calendar/months/index.js +2 -2
- package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.d.ts +1 -1
- package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.js +1 -1
- package/dist/ui/components/form/input-file/render-files/file-item/index.d.ts +2 -2
- package/dist/ui/components/form/input-file/render-files/file-item/index.js +3 -3
- package/dist/ui/components/form/input-mask/lib/core/errors/SyntheticChangeError.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.js +2 -2
- package/dist/ui/components/form/input-mask/lib/core/index.d.ts +5 -5
- package/dist/ui/components/form/input-mask/lib/core/index.js +4 -4
- package/dist/ui/components/form/input-mask/lib/core/utils/setInputAttributes.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/InputMask.d.ts +2 -2
- package/dist/ui/components/form/input-mask/lib/mask/InputMask.js +2 -2
- package/dist/ui/components/form/input-mask/lib/mask/index.d.ts +5 -5
- package/dist/ui/components/form/input-mask/lib/mask/index.js +3 -3
- package/dist/ui/components/form/input-mask/lib/mask/types.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/useMask.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/useMask.js +7 -7
- package/dist/ui/components/form/input-mask/lib/mask/utils/filter.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/format.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/formatToParts.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/formatToReplacementObject.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.js +3 -3
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveSelection.d.ts +0 -18
- package/dist/ui/components/form/input-mask/lib/mask/utils/unformat.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/validate.d.ts +0 -13
- package/dist/ui/components/form/input-mask/lib/mask/utils.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils.js +5 -5
- package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.d.ts +2 -2
- package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.js +2 -2
- package/dist/ui/components/form/input-mask/lib/number-format/index.d.ts +4 -4
- package/dist/ui/components/form/input-mask/lib/number-format/index.js +2 -2
- package/dist/ui/components/form/input-mask/lib/number-format/types.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.js +6 -6
- package/dist/ui/components/form/input-mask/lib/number-format/utils/localizeValues.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.d.ts +2 -2
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.js +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveOptions.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveSelection.d.ts +0 -24
- package/package.json +1 -1
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
//@ts-nocheck
|
|
13
|
+
var utils_1 = require("../../shared/utils.js");
|
|
14
|
+
var document_1 = require("../../ssr-window/document.js");
|
|
15
|
+
function onTouchMove(event) {
|
|
16
|
+
var document = (0, document_1.getDocument)();
|
|
17
|
+
var swiper = this;
|
|
18
|
+
var data = swiper.touchEventsData;
|
|
19
|
+
var params = swiper.params, touches = swiper.touches, rtl = swiper.rtlTranslate, enabled = swiper.enabled;
|
|
20
|
+
if (!enabled)
|
|
21
|
+
return;
|
|
22
|
+
if (!params.simulateTouch && event.pointerType === 'mouse')
|
|
23
|
+
return;
|
|
24
|
+
var e = event;
|
|
25
|
+
if (e.originalEvent)
|
|
26
|
+
e = e.originalEvent;
|
|
27
|
+
if (e.type === 'pointermove') {
|
|
28
|
+
if (data.touchId !== null)
|
|
29
|
+
return; // return from pointer if we use touch
|
|
30
|
+
var id = e.pointerId;
|
|
31
|
+
if (id !== data.pointerId)
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
var targetTouch;
|
|
35
|
+
if (e.type === 'touchmove') {
|
|
36
|
+
targetTouch = __spreadArray([], e.changedTouches, true).filter(function (t) { return t.identifier === data.touchId; })[0];
|
|
37
|
+
if (!targetTouch || targetTouch.identifier !== data.touchId)
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
targetTouch = e;
|
|
42
|
+
}
|
|
43
|
+
if (!data.isTouched) {
|
|
44
|
+
if (data.startMoving && data.isScrolling) {
|
|
45
|
+
swiper.emit('touchMoveOpposite', e);
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
var pageX = targetTouch.pageX;
|
|
50
|
+
var pageY = targetTouch.pageY;
|
|
51
|
+
if (e.preventedByNestedSwiper) {
|
|
52
|
+
touches.startX = pageX;
|
|
53
|
+
touches.startY = pageY;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (!swiper.allowTouchMove) {
|
|
57
|
+
if (!e.target.matches(data.focusableElements)) {
|
|
58
|
+
swiper.allowClick = false;
|
|
59
|
+
}
|
|
60
|
+
if (data.isTouched) {
|
|
61
|
+
Object.assign(touches, {
|
|
62
|
+
startX: pageX,
|
|
63
|
+
startY: pageY,
|
|
64
|
+
currentX: pageX,
|
|
65
|
+
currentY: pageY,
|
|
66
|
+
});
|
|
67
|
+
data.touchStartTime = (0, utils_1.now)();
|
|
68
|
+
}
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (params.touchReleaseOnEdges && !params.loop) {
|
|
72
|
+
if (swiper.isVertical()) {
|
|
73
|
+
// Vertical
|
|
74
|
+
if ((pageY < touches.startY && swiper.translate <= swiper.maxTranslate()) ||
|
|
75
|
+
(pageY > touches.startY && swiper.translate >= swiper.minTranslate())) {
|
|
76
|
+
data.isTouched = false;
|
|
77
|
+
data.isMoved = false;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else if ((pageX < touches.startX && swiper.translate <= swiper.maxTranslate()) ||
|
|
82
|
+
(pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (document.activeElement) {
|
|
87
|
+
if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
|
|
88
|
+
data.isMoved = true;
|
|
89
|
+
swiper.allowClick = false;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (data.allowTouchCallbacks) {
|
|
94
|
+
swiper.emit('touchMove', e);
|
|
95
|
+
}
|
|
96
|
+
touches.previousX = touches.currentX;
|
|
97
|
+
touches.previousY = touches.currentY;
|
|
98
|
+
touches.currentX = pageX;
|
|
99
|
+
touches.currentY = pageY;
|
|
100
|
+
var diffX = touches.currentX - touches.startX;
|
|
101
|
+
var diffY = touches.currentY - touches.startY;
|
|
102
|
+
if (swiper.params.threshold && Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2)) < swiper.params.threshold)
|
|
103
|
+
return;
|
|
104
|
+
if (typeof data.isScrolling === 'undefined') {
|
|
105
|
+
var touchAngle = void 0;
|
|
106
|
+
if ((swiper.isHorizontal() && touches.currentY === touches.startY) ||
|
|
107
|
+
(swiper.isVertical() && touches.currentX === touches.startX)) {
|
|
108
|
+
data.isScrolling = false;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// eslint-disable-next-line
|
|
112
|
+
if (diffX * diffX + diffY * diffY >= 25) {
|
|
113
|
+
touchAngle = (Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180) / Math.PI;
|
|
114
|
+
data.isScrolling = swiper.isHorizontal()
|
|
115
|
+
? touchAngle > params.touchAngle
|
|
116
|
+
: 90 - touchAngle > params.touchAngle;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (data.isScrolling) {
|
|
121
|
+
swiper.emit('touchMoveOpposite', e);
|
|
122
|
+
}
|
|
123
|
+
if (typeof data.startMoving === 'undefined') {
|
|
124
|
+
if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
|
|
125
|
+
data.startMoving = true;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (data.isScrolling || (e.type === 'touchmove' && data.preventTouchMoveFromPointerMove)) {
|
|
129
|
+
data.isTouched = false;
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (!data.startMoving) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
swiper.allowClick = false;
|
|
136
|
+
if (!params.cssMode && e.cancelable) {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
}
|
|
139
|
+
if (params.touchMoveStopPropagation && !params.nested) {
|
|
140
|
+
e.stopPropagation();
|
|
141
|
+
}
|
|
142
|
+
var diff = swiper.isHorizontal() ? diffX : diffY;
|
|
143
|
+
var touchesDiff = swiper.isHorizontal()
|
|
144
|
+
? touches.currentX - touches.previousX
|
|
145
|
+
: touches.currentY - touches.previousY;
|
|
146
|
+
if (params.oneWayMovement) {
|
|
147
|
+
diff = Math.abs(diff) * (rtl ? 1 : -1);
|
|
148
|
+
touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1);
|
|
149
|
+
}
|
|
150
|
+
touches.diff = diff;
|
|
151
|
+
diff *= params.touchRatio;
|
|
152
|
+
if (rtl) {
|
|
153
|
+
diff = -diff;
|
|
154
|
+
touchesDiff = -touchesDiff;
|
|
155
|
+
}
|
|
156
|
+
var prevTouchesDirection = swiper.touchesDirection;
|
|
157
|
+
swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
|
|
158
|
+
swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next';
|
|
159
|
+
var isLoop = swiper.params.loop && !params.cssMode;
|
|
160
|
+
var allowLoopFix = (swiper.touchesDirection === 'next' && swiper.allowSlideNext) ||
|
|
161
|
+
(swiper.touchesDirection === 'prev' && swiper.allowSlidePrev);
|
|
162
|
+
if (!data.isMoved) {
|
|
163
|
+
if (isLoop && allowLoopFix) {
|
|
164
|
+
swiper.loopFix({ direction: swiper.swipeDirection });
|
|
165
|
+
}
|
|
166
|
+
data.startTranslate = swiper.getTranslate();
|
|
167
|
+
swiper.setTransition(0);
|
|
168
|
+
if (swiper.animating) {
|
|
169
|
+
var evt = new window.CustomEvent('transitionend', {
|
|
170
|
+
bubbles: true,
|
|
171
|
+
cancelable: true,
|
|
172
|
+
detail: {
|
|
173
|
+
bySwiperTouchMove: true,
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
swiper.wrapperEl.dispatchEvent(evt);
|
|
177
|
+
}
|
|
178
|
+
data.allowMomentumBounce = false;
|
|
179
|
+
// Grab Cursor
|
|
180
|
+
if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
|
181
|
+
swiper.setGrabCursor(true);
|
|
182
|
+
}
|
|
183
|
+
swiper.emit('sliderFirstMove', e);
|
|
184
|
+
}
|
|
185
|
+
var loopFixed;
|
|
186
|
+
var time = new Date().getTime();
|
|
187
|
+
if (data.isMoved &&
|
|
188
|
+
data.allowThresholdMove &&
|
|
189
|
+
prevTouchesDirection !== swiper.touchesDirection &&
|
|
190
|
+
isLoop &&
|
|
191
|
+
allowLoopFix &&
|
|
192
|
+
Math.abs(diff) >= 1) {
|
|
193
|
+
Object.assign(touches, {
|
|
194
|
+
startX: pageX,
|
|
195
|
+
startY: pageY,
|
|
196
|
+
currentX: pageX,
|
|
197
|
+
currentY: pageY,
|
|
198
|
+
startTranslate: data.currentTranslate,
|
|
199
|
+
});
|
|
200
|
+
data.loopSwapReset = true;
|
|
201
|
+
data.startTranslate = data.currentTranslate;
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
swiper.emit('sliderMove', e);
|
|
205
|
+
data.isMoved = true;
|
|
206
|
+
data.currentTranslate = diff + data.startTranslate;
|
|
207
|
+
var disableParentSwiper = true;
|
|
208
|
+
var resistanceRatio = params.resistanceRatio;
|
|
209
|
+
if (params.touchReleaseOnEdges) {
|
|
210
|
+
resistanceRatio = 0;
|
|
211
|
+
}
|
|
212
|
+
if (diff > 0) {
|
|
213
|
+
if (isLoop &&
|
|
214
|
+
allowLoopFix &&
|
|
215
|
+
!loopFixed &&
|
|
216
|
+
data.allowThresholdMove &&
|
|
217
|
+
data.currentTranslate >
|
|
218
|
+
(params.centeredSlides
|
|
219
|
+
? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1]
|
|
220
|
+
: swiper.minTranslate())) {
|
|
221
|
+
swiper.loopFix({ direction: 'prev', setTranslate: true, activeSlideIndex: 0 });
|
|
222
|
+
}
|
|
223
|
+
if (data.currentTranslate > swiper.minTranslate()) {
|
|
224
|
+
disableParentSwiper = false;
|
|
225
|
+
if (params.resistance) {
|
|
226
|
+
data.currentTranslate =
|
|
227
|
+
swiper.minTranslate() -
|
|
228
|
+
1 +
|
|
229
|
+
Math.pow((-swiper.minTranslate() + data.startTranslate + diff), resistanceRatio);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
else if (diff < 0) {
|
|
234
|
+
if (isLoop &&
|
|
235
|
+
allowLoopFix &&
|
|
236
|
+
!loopFixed &&
|
|
237
|
+
data.allowThresholdMove &&
|
|
238
|
+
data.currentTranslate <
|
|
239
|
+
(params.centeredSlides
|
|
240
|
+
? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1]
|
|
241
|
+
: swiper.maxTranslate())) {
|
|
242
|
+
swiper.loopFix({
|
|
243
|
+
direction: 'next',
|
|
244
|
+
setTranslate: true,
|
|
245
|
+
activeSlideIndex: swiper.slides.length -
|
|
246
|
+
(params.slidesPerView === 'auto'
|
|
247
|
+
? swiper.slidesPerViewDynamic()
|
|
248
|
+
: Math.ceil(parseFloat(params.slidesPerView, 10))),
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
if (data.currentTranslate < swiper.maxTranslate()) {
|
|
252
|
+
disableParentSwiper = false;
|
|
253
|
+
if (params.resistance) {
|
|
254
|
+
data.currentTranslate =
|
|
255
|
+
swiper.maxTranslate() +
|
|
256
|
+
1 -
|
|
257
|
+
Math.pow((swiper.maxTranslate() - data.startTranslate - diff), resistanceRatio);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (disableParentSwiper) {
|
|
262
|
+
e.preventedByNestedSwiper = true;
|
|
263
|
+
}
|
|
264
|
+
// Directions locks
|
|
265
|
+
if (!swiper.allowSlideNext &&
|
|
266
|
+
swiper.swipeDirection === 'next' &&
|
|
267
|
+
data.currentTranslate < data.startTranslate) {
|
|
268
|
+
data.currentTranslate = data.startTranslate;
|
|
269
|
+
}
|
|
270
|
+
if (!swiper.allowSlidePrev &&
|
|
271
|
+
swiper.swipeDirection === 'prev' &&
|
|
272
|
+
data.currentTranslate > data.startTranslate) {
|
|
273
|
+
data.currentTranslate = data.startTranslate;
|
|
274
|
+
}
|
|
275
|
+
if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
|
|
276
|
+
data.currentTranslate = data.startTranslate;
|
|
277
|
+
}
|
|
278
|
+
// Threshold
|
|
279
|
+
if (params.threshold > 0) {
|
|
280
|
+
if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
|
|
281
|
+
if (!data.allowThresholdMove) {
|
|
282
|
+
data.allowThresholdMove = true;
|
|
283
|
+
touches.startX = touches.currentX;
|
|
284
|
+
touches.startY = touches.currentY;
|
|
285
|
+
data.currentTranslate = data.startTranslate;
|
|
286
|
+
touches.diff = swiper.isHorizontal()
|
|
287
|
+
? touches.currentX - touches.startX
|
|
288
|
+
: touches.currentY - touches.startY;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
data.currentTranslate = data.startTranslate;
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (!params.followFinger || params.cssMode)
|
|
298
|
+
return;
|
|
299
|
+
// Update active index in free mode
|
|
300
|
+
if ((params.freeMode && params.freeMode.enabled && swiper.freeMode) ||
|
|
301
|
+
params.watchSlidesProgress) {
|
|
302
|
+
swiper.updateActiveIndex();
|
|
303
|
+
swiper.updateSlidesClasses();
|
|
304
|
+
}
|
|
305
|
+
if (params.freeMode && params.freeMode.enabled && swiper.freeMode) {
|
|
306
|
+
swiper.freeMode.onTouchMove();
|
|
307
|
+
}
|
|
308
|
+
// Update progress
|
|
309
|
+
swiper.updateProgress(data.currentTranslate);
|
|
310
|
+
// Update translate
|
|
311
|
+
swiper.setTranslate(data.currentTranslate);
|
|
312
|
+
}
|
|
313
|
+
exports.default = onTouchMove;
|
|
314
|
+
//# sourceMappingURL=onTouchMove.js.map
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//@ts-nocheck
|
|
4
|
+
var utils_1 = require("../../shared/utils.js");
|
|
5
|
+
var document_1 = require("../../ssr-window/document.js");
|
|
6
|
+
var window_1 = require("../../ssr-window/window.js");
|
|
7
|
+
// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
|
|
8
|
+
function closestElement(selector, base) {
|
|
9
|
+
if (base === void 0) { base = this; }
|
|
10
|
+
function __closestFrom(el) {
|
|
11
|
+
if (!el || el === (0, document_1.getDocument)() || el === (0, window_1.getWindow)())
|
|
12
|
+
return null;
|
|
13
|
+
if (el.assignedSlot)
|
|
14
|
+
el = el.assignedSlot;
|
|
15
|
+
var found = el.closest(selector);
|
|
16
|
+
if (!found && !el.getRootNode) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return found || __closestFrom(el.getRootNode().host);
|
|
20
|
+
}
|
|
21
|
+
return __closestFrom(base);
|
|
22
|
+
}
|
|
23
|
+
function preventEdgeSwipe(swiper, event, startX) {
|
|
24
|
+
var window = (0, window_1.getWindow)();
|
|
25
|
+
var params = swiper.params;
|
|
26
|
+
var edgeSwipeDetection = params.edgeSwipeDetection;
|
|
27
|
+
var edgeSwipeThreshold = params.edgeSwipeThreshold;
|
|
28
|
+
if (edgeSwipeDetection &&
|
|
29
|
+
(startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
|
|
30
|
+
if (edgeSwipeDetection === 'prevent') {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
function onTouchStart(event) {
|
|
39
|
+
var swiper = this;
|
|
40
|
+
var document = (0, document_1.getDocument)();
|
|
41
|
+
var e = event;
|
|
42
|
+
if (e.originalEvent)
|
|
43
|
+
e = e.originalEvent;
|
|
44
|
+
var data = swiper.touchEventsData;
|
|
45
|
+
if (e.type === 'pointerdown') {
|
|
46
|
+
if (data.pointerId !== null && data.pointerId !== e.pointerId) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
data.pointerId = e.pointerId;
|
|
50
|
+
}
|
|
51
|
+
else if (e.type === 'touchstart' && e.targetTouches.length === 1) {
|
|
52
|
+
data.touchId = e.targetTouches[0].identifier;
|
|
53
|
+
}
|
|
54
|
+
if (e.type === 'touchstart') {
|
|
55
|
+
// don't proceed touch event
|
|
56
|
+
preventEdgeSwipe(swiper, e, e.targetTouches[0].pageX);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
var params = swiper.params, touches = swiper.touches, enabled = swiper.enabled;
|
|
60
|
+
if (!enabled)
|
|
61
|
+
return;
|
|
62
|
+
if (!params.simulateTouch && e.pointerType === 'mouse')
|
|
63
|
+
return;
|
|
64
|
+
if (swiper.animating && params.preventInteractionOnTransition) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!swiper.animating && params.cssMode && params.loop) {
|
|
68
|
+
swiper.loopFix();
|
|
69
|
+
}
|
|
70
|
+
var targetEl = e.target;
|
|
71
|
+
if (params.touchEventsTarget === 'wrapper') {
|
|
72
|
+
if (!swiper.wrapperEl.contains(targetEl))
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if ('which' in e && e.which === 3)
|
|
76
|
+
return;
|
|
77
|
+
if ('button' in e && e.button > 0)
|
|
78
|
+
return;
|
|
79
|
+
if (data.isTouched && data.isMoved)
|
|
80
|
+
return;
|
|
81
|
+
// change target el for shadow root component
|
|
82
|
+
var swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
|
|
83
|
+
// eslint-disable-next-line
|
|
84
|
+
var eventPath = e.composedPath ? e.composedPath() : e.path;
|
|
85
|
+
if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
|
|
86
|
+
targetEl = eventPath[0];
|
|
87
|
+
}
|
|
88
|
+
var noSwipingSelector = params.noSwipingSelector
|
|
89
|
+
? params.noSwipingSelector
|
|
90
|
+
: ".".concat(params.noSwipingClass);
|
|
91
|
+
var isTargetShadow = !!(e.target && e.target.shadowRoot);
|
|
92
|
+
// use closestElement for shadow root element to get the actual closest for nested shadow root element
|
|
93
|
+
if (params.noSwiping &&
|
|
94
|
+
(isTargetShadow
|
|
95
|
+
? closestElement(noSwipingSelector, targetEl)
|
|
96
|
+
: targetEl.closest(noSwipingSelector))) {
|
|
97
|
+
swiper.allowClick = true;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (params.swipeHandler) {
|
|
101
|
+
if (!targetEl.closest(params.swipeHandler))
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
touches.currentX = e.pageX;
|
|
105
|
+
touches.currentY = e.pageY;
|
|
106
|
+
var startX = touches.currentX;
|
|
107
|
+
var startY = touches.currentY;
|
|
108
|
+
// Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
|
|
109
|
+
if (!preventEdgeSwipe(swiper, e, startX)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
Object.assign(data, {
|
|
113
|
+
isTouched: true,
|
|
114
|
+
isMoved: false,
|
|
115
|
+
allowTouchCallbacks: true,
|
|
116
|
+
isScrolling: undefined,
|
|
117
|
+
startMoving: undefined,
|
|
118
|
+
});
|
|
119
|
+
touches.startX = startX;
|
|
120
|
+
touches.startY = startY;
|
|
121
|
+
data.touchStartTime = (0, utils_1.now)();
|
|
122
|
+
swiper.allowClick = true;
|
|
123
|
+
swiper.updateSize();
|
|
124
|
+
swiper.swipeDirection = undefined;
|
|
125
|
+
if (params.threshold > 0)
|
|
126
|
+
data.allowThresholdMove = false;
|
|
127
|
+
var preventDefault = true;
|
|
128
|
+
if (targetEl.matches(data.focusableElements)) {
|
|
129
|
+
preventDefault = false;
|
|
130
|
+
if (targetEl.nodeName === 'SELECT') {
|
|
131
|
+
data.isTouched = false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (document.activeElement &&
|
|
135
|
+
document.activeElement.matches(data.focusableElements) &&
|
|
136
|
+
document.activeElement !== targetEl) {
|
|
137
|
+
document.activeElement.blur();
|
|
138
|
+
}
|
|
139
|
+
var shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
|
140
|
+
if ((params.touchStartForcePreventDefault || shouldPreventDefault) &&
|
|
141
|
+
!targetEl.isContentEditable) {
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
}
|
|
144
|
+
if (params.freeMode &&
|
|
145
|
+
params.freeMode.enabled &&
|
|
146
|
+
swiper.freeMode &&
|
|
147
|
+
swiper.animating &&
|
|
148
|
+
!params.cssMode) {
|
|
149
|
+
swiper.freeMode.onTouchStart();
|
|
150
|
+
}
|
|
151
|
+
swiper.emit('touchStart', e);
|
|
152
|
+
}
|
|
153
|
+
exports.default = onTouchStart;
|
|
154
|
+
//# sourceMappingURL=onTouchStart.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
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 setGrabCursor_1 = __importDefault(require("./setGrabCursor.js"));
|
|
7
|
+
var unsetGrabCursor_1 = __importDefault(require("./unsetGrabCursor.js"));
|
|
8
|
+
exports.default = {
|
|
9
|
+
setGrabCursor: setGrabCursor_1.default,
|
|
10
|
+
unsetGrabCursor: unsetGrabCursor_1.default,
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import loopCreate from './loopCreate.js';
|
|
2
|
+
import loopFix from './loopFix.js';
|
|
3
|
+
import loopDestroy from './loopDestroy.js';
|
|
4
|
+
declare const _default: {
|
|
5
|
+
loopCreate: typeof loopCreate;
|
|
6
|
+
loopFix: typeof loopFix;
|
|
7
|
+
loopDestroy: typeof loopDestroy;
|
|
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 loopCreate_1 = __importDefault(require("./loopCreate.js"));
|
|
7
|
+
var loopFix_1 = __importDefault(require("./loopFix.js"));
|
|
8
|
+
var loopDestroy_1 = __importDefault(require("./loopDestroy.js"));
|
|
9
|
+
exports.default = {
|
|
10
|
+
loopCreate: loopCreate_1.default,
|
|
11
|
+
loopFix: loopFix_1.default,
|
|
12
|
+
loopDestroy: loopDestroy_1.default,
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var utils_1 = require("../../shared/utils.js");
|
|
4
|
+
function loopCreate(slideRealIndex) {
|
|
5
|
+
var swiper = this;
|
|
6
|
+
var params = swiper.params, slidesEl = swiper.slidesEl;
|
|
7
|
+
if (!params.loop || (swiper.virtual && swiper.params.virtual.enabled))
|
|
8
|
+
return;
|
|
9
|
+
var initSlides = function () {
|
|
10
|
+
var slides = (0, utils_1.elementChildren)(slidesEl, ".".concat(params.slideClass, ", swiper-slide"));
|
|
11
|
+
slides.forEach(function (el, index) {
|
|
12
|
+
el.setAttribute('data-swiper-slide-index', index);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
16
|
+
var slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
|
|
17
|
+
var shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
|
|
18
|
+
var shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
|
|
19
|
+
var addBlankSlides = function (amountOfSlides) {
|
|
20
|
+
for (var i = 0; i < amountOfSlides; i += 1) {
|
|
21
|
+
var slideEl = swiper.isElement
|
|
22
|
+
? (0, utils_1.createElement)('swiper-slide', [params.slideBlankClass])
|
|
23
|
+
: (0, utils_1.createElement)('div', [params.slideClass, params.slideBlankClass]);
|
|
24
|
+
swiper.slidesEl.append(slideEl);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
if (shouldFillGroup) {
|
|
28
|
+
if (params.loopAddBlankSlides) {
|
|
29
|
+
var slidesToAdd = slidesPerGroup - (swiper.slides.length % slidesPerGroup);
|
|
30
|
+
addBlankSlides(slidesToAdd);
|
|
31
|
+
swiper.recalcSlides();
|
|
32
|
+
swiper.updateSlides();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
(0, utils_1.showWarning)('Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
|
|
36
|
+
}
|
|
37
|
+
initSlides();
|
|
38
|
+
}
|
|
39
|
+
else if (shouldFillGrid) {
|
|
40
|
+
if (params.loopAddBlankSlides) {
|
|
41
|
+
var slidesToAdd = params.grid.rows - (swiper.slides.length % params.grid.rows);
|
|
42
|
+
addBlankSlides(slidesToAdd);
|
|
43
|
+
swiper.recalcSlides();
|
|
44
|
+
swiper.updateSlides();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
(0, utils_1.showWarning)('Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
|
|
48
|
+
}
|
|
49
|
+
initSlides();
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
initSlides();
|
|
53
|
+
}
|
|
54
|
+
swiper.loopFix({ slideRealIndex: slideRealIndex, direction: params.centeredSlides ? undefined : 'next' });
|
|
55
|
+
}
|
|
56
|
+
exports.default = loopCreate;
|
|
57
|
+
//# sourceMappingURL=loopCreate.js.map
|