uikit 3.11.2-dev.3dfa2c50b → 3.11.2-dev.45194f70c

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 (147) hide show
  1. package/CHANGELOG.md +40 -19
  2. package/dist/css/uikit-core-rtl.css +86 -185
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +86 -185
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +88 -191
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +88 -191
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +3 -3
  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 +29 -68
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +30 -70
  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 +115 -78
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +115 -78
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +79 -58
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +115 -78
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +35 -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 +2 -2
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +408 -326
  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 +646 -528
  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 +34 -1
  46. package/src/js/components/countdown.js +2 -2
  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 +18 -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/core/accordion.js +6 -1
  57. package/src/js/core/alert.js +1 -2
  58. package/src/js/core/core.js +2 -21
  59. package/src/js/core/cover.js +5 -1
  60. package/src/js/core/drop.js +3 -1
  61. package/src/js/core/form-custom.js +2 -2
  62. package/src/js/core/height-viewport.js +3 -0
  63. package/src/js/core/icon.js +13 -6
  64. package/src/js/core/img.js +131 -122
  65. package/src/js/core/modal.js +1 -2
  66. package/src/js/core/navbar.js +3 -3
  67. package/src/js/core/sticky.js +51 -57
  68. package/src/js/core/svg.js +10 -6
  69. package/src/js/core/switcher.js +6 -1
  70. package/src/js/core/toggle.js +5 -2
  71. package/src/js/core/video.js +13 -1
  72. package/src/js/mixin/internal/animate-slide.js +9 -12
  73. package/src/js/mixin/lazyload.js +16 -0
  74. package/src/js/mixin/parallax.js +116 -79
  75. package/src/js/mixin/slider.js +8 -22
  76. package/src/js/mixin/slideshow.js +2 -6
  77. package/src/js/mixin/togglable.js +1 -2
  78. package/src/js/util/ajax.js +15 -14
  79. package/src/js/util/animation.js +7 -12
  80. package/src/js/util/dimensions.js +4 -4
  81. package/src/js/util/dom.js +37 -31
  82. package/src/js/util/index.js +1 -0
  83. package/src/js/util/lang.js +7 -6
  84. package/src/js/util/observer.js +36 -0
  85. package/src/js/util/options.js +2 -11
  86. package/src/js/util/player.js +5 -4
  87. package/src/js/util/selector.js +12 -18
  88. package/src/js/util/style.js +4 -4
  89. package/src/less/components/base.less +10 -33
  90. package/src/less/components/form-range.less +48 -95
  91. package/src/less/components/form.less +0 -1
  92. package/src/less/components/height.less +3 -0
  93. package/src/less/components/leader.less +0 -1
  94. package/src/less/components/lightbox.less +0 -1
  95. package/src/less/components/modal.less +3 -7
  96. package/src/less/components/progress.less +14 -36
  97. package/src/less/components/slider.less +0 -3
  98. package/src/less/components/slideshow.less +0 -3
  99. package/src/less/components/text.less +16 -32
  100. package/src/scss/components/base.scss +10 -33
  101. package/src/scss/components/form-range.scss +48 -95
  102. package/src/scss/components/form.scss +0 -1
  103. package/src/scss/components/height.scss +3 -0
  104. package/src/scss/components/leader.scss +0 -1
  105. package/src/scss/components/lightbox.scss +0 -1
  106. package/src/scss/components/modal.scss +3 -7
  107. package/src/scss/components/progress.scss +14 -36
  108. package/src/scss/components/slider.scss +0 -3
  109. package/src/scss/components/slideshow.scss +0 -3
  110. package/src/scss/components/text.scss +16 -32
  111. package/src/scss/mixins-theme.scss +1 -1
  112. package/src/scss/mixins.scss +1 -1
  113. package/src/scss/variables-theme.scss +3 -3
  114. package/src/scss/variables.scss +3 -3
  115. package/tests/align.html +10 -10
  116. package/tests/animation.html +2 -2
  117. package/tests/article.html +2 -2
  118. package/tests/base.html +3 -3
  119. package/tests/card.html +10 -10
  120. package/tests/column.html +3 -3
  121. package/tests/comment.html +9 -9
  122. package/tests/dotnav.html +3 -3
  123. package/tests/image.html +296 -64
  124. package/tests/images/image-type.avif +0 -0
  125. package/tests/images/image-type.jpeg +0 -0
  126. package/tests/images/image-type.webp +0 -0
  127. package/tests/index.html +8 -8
  128. package/tests/lightbox.html +10 -10
  129. package/tests/marker.html +2 -2
  130. package/tests/modal.html +8 -9
  131. package/tests/navbar.html +2 -2
  132. package/tests/overlay.html +7 -7
  133. package/tests/parallax.html +16 -7
  134. package/tests/position.html +12 -12
  135. package/tests/slidenav.html +12 -12
  136. package/tests/slider.html +20 -20
  137. package/tests/sortable.html +1 -1
  138. package/tests/sticky-parallax.html +56 -71
  139. package/tests/svg.html +6 -6
  140. package/tests/table.html +11 -11
  141. package/tests/thumbnav.html +12 -12
  142. package/tests/transition.html +30 -30
  143. package/tests/utility.html +50 -33
  144. package/tests/video.html +1 -1
  145. package/tests/width.html +1 -1
  146. package/src/js/util/promise.js +0 -0
  147. package/tests/images/animated.gif +0 -0
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.3dfa2c50b | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.45194f70c | 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,
@@ -451,12 +439,6 @@
451
439
  return findAll(selector, getContext(selector, context));
452
440
  }
453
441
 
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
442
  function find(selector, context) {
461
443
  return toNode(_query(selector, context, 'querySelector'));
462
444
  }
@@ -465,6 +447,17 @@
465
447
  return toNodes(_query(selector, context, 'querySelectorAll'));
466
448
  }
467
449
 
450
+ const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
451
+ const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
452
+
453
+ function getContext(selector, context) {if (context === void 0) {context = document;}
454
+ return isString(selector) && isContextSelector(selector) || isDocument(context) ?
455
+ context :
456
+ context.ownerDocument;
457
+ }
458
+
459
+ const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
460
+
468
461
  function _query(selector, context, queryFn) {if (context === void 0) {context = document;}
469
462
  if (!selector || !isString(selector)) {
470
463
  return selector;
@@ -509,11 +502,6 @@
509
502
  }
510
503
  }
511
504
 
512
- const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
513
- const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
514
-
515
- const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
516
-
517
505
  const selectorRe = /.*?[^\\](?:,|$)/g;
518
506
 
519
507
  const splitSelector = memoize((selector) =>
@@ -539,13 +527,8 @@
539
527
  return names.join(' > ');
540
528
  }
541
529
 
542
- const escapeFn =
543
- inBrowser && window.CSS && CSS.escape ||
544
- function (css) {
545
- return css.replace(/([^\x7f-\uFFFF\w-])/g, (match) => "\\" + match);
546
- };
547
530
  function escape(css) {
548
- return isString(css) ? escapeFn.call(null, css) : '';
531
+ return isString(css) ? CSS.escape(css) : '';
549
532
  }
550
533
 
551
534
  function on() {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}
@@ -688,17 +671,14 @@
688
671
  }
689
672
 
690
673
  function ajax(url, options) {
691
- const env = assign(
692
- {
674
+ const env = {
693
675
  data: null,
694
676
  method: 'GET',
695
677
  headers: {},
696
678
  xhr: new XMLHttpRequest(),
697
679
  beforeSend: noop,
698
- responseType: '' },
699
-
700
- options);
701
-
680
+ responseType: '',
681
+ ...options };
702
682
 
703
683
  return Promise.resolve().
704
684
  then(() => env.beforeSend(env)).
@@ -749,8 +729,12 @@
749
729
  return new Promise((resolve, reject) => {
750
730
  const img = new Image();
751
731
 
752
- img.onerror = (e) => reject(e);
753
- img.onload = () => resolve(img);
732
+ img.onerror = (e) => {
733
+ reject(e);
734
+ };
735
+ img.onload = () => {
736
+ resolve(img);
737
+ };
754
738
 
755
739
  sizes && (img.sizes = sizes);
756
740
  srcset && (img.srcset = srcset);
@@ -777,7 +761,8 @@
777
761
 
778
762
 
779
763
  function css(element, property, value, priority) {if (priority === void 0) {priority = '';}
780
- return toNodes(element).map((element) => {
764
+ const elements = toNodes(element);
765
+ for (const element of elements) {
781
766
  if (isString(property)) {
782
767
  property = propName(property);
783
768
 
@@ -803,9 +788,8 @@
803
788
  priority = value;
804
789
  each(property, (value, property) => css(element, property, value, priority));
805
790
  }
806
-
807
- return element;
808
- })[0];
791
+ }
792
+ return elements[0];
809
793
  }
810
794
 
811
795
  function getStyles(element, pseudoElt) {
@@ -932,16 +916,11 @@
932
916
 
933
917
 
934
918
  addClass(element, 'uk-transition');
935
- css(
936
- element,
937
- assign(
938
- {
919
+ css(element, {
939
920
  transitionProperty: Object.keys(props).map(propName).join(','),
940
921
  transitionDuration: duration + "ms",
941
- transitionTimingFunction: timing },
942
-
943
- props));
944
-
922
+ transitionTimingFunction: timing,
923
+ ...props });
945
924
 
946
925
  })));
947
926
 
@@ -1041,8 +1020,8 @@
1041
1020
  const currentOffset = dimensions$1(element);
1042
1021
 
1043
1022
  if (element) {
1044
- const { pageYOffset, pageXOffset } = toWindow(element);
1045
- const offsetBy = { height: pageYOffset, width: pageXOffset };
1023
+ const { scrollY, scrollX } = toWindow(element);
1024
+ const offsetBy = { height: scrollY, width: scrollX };
1046
1025
 
1047
1026
  for (const dir in dirs$1) {
1048
1027
  for (const i in dirs$1[dir]) {
@@ -1108,8 +1087,8 @@
1108
1087
 
1109
1088
  if (css(element, 'position') === 'fixed') {
1110
1089
  const win = toWindow(element);
1111
- offset[0] += win.pageYOffset;
1112
- offset[1] += win.pageXOffset;
1090
+ offset[0] += win.scrollY;
1091
+ offset[1] += win.scrollX;
1113
1092
  return offset;
1114
1093
  }
1115
1094
  } while (element = element.offsetParent);
@@ -1200,8 +1179,8 @@
1200
1179
 
1201
1180
  const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
1202
1181
  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]);
1182
+ const unitRe$1 = /(?:v[hw]|%)$/;
1183
+ const parseUnit = memoize((str) => (str.match(unitRe$1) || [])[0]);
1205
1184
 
1206
1185
  function percent(base, value) {
1207
1186
  return base * toFloat(value) / 100;
@@ -1216,6 +1195,10 @@
1216
1195
  once(document, 'DOMContentLoaded', fn);
1217
1196
  }
1218
1197
 
1198
+ function isTag(element, tagName) {var _element$tagName;
1199
+ return (element == null ? void 0 : (_element$tagName = element.tagName) == null ? void 0 : _element$tagName.toLowerCase()) === tagName.toLowerCase();
1200
+ }
1201
+
1219
1202
  function empty(element) {
1220
1203
  return replaceChildren(element, '');
1221
1204
  }
@@ -1224,34 +1207,20 @@
1224
1207
  return isUndefined(html) ? $(parent).innerHTML : replaceChildren(parent, html);
1225
1208
  }
1226
1209
 
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
- }
1210
+ const replaceChildren = applyFn('replaceChildren');
1211
+ const prepend = applyFn('prepend');
1212
+ const append = applyFn('append');
1213
+ const before = applyFn('before');
1214
+ const after = applyFn('after');
1244
1215
 
1245
- function before(ref, element) {
1246
- const nodes = $$(element);
1247
- $(ref).before(...nodes);
1248
- return nodes;
1249
- }
1250
-
1251
- function after(ref, element) {
1252
- const nodes = $$(element);
1253
- $(ref).after(...nodes);
1254
- return nodes;
1216
+ function applyFn(fn) {
1217
+ return function (ref, element) {
1218
+ const nodes = toNodes(isString(element) ? fragment(element) : element);
1219
+ if (nodes.length) {
1220
+ $(ref)[fn](...nodes);
1221
+ }
1222
+ return unwrapSingle(nodes);
1223
+ };
1255
1224
  }
1256
1225
 
1257
1226
  function remove$1(element) {
@@ -1287,11 +1256,27 @@
1287
1256
  forEach((parent) => parent.replaceWith(...parent.childNodes));
1288
1257
  }
1289
1258
 
1259
+ const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
1260
+ const singleTagRe = /^<(\w+)\s*\/?>(?:<\/\1>)?$/;
1261
+
1290
1262
  function fragment(html) {
1291
- const template = document.createElement('template');
1292
- template.innerHTML = html;
1293
- const { childNodes } = template.content;
1294
- return childNodes.length > 1 ? toNodes(childNodes) : childNodes[0];
1263
+ const matches = singleTagRe.exec(html);
1264
+ if (matches) {
1265
+ return document.createElement(matches[1]);
1266
+ }
1267
+
1268
+ const container = document.createElement('div');
1269
+ if (fragmentRe.test(html)) {
1270
+ container.insertAdjacentHTML('beforeend', html.trim());
1271
+ } else {
1272
+ container.textContent = html;
1273
+ }
1274
+
1275
+ return unwrapSingle(container.childNodes);
1276
+ }
1277
+
1278
+ function unwrapSingle(nodes) {
1279
+ return nodes.length > 1 ? nodes : nodes[0];
1295
1280
  }
1296
1281
 
1297
1282
  function apply(node, fn) {
@@ -1320,6 +1305,19 @@
1320
1305
  return isString(str) && startsWith(str.trim(), '<');
1321
1306
  }
1322
1307
 
1308
+ const inBrowser = typeof window !== 'undefined';
1309
+ const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
1310
+
1311
+ const hasTouch = inBrowser && 'ontouchstart' in window;
1312
+ const hasPointerEvents = inBrowser && window.PointerEvent;
1313
+
1314
+ const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1315
+ const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1316
+ const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
1317
+ const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
1318
+ const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
1319
+ const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
1320
+
1323
1321
  /*
1324
1322
  Based on:
1325
1323
  Copyright (c) 2016 Wilson Page wilsonpage@me.com
@@ -1472,6 +1470,41 @@
1472
1470
  return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };
1473
1471
  }
1474
1472
 
1473
+ // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
1474
+ const hasIntersectionObserver =
1475
+ window.IntersectionObserver && 'isIntersecting' in IntersectionObserverEntry.prototype;
1476
+ function observeIntersection(targets, cb, options, intersecting) {if (intersecting === void 0) {intersecting = true;}
1477
+ if (!hasIntersectionObserver) {
1478
+ return;
1479
+ }
1480
+
1481
+ const observer = new IntersectionObserver((entries, observer) => {
1482
+ if (!intersecting || entries.some((entry) => entry.isIntersecting)) {
1483
+ cb(entries, observer);
1484
+ }
1485
+ }, options);
1486
+ for (const el of isArray(targets) ? targets : [targets]) {
1487
+ observer.observe(el);
1488
+ }
1489
+ return observer;
1490
+ }
1491
+
1492
+ const hasResizeObserver = window.ResizeObserver;
1493
+ function observeResize(targets, cb, options) {if (options === void 0) {options = { box: 'border-box' };}
1494
+ if (!hasResizeObserver) {
1495
+ return;
1496
+ }
1497
+
1498
+ const observer = new ResizeObserver((entries, observer) => {
1499
+ cb(entries, observer);
1500
+ });
1501
+ for (const el of isArray(targets) ? targets : [targets]) {
1502
+ observer.observe(el, options);
1503
+ }
1504
+
1505
+ return observer;
1506
+ }
1507
+
1475
1508
  const strats = {};
1476
1509
 
1477
1510
  strats.events =
@@ -1511,7 +1544,7 @@
1511
1544
 
1512
1545
  // extend strategy
1513
1546
  strats.computed = strats.methods = function (parentVal, childVal) {
1514
- return childVal ? parentVal ? assign({}, parentVal, childVal) : childVal : parentVal;
1547
+ return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
1515
1548
  };
1516
1549
 
1517
1550
  // data strategy
@@ -1651,11 +1684,11 @@
1651
1684
  }
1652
1685
 
1653
1686
  function isHTML5(el) {
1654
- return (el == null ? void 0 : el.tagName) === 'VIDEO';
1687
+ return isTag(el, 'video');
1655
1688
  }
1656
1689
 
1657
1690
  function isIFrame(el) {
1658
- return (el == null ? void 0 : el.tagName) === 'IFRAME' && (isYoutube(el) || isVimeo(el));
1691
+ return isTag(el, 'iframe') && (isYoutube(el) || isVimeo(el));
1659
1692
  }
1660
1693
 
1661
1694
  function isYoutube(el) {
@@ -1675,7 +1708,7 @@
1675
1708
 
1676
1709
  function post(el, cmd) {
1677
1710
  try {
1678
- el.contentWindow.postMessage(JSON.stringify(assign({ event: 'command' }, cmd)), '*');
1711
+ el.contentWindow.postMessage(JSON.stringify({ event: 'command', ...cmd }), '*');
1679
1712
  } catch (e) {
1680
1713
  // noop
1681
1714
  }
@@ -2055,6 +2088,7 @@
2055
2088
  flipPosition: flipPosition,
2056
2089
  toPx: toPx,
2057
2090
  ready: ready,
2091
+ isTag: isTag,
2058
2092
  empty: empty,
2059
2093
  html: html,
2060
2094
  replaceChildren: replaceChildren,
@@ -2148,6 +2182,9 @@
2148
2182
  memoize: memoize,
2149
2183
  Deferred: Deferred,
2150
2184
  MouseTracker: MouseTracker,
2185
+ hasIntersectionObserver: hasIntersectionObserver,
2186
+ observeIntersection: observeIntersection,
2187
+ observeResize: observeResize,
2151
2188
  mergeOptions: mergeOptions,
2152
2189
  parseOptions: parseOptions,
2153
2190
  play: play,
@@ -2325,8 +2362,8 @@
2325
2362
  };
2326
2363
 
2327
2364
  function runUpdates(types) {
2328
- for (const { read, write, events } of this.$options.update) {
2329
- if (!types.has('update') && (!events || !events.some((type) => types.has(type)))) {
2365
+ for (const { read, write, events = [] } of this.$options.update) {
2366
+ if (!types.has('update') && !events.some((type) => types.has(type))) {
2330
2367
  continue;
2331
2368
  }
2332
2369
 
@@ -2349,7 +2386,7 @@
2349
2386
  const {
2350
2387
  $options: { computed } } =
2351
2388
  this;
2352
- const values = assign({}, this._computeds);
2389
+ const values = { ...this._computeds };
2353
2390
  this._computeds = {};
2354
2391
 
2355
2392
  for (const key in computed) {
@@ -2447,17 +2484,28 @@
2447
2484
  }
2448
2485
  }
2449
2486
  }
2487
+ for (const { events = [] } of this.$options.update || []) {
2488
+ if (includes(events, 'scroll')) {
2489
+ registerScrollListener(this._uid, () => this.$emit('scroll'));
2490
+ break;
2491
+ }
2492
+ }
2450
2493
  };
2451
2494
 
2452
2495
  UIkit.prototype._unbindEvents = function () {
2453
2496
  this._events.forEach((unbind) => unbind());
2454
2497
  delete this._events;
2498
+ unregisterScrollListener(this._uid);
2455
2499
  };
2456
2500
 
2457
2501
  UIkit.prototype._initObservers = function () {
2458
2502
  this._observers = [initChildListObserver(this), initPropsObserver(this)];
2459
2503
  };
2460
2504
 
2505
+ UIkit.prototype.registerObserver = function (observer) {
2506
+ this._observers.push(observer);
2507
+ };
2508
+
2461
2509
  UIkit.prototype._disconnectObservers = function () {
2462
2510
  this._observers.forEach((observer) => observer == null ? void 0 : observer.disconnect());
2463
2511
  };
@@ -2534,7 +2582,7 @@
2534
2582
  el = isFunction(el) ? el.call(component) : el || component.$el;
2535
2583
 
2536
2584
  if (isArray(el)) {
2537
- el.forEach((el) => registerEvent(component, assign({}, event, { el }), key));
2585
+ el.forEach((el) => registerEvent(component, { ...event, el }, key));
2538
2586
  return;
2539
2587
  }
2540
2588
 
@@ -2646,6 +2694,27 @@
2646
2694
 
2647
2695
  return observer;
2648
2696
  }
2697
+
2698
+ const scrollListeners = new Map();
2699
+ let unbindScrollListener;
2700
+ function registerScrollListener(id, listener) {
2701
+ unbindScrollListener =
2702
+ unbindScrollListener ||
2703
+ on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
2704
+ passive: true,
2705
+ capture: true });
2706
+
2707
+
2708
+ scrollListeners.set(id, listener);
2709
+ }
2710
+
2711
+ function unregisterScrollListener(id) {
2712
+ scrollListeners.delete(id);
2713
+ if (unbindScrollListener && !scrollListeners.size) {
2714
+ unbindScrollListener();
2715
+ unbindScrollListener = null;
2716
+ }
2717
+ }
2649
2718
  }
2650
2719
 
2651
2720
  function instanceAPI (UIkit) {
@@ -2768,7 +2837,7 @@
2768
2837
  }
2769
2838
  };
2770
2839
 
2771
- const opt = isPlainObject(options) ? assign({}, options) : options.options;
2840
+ const opt = isPlainObject(options) ? { ...options } : options.options;
2772
2841
 
2773
2842
  opt.name = name;
2774
2843
 
@@ -2821,7 +2890,7 @@
2821
2890
  UIkit.data = '__uikit__';
2822
2891
  UIkit.prefix = 'uk-';
2823
2892
  UIkit.options = {};
2824
- UIkit.version = '3.11.2-dev.3dfa2c50b';
2893
+ UIkit.version = '3.11.2-dev.45194f70c';
2825
2894
 
2826
2895
  globalAPI(UIkit);
2827
2896
  hooksAPI(UIkit);
@@ -2846,28 +2915,8 @@
2846
2915
  };
2847
2916
 
2848
2917
  on(window, 'load resize', handleResize);
2849
- on(document, 'loadedmetadata load', handleResize, true);
2850
-
2851
- if ('ResizeObserver' in window) {
2852
- new ResizeObserver(handleResize).observe(document.documentElement);
2853
- }
2854
-
2855
- // throttle `scroll` event (Safari triggers multiple `scroll` events per frame)
2856
- let pending;
2857
- on(
2858
- window,
2859
- 'scroll',
2860
- (e) => {
2861
- if (pending) {
2862
- return;
2863
- }
2864
- pending = true;
2865
- fastdom.read(() => pending = false);
2866
-
2867
- UIkit.update(null, e.type);
2868
- },
2869
- { passive: true, capture: true });
2870
2918
 
2919
+ observeResize(document.documentElement, handleResize);
2871
2920
 
2872
2921
  let started = 0;
2873
2922
  on(
@@ -2989,6 +3038,19 @@
2989
3038
  !hasClass(this.$el, this.$name) && addClass(this.$el, this.$name);
2990
3039
  } };
2991
3040
 
3041
+ var Lazyload = {
3042
+ methods: {
3043
+ lazyload(observeTargets, targets) {if (observeTargets === void 0) {observeTargets = this.$el;}if (targets === void 0) {targets = this.$el;}
3044
+ this.registerObserver(
3045
+ observeIntersection(observeTargets, (entries, observer) => {
3046
+ for (const el of isArray(targets) ? targets : [targets]) {
3047
+ $$('img[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
3048
+ }
3049
+ observer.disconnect();
3050
+ }));
3051
+
3052
+ } } };
3053
+
2992
3054
  var Togglable = {
2993
3055
  props: {
2994
3056
  cls: Boolean,
@@ -3144,7 +3206,7 @@
3144
3206
  show ?
3145
3207
  Transition.start(
3146
3208
  el,
3147
- assign({}, initProps, { overflow: 'hidden', height: endHeight }),
3209
+ { ...initProps, overflow: 'hidden', height: endHeight },
3148
3210
  Math.round(duration * (1 - currentHeight / endHeight)),
3149
3211
  transition) :
3150
3212
 
@@ -3176,7 +3238,7 @@
3176
3238
  }
3177
3239
 
3178
3240
  var Accordion = {
3179
- mixins: [Class, Togglable],
3241
+ mixins: [Class, Lazyload, Togglable],
3180
3242
 
3181
3243
  props: {
3182
3244
  targets: String,
@@ -3232,6 +3294,10 @@
3232
3294
  } },
3233
3295
 
3234
3296
 
3297
+ connected() {
3298
+ this.lazyload();
3299
+ },
3300
+
3235
3301
  events: [
3236
3302
  {
3237
3303
  name: 'click',
@@ -3316,7 +3382,7 @@
3316
3382
  animation: [true],
3317
3383
  selClose: '.uk-alert-close',
3318
3384
  duration: 150,
3319
- hideProps: assign({ opacity: 0 }, Togglable.data.hideProps) },
3385
+ hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3320
3386
 
3321
3387
 
3322
3388
  events: [
@@ -3367,6 +3433,8 @@
3367
3433
  if (this.automute) {
3368
3434
  mute(this.$el);
3369
3435
  }
3436
+
3437
+ this.registerObserver(observeIntersection(this.$el, () => this.$emit('resize')));
3370
3438
  },
3371
3439
 
3372
3440
  update: {
@@ -3403,6 +3471,10 @@
3403
3471
  automute: true },
3404
3472
 
3405
3473
 
3474
+ connected() {
3475
+ this.registerObserver(observeResize(this.$el, () => this.$emit('resize')));
3476
+ },
3477
+
3406
3478
  update: {
3407
3479
  read() {
3408
3480
  const el = this.$el;
@@ -3528,7 +3600,7 @@
3528
3600
  let active$1;
3529
3601
 
3530
3602
  var drop = {
3531
- mixins: [Container, Position, Togglable],
3603
+ mixins: [Container, Lazyload, Position, Togglable],
3532
3604
 
3533
3605
  args: 'pos',
3534
3606
 
@@ -3582,6 +3654,7 @@
3582
3654
  mode: this.mode }).
3583
3655
  $el;
3584
3656
  attr(this.target, 'aria-haspopup', true);
3657
+ this.lazyload(this.target);
3585
3658
  }
3586
3659
  },
3587
3660
 
@@ -3957,7 +4030,7 @@
3957
4030
  name: 'change',
3958
4031
 
3959
4032
  handler() {
3960
- this.$update();
4033
+ this.$emit();
3961
4034
  } },
3962
4035
 
3963
4036
 
@@ -3969,7 +4042,7 @@
3969
4042
  },
3970
4043
 
3971
4044
  handler() {
3972
- this.$update();
4045
+ this.$emit();
3973
4046
  } }] };
3974
4047
 
3975
4048
  // Deprecated
@@ -4326,6 +4399,8 @@
4326
4399
  }
4327
4400
 
4328
4401
  var heightViewport = {
4402
+ mixins: [Class],
4403
+
4329
4404
  props: {
4330
4405
  expand: Boolean,
4331
4406
  offsetTop: Boolean,
@@ -4473,6 +4548,12 @@
4473
4548
 
4474
4549
  methods: {
4475
4550
  async getSvg() {
4551
+ if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4552
+ return new Promise((resolve) =>
4553
+ once(this.$el, 'load', () => resolve(this.getSvg())));
4554
+
4555
+ }
4556
+
4476
4557
  return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4477
4558
  },
4478
4559
 
@@ -4572,7 +4653,7 @@
4572
4653
  }
4573
4654
 
4574
4655
  function insertSVG(el, root) {
4575
- if (isVoidElement(root) || root.tagName === 'CANVAS') {
4656
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
4576
4657
  root.hidden = true;
4577
4658
 
4578
4659
  const next = root.nextElementSibling;
@@ -4584,11 +4665,7 @@
4584
4665
  }
4585
4666
 
4586
4667
  function equals(el, other) {
4587
- return isSVG(el) && isSVG(other) && innerHTML(el) === innerHTML(other);
4588
- }
4589
-
4590
- function isSVG(el) {
4591
- return (el == null ? void 0 : el.tagName) === 'svg';
4668
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4592
4669
  }
4593
4670
 
4594
4671
  function innerHTML(el) {
@@ -4669,14 +4746,14 @@
4669
4746
  },
4670
4747
 
4671
4748
  methods: {
4672
- getSvg() {
4749
+ async getSvg() {
4673
4750
  const icon = getIcon(this.icon);
4674
4751
 
4675
4752
  if (!icon) {
4676
- return Promise.reject('Icon not found.');
4753
+ throw 'Icon not found.';
4677
4754
  }
4678
4755
 
4679
- return Promise.resolve(icon);
4756
+ return icon;
4680
4757
  } } };
4681
4758
 
4682
4759
  const IconComponent = {
@@ -4734,10 +4811,17 @@
4734
4811
  const Spinner = {
4735
4812
  extends: IconComponent,
4736
4813
 
4737
- async connected() {
4738
- const svg = await this.svg;
4739
- svg && this.ratio !== 1 && css($('circle', svg), 'strokeWidth', 1 / this.ratio);
4740
- } };
4814
+ methods: {
4815
+ async getSvg() {
4816
+ const icon = await Icon.methods.getSvg.call(this);
4817
+
4818
+ if (this.ratio !== 1) {
4819
+ css($('circle', icon), 'strokeWidth', 1 / this.ratio);
4820
+ }
4821
+
4822
+ return icon;
4823
+ } } };
4824
+
4741
4825
 
4742
4826
 
4743
4827
  const parsed = {};
@@ -4775,120 +4859,93 @@
4775
4859
  return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4776
4860
  }
4777
4861
 
4862
+ const nativeLazyLoad = ('loading' in HTMLImageElement.prototype);
4863
+
4778
4864
  var img = {
4779
4865
  args: 'dataSrc',
4780
4866
 
4781
4867
  props: {
4782
4868
  dataSrc: String,
4783
- dataSrcset: Boolean,
4784
- sizes: String,
4785
- width: Number,
4786
- height: Number,
4869
+ sources: String,
4787
4870
  offsetTop: String,
4788
4871
  offsetLeft: String,
4789
- target: String },
4872
+ target: String,
4873
+ loading: String },
4790
4874
 
4791
4875
 
4792
4876
  data: {
4793
4877
  dataSrc: '',
4794
- dataSrcset: false,
4795
- sizes: false,
4796
- width: false,
4797
- height: false,
4878
+ sources: false,
4798
4879
  offsetTop: '50vh',
4799
4880
  offsetLeft: '50vw',
4800
- target: false },
4881
+ target: false,
4882
+ loading: 'lazy' },
4801
4883
 
4802
4884
 
4803
4885
  computed: {
4804
- cacheKey(_ref) {let { dataSrc } = _ref;
4805
- return this.$name + "." + dataSrc;
4806
- },
4807
-
4808
- width(_ref2) {let { width, dataWidth } = _ref2;
4809
- return width || dataWidth;
4810
- },
4811
-
4812
- height(_ref3) {let { height, dataHeight } = _ref3;
4813
- return height || dataHeight;
4814
- },
4815
-
4816
- sizes(_ref4) {let { sizes, dataSizes } = _ref4;
4817
- return sizes || dataSizes;
4818
- },
4819
-
4820
- isImg(_, $el) {
4821
- return isImg($el);
4822
- },
4823
-
4824
4886
  target: {
4825
- get(_ref5) {let { target } = _ref5;
4887
+ get(_ref) {let { target } = _ref;
4826
4888
  return [this.$el, ...queryAll(target, this.$el)];
4827
4889
  },
4828
4890
 
4829
4891
  watch() {
4830
- this.observe();
4831
- } },
4832
-
4833
-
4834
- offsetTop(_ref6) {let { offsetTop } = _ref6;
4835
- return toPx(offsetTop, 'height');
4836
- },
4892
+ this.$reset();
4893
+ } } },
4837
4894
 
4838
- offsetLeft(_ref7) {let { offsetLeft } = _ref7;
4839
- return toPx(offsetLeft, 'width');
4840
- } },
4841
4895
 
4842
4896
 
4843
4897
  connected() {
4844
- if (!window.IntersectionObserver) {
4845
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
4898
+ if (this.loading !== 'lazy' || !hasIntersectionObserver) {
4899
+ this.load();
4846
4900
  return;
4847
4901
  }
4848
4902
 
4849
- if (storage[this.cacheKey]) {
4850
- setSrcAttrs(this.$el, storage[this.cacheKey], this.dataSrcset, this.sizes);
4851
- } else if (this.isImg && this.width && this.height) {
4852
- setSrcAttrs(this.$el, getPlaceholderImage(this.width, this.height, this.sizes));
4903
+ if (nativeLazyLoad && isImg(this.$el)) {
4904
+ this.$el.loading = 'lazy';
4905
+ setSrcAttrs(this.$el);
4906
+
4907
+ if (this.target.length === 1) {
4908
+ return;
4909
+ }
4853
4910
  }
4854
4911
 
4855
- this.observer = new IntersectionObserver(this.load, {
4856
- rootMargin: this.offsetTop + "px " + this.offsetLeft + "px" });
4912
+ ensureSrcAttribute(this.$el);
4913
+
4914
+ this.registerObserver(
4915
+ observeIntersection(
4916
+ this.target,
4917
+ (entries, observer) => {
4918
+ this.load();
4919
+ observer.disconnect();
4920
+ },
4921
+ {
4922
+ rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
4923
+ this.offsetLeft,
4924
+ 'width') + "px" }));
4925
+
4926
+
4857
4927
 
4858
4928
 
4859
- requestAnimationFrame(this.observe);
4860
4929
  },
4861
4930
 
4862
4931
  disconnected() {
4863
- this.observer && this.observer.disconnect();
4932
+ if (this._data.image) {
4933
+ this._data.image.onload = '';
4934
+ }
4864
4935
  },
4865
4936
 
4866
4937
  update: {
4867
- read(_ref8) {let { image } = _ref8;
4868
- if (!this.observer) {
4938
+ write(store) {
4939
+ if (!this.observer || isImg(this.$el)) {
4869
4940
  return false;
4870
4941
  }
4871
4942
 
4872
- if (!image && document.readyState === 'complete') {
4873
- this.load(this.observer.takeRecords());
4874
- }
4875
-
4876
- if (this.isImg) {
4877
- return false;
4878
- }
4879
-
4880
- image &&
4881
- image.then(
4882
- (img) => img && img.currentSrc !== '' && setSrcAttrs(this.$el, currentSrc(img)));
4883
-
4884
- },
4885
-
4886
- write(data) {
4887
- if (this.dataSrcset && window.devicePixelRatio !== 1) {
4943
+ const srcset = data(this.$el, 'data-srcset');
4944
+ if (srcset && window.devicePixelRatio !== 1) {
4888
4945
  const bgSize = css(this.$el, 'backgroundSize');
4889
- if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === data.bgSize) {
4890
- data.bgSize = getSourceSize(this.dataSrcset, this.sizes);
4891
- css(this.$el, 'backgroundSize', data.bgSize + "px");
4946
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
4947
+ store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
4948
+ css(this.$el, 'backgroundSize', store.bgSize + "px");
4892
4949
  }
4893
4950
  }
4894
4951
  },
@@ -4897,42 +4954,27 @@
4897
4954
 
4898
4955
 
4899
4956
  methods: {
4900
- load(entries) {
4901
- // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
4902
- if (
4903
- !entries.some((entry) => isUndefined(entry.isIntersecting) || entry.isIntersecting))
4904
- {
4905
- return;
4957
+ load() {
4958
+ if (this._data.image) {
4959
+ return this._data.image;
4906
4960
  }
4907
4961
 
4908
- this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(
4909
- (img) => {
4910
- setSrcAttrs(this.$el, currentSrc(img), img.srcset, img.sizes);
4911
- storage[this.cacheKey] = currentSrc(img);
4912
- return img;
4913
- },
4914
- (e) => trigger(this.$el, new e.constructor(e.type, e)));
4915
-
4962
+ const image = isImg(this.$el) ?
4963
+ this.$el :
4964
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
4916
4965
 
4917
- this.observer.disconnect();
4918
- },
4919
-
4920
- observe() {
4921
- if (this._connected && !this._data.image) {
4922
- for (const el of this.target) {
4923
- this.observer.observe(el);
4924
- }
4925
- }
4966
+ removeAttr(image, 'loading');
4967
+ setSrcAttrs(this.$el, image.currentSrc);
4968
+ return this._data.image = image;
4926
4969
  } } };
4927
4970
 
4928
4971
 
4929
4972
 
4930
- function setSrcAttrs(el, src, srcset, sizes) {
4973
+ function setSrcAttrs(el, src) {
4931
4974
  if (isImg(el)) {
4932
- const set = (prop, val) => val && val !== el[prop] && (el[prop] = val);
4933
- set('sizes', sizes);
4934
- set('srcset', srcset);
4935
- set('src', src);
4975
+ const parentNode = parent(el);
4976
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
4977
+ elements.forEach((el) => setSourceProps(el, el));
4936
4978
  } else if (src) {
4937
4979
  const change = !includes(el.style.backgroundImage, src);
4938
4980
  if (change) {
@@ -4942,16 +4984,62 @@
4942
4984
  }
4943
4985
  }
4944
4986
 
4945
- function getPlaceholderImage(width, height, sizes) {
4946
- if (sizes) {
4947
- ({ width, height } = Dimensions.ratio(
4948
- { width, height },
4949
- 'width',
4950
- toPx(sizesToPixel(sizes))));
4987
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
4988
+ function setSourceProps(sourceEl, targetEl) {
4989
+ srcProps.forEach((prop) => {
4990
+ const value = data(sourceEl, prop);
4991
+ if (value) {
4992
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
4993
+ }
4994
+ });
4995
+ }
4996
+
4997
+ function getImageFromElement(el, src, sources) {
4998
+ const img = new Image();
4999
+
5000
+ wrapInPicture(img, sources);
5001
+ setSourceProps(el, img);
5002
+ img.onload = () => {
5003
+ setSrcAttrs(el, img.currentSrc);
5004
+ };
5005
+ attr(img, 'src', src);
5006
+ return img;
5007
+ }
5008
+
5009
+ function wrapInPicture(img, sources) {
5010
+ sources = parseSources(sources);
5011
+
5012
+ if (sources.length) {
5013
+ const picture = fragment('<picture>');
5014
+ for (const attrs of sources) {
5015
+ const source = fragment('<source>');
5016
+ attr(source, attrs);
5017
+ append(picture, source);
5018
+ }
5019
+ append(picture, img);
5020
+ }
5021
+ }
5022
+
5023
+ function parseSources(sources) {
5024
+ if (!sources) {
5025
+ return [];
5026
+ }
4951
5027
 
5028
+ if (startsWith(sources, '[')) {
5029
+ try {
5030
+ sources = JSON.parse(sources);
5031
+ } catch (e) {
5032
+ sources = [];
5033
+ }
5034
+ } else {
5035
+ sources = parseOptions(sources);
4952
5036
  }
4953
5037
 
4954
- return "data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>";
5038
+ if (!isArray(sources)) {
5039
+ sources = [sources];
5040
+ }
5041
+
5042
+ return sources.filter((source) => !isEmpty(source));
4955
5043
  }
4956
5044
 
4957
5045
  const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -4991,24 +5079,18 @@
4991
5079
  return descriptors.filter((size) => size >= srcSize)[0] || descriptors.pop() || '';
4992
5080
  }
4993
5081
 
4994
- function isImg(el) {
4995
- return el.tagName === 'IMG';
5082
+ function ensureSrcAttribute(el) {
5083
+ if (isImg(el) && !hasAttr(el, 'src')) {
5084
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5085
+ }
4996
5086
  }
4997
5087
 
4998
- function currentSrc(el) {
4999
- return el.currentSrc || el.src;
5088
+ function isPicture(el) {
5089
+ return isTag(el, 'picture');
5000
5090
  }
5001
5091
 
5002
- const key = '__test__';
5003
- let storage;
5004
-
5005
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
5006
- try {
5007
- storage = window.sessionStorage || {};
5008
- storage[key] = 1;
5009
- delete storage[key];
5010
- } catch (e) {
5011
- storage = {};
5092
+ function isImg(el) {
5093
+ return isTag(el, 'img');
5012
5094
  }
5013
5095
 
5014
5096
  var Media = {
@@ -5464,7 +5546,7 @@
5464
5546
 
5465
5547
 
5466
5548
  function openDialog(tmpl, options, hideFn, submitFn) {
5467
- options = assign({ bgClose: false, escClose: true, labels: modal.labels }, options);
5549
+ options = { bgClose: false, escClose: true, labels: modal.labels, ...options };
5468
5550
 
5469
5551
  const dialog = modal.dialog(tmpl(options), options);
5470
5552
  const deferred = new Deferred();
@@ -5593,10 +5675,11 @@
5593
5675
  this.$create(
5594
5676
  'drop',
5595
5677
  dropdowns.filter((el) => !this.getDropdown(el)),
5596
- assign({}, this.$props, {
5678
+ {
5679
+ ...this.$props,
5597
5680
  boundary: this.boundary,
5598
5681
  pos: this.pos,
5599
- offset: this.dropbar || this.offset }));
5682
+ offset: this.dropbar || this.offset });
5600
5683
 
5601
5684
 
5602
5685
  },
@@ -6488,26 +6571,11 @@
6488
6571
 
6489
6572
 
6490
6573
  computed: {
6491
- position(_ref, $el) {let { position } = _ref;
6492
- return position === 'auto' ?
6493
- (this.isFixed ? this.placeholder : $el).offsetHeight > height(window) ?
6494
- 'bottom' :
6495
- 'top' :
6496
- position;
6497
- },
6498
-
6499
- offset(_ref2, $el) {let { offset } = _ref2;
6500
- if (this.position === 'bottom') {
6501
- offset += '+100vh-100%';
6502
- }
6503
- return toPx(offset, 'height', $el);
6504
- },
6505
-
6506
- selTarget(_ref3, $el) {let { selTarget } = _ref3;
6574
+ selTarget(_ref, $el) {let { selTarget } = _ref;
6507
6575
  return selTarget && $(selTarget, $el) || $el;
6508
6576
  },
6509
6577
 
6510
- widthElement(_ref4, $el) {let { widthElement } = _ref4;
6578
+ widthElement(_ref2, $el) {let { widthElement } = _ref2;
6511
6579
  return query(widthElement, $el) || this.placeholder;
6512
6580
  },
6513
6581
 
@@ -6555,41 +6623,36 @@
6555
6623
  return window;
6556
6624
  },
6557
6625
 
6626
+ filter() {
6627
+ return this.targetOffset !== false;
6628
+ },
6629
+
6558
6630
  handler() {
6559
- if (!(this.targetOffset !== false && location.hash && scrollTop(window) > 0)) {
6631
+ if (!location.hash || scrollTop(window) === 0) {
6560
6632
  return;
6561
6633
  }
6562
6634
 
6563
- const target = $(location.hash);
6564
-
6565
- if (target) {
6566
- fastdom.read(() => {
6567
- const { top } = offset(target);
6568
- const elTop = offset(this.$el).top;
6569
- const elHeight = this.$el.offsetHeight;
6635
+ fastdom.read(() => {
6636
+ const targetOffset = offset($(location.hash));
6637
+ const elOffset = offset(this.$el);
6570
6638
 
6571
- if (
6572
- this.isFixed &&
6573
- elTop + elHeight >= top &&
6574
- elTop <= top + target.offsetHeight)
6575
- {
6576
- scrollTop(
6577
- window,
6578
- top -
6579
- elHeight - (
6580
- isNumeric(this.targetOffset) ? this.targetOffset : 0) -
6581
- this.offset);
6639
+ if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6640
+ scrollTop(
6641
+ window,
6642
+ targetOffset.top -
6643
+ elOffset.height -
6644
+ toPx(this.targetOffset, 'height') -
6645
+ toPx(this.offset, 'height'));
6582
6646
 
6583
- }
6584
- });
6585
- }
6647
+ }
6648
+ });
6586
6649
  } }],
6587
6650
 
6588
6651
 
6589
6652
 
6590
6653
  update: [
6591
6654
  {
6592
- read(_ref5, types) {let { height: height$1, margin } = _ref5;
6655
+ read(_ref3, types) {let { height: height$1, margin } = _ref3;
6593
6656
  this.inactive = !this.matchMedia || !isVisible(this.$el);
6594
6657
 
6595
6658
  if (this.inactive) {
@@ -6598,35 +6661,49 @@
6598
6661
 
6599
6662
  const hide = this.isActive && types.has('resize');
6600
6663
  if (hide) {
6664
+ css(this.selTarget, 'transition', '0s');
6601
6665
  this.hide();
6602
6666
  }
6603
6667
 
6604
6668
  if (!this.isActive) {
6605
- height$1 = this.$el.offsetHeight;
6669
+ height$1 = offset(this.$el).height;
6606
6670
  margin = css(this.$el, 'margin');
6607
6671
  }
6608
6672
 
6609
6673
  if (hide) {
6610
6674
  this.show();
6675
+ fastdom.write(() => css(this.selTarget, 'transition', ''));
6611
6676
  }
6612
6677
 
6613
- const overflow = Math.max(0, height$1 + this.offset - height(window));
6614
-
6615
6678
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
6679
+ const windowHeight = height(window);
6680
+
6681
+ let position = this.position;
6682
+ if (position === 'auto' && height$1 > windowHeight) {
6683
+ position = 'bottom';
6684
+ }
6685
+
6686
+ let offset$1 = toPx(this.offset, 'height', referenceElement);
6687
+ if (position === 'bottom') {
6688
+ offset$1 += windowHeight - height$1;
6689
+ }
6690
+
6691
+ const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
6616
6692
  const topOffset = offset(referenceElement).top;
6617
6693
  const offsetParentTop = offset(referenceElement.offsetParent).top;
6618
6694
 
6619
6695
  const top = parseProp(this.top, this.$el, topOffset);
6620
6696
  const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
6621
6697
 
6622
- const start = Math.max(top, topOffset) - this.offset;
6698
+ const start = Math.max(top, topOffset) - offset$1;
6623
6699
  const end = bottom ?
6624
- bottom - this.$el.offsetHeight + overflow - this.offset :
6625
- getScrollingElement(this.$el).scrollHeight - height(window);
6700
+ bottom - offset(this.$el).height + overflow - offset$1 :
6701
+ getScrollingElement(this.$el).scrollHeight - windowHeight;
6626
6702
 
6627
6703
  return {
6628
6704
  start,
6629
6705
  end,
6706
+ offset: offset$1,
6630
6707
  overflow,
6631
6708
  topOffset,
6632
6709
  offsetParentTop,
@@ -6634,11 +6711,11 @@
6634
6711
  margin,
6635
6712
  width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).
6636
6713
  width,
6637
- top: offsetPosition(this.placeholder)[0] };
6714
+ top: offsetPosition(referenceElement)[0] };
6638
6715
 
6639
6716
  },
6640
6717
 
6641
- write(_ref6) {let { height, margin } = _ref6;
6718
+ write(_ref4) {let { height, margin } = _ref4;
6642
6719
  const { placeholder } = this;
6643
6720
 
6644
6721
  css(placeholder, { height, margin });
@@ -6655,14 +6732,14 @@
6655
6732
 
6656
6733
 
6657
6734
  {
6658
- read(_ref7)
6735
+ read(_ref5)
6659
6736
 
6660
6737
 
6661
6738
 
6662
6739
 
6663
6740
 
6664
6741
 
6665
- {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref7;
6742
+ {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref5;
6666
6743
  const scroll = scrollTop(window);
6667
6744
  const dir = prevScroll <= scroll ? 'down' : 'up';
6668
6745
 
@@ -6743,7 +6820,7 @@
6743
6820
  }
6744
6821
  } else if (this.isFixed) {
6745
6822
  this.update();
6746
- } else if (this.animation) {
6823
+ } else if (this.animation && scroll > topOffset) {
6747
6824
  Animation.cancel(this.$el);
6748
6825
  this.show();
6749
6826
  Animation.in(this.$el, this.animation).catch(noop);
@@ -6771,33 +6848,33 @@
6771
6848
  },
6772
6849
 
6773
6850
  update() {
6774
- const {
6851
+ let {
6775
6852
  width,
6776
6853
  scroll = 0,
6777
6854
  overflow,
6778
6855
  overflowScroll = 0,
6779
6856
  start,
6780
6857
  end,
6858
+ offset,
6781
6859
  topOffset,
6782
6860
  height,
6783
6861
  offsetParentTop } =
6784
6862
  this._data;
6785
6863
  const active = start !== 0 || scroll > start;
6786
- let top = this.offset;
6787
6864
  let position = 'fixed';
6788
6865
 
6789
6866
  if (scroll > end) {
6790
- top = end + this.offset - offsetParentTop;
6867
+ offset += end - offsetParentTop;
6791
6868
  position = 'absolute';
6792
6869
  }
6793
6870
 
6794
6871
  if (overflow) {
6795
- top -= overflowScroll;
6872
+ offset -= overflowScroll;
6796
6873
  }
6797
6874
 
6798
6875
  css(this.$el, {
6799
6876
  position,
6800
- top: top + "px",
6877
+ top: offset + "px",
6801
6878
  width });
6802
6879
 
6803
6880
 
@@ -6827,7 +6904,7 @@
6827
6904
  }
6828
6905
 
6829
6906
  var Switcher = {
6830
- mixins: [Togglable],
6907
+ mixins: [Lazyload, Togglable],
6831
6908
 
6832
6909
  args: 'connect',
6833
6910
 
@@ -6891,6 +6968,10 @@
6891
6968
  } },
6892
6969
 
6893
6970
 
6971
+ connected() {
6972
+ this.lazyload(this.$el, this.connects);
6973
+ },
6974
+
6894
6975
  events: [
6895
6976
  {
6896
6977
  name: 'click',
@@ -6999,7 +7080,7 @@
6999
7080
  const KEY_SPACE = 32;
7000
7081
 
7001
7082
  var toggle = {
7002
- mixins: [Media, Togglable],
7083
+ mixins: [Lazyload, Media, Togglable],
7003
7084
 
7004
7085
  args: 'target',
7005
7086
 
@@ -7021,6 +7102,7 @@
7021
7102
  if (!includes(this.mode, 'media') && !isFocusable(this.$el)) {
7022
7103
  attr(this.$el, 'tabindex', '0');
7023
7104
  }
7105
+ this.lazyload(this.$el, this.target);
7024
7106
  },
7025
7107
 
7026
7108
  computed: {
@@ -7112,7 +7194,7 @@
7112
7194
  name: 'keydown',
7113
7195
 
7114
7196
  filter() {
7115
- return includes(this.mode, 'click') && this.$el.tagName !== 'INPUT';
7197
+ return includes(this.mode, 'click') && !isTag(this.$el, 'input');
7116
7198
  },
7117
7199
 
7118
7200
  handler(e) {
@@ -7373,8 +7455,8 @@
7373
7455
  this.stop();
7374
7456
 
7375
7457
  if (this.date && this.units.length) {
7376
- this.$update();
7377
- this.timer = setInterval(this.$update, 1000);
7458
+ this.$emit();
7459
+ this.timer = setInterval(() => this.$emit(), 1000);
7378
7460
  }
7379
7461
  },
7380
7462
 
@@ -7556,7 +7638,7 @@
7556
7638
 
7557
7639
  // Reset to previous state
7558
7640
  nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));
7559
- css(target, assign({ display: 'block' }, targetProps));
7641
+ css(target, { display: 'block', ...targetProps });
7560
7642
 
7561
7643
  // Start transitions on next frame
7562
7644
  requestAnimationFrame(() => {
@@ -7588,15 +7670,13 @@
7588
7670
  const zIndex = css(el, 'zIndex');
7589
7671
 
7590
7672
  return isVisible(el) ?
7591
- assign(
7592
7673
  {
7593
7674
  display: '',
7594
7675
  opacity: opacity ? css(el, 'opacity') : '0',
7595
7676
  pointerEvents: 'none',
7596
7677
  position: 'absolute',
7597
- zIndex: zIndex === 'auto' ? index(el) : zIndex },
7598
-
7599
- getPositionWithMargin(el)) :
7678
+ zIndex: zIndex === 'auto' ? index(el) : zIndex,
7679
+ ...getPositionWithMargin(el) } :
7600
7680
 
7601
7681
  false;
7602
7682
  }
@@ -7780,7 +7860,7 @@
7780
7860
  },
7781
7861
 
7782
7862
  setState(state, animate) {if (animate === void 0) {animate = true;}
7783
- state = assign({ filter: { '': '' }, sort: [] }, state);
7863
+ state = { filter: { '': '' }, sort: [], ...state };
7784
7864
 
7785
7865
  trigger(this.$el, 'beforeFilter', [this, state]);
7786
7866
 
@@ -7880,7 +7960,7 @@
7880
7960
  }
7881
7961
 
7882
7962
  function sortItems(nodes, sort, order) {
7883
- return assign([], nodes).sort(
7963
+ return [...nodes].sort(
7884
7964
  (a, b) =>
7885
7965
  data(a, sort).localeCompare(data(b, sort), undefined, { numeric: true }) * (
7886
7966
  order === 'asc' || -1));
@@ -7919,7 +7999,8 @@
7919
7999
  return "scale3d(" + value + ", " + value + ", 1)";
7920
8000
  }
7921
8001
 
7922
- var Animations$1 = assign({}, Animations$2, {
8002
+ var Animations$1 = {
8003
+ ...Animations$2,
7923
8004
  fade: {
7924
8005
  show() {
7925
8006
  return [{ opacity: 0 }, { opacity: 1 }];
@@ -7951,7 +8032,7 @@
7951
8032
  { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },
7952
8033
  { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }];
7953
8034
 
7954
- } } });
8035
+ } } };
7955
8036
 
7956
8037
  function Transitioner$1(prev, next, dir, _ref) {let { animation, easing } = _ref;
7957
8038
  const { percent, translate, show = noop } = animation;
@@ -8425,12 +8506,6 @@
8425
8506
  } },
8426
8507
 
8427
8508
 
8428
- events: {
8429
- itemshown() {
8430
- this.$update(this.list);
8431
- } },
8432
-
8433
-
8434
8509
  methods: {
8435
8510
  show(index, force) {if (force === void 0) {force = false;}
8436
8511
  if (this.dragging || !this.length) {
@@ -8512,20 +8587,13 @@
8512
8587
  },
8513
8588
 
8514
8589
  _show(prev, next, force) {
8515
- this._transitioner = this._getTransitioner(
8516
- prev,
8517
- next,
8518
- this.dir,
8519
- assign(
8520
- {
8590
+ this._transitioner = this._getTransitioner(prev, next, this.dir, {
8521
8591
  easing: force ?
8522
8592
  next.offsetWidth < 600 ?
8523
8593
  'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
8524
8594
  'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
8525
- this.easing },
8526
-
8527
- this.transitionOptions));
8528
-
8595
+ this.easing,
8596
+ ...this.transitionOptions });
8529
8597
 
8530
8598
 
8531
8599
  if (!force && !prev) {
@@ -8590,7 +8658,7 @@
8590
8658
 
8591
8659
  computed: {
8592
8660
  animation(_ref) {let { animation, Animations } = _ref;
8593
- return assign(Animations[animation] || Animations.slide, { name: animation });
8661
+ return { ...(Animations[animation] || Animations.slide), name: animation };
8594
8662
  },
8595
8663
 
8596
8664
  transitionOptions() {
@@ -8599,19 +8667,15 @@
8599
8667
 
8600
8668
 
8601
8669
  events: {
8602
- 'itemshow itemhide itemshown itemhidden'(_ref2) {let { target } = _ref2;
8603
- this.$update(target);
8604
- },
8605
-
8606
- beforeitemshow(_ref3) {let { target } = _ref3;
8670
+ beforeitemshow(_ref2) {let { target } = _ref2;
8607
8671
  addClass(target, this.clsActive);
8608
8672
  },
8609
8673
 
8610
- itemshown(_ref4) {let { target } = _ref4;
8674
+ itemshown(_ref3) {let { target } = _ref3;
8611
8675
  addClass(target, this.clsActivated);
8612
8676
  },
8613
8677
 
8614
- itemhidden(_ref5) {let { target } = _ref5;
8678
+ itemhidden(_ref4) {let { target } = _ref4;
8615
8679
  removeClass(target, this.clsActive, this.clsActivated);
8616
8680
  } } };
8617
8681
 
@@ -8813,28 +8877,20 @@
8813
8877
  if (type === 'image' || src.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i)) {
8814
8878
  try {
8815
8879
  const { width, height } = await getImage(src, attrs.srcset, attrs.size);
8816
- this.setItem(
8817
- item,
8818
- createEl('img', assign({ src, width, height, alt }, attrs)));
8819
-
8880
+ this.setItem(item, createEl('img', { src, width, height, alt, ...attrs }));
8820
8881
  } catch (e) {
8821
8882
  this.setError(item);
8822
8883
  }
8823
8884
 
8824
8885
  // Video
8825
8886
  } else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
8826
- const video = createEl(
8827
- 'video',
8828
- assign(
8829
- {
8887
+ const video = createEl('video', {
8830
8888
  src,
8831
8889
  poster,
8832
8890
  controls: '',
8833
8891
  playsinline: '',
8834
- 'uk-video': "" + this.videoAutoplay },
8835
-
8836
- attrs));
8837
-
8892
+ 'uk-video': "" + this.videoAutoplay,
8893
+ ...attrs });
8838
8894
 
8839
8895
 
8840
8896
  on(video, 'loadedmetadata', () => {
@@ -8847,17 +8903,12 @@
8847
8903
  } else if (type === 'iframe' || src.match(/\.(html|php)($|\?)/i)) {
8848
8904
  this.setItem(
8849
8905
  item,
8850
- createEl(
8851
- 'iframe',
8852
- assign(
8853
- {
8906
+ createEl('iframe', {
8854
8907
  src,
8855
8908
  frameborder: '0',
8856
8909
  allowfullscreen: '',
8857
- class: 'uk-lightbox-iframe' },
8858
-
8859
- attrs)));
8860
-
8910
+ class: 'uk-lightbox-iframe',
8911
+ ...attrs }));
8861
8912
 
8862
8913
 
8863
8914
 
@@ -8869,19 +8920,14 @@
8869
8920
  {
8870
8921
  this.setItem(
8871
8922
  item,
8872
- createEl(
8873
- 'iframe',
8874
- assign(
8875
- {
8876
- src: "https://www.youtube" + (matches[1] || '') + ".com/embed/" +
8877
- matches[2] + (
8923
+ createEl('iframe', {
8924
+ src: "https://www.youtube" + (matches[1] || '') + ".com/embed/" + matches[2] + (
8878
8925
  matches[3] ? "?" + matches[3] : ''),
8879
- width: 1920,
8880
- height: 1080 },
8881
-
8882
- iframeAttrs,
8883
- attrs)));
8884
8926
 
8927
+ width: 1920,
8928
+ height: 1080,
8929
+ ...iframeAttrs,
8930
+ ...attrs }));
8885
8931
 
8886
8932
 
8887
8933
 
@@ -8901,19 +8947,14 @@
8901
8947
 
8902
8948
  this.setItem(
8903
8949
  item,
8904
- createEl(
8905
- 'iframe',
8906
- assign(
8907
- {
8950
+ createEl('iframe', {
8908
8951
  src: "https://player.vimeo.com/video/" + matches[1] + (
8909
8952
  matches[2] ? "?" + matches[2] : ''),
8910
8953
 
8911
8954
  width,
8912
- height },
8913
-
8914
- iframeAttrs,
8915
- attrs)));
8916
-
8955
+ height,
8956
+ ...iframeAttrs,
8957
+ ...attrs }));
8917
8958
 
8918
8959
 
8919
8960
  } catch (e) {
@@ -9015,8 +9056,7 @@
9015
9056
  index = findIndex(items, (_ref2) => {let { source: src } = _ref2;return source === src;});
9016
9057
  }
9017
9058
 
9018
- this.panel =
9019
- this.panel || this.$create('lightboxPanel', assign({}, this.$props, { items }));
9059
+ this.panel = this.panel || this.$create('lightboxPanel', { ...this.$props, items });
9020
9060
 
9021
9061
  on(this.panel.$el, 'hidden', () => this.panel = false);
9022
9062
 
@@ -9221,50 +9261,44 @@
9221
9261
  },
9222
9262
 
9223
9263
  getCss(percent) {
9224
- return keys(this.props).reduce(
9225
- (css, prop) => {
9264
+ const css = { transform: '', filter: '' };
9265
+ for (const prop in this.props) {
9226
9266
  this.props[prop](css, percent);
9227
- return css;
9228
- },
9229
- { transform: '', filter: '' });
9230
-
9267
+ }
9268
+ return css;
9231
9269
  } } };
9232
9270
 
9233
9271
 
9234
9272
 
9235
- function transformFn(prop, el, steps) {
9236
- const unit = getUnit(steps) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
9273
+ function transformFn(prop, el, stops) {
9274
+ const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
9275
+ let transformFn;
9237
9276
 
9238
9277
  if (prop === 'x' || prop === 'y') {
9239
9278
  prop = "translate" + ucfirst(prop);
9279
+ transformFn = (stop) => toFloat(toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
9240
9280
  }
9241
9281
 
9242
- steps = steps.map(toFloat);
9243
-
9244
- if (steps.length === 1) {
9245
- steps.unshift(prop === 'scale' ? 1 : 0);
9282
+ if (stops.length === 1) {
9283
+ stops.unshift(prop === 'scale' ? 1 : 0);
9246
9284
  }
9247
9285
 
9248
- return (css, percent) => {
9249
- let value = getValue(steps, percent);
9286
+ stops = parseStops(stops, transformFn);
9250
9287
 
9251
- if (startsWith(prop, 'translate')) {
9252
- value = toFloat(value).toFixed(unit === 'px' ? 0 : 6);
9253
- }
9254
-
9255
- css.transform += " " + prop + "(" + value + unit + ")";
9288
+ return (css, percent) => {
9289
+ css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
9256
9290
  };
9257
9291
  }
9258
9292
 
9259
- function colorFn(prop, el, steps) {
9260
- if (steps.length === 1) {
9261
- steps.unshift(getCssValue(el, prop, ''));
9293
+ function colorFn(prop, el, stops) {
9294
+ if (stops.length === 1) {
9295
+ stops.unshift(getCssValue(el, prop, ''));
9262
9296
  }
9263
9297
 
9264
- steps = steps.map((step) => parseColor(el, step));
9298
+ stops = parseStops(stops, (stop) => parseColor(el, stop));
9265
9299
 
9266
9300
  return (css, percent) => {
9267
- const [start, end, p] = getStep(steps, percent);
9301
+ const [start, end, p] = getStop(stops, percent);
9268
9302
  const value = start.
9269
9303
  map((value, i) => {
9270
9304
  value += p * (end[i] - value);
@@ -9284,85 +9318,83 @@
9284
9318
  map(toFloat);
9285
9319
  }
9286
9320
 
9287
- function filterFn(prop, el, steps) {
9288
- if (steps.length === 1) {
9289
- steps.unshift(0);
9321
+ function filterFn(prop, el, stops) {
9322
+ if (stops.length === 1) {
9323
+ stops.unshift(0);
9290
9324
  }
9291
9325
 
9292
- const unit = getUnit(steps) || { blur: 'px', hue: 'deg' }[prop] || '%';
9326
+ const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
9293
9327
  prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
9294
- steps = steps.map(toFloat);
9328
+ stops = parseStops(stops);
9295
9329
 
9296
9330
  return (css, percent) => {
9297
- const value = getValue(steps, percent);
9331
+ const value = getValue(stops, percent);
9298
9332
  css.filter += " " + prop + "(" + (value + unit) + ")";
9299
9333
  };
9300
9334
  }
9301
9335
 
9302
- function cssPropFn(prop, el, steps) {
9303
- if (steps.length === 1) {
9304
- steps.unshift(getCssValue(el, prop, ''));
9336
+ function cssPropFn(prop, el, stops) {
9337
+ if (stops.length === 1) {
9338
+ stops.unshift(getCssValue(el, prop, ''));
9305
9339
  }
9306
9340
 
9307
- steps = steps.map(toFloat);
9341
+ stops = parseStops(stops);
9308
9342
 
9309
9343
  return (css, percent) => {
9310
- css[prop] = getValue(steps, percent);
9344
+ css[prop] = getValue(stops, percent);
9311
9345
  };
9312
9346
  }
9313
9347
 
9314
- function strokeFn(prop, el, steps) {
9315
- if (steps.length === 1) {
9316
- steps.unshift(0);
9348
+ function strokeFn(prop, el, stops) {
9349
+ if (stops.length === 1) {
9350
+ stops.unshift(0);
9317
9351
  }
9318
9352
 
9319
- const unit = getUnit(steps);
9320
- steps = steps.map(toFloat);
9353
+ const unit = getUnit(stops);
9354
+ const length = getMaxPathLength(el);
9355
+ stops = parseStops(stops.reverse(), (stop) => {
9356
+ stop = toFloat(stop);
9357
+ return unit === '%' ? stop * length / 100 : stop;
9358
+ });
9321
9359
 
9322
- if (!steps.some((step) => step)) {
9360
+ if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
9323
9361
  return noop;
9324
9362
  }
9325
9363
 
9326
- const length = getMaxPathLength(el);
9327
9364
  css(el, 'strokeDasharray', length);
9328
9365
 
9329
- if (unit === '%') {
9330
- steps = steps.map((step) => step * length / 100);
9331
- }
9332
-
9333
- steps = steps.reverse();
9334
-
9335
9366
  return (css, percent) => {
9336
- css.strokeDashoffset = getValue(steps, percent);
9367
+ css.strokeDashoffset = getValue(stops, percent);
9337
9368
  };
9338
9369
  }
9339
9370
 
9340
- function backgroundFn(prop, el, steps) {
9341
- if (steps.length === 1) {
9342
- steps.unshift(0);
9371
+ function backgroundFn(prop, el, stops) {
9372
+ if (stops.length === 1) {
9373
+ stops.unshift(0);
9343
9374
  }
9344
9375
 
9345
9376
  prop = prop.substr(-1);
9346
9377
  const attr = prop === 'y' ? 'height' : 'width';
9347
- steps = steps.map((step) => toPx(step, attr, el));
9378
+ stops = parseStops(stops, (stop) => toPx(stop, attr, el));
9348
9379
 
9349
9380
  const bgPos = getCssValue(el, "background-position-" + prop, '');
9350
9381
 
9351
9382
  return getCssValue(el, 'backgroundSize', '') === 'cover' ?
9352
- backgroundCoverFn(prop, el, steps, bgPos, attr) :
9353
- setBackgroundPosFn(prop, steps, bgPos);
9383
+ backgroundCoverFn(prop, el, stops, bgPos, attr) :
9384
+ setBackgroundPosFn(prop, stops, bgPos);
9354
9385
  }
9355
9386
 
9356
- function backgroundCoverFn(prop, el, steps, bgPos, attr) {
9387
+ function backgroundCoverFn(prop, el, stops, bgPos, attr) {
9357
9388
  const dimImage = getBackgroundImageDimensions(el);
9358
9389
 
9359
9390
  if (!dimImage.width) {
9360
9391
  return noop;
9361
9392
  }
9362
9393
 
9363
- const min = Math.min(...steps);
9364
- const max = Math.max(...steps);
9365
- const down = steps.indexOf(min) < steps.indexOf(max);
9394
+ const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
9395
+ const min = Math.min(...values);
9396
+ const max = Math.max(...values);
9397
+ const down = values.indexOf(min) < values.indexOf(max);
9366
9398
 
9367
9399
  const diff = max - min;
9368
9400
  let pos = (down ? -diff : 0) - (down ? min : max);
@@ -9387,7 +9419,7 @@
9387
9419
 
9388
9420
  const dim = Dimensions.cover(dimImage, dimEl);
9389
9421
 
9390
- const fn = setBackgroundPosFn(prop, steps, pos + "px");
9422
+ const fn = setBackgroundPosFn(prop, stops, pos + "px");
9391
9423
  return (css, percent) => {
9392
9424
  fn(css, percent);
9393
9425
  css.backgroundSize = dim.width + "px " + dim.height + "px";
@@ -9395,9 +9427,9 @@
9395
9427
  };
9396
9428
  }
9397
9429
 
9398
- function setBackgroundPosFn(prop, steps, pos) {
9430
+ function setBackgroundPosFn(prop, stops, pos) {
9399
9431
  return function (css, percent) {
9400
- css["background-position-" + prop] = "calc(" + pos + " + " + getValue(steps, percent) + "px)";
9432
+ css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
9401
9433
  };
9402
9434
  }
9403
9435
 
@@ -9418,6 +9450,7 @@
9418
9450
  dimensions[src] = toDimensions(image);
9419
9451
  trigger(el, 'bgimageload');
9420
9452
  };
9453
+ return toDimensions(image);
9421
9454
  }
9422
9455
  }
9423
9456
 
@@ -9431,27 +9464,71 @@
9431
9464
 
9432
9465
  }
9433
9466
 
9434
- function getStep(steps, percent) {
9435
- const count = steps.length - 1;
9436
- const index = Math.min(Math.floor(count * percent), count - 1);
9467
+ function parseStops(stops, fn) {if (fn === void 0) {fn = toFloat;}
9468
+ const result = [];
9469
+ const { length } = stops;
9470
+ let nullIndex = 0;
9471
+ for (let i = 0; i < length; i++) {
9472
+ let [value, percent] = isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
9473
+ value = fn(value);
9474
+ percent = percent ? toFloat(percent) / 100 : null;
9475
+
9476
+ if (i === 0) {
9477
+ if (percent === null) {
9478
+ percent = 0;
9479
+ } else if (percent) {
9480
+ result.push([value, 0]);
9481
+ }
9482
+ } else if (i === length - 1) {
9483
+ if (percent === null) {
9484
+ percent = 1;
9485
+ } else if (percent !== 1) {
9486
+ result.push([value, percent]);
9487
+ percent = 1;
9488
+ }
9489
+ }
9490
+
9491
+ result.push([value, percent]);
9492
+
9493
+ if (percent === null) {
9494
+ nullIndex++;
9495
+ } else if (nullIndex) {
9496
+ const leftPercent = result[i - nullIndex - 1][1];
9497
+ const p = (percent - leftPercent) / (nullIndex + 1);
9498
+ for (let j = nullIndex; j > 0; j--) {
9499
+ result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
9500
+ }
9501
+
9502
+ nullIndex = 0;
9503
+ }
9504
+ }
9505
+
9506
+ return result;
9507
+ }
9508
+
9509
+ function getStop(stops, percent) {
9510
+ const index = findIndex(stops.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
9511
+ return [
9512
+ stops[index - 1][0],
9513
+ stops[index][0],
9514
+ (percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
9437
9515
 
9438
- return steps.
9439
- slice(index, index + 2).
9440
- concat(percent === 1 ? 1 : percent % (1 / count) * count);
9441
9516
  }
9442
9517
 
9443
- function getValue(steps, percent) {
9444
- const [start, end, p] = getStep(steps, percent);
9518
+ function getValue(stops, percent) {
9519
+ const [start, end, p] = getStop(stops, percent);
9445
9520
  return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
9446
9521
  }
9447
9522
 
9448
- function getUnit(steps, defaultUnit) {
9449
- return (
9450
- steps.reduce(
9451
- (unit, step) => unit || isString(step) && step.replace(/[\d-]/g, '').trim(),
9452
- '') ||
9453
- defaultUnit);
9454
-
9523
+ const unitRe = /^-?\d+([^\s]*)/;
9524
+ function getUnit(stops, defaultUnit) {
9525
+ for (const stop of stops) {
9526
+ const match = stop.match == null ? void 0 : stop.match(unitRe);
9527
+ if (match) {
9528
+ return match[1];
9529
+ }
9530
+ }
9531
+ return defaultUnit;
9455
9532
  }
9456
9533
 
9457
9534
  function getCssValue(el, prop, value) {
@@ -9563,6 +9640,22 @@
9563
9640
 
9564
9641
  events: ['resize'] } };
9565
9642
 
9643
+ var SliderPreload = {
9644
+ connected() {
9645
+ this.registerObserver(
9646
+ observeIntersection(
9647
+ this.slides.concat(this.$el),
9648
+ (entries, observer) => {
9649
+ for (const el of this.getAdjacentSlides()) {
9650
+ $$('img[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
9651
+ observer.unobserve(el);
9652
+ }
9653
+ },
9654
+ { rootMargin: '50% 50%' }));
9655
+
9656
+
9657
+ } };
9658
+
9566
9659
  function Transitioner (prev, next, dir, _ref) {let { center, easing, list } = _ref;
9567
9660
  const deferred = new Deferred();
9568
9661
 
@@ -9729,7 +9822,7 @@
9729
9822
  }
9730
9823
 
9731
9824
  var slider = {
9732
- mixins: [Class, Slider, SliderReactive],
9825
+ mixins: [Class, Slider, SliderReactive, SliderPreload],
9733
9826
 
9734
9827
  props: {
9735
9828
  center: Boolean,
@@ -9781,48 +9874,39 @@
9781
9874
  return ~index ? index : this.length - 1;
9782
9875
  },
9783
9876
 
9784
- sets(_ref2) {let { sets } = _ref2;
9785
- if (!sets) {
9877
+ sets(_ref2) {let { sets: enabled } = _ref2;
9878
+ if (!enabled) {
9786
9879
  return;
9787
9880
  }
9788
9881
 
9789
- const width = dimensions$1(this.list).width / (this.center ? 2 : 1);
9790
-
9791
9882
  let left = 0;
9792
- let leftCenter = width;
9793
- let slideLeft = 0;
9794
-
9795
- sets = sortBy$1(this.slides, 'offsetLeft').reduce((sets, slide, i) => {
9796
- const slideWidth = dimensions$1(slide).width;
9797
- const slideRight = slideLeft + slideWidth;
9883
+ const sets = [];
9884
+ const width = dimensions$1(this.list).width;
9885
+ for (let i in this.slides) {
9886
+ const slideWidth = dimensions$1(this.slides[i]).width;
9798
9887
 
9799
- if (slideRight > left) {
9800
- if (!this.center && i > this.maxIndex) {
9801
- i = this.maxIndex;
9802
- }
9888
+ if (left + slideWidth > width) {
9889
+ left = 0;
9890
+ }
9803
9891
 
9804
- if (!includes(sets, i)) {
9805
- const cmp = this.slides[i + 1];
9806
- if (
9807
- this.center &&
9808
- cmp &&
9809
- slideWidth < leftCenter - dimensions$1(cmp).width / 2)
9810
- {
9811
- leftCenter -= slideWidth;
9812
- } else {
9813
- leftCenter = width;
9814
- sets.push(i);
9815
- left = slideLeft + width + (this.center ? slideWidth / 2 : 0);
9816
- }
9892
+ if (this.center) {
9893
+ if (
9894
+ left < width / 2 &&
9895
+ left + slideWidth + dimensions$1(this.slides[+i + 1]).width / 2 > width / 2)
9896
+ {
9897
+ sets.push(+i);
9898
+ left = width / 2 - slideWidth / 2;
9817
9899
  }
9900
+ } else if (left === 0) {
9901
+ sets.push(Math.min(+i, this.maxIndex));
9818
9902
  }
9819
9903
 
9820
- slideLeft += slideWidth;
9904
+ left += slideWidth;
9905
+ }
9821
9906
 
9907
+ if (sets.length) {
9822
9908
  return sets;
9823
- }, []);
9824
-
9825
- return !isEmpty(sets) && sets;
9909
+ }
9826
9910
  },
9827
9911
 
9828
9912
  transitionOptions() {
@@ -9854,15 +9938,7 @@
9854
9938
  this._translate(1);
9855
9939
  }
9856
9940
 
9857
- const actives = this._getTransitioner(this.index).getActives();
9858
- const activeClasses = [
9859
- this.clsActive,
9860
- (!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
9861
- ''];
9862
-
9863
- for (const slide of this.slides) {
9864
- toggleClass(slide, activeClasses, includes(actives, slide));
9865
- }
9941
+ this.updateActiveClasses();
9866
9942
  },
9867
9943
 
9868
9944
  events: ['resize'] },
@@ -9910,6 +9986,10 @@
9910
9986
  if (~this.prevIndex) {
9911
9987
  addClass(this._getTransitioner().getItemIn(), this.clsActive);
9912
9988
  }
9989
+ },
9990
+
9991
+ itemshown() {
9992
+ this.updateActiveClasses();
9913
9993
  } },
9914
9994
 
9915
9995
 
@@ -9947,6 +10027,18 @@
9947
10027
  }
9948
10028
  },
9949
10029
 
10030
+ updateActiveClasses() {
10031
+ const actives = this._getTransitioner(this.index).getActives();
10032
+ const activeClasses = [
10033
+ this.clsActive,
10034
+ (!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
10035
+ ''];
10036
+
10037
+ for (const slide of this.slides) {
10038
+ toggleClass(slide, activeClasses, includes(actives, slide));
10039
+ }
10040
+ },
10041
+
9950
10042
  getValidIndex(index, prevIndex) {if (index === void 0) {index = this.index;}if (prevIndex === void 0) {prevIndex = this.prevIndex;}
9951
10043
  index = this.getIndex(index, prevIndex);
9952
10044
 
@@ -9966,6 +10058,25 @@
9966
10058
  } while (index !== prev);
9967
10059
 
9968
10060
  return index;
10061
+ },
10062
+
10063
+ getAdjacentSlides() {
10064
+ const { width } = dimensions$1(this.list);
10065
+ const left = -width;
10066
+ const right = width * 2;
10067
+ const slideWidth = dimensions$1(this.slides[this.index]).width;
10068
+ const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
10069
+ const slides = new Set();
10070
+ for (const i of [-1, 1]) {
10071
+ let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
10072
+ let j = 0;
10073
+ do {
10074
+ const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
10075
+ currentLeft += dimensions$1(slide).width * i;
10076
+ slides.add(slide);
10077
+ } while (this.slides.length > j && currentLeft > left && currentLeft < right);
10078
+ }
10079
+ return Array.from(slides);
9969
10080
  } } };
9970
10081
 
9971
10082
 
@@ -10052,7 +10163,8 @@
10052
10163
  return isIn(type) ^ dir < 0 ? percent : 1 - percent;
10053
10164
  }
10054
10165
 
10055
- var Animations = assign({}, Animations$2, {
10166
+ var Animations = {
10167
+ ...Animations$2,
10056
10168
  fade: {
10057
10169
  show() {
10058
10170
  return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
@@ -10141,10 +10253,10 @@
10141
10253
  { transform: translate(-30 * percent), zIndex: -1 },
10142
10254
  { transform: translate(100 * (1 - percent)), zIndex: 0 }];
10143
10255
 
10144
- } } });
10256
+ } } };
10145
10257
 
10146
10258
  var slideshow = {
10147
- mixins: [Class, Slideshow, SliderReactive],
10259
+ mixins: [Class, Slideshow, SliderReactive, SliderPreload],
10148
10260
 
10149
10261
  props: {
10150
10262
  ratio: String,
@@ -10187,7 +10299,13 @@
10187
10299
  height > 0 && css(this.list, 'minHeight', height);
10188
10300
  },
10189
10301
 
10190
- events: ['resize'] } };
10302
+ events: ['resize'] },
10303
+
10304
+
10305
+ methods: {
10306
+ getAdjacentSlides() {
10307
+ return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
10308
+ } } };
10191
10309
 
10192
10310
  var sortable = {
10193
10311
  mixins: [Class, Animate],
@@ -10360,7 +10478,7 @@
10360
10478
 
10361
10479
  this.touched = new Set([this]);
10362
10480
  this.placeholder = placeholder;
10363
- this.origin = assign({ target, index: index(placeholder) }, this.pos);
10481
+ this.origin = { target, index: index(placeholder), ...this.pos };
10364
10482
 
10365
10483
  on(document, pointerMove, this.move);
10366
10484
  on(document, pointerUp, this.end);