@kolserdav/swiper 4.1.5 → 4.2.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/LICENSE +21 -0
- package/README.md +2 -2
- package/dist/index.d.ts +85 -85
- package/dist/index.js +3 -914
- package/dist/index.js.LICENSE.txt +24 -0
- package/dist/index.js.map +1 -1
- package/dist/index.test.d.ts +1 -1
- package/dist/styles.css +27 -0
- package/dist/styles.css.map +1 -0
- package/package.json +48 -36
- package/dist/index.css +0 -137
- package/dist/index.modern.js +0 -909
- package/dist/index.modern.js.map +0 -1
- package/dist/navigate_next_black_24dp~NBZptwCk.svg +0 -1
- package/dist/navigate_next_black_24dp~kmANFsMv.svg +0 -1
- package/dist/navigate_next_black_48dp~bfNeNKBt.svg +0 -1
- package/dist/navigate_next_black_48dp~kmANFsMv.svg +0 -1
package/dist/index.modern.js
DELETED
|
@@ -1,909 +0,0 @@
|
|
|
1
|
-
import React, { useState, useRef, useMemo, useEffect, Fragment, createRef } from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
|
|
4
|
-
function _extends() {
|
|
5
|
-
_extends = Object.assign || function (target) {
|
|
6
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7
|
-
var source = arguments[i];
|
|
8
|
-
|
|
9
|
-
for (var key in source) {
|
|
10
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11
|
-
target[key] = source[key];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return target;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return _extends.apply(this, arguments);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// A type of promise-like that resolves synchronously and supports only one observer
|
|
23
|
-
const _Pact = /*#__PURE__*/(function() {
|
|
24
|
-
function _Pact() {}
|
|
25
|
-
_Pact.prototype.then = function(onFulfilled, onRejected) {
|
|
26
|
-
const result = new _Pact();
|
|
27
|
-
const state = this.s;
|
|
28
|
-
if (state) {
|
|
29
|
-
const callback = state & 1 ? onFulfilled : onRejected;
|
|
30
|
-
if (callback) {
|
|
31
|
-
try {
|
|
32
|
-
_settle(result, 1, callback(this.v));
|
|
33
|
-
} catch (e) {
|
|
34
|
-
_settle(result, 2, e);
|
|
35
|
-
}
|
|
36
|
-
return result;
|
|
37
|
-
} else {
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
this.o = function(_this) {
|
|
42
|
-
try {
|
|
43
|
-
const value = _this.v;
|
|
44
|
-
if (_this.s & 1) {
|
|
45
|
-
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
|
46
|
-
} else if (onRejected) {
|
|
47
|
-
_settle(result, 1, onRejected(value));
|
|
48
|
-
} else {
|
|
49
|
-
_settle(result, 2, value);
|
|
50
|
-
}
|
|
51
|
-
} catch (e) {
|
|
52
|
-
_settle(result, 2, e);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
return result;
|
|
56
|
-
};
|
|
57
|
-
return _Pact;
|
|
58
|
-
})();
|
|
59
|
-
|
|
60
|
-
// Settles a pact synchronously
|
|
61
|
-
function _settle(pact, state, value) {
|
|
62
|
-
if (!pact.s) {
|
|
63
|
-
if (value instanceof _Pact) {
|
|
64
|
-
if (value.s) {
|
|
65
|
-
if (state & 1) {
|
|
66
|
-
state = value.s;
|
|
67
|
-
}
|
|
68
|
-
value = value.v;
|
|
69
|
-
} else {
|
|
70
|
-
value.o = _settle.bind(null, pact, state);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (value && value.then) {
|
|
75
|
-
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
pact.s = state;
|
|
79
|
-
pact.v = value;
|
|
80
|
-
const observer = pact.o;
|
|
81
|
-
if (observer) {
|
|
82
|
-
observer(pact);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
|
88
|
-
|
|
89
|
-
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
|
90
|
-
|
|
91
|
-
// Asynchronously implement a switch statement
|
|
92
|
-
function _switch(discriminant, cases) {
|
|
93
|
-
var dispatchIndex = -1;
|
|
94
|
-
var awaitBody;
|
|
95
|
-
outer: {
|
|
96
|
-
for (var i = 0; i < cases.length; i++) {
|
|
97
|
-
var test = cases[i][0];
|
|
98
|
-
if (test) {
|
|
99
|
-
var testValue = test();
|
|
100
|
-
if (testValue && testValue.then) {
|
|
101
|
-
break outer;
|
|
102
|
-
}
|
|
103
|
-
if (testValue === discriminant) {
|
|
104
|
-
dispatchIndex = i;
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
// Found the default case, set it as the pending dispatch case
|
|
109
|
-
dispatchIndex = i;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
if (dispatchIndex !== -1) {
|
|
113
|
-
do {
|
|
114
|
-
var body = cases[dispatchIndex][1];
|
|
115
|
-
while (!body) {
|
|
116
|
-
dispatchIndex++;
|
|
117
|
-
body = cases[dispatchIndex][1];
|
|
118
|
-
}
|
|
119
|
-
var result = body();
|
|
120
|
-
if (result && result.then) {
|
|
121
|
-
awaitBody = true;
|
|
122
|
-
break outer;
|
|
123
|
-
}
|
|
124
|
-
var fallthroughCheck = cases[dispatchIndex][2];
|
|
125
|
-
dispatchIndex++;
|
|
126
|
-
} while (fallthroughCheck && !fallthroughCheck());
|
|
127
|
-
return result;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
const pact = new _Pact();
|
|
131
|
-
const reject = _settle.bind(null, pact, 2);
|
|
132
|
-
(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);
|
|
133
|
-
return pact;
|
|
134
|
-
function _resumeAfterTest(value) {
|
|
135
|
-
for (;;) {
|
|
136
|
-
if (value === discriminant) {
|
|
137
|
-
dispatchIndex = i;
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
if (++i === cases.length) {
|
|
141
|
-
if (dispatchIndex !== -1) {
|
|
142
|
-
break;
|
|
143
|
-
} else {
|
|
144
|
-
_settle(pact, 1, result);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
test = cases[i][0];
|
|
149
|
-
if (test) {
|
|
150
|
-
value = test();
|
|
151
|
-
if (value && value.then) {
|
|
152
|
-
value.then(_resumeAfterTest).then(void 0, reject);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
} else {
|
|
156
|
-
dispatchIndex = i;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
do {
|
|
160
|
-
var body = cases[dispatchIndex][1];
|
|
161
|
-
while (!body) {
|
|
162
|
-
dispatchIndex++;
|
|
163
|
-
body = cases[dispatchIndex][1];
|
|
164
|
-
}
|
|
165
|
-
var result = body();
|
|
166
|
-
if (result && result.then) {
|
|
167
|
-
result.then(_resumeAfterBody).then(void 0, reject);
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
var fallthroughCheck = cases[dispatchIndex][2];
|
|
171
|
-
dispatchIndex++;
|
|
172
|
-
} while (fallthroughCheck && !fallthroughCheck());
|
|
173
|
-
_settle(pact, 1, result);
|
|
174
|
-
}
|
|
175
|
-
function _resumeAfterBody(result) {
|
|
176
|
-
for (;;) {
|
|
177
|
-
var fallthroughCheck = cases[dispatchIndex][2];
|
|
178
|
-
if (!fallthroughCheck || fallthroughCheck()) {
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
dispatchIndex++;
|
|
182
|
-
var body = cases[dispatchIndex][1];
|
|
183
|
-
while (!body) {
|
|
184
|
-
dispatchIndex++;
|
|
185
|
-
body = cases[dispatchIndex][1];
|
|
186
|
-
}
|
|
187
|
-
result = body();
|
|
188
|
-
if (result && result.then) {
|
|
189
|
-
result.then(_resumeAfterBody).then(void 0, reject);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
_settle(pact, 1, result);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
var s = {"container":"_1Lxpd","paper":"_8Yd7S","pipe":"_3uH2i","card":"_xsi02","prev":"_KqFRp","next":"_1uQwZ","back":"_18Pcq","go":"_1nj1b","card__stop":"_3cLUl","content":"_2jwZj","button":"_2hTXI","button__next":"_2Z7EZ","button__prev":"_2Xedt","icon__button":"_2J4XS","dots":"_3MuXE","dot":"_3U2py","active":"_3sodH"};
|
|
198
|
-
|
|
199
|
-
var SWIPE_TRANSITION_TIMEOUT = 400;
|
|
200
|
-
var SWIPE_ON_EVENT_SPEED = 0.7;
|
|
201
|
-
|
|
202
|
-
var getSwipes = function getSwipes(prev, current, next, swipes) {
|
|
203
|
-
if (((prev === null || prev === void 0 ? void 0 : prev.id) === (current === null || current === void 0 ? void 0 : current.id) || (current === null || current === void 0 ? void 0 : current.id) === (next === null || next === void 0 ? void 0 : next.id) || (next === null || next === void 0 ? void 0 : next.id) === (prev === null || prev === void 0 ? void 0 : prev.id)) && swipes.length) {
|
|
204
|
-
return swipes;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
var result = [1, 2, 3].map(function (id) {
|
|
208
|
-
var item = id === 1 ? _extends({}, prev) : id === 2 ? current : _extends({}, next);
|
|
209
|
-
item.type = id === 1 ? 'prev' : id === 2 ? 'current' : 'next';
|
|
210
|
-
return item;
|
|
211
|
-
});
|
|
212
|
-
return result;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
var getDefaultSwipe = function getDefaultSwipe() {
|
|
216
|
-
return {
|
|
217
|
-
id: Math.ceil(Math.random() * 1000),
|
|
218
|
-
children: React.createElement("div", null)
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
var refs = {};
|
|
223
|
-
var startClientX;
|
|
224
|
-
var startClientY;
|
|
225
|
-
var lastLeft;
|
|
226
|
-
var animated = false;
|
|
227
|
-
var prePrev = null;
|
|
228
|
-
var postNext = null;
|
|
229
|
-
|
|
230
|
-
var _defaultCurrent;
|
|
231
|
-
|
|
232
|
-
var oldSwipes = [];
|
|
233
|
-
var startTime = new Date().getTime();
|
|
234
|
-
var Swiper = function Swiper(props) {
|
|
235
|
-
var defaultCurrent = props.defaultCurrent,
|
|
236
|
-
getNext = props.getNext,
|
|
237
|
-
getPrev = props.getPrev,
|
|
238
|
-
onSwipe = props.onSwipe,
|
|
239
|
-
className = props.className,
|
|
240
|
-
invitationAnimation = props.invitationAnimation,
|
|
241
|
-
durationAnimation = props.durationAnimation,
|
|
242
|
-
blockSwipe = props.blockSwipe,
|
|
243
|
-
dots = props.dots;
|
|
244
|
-
|
|
245
|
-
var _useState = useState(),
|
|
246
|
-
current = _useState[0],
|
|
247
|
-
setCurrent = _useState[1];
|
|
248
|
-
|
|
249
|
-
var _useState2 = useState(),
|
|
250
|
-
prev = _useState2[0],
|
|
251
|
-
setPrev = _useState2[1];
|
|
252
|
-
|
|
253
|
-
var _useState3 = useState(),
|
|
254
|
-
next = _useState3[0],
|
|
255
|
-
setNext = _useState3[1];
|
|
256
|
-
|
|
257
|
-
var _useState4 = useState(0),
|
|
258
|
-
windowWidth = _useState4[0],
|
|
259
|
-
setWindowWidth = _useState4[1];
|
|
260
|
-
|
|
261
|
-
var _useState5 = useState(0),
|
|
262
|
-
height = _useState5[0],
|
|
263
|
-
setHeight = _useState5[1];
|
|
264
|
-
|
|
265
|
-
var _useState6 = useState(0),
|
|
266
|
-
width = _useState6[0],
|
|
267
|
-
setWidth = _useState6[1];
|
|
268
|
-
|
|
269
|
-
var _useState7 = useState(0),
|
|
270
|
-
_left = _useState7[0],
|
|
271
|
-
_setLeft = _useState7[1];
|
|
272
|
-
|
|
273
|
-
var _useState8 = useState(0),
|
|
274
|
-
left = _useState8[0],
|
|
275
|
-
setLeft = _useState8[1];
|
|
276
|
-
|
|
277
|
-
var _useState9 = useState(),
|
|
278
|
-
isMobile = _useState9[0],
|
|
279
|
-
setIsMobile = _useState9[1];
|
|
280
|
-
|
|
281
|
-
var _useState10 = useState(false),
|
|
282
|
-
load = _useState10[0],
|
|
283
|
-
setLoad = _useState10[1];
|
|
284
|
-
|
|
285
|
-
var containerRef = useRef(null);
|
|
286
|
-
|
|
287
|
-
if (typeof _defaultCurrent === 'undefined') {
|
|
288
|
-
_defaultCurrent = defaultCurrent;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
var swipes = useMemo(function () {
|
|
292
|
-
return getSwipes(prev || getDefaultSwipe(), current || defaultCurrent, next || getDefaultSwipe(), oldSwipes);
|
|
293
|
-
}, [next, prev, current]);
|
|
294
|
-
oldSwipes = swipes;
|
|
295
|
-
|
|
296
|
-
var getRef = function getRef(id) {
|
|
297
|
-
refs[id] = refs[id] ? refs[id] : createRef();
|
|
298
|
-
return refs[id];
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
var setGoClassHandler = function setGoClassHandler(_next, _prev) {
|
|
302
|
-
var _getRef$current, _getRef$current2, _getRef$current3;
|
|
303
|
-
|
|
304
|
-
(_getRef$current = getRef((_next === null || _next === void 0 ? void 0 : _next.id) || (next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _getRef$current === void 0 ? void 0 : _getRef$current.classList.add(s.go);
|
|
305
|
-
(_getRef$current2 = getRef((_prev === null || _prev === void 0 ? void 0 : _prev.id) || (prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _getRef$current2 === void 0 ? void 0 : _getRef$current2.classList.add(s.go);
|
|
306
|
-
(_getRef$current3 = getRef((current === null || current === void 0 ? void 0 : current.id) || 0).current) === null || _getRef$current3 === void 0 ? void 0 : _getRef$current3.classList.add(s.go);
|
|
307
|
-
setTimeout(function () {
|
|
308
|
-
var _getRef$current4, _getRef$current5, _getRef$current6;
|
|
309
|
-
|
|
310
|
-
(_getRef$current4 = getRef((_next === null || _next === void 0 ? void 0 : _next.id) || (next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _getRef$current4 === void 0 ? void 0 : _getRef$current4.classList.remove(s.go);
|
|
311
|
-
(_getRef$current5 = getRef((_prev === null || _prev === void 0 ? void 0 : _prev.id) || (prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _getRef$current5 === void 0 ? void 0 : _getRef$current5.classList.remove(s.go);
|
|
312
|
-
(_getRef$current6 = getRef((current === null || current === void 0 ? void 0 : current.id) || 0).current) === null || _getRef$current6 === void 0 ? void 0 : _getRef$current6.classList.remove(s.go);
|
|
313
|
-
}, SWIPE_TRANSITION_TIMEOUT);
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
var setBackClassHandler = function setBackClassHandler() {
|
|
317
|
-
var _getRef$current7, _getRef$current8, _getRef$current9;
|
|
318
|
-
|
|
319
|
-
(_getRef$current7 = getRef((next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _getRef$current7 === void 0 ? void 0 : _getRef$current7.classList.add(s.back);
|
|
320
|
-
(_getRef$current8 = getRef((prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _getRef$current8 === void 0 ? void 0 : _getRef$current8.classList.add(s.back);
|
|
321
|
-
(_getRef$current9 = getRef((current === null || current === void 0 ? void 0 : current.id) || 0).current) === null || _getRef$current9 === void 0 ? void 0 : _getRef$current9.classList.add(s.back);
|
|
322
|
-
setTimeout(function () {
|
|
323
|
-
var _getRef$current10, _getRef$current11, _getRef$current12;
|
|
324
|
-
|
|
325
|
-
(_getRef$current10 = getRef((next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _getRef$current10 === void 0 ? void 0 : _getRef$current10.classList.remove(s.back);
|
|
326
|
-
(_getRef$current11 = getRef((prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _getRef$current11 === void 0 ? void 0 : _getRef$current11.classList.remove(s.back);
|
|
327
|
-
(_getRef$current12 = getRef((current === null || current === void 0 ? void 0 : current.id) || 0).current) === null || _getRef$current12 === void 0 ? void 0 : _getRef$current12.classList.remove(s.back);
|
|
328
|
-
}, SWIPE_TRANSITION_TIMEOUT);
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
var wait = function wait(miliseconds) {
|
|
332
|
-
try {
|
|
333
|
-
return Promise.resolve(new Promise(function (resolve) {
|
|
334
|
-
setTimeout(function () {
|
|
335
|
-
resolve(0);
|
|
336
|
-
}, miliseconds);
|
|
337
|
-
})).then(function () {});
|
|
338
|
-
} catch (e) {
|
|
339
|
-
return Promise.reject(e);
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
var setPreValues = function setPreValues(_p, _n) {
|
|
344
|
-
if (_p) {
|
|
345
|
-
getPrev((_p === null || _p === void 0 ? void 0 : _p.id) || 0).then(function (d) {
|
|
346
|
-
prePrev = d;
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
if (_n) {
|
|
351
|
-
getNext((_n === null || _n === void 0 ? void 0 : _n.id) || 0).then(function (d) {
|
|
352
|
-
postNext = d;
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
var swipe = function swipe(_ref) {
|
|
358
|
-
var _lastLeft = _ref._lastLeft,
|
|
359
|
-
_next = _ref._next,
|
|
360
|
-
_prev = _ref._prev,
|
|
361
|
-
speed = _ref.speed;
|
|
362
|
-
|
|
363
|
-
try {
|
|
364
|
-
var _temp7 = function _temp7(_result2) {
|
|
365
|
-
if (_exit2) return _result2;
|
|
366
|
-
setLoad(false);
|
|
367
|
-
return 0;
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
var _exit2 = false;
|
|
371
|
-
setLoad(true);
|
|
372
|
-
|
|
373
|
-
var _startTime;
|
|
374
|
-
|
|
375
|
-
var currentId = 0;
|
|
376
|
-
|
|
377
|
-
var _temp8 = function () {
|
|
378
|
-
if (Math.abs(_lastLeft) > width / 3 || speed !== undefined && speed > SWIPE_ON_EVENT_SPEED) {
|
|
379
|
-
return function () {
|
|
380
|
-
if (_lastLeft < 0) {
|
|
381
|
-
var _temp9 = function _temp9() {
|
|
382
|
-
return Promise.resolve(wait(SWIPE_TRANSITION_TIMEOUT - (new Date().getTime() - _startTime))).then(function () {
|
|
383
|
-
setLeft(0);
|
|
384
|
-
setPrev(current);
|
|
385
|
-
setCurrent(_next || next);
|
|
386
|
-
setNext(postNext);
|
|
387
|
-
});
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
if ((next === null || next === void 0 ? void 0 : next.id) === null) {
|
|
391
|
-
setBackClassHandler();
|
|
392
|
-
setLeft(0);
|
|
393
|
-
setLoad(false);
|
|
394
|
-
_exit2 = true;
|
|
395
|
-
return 1;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
currentId = (_next === null || _next === void 0 ? void 0 : _next.id) || (next === null || next === void 0 ? void 0 : next.id);
|
|
399
|
-
|
|
400
|
-
if (onSwipe !== undefined) {
|
|
401
|
-
onSwipe(currentId);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
setGoClassHandler(_next);
|
|
405
|
-
setLeft(windowWidth * -1);
|
|
406
|
-
_startTime = new Date().getTime();
|
|
407
|
-
|
|
408
|
-
var _temp10 = function () {
|
|
409
|
-
var _postNext;
|
|
410
|
-
|
|
411
|
-
if ((next === null || next === void 0 ? void 0 : next.id) === ((_postNext = postNext) === null || _postNext === void 0 ? void 0 : _postNext.id)) {
|
|
412
|
-
return Promise.resolve(new Promise(function (resolve) {
|
|
413
|
-
var clear = setInterval(function () {
|
|
414
|
-
var _postNext2;
|
|
415
|
-
|
|
416
|
-
if ((next === null || next === void 0 ? void 0 : next.id) !== ((_postNext2 = postNext) === null || _postNext2 === void 0 ? void 0 : _postNext2.id)) {
|
|
417
|
-
clearInterval(clear);
|
|
418
|
-
resolve(0);
|
|
419
|
-
}
|
|
420
|
-
}, 0);
|
|
421
|
-
})).then(function () {});
|
|
422
|
-
}
|
|
423
|
-
}();
|
|
424
|
-
|
|
425
|
-
return _temp10 && _temp10.then ? _temp10.then(_temp9) : _temp9(_temp10);
|
|
426
|
-
} else {
|
|
427
|
-
var _temp11 = function _temp11() {
|
|
428
|
-
return Promise.resolve(wait(SWIPE_TRANSITION_TIMEOUT - (new Date().getTime() - _startTime))).then(function () {
|
|
429
|
-
setLeft(0);
|
|
430
|
-
setPrev(prePrev);
|
|
431
|
-
setCurrent(_prev || prev);
|
|
432
|
-
setNext(current);
|
|
433
|
-
});
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
if ((prev === null || prev === void 0 ? void 0 : prev.id) === null) {
|
|
437
|
-
setBackClassHandler();
|
|
438
|
-
setLeft(0);
|
|
439
|
-
setLoad(false);
|
|
440
|
-
_exit2 = true;
|
|
441
|
-
return 1;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
currentId = (_prev === null || _prev === void 0 ? void 0 : _prev.id) || (prev === null || prev === void 0 ? void 0 : prev.id);
|
|
445
|
-
|
|
446
|
-
if (onSwipe !== undefined) {
|
|
447
|
-
onSwipe(currentId);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
setGoClassHandler(undefined, _prev);
|
|
451
|
-
setLeft(windowWidth);
|
|
452
|
-
_startTime = new Date().getTime();
|
|
453
|
-
|
|
454
|
-
var _temp12 = function () {
|
|
455
|
-
var _prePrev;
|
|
456
|
-
|
|
457
|
-
if ((prev === null || prev === void 0 ? void 0 : prev.id) === ((_prePrev = prePrev) === null || _prePrev === void 0 ? void 0 : _prePrev.id)) {
|
|
458
|
-
return Promise.resolve(new Promise(function (resolve) {
|
|
459
|
-
var clear = setInterval(function () {
|
|
460
|
-
var _prePrev2;
|
|
461
|
-
|
|
462
|
-
if ((prev === null || prev === void 0 ? void 0 : prev.id) !== ((_prePrev2 = prePrev) === null || _prePrev2 === void 0 ? void 0 : _prePrev2.id)) {
|
|
463
|
-
clearInterval(clear);
|
|
464
|
-
resolve(0);
|
|
465
|
-
}
|
|
466
|
-
}, 0);
|
|
467
|
-
})).then(function () {});
|
|
468
|
-
}
|
|
469
|
-
}();
|
|
470
|
-
|
|
471
|
-
return _temp12 && _temp12.then ? _temp12.then(_temp11) : _temp11(_temp12);
|
|
472
|
-
}
|
|
473
|
-
}();
|
|
474
|
-
} else {
|
|
475
|
-
setBackClassHandler();
|
|
476
|
-
setLeft(0);
|
|
477
|
-
setLoad(false);
|
|
478
|
-
_exit2 = true;
|
|
479
|
-
return 1;
|
|
480
|
-
}
|
|
481
|
-
}();
|
|
482
|
-
|
|
483
|
-
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8));
|
|
484
|
-
} catch (e) {
|
|
485
|
-
return Promise.reject(e);
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
var onTouchHandler = function onTouchHandler(name, e) {
|
|
490
|
-
try {
|
|
491
|
-
var _touches$, _touches$2;
|
|
492
|
-
|
|
493
|
-
var _temp16 = function _temp16() {
|
|
494
|
-
_interrupt2 = true;
|
|
495
|
-
};
|
|
496
|
-
|
|
497
|
-
var _interrupt2 = false;
|
|
498
|
-
var touches = e.touches;
|
|
499
|
-
var clientX = (_touches$ = touches[0]) === null || _touches$ === void 0 ? void 0 : _touches$.clientX;
|
|
500
|
-
var clientY = (_touches$2 = touches[0]) === null || _touches$2 === void 0 ? void 0 : _touches$2.clientY;
|
|
501
|
-
startClientX = startClientX || 0;
|
|
502
|
-
startClientY = startClientY || 0;
|
|
503
|
-
var absX = 0;
|
|
504
|
-
var absY = 0;
|
|
505
|
-
|
|
506
|
-
var _temp17 = _switch(name, [[function () {
|
|
507
|
-
return 'onTouchStart';
|
|
508
|
-
}, function () {
|
|
509
|
-
startClientX = clientX;
|
|
510
|
-
startClientY = clientY;
|
|
511
|
-
lastLeft = _left;
|
|
512
|
-
startTime = new Date().getTime();
|
|
513
|
-
_interrupt2 = true;
|
|
514
|
-
}], [function () {
|
|
515
|
-
return 'onTouchMove';
|
|
516
|
-
}, function () {
|
|
517
|
-
if (!blockSwipe) {
|
|
518
|
-
absY = Math.abs(startClientY - clientY);
|
|
519
|
-
absX = Math.abs(startClientX - clientX);
|
|
520
|
-
|
|
521
|
-
if (absX > absY) {
|
|
522
|
-
lastLeft = _left - (startClientX - clientX);
|
|
523
|
-
setLeft(lastLeft);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
_interrupt2 = true;
|
|
528
|
-
}], [function () {
|
|
529
|
-
return 'onTouchEnd';
|
|
530
|
-
}, function () {
|
|
531
|
-
var _temp13 = function () {
|
|
532
|
-
if (!blockSwipe) {
|
|
533
|
-
return Promise.resolve(swipe({
|
|
534
|
-
_lastLeft: lastLeft,
|
|
535
|
-
speed: Math.abs(lastLeft / (new Date().getTime() - startTime))
|
|
536
|
-
})).then(function () {});
|
|
537
|
-
}
|
|
538
|
-
}();
|
|
539
|
-
|
|
540
|
-
return _temp13 && _temp13.then ? _temp13.then(_temp16) : _temp16(_temp13);
|
|
541
|
-
}], []]);
|
|
542
|
-
|
|
543
|
-
return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
|
|
544
|
-
} catch (e) {
|
|
545
|
-
return Promise.reject(e);
|
|
546
|
-
}
|
|
547
|
-
};
|
|
548
|
-
|
|
549
|
-
var onTouchWrapper = function onTouchWrapper(name) {
|
|
550
|
-
return function (e) {
|
|
551
|
-
onTouchHandler(name, e);
|
|
552
|
-
};
|
|
553
|
-
};
|
|
554
|
-
|
|
555
|
-
var clickHandler = function clickHandler(origin) {
|
|
556
|
-
var isNext = origin === 'next';
|
|
557
|
-
return function () {
|
|
558
|
-
try {
|
|
559
|
-
var coeff = isNext ? -1 : 1;
|
|
560
|
-
var leftVal = width * coeff;
|
|
561
|
-
|
|
562
|
-
if (isNext) {
|
|
563
|
-
setGoClassHandler();
|
|
564
|
-
} else {
|
|
565
|
-
setBackClassHandler();
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
return Promise.resolve(wait(SWIPE_TRANSITION_TIMEOUT)).then(function () {
|
|
569
|
-
return Promise.resolve(swipe({
|
|
570
|
-
_lastLeft: leftVal
|
|
571
|
-
})).then(function () {
|
|
572
|
-
return 0;
|
|
573
|
-
});
|
|
574
|
-
});
|
|
575
|
-
} catch (e) {
|
|
576
|
-
return Promise.reject(e);
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
};
|
|
580
|
-
|
|
581
|
-
var clickNextHandler = clickHandler('next');
|
|
582
|
-
var clickPrevHandler = clickHandler('prev');
|
|
583
|
-
|
|
584
|
-
var resizeHandler = function resizeHandler() {
|
|
585
|
-
var _containerRef$current, _containerRef$current2, _containerRef$current3, _containerRef$current4, _containerRef$current5, _containerRef$current6, _containerRef$current7, _containerRef$current8, _containerRef$current9;
|
|
586
|
-
|
|
587
|
-
var _width = containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : (_containerRef$current2 = _containerRef$current.parentElement) === null || _containerRef$current2 === void 0 ? void 0 : (_containerRef$current3 = _containerRef$current2.getBoundingClientRect()) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.width;
|
|
588
|
-
|
|
589
|
-
var _height = containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 ? void 0 : (_containerRef$current5 = _containerRef$current4.parentElement) === null || _containerRef$current5 === void 0 ? void 0 : (_containerRef$current6 = _containerRef$current5.getBoundingClientRect()) === null || _containerRef$current6 === void 0 ? void 0 : _containerRef$current6.height;
|
|
590
|
-
|
|
591
|
-
var __left = containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current7 = containerRef.current) === null || _containerRef$current7 === void 0 ? void 0 : (_containerRef$current8 = _containerRef$current7.parentElement) === null || _containerRef$current8 === void 0 ? void 0 : (_containerRef$current9 = _containerRef$current8.getBoundingClientRect()) === null || _containerRef$current9 === void 0 ? void 0 : _containerRef$current9.left;
|
|
592
|
-
|
|
593
|
-
var _windowWidth = document.body.clientWidth;
|
|
594
|
-
|
|
595
|
-
if (_width && _height) {
|
|
596
|
-
setWidth(_width);
|
|
597
|
-
setHeight(_height);
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
if (__left) {
|
|
601
|
-
setLeft(__left);
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
if (_windowWidth) {
|
|
605
|
-
setWindowWidth(_windowWidth);
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
|
|
609
|
-
var infitationAnimationHandler = function infitationAnimationHandler(shift) {
|
|
610
|
-
try {
|
|
611
|
-
if (shift < 0) {
|
|
612
|
-
setGoClassHandler();
|
|
613
|
-
} else {
|
|
614
|
-
setBackClassHandler();
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
setLeft(shift);
|
|
618
|
-
return Promise.resolve(wait(SWIPE_TRANSITION_TIMEOUT)).then(function () {
|
|
619
|
-
if (shift < 0) {
|
|
620
|
-
setBackClassHandler();
|
|
621
|
-
} else {
|
|
622
|
-
setGoClassHandler();
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
setLeft(0);
|
|
626
|
-
return Promise.resolve(wait(SWIPE_TRANSITION_TIMEOUT)).then(function () {});
|
|
627
|
-
});
|
|
628
|
-
} catch (e) {
|
|
629
|
-
return Promise.reject(e);
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
|
|
633
|
-
var setStartCards = function setStartCards() {
|
|
634
|
-
try {
|
|
635
|
-
return Promise.resolve(getNext(defaultCurrent.id || 0)).then(function (_n) {
|
|
636
|
-
return Promise.resolve(getPrev(defaultCurrent.id || 0)).then(function (_p) {
|
|
637
|
-
setCurrent(defaultCurrent);
|
|
638
|
-
setPrev(_p);
|
|
639
|
-
setNext(_n);
|
|
640
|
-
return Promise.resolve(getPrev(_p.id || 0)).then(function (_getPrev) {
|
|
641
|
-
prePrev = _getPrev;
|
|
642
|
-
return Promise.resolve(getNext(_n.id || 0)).then(function (_getNext) {
|
|
643
|
-
postNext = _getNext;
|
|
644
|
-
_defaultCurrent = defaultCurrent;
|
|
645
|
-
setLoad(false);
|
|
646
|
-
});
|
|
647
|
-
});
|
|
648
|
-
});
|
|
649
|
-
});
|
|
650
|
-
} catch (e) {
|
|
651
|
-
return Promise.reject(e);
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
|
|
655
|
-
var startInvitationAnimation = function startInvitationAnimation(prev, next) {
|
|
656
|
-
try {
|
|
657
|
-
var _temp21 = function _temp21() {
|
|
658
|
-
var _temp18 = function () {
|
|
659
|
-
if (next.id) {
|
|
660
|
-
return Promise.resolve(infitationAnimationHandler(windowWidth / 5.5 * -1)).then(function () {});
|
|
661
|
-
}
|
|
662
|
-
}();
|
|
663
|
-
|
|
664
|
-
if (_temp18 && _temp18.then) return _temp18.then(function () {});
|
|
665
|
-
};
|
|
666
|
-
|
|
667
|
-
var _temp22 = function () {
|
|
668
|
-
if (prev.id) {
|
|
669
|
-
return Promise.resolve(infitationAnimationHandler(windowWidth / 5.5)).then(function () {});
|
|
670
|
-
}
|
|
671
|
-
}();
|
|
672
|
-
|
|
673
|
-
return Promise.resolve(_temp22 && _temp22.then ? _temp22.then(_temp21) : _temp21(_temp22));
|
|
674
|
-
} catch (e) {
|
|
675
|
-
return Promise.reject(e);
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
var clickDotHandler = function clickDotHandler(e) {
|
|
680
|
-
try {
|
|
681
|
-
var target = e.target;
|
|
682
|
-
var tabindex = target === null || target === void 0 ? void 0 : target.getAttribute('tabindex');
|
|
683
|
-
var active = parseInt(tabindex, 10);
|
|
684
|
-
var currId = (current === null || current === void 0 ? void 0 : current.id) || 0;
|
|
685
|
-
|
|
686
|
-
var _temp24 = function () {
|
|
687
|
-
if (currId < active) {
|
|
688
|
-
return Promise.resolve(getNext(active - 1)).then(function (next) {
|
|
689
|
-
setNext(next);
|
|
690
|
-
return Promise.resolve(getPrev((next === null || next === void 0 ? void 0 : next.id) || 0)).then(function (prev) {
|
|
691
|
-
return Promise.resolve(swipe({
|
|
692
|
-
_lastLeft: -1000,
|
|
693
|
-
_prev: prev,
|
|
694
|
-
_next: next
|
|
695
|
-
})).then(function () {
|
|
696
|
-
return Promise.resolve(getNext((next === null || next === void 0 ? void 0 : next.id) || 0)).then(function (_getNext2) {
|
|
697
|
-
postNext = _getNext2;
|
|
698
|
-
return Promise.resolve(getPrev((prev === null || prev === void 0 ? void 0 : prev.id) || 0)).then(function (_getPrev2) {
|
|
699
|
-
prePrev = _getPrev2;
|
|
700
|
-
setPrev(prev);
|
|
701
|
-
});
|
|
702
|
-
});
|
|
703
|
-
});
|
|
704
|
-
});
|
|
705
|
-
});
|
|
706
|
-
} else {
|
|
707
|
-
return Promise.resolve(getPrev(active + 1)).then(function (prev) {
|
|
708
|
-
setPrev(prev);
|
|
709
|
-
return Promise.resolve(getNext((prev === null || prev === void 0 ? void 0 : prev.id) || 0)).then(function (next) {
|
|
710
|
-
return Promise.resolve(swipe({
|
|
711
|
-
_lastLeft: 1000,
|
|
712
|
-
_prev: prev,
|
|
713
|
-
_next: next
|
|
714
|
-
})).then(function () {
|
|
715
|
-
return Promise.resolve(getNext((next === null || next === void 0 ? void 0 : next.id) || 0)).then(function (_getNext3) {
|
|
716
|
-
postNext = _getNext3;
|
|
717
|
-
return Promise.resolve(getPrev((prev === null || prev === void 0 ? void 0 : prev.id) || 0)).then(function (_getPrev3) {
|
|
718
|
-
prePrev = _getPrev3;
|
|
719
|
-
setNext(next);
|
|
720
|
-
});
|
|
721
|
-
});
|
|
722
|
-
});
|
|
723
|
-
});
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
}();
|
|
727
|
-
|
|
728
|
-
return Promise.resolve(_temp24 && _temp24.then ? _temp24.then(function () {}) : void 0);
|
|
729
|
-
} catch (e) {
|
|
730
|
-
return Promise.reject(e);
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
|
|
734
|
-
useEffect(function () {
|
|
735
|
-
var _containerRef$current10, _containerRef$current11, _containerRef$current12, _containerRef$current13, _containerRef$current14, _containerRef$current15, _containerRef$current16, _containerRef$current17, _containerRef$current18, _current$nextRef, _current$closeRef;
|
|
736
|
-
|
|
737
|
-
var clearAnimate;
|
|
738
|
-
|
|
739
|
-
if (durationAnimation) {
|
|
740
|
-
clearAnimate = setInterval(function () {
|
|
741
|
-
clickNextHandler();
|
|
742
|
-
}, durationAnimation);
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
var _width = containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current10 = containerRef.current) === null || _containerRef$current10 === void 0 ? void 0 : (_containerRef$current11 = _containerRef$current10.parentElement) === null || _containerRef$current11 === void 0 ? void 0 : (_containerRef$current12 = _containerRef$current11.getBoundingClientRect()) === null || _containerRef$current12 === void 0 ? void 0 : _containerRef$current12.width;
|
|
746
|
-
|
|
747
|
-
var _height = containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current13 = containerRef.current) === null || _containerRef$current13 === void 0 ? void 0 : (_containerRef$current14 = _containerRef$current13.parentElement) === null || _containerRef$current14 === void 0 ? void 0 : (_containerRef$current15 = _containerRef$current14.getBoundingClientRect()) === null || _containerRef$current15 === void 0 ? void 0 : _containerRef$current15.height;
|
|
748
|
-
|
|
749
|
-
var __left = containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current16 = containerRef.current) === null || _containerRef$current16 === void 0 ? void 0 : (_containerRef$current17 = _containerRef$current16.parentElement) === null || _containerRef$current17 === void 0 ? void 0 : (_containerRef$current18 = _containerRef$current17.getBoundingClientRect()) === null || _containerRef$current18 === void 0 ? void 0 : _containerRef$current18.left;
|
|
750
|
-
|
|
751
|
-
var _windowWidth = document.body.clientWidth;
|
|
752
|
-
var buttonNext = current === null || current === void 0 ? void 0 : (_current$nextRef = current.nextRef) === null || _current$nextRef === void 0 ? void 0 : _current$nextRef.current;
|
|
753
|
-
var buttonClose = current === null || current === void 0 ? void 0 : (_current$closeRef = current.closeRef) === null || _current$closeRef === void 0 ? void 0 : _current$closeRef.current;
|
|
754
|
-
buttonNext === null || buttonNext === void 0 ? void 0 : buttonNext.addEventListener('click', clickNextHandler);
|
|
755
|
-
buttonClose === null || buttonClose === void 0 ? void 0 : buttonClose.addEventListener('click', clickNextHandler);
|
|
756
|
-
|
|
757
|
-
if (_width && !width && _height && !height) {
|
|
758
|
-
setWidth(_width);
|
|
759
|
-
setHeight(_height);
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
if (__left && !left) {
|
|
763
|
-
_setLeft(__left);
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
if (!windowWidth && _windowWidth) {
|
|
767
|
-
setWindowWidth(_windowWidth);
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
if (!current || !prev || !next || _defaultCurrent !== defaultCurrent) {
|
|
771
|
-
setStartCards();
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
if (invitationAnimation && width && !animated) {
|
|
775
|
-
if (prev && next) {
|
|
776
|
-
animated = true;
|
|
777
|
-
startInvitationAnimation(prev, next);
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
if (typeof isMobile === 'undefined') {
|
|
782
|
-
var _navigator;
|
|
783
|
-
|
|
784
|
-
setIsMobile('ontouchstart' in window || typeof ((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.msMaxTouchPoints) !== 'undefined');
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
setPreValues(prev, next);
|
|
788
|
-
window.addEventListener('resize', resizeHandler);
|
|
789
|
-
return function () {
|
|
790
|
-
if (clearAnimate) {
|
|
791
|
-
clearInterval(clearAnimate);
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
window.removeEventListener('resize', resizeHandler);
|
|
795
|
-
buttonNext === null || buttonNext === void 0 ? void 0 : buttonNext.removeEventListener('click', clickNextHandler);
|
|
796
|
-
buttonClose === null || buttonClose === void 0 ? void 0 : buttonClose.removeEventListener('click', clickNextHandler);
|
|
797
|
-
};
|
|
798
|
-
}, [next, defaultCurrent]);
|
|
799
|
-
return React.createElement("div", {
|
|
800
|
-
className: s.container,
|
|
801
|
-
ref: containerRef
|
|
802
|
-
}, swipes.map(function (item) {
|
|
803
|
-
var _item$id;
|
|
804
|
-
|
|
805
|
-
return React.createElement(Fragment, {
|
|
806
|
-
key: item.id
|
|
807
|
-
}, item.id !== null && item.children !== null && width && React.createElement("div", {
|
|
808
|
-
onTouchMove: onTouchWrapper('onTouchMove'),
|
|
809
|
-
onTouchStart: onTouchWrapper('onTouchStart'),
|
|
810
|
-
onTouchEnd: onTouchWrapper('onTouchEnd'),
|
|
811
|
-
id: (_item$id = item.id) === null || _item$id === void 0 ? void 0 : _item$id.toString(),
|
|
812
|
-
style: item.type === 'current' ? {
|
|
813
|
-
width: width,
|
|
814
|
-
height: height,
|
|
815
|
-
left: left
|
|
816
|
-
} : item.type === 'prev' ? {
|
|
817
|
-
width: width,
|
|
818
|
-
height: height,
|
|
819
|
-
left: left - window.innerWidth
|
|
820
|
-
} : {
|
|
821
|
-
width: width,
|
|
822
|
-
height: height,
|
|
823
|
-
left: left + window.innerWidth
|
|
824
|
-
},
|
|
825
|
-
className: clsx(s.card, item.type === 'prev' ? s.prev : item.type === 'next' ? s.next : ''),
|
|
826
|
-
ref: getRef(item.id)
|
|
827
|
-
}, React.createElement("div", {
|
|
828
|
-
className: clsx(s.content, className)
|
|
829
|
-
}, item.children)), item.id === null && React.createElement("div", {
|
|
830
|
-
style: item.type === 'current' ? {
|
|
831
|
-
width: width,
|
|
832
|
-
height: height,
|
|
833
|
-
left: left
|
|
834
|
-
} : item.type === 'prev' ? {
|
|
835
|
-
width: width,
|
|
836
|
-
height: height,
|
|
837
|
-
left: left - windowWidth
|
|
838
|
-
} : {
|
|
839
|
-
width: width,
|
|
840
|
-
height: height,
|
|
841
|
-
left: left + windowWidth
|
|
842
|
-
},
|
|
843
|
-
className: clsx(s.card, item.type === 'prev' ? s.prev : item.type === 'next' ? s.next : '')
|
|
844
|
-
}, React.createElement("svg", {
|
|
845
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
846
|
-
height: "24px",
|
|
847
|
-
viewBox: "0 0 24 24",
|
|
848
|
-
width: "24px",
|
|
849
|
-
fill: "#000000"
|
|
850
|
-
}, React.createElement("path", {
|
|
851
|
-
d: "M0 0h24v24H0V0z",
|
|
852
|
-
fill: "none"
|
|
853
|
-
}), React.createElement("path", {
|
|
854
|
-
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"
|
|
855
|
-
}))));
|
|
856
|
-
}), typeof isMobile !== 'undefined' && !isMobile && (prev === null || prev === void 0 ? void 0 : prev.id) !== null && React.createElement("div", {
|
|
857
|
-
className: clsx(s.button, s.button__prev)
|
|
858
|
-
}, React.createElement("button", {
|
|
859
|
-
className: s.icon__button,
|
|
860
|
-
type: "button",
|
|
861
|
-
disabled: load || isMobile,
|
|
862
|
-
onClick: clickPrevHandler
|
|
863
|
-
}, React.createElement("svg", {
|
|
864
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
865
|
-
height: "24px",
|
|
866
|
-
viewBox: "0 0 24 24",
|
|
867
|
-
width: "24px",
|
|
868
|
-
fill: "#000000"
|
|
869
|
-
}, React.createElement("path", {
|
|
870
|
-
d: "M0 0h24v24H0V0z",
|
|
871
|
-
fill: "none"
|
|
872
|
-
}), React.createElement("path", {
|
|
873
|
-
d: "M10.02 6L8.61 7.41 13.19 12l-4.58 4.59L10.02 18l6-6-6-6z"
|
|
874
|
-
})))), typeof isMobile !== 'undefined' && !isMobile && (next === null || next === void 0 ? void 0 : next.id) !== null && React.createElement("div", {
|
|
875
|
-
className: clsx(s.button, s.button__next)
|
|
876
|
-
}, React.createElement("button", {
|
|
877
|
-
className: s.icon__button,
|
|
878
|
-
type: "button",
|
|
879
|
-
disabled: load || isMobile,
|
|
880
|
-
onClick: clickNextHandler
|
|
881
|
-
}, React.createElement("svg", {
|
|
882
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
883
|
-
height: "24px",
|
|
884
|
-
viewBox: "0 0 24 24",
|
|
885
|
-
width: "24px",
|
|
886
|
-
fill: "#000000"
|
|
887
|
-
}, React.createElement("path", {
|
|
888
|
-
d: "M0 0h24v24H0V0z",
|
|
889
|
-
fill: "none"
|
|
890
|
-
}), React.createElement("path", {
|
|
891
|
-
d: "M10.02 6L8.61 7.41 13.19 12l-4.58 4.59L10.02 18l6-6-6-6z"
|
|
892
|
-
})))), dots && React.createElement("div", {
|
|
893
|
-
className: s.dots
|
|
894
|
-
}, dots.list.map(function (item) {
|
|
895
|
-
return React.createElement("div", {
|
|
896
|
-
role: "button",
|
|
897
|
-
onClick: clickDotHandler,
|
|
898
|
-
tabIndex: item,
|
|
899
|
-
key: item,
|
|
900
|
-
className: clsx(s.dot, (current === null || current === void 0 ? void 0 : current.id) === item ? s.active : '')
|
|
901
|
-
});
|
|
902
|
-
})));
|
|
903
|
-
};
|
|
904
|
-
Swiper.defaultProps = {
|
|
905
|
-
className: ''
|
|
906
|
-
};
|
|
907
|
-
|
|
908
|
-
export { SWIPE_ON_EVENT_SPEED, SWIPE_TRANSITION_TIMEOUT, Swiper };
|
|
909
|
-
//# sourceMappingURL=index.modern.js.map
|