@kolserdav/swiper 2.0.1-beta → 2.1.3-beta
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/README.md +0 -10
- package/dist/index.d.ts +1 -9
- package/dist/index.js +136 -50
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +137 -51
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -84,16 +84,6 @@ interface SwiperProps {
|
|
|
84
84
|
*/
|
|
85
85
|
className?: string;
|
|
86
86
|
|
|
87
|
-
/**
|
|
88
|
-
* Button for swipe to next
|
|
89
|
-
*/
|
|
90
|
-
nextButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Button for swipe to previous
|
|
94
|
-
*/
|
|
95
|
-
prevButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;
|
|
96
|
-
|
|
97
87
|
/**
|
|
98
88
|
* invitation animation
|
|
99
89
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright: kolserdav, All rights reserved (c)
|
|
8
8
|
* Create date: Mon Nov 29 2021 16:18:08 GMT+0700 (Krasnoyarsk Standard Time)
|
|
9
9
|
******************************************************************************************/
|
|
10
|
-
import React
|
|
10
|
+
import React from 'react';
|
|
11
11
|
/**
|
|
12
12
|
* Time to miliseconds of change animation by card left value
|
|
13
13
|
*/
|
|
@@ -43,14 +43,6 @@ interface SwiperProps {
|
|
|
43
43
|
* Class name for content block
|
|
44
44
|
*/
|
|
45
45
|
className?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Button for swipe to next
|
|
48
|
-
*/
|
|
49
|
-
nextButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;
|
|
50
|
-
/**
|
|
51
|
-
* Button for swipe to previous
|
|
52
|
-
*/
|
|
53
|
-
prevButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;
|
|
54
46
|
/**
|
|
55
47
|
* invitation animation
|
|
56
48
|
*/
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var React__default = _interopDefault(React);
|
|
5
5
|
var material = require('@mui/material');
|
|
6
|
+
var styles = require('@mui/styles');
|
|
6
7
|
var clsx = _interopDefault(require('clsx'));
|
|
7
8
|
var StopIcon = _interopDefault(require('@mui/icons-material/StopScreenShare'));
|
|
8
9
|
var NavigateNextIcon = _interopDefault(require('@mui/icons-material/NavigateNext'));
|
|
@@ -200,8 +201,68 @@ function _switch(discriminant, cases) {
|
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
|
|
203
|
-
var
|
|
204
|
-
|
|
204
|
+
var useStyles = styles.makeStyles(function () {
|
|
205
|
+
return {
|
|
206
|
+
go: {
|
|
207
|
+
transition: 'left 0.4s ease-out 0s'
|
|
208
|
+
},
|
|
209
|
+
back: {
|
|
210
|
+
transition: 'left 0.4s ease-in 0s'
|
|
211
|
+
},
|
|
212
|
+
container: {
|
|
213
|
+
position: 'relative',
|
|
214
|
+
overflow: 'hidden',
|
|
215
|
+
minWidth: '320px',
|
|
216
|
+
width: '100%',
|
|
217
|
+
height: '100%',
|
|
218
|
+
minHeight: '80vh',
|
|
219
|
+
maxWidth: '100vw',
|
|
220
|
+
display: 'flex',
|
|
221
|
+
alignItems: 'center',
|
|
222
|
+
justifyContent: 'center'
|
|
223
|
+
},
|
|
224
|
+
button: {
|
|
225
|
+
cursor: 'pointer',
|
|
226
|
+
position: 'absolute',
|
|
227
|
+
width: 'auto',
|
|
228
|
+
height: 'auto',
|
|
229
|
+
display: 'flex',
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
zIndex: '12'
|
|
232
|
+
},
|
|
233
|
+
button__prev: {
|
|
234
|
+
left: 0,
|
|
235
|
+
transform: 'rotate(180deg)'
|
|
236
|
+
},
|
|
237
|
+
button__next: {
|
|
238
|
+
right: 0
|
|
239
|
+
},
|
|
240
|
+
content: {
|
|
241
|
+
borderRadius: '2px',
|
|
242
|
+
position: 'relative',
|
|
243
|
+
width: 'calc(100% - 48px)',
|
|
244
|
+
height: 'calc(100% - 48px)',
|
|
245
|
+
'-webkit-box-shadow': '0px 0px 5px 1px rgba(34, 60, 80, 0.14)',
|
|
246
|
+
'-moz-box-shadow': '0px 0px 5px 1px rgba(34, 60, 80, 0.14)',
|
|
247
|
+
boxShadow: '0px 0px 5px 1px rgba(34, 60, 80, 0.14)'
|
|
248
|
+
},
|
|
249
|
+
card: {
|
|
250
|
+
position: 'absolute',
|
|
251
|
+
maxWidth: 'inherit',
|
|
252
|
+
top: 0,
|
|
253
|
+
left: 0,
|
|
254
|
+
display: 'flex',
|
|
255
|
+
alignItems: 'center',
|
|
256
|
+
justifyContent: 'center'
|
|
257
|
+
},
|
|
258
|
+
card__prev: {
|
|
259
|
+
left: '-100%'
|
|
260
|
+
},
|
|
261
|
+
card__next: {
|
|
262
|
+
left: '100%'
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
});
|
|
205
266
|
var SWIPE_TRANSITION_TIMEOUT = 400;
|
|
206
267
|
|
|
207
268
|
var getSwipes = function getSwipes(prev, current, next, swipes) {
|
|
@@ -240,10 +301,20 @@ var Swiper = function Swiper(props) {
|
|
|
240
301
|
getPrev = props.getPrev,
|
|
241
302
|
onSwipe = props.onSwipe,
|
|
242
303
|
className = props.className,
|
|
243
|
-
prevButtonRef = props.prevButtonRef,
|
|
244
|
-
nextButtonRef = props.nextButtonRef,
|
|
245
304
|
invitationAnimation = props.invitationAnimation;
|
|
246
305
|
|
|
306
|
+
var _useStyles = useStyles(),
|
|
307
|
+
go = _useStyles.go,
|
|
308
|
+
card = _useStyles.card,
|
|
309
|
+
card__next = _useStyles.card__next,
|
|
310
|
+
card__prev = _useStyles.card__prev,
|
|
311
|
+
button = _useStyles.button,
|
|
312
|
+
button__next = _useStyles.button__next,
|
|
313
|
+
button__prev = _useStyles.button__prev,
|
|
314
|
+
back = _useStyles.back,
|
|
315
|
+
container = _useStyles.container,
|
|
316
|
+
content = _useStyles.content;
|
|
317
|
+
|
|
247
318
|
var _useState = React.useState(),
|
|
248
319
|
current = _useState[0],
|
|
249
320
|
setCurrent = _useState[1];
|
|
@@ -280,6 +351,10 @@ var Swiper = function Swiper(props) {
|
|
|
280
351
|
isMobile = _useState9[0],
|
|
281
352
|
setIsMobile = _useState9[1];
|
|
282
353
|
|
|
354
|
+
var _useState10 = React.useState(true),
|
|
355
|
+
load = _useState10[0],
|
|
356
|
+
setLoad = _useState10[1];
|
|
357
|
+
|
|
283
358
|
var containerRef = React.useRef(null);
|
|
284
359
|
|
|
285
360
|
var _buttonPrevRef = React.useRef(null);
|
|
@@ -300,33 +375,33 @@ var Swiper = function Swiper(props) {
|
|
|
300
375
|
return refs[id];
|
|
301
376
|
};
|
|
302
377
|
|
|
303
|
-
var
|
|
378
|
+
var setGoClassHandler = function setGoClassHandler() {
|
|
304
379
|
var _getRef$current, _getRef$current2, _getRef$current3;
|
|
305
380
|
|
|
306
|
-
(_getRef$current = getRef((next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _getRef$current === void 0 ? void 0 : _getRef$current.classList.add(
|
|
307
|
-
(_getRef$current2 = getRef((prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _getRef$current2 === void 0 ? void 0 : _getRef$current2.classList.add(
|
|
308
|
-
(_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(
|
|
381
|
+
(_getRef$current = getRef((next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _getRef$current === void 0 ? void 0 : _getRef$current.classList.add(go);
|
|
382
|
+
(_getRef$current2 = getRef((prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _getRef$current2 === void 0 ? void 0 : _getRef$current2.classList.add(go);
|
|
383
|
+
(_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(go);
|
|
309
384
|
setTimeout(function () {
|
|
310
385
|
var _getRef$current4, _getRef$current5, _getRef$current6;
|
|
311
386
|
|
|
312
|
-
(_getRef$current4 = getRef((next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _getRef$current4 === void 0 ? void 0 : _getRef$current4.classList.remove(
|
|
313
|
-
(_getRef$current5 = getRef((prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _getRef$current5 === void 0 ? void 0 : _getRef$current5.classList.remove(
|
|
314
|
-
(_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(
|
|
387
|
+
(_getRef$current4 = getRef((next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _getRef$current4 === void 0 ? void 0 : _getRef$current4.classList.remove(go);
|
|
388
|
+
(_getRef$current5 = getRef((prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _getRef$current5 === void 0 ? void 0 : _getRef$current5.classList.remove(go);
|
|
389
|
+
(_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(go);
|
|
315
390
|
}, SWIPE_TRANSITION_TIMEOUT);
|
|
316
391
|
};
|
|
317
392
|
|
|
318
|
-
var
|
|
393
|
+
var setBackClassHandler = function setBackClassHandler() {
|
|
319
394
|
var _getRef$current7, _getRef$current8, _getRef$current9;
|
|
320
395
|
|
|
321
|
-
(_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(
|
|
322
|
-
(_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(
|
|
323
|
-
(_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(
|
|
396
|
+
(_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(back);
|
|
397
|
+
(_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(back);
|
|
398
|
+
(_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(back);
|
|
324
399
|
setTimeout(function () {
|
|
325
400
|
var _getRef$current10, _getRef$current11, _getRef$current12;
|
|
326
401
|
|
|
327
|
-
(_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(
|
|
328
|
-
(_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(
|
|
329
|
-
(_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(
|
|
402
|
+
(_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(back);
|
|
403
|
+
(_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(back);
|
|
404
|
+
(_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(back);
|
|
330
405
|
}, SWIPE_TRANSITION_TIMEOUT);
|
|
331
406
|
};
|
|
332
407
|
|
|
@@ -365,10 +440,12 @@ var Swiper = function Swiper(props) {
|
|
|
365
440
|
onSwipe(currentId);
|
|
366
441
|
}
|
|
367
442
|
|
|
443
|
+
setLoad(false);
|
|
368
444
|
return 0;
|
|
369
445
|
};
|
|
370
446
|
|
|
371
447
|
var _exit2 = false;
|
|
448
|
+
setLoad(true);
|
|
372
449
|
var startTime;
|
|
373
450
|
var currentId = 0;
|
|
374
451
|
|
|
@@ -387,13 +464,14 @@ var Swiper = function Swiper(props) {
|
|
|
387
464
|
};
|
|
388
465
|
|
|
389
466
|
if (!(next !== null && next !== void 0 && next.id)) {
|
|
390
|
-
|
|
467
|
+
setBackClassHandler();
|
|
391
468
|
setLeft(0);
|
|
469
|
+
setLoad(false);
|
|
392
470
|
_exit2 = true;
|
|
393
471
|
return 1;
|
|
394
472
|
}
|
|
395
473
|
|
|
396
|
-
|
|
474
|
+
setGoClassHandler();
|
|
397
475
|
setLeft(windowWidth * -1);
|
|
398
476
|
startTime = new Date().getTime();
|
|
399
477
|
|
|
@@ -427,13 +505,14 @@ var Swiper = function Swiper(props) {
|
|
|
427
505
|
};
|
|
428
506
|
|
|
429
507
|
if (!(prev !== null && prev !== void 0 && prev.id)) {
|
|
430
|
-
|
|
508
|
+
setBackClassHandler();
|
|
431
509
|
setLeft(0);
|
|
510
|
+
setLoad(false);
|
|
432
511
|
_exit2 = true;
|
|
433
512
|
return 1;
|
|
434
513
|
}
|
|
435
514
|
|
|
436
|
-
|
|
515
|
+
setGoClassHandler();
|
|
437
516
|
setLeft(windowWidth);
|
|
438
517
|
startTime = new Date().getTime();
|
|
439
518
|
|
|
@@ -458,8 +537,9 @@ var Swiper = function Swiper(props) {
|
|
|
458
537
|
}
|
|
459
538
|
}();
|
|
460
539
|
} else {
|
|
461
|
-
|
|
540
|
+
setBackClassHandler();
|
|
462
541
|
setLeft(0);
|
|
542
|
+
setLoad(false);
|
|
463
543
|
_exit2 = true;
|
|
464
544
|
return 1;
|
|
465
545
|
}
|
|
@@ -515,18 +595,23 @@ var Swiper = function Swiper(props) {
|
|
|
515
595
|
var isNext = origin === 'next';
|
|
516
596
|
return function () {
|
|
517
597
|
try {
|
|
598
|
+
if (load) {
|
|
599
|
+
return Promise.resolve(1);
|
|
600
|
+
}
|
|
601
|
+
|
|
518
602
|
var coeff = isNext ? -1 : 1;
|
|
519
603
|
var leftVal = width * coeff;
|
|
520
604
|
|
|
521
605
|
if (isNext) {
|
|
522
|
-
|
|
606
|
+
setGoClassHandler();
|
|
523
607
|
} else {
|
|
524
|
-
|
|
608
|
+
setBackClassHandler();
|
|
525
609
|
}
|
|
526
610
|
|
|
527
|
-
setLeft(leftVal);
|
|
528
611
|
return Promise.resolve(wait(SWIPE_TRANSITION_TIMEOUT / 2)).then(function () {
|
|
529
|
-
return Promise.resolve(swipe(leftVal)).then(function () {
|
|
612
|
+
return Promise.resolve(swipe(leftVal)).then(function () {
|
|
613
|
+
return 0;
|
|
614
|
+
});
|
|
530
615
|
});
|
|
531
616
|
} catch (e) {
|
|
532
617
|
return Promise.reject(e);
|
|
@@ -565,20 +650,21 @@ var Swiper = function Swiper(props) {
|
|
|
565
650
|
var infitationAnimationHandler = function infitationAnimationHandler(shift) {
|
|
566
651
|
try {
|
|
567
652
|
if (shift < 0) {
|
|
568
|
-
|
|
653
|
+
setGoClassHandler();
|
|
569
654
|
} else {
|
|
570
|
-
|
|
655
|
+
setBackClassHandler();
|
|
571
656
|
}
|
|
572
657
|
|
|
573
658
|
setLeft(shift);
|
|
574
659
|
return Promise.resolve(wait(SWIPE_TRANSITION_TIMEOUT)).then(function () {
|
|
575
660
|
if (shift < 0) {
|
|
576
|
-
|
|
661
|
+
setBackClassHandler();
|
|
577
662
|
} else {
|
|
578
|
-
|
|
663
|
+
setGoClassHandler();
|
|
579
664
|
}
|
|
580
665
|
|
|
581
666
|
setLeft(0);
|
|
667
|
+
return Promise.resolve(wait(SWIPE_TRANSITION_TIMEOUT)).then(function () {});
|
|
582
668
|
});
|
|
583
669
|
} catch (e) {
|
|
584
670
|
return Promise.reject(e);
|
|
@@ -594,8 +680,6 @@ var Swiper = function Swiper(props) {
|
|
|
594
680
|
|
|
595
681
|
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;
|
|
596
682
|
|
|
597
|
-
var prevButton = prevButtonRef ? prevButtonRef === null || prevButtonRef === void 0 ? void 0 : prevButtonRef.current : _buttonPrevRef.current;
|
|
598
|
-
var nextButton = nextButtonRef ? nextButtonRef === null || nextButtonRef === void 0 ? void 0 : nextButtonRef.current : _buttonNextRef.current;
|
|
599
683
|
var _windowWidth = document.body.clientWidth;
|
|
600
684
|
|
|
601
685
|
if (_width && !width && _height && !height) {
|
|
@@ -618,12 +702,12 @@ var Swiper = function Swiper(props) {
|
|
|
618
702
|
setCurrent(defaultCurrent);
|
|
619
703
|
setPrev(_p);
|
|
620
704
|
setNext(_n);
|
|
621
|
-
setLeft(_left);
|
|
622
705
|
return Promise.resolve(getPrev(_p.id || 0)).then(function (_getPrev) {
|
|
623
706
|
prePrev = _getPrev;
|
|
624
707
|
return Promise.resolve(getNext(_n.id || 0)).then(function (_getNext) {
|
|
625
708
|
postNext = _getNext;
|
|
626
709
|
_defaultCurrent = defaultCurrent;
|
|
710
|
+
setLoad(false);
|
|
627
711
|
});
|
|
628
712
|
});
|
|
629
713
|
});
|
|
@@ -641,7 +725,7 @@ var Swiper = function Swiper(props) {
|
|
|
641
725
|
var _temp18 = function _temp18() {
|
|
642
726
|
var _temp15 = function () {
|
|
643
727
|
if (next !== null && next !== void 0 && next.id) {
|
|
644
|
-
return Promise.resolve(infitationAnimationHandler(-
|
|
728
|
+
return Promise.resolve(infitationAnimationHandler(windowWidth / 5.5 * -1)).then(function () {});
|
|
645
729
|
}
|
|
646
730
|
}();
|
|
647
731
|
|
|
@@ -650,7 +734,7 @@ var Swiper = function Swiper(props) {
|
|
|
650
734
|
|
|
651
735
|
var _temp19 = function () {
|
|
652
736
|
if (prev !== null && prev !== void 0 && prev.id) {
|
|
653
|
-
return Promise.resolve(infitationAnimationHandler(
|
|
737
|
+
return Promise.resolve(infitationAnimationHandler(windowWidth / 5.5)).then(function () {});
|
|
654
738
|
}
|
|
655
739
|
}();
|
|
656
740
|
|
|
@@ -666,24 +750,20 @@ var Swiper = function Swiper(props) {
|
|
|
666
750
|
}
|
|
667
751
|
|
|
668
752
|
setPreValues(prev, next);
|
|
669
|
-
prevButton === null || prevButton === void 0 ? void 0 : prevButton.addEventListener('click', clickPrevHandler);
|
|
670
|
-
nextButton === null || nextButton === void 0 ? void 0 : nextButton.addEventListener('click', clickNextHandler);
|
|
671
753
|
window.addEventListener('resize', resizeHandler);
|
|
672
754
|
return function () {
|
|
673
|
-
prevButton === null || prevButton === void 0 ? void 0 : prevButton.removeEventListener('click', clickPrevHandler);
|
|
674
|
-
nextButton === null || nextButton === void 0 ? void 0 : nextButton.removeEventListener('click', clickNextHandler);
|
|
675
755
|
window.removeEventListener('resize', resizeHandler);
|
|
676
756
|
};
|
|
677
757
|
}, [next, defaultCurrent]);
|
|
678
758
|
return React__default.createElement("div", {
|
|
679
|
-
className:
|
|
759
|
+
className: container,
|
|
680
760
|
ref: containerRef
|
|
681
761
|
}, swipes.map(function (item) {
|
|
682
762
|
var _item$id;
|
|
683
763
|
|
|
684
764
|
return React__default.createElement("div", {
|
|
685
765
|
key: item.id
|
|
686
|
-
}, React__default.createElement(
|
|
766
|
+
}, React__default.createElement(React.Fragment, null, item.id && width && React__default.createElement("div", {
|
|
687
767
|
onTouchMove: onTouchWrapper('onTouchMove'),
|
|
688
768
|
onTouchStart: onTouchWrapper('onTouchStart'),
|
|
689
769
|
onTouchEnd: onTouchWrapper('onTouchEnd'),
|
|
@@ -701,10 +781,10 @@ var Swiper = function Swiper(props) {
|
|
|
701
781
|
height: height,
|
|
702
782
|
left: left + windowWidth
|
|
703
783
|
},
|
|
704
|
-
className: clsx(
|
|
784
|
+
className: clsx(card, item.type === 'prev' ? card__prev : item.type === 'next' ? card__next : ''),
|
|
705
785
|
ref: getRef(item.id)
|
|
706
786
|
}, React__default.createElement("div", {
|
|
707
|
-
className: clsx(
|
|
787
|
+
className: clsx(content, className)
|
|
708
788
|
}, item.children)), !item.id && React__default.createElement("div", {
|
|
709
789
|
style: item.type === 'current' ? {
|
|
710
790
|
width: width,
|
|
@@ -719,17 +799,23 @@ var Swiper = function Swiper(props) {
|
|
|
719
799
|
height: height,
|
|
720
800
|
left: left + windowWidth
|
|
721
801
|
},
|
|
722
|
-
className: clsx(
|
|
802
|
+
className: clsx(card, item.type === 'prev' ? card__prev : item.type === 'next' ? card__next : '')
|
|
723
803
|
}, React__default.createElement(material.IconButton, {
|
|
724
804
|
disabled: true
|
|
725
805
|
}, React__default.createElement(StopIcon, null)))));
|
|
726
|
-
}), typeof isMobile !== 'undefined' && !isMobile &&
|
|
727
|
-
className: clsx(
|
|
806
|
+
}), typeof isMobile !== 'undefined' && !isMobile && (prev === null || prev === void 0 ? void 0 : prev.id) && React__default.createElement("div", {
|
|
807
|
+
className: clsx(button, button__prev),
|
|
728
808
|
ref: _buttonPrevRef
|
|
729
|
-
}, React__default.createElement(material.IconButton,
|
|
730
|
-
|
|
809
|
+
}, React__default.createElement(material.IconButton, {
|
|
810
|
+
disabled: load,
|
|
811
|
+
onClick: clickPrevHandler
|
|
812
|
+
}, React__default.createElement(NavigateNextIcon, null))), typeof isMobile !== 'undefined' && !isMobile && (next === null || next === void 0 ? void 0 : next.id) && React__default.createElement("div", {
|
|
813
|
+
className: clsx(button, button__next),
|
|
731
814
|
ref: _buttonNextRef
|
|
732
|
-
}, React__default.createElement(material.IconButton,
|
|
815
|
+
}, React__default.createElement(material.IconButton, {
|
|
816
|
+
disabled: load,
|
|
817
|
+
onClick: clickNextHandler
|
|
818
|
+
}, React__default.createElement(NavigateNextIcon, null))));
|
|
733
819
|
};
|
|
734
820
|
Swiper.defaultProps = {
|
|
735
821
|
className: ''
|