uikit 3.11.2-dev.57792c7e7 → 3.11.2-dev.72dbb9a19

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.
Files changed (171) hide show
  1. package/.eslintrc.json +4 -49
  2. package/.prettierignore +14 -0
  3. package/.prettierrc.json +13 -0
  4. package/.webstorm.js +3 -3
  5. package/CHANGELOG.md +21 -0
  6. package/build/.eslintrc.json +1 -3
  7. package/build/build.js +26 -28
  8. package/build/icons.js +7 -11
  9. package/build/less.js +48 -36
  10. package/build/package.json +2 -2
  11. package/build/prefix.js +21 -18
  12. package/build/publishDev.js +6 -8
  13. package/build/release.js +20 -17
  14. package/build/scope.js +21 -11
  15. package/build/scss.js +72 -39
  16. package/build/util.js +71 -62
  17. package/build/wrapper/icons.js +0 -2
  18. package/dist/css/uikit-core-rtl.css +42 -32
  19. package/dist/css/uikit-core-rtl.min.css +1 -1
  20. package/dist/css/uikit-core.css +42 -32
  21. package/dist/css/uikit-core.min.css +1 -1
  22. package/dist/css/uikit-rtl.css +42 -32
  23. package/dist/css/uikit-rtl.min.css +1 -1
  24. package/dist/css/uikit.css +42 -32
  25. package/dist/css/uikit.min.css +1 -1
  26. package/dist/js/components/countdown.js +88 -133
  27. package/dist/js/components/countdown.min.js +1 -1
  28. package/dist/js/components/filter.js +408 -439
  29. package/dist/js/components/filter.min.js +1 -1
  30. package/dist/js/components/lightbox-panel.js +1098 -1316
  31. package/dist/js/components/lightbox-panel.min.js +1 -1
  32. package/dist/js/components/lightbox.js +1144 -1393
  33. package/dist/js/components/lightbox.min.js +1 -1
  34. package/dist/js/components/notification.js +94 -114
  35. package/dist/js/components/notification.min.js +1 -1
  36. package/dist/js/components/parallax.js +297 -352
  37. package/dist/js/components/parallax.min.js +1 -1
  38. package/dist/js/components/slider-parallax.js +295 -340
  39. package/dist/js/components/slider-parallax.min.js +1 -1
  40. package/dist/js/components/slider.js +722 -852
  41. package/dist/js/components/slider.min.js +1 -1
  42. package/dist/js/components/slideshow-parallax.js +295 -340
  43. package/dist/js/components/slideshow-parallax.min.js +1 -1
  44. package/dist/js/components/slideshow.js +612 -802
  45. package/dist/js/components/slideshow.min.js +1 -1
  46. package/dist/js/components/sortable.js +587 -621
  47. package/dist/js/components/sortable.min.js +1 -1
  48. package/dist/js/components/tooltip.js +324 -356
  49. package/dist/js/components/tooltip.min.js +1 -1
  50. package/dist/js/components/upload.js +155 -167
  51. package/dist/js/components/upload.min.js +1 -1
  52. package/dist/js/uikit-core.js +5370 -6659
  53. package/dist/js/uikit-core.min.js +1 -1
  54. package/dist/js/uikit-icons.js +7 -9
  55. package/dist/js/uikit-icons.min.js +1 -1
  56. package/dist/js/uikit.js +7904 -9673
  57. package/dist/js/uikit.min.js +1 -1
  58. package/jsconfig.json +1 -1
  59. package/package.json +64 -60
  60. package/src/js/api/boot.js +25 -32
  61. package/src/js/api/component.js +15 -28
  62. package/src/js/api/global.js +6 -12
  63. package/src/js/api/hooks.js +14 -33
  64. package/src/js/api/instance.js +7 -15
  65. package/src/js/api/state.js +79 -100
  66. package/src/js/components/countdown.js +24 -50
  67. package/src/js/components/filter.js +70 -66
  68. package/src/js/components/index.js +13 -13
  69. package/src/js/components/internal/lightbox-animations.js +14 -25
  70. package/src/js/components/internal/slider-transitioner.js +66 -45
  71. package/src/js/components/internal/slideshow-animations.js +46 -64
  72. package/src/js/components/lightbox-panel.js +107 -105
  73. package/src/js/components/lightbox.js +17 -39
  74. package/src/js/components/notification.js +49 -43
  75. package/src/js/components/parallax.js +21 -46
  76. package/src/js/components/slider-parallax.js +13 -23
  77. package/src/js/components/slider.js +75 -64
  78. package/src/js/components/slideshow-parallax.js +1 -1
  79. package/src/js/components/slideshow.js +8 -13
  80. package/src/js/components/sortable.js +126 -108
  81. package/src/js/components/tooltip.js +41 -31
  82. package/src/js/components/upload.js +52 -63
  83. package/src/js/core/accordion.js +53 -48
  84. package/src/js/core/alert.js +9 -17
  85. package/src/js/core/core.js +74 -53
  86. package/src/js/core/cover.js +11 -15
  87. package/src/js/core/drop.js +107 -93
  88. package/src/js/core/form-custom.js +20 -25
  89. package/src/js/core/gif.js +3 -7
  90. package/src/js/core/grid.js +57 -58
  91. package/src/js/core/height-match.js +16 -29
  92. package/src/js/core/height-viewport.js +29 -36
  93. package/src/js/core/icon.js +38 -50
  94. package/src/js/core/img.js +59 -58
  95. package/src/js/core/index.js +39 -39
  96. package/src/js/core/leader.js +9 -18
  97. package/src/js/core/margin.js +21 -37
  98. package/src/js/core/modal.js +49 -36
  99. package/src/js/core/nav.js +2 -4
  100. package/src/js/core/navbar.js +113 -85
  101. package/src/js/core/offcanvas.js +49 -53
  102. package/src/js/core/overflow-auto.js +13 -17
  103. package/src/js/core/responsive.js +14 -12
  104. package/src/js/core/scroll.js +10 -20
  105. package/src/js/core/scrollspy-nav.js +34 -31
  106. package/src/js/core/scrollspy.js +37 -54
  107. package/src/js/core/sticky.js +187 -116
  108. package/src/js/core/svg.js +60 -79
  109. package/src/js/core/switcher.js +47 -46
  110. package/src/js/core/tab.js +7 -10
  111. package/src/js/core/toggle.js +64 -66
  112. package/src/js/core/video.js +11 -22
  113. package/src/js/mixin/animate.js +19 -20
  114. package/src/js/mixin/class.js +2 -4
  115. package/src/js/mixin/container.js +7 -11
  116. package/src/js/mixin/internal/animate-fade.js +73 -30
  117. package/src/js/mixin/internal/animate-slide.js +58 -41
  118. package/src/js/mixin/internal/slideshow-animations.js +7 -14
  119. package/src/js/mixin/internal/slideshow-transitioner.js +10 -17
  120. package/src/js/mixin/media.js +5 -10
  121. package/src/js/mixin/modal.js +89 -66
  122. package/src/js/mixin/parallax.js +80 -64
  123. package/src/js/mixin/position.js +26 -20
  124. package/src/js/mixin/slider-autoplay.js +12 -21
  125. package/src/js/mixin/slider-drag.js +64 -65
  126. package/src/js/mixin/slider-nav.js +26 -35
  127. package/src/js/mixin/slider-reactive.js +2 -8
  128. package/src/js/mixin/slider.js +48 -55
  129. package/src/js/mixin/slideshow.js +13 -19
  130. package/src/js/mixin/togglable.js +89 -63
  131. package/src/js/uikit-core.js +2 -4
  132. package/src/js/uikit.js +2 -4
  133. package/src/js/util/ajax.js +20 -39
  134. package/src/js/util/animation.js +77 -75
  135. package/src/js/util/attr.js +17 -21
  136. package/src/js/util/class.js +14 -52
  137. package/src/js/util/dimensions.js +76 -47
  138. package/src/js/util/dom.js +40 -73
  139. package/src/js/util/env.js +7 -12
  140. package/src/js/util/event.js +60 -59
  141. package/src/js/util/fastdom.js +3 -8
  142. package/src/js/util/filter.js +17 -34
  143. package/src/js/util/index.js +0 -1
  144. package/src/js/util/lang.js +81 -121
  145. package/src/js/util/mouse.js +19 -17
  146. package/src/js/util/options.js +35 -49
  147. package/src/js/util/player.js +40 -36
  148. package/src/js/util/position.js +54 -46
  149. package/src/js/util/selector.js +43 -58
  150. package/src/js/util/style.js +36 -46
  151. package/src/js/util/viewport.js +81 -66
  152. package/src/less/components/base.less +0 -5
  153. package/src/less/components/flex.less +0 -9
  154. package/src/less/components/leader.less +0 -1
  155. package/src/less/components/navbar.less +0 -7
  156. package/src/less/components/utility.less +22 -0
  157. package/src/scss/components/base.scss +0 -5
  158. package/src/scss/components/flex.scss +0 -9
  159. package/src/scss/components/form.scss +3 -3
  160. package/src/scss/components/icon.scss +2 -2
  161. package/src/scss/components/leader.scss +0 -1
  162. package/src/scss/components/navbar.scss +0 -7
  163. package/src/scss/components/search.scss +1 -1
  164. package/src/scss/components/utility.scss +22 -0
  165. package/src/scss/variables-theme.scss +6 -6
  166. package/src/scss/variables.scss +6 -6
  167. package/tests/js/index.js +114 -85
  168. package/tests/sticky-parallax.html +44 -41
  169. package/tests/sticky.html +56 -24
  170. package/src/js/mixin/flex-bug.js +0 -56
  171. package/src/js/util/promise.js +0 -191
@@ -1,6 +1,19 @@
1
1
  import Media from '../mixin/media';
2
- import {getMaxPathLength} from '../core/svg';
3
- import {css, Dimensions, each, isNumber, isString, isUndefined, noop, startsWith, toFloat, toPx, ucfirst} from 'uikit-util';
2
+ import { getMaxPathLength } from '../core/svg';
3
+ import {
4
+ css,
5
+ Dimensions,
6
+ each,
7
+ isNumber,
8
+ isString,
9
+ isUndefined,
10
+ noop,
11
+ startsWith,
12
+ toFloat,
13
+ toPx,
14
+ trigger,
15
+ ucfirst,
16
+ } from 'uikit-util';
4
17
 
5
18
  const props = {
6
19
  x: transformFn,
@@ -20,13 +33,12 @@ const props = {
20
33
  opacity: cssPropFn,
21
34
  stroke: strokeFn,
22
35
  bgx: backgroundFn,
23
- bgy: backgroundFn
36
+ bgy: backgroundFn,
24
37
  };
25
38
 
26
- const {keys} = Object;
39
+ const { keys } = Object;
27
40
 
28
41
  export default {
29
-
30
42
  mixins: [Media],
31
43
 
32
44
  props: fillObject(keys(props), 'list'),
@@ -34,38 +46,41 @@ export default {
34
46
  data: fillObject(keys(props), undefined),
35
47
 
36
48
  computed: {
37
-
38
49
  props(properties, $el) {
39
50
  return keys(props).reduce((result, prop) => {
40
51
  if (!isUndefined(properties[prop])) {
41
- result[prop] = props[prop].call(this, prop, $el, properties[prop].slice());
52
+ result[prop] = props[prop](prop, $el, properties[prop].slice());
42
53
  }
43
54
  return result;
44
55
  }, {});
45
- }
56
+ },
57
+ },
46
58
 
59
+ events: {
60
+ bgimageload() {
61
+ this.$emit();
62
+ },
47
63
  },
48
64
 
49
65
  methods: {
50
-
51
66
  reset() {
52
67
  each(this.getCss(0), (_, prop) => css(this.$el, prop, ''));
53
68
  },
54
69
 
55
70
  getCss(percent) {
56
- return keys(this.props).reduce((css, prop) => {
57
- this.props[prop](css, percent);
58
- return css;
59
- }, {transform: '', filter: ''});
60
- }
61
-
62
- }
63
-
71
+ return keys(this.props).reduce(
72
+ (css, prop) => {
73
+ this.props[prop](css, percent);
74
+ return css;
75
+ },
76
+ { transform: '', filter: '' }
77
+ );
78
+ },
79
+ },
64
80
  };
65
81
 
66
82
  function transformFn(prop, el, steps) {
67
-
68
- const unit = getUnit(steps) || {x: 'px', y: 'px', rotate: 'deg'}[prop] || '';
83
+ const unit = getUnit(steps) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
69
84
 
70
85
  if (prop === 'x' || prop === 'y') {
71
86
  prop = `translate${ucfirst(prop)}`;
@@ -89,20 +104,20 @@ function transformFn(prop, el, steps) {
89
104
  }
90
105
 
91
106
  function colorFn(prop, el, steps) {
92
-
93
107
  if (steps.length === 1) {
94
108
  steps.unshift(getCssValue(el, prop, ''));
95
109
  }
96
110
 
97
- steps = steps.map(step => parseColor(el, step));
111
+ steps = steps.map((step) => parseColor(el, step));
98
112
 
99
113
  return (css, percent) => {
100
-
101
114
  const [start, end, p] = getStep(steps, percent);
102
- const value = start.map((value, i) => {
103
- value += p * (end[i] - value);
104
- return i === 3 ? toFloat(value) : parseInt(value, 10);
105
- }).join(',');
115
+ const value = start
116
+ .map((value, i) => {
117
+ value += p * (end[i] - value);
118
+ return i === 3 ? toFloat(value) : parseInt(value, 10);
119
+ })
120
+ .join(',');
106
121
  css[prop] = `rgba(${value})`;
107
122
  };
108
123
  }
@@ -117,13 +132,12 @@ function parseColor(el, color) {
117
132
  }
118
133
 
119
134
  function filterFn(prop, el, steps) {
120
-
121
135
  if (steps.length === 1) {
122
136
  steps.unshift(0);
123
137
  }
124
138
 
125
- const unit = getUnit(steps) || {blur: 'px', hue: 'deg'}[prop] || '%';
126
- prop = {fopacity: 'opacity', hue: 'hue-rotate'}[prop] || prop;
139
+ const unit = getUnit(steps) || { blur: 'px', hue: 'deg' }[prop] || '%';
140
+ prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
127
141
  steps = steps.map(toFloat);
128
142
 
129
143
  return (css, percent) => {
@@ -133,7 +147,6 @@ function filterFn(prop, el, steps) {
133
147
  }
134
148
 
135
149
  function cssPropFn(prop, el, steps) {
136
-
137
150
  if (steps.length === 1) {
138
151
  steps.unshift(getCssValue(el, prop, ''));
139
152
  }
@@ -146,7 +159,6 @@ function cssPropFn(prop, el, steps) {
146
159
  }
147
160
 
148
161
  function strokeFn(prop, el, steps) {
149
-
150
162
  if (steps.length === 1) {
151
163
  steps.unshift(0);
152
164
  }
@@ -154,7 +166,7 @@ function strokeFn(prop, el, steps) {
154
166
  const unit = getUnit(steps);
155
167
  steps = steps.map(toFloat);
156
168
 
157
- if (!steps.some(step => step)) {
169
+ if (!steps.some((step) => step)) {
158
170
  return noop;
159
171
  }
160
172
 
@@ -162,7 +174,7 @@ function strokeFn(prop, el, steps) {
162
174
  css(el, 'strokeDasharray', length);
163
175
 
164
176
  if (unit === '%') {
165
- steps = steps.map(step => step * length / 100);
177
+ steps = steps.map((step) => (step * length) / 100);
166
178
  }
167
179
 
168
180
  steps = steps.reverse();
@@ -173,28 +185,25 @@ function strokeFn(prop, el, steps) {
173
185
  }
174
186
 
175
187
  function backgroundFn(prop, el, steps) {
176
-
177
188
  if (steps.length === 1) {
178
189
  steps.unshift(0);
179
190
  }
180
191
 
181
192
  prop = prop.substr(-1);
182
193
  const attr = prop === 'y' ? 'height' : 'width';
183
- steps = steps.map(step => toPx(step, attr, el));
194
+ steps = steps.map((step) => toPx(step, attr, el));
184
195
 
185
- css(el, `background-position-${prop}`, '');
186
- const bgPos = css(el, 'backgroundPosition').split(' ')[prop === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
196
+ const bgPos = getCssValue(el, `background-position-${prop}`, '');
187
197
 
188
198
  return getCssValue(el, 'backgroundSize', '') === 'cover'
189
- ? backgroundCoverFn.call(this, prop, el, steps, bgPos, attr)
199
+ ? backgroundCoverFn(prop, el, steps, bgPos, attr)
190
200
  : setBackgroundPosFn(prop, steps, bgPos);
191
201
  }
192
202
 
193
203
  function backgroundCoverFn(prop, el, steps, bgPos, attr) {
204
+ const dimImage = getBackgroundImageDimensions(el);
194
205
 
195
- const image = getBackgroundImage.call(this, el);
196
-
197
- if (!image.naturalWidth) {
206
+ if (!dimImage.width) {
198
207
  return noop;
199
208
  }
200
209
 
@@ -207,12 +216,7 @@ function backgroundCoverFn(prop, el, steps, bgPos, attr) {
207
216
 
208
217
  const dimEl = {
209
218
  width: el.offsetWidth,
210
- height: el.offsetHeight
211
- };
212
-
213
- const dimImage = {
214
- width: image.naturalWidth,
215
- height: image.naturalHeight
219
+ height: el.offsetHeight,
216
220
  };
217
221
 
218
222
  const baseDim = Dimensions.cover(dimImage, dimEl);
@@ -221,7 +225,6 @@ function backgroundCoverFn(prop, el, steps, bgPos, attr) {
221
225
  if (span < diff) {
222
226
  dimEl[attr] = baseDim[attr] + diff - span;
223
227
  } else if (span > diff) {
224
-
225
228
  const posPercentage = dimEl[attr] / toPx(bgPos, attr, el, true);
226
229
 
227
230
  if (posPercentage) {
@@ -245,24 +248,34 @@ function setBackgroundPosFn(prop, steps, pos) {
245
248
  };
246
249
  }
247
250
 
248
- function getBackgroundImage(el) {
251
+ const dimensions = {};
252
+ function getBackgroundImageDimensions(el) {
249
253
  const src = css(el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
250
254
 
251
- const data = this._data;
252
-
253
- if (data[src]) {
254
- return data[src];
255
+ if (dimensions[src]) {
256
+ return dimensions[src];
255
257
  }
256
258
 
259
+ const image = new Image();
257
260
  if (src) {
258
- const img = new Image();
259
- img.src = src;
260
- if (!img.naturalWidth) {
261
- img.onload = () => this.$update();
262
- }
261
+ image.src = src;
263
262
 
264
- return data[src] = img;
263
+ if (!image.naturalWidth) {
264
+ image.onload = () => {
265
+ dimensions[src] = toDimensions(image);
266
+ trigger(el, 'bgimageload');
267
+ };
268
+ }
265
269
  }
270
+
271
+ return (dimensions[src] = toDimensions(image));
272
+ }
273
+
274
+ function toDimensions(image) {
275
+ return {
276
+ width: image.naturalWidth,
277
+ height: image.naturalHeight,
278
+ };
266
279
  }
267
280
 
268
281
  function getStep(steps, percent) {
@@ -271,18 +284,21 @@ function getStep(steps, percent) {
271
284
 
272
285
  return steps
273
286
  .slice(index, index + 2)
274
- .concat(percent === 1 ? 1 : percent % (1 / count) * count);
287
+ .concat(percent === 1 ? 1 : (percent % (1 / count)) * count);
275
288
  }
276
289
 
277
290
  function getValue(steps, percent) {
278
291
  const [start, end, p] = getStep(steps, percent);
279
- return isNumber(start)
280
- ? start + Math.abs(start - end) * p * (start < end ? 1 : -1)
281
- : +end;
292
+ return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
282
293
  }
283
294
 
284
295
  function getUnit(steps, defaultUnit) {
285
- return steps.reduce((unit, step) => unit || isString(step) && step.replace(/[\d-]/g, '').trim(), '') || defaultUnit;
296
+ return (
297
+ steps.reduce(
298
+ (unit, step) => unit || (isString(step) && step.replace(/[\d-]/g, '').trim()),
299
+ ''
300
+ ) || defaultUnit
301
+ );
286
302
  }
287
303
 
288
304
  function getCssValue(el, prop, value) {
@@ -1,24 +1,31 @@
1
- import {$, flipPosition, offset as getOffset, isNumeric, isRtl, positionAt, removeClasses, toggleClass} from 'uikit-util';
1
+ import {
2
+ $,
3
+ flipPosition,
4
+ offset as getOffset,
5
+ isNumeric,
6
+ isRtl,
7
+ positionAt,
8
+ removeClasses,
9
+ toggleClass,
10
+ } from 'uikit-util';
2
11
 
3
12
  export default {
4
-
5
13
  props: {
6
14
  pos: String,
7
15
  offset: null,
8
16
  flip: Boolean,
9
- clsPos: String
17
+ clsPos: String,
10
18
  },
11
19
 
12
20
  data: {
13
21
  pos: `bottom-${isRtl ? 'right' : 'left'}`,
14
22
  flip: true,
15
23
  offset: false,
16
- clsPos: ''
24
+ clsPos: '',
17
25
  },
18
26
 
19
27
  computed: {
20
-
21
- pos({pos}) {
28
+ pos({ pos }) {
22
29
  return pos.split('-').concat('center').slice(0, 2);
23
30
  },
24
31
 
@@ -28,32 +35,34 @@ export default {
28
35
 
29
36
  align() {
30
37
  return this.pos[1];
31
- }
32
-
38
+ },
33
39
  },
34
40
 
35
41
  methods: {
36
-
37
42
  positionAt(element, target, boundary) {
38
-
39
43
  removeClasses(element, `${this.clsPos}-(top|bottom|left|right)(-[a-z]+)?`);
40
44
 
41
- let {offset} = this;
45
+ let { offset } = this;
42
46
  const axis = this.getAxis();
43
47
 
44
48
  if (!isNumeric(offset)) {
45
49
  const node = $(offset);
46
50
  offset = node
47
- ? getOffset(node)[axis === 'x' ? 'left' : 'top'] - getOffset(target)[axis === 'x' ? 'right' : 'bottom']
51
+ ? getOffset(node)[axis === 'x' ? 'left' : 'top'] -
52
+ getOffset(target)[axis === 'x' ? 'right' : 'bottom']
48
53
  : 0;
49
54
  }
50
55
 
51
- const {x, y} = positionAt(
56
+ const { x, y } = positionAt(
52
57
  element,
53
58
  target,
54
- axis === 'x' ? `${flipPosition(this.dir)} ${this.align}` : `${this.align} ${flipPosition(this.dir)}`,
59
+ axis === 'x'
60
+ ? `${flipPosition(this.dir)} ${this.align}`
61
+ : `${this.align} ${flipPosition(this.dir)}`,
55
62
  axis === 'x' ? `${this.dir} ${this.align}` : `${this.align} ${this.dir}`,
56
- axis === 'x' ? `${this.dir === 'left' ? -offset : offset}` : ` ${this.dir === 'top' ? -offset : offset}`,
63
+ axis === 'x'
64
+ ? `${this.dir === 'left' ? -offset : offset}`
65
+ : ` ${this.dir === 'top' ? -offset : offset}`,
57
66
  null,
58
67
  this.flip,
59
68
  boundary
@@ -63,13 +72,10 @@ export default {
63
72
  this.align = axis === 'x' ? y : x;
64
73
 
65
74
  toggleClass(element, `${this.clsPos}-${this.dir}-${this.align}`, this.offset === false);
66
-
67
75
  },
68
76
 
69
77
  getAxis() {
70
78
  return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
71
- }
72
-
73
- }
74
-
79
+ },
80
+ },
75
81
  };
@@ -1,17 +1,16 @@
1
- import {$, attr, matches} from 'uikit-util';
1
+ import { $, attr, matches } from 'uikit-util';
2
2
 
3
3
  export default {
4
-
5
4
  props: {
6
5
  autoplay: Boolean,
7
6
  autoplayInterval: Number,
8
- pauseOnHover: Boolean
7
+ pauseOnHover: Boolean,
9
8
  },
10
9
 
11
10
  data: {
12
11
  autoplay: false,
13
12
  autoplayInterval: 7000,
14
- pauseOnHover: true
13
+ pauseOnHover: true,
15
14
  },
16
15
 
17
16
  connected() {
@@ -27,9 +26,7 @@ export default {
27
26
  },
28
27
 
29
28
  events: [
30
-
31
29
  {
32
-
33
30
  name: 'visibilitychange',
34
31
 
35
32
  el() {
@@ -46,32 +43,26 @@ export default {
46
43
  } else {
47
44
  this.startAutoplay();
48
45
  }
49
- }
50
-
51
- }
52
-
46
+ },
47
+ },
53
48
  ],
54
49
 
55
50
  methods: {
56
-
57
51
  startAutoplay() {
58
-
59
52
  this.stopAutoplay();
60
53
 
61
54
  this.interval = setInterval(
62
- () => (!this.draggable || !$(':focus', this.$el))
63
- && (!this.pauseOnHover || !matches(this.$el, ':hover'))
64
- && !this.stack.length
65
- && this.show('next'),
55
+ () =>
56
+ (!this.draggable || !$(':focus', this.$el)) &&
57
+ (!this.pauseOnHover || !matches(this.$el, ':hover')) &&
58
+ !this.stack.length &&
59
+ this.show('next'),
66
60
  this.autoplayInterval
67
61
  );
68
-
69
62
  },
70
63
 
71
64
  stopAutoplay() {
72
65
  this.interval && clearInterval(this.interval);
73
- }
74
-
75
- }
76
-
66
+ },
67
+ },
77
68
  };