uikit 3.11.2-dev.44c622843 → 3.11.2-dev.536e1a374

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 (154) hide show
  1. package/CHANGELOG.md +40 -19
  2. package/dist/css/uikit-core-rtl.css +97 -190
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +97 -190
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +99 -196
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +99 -196
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +24 -51
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +6 -8
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +30 -69
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +31 -71
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +117 -80
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +117 -80
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +87 -58
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +117 -80
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +43 -29
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +5 -7
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +3 -3
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +2 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +600 -508
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +857 -764
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/component.js +2 -11
  44. package/src/js/api/hooks.js +3 -3
  45. package/src/js/api/state.js +173 -140
  46. package/src/js/components/countdown.js +24 -51
  47. package/src/js/components/filter.js +2 -3
  48. package/src/js/components/internal/lightbox-animations.js +4 -3
  49. package/src/js/components/internal/slider-preload.js +9 -0
  50. package/src/js/components/internal/slideshow-animations.js +4 -3
  51. package/src/js/components/lightbox-panel.js +34 -58
  52. package/src/js/components/lightbox.js +1 -2
  53. package/src/js/components/slider.js +60 -43
  54. package/src/js/components/slideshow.js +8 -1
  55. package/src/js/components/sortable.js +1 -1
  56. package/src/js/components/upload.js +2 -1
  57. package/src/js/core/accordion.js +6 -1
  58. package/src/js/core/alert.js +1 -2
  59. package/src/js/core/core.js +2 -75
  60. package/src/js/core/cover.js +5 -1
  61. package/src/js/core/drop.js +3 -1
  62. package/src/js/core/form-custom.js +2 -2
  63. package/src/js/core/height-viewport.js +3 -0
  64. package/src/js/core/icon.js +13 -6
  65. package/src/js/core/img.js +131 -122
  66. package/src/js/core/modal.js +1 -2
  67. package/src/js/core/navbar.js +3 -3
  68. package/src/js/core/offcanvas.js +2 -1
  69. package/src/js/core/sticky.js +51 -57
  70. package/src/js/core/svg.js +10 -6
  71. package/src/js/core/switcher.js +11 -3
  72. package/src/js/core/toggle.js +5 -2
  73. package/src/js/core/video.js +13 -1
  74. package/src/js/mixin/internal/animate-slide.js +9 -12
  75. package/src/js/mixin/lazyload.js +20 -0
  76. package/src/js/mixin/parallax.js +118 -81
  77. package/src/js/mixin/slider.js +8 -22
  78. package/src/js/mixin/slideshow.js +2 -6
  79. package/src/js/mixin/swipe.js +72 -0
  80. package/src/js/mixin/togglable.js +2 -3
  81. package/src/js/util/ajax.js +15 -14
  82. package/src/js/util/animation.js +7 -12
  83. package/src/js/util/dimensions.js +4 -4
  84. package/src/js/util/dom.js +22 -33
  85. package/src/js/util/filter.js +1 -2
  86. package/src/js/util/index.js +1 -0
  87. package/src/js/util/lang.js +7 -6
  88. package/src/js/util/observer.js +36 -0
  89. package/src/js/util/options.js +2 -11
  90. package/src/js/util/player.js +5 -4
  91. package/src/js/util/selector.js +12 -18
  92. package/src/js/util/style.js +4 -4
  93. package/src/less/components/base.less +10 -33
  94. package/src/less/components/form-range.less +48 -95
  95. package/src/less/components/form.less +0 -1
  96. package/src/less/components/height.less +3 -0
  97. package/src/less/components/leader.less +0 -1
  98. package/src/less/components/lightbox.less +0 -1
  99. package/src/less/components/modal.less +3 -7
  100. package/src/less/components/progress.less +14 -36
  101. package/src/less/components/slider.less +0 -3
  102. package/src/less/components/slideshow.less +0 -3
  103. package/src/less/components/text.less +16 -32
  104. package/src/less/components/utility.less +6 -3
  105. package/src/scss/components/base.scss +10 -33
  106. package/src/scss/components/form-range.scss +48 -95
  107. package/src/scss/components/form.scss +0 -1
  108. package/src/scss/components/height.scss +3 -0
  109. package/src/scss/components/leader.scss +0 -1
  110. package/src/scss/components/lightbox.scss +0 -1
  111. package/src/scss/components/modal.scss +3 -7
  112. package/src/scss/components/progress.scss +14 -36
  113. package/src/scss/components/slider.scss +0 -3
  114. package/src/scss/components/slideshow.scss +0 -3
  115. package/src/scss/components/text.scss +16 -32
  116. package/src/scss/components/utility.scss +6 -3
  117. package/src/scss/mixins-theme.scss +1 -1
  118. package/src/scss/mixins.scss +1 -1
  119. package/src/scss/variables-theme.scss +3 -3
  120. package/src/scss/variables.scss +3 -3
  121. package/tests/align.html +10 -10
  122. package/tests/animation.html +2 -2
  123. package/tests/article.html +2 -2
  124. package/tests/base.html +3 -3
  125. package/tests/card.html +10 -10
  126. package/tests/column.html +3 -3
  127. package/tests/comment.html +9 -9
  128. package/tests/countdown.html +10 -8
  129. package/tests/dotnav.html +3 -3
  130. package/tests/image.html +296 -64
  131. package/tests/images/image-type.avif +0 -0
  132. package/tests/images/image-type.jpeg +0 -0
  133. package/tests/images/image-type.webp +0 -0
  134. package/tests/index.html +8 -8
  135. package/tests/lightbox.html +10 -10
  136. package/tests/marker.html +2 -2
  137. package/tests/modal.html +8 -9
  138. package/tests/navbar.html +2 -2
  139. package/tests/overlay.html +7 -7
  140. package/tests/parallax.html +16 -7
  141. package/tests/position.html +12 -12
  142. package/tests/slidenav.html +12 -12
  143. package/tests/slider.html +20 -20
  144. package/tests/sortable.html +1 -1
  145. package/tests/sticky-parallax.html +56 -71
  146. package/tests/svg.html +6 -6
  147. package/tests/table.html +11 -11
  148. package/tests/thumbnav.html +12 -12
  149. package/tests/transition.html +30 -30
  150. package/tests/utility.html +50 -33
  151. package/tests/video.html +1 -1
  152. package/tests/width.html +1 -1
  153. package/src/js/util/promise.js +0 -0
  154. package/tests/images/animated.gif +0 -0
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.44c622843 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.536e1a374 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -29,19 +29,19 @@
29
29
  }
30
30
 
31
31
  function startsWith(str, search) {
32
- return str.startsWith(search);
32
+ return str == null ? void 0 : str.startsWith == null ? void 0 : str.startsWith(search);
33
33
  }
34
34
 
35
35
  function endsWith(str, search) {
36
- return str.endsWith(search);
36
+ return str == null ? void 0 : str.endsWith == null ? void 0 : str.endsWith(search);
37
37
  }
38
38
 
39
39
  function includes(obj, search) {
40
- return obj && obj.includes(search);
40
+ return obj == null ? void 0 : obj.includes == null ? void 0 : obj.includes(search);
41
41
  }
42
42
 
43
43
  function findIndex(array, predicate) {
44
- return array.findIndex(predicate);
44
+ return array == null ? void 0 : array.findIndex == null ? void 0 : array.findIndex(predicate);
45
45
  }
46
46
 
47
47
  const { isArray, from: toArray } = Array;
@@ -130,14 +130,15 @@
130
130
  return element && (isNode(element) ? [element] : Array.from(element).filter(isNode)) || [];
131
131
  }
132
132
 
133
- function toWindow(element) {
133
+ function toWindow(element) {var _element;
134
134
  if (isWindow(element)) {
135
135
  return element;
136
136
  }
137
137
 
138
138
  element = toNode(element);
139
+ const document = isDocument(element) ? element : (_element = element) == null ? void 0 : _element.ownerDocument;
139
140
 
140
- return element ? (isDocument(element) ? element : element.ownerDocument).defaultView : window;
141
+ return (document == null ? void 0 : document.defaultView) || window;
141
142
  }
142
143
 
143
144
  function toMs(time) {
@@ -224,7 +225,7 @@
224
225
  },
225
226
 
226
227
  contain(dimensions, maxDimensions) {
227
- dimensions = assign({}, dimensions);
228
+ dimensions = { ...dimensions };
228
229
 
229
230
  each(
230
231
  dimensions,
@@ -339,19 +340,6 @@
339
340
  }
340
341
  }
341
342
 
342
- const inBrowser = typeof window !== 'undefined';
343
- const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
344
-
345
- const hasTouch = inBrowser && 'ontouchstart' in window;
346
- const hasPointerEvents = inBrowser && window.PointerEvent;
347
-
348
- const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
349
- const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
350
- const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
351
- const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
352
- const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
353
- const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
354
-
355
343
  const voidElements = {
356
344
  area: true,
357
345
  base: true,
@@ -390,9 +378,8 @@
390
378
  return matches(element, selFocusable);
391
379
  }
392
380
 
393
- function parent(element) {
394
- element = toNode(element);
395
- return element && isElement(element.parentNode) && element.parentNode;
381
+ function parent(element) {var _toNode;
382
+ return (_toNode = toNode(element)) == null ? void 0 : _toNode.parentElement;
396
383
  }
397
384
 
398
385
  function filter$1(element, selector) {
@@ -451,12 +438,6 @@
451
438
  return findAll(selector, getContext(selector, context));
452
439
  }
453
440
 
454
- function getContext(selector, context) {if (context === void 0) {context = document;}
455
- return isString(selector) && isContextSelector(selector) || isDocument(context) ?
456
- context :
457
- context.ownerDocument;
458
- }
459
-
460
441
  function find(selector, context) {
461
442
  return toNode(_query(selector, context, 'querySelector'));
462
443
  }
@@ -465,6 +446,17 @@
465
446
  return toNodes(_query(selector, context, 'querySelectorAll'));
466
447
  }
467
448
 
449
+ const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
450
+ const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
451
+
452
+ function getContext(selector, context) {if (context === void 0) {context = document;}
453
+ return isString(selector) && isContextSelector(selector) || isDocument(context) ?
454
+ context :
455
+ context.ownerDocument;
456
+ }
457
+
458
+ const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
459
+
468
460
  function _query(selector, context, queryFn) {if (context === void 0) {context = document;}
469
461
  if (!selector || !isString(selector)) {
470
462
  return selector;
@@ -509,11 +501,6 @@
509
501
  }
510
502
  }
511
503
 
512
- const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
513
- const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
514
-
515
- const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
516
-
517
504
  const selectorRe = /.*?[^\\](?:,|$)/g;
518
505
 
519
506
  const splitSelector = memoize((selector) =>
@@ -539,13 +526,8 @@
539
526
  return names.join(' > ');
540
527
  }
541
528
 
542
- const escapeFn =
543
- inBrowser && window.CSS && CSS.escape ||
544
- function (css) {
545
- return css.replace(/([^\x7f-\uFFFF\w-])/g, (match) => "\\" + match);
546
- };
547
529
  function escape(css) {
548
- return isString(css) ? escapeFn.call(null, css) : '';
530
+ return isString(css) ? CSS.escape(css) : '';
549
531
  }
550
532
 
551
533
  function on() {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}
@@ -688,17 +670,14 @@
688
670
  }
689
671
 
690
672
  function ajax(url, options) {
691
- const env = assign(
692
- {
673
+ const env = {
693
674
  data: null,
694
675
  method: 'GET',
695
676
  headers: {},
696
677
  xhr: new XMLHttpRequest(),
697
678
  beforeSend: noop,
698
- responseType: '' },
699
-
700
- options);
701
-
679
+ responseType: '',
680
+ ...options };
702
681
 
703
682
  return Promise.resolve().
704
683
  then(() => env.beforeSend(env)).
@@ -749,8 +728,12 @@
749
728
  return new Promise((resolve, reject) => {
750
729
  const img = new Image();
751
730
 
752
- img.onerror = (e) => reject(e);
753
- img.onload = () => resolve(img);
731
+ img.onerror = (e) => {
732
+ reject(e);
733
+ };
734
+ img.onload = () => {
735
+ resolve(img);
736
+ };
754
737
 
755
738
  sizes && (img.sizes = sizes);
756
739
  srcset && (img.srcset = srcset);
@@ -777,7 +760,8 @@
777
760
 
778
761
 
779
762
  function css(element, property, value, priority) {if (priority === void 0) {priority = '';}
780
- return toNodes(element).map((element) => {
763
+ const elements = toNodes(element);
764
+ for (const element of elements) {
781
765
  if (isString(property)) {
782
766
  property = propName(property);
783
767
 
@@ -803,9 +787,8 @@
803
787
  priority = value;
804
788
  each(property, (value, property) => css(element, property, value, priority));
805
789
  }
806
-
807
- return element;
808
- })[0];
790
+ }
791
+ return elements[0];
809
792
  }
810
793
 
811
794
  function getStyles(element, pseudoElt) {
@@ -932,16 +915,11 @@
932
915
 
933
916
 
934
917
  addClass(element, 'uk-transition');
935
- css(
936
- element,
937
- assign(
938
- {
918
+ css(element, {
939
919
  transitionProperty: Object.keys(props).map(propName).join(','),
940
920
  transitionDuration: duration + "ms",
941
- transitionTimingFunction: timing },
942
-
943
- props));
944
-
921
+ transitionTimingFunction: timing,
922
+ ...props });
945
923
 
946
924
  })));
947
925
 
@@ -1041,8 +1019,8 @@
1041
1019
  const currentOffset = dimensions$1(element);
1042
1020
 
1043
1021
  if (element) {
1044
- const { pageYOffset, pageXOffset } = toWindow(element);
1045
- const offsetBy = { height: pageYOffset, width: pageXOffset };
1022
+ const { scrollY, scrollX } = toWindow(element);
1023
+ const offsetBy = { height: scrollY, width: scrollX };
1046
1024
 
1047
1025
  for (const dir in dirs$1) {
1048
1026
  for (const i in dirs$1[dir]) {
@@ -1108,8 +1086,8 @@
1108
1086
 
1109
1087
  if (css(element, 'position') === 'fixed') {
1110
1088
  const win = toWindow(element);
1111
- offset[0] += win.pageYOffset;
1112
- offset[1] += win.pageXOffset;
1089
+ offset[0] += win.scrollY;
1090
+ offset[1] += win.scrollX;
1113
1091
  return offset;
1114
1092
  }
1115
1093
  } while (element = element.offsetParent);
@@ -1200,8 +1178,8 @@
1200
1178
 
1201
1179
  const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
1202
1180
  const parseCalc = memoize((calc) => calc.toString().replace(/\s/g, '').match(calcRe) || []);
1203
- const unitRe = /(?:v[hw]|%)$/;
1204
- const parseUnit = memoize((str) => (str.match(unitRe) || [])[0]);
1181
+ const unitRe$1 = /(?:v[hw]|%)$/;
1182
+ const parseUnit = memoize((str) => (str.match(unitRe$1) || [])[0]);
1205
1183
 
1206
1184
  function percent(base, value) {
1207
1185
  return base * toFloat(value) / 100;
@@ -1216,6 +1194,10 @@
1216
1194
  once(document, 'DOMContentLoaded', fn);
1217
1195
  }
1218
1196
 
1197
+ function isTag(element, tagName) {var _element$tagName;
1198
+ return (element == null ? void 0 : (_element$tagName = element.tagName) == null ? void 0 : _element$tagName.toLowerCase()) === tagName.toLowerCase();
1199
+ }
1200
+
1219
1201
  function empty(element) {
1220
1202
  return replaceChildren(element, '');
1221
1203
  }
@@ -1224,34 +1206,18 @@
1224
1206
  return isUndefined(html) ? $(parent).innerHTML : replaceChildren(parent, html);
1225
1207
  }
1226
1208
 
1227
- function replaceChildren(parent, element) {
1228
- const nodes = $$(element);
1229
- $(parent).replaceChildren(...nodes);
1230
- return nodes;
1231
- }
1232
-
1233
- function prepend(parent, element) {
1234
- const nodes = $$(element);
1235
- $(parent).prepend(...nodes);
1236
- return nodes;
1237
- }
1238
-
1239
- function append(parent, element) {
1240
- const nodes = $$(element);
1241
- $(parent).append(...nodes);
1242
- return nodes;
1243
- }
1244
-
1245
- function before(ref, element) {
1246
- const nodes = $$(element);
1247
- $(ref).before(...nodes);
1248
- return nodes;
1249
- }
1209
+ const replaceChildren = applyFn('replaceChildren');
1210
+ const prepend = applyFn('prepend');
1211
+ const append = applyFn('append');
1212
+ const before = applyFn('before');
1213
+ const after = applyFn('after');
1250
1214
 
1251
- function after(ref, element) {
1252
- const nodes = $$(element);
1253
- $(ref).after(...nodes);
1254
- return nodes;
1215
+ function applyFn(fn) {
1216
+ return function (ref, element) {var _$;
1217
+ const nodes = toNodes(isString(element) ? fragment(element) : element);
1218
+ (_$ = $(ref)) == null ? void 0 : _$[fn](...nodes);
1219
+ return unwrapSingle(nodes);
1220
+ };
1255
1221
  }
1256
1222
 
1257
1223
  function remove$1(element) {
@@ -1273,7 +1239,7 @@
1273
1239
  function wrapInner(element, structure) {
1274
1240
  return toNodes(
1275
1241
  toNodes(element).map((element) =>
1276
- element.hasChildNodes ?
1242
+ element.hasChildNodes() ?
1277
1243
  wrapAll(toNodes(element.childNodes), structure) :
1278
1244
  append(element, structure)));
1279
1245
 
@@ -1284,10 +1250,7 @@
1284
1250
  toNodes(element).
1285
1251
  map(parent).
1286
1252
  filter((value, index, self) => self.indexOf(value) === index).
1287
- forEach((parent) => {
1288
- before(parent, parent.childNodes);
1289
- remove$1(parent);
1290
- });
1253
+ forEach((parent) => parent.replaceWith(...parent.childNodes));
1291
1254
  }
1292
1255
 
1293
1256
  const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
@@ -1306,7 +1269,11 @@
1306
1269
  container.textContent = html;
1307
1270
  }
1308
1271
 
1309
- return container.childNodes.length > 1 ? toNodes(container.childNodes) : container.firstChild;
1272
+ return unwrapSingle(container.childNodes);
1273
+ }
1274
+
1275
+ function unwrapSingle(nodes) {
1276
+ return nodes.length > 1 ? nodes : nodes[0];
1310
1277
  }
1311
1278
 
1312
1279
  function apply(node, fn) {
@@ -1335,6 +1302,19 @@
1335
1302
  return isString(str) && startsWith(str.trim(), '<');
1336
1303
  }
1337
1304
 
1305
+ const inBrowser = typeof window !== 'undefined';
1306
+ const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
1307
+
1308
+ const hasTouch = inBrowser && 'ontouchstart' in window;
1309
+ const hasPointerEvents = inBrowser && window.PointerEvent;
1310
+
1311
+ const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1312
+ const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1313
+ const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
1314
+ const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
1315
+ const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
1316
+ const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
1317
+
1338
1318
  /*
1339
1319
  Based on:
1340
1320
  Copyright (c) 2016 Wilson Page wilsonpage@me.com
@@ -1487,6 +1467,41 @@
1487
1467
  return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };
1488
1468
  }
1489
1469
 
1470
+ // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
1471
+ const hasIntersectionObserver =
1472
+ window.IntersectionObserver && 'isIntersecting' in IntersectionObserverEntry.prototype;
1473
+ function observeIntersection(targets, cb, options, intersecting) {if (intersecting === void 0) {intersecting = true;}
1474
+ if (!hasIntersectionObserver) {
1475
+ return;
1476
+ }
1477
+
1478
+ const observer = new IntersectionObserver((entries, observer) => {
1479
+ if (!intersecting || entries.some((entry) => entry.isIntersecting)) {
1480
+ cb(entries, observer);
1481
+ }
1482
+ }, options);
1483
+ for (const el of toNodes(targets)) {
1484
+ observer.observe(el);
1485
+ }
1486
+ return observer;
1487
+ }
1488
+
1489
+ const hasResizeObserver = window.ResizeObserver;
1490
+ function observeResize(targets, cb, options) {if (options === void 0) {options = { box: 'border-box' };}
1491
+ if (!hasResizeObserver) {
1492
+ return;
1493
+ }
1494
+
1495
+ const observer = new ResizeObserver((entries, observer) => {
1496
+ cb(entries, observer);
1497
+ });
1498
+ for (const el of toNodes(targets)) {
1499
+ observer.observe(el, options);
1500
+ }
1501
+
1502
+ return observer;
1503
+ }
1504
+
1490
1505
  const strats = {};
1491
1506
 
1492
1507
  strats.events =
@@ -1526,7 +1541,7 @@
1526
1541
 
1527
1542
  // extend strategy
1528
1543
  strats.computed = strats.methods = function (parentVal, childVal) {
1529
- return childVal ? parentVal ? assign({}, parentVal, childVal) : childVal : parentVal;
1544
+ return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
1530
1545
  };
1531
1546
 
1532
1547
  // data strategy
@@ -1666,11 +1681,11 @@
1666
1681
  }
1667
1682
 
1668
1683
  function isHTML5(el) {
1669
- return (el == null ? void 0 : el.tagName) === 'VIDEO';
1684
+ return isTag(el, 'video');
1670
1685
  }
1671
1686
 
1672
1687
  function isIFrame(el) {
1673
- return (el == null ? void 0 : el.tagName) === 'IFRAME' && (isYoutube(el) || isVimeo(el));
1688
+ return isTag(el, 'iframe') && (isYoutube(el) || isVimeo(el));
1674
1689
  }
1675
1690
 
1676
1691
  function isYoutube(el) {
@@ -1690,7 +1705,7 @@
1690
1705
 
1691
1706
  function post(el, cmd) {
1692
1707
  try {
1693
- el.contentWindow.postMessage(JSON.stringify(assign({ event: 'command' }, cmd)), '*');
1708
+ el.contentWindow.postMessage(JSON.stringify({ event: 'command', ...cmd }), '*');
1694
1709
  } catch (e) {
1695
1710
  // noop
1696
1711
  }
@@ -2070,6 +2085,7 @@
2070
2085
  flipPosition: flipPosition,
2071
2086
  toPx: toPx,
2072
2087
  ready: ready,
2088
+ isTag: isTag,
2073
2089
  empty: empty,
2074
2090
  html: html,
2075
2091
  replaceChildren: replaceChildren,
@@ -2163,6 +2179,9 @@
2163
2179
  memoize: memoize,
2164
2180
  Deferred: Deferred,
2165
2181
  MouseTracker: MouseTracker,
2182
+ hasIntersectionObserver: hasIntersectionObserver,
2183
+ observeIntersection: observeIntersection,
2184
+ observeResize: observeResize,
2166
2185
  mergeOptions: mergeOptions,
2167
2186
  parseOptions: parseOptions,
2168
2187
  play: play,
@@ -2340,8 +2359,8 @@
2340
2359
  };
2341
2360
 
2342
2361
  function runUpdates(types) {
2343
- for (const { read, write, events } of this.$options.update) {
2344
- if (!types.has('update') && (!events || !events.some((type) => types.has(type)))) {
2362
+ for (const { read, write, events = [] } of this.$options.update) {
2363
+ if (!types.has('update') && !events.some((type) => types.has(type))) {
2345
2364
  continue;
2346
2365
  }
2347
2366
 
@@ -2364,7 +2383,7 @@
2364
2383
  const {
2365
2384
  $options: { computed } } =
2366
2385
  this;
2367
- const values = assign({}, this._computeds);
2386
+ const values = { ...this._computeds };
2368
2387
  this._computeds = {};
2369
2388
 
2370
2389
  for (const key in computed) {
@@ -2435,7 +2454,7 @@
2435
2454
  UIkit.prototype._initProps = function (props) {
2436
2455
  let key;
2437
2456
 
2438
- props = props || getProps(this.$options, this.$name);
2457
+ props = props || getProps$1(this.$options, this.$name);
2439
2458
 
2440
2459
  for (key in props) {
2441
2460
  if (!isUndefined(props[key])) {
@@ -2462,204 +2481,236 @@
2462
2481
  }
2463
2482
  }
2464
2483
  }
2484
+ for (const { events = [] } of this.$options.update || []) {
2485
+ if (includes(events, 'scroll')) {
2486
+ registerScrollListener(this._uid, () => this.$emit('scroll'));
2487
+ break;
2488
+ }
2489
+ }
2465
2490
  };
2466
2491
 
2467
2492
  UIkit.prototype._unbindEvents = function () {
2468
2493
  this._events.forEach((unbind) => unbind());
2469
2494
  delete this._events;
2495
+ unregisterScrollListener(this._uid);
2470
2496
  };
2471
2497
 
2472
2498
  UIkit.prototype._initObservers = function () {
2473
2499
  this._observers = [initChildListObserver(this), initPropsObserver(this)];
2474
2500
  };
2475
2501
 
2502
+ UIkit.prototype.registerObserver = function (observer) {
2503
+ this._observers.push(observer);
2504
+ };
2505
+
2476
2506
  UIkit.prototype._disconnectObservers = function () {
2477
2507
  this._observers.forEach((observer) => observer == null ? void 0 : observer.disconnect());
2478
2508
  };
2509
+ }
2479
2510
 
2480
- function getProps(opts, name) {
2481
- const data$1 = {};
2482
- const { args = [], props = {}, el } = opts;
2483
-
2484
- if (!props) {
2485
- return data$1;
2486
- }
2511
+ function getProps$1(opts, name) {
2512
+ const data$1 = {};
2513
+ const { args = [], props = {}, el } = opts;
2487
2514
 
2488
- for (const key in props) {
2489
- const prop = hyphenate(key);
2490
- let value = data(el, prop);
2515
+ if (!props) {
2516
+ return data$1;
2517
+ }
2491
2518
 
2492
- if (isUndefined(value)) {
2493
- continue;
2494
- }
2519
+ for (const key in props) {
2520
+ const prop = hyphenate(key);
2521
+ let value = data(el, prop);
2495
2522
 
2496
- value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
2523
+ if (isUndefined(value)) {
2524
+ continue;
2525
+ }
2497
2526
 
2498
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2499
- continue;
2500
- }
2527
+ value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
2501
2528
 
2502
- data$1[key] = value;
2529
+ if (prop === 'target' && (!value || startsWith(value, '_'))) {
2530
+ continue;
2503
2531
  }
2504
2532
 
2505
- const options = parseOptions(data(el, name), args);
2533
+ data$1[key] = value;
2534
+ }
2506
2535
 
2507
- for (const key in options) {
2508
- const prop = camelize(key);
2509
- if (props[prop] !== undefined) {
2510
- data$1[prop] = coerce(props[prop], options[key]);
2511
- }
2512
- }
2536
+ const options = parseOptions(data(el, name), args);
2513
2537
 
2514
- return data$1;
2538
+ for (const key in options) {
2539
+ const prop = camelize(key);
2540
+ if (props[prop] !== undefined) {
2541
+ data$1[prop] = coerce(props[prop], options[key]);
2542
+ }
2515
2543
  }
2516
2544
 
2517
- function registerComputed(component, key, cb) {
2518
- Object.defineProperty(component, key, {
2519
- enumerable: true,
2545
+ return data$1;
2546
+ }
2520
2547
 
2521
- get() {
2522
- const { _computeds, $props, $el } = component;
2548
+ function registerComputed(component, key, cb) {
2549
+ Object.defineProperty(component, key, {
2550
+ enumerable: true,
2523
2551
 
2524
- if (!hasOwn(_computeds, key)) {
2525
- _computeds[key] = (cb.get || cb).call(component, $props, $el);
2526
- }
2552
+ get() {
2553
+ const { _computeds, $props, $el } = component;
2527
2554
 
2528
- return _computeds[key];
2529
- },
2555
+ if (!hasOwn(_computeds, key)) {
2556
+ _computeds[key] = (cb.get || cb).call(component, $props, $el);
2557
+ }
2530
2558
 
2531
- set(value) {
2532
- const { _computeds } = component;
2559
+ return _computeds[key];
2560
+ },
2533
2561
 
2534
- _computeds[key] = cb.set ? cb.set.call(component, value) : value;
2562
+ set(value) {
2563
+ const { _computeds } = component;
2535
2564
 
2536
- if (isUndefined(_computeds[key])) {
2537
- delete _computeds[key];
2538
- }
2539
- } });
2565
+ _computeds[key] = cb.set ? cb.set.call(component, value) : value;
2566
+
2567
+ if (isUndefined(_computeds[key])) {
2568
+ delete _computeds[key];
2569
+ }
2570
+ } });
2540
2571
 
2572
+ }
2573
+
2574
+ function registerEvent(component, event, key) {
2575
+ if (!isPlainObject(event)) {
2576
+ event = { name: key, handler: event };
2541
2577
  }
2542
2578
 
2543
- function registerEvent(component, event, key) {
2544
- if (!isPlainObject(event)) {
2545
- event = { name: key, handler: event };
2546
- }
2579
+ let { name, el, handler, capture, passive, delegate, filter, self } = event;
2580
+ el = isFunction(el) ? el.call(component) : el || component.$el;
2547
2581
 
2548
- let { name, el, handler, capture, passive, delegate, filter, self } = event;
2549
- el = isFunction(el) ? el.call(component) : el || component.$el;
2582
+ if (isArray(el)) {
2583
+ el.forEach((el) => registerEvent(component, { ...event, el }, key));
2584
+ return;
2585
+ }
2550
2586
 
2551
- if (isArray(el)) {
2552
- el.forEach((el) => registerEvent(component, assign({}, event, { el }), key));
2553
- return;
2554
- }
2587
+ if (!el || filter && !filter.call(component)) {
2588
+ return;
2589
+ }
2555
2590
 
2556
- if (!el || filter && !filter.call(component)) {
2557
- return;
2558
- }
2591
+ component._events.push(
2592
+ on(
2593
+ el,
2594
+ name,
2595
+ delegate ? isString(delegate) ? delegate : delegate.call(component) : null,
2596
+ isString(handler) ? component[handler] : handler.bind(component),
2597
+ { passive, capture, self }));
2559
2598
 
2560
- component._events.push(
2561
- on(
2562
- el,
2563
- name,
2564
- delegate ? isString(delegate) ? delegate : delegate.call(component) : null,
2565
- isString(handler) ? component[handler] : handler.bind(component),
2566
- { passive, capture, self }));
2567
2599
 
2600
+ }
2568
2601
 
2569
- }
2602
+ function notIn(options, key) {
2603
+ return options.every((arr) => !arr || !hasOwn(arr, key));
2604
+ }
2570
2605
 
2571
- function notIn(options, key) {
2572
- return options.every((arr) => !arr || !hasOwn(arr, key));
2606
+ function coerce(type, value) {
2607
+ if (type === Boolean) {
2608
+ return toBoolean(value);
2609
+ } else if (type === Number) {
2610
+ return toNumber(value);
2611
+ } else if (type === 'list') {
2612
+ return toList(value);
2573
2613
  }
2574
2614
 
2575
- function coerce(type, value) {
2576
- if (type === Boolean) {
2577
- return toBoolean(value);
2578
- } else if (type === Number) {
2579
- return toNumber(value);
2580
- } else if (type === 'list') {
2581
- return toList(value);
2582
- }
2615
+ return type ? type(value) : value;
2616
+ }
2583
2617
 
2584
- return type ? type(value) : value;
2618
+ function toList(value) {
2619
+ return isArray(value) ?
2620
+ value :
2621
+ isString(value) ?
2622
+ value.
2623
+ split(/,(?![^(]*\))/).
2624
+ map((value) => isNumeric(value) ? toNumber(value) : toBoolean(value.trim())) :
2625
+ [value];
2626
+ }
2627
+
2628
+ function normalizeData(_ref, _ref2) {let { data = {} } = _ref;let { args = [], props = {} } = _ref2;
2629
+ if (isArray(data)) {
2630
+ data = data.slice(0, args.length).reduce((data, value, index) => {
2631
+ if (isPlainObject(value)) {
2632
+ assign(data, value);
2633
+ } else {
2634
+ data[args[index]] = value;
2635
+ }
2636
+ return data;
2637
+ }, {});
2585
2638
  }
2586
2639
 
2587
- function toList(value) {
2588
- return isArray(value) ?
2589
- value :
2590
- isString(value) ?
2591
- value.
2592
- split(/,(?![^(]*\))/).
2593
- map((value) => isNumeric(value) ? toNumber(value) : toBoolean(value.trim())) :
2594
- [value];
2640
+ for (const key in data) {
2641
+ if (isUndefined(data[key])) {
2642
+ delete data[key];
2643
+ } else if (props[key]) {
2644
+ data[key] = coerce(props[key], data[key]);
2645
+ }
2595
2646
  }
2596
2647
 
2597
- function normalizeData(_ref, _ref2) {let { data = {} } = _ref;let { args = [], props = {} } = _ref2;
2598
- if (isArray(data)) {
2599
- data = data.slice(0, args.length).reduce((data, value, index) => {
2600
- if (isPlainObject(value)) {
2601
- assign(data, value);
2602
- } else {
2603
- data[args[index]] = value;
2604
- }
2605
- return data;
2606
- }, {});
2607
- }
2648
+ return data;
2649
+ }
2608
2650
 
2609
- for (const key in data) {
2610
- if (isUndefined(data[key])) {
2611
- delete data[key];
2612
- } else if (props[key]) {
2613
- data[key] = coerce(props[key], data[key]);
2614
- }
2615
- }
2651
+ function initChildListObserver(component) {
2652
+ const { el } = component.$options;
2616
2653
 
2617
- return data;
2618
- }
2654
+ const observer = new MutationObserver(() => component.$emit());
2655
+ observer.observe(el, {
2656
+ childList: true,
2657
+ subtree: true });
2619
2658
 
2620
- function initChildListObserver(component) {
2621
- const { el } = component.$options;
2622
2659
 
2623
- const observer = new MutationObserver(() => component.$emit());
2624
- observer.observe(el, {
2625
- childList: true,
2626
- subtree: true });
2660
+ return observer;
2661
+ }
2627
2662
 
2663
+ function initPropsObserver(component) {
2664
+ const { $name, $options, $props } = component;
2665
+ const { attrs, props, el } = $options;
2628
2666
 
2629
- return observer;
2667
+ if (!props || attrs === false) {
2668
+ return;
2630
2669
  }
2631
2670
 
2632
- function initPropsObserver(component) {
2633
- const { $name, $options, $props } = component;
2634
- const { attrs, props, el } = $options;
2671
+ const attributes = isArray(attrs) ? attrs : Object.keys(props);
2672
+ const filter = attributes.map((key) => hyphenate(key)).concat($name);
2635
2673
 
2636
- if (!props || attrs === false) {
2637
- return;
2674
+ const observer = new MutationObserver((records) => {
2675
+ const data = getProps$1($options, $name);
2676
+ if (
2677
+ records.some((_ref3) => {let { attributeName } = _ref3;
2678
+ const prop = attributeName.replace('data-', '');
2679
+ return (
2680
+ prop === $name ? attributes : [camelize(prop), camelize(attributeName)]).
2681
+ some((prop) => !isUndefined(data[prop]) && data[prop] !== $props[prop]);
2682
+ }))
2683
+ {
2684
+ component.$reset();
2638
2685
  }
2686
+ });
2639
2687
 
2640
- const attributes = isArray(attrs) ? attrs : Object.keys(props);
2641
- const filter = attributes.map((key) => hyphenate(key)).concat($name);
2688
+ observer.observe(el, {
2689
+ attributes: true,
2690
+ attributeFilter: filter.concat(filter.map((key) => "data-" + key)) });
2642
2691
 
2643
- const observer = new MutationObserver((records) => {
2644
- const data = getProps($options, $name);
2645
- if (
2646
- records.some((_ref3) => {let { attributeName } = _ref3;
2647
- const prop = attributeName.replace('data-', '');
2648
- return (
2649
- prop === $name ? attributes : [camelize(prop), camelize(attributeName)]).
2650
- some((prop) => !isUndefined(data[prop]) && data[prop] !== $props[prop]);
2651
- }))
2652
- {
2653
- component.$reset();
2654
- }
2655
- });
2656
2692
 
2657
- observer.observe(el, {
2658
- attributes: true,
2659
- attributeFilter: filter.concat(filter.map((key) => "data-" + key)) });
2693
+ return observer;
2694
+ }
2660
2695
 
2696
+ const scrollListeners = new Map();
2697
+ let unbindScrollListener;
2698
+ function registerScrollListener(id, listener) {
2699
+ unbindScrollListener =
2700
+ unbindScrollListener ||
2701
+ on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
2702
+ passive: true,
2703
+ capture: true });
2661
2704
 
2662
- return observer;
2705
+
2706
+ scrollListeners.set(id, listener);
2707
+ }
2708
+
2709
+ function unregisterScrollListener(id) {
2710
+ scrollListeners.delete(id);
2711
+ if (unbindScrollListener && !scrollListeners.size) {
2712
+ unbindScrollListener();
2713
+ unbindScrollListener = null;
2663
2714
  }
2664
2715
  }
2665
2716
 
@@ -2783,7 +2834,7 @@
2783
2834
  }
2784
2835
  };
2785
2836
 
2786
- const opt = isPlainObject(options) ? assign({}, options) : options.options;
2837
+ const opt = isPlainObject(options) ? { ...options } : options.options;
2787
2838
 
2788
2839
  opt.name = name;
2789
2840
 
@@ -2836,7 +2887,7 @@
2836
2887
  UIkit.data = '__uikit__';
2837
2888
  UIkit.prefix = 'uk-';
2838
2889
  UIkit.options = {};
2839
- UIkit.version = '3.11.2-dev.44c622843';
2890
+ UIkit.version = '3.11.2-dev.536e1a374';
2840
2891
 
2841
2892
  globalAPI(UIkit);
2842
2893
  hooksAPI(UIkit);
@@ -2862,27 +2913,7 @@
2862
2913
 
2863
2914
  on(window, 'load resize', handleResize);
2864
2915
  on(document, 'loadedmetadata load', handleResize, true);
2865
-
2866
- if ('ResizeObserver' in window) {
2867
- new ResizeObserver(handleResize).observe(document.documentElement);
2868
- }
2869
-
2870
- // throttle `scroll` event (Safari triggers multiple `scroll` events per frame)
2871
- let pending;
2872
- on(
2873
- window,
2874
- 'scroll',
2875
- (e) => {
2876
- if (pending) {
2877
- return;
2878
- }
2879
- pending = true;
2880
- fastdom.read(() => pending = false);
2881
-
2882
- UIkit.update(null, e.type);
2883
- },
2884
- { passive: true, capture: true });
2885
-
2916
+ observeResize(document.documentElement, handleResize);
2886
2917
 
2887
2918
  let started = 0;
2888
2919
  on(
@@ -2901,45 +2932,6 @@
2901
2932
  },
2902
2933
  true);
2903
2934
 
2904
-
2905
- on(
2906
- document,
2907
- pointerDown,
2908
- (e) => {
2909
- if (!isTouch(e)) {
2910
- return;
2911
- }
2912
-
2913
- // Handle Swipe Gesture
2914
- const pos = getEventPos(e);
2915
- const target = 'tagName' in e.target ? e.target : parent(e.target);
2916
- once(document, pointerUp + " " + pointerCancel + " scroll", (e) => {
2917
- const { x, y } = getEventPos(e);
2918
-
2919
- // swipe
2920
- if (
2921
- e.type !== 'scroll' && target && x && Math.abs(pos.x - x) > 100 ||
2922
- y && Math.abs(pos.y - y) > 100)
2923
- {
2924
- setTimeout(() => {
2925
- trigger(target, 'swipe');
2926
- trigger(target, "swipe" + swipeDirection(pos.x, pos.y, x, y));
2927
- });
2928
- }
2929
- });
2930
- },
2931
- { passive: true });
2932
-
2933
- }
2934
-
2935
- function swipeDirection(x1, y1, x2, y2) {
2936
- return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ?
2937
- x1 - x2 > 0 ?
2938
- 'Left' :
2939
- 'Right' :
2940
- y1 - y2 > 0 ?
2941
- 'Up' :
2942
- 'Down';
2943
2935
  }
2944
2936
 
2945
2937
  function boot (UIkit) {
@@ -3004,6 +2996,23 @@
3004
2996
  !hasClass(this.$el, this.$name) && addClass(this.$el, this.$name);
3005
2997
  } };
3006
2998
 
2999
+ var Lazyload = {
3000
+ methods: {
3001
+ lazyload(observeTargets, targets) {if (observeTargets === void 0) {observeTargets = this.$el;}if (targets === void 0) {targets = this.$el;}
3002
+ this.registerObserver(
3003
+ observeIntersection(observeTargets, (entries, observer) => {
3004
+ for (const el of toNodes(isFunction(targets) ? targets() : targets)) {
3005
+ $$('[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
3006
+ }
3007
+ for (const el of entries.
3008
+ filter((_ref) => {let { isIntersecting } = _ref;return isIntersecting;}).
3009
+ map((_ref2) => {let { target } = _ref2;return target;})) {
3010
+ observer.unobserve(el);
3011
+ }
3012
+ }));
3013
+
3014
+ } } };
3015
+
3007
3016
  var Togglable = {
3008
3017
  props: {
3009
3018
  cls: Boolean,
@@ -3135,7 +3144,7 @@
3135
3144
  function toggleHeight(_ref3) {let { isToggled, duration, initProps, hideProps, transition, _toggle } = _ref3;
3136
3145
  return (el, show) => {
3137
3146
  const inProgress = Transition.inProgress(el);
3138
- const inner = el.hasChildNodes ?
3147
+ const inner = el.hasChildNodes() ?
3139
3148
  toFloat(css(el.firstElementChild, 'marginTop')) +
3140
3149
  toFloat(css(el.lastElementChild, 'marginBottom')) :
3141
3150
  0;
@@ -3159,7 +3168,7 @@
3159
3168
  show ?
3160
3169
  Transition.start(
3161
3170
  el,
3162
- assign({}, initProps, { overflow: 'hidden', height: endHeight }),
3171
+ { ...initProps, overflow: 'hidden', height: endHeight },
3163
3172
  Math.round(duration * (1 - currentHeight / endHeight)),
3164
3173
  transition) :
3165
3174
 
@@ -3191,7 +3200,7 @@
3191
3200
  }
3192
3201
 
3193
3202
  var Accordion = {
3194
- mixins: [Class, Togglable],
3203
+ mixins: [Class, Lazyload, Togglable],
3195
3204
 
3196
3205
  props: {
3197
3206
  targets: String,
@@ -3247,6 +3256,10 @@
3247
3256
  } },
3248
3257
 
3249
3258
 
3259
+ connected() {
3260
+ this.lazyload();
3261
+ },
3262
+
3250
3263
  events: [
3251
3264
  {
3252
3265
  name: 'click',
@@ -3331,7 +3344,7 @@
3331
3344
  animation: [true],
3332
3345
  selClose: '.uk-alert-close',
3333
3346
  duration: 150,
3334
- hideProps: assign({ opacity: 0 }, Togglable.data.hideProps) },
3347
+ hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3335
3348
 
3336
3349
 
3337
3350
  events: [
@@ -3382,6 +3395,8 @@
3382
3395
  if (this.automute) {
3383
3396
  mute(this.$el);
3384
3397
  }
3398
+
3399
+ this.registerObserver(observeIntersection(this.$el, () => this.$emit('scroll'), {}, false));
3385
3400
  },
3386
3401
 
3387
3402
  update: {
@@ -3418,6 +3433,10 @@
3418
3433
  automute: true },
3419
3434
 
3420
3435
 
3436
+ connected() {
3437
+ this.registerObserver(observeResize(this.$el, () => this.$emit('resize')));
3438
+ },
3439
+
3421
3440
  update: {
3422
3441
  read() {
3423
3442
  const el = this.$el;
@@ -3543,7 +3562,7 @@
3543
3562
  let active$1;
3544
3563
 
3545
3564
  var drop = {
3546
- mixins: [Container, Position, Togglable],
3565
+ mixins: [Container, Lazyload, Position, Togglable],
3547
3566
 
3548
3567
  args: 'pos',
3549
3568
 
@@ -3597,6 +3616,7 @@
3597
3616
  mode: this.mode }).
3598
3617
  $el;
3599
3618
  attr(this.target, 'aria-haspopup', true);
3619
+ this.lazyload(this.target);
3600
3620
  }
3601
3621
  },
3602
3622
 
@@ -3972,7 +3992,7 @@
3972
3992
  name: 'change',
3973
3993
 
3974
3994
  handler() {
3975
- this.$update();
3995
+ this.$emit();
3976
3996
  } },
3977
3997
 
3978
3998
 
@@ -3984,7 +4004,7 @@
3984
4004
  },
3985
4005
 
3986
4006
  handler() {
3987
- this.$update();
4007
+ this.$emit();
3988
4008
  } }] };
3989
4009
 
3990
4010
  // Deprecated
@@ -4341,6 +4361,8 @@
4341
4361
  }
4342
4362
 
4343
4363
  var heightViewport = {
4364
+ mixins: [Class],
4365
+
4344
4366
  props: {
4345
4367
  expand: Boolean,
4346
4368
  offsetTop: Boolean,
@@ -4488,6 +4510,12 @@
4488
4510
 
4489
4511
  methods: {
4490
4512
  async getSvg() {
4513
+ if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4514
+ return new Promise((resolve) =>
4515
+ once(this.$el, 'load', () => resolve(this.getSvg())));
4516
+
4517
+ }
4518
+
4491
4519
  return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4492
4520
  },
4493
4521
 
@@ -4587,7 +4615,7 @@
4587
4615
  }
4588
4616
 
4589
4617
  function insertSVG(el, root) {
4590
- if (isVoidElement(root) || root.tagName === 'CANVAS') {
4618
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
4591
4619
  root.hidden = true;
4592
4620
 
4593
4621
  const next = root.nextElementSibling;
@@ -4599,11 +4627,7 @@
4599
4627
  }
4600
4628
 
4601
4629
  function equals(el, other) {
4602
- return isSVG(el) && isSVG(other) && innerHTML(el) === innerHTML(other);
4603
- }
4604
-
4605
- function isSVG(el) {
4606
- return (el == null ? void 0 : el.tagName) === 'svg';
4630
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4607
4631
  }
4608
4632
 
4609
4633
  function innerHTML(el) {
@@ -4684,14 +4708,14 @@
4684
4708
  },
4685
4709
 
4686
4710
  methods: {
4687
- getSvg() {
4711
+ async getSvg() {
4688
4712
  const icon = getIcon(this.icon);
4689
4713
 
4690
4714
  if (!icon) {
4691
- return Promise.reject('Icon not found.');
4715
+ throw 'Icon not found.';
4692
4716
  }
4693
4717
 
4694
- return Promise.resolve(icon);
4718
+ return icon;
4695
4719
  } } };
4696
4720
 
4697
4721
  const IconComponent = {
@@ -4749,10 +4773,17 @@
4749
4773
  const Spinner = {
4750
4774
  extends: IconComponent,
4751
4775
 
4752
- async connected() {
4753
- const svg = await this.svg;
4754
- svg && this.ratio !== 1 && css($('circle', svg), 'strokeWidth', 1 / this.ratio);
4755
- } };
4776
+ methods: {
4777
+ async getSvg() {
4778
+ const icon = await Icon.methods.getSvg.call(this);
4779
+
4780
+ if (this.ratio !== 1) {
4781
+ css($('circle', icon), 'strokeWidth', 1 / this.ratio);
4782
+ }
4783
+
4784
+ return icon;
4785
+ } } };
4786
+
4756
4787
 
4757
4788
 
4758
4789
  const parsed = {};
@@ -4790,120 +4821,93 @@
4790
4821
  return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4791
4822
  }
4792
4823
 
4824
+ const nativeLazyLoad = ('loading' in HTMLImageElement.prototype);
4825
+
4793
4826
  var img = {
4794
4827
  args: 'dataSrc',
4795
4828
 
4796
4829
  props: {
4797
4830
  dataSrc: String,
4798
- dataSrcset: Boolean,
4799
- sizes: String,
4800
- width: Number,
4801
- height: Number,
4831
+ sources: String,
4802
4832
  offsetTop: String,
4803
4833
  offsetLeft: String,
4804
- target: String },
4834
+ target: String,
4835
+ loading: String },
4805
4836
 
4806
4837
 
4807
4838
  data: {
4808
4839
  dataSrc: '',
4809
- dataSrcset: false,
4810
- sizes: false,
4811
- width: false,
4812
- height: false,
4840
+ sources: false,
4813
4841
  offsetTop: '50vh',
4814
4842
  offsetLeft: '50vw',
4815
- target: false },
4843
+ target: false,
4844
+ loading: 'lazy' },
4816
4845
 
4817
4846
 
4818
4847
  computed: {
4819
- cacheKey(_ref) {let { dataSrc } = _ref;
4820
- return this.$name + "." + dataSrc;
4821
- },
4822
-
4823
- width(_ref2) {let { width, dataWidth } = _ref2;
4824
- return width || dataWidth;
4825
- },
4826
-
4827
- height(_ref3) {let { height, dataHeight } = _ref3;
4828
- return height || dataHeight;
4829
- },
4830
-
4831
- sizes(_ref4) {let { sizes, dataSizes } = _ref4;
4832
- return sizes || dataSizes;
4833
- },
4834
-
4835
- isImg(_, $el) {
4836
- return isImg($el);
4837
- },
4838
-
4839
4848
  target: {
4840
- get(_ref5) {let { target } = _ref5;
4849
+ get(_ref) {let { target } = _ref;
4841
4850
  return [this.$el, ...queryAll(target, this.$el)];
4842
4851
  },
4843
4852
 
4844
4853
  watch() {
4845
- this.observe();
4846
- } },
4847
-
4848
-
4849
- offsetTop(_ref6) {let { offsetTop } = _ref6;
4850
- return toPx(offsetTop, 'height');
4851
- },
4854
+ this.$reset();
4855
+ } } },
4852
4856
 
4853
- offsetLeft(_ref7) {let { offsetLeft } = _ref7;
4854
- return toPx(offsetLeft, 'width');
4855
- } },
4856
4857
 
4857
4858
 
4858
4859
  connected() {
4859
- if (!window.IntersectionObserver) {
4860
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
4860
+ if (this.loading !== 'lazy' || !hasIntersectionObserver) {
4861
+ this.load();
4861
4862
  return;
4862
4863
  }
4863
4864
 
4864
- if (storage[this.cacheKey]) {
4865
- setSrcAttrs(this.$el, storage[this.cacheKey], this.dataSrcset, this.sizes);
4866
- } else if (this.isImg && this.width && this.height) {
4867
- setSrcAttrs(this.$el, getPlaceholderImage(this.width, this.height, this.sizes));
4865
+ if (nativeLazyLoad && isImg(this.$el)) {
4866
+ this.$el.loading = 'lazy';
4867
+ setSrcAttrs(this.$el);
4868
+
4869
+ if (this.target.length === 1) {
4870
+ return;
4871
+ }
4868
4872
  }
4869
4873
 
4870
- this.observer = new IntersectionObserver(this.load, {
4871
- rootMargin: this.offsetTop + "px " + this.offsetLeft + "px" });
4874
+ ensureSrcAttribute(this.$el);
4875
+
4876
+ this.registerObserver(
4877
+ observeIntersection(
4878
+ this.target,
4879
+ (entries, observer) => {
4880
+ this.load();
4881
+ observer.disconnect();
4882
+ },
4883
+ {
4884
+ rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
4885
+ this.offsetLeft,
4886
+ 'width') + "px" }));
4887
+
4888
+
4872
4889
 
4873
4890
 
4874
- requestAnimationFrame(this.observe);
4875
4891
  },
4876
4892
 
4877
4893
  disconnected() {
4878
- this.observer && this.observer.disconnect();
4894
+ if (this._data.image) {
4895
+ this._data.image.onload = '';
4896
+ }
4879
4897
  },
4880
4898
 
4881
4899
  update: {
4882
- read(_ref8) {let { image } = _ref8;
4883
- if (!this.observer) {
4900
+ write(store) {
4901
+ if (!this.observer || isImg(this.$el)) {
4884
4902
  return false;
4885
4903
  }
4886
4904
 
4887
- if (!image && document.readyState === 'complete') {
4888
- this.load(this.observer.takeRecords());
4889
- }
4890
-
4891
- if (this.isImg) {
4892
- return false;
4893
- }
4894
-
4895
- image &&
4896
- image.then(
4897
- (img) => img && img.currentSrc !== '' && setSrcAttrs(this.$el, currentSrc(img)));
4898
-
4899
- },
4900
-
4901
- write(data) {
4902
- if (this.dataSrcset && window.devicePixelRatio !== 1) {
4905
+ const srcset = data(this.$el, 'data-srcset');
4906
+ if (srcset && window.devicePixelRatio !== 1) {
4903
4907
  const bgSize = css(this.$el, 'backgroundSize');
4904
- if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === data.bgSize) {
4905
- data.bgSize = getSourceSize(this.dataSrcset, this.sizes);
4906
- css(this.$el, 'backgroundSize', data.bgSize + "px");
4908
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
4909
+ store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
4910
+ css(this.$el, 'backgroundSize', store.bgSize + "px");
4907
4911
  }
4908
4912
  }
4909
4913
  },
@@ -4911,43 +4915,28 @@
4911
4915
  events: ['resize'] },
4912
4916
 
4913
4917
 
4914
- methods: {
4915
- load(entries) {
4916
- // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
4917
- if (
4918
- !entries.some((entry) => isUndefined(entry.isIntersecting) || entry.isIntersecting))
4919
- {
4920
- return;
4921
- }
4922
-
4923
- this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(
4924
- (img) => {
4925
- setSrcAttrs(this.$el, currentSrc(img), img.srcset, img.sizes);
4926
- storage[this.cacheKey] = currentSrc(img);
4927
- return img;
4928
- },
4929
- (e) => trigger(this.$el, new e.constructor(e.type, e)));
4930
-
4931
-
4932
- this.observer.disconnect();
4933
- },
4934
-
4935
- observe() {
4936
- if (this._connected && !this._data.image) {
4937
- for (const el of this.target) {
4938
- this.observer.observe(el);
4939
- }
4918
+ methods: {
4919
+ load() {
4920
+ if (this._data.image) {
4921
+ return this._data.image;
4940
4922
  }
4923
+
4924
+ const image = isImg(this.$el) ?
4925
+ this.$el :
4926
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
4927
+
4928
+ removeAttr(image, 'loading');
4929
+ setSrcAttrs(this.$el, image.currentSrc);
4930
+ return this._data.image = image;
4941
4931
  } } };
4942
4932
 
4943
4933
 
4944
4934
 
4945
- function setSrcAttrs(el, src, srcset, sizes) {
4935
+ function setSrcAttrs(el, src) {
4946
4936
  if (isImg(el)) {
4947
- const set = (prop, val) => val && val !== el[prop] && (el[prop] = val);
4948
- set('sizes', sizes);
4949
- set('srcset', srcset);
4950
- set('src', src);
4937
+ const parentNode = parent(el);
4938
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
4939
+ elements.forEach((el) => setSourceProps(el, el));
4951
4940
  } else if (src) {
4952
4941
  const change = !includes(el.style.backgroundImage, src);
4953
4942
  if (change) {
@@ -4957,16 +4946,62 @@
4957
4946
  }
4958
4947
  }
4959
4948
 
4960
- function getPlaceholderImage(width, height, sizes) {
4961
- if (sizes) {
4962
- ({ width, height } = Dimensions.ratio(
4963
- { width, height },
4964
- 'width',
4965
- toPx(sizesToPixel(sizes))));
4949
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
4950
+ function setSourceProps(sourceEl, targetEl) {
4951
+ srcProps.forEach((prop) => {
4952
+ const value = data(sourceEl, prop);
4953
+ if (value) {
4954
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
4955
+ }
4956
+ });
4957
+ }
4958
+
4959
+ function getImageFromElement(el, src, sources) {
4960
+ const img = new Image();
4961
+
4962
+ wrapInPicture(img, sources);
4963
+ setSourceProps(el, img);
4964
+ img.onload = () => {
4965
+ setSrcAttrs(el, img.currentSrc);
4966
+ };
4967
+ attr(img, 'src', src);
4968
+ return img;
4969
+ }
4970
+
4971
+ function wrapInPicture(img, sources) {
4972
+ sources = parseSources(sources);
4973
+
4974
+ if (sources.length) {
4975
+ const picture = fragment('<picture>');
4976
+ for (const attrs of sources) {
4977
+ const source = fragment('<source>');
4978
+ attr(source, attrs);
4979
+ append(picture, source);
4980
+ }
4981
+ append(picture, img);
4982
+ }
4983
+ }
4984
+
4985
+ function parseSources(sources) {
4986
+ if (!sources) {
4987
+ return [];
4988
+ }
4989
+
4990
+ if (startsWith(sources, '[')) {
4991
+ try {
4992
+ sources = JSON.parse(sources);
4993
+ } catch (e) {
4994
+ sources = [];
4995
+ }
4996
+ } else {
4997
+ sources = parseOptions(sources);
4998
+ }
4966
4999
 
5000
+ if (!isArray(sources)) {
5001
+ sources = [sources];
4967
5002
  }
4968
5003
 
4969
- return "data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>";
5004
+ return sources.filter((source) => !isEmpty(source));
4970
5005
  }
4971
5006
 
4972
5007
  const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -5006,24 +5041,18 @@
5006
5041
  return descriptors.filter((size) => size >= srcSize)[0] || descriptors.pop() || '';
5007
5042
  }
5008
5043
 
5009
- function isImg(el) {
5010
- return el.tagName === 'IMG';
5044
+ function ensureSrcAttribute(el) {
5045
+ if (isImg(el) && !hasAttr(el, 'src')) {
5046
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5047
+ }
5011
5048
  }
5012
5049
 
5013
- function currentSrc(el) {
5014
- return el.currentSrc || el.src;
5050
+ function isPicture(el) {
5051
+ return isTag(el, 'picture');
5015
5052
  }
5016
5053
 
5017
- const key = '__test__';
5018
- let storage;
5019
-
5020
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
5021
- try {
5022
- storage = window.sessionStorage || {};
5023
- storage[key] = 1;
5024
- delete storage[key];
5025
- } catch (e) {
5026
- storage = {};
5054
+ function isImg(el) {
5055
+ return isTag(el, 'img');
5027
5056
  }
5028
5057
 
5029
5058
  var Media = {
@@ -5479,7 +5508,7 @@
5479
5508
 
5480
5509
 
5481
5510
  function openDialog(tmpl, options, hideFn, submitFn) {
5482
- options = assign({ bgClose: false, escClose: true, labels: modal.labels }, options);
5511
+ options = { bgClose: false, escClose: true, labels: modal.labels, ...options };
5483
5512
 
5484
5513
  const dialog = modal.dialog(tmpl(options), options);
5485
5514
  const deferred = new Deferred();
@@ -5608,10 +5637,11 @@
5608
5637
  this.$create(
5609
5638
  'drop',
5610
5639
  dropdowns.filter((el) => !this.getDropdown(el)),
5611
- assign({}, this.$props, {
5640
+ {
5641
+ ...this.$props,
5612
5642
  boundary: this.boundary,
5613
5643
  pos: this.pos,
5614
- offset: this.dropbar || this.offset }));
5644
+ offset: this.dropbar || this.offset });
5615
5645
 
5616
5646
 
5617
5647
  },
@@ -5921,8 +5951,69 @@
5921
5951
  RIGHT: 39,
5922
5952
  DOWN: 40 };
5923
5953
 
5954
+ var Swipe = {
5955
+ props: {
5956
+ swiping: Boolean },
5957
+
5958
+
5959
+ data: {
5960
+ swiping: true },
5961
+
5962
+
5963
+ computed: {
5964
+ swipeTarget(props, $el) {
5965
+ return $el;
5966
+ } },
5967
+
5968
+
5969
+ connected() {
5970
+ if (!this.swiping) {
5971
+ return;
5972
+ }
5973
+
5974
+ registerEvent(this, {
5975
+ el: this.swipeTarget,
5976
+ name: pointerDown,
5977
+ passive: true,
5978
+ handler(e) {
5979
+ if (!isTouch(e)) {
5980
+ return;
5981
+ }
5982
+
5983
+ // Handle Swipe Gesture
5984
+ const pos = getEventPos(e);
5985
+ const target = 'tagName' in e.target ? e.target : parent(e.target);
5986
+ once(document, pointerUp + " " + pointerCancel + " scroll", (e) => {
5987
+ const { x, y } = getEventPos(e);
5988
+
5989
+ // swipe
5990
+ if (
5991
+ e.type !== 'scroll' && target && x && Math.abs(pos.x - x) > 100 ||
5992
+ y && Math.abs(pos.y - y) > 100)
5993
+ {
5994
+ setTimeout(() => {
5995
+ trigger(target, 'swipe');
5996
+ trigger(target, "swipe" + swipeDirection(pos.x, pos.y, x, y));
5997
+ });
5998
+ }
5999
+ });
6000
+ } });
6001
+
6002
+ } };
6003
+
6004
+
6005
+ function swipeDirection(x1, y1, x2, y2) {
6006
+ return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ?
6007
+ x1 - x2 > 0 ?
6008
+ 'Left' :
6009
+ 'Right' :
6010
+ y1 - y2 > 0 ?
6011
+ 'Up' :
6012
+ 'Down';
6013
+ }
6014
+
5924
6015
  var offcanvas = {
5925
- mixins: [Modal],
6016
+ mixins: [Modal, Swipe],
5926
6017
 
5927
6018
  args: 'mode',
5928
6019
 
@@ -6503,26 +6594,11 @@
6503
6594
 
6504
6595
 
6505
6596
  computed: {
6506
- position(_ref, $el) {let { position } = _ref;
6507
- return position === 'auto' ?
6508
- (this.isFixed ? this.placeholder : $el).offsetHeight > height(window) ?
6509
- 'bottom' :
6510
- 'top' :
6511
- position;
6512
- },
6513
-
6514
- offset(_ref2, $el) {let { offset } = _ref2;
6515
- if (this.position === 'bottom') {
6516
- offset += '+100vh-100%';
6517
- }
6518
- return toPx(offset, 'height', $el);
6519
- },
6520
-
6521
- selTarget(_ref3, $el) {let { selTarget } = _ref3;
6597
+ selTarget(_ref, $el) {let { selTarget } = _ref;
6522
6598
  return selTarget && $(selTarget, $el) || $el;
6523
6599
  },
6524
6600
 
6525
- widthElement(_ref4, $el) {let { widthElement } = _ref4;
6601
+ widthElement(_ref2, $el) {let { widthElement } = _ref2;
6526
6602
  return query(widthElement, $el) || this.placeholder;
6527
6603
  },
6528
6604
 
@@ -6570,41 +6646,36 @@
6570
6646
  return window;
6571
6647
  },
6572
6648
 
6649
+ filter() {
6650
+ return this.targetOffset !== false;
6651
+ },
6652
+
6573
6653
  handler() {
6574
- if (!(this.targetOffset !== false && location.hash && scrollTop(window) > 0)) {
6654
+ if (!location.hash || scrollTop(window) === 0) {
6575
6655
  return;
6576
6656
  }
6577
6657
 
6578
- const target = $(location.hash);
6579
-
6580
- if (target) {
6581
- fastdom.read(() => {
6582
- const { top } = offset(target);
6583
- const elTop = offset(this.$el).top;
6584
- const elHeight = this.$el.offsetHeight;
6658
+ fastdom.read(() => {
6659
+ const targetOffset = offset($(location.hash));
6660
+ const elOffset = offset(this.$el);
6585
6661
 
6586
- if (
6587
- this.isFixed &&
6588
- elTop + elHeight >= top &&
6589
- elTop <= top + target.offsetHeight)
6590
- {
6591
- scrollTop(
6592
- window,
6593
- top -
6594
- elHeight - (
6595
- isNumeric(this.targetOffset) ? this.targetOffset : 0) -
6596
- this.offset);
6662
+ if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6663
+ scrollTop(
6664
+ window,
6665
+ targetOffset.top -
6666
+ elOffset.height -
6667
+ toPx(this.targetOffset, 'height') -
6668
+ toPx(this.offset, 'height'));
6597
6669
 
6598
- }
6599
- });
6600
- }
6670
+ }
6671
+ });
6601
6672
  } }],
6602
6673
 
6603
6674
 
6604
6675
 
6605
6676
  update: [
6606
6677
  {
6607
- read(_ref5, types) {let { height: height$1, margin } = _ref5;
6678
+ read(_ref3, types) {let { height: height$1, margin } = _ref3;
6608
6679
  this.inactive = !this.matchMedia || !isVisible(this.$el);
6609
6680
 
6610
6681
  if (this.inactive) {
@@ -6613,35 +6684,49 @@
6613
6684
 
6614
6685
  const hide = this.isActive && types.has('resize');
6615
6686
  if (hide) {
6687
+ css(this.selTarget, 'transition', '0s');
6616
6688
  this.hide();
6617
6689
  }
6618
6690
 
6619
6691
  if (!this.isActive) {
6620
- height$1 = this.$el.offsetHeight;
6692
+ height$1 = offset(this.$el).height;
6621
6693
  margin = css(this.$el, 'margin');
6622
6694
  }
6623
6695
 
6624
6696
  if (hide) {
6625
6697
  this.show();
6698
+ fastdom.write(() => css(this.selTarget, 'transition', ''));
6626
6699
  }
6627
6700
 
6628
- const overflow = Math.max(0, height$1 + this.offset - height(window));
6629
-
6630
6701
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
6702
+ const windowHeight = height(window);
6703
+
6704
+ let position = this.position;
6705
+ if (position === 'auto' && height$1 > windowHeight) {
6706
+ position = 'bottom';
6707
+ }
6708
+
6709
+ let offset$1 = toPx(this.offset, 'height', referenceElement);
6710
+ if (position === 'bottom') {
6711
+ offset$1 += windowHeight - height$1;
6712
+ }
6713
+
6714
+ const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
6631
6715
  const topOffset = offset(referenceElement).top;
6632
6716
  const offsetParentTop = offset(referenceElement.offsetParent).top;
6633
6717
 
6634
6718
  const top = parseProp(this.top, this.$el, topOffset);
6635
6719
  const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
6636
6720
 
6637
- const start = Math.max(top, topOffset) - this.offset;
6721
+ const start = Math.max(top, topOffset) - offset$1;
6638
6722
  const end = bottom ?
6639
- bottom - this.$el.offsetHeight + overflow - this.offset :
6640
- getScrollingElement(this.$el).scrollHeight - height(window);
6723
+ bottom - offset(this.$el).height + overflow - offset$1 :
6724
+ getScrollingElement(this.$el).scrollHeight - windowHeight;
6641
6725
 
6642
6726
  return {
6643
6727
  start,
6644
6728
  end,
6729
+ offset: offset$1,
6645
6730
  overflow,
6646
6731
  topOffset,
6647
6732
  offsetParentTop,
@@ -6649,11 +6734,11 @@
6649
6734
  margin,
6650
6735
  width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).
6651
6736
  width,
6652
- top: offsetPosition(this.placeholder)[0] };
6737
+ top: offsetPosition(referenceElement)[0] };
6653
6738
 
6654
6739
  },
6655
6740
 
6656
- write(_ref6) {let { height, margin } = _ref6;
6741
+ write(_ref4) {let { height, margin } = _ref4;
6657
6742
  const { placeholder } = this;
6658
6743
 
6659
6744
  css(placeholder, { height, margin });
@@ -6670,14 +6755,14 @@
6670
6755
 
6671
6756
 
6672
6757
  {
6673
- read(_ref7)
6758
+ read(_ref5)
6674
6759
 
6675
6760
 
6676
6761
 
6677
6762
 
6678
6763
 
6679
6764
 
6680
- {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref7;
6765
+ {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref5;
6681
6766
  const scroll = scrollTop(window);
6682
6767
  const dir = prevScroll <= scroll ? 'down' : 'up';
6683
6768
 
@@ -6758,7 +6843,7 @@
6758
6843
  }
6759
6844
  } else if (this.isFixed) {
6760
6845
  this.update();
6761
- } else if (this.animation) {
6846
+ } else if (this.animation && scroll > topOffset) {
6762
6847
  Animation.cancel(this.$el);
6763
6848
  this.show();
6764
6849
  Animation.in(this.$el, this.animation).catch(noop);
@@ -6786,33 +6871,33 @@
6786
6871
  },
6787
6872
 
6788
6873
  update() {
6789
- const {
6874
+ let {
6790
6875
  width,
6791
6876
  scroll = 0,
6792
6877
  overflow,
6793
6878
  overflowScroll = 0,
6794
6879
  start,
6795
6880
  end,
6881
+ offset,
6796
6882
  topOffset,
6797
6883
  height,
6798
6884
  offsetParentTop } =
6799
6885
  this._data;
6800
6886
  const active = start !== 0 || scroll > start;
6801
- let top = this.offset;
6802
6887
  let position = 'fixed';
6803
6888
 
6804
6889
  if (scroll > end) {
6805
- top = end + this.offset - offsetParentTop;
6890
+ offset += end - offsetParentTop;
6806
6891
  position = 'absolute';
6807
6892
  }
6808
6893
 
6809
6894
  if (overflow) {
6810
- top -= overflowScroll;
6895
+ offset -= overflowScroll;
6811
6896
  }
6812
6897
 
6813
6898
  css(this.$el, {
6814
6899
  position,
6815
- top: top + "px",
6900
+ top: offset + "px",
6816
6901
  width });
6817
6902
 
6818
6903
 
@@ -6842,7 +6927,7 @@
6842
6927
  }
6843
6928
 
6844
6929
  var Switcher = {
6845
- mixins: [Togglable],
6930
+ mixins: [Lazyload, Swipe, Togglable],
6846
6931
 
6847
6932
  args: 'connect',
6848
6933
 
@@ -6850,8 +6935,7 @@
6850
6935
  connect: String,
6851
6936
  toggle: String,
6852
6937
  itemNav: String,
6853
- active: Number,
6854
- swiping: Boolean },
6938
+ active: Number },
6855
6939
 
6856
6940
 
6857
6941
  data: {
@@ -6859,7 +6943,6 @@
6859
6943
  toggle: '> * > :first-child',
6860
6944
  itemNav: false,
6861
6945
  active: 0,
6862
- swiping: true,
6863
6946
  cls: 'uk-active',
6864
6947
  attrItem: 'uk-switcher-item' },
6865
6948
 
@@ -6903,9 +6986,17 @@
6903
6986
  return children(this.$el).filter((child) =>
6904
6987
  this.toggles.some((toggle) => within(toggle, child)));
6905
6988
 
6989
+ },
6990
+
6991
+ swipeTarget() {
6992
+ return this.connects;
6906
6993
  } },
6907
6994
 
6908
6995
 
6996
+ connected() {
6997
+ this.lazyload(this.$el, this.connects);
6998
+ },
6999
+
6909
7000
  events: [
6910
7001
  {
6911
7002
  name: 'click',
@@ -7014,7 +7105,7 @@
7014
7105
  const KEY_SPACE = 32;
7015
7106
 
7016
7107
  var toggle = {
7017
- mixins: [Media, Togglable],
7108
+ mixins: [Lazyload, Media, Togglable],
7018
7109
 
7019
7110
  args: 'target',
7020
7111
 
@@ -7036,6 +7127,7 @@
7036
7127
  if (!includes(this.mode, 'media') && !isFocusable(this.$el)) {
7037
7128
  attr(this.$el, 'tabindex', '0');
7038
7129
  }
7130
+ this.lazyload(this.$el, this.target);
7039
7131
  },
7040
7132
 
7041
7133
  computed: {
@@ -7127,7 +7219,7 @@
7127
7219
  name: 'keydown',
7128
7220
 
7129
7221
  filter() {
7130
- return includes(this.mode, 'click') && this.$el.tagName !== 'INPUT';
7222
+ return includes(this.mode, 'click') && !isTag(this.$el, 'input');
7131
7223
  },
7132
7224
 
7133
7225
  handler(e) {
@@ -7288,6 +7380,8 @@
7288
7380
 
7289
7381
  boot(UIkit);
7290
7382
 
7383
+ const units = ['days', 'hours', 'minutes', 'seconds'];
7384
+
7291
7385
  var countdown = {
7292
7386
  mixins: [Class],
7293
7387
 
@@ -7301,39 +7395,13 @@
7301
7395
  clsWrapper: '.uk-countdown-%unit%' },
7302
7396
 
7303
7397
 
7304
- computed: {
7305
- date(_ref) {let { date } = _ref;
7306
- return Date.parse(date);
7307
- },
7308
-
7309
- days(_ref2, $el) {let { clsWrapper } = _ref2;
7310
- return $(clsWrapper.replace('%unit%', 'days'), $el);
7311
- },
7312
-
7313
- hours(_ref3, $el) {let { clsWrapper } = _ref3;
7314
- return $(clsWrapper.replace('%unit%', 'hours'), $el);
7315
- },
7316
-
7317
- minutes(_ref4, $el) {let { clsWrapper } = _ref4;
7318
- return $(clsWrapper.replace('%unit%', 'minutes'), $el);
7319
- },
7320
-
7321
- seconds(_ref5, $el) {let { clsWrapper } = _ref5;
7322
- return $(clsWrapper.replace('%unit%', 'seconds'), $el);
7323
- },
7324
-
7325
- units() {
7326
- return ['days', 'hours', 'minutes', 'seconds'].filter((unit) => this[unit]);
7327
- } },
7328
-
7329
-
7330
7398
  connected() {
7399
+ this.date = Date.parse(this.date);
7331
7400
  this.start();
7332
7401
  },
7333
7402
 
7334
7403
  disconnected() {
7335
7404
  this.stop();
7336
- this.units.forEach((unit) => empty(this[unit]));
7337
7405
  },
7338
7406
 
7339
7407
  events: [
@@ -7354,22 +7422,37 @@
7354
7422
 
7355
7423
 
7356
7424
 
7357
- update: {
7358
- write() {
7425
+ methods: {
7426
+ start() {
7427
+ this.stop();
7428
+ this.update();
7429
+ this.timer = setInterval(this.update, 1000);
7430
+ },
7431
+
7432
+ stop() {
7433
+ clearInterval(this.timer);
7434
+ },
7435
+
7436
+ update() {
7359
7437
  const timespan = getTimeSpan(this.date);
7360
7438
 
7361
- if (timespan.total <= 0) {
7439
+ if (!this.date || timespan.total <= 0) {
7362
7440
  this.stop();
7363
7441
 
7364
7442
  timespan.days = timespan.hours = timespan.minutes = timespan.seconds = 0;
7365
7443
  }
7366
7444
 
7367
- for (const unit of this.units) {
7445
+ for (const unit of units) {
7446
+ const el = $(this.clsWrapper.replace('%unit%', unit), this.$el);
7447
+
7448
+ if (!el) {
7449
+ continue;
7450
+ }
7451
+
7368
7452
  let digits = String(Math.floor(timespan[unit]));
7369
7453
 
7370
7454
  digits = digits.length < 2 ? "0" + digits : digits;
7371
7455
 
7372
- const el = this[unit];
7373
7456
  if (el.textContent !== digits) {
7374
7457
  digits = digits.split('');
7375
7458
 
@@ -7380,24 +7463,6 @@
7380
7463
  digits.forEach((digit, i) => el.children[i].textContent = digit);
7381
7464
  }
7382
7465
  }
7383
- } },
7384
-
7385
-
7386
- methods: {
7387
- start() {
7388
- this.stop();
7389
-
7390
- if (this.date && this.units.length) {
7391
- this.$update();
7392
- this.timer = setInterval(this.$update, 1000);
7393
- }
7394
- },
7395
-
7396
- stop() {
7397
- if (this.timer) {
7398
- clearInterval(this.timer);
7399
- this.timer = null;
7400
- }
7401
7466
  } } };
7402
7467
 
7403
7468
 
@@ -7571,7 +7636,7 @@
7571
7636
 
7572
7637
  // Reset to previous state
7573
7638
  nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));
7574
- css(target, assign({ display: 'block' }, targetProps));
7639
+ css(target, { display: 'block', ...targetProps });
7575
7640
 
7576
7641
  // Start transitions on next frame
7577
7642
  requestAnimationFrame(() => {
@@ -7603,15 +7668,13 @@
7603
7668
  const zIndex = css(el, 'zIndex');
7604
7669
 
7605
7670
  return isVisible(el) ?
7606
- assign(
7607
7671
  {
7608
7672
  display: '',
7609
7673
  opacity: opacity ? css(el, 'opacity') : '0',
7610
7674
  pointerEvents: 'none',
7611
7675
  position: 'absolute',
7612
- zIndex: zIndex === 'auto' ? index(el) : zIndex },
7613
-
7614
- getPositionWithMargin(el)) :
7676
+ zIndex: zIndex === 'auto' ? index(el) : zIndex,
7677
+ ...getPositionWithMargin(el) } :
7615
7678
 
7616
7679
  false;
7617
7680
  }
@@ -7795,7 +7858,7 @@
7795
7858
  },
7796
7859
 
7797
7860
  setState(state, animate) {if (animate === void 0) {animate = true;}
7798
- state = assign({ filter: { '': '' }, sort: [] }, state);
7861
+ state = { filter: { '': '' }, sort: [], ...state };
7799
7862
 
7800
7863
  trigger(this.$el, 'beforeFilter', [this, state]);
7801
7864
 
@@ -7895,7 +7958,7 @@
7895
7958
  }
7896
7959
 
7897
7960
  function sortItems(nodes, sort, order) {
7898
- return assign([], nodes).sort(
7961
+ return [...nodes].sort(
7899
7962
  (a, b) =>
7900
7963
  data(a, sort).localeCompare(data(b, sort), undefined, { numeric: true }) * (
7901
7964
  order === 'asc' || -1));
@@ -7934,7 +7997,8 @@
7934
7997
  return "scale3d(" + value + ", " + value + ", 1)";
7935
7998
  }
7936
7999
 
7937
- var Animations$1 = assign({}, Animations$2, {
8000
+ var Animations$1 = {
8001
+ ...Animations$2,
7938
8002
  fade: {
7939
8003
  show() {
7940
8004
  return [{ opacity: 0 }, { opacity: 1 }];
@@ -7966,7 +8030,7 @@
7966
8030
  { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },
7967
8031
  { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }];
7968
8032
 
7969
- } } });
8033
+ } } };
7970
8034
 
7971
8035
  function Transitioner$1(prev, next, dir, _ref) {let { animation, easing } = _ref;
7972
8036
  const { percent, translate, show = noop } = animation;
@@ -8440,12 +8504,6 @@
8440
8504
  } },
8441
8505
 
8442
8506
 
8443
- events: {
8444
- itemshown() {
8445
- this.$update(this.list);
8446
- } },
8447
-
8448
-
8449
8507
  methods: {
8450
8508
  show(index, force) {if (force === void 0) {force = false;}
8451
8509
  if (this.dragging || !this.length) {
@@ -8527,20 +8585,13 @@
8527
8585
  },
8528
8586
 
8529
8587
  _show(prev, next, force) {
8530
- this._transitioner = this._getTransitioner(
8531
- prev,
8532
- next,
8533
- this.dir,
8534
- assign(
8535
- {
8588
+ this._transitioner = this._getTransitioner(prev, next, this.dir, {
8536
8589
  easing: force ?
8537
8590
  next.offsetWidth < 600 ?
8538
8591
  'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
8539
8592
  'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
8540
- this.easing },
8541
-
8542
- this.transitionOptions));
8543
-
8593
+ this.easing,
8594
+ ...this.transitionOptions });
8544
8595
 
8545
8596
 
8546
8597
  if (!force && !prev) {
@@ -8605,7 +8656,7 @@
8605
8656
 
8606
8657
  computed: {
8607
8658
  animation(_ref) {let { animation, Animations } = _ref;
8608
- return assign(Animations[animation] || Animations.slide, { name: animation });
8659
+ return { ...(Animations[animation] || Animations.slide), name: animation };
8609
8660
  },
8610
8661
 
8611
8662
  transitionOptions() {
@@ -8614,19 +8665,15 @@
8614
8665
 
8615
8666
 
8616
8667
  events: {
8617
- 'itemshow itemhide itemshown itemhidden'(_ref2) {let { target } = _ref2;
8618
- this.$update(target);
8619
- },
8620
-
8621
- beforeitemshow(_ref3) {let { target } = _ref3;
8668
+ beforeitemshow(_ref2) {let { target } = _ref2;
8622
8669
  addClass(target, this.clsActive);
8623
8670
  },
8624
8671
 
8625
- itemshown(_ref4) {let { target } = _ref4;
8672
+ itemshown(_ref3) {let { target } = _ref3;
8626
8673
  addClass(target, this.clsActivated);
8627
8674
  },
8628
8675
 
8629
- itemhidden(_ref5) {let { target } = _ref5;
8676
+ itemhidden(_ref4) {let { target } = _ref4;
8630
8677
  removeClass(target, this.clsActive, this.clsActivated);
8631
8678
  } } };
8632
8679
 
@@ -8828,28 +8875,20 @@
8828
8875
  if (type === 'image' || src.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i)) {
8829
8876
  try {
8830
8877
  const { width, height } = await getImage(src, attrs.srcset, attrs.size);
8831
- this.setItem(
8832
- item,
8833
- createEl('img', assign({ src, width, height, alt }, attrs)));
8834
-
8878
+ this.setItem(item, createEl('img', { src, width, height, alt, ...attrs }));
8835
8879
  } catch (e) {
8836
8880
  this.setError(item);
8837
8881
  }
8838
8882
 
8839
8883
  // Video
8840
8884
  } else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
8841
- const video = createEl(
8842
- 'video',
8843
- assign(
8844
- {
8885
+ const video = createEl('video', {
8845
8886
  src,
8846
8887
  poster,
8847
8888
  controls: '',
8848
8889
  playsinline: '',
8849
- 'uk-video': "" + this.videoAutoplay },
8850
-
8851
- attrs));
8852
-
8890
+ 'uk-video': "" + this.videoAutoplay,
8891
+ ...attrs });
8853
8892
 
8854
8893
 
8855
8894
  on(video, 'loadedmetadata', () => {
@@ -8862,17 +8901,12 @@
8862
8901
  } else if (type === 'iframe' || src.match(/\.(html|php)($|\?)/i)) {
8863
8902
  this.setItem(
8864
8903
  item,
8865
- createEl(
8866
- 'iframe',
8867
- assign(
8868
- {
8904
+ createEl('iframe', {
8869
8905
  src,
8870
8906
  frameborder: '0',
8871
8907
  allowfullscreen: '',
8872
- class: 'uk-lightbox-iframe' },
8873
-
8874
- attrs)));
8875
-
8908
+ class: 'uk-lightbox-iframe',
8909
+ ...attrs }));
8876
8910
 
8877
8911
 
8878
8912
 
@@ -8884,19 +8918,14 @@
8884
8918
  {
8885
8919
  this.setItem(
8886
8920
  item,
8887
- createEl(
8888
- 'iframe',
8889
- assign(
8890
- {
8891
- src: "https://www.youtube" + (matches[1] || '') + ".com/embed/" +
8892
- matches[2] + (
8921
+ createEl('iframe', {
8922
+ src: "https://www.youtube" + (matches[1] || '') + ".com/embed/" + matches[2] + (
8893
8923
  matches[3] ? "?" + matches[3] : ''),
8894
- width: 1920,
8895
- height: 1080 },
8896
-
8897
- iframeAttrs,
8898
- attrs)));
8899
8924
 
8925
+ width: 1920,
8926
+ height: 1080,
8927
+ ...iframeAttrs,
8928
+ ...attrs }));
8900
8929
 
8901
8930
 
8902
8931
 
@@ -8916,19 +8945,14 @@
8916
8945
 
8917
8946
  this.setItem(
8918
8947
  item,
8919
- createEl(
8920
- 'iframe',
8921
- assign(
8922
- {
8948
+ createEl('iframe', {
8923
8949
  src: "https://player.vimeo.com/video/" + matches[1] + (
8924
8950
  matches[2] ? "?" + matches[2] : ''),
8925
8951
 
8926
8952
  width,
8927
- height },
8928
-
8929
- iframeAttrs,
8930
- attrs)));
8931
-
8953
+ height,
8954
+ ...iframeAttrs,
8955
+ ...attrs }));
8932
8956
 
8933
8957
 
8934
8958
  } catch (e) {
@@ -9030,8 +9054,7 @@
9030
9054
  index = findIndex(items, (_ref2) => {let { source: src } = _ref2;return source === src;});
9031
9055
  }
9032
9056
 
9033
- this.panel =
9034
- this.panel || this.$create('lightboxPanel', assign({}, this.$props, { items }));
9057
+ this.panel = this.panel || this.$create('lightboxPanel', { ...this.$props, items });
9035
9058
 
9036
9059
  on(this.panel.$el, 'hidden', () => this.panel = false);
9037
9060
 
@@ -9225,7 +9248,7 @@
9225
9248
 
9226
9249
 
9227
9250
  events: {
9228
- bgimageload() {
9251
+ load() {
9229
9252
  this.$emit();
9230
9253
  } },
9231
9254
 
@@ -9236,50 +9259,44 @@
9236
9259
  },
9237
9260
 
9238
9261
  getCss(percent) {
9239
- return keys(this.props).reduce(
9240
- (css, prop) => {
9262
+ const css = { transform: '', filter: '' };
9263
+ for (const prop in this.props) {
9241
9264
  this.props[prop](css, percent);
9242
- return css;
9243
- },
9244
- { transform: '', filter: '' });
9245
-
9265
+ }
9266
+ return css;
9246
9267
  } } };
9247
9268
 
9248
9269
 
9249
9270
 
9250
- function transformFn(prop, el, steps) {
9251
- const unit = getUnit(steps) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
9271
+ function transformFn(prop, el, stops) {
9272
+ const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
9273
+ let transformFn;
9252
9274
 
9253
9275
  if (prop === 'x' || prop === 'y') {
9254
9276
  prop = "translate" + ucfirst(prop);
9277
+ transformFn = (stop) => toFloat(toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
9255
9278
  }
9256
9279
 
9257
- steps = steps.map(toFloat);
9258
-
9259
- if (steps.length === 1) {
9260
- steps.unshift(prop === 'scale' ? 1 : 0);
9280
+ if (stops.length === 1) {
9281
+ stops.unshift(prop === 'scale' ? 1 : 0);
9261
9282
  }
9262
9283
 
9263
- return (css, percent) => {
9264
- let value = getValue(steps, percent);
9265
-
9266
- if (startsWith(prop, 'translate')) {
9267
- value = toFloat(value).toFixed(unit === 'px' ? 0 : 6);
9268
- }
9284
+ stops = parseStops(stops, transformFn);
9269
9285
 
9270
- css.transform += " " + prop + "(" + value + unit + ")";
9286
+ return (css, percent) => {
9287
+ css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
9271
9288
  };
9272
9289
  }
9273
9290
 
9274
- function colorFn(prop, el, steps) {
9275
- if (steps.length === 1) {
9276
- steps.unshift(getCssValue(el, prop, ''));
9291
+ function colorFn(prop, el, stops) {
9292
+ if (stops.length === 1) {
9293
+ stops.unshift(getCssValue(el, prop, ''));
9277
9294
  }
9278
9295
 
9279
- steps = steps.map((step) => parseColor(el, step));
9296
+ stops = parseStops(stops, (stop) => parseColor(el, stop));
9280
9297
 
9281
9298
  return (css, percent) => {
9282
- const [start, end, p] = getStep(steps, percent);
9299
+ const [start, end, p] = getStop(stops, percent);
9283
9300
  const value = start.
9284
9301
  map((value, i) => {
9285
9302
  value += p * (end[i] - value);
@@ -9299,85 +9316,83 @@
9299
9316
  map(toFloat);
9300
9317
  }
9301
9318
 
9302
- function filterFn(prop, el, steps) {
9303
- if (steps.length === 1) {
9304
- steps.unshift(0);
9319
+ function filterFn(prop, el, stops) {
9320
+ if (stops.length === 1) {
9321
+ stops.unshift(0);
9305
9322
  }
9306
9323
 
9307
- const unit = getUnit(steps) || { blur: 'px', hue: 'deg' }[prop] || '%';
9324
+ const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
9308
9325
  prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
9309
- steps = steps.map(toFloat);
9326
+ stops = parseStops(stops);
9310
9327
 
9311
9328
  return (css, percent) => {
9312
- const value = getValue(steps, percent);
9329
+ const value = getValue(stops, percent);
9313
9330
  css.filter += " " + prop + "(" + (value + unit) + ")";
9314
9331
  };
9315
9332
  }
9316
9333
 
9317
- function cssPropFn(prop, el, steps) {
9318
- if (steps.length === 1) {
9319
- steps.unshift(getCssValue(el, prop, ''));
9334
+ function cssPropFn(prop, el, stops) {
9335
+ if (stops.length === 1) {
9336
+ stops.unshift(getCssValue(el, prop, ''));
9320
9337
  }
9321
9338
 
9322
- steps = steps.map(toFloat);
9339
+ stops = parseStops(stops);
9323
9340
 
9324
9341
  return (css, percent) => {
9325
- css[prop] = getValue(steps, percent);
9342
+ css[prop] = getValue(stops, percent);
9326
9343
  };
9327
9344
  }
9328
9345
 
9329
- function strokeFn(prop, el, steps) {
9330
- if (steps.length === 1) {
9331
- steps.unshift(0);
9346
+ function strokeFn(prop, el, stops) {
9347
+ if (stops.length === 1) {
9348
+ stops.unshift(0);
9332
9349
  }
9333
9350
 
9334
- const unit = getUnit(steps);
9335
- steps = steps.map(toFloat);
9351
+ const unit = getUnit(stops);
9352
+ const length = getMaxPathLength(el);
9353
+ stops = parseStops(stops.reverse(), (stop) => {
9354
+ stop = toFloat(stop);
9355
+ return unit === '%' ? stop * length / 100 : stop;
9356
+ });
9336
9357
 
9337
- if (!steps.some((step) => step)) {
9358
+ if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
9338
9359
  return noop;
9339
9360
  }
9340
9361
 
9341
- const length = getMaxPathLength(el);
9342
9362
  css(el, 'strokeDasharray', length);
9343
9363
 
9344
- if (unit === '%') {
9345
- steps = steps.map((step) => step * length / 100);
9346
- }
9347
-
9348
- steps = steps.reverse();
9349
-
9350
9364
  return (css, percent) => {
9351
- css.strokeDashoffset = getValue(steps, percent);
9365
+ css.strokeDashoffset = getValue(stops, percent);
9352
9366
  };
9353
9367
  }
9354
9368
 
9355
- function backgroundFn(prop, el, steps) {
9356
- if (steps.length === 1) {
9357
- steps.unshift(0);
9369
+ function backgroundFn(prop, el, stops) {
9370
+ if (stops.length === 1) {
9371
+ stops.unshift(0);
9358
9372
  }
9359
9373
 
9360
9374
  prop = prop.substr(-1);
9361
9375
  const attr = prop === 'y' ? 'height' : 'width';
9362
- steps = steps.map((step) => toPx(step, attr, el));
9376
+ stops = parseStops(stops, (stop) => toPx(stop, attr, el));
9363
9377
 
9364
9378
  const bgPos = getCssValue(el, "background-position-" + prop, '');
9365
9379
 
9366
9380
  return getCssValue(el, 'backgroundSize', '') === 'cover' ?
9367
- backgroundCoverFn(prop, el, steps, bgPos, attr) :
9368
- setBackgroundPosFn(prop, steps, bgPos);
9381
+ backgroundCoverFn(prop, el, stops, bgPos, attr) :
9382
+ setBackgroundPosFn(prop, stops, bgPos);
9369
9383
  }
9370
9384
 
9371
- function backgroundCoverFn(prop, el, steps, bgPos, attr) {
9385
+ function backgroundCoverFn(prop, el, stops, bgPos, attr) {
9372
9386
  const dimImage = getBackgroundImageDimensions(el);
9373
9387
 
9374
9388
  if (!dimImage.width) {
9375
9389
  return noop;
9376
9390
  }
9377
9391
 
9378
- const min = Math.min(...steps);
9379
- const max = Math.max(...steps);
9380
- const down = steps.indexOf(min) < steps.indexOf(max);
9392
+ const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
9393
+ const min = Math.min(...values);
9394
+ const max = Math.max(...values);
9395
+ const down = values.indexOf(min) < values.indexOf(max);
9381
9396
 
9382
9397
  const diff = max - min;
9383
9398
  let pos = (down ? -diff : 0) - (down ? min : max);
@@ -9402,7 +9417,7 @@
9402
9417
 
9403
9418
  const dim = Dimensions.cover(dimImage, dimEl);
9404
9419
 
9405
- const fn = setBackgroundPosFn(prop, steps, pos + "px");
9420
+ const fn = setBackgroundPosFn(prop, stops, pos + "px");
9406
9421
  return (css, percent) => {
9407
9422
  fn(css, percent);
9408
9423
  css.backgroundSize = dim.width + "px " + dim.height + "px";
@@ -9410,9 +9425,9 @@
9410
9425
  };
9411
9426
  }
9412
9427
 
9413
- function setBackgroundPosFn(prop, steps, pos) {
9428
+ function setBackgroundPosFn(prop, stops, pos) {
9414
9429
  return function (css, percent) {
9415
- css["background-position-" + prop] = "calc(" + pos + " + " + getValue(steps, percent) + "px)";
9430
+ css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
9416
9431
  };
9417
9432
  }
9418
9433
 
@@ -9431,8 +9446,9 @@
9431
9446
  if (!image.naturalWidth) {
9432
9447
  image.onload = () => {
9433
9448
  dimensions[src] = toDimensions(image);
9434
- trigger(el, 'bgimageload');
9449
+ trigger(el, 'load');
9435
9450
  };
9451
+ return toDimensions(image);
9436
9452
  }
9437
9453
  }
9438
9454
 
@@ -9446,27 +9462,71 @@
9446
9462
 
9447
9463
  }
9448
9464
 
9449
- function getStep(steps, percent) {
9450
- const count = steps.length - 1;
9451
- const index = Math.min(Math.floor(count * percent), count - 1);
9465
+ function parseStops(stops, fn) {if (fn === void 0) {fn = toFloat;}
9466
+ const result = [];
9467
+ const { length } = stops;
9468
+ let nullIndex = 0;
9469
+ for (let i = 0; i < length; i++) {
9470
+ let [value, percent] = isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
9471
+ value = fn(value);
9472
+ percent = percent ? toFloat(percent) / 100 : null;
9473
+
9474
+ if (i === 0) {
9475
+ if (percent === null) {
9476
+ percent = 0;
9477
+ } else if (percent) {
9478
+ result.push([value, 0]);
9479
+ }
9480
+ } else if (i === length - 1) {
9481
+ if (percent === null) {
9482
+ percent = 1;
9483
+ } else if (percent !== 1) {
9484
+ result.push([value, percent]);
9485
+ percent = 1;
9486
+ }
9487
+ }
9488
+
9489
+ result.push([value, percent]);
9490
+
9491
+ if (percent === null) {
9492
+ nullIndex++;
9493
+ } else if (nullIndex) {
9494
+ const leftPercent = result[i - nullIndex - 1][1];
9495
+ const p = (percent - leftPercent) / (nullIndex + 1);
9496
+ for (let j = nullIndex; j > 0; j--) {
9497
+ result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
9498
+ }
9499
+
9500
+ nullIndex = 0;
9501
+ }
9502
+ }
9503
+
9504
+ return result;
9505
+ }
9506
+
9507
+ function getStop(stops, percent) {
9508
+ const index = findIndex(stops.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
9509
+ return [
9510
+ stops[index - 1][0],
9511
+ stops[index][0],
9512
+ (percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
9452
9513
 
9453
- return steps.
9454
- slice(index, index + 2).
9455
- concat(percent === 1 ? 1 : percent % (1 / count) * count);
9456
9514
  }
9457
9515
 
9458
- function getValue(steps, percent) {
9459
- const [start, end, p] = getStep(steps, percent);
9516
+ function getValue(stops, percent) {
9517
+ const [start, end, p] = getStop(stops, percent);
9460
9518
  return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
9461
9519
  }
9462
9520
 
9463
- function getUnit(steps, defaultUnit) {
9464
- return (
9465
- steps.reduce(
9466
- (unit, step) => unit || isString(step) && step.replace(/[\d-]/g, '').trim(),
9467
- '') ||
9468
- defaultUnit);
9469
-
9521
+ const unitRe = /^-?\d+([^\s]*)/;
9522
+ function getUnit(stops, defaultUnit) {
9523
+ for (const stop of stops) {
9524
+ const match = stop.match == null ? void 0 : stop.match(unitRe);
9525
+ if (match) {
9526
+ return match[1];
9527
+ }
9528
+ }
9529
+ return defaultUnit;
9470
9530
  }
9471
9531
 
9472
9532
  function getCssValue(el, prop, value) {
@@ -9578,6 +9638,13 @@
9578
9638
 
9579
9639
  events: ['resize'] } };
9580
9640
 
9641
+ var SliderPreload = {
9642
+ mixins: [Lazyload],
9643
+
9644
+ connected() {
9645
+ this.lazyload(this.slides, this.getAdjacentSlides);
9646
+ } };
9647
+
9581
9648
  function Transitioner (prev, next, dir, _ref) {let { center, easing, list } = _ref;
9582
9649
  const deferred = new Deferred();
9583
9650
 
@@ -9744,7 +9811,7 @@
9744
9811
  }
9745
9812
 
9746
9813
  var slider = {
9747
- mixins: [Class, Slider, SliderReactive],
9814
+ mixins: [Class, Slider, SliderReactive, SliderPreload],
9748
9815
 
9749
9816
  props: {
9750
9817
  center: Boolean,
@@ -9796,48 +9863,39 @@
9796
9863
  return ~index ? index : this.length - 1;
9797
9864
  },
9798
9865
 
9799
- sets(_ref2) {let { sets } = _ref2;
9800
- if (!sets) {
9866
+ sets(_ref2) {let { sets: enabled } = _ref2;
9867
+ if (!enabled) {
9801
9868
  return;
9802
9869
  }
9803
9870
 
9804
- const width = dimensions$1(this.list).width / (this.center ? 2 : 1);
9805
-
9806
9871
  let left = 0;
9807
- let leftCenter = width;
9808
- let slideLeft = 0;
9872
+ const sets = [];
9873
+ const width = dimensions$1(this.list).width;
9874
+ for (let i in this.slides) {
9875
+ const slideWidth = dimensions$1(this.slides[i]).width;
9809
9876
 
9810
- sets = sortBy$1(this.slides, 'offsetLeft').reduce((sets, slide, i) => {
9811
- const slideWidth = dimensions$1(slide).width;
9812
- const slideRight = slideLeft + slideWidth;
9813
-
9814
- if (slideRight > left) {
9815
- if (!this.center && i > this.maxIndex) {
9816
- i = this.maxIndex;
9817
- }
9877
+ if (left + slideWidth > width) {
9878
+ left = 0;
9879
+ }
9818
9880
 
9819
- if (!includes(sets, i)) {
9820
- const cmp = this.slides[i + 1];
9821
- if (
9822
- this.center &&
9823
- cmp &&
9824
- slideWidth < leftCenter - dimensions$1(cmp).width / 2)
9825
- {
9826
- leftCenter -= slideWidth;
9827
- } else {
9828
- leftCenter = width;
9829
- sets.push(i);
9830
- left = slideLeft + width + (this.center ? slideWidth / 2 : 0);
9831
- }
9881
+ if (this.center) {
9882
+ if (
9883
+ left < width / 2 &&
9884
+ left + slideWidth + dimensions$1(this.slides[+i + 1]).width / 2 > width / 2)
9885
+ {
9886
+ sets.push(+i);
9887
+ left = width / 2 - slideWidth / 2;
9832
9888
  }
9889
+ } else if (left === 0) {
9890
+ sets.push(Math.min(+i, this.maxIndex));
9833
9891
  }
9834
9892
 
9835
- slideLeft += slideWidth;
9893
+ left += slideWidth;
9894
+ }
9836
9895
 
9896
+ if (sets.length) {
9837
9897
  return sets;
9838
- }, []);
9839
-
9840
- return !isEmpty(sets) && sets;
9898
+ }
9841
9899
  },
9842
9900
 
9843
9901
  transitionOptions() {
@@ -9869,15 +9927,7 @@
9869
9927
  this._translate(1);
9870
9928
  }
9871
9929
 
9872
- const actives = this._getTransitioner(this.index).getActives();
9873
- const activeClasses = [
9874
- this.clsActive,
9875
- (!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
9876
- ''];
9877
-
9878
- for (const slide of this.slides) {
9879
- toggleClass(slide, activeClasses, includes(actives, slide));
9880
- }
9930
+ this.updateActiveClasses();
9881
9931
  },
9882
9932
 
9883
9933
  events: ['resize'] },
@@ -9925,6 +9975,10 @@
9925
9975
  if (~this.prevIndex) {
9926
9976
  addClass(this._getTransitioner().getItemIn(), this.clsActive);
9927
9977
  }
9978
+ },
9979
+
9980
+ itemshown() {
9981
+ this.updateActiveClasses();
9928
9982
  } },
9929
9983
 
9930
9984
 
@@ -9962,6 +10016,18 @@
9962
10016
  }
9963
10017
  },
9964
10018
 
10019
+ updateActiveClasses() {
10020
+ const actives = this._getTransitioner(this.index).getActives();
10021
+ const activeClasses = [
10022
+ this.clsActive,
10023
+ (!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
10024
+ ''];
10025
+
10026
+ for (const slide of this.slides) {
10027
+ toggleClass(slide, activeClasses, includes(actives, slide));
10028
+ }
10029
+ },
10030
+
9965
10031
  getValidIndex(index, prevIndex) {if (index === void 0) {index = this.index;}if (prevIndex === void 0) {prevIndex = this.prevIndex;}
9966
10032
  index = this.getIndex(index, prevIndex);
9967
10033
 
@@ -9981,6 +10047,25 @@
9981
10047
  } while (index !== prev);
9982
10048
 
9983
10049
  return index;
10050
+ },
10051
+
10052
+ getAdjacentSlides() {
10053
+ const { width } = dimensions$1(this.list);
10054
+ const left = -width;
10055
+ const right = width * 2;
10056
+ const slideWidth = dimensions$1(this.slides[this.index]).width;
10057
+ const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
10058
+ const slides = new Set();
10059
+ for (const i of [-1, 1]) {
10060
+ let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
10061
+ let j = 0;
10062
+ do {
10063
+ const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
10064
+ currentLeft += dimensions$1(slide).width * i;
10065
+ slides.add(slide);
10066
+ } while (this.slides.length > j && currentLeft > left && currentLeft < right);
10067
+ }
10068
+ return Array.from(slides);
9984
10069
  } } };
9985
10070
 
9986
10071
 
@@ -10067,7 +10152,8 @@
10067
10152
  return isIn(type) ^ dir < 0 ? percent : 1 - percent;
10068
10153
  }
10069
10154
 
10070
- var Animations = assign({}, Animations$2, {
10155
+ var Animations = {
10156
+ ...Animations$2,
10071
10157
  fade: {
10072
10158
  show() {
10073
10159
  return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
@@ -10156,10 +10242,10 @@
10156
10242
  { transform: translate(-30 * percent), zIndex: -1 },
10157
10243
  { transform: translate(100 * (1 - percent)), zIndex: 0 }];
10158
10244
 
10159
- } } });
10245
+ } } };
10160
10246
 
10161
10247
  var slideshow = {
10162
- mixins: [Class, Slideshow, SliderReactive],
10248
+ mixins: [Class, Slideshow, SliderReactive, SliderPreload],
10163
10249
 
10164
10250
  props: {
10165
10251
  ratio: String,
@@ -10202,7 +10288,13 @@
10202
10288
  height > 0 && css(this.list, 'minHeight', height);
10203
10289
  },
10204
10290
 
10205
- events: ['resize'] } };
10291
+ events: ['resize'] },
10292
+
10293
+
10294
+ methods: {
10295
+ getAdjacentSlides() {
10296
+ return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
10297
+ } } };
10206
10298
 
10207
10299
  var sortable = {
10208
10300
  mixins: [Class, Animate],
@@ -10375,7 +10467,7 @@
10375
10467
 
10376
10468
  this.touched = new Set([this]);
10377
10469
  this.placeholder = placeholder;
10378
- this.origin = assign({ target, index: index(placeholder) }, this.pos);
10470
+ this.origin = { target, index: index(placeholder), ...this.pos };
10379
10471
 
10380
10472
  on(document, pointerMove, this.move);
10381
10473
  on(document, pointerUp, this.end);
@@ -10916,6 +11008,7 @@
10916
11008
  }
10917
11009
 
10918
11010
  function chunk(files, size) {
11011
+ files = toArray(files);
10919
11012
  const chunks = [];
10920
11013
  for (let i = 0; i < files.length; i += size) {
10921
11014
  chunks.push(files.slice(i, i + size));