1
1
/*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.7
3
3
* https://fengyuanchen.github.io/viewerjs
4
4
*
5
5
* Copyright 2015-present Chen Fengyuan
6
6
* Released under the MIT license
7
7
*
8
- * Date: 2023-09-17T03:16:38.052Z
8
+ * Date: 2024-11-24T04:32:19.116Z
9
9
*/
10
10
11
11
'use strict' ;
12
12
13
+ function _classCallCheck ( a , n ) {
14
+ if ( ! ( a instanceof n ) ) throw new TypeError ( "Cannot call a class as a function" ) ;
15
+ }
16
+ function _defineProperties ( e , r ) {
17
+ for ( var t = 0 ; t < r . length ; t ++ ) {
18
+ var o = r [ t ] ;
19
+ o . enumerable = o . enumerable || ! 1 , o . configurable = ! 0 , "value" in o && ( o . writable = ! 0 ) , Object . defineProperty ( e , _toPropertyKey ( o . key ) , o ) ;
20
+ }
21
+ }
22
+ function _createClass ( e , r , t ) {
23
+ return r && _defineProperties ( e . prototype , r ) , t && _defineProperties ( e , t ) , Object . defineProperty ( e , "prototype" , {
24
+ writable : ! 1
25
+ } ) , e ;
26
+ }
27
+ function _defineProperty ( e , r , t ) {
28
+ return ( r = _toPropertyKey ( r ) ) in e ? Object . defineProperty ( e , r , {
29
+ value : t ,
30
+ enumerable : ! 0 ,
31
+ configurable : ! 0 ,
32
+ writable : ! 0
33
+ } ) : e [ r ] = t , e ;
34
+ }
13
35
function ownKeys ( e , r ) {
14
36
var t = Object . keys ( e ) ;
15
37
if ( Object . getOwnPropertySymbols ) {
@@ -31,6 +53,20 @@ function _objectSpread2(e) {
31
53
}
32
54
return e ;
33
55
}
56
+ function _toPrimitive ( t , r ) {
57
+ if ( "object" != typeof t || ! t ) return t ;
58
+ var e = t [ Symbol . toPrimitive ] ;
59
+ if ( void 0 !== e ) {
60
+ var i = e . call ( t , r || "default" ) ;
61
+ if ( "object" != typeof i ) return i ;
62
+ throw new TypeError ( "@@toPrimitive must return a primitive value." ) ;
63
+ }
64
+ return ( "string" === r ? String : Number ) ( t ) ;
65
+ }
66
+ function _toPropertyKey ( t ) {
67
+ var i = _toPrimitive ( t , "string" ) ;
68
+ return "symbol" == typeof i ? i : i + "" ;
69
+ }
34
70
function _typeof ( o ) {
35
71
"@babel/helpers - typeof" ;
36
72
@@ -40,56 +76,6 @@ function _typeof(o) {
40
76
return o && "function" == typeof Symbol && o . constructor === Symbol && o !== Symbol . prototype ? "symbol" : typeof o ;
41
77
} , _typeof ( o ) ;
42
78
}
43
- function _classCallCheck ( instance , Constructor ) {
44
- if ( ! ( instance instanceof Constructor ) ) {
45
- throw new TypeError ( "Cannot call a class as a function" ) ;
46
- }
47
- }
48
- function _defineProperties ( target , props ) {
49
- for ( var i = 0 ; i < props . length ; i ++ ) {
50
- var descriptor = props [ i ] ;
51
- descriptor . enumerable = descriptor . enumerable || false ;
52
- descriptor . configurable = true ;
53
- if ( "value" in descriptor ) descriptor . writable = true ;
54
- Object . defineProperty ( target , _toPropertyKey ( descriptor . key ) , descriptor ) ;
55
- }
56
- }
57
- function _createClass ( Constructor , protoProps , staticProps ) {
58
- if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
59
- if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
60
- Object . defineProperty ( Constructor , "prototype" , {
61
- writable : false
62
- } ) ;
63
- return Constructor ;
64
- }
65
- function _defineProperty ( obj , key , value ) {
66
- key = _toPropertyKey ( key ) ;
67
- if ( key in obj ) {
68
- Object . defineProperty ( obj , key , {
69
- value : value ,
70
- enumerable : true ,
71
- configurable : true ,
72
- writable : true
73
- } ) ;
74
- } else {
75
- obj [ key ] = value ;
76
- }
77
- return obj ;
78
- }
79
- function _toPrimitive ( input , hint ) {
80
- if ( typeof input !== "object" || input === null ) return input ;
81
- var prim = input [ Symbol . toPrimitive ] ;
82
- if ( prim !== undefined ) {
83
- var res = prim . call ( input , hint || "default" ) ;
84
- if ( typeof res !== "object" ) return res ;
85
- throw new TypeError ( "@@toPrimitive must return a primitive value." ) ;
86
- }
87
- return ( hint === "string" ? String : Number ) ( input ) ;
88
- }
89
- function _toPropertyKey ( arg ) {
90
- var key = _toPrimitive ( arg , "string" ) ;
91
- return typeof key === "symbol" ? key : String ( key ) ;
92
- }
93
79
94
80
var DEFAULTS = {
95
81
/**
@@ -1762,17 +1748,17 @@ var methods = {
1762
1748
_this . hidden ( ) ;
1763
1749
} ;
1764
1750
if ( options . transition && ! immediate ) {
1765
- var onViewerTransitionEnd = function onViewerTransitionEnd ( event ) {
1751
+ var _onViewerTransitionEnd = function onViewerTransitionEnd ( event ) {
1766
1752
// Ignore all propagating `transitionend` events (#275).
1767
1753
if ( event && event . target === viewer ) {
1768
- removeListener ( viewer , EVENT_TRANSITION_END , onViewerTransitionEnd ) ;
1754
+ removeListener ( viewer , EVENT_TRANSITION_END , _onViewerTransitionEnd ) ;
1769
1755
_this . hidden ( ) ;
1770
1756
}
1771
1757
} ;
1772
1758
var onImageTransitionEnd = function onImageTransitionEnd ( ) {
1773
1759
// In case of show the viewer by `viewer.show(true)` previously (#407).
1774
1760
if ( hasClass ( viewer , CLASS_TRANSITION ) ) {
1775
- addListener ( viewer , EVENT_TRANSITION_END , onViewerTransitionEnd ) ;
1761
+ addListener ( viewer , EVENT_TRANSITION_END , _onViewerTransitionEnd ) ;
1776
1762
removeClass ( viewer , CLASS_IN ) ;
1777
1763
} else {
1778
1764
hideImmediately ( ) ;
@@ -1783,7 +1769,7 @@ var methods = {
1783
1769
if ( _this . viewed && hasClass ( image , CLASS_TRANSITION ) ) {
1784
1770
removeListener ( image , EVENT_TRANSITION_END , onImageTransitionEnd ) ;
1785
1771
} else if ( hasClass ( viewer , CLASS_TRANSITION ) ) {
1786
- removeListener ( viewer , EVENT_TRANSITION_END , onViewerTransitionEnd ) ;
1772
+ removeListener ( viewer , EVENT_TRANSITION_END , _onViewerTransitionEnd ) ;
1787
1773
}
1788
1774
}
1789
1775
} ;
@@ -2376,27 +2362,27 @@ var methods = {
2376
2362
player . appendChild ( image ) ;
2377
2363
} ) ;
2378
2364
if ( isNumber ( options . interval ) && options . interval > 0 ) {
2379
- var prev = function prev ( ) {
2365
+ var _prev = function prev ( ) {
2380
2366
clearTimeout ( _this7 . playing . timeout ) ;
2381
2367
removeClass ( list [ index ] , CLASS_IN ) ;
2382
2368
index -= 1 ;
2383
2369
index = index >= 0 ? index : total - 1 ;
2384
2370
addClass ( list [ index ] , CLASS_IN ) ;
2385
- _this7 . playing . timeout = setTimeout ( prev , options . interval ) ;
2371
+ _this7 . playing . timeout = setTimeout ( _prev , options . interval ) ;
2386
2372
} ;
2387
- var next = function next ( ) {
2373
+ var _next = function next ( ) {
2388
2374
clearTimeout ( _this7 . playing . timeout ) ;
2389
2375
removeClass ( list [ index ] , CLASS_IN ) ;
2390
2376
index += 1 ;
2391
2377
index = index < total ? index : 0 ;
2392
2378
addClass ( list [ index ] , CLASS_IN ) ;
2393
- _this7 . playing . timeout = setTimeout ( next , options . interval ) ;
2379
+ _this7 . playing . timeout = setTimeout ( _next , options . interval ) ;
2394
2380
} ;
2395
2381
if ( total > 1 ) {
2396
2382
this . playing = {
2397
- prev : prev ,
2398
- next : next ,
2399
- timeout : setTimeout ( next , options . interval )
2383
+ prev : _prev ,
2384
+ next : _next ,
2385
+ timeout : setTimeout ( _next , options . interval )
2400
2386
} ;
2401
2387
}
2402
2388
}
@@ -2968,7 +2954,7 @@ var Viewer = /*#__PURE__*/function () {
2968
2954
this . id = getUniqueID ( ) ;
2969
2955
this . init ( ) ;
2970
2956
}
2971
- _createClass ( Viewer , [ {
2957
+ return _createClass ( Viewer , [ {
2972
2958
key : "init" ,
2973
2959
value : function init ( ) {
2974
2960
var _this = this ;
@@ -3230,7 +3216,6 @@ var Viewer = /*#__PURE__*/function () {
3230
3216
assign ( DEFAULTS , isPlainObject ( options ) && options ) ;
3231
3217
}
3232
3218
} ] ) ;
3233
- return Viewer ;
3234
3219
} ( ) ;
3235
3220
assign ( Viewer . prototype , render , events , handlers , methods , others ) ;
3236
3221
0 commit comments