uikit 3.11.2-dev.44c622843 → 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 +394 -327
  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 +632 -529
  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 +23 -32
  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
@@ -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.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(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);
@@ -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
- }
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');
1238
1215
 
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
- }
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) {
@@ -1284,10 +1253,7 @@
1284
1253
  toNodes(element).
1285
1254
  map(parent).
1286
1255
  filter((value, index, self) => self.indexOf(value) === index).
1287
- forEach((parent) => {
1288
- before(parent, parent.childNodes);
1289
- remove$1(parent);
1290
- });
1256
+ forEach((parent) => parent.replaceWith(...parent.childNodes));
1291
1257
  }
1292
1258
 
1293
1259
  const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
@@ -1306,7 +1272,11 @@
1306
1272
  container.textContent = html;
1307
1273
  }
1308
1274
 
1309
- return container.childNodes.length > 1 ? toNodes(container.childNodes) : container.firstChild;
1275
+ return unwrapSingle(container.childNodes);
1276
+ }
1277
+
1278
+ function unwrapSingle(nodes) {
1279
+ return nodes.length > 1 ? nodes : nodes[0];
1310
1280
  }
1311
1281
 
1312
1282
  function apply(node, fn) {
@@ -1335,6 +1305,19 @@
1335
1305
  return isString(str) && startsWith(str.trim(), '<');
1336
1306
  }
1337
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
+
1338
1321
  /*
1339
1322
  Based on:
1340
1323
  Copyright (c) 2016 Wilson Page wilsonpage@me.com
@@ -1487,6 +1470,41 @@
1487
1470
  return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };
1488
1471
  }
1489
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
+
1490
1508
  const strats = {};
1491
1509
 
1492
1510
  strats.events =
@@ -1526,7 +1544,7 @@
1526
1544
 
1527
1545
  // extend strategy
1528
1546
  strats.computed = strats.methods = function (parentVal, childVal) {
1529
- return childVal ? parentVal ? assign({}, parentVal, childVal) : childVal : parentVal;
1547
+ return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
1530
1548
  };
1531
1549
 
1532
1550
  // data strategy
@@ -1666,11 +1684,11 @@
1666
1684
  }
1667
1685
 
1668
1686
  function isHTML5(el) {
1669
- return (el == null ? void 0 : el.tagName) === 'VIDEO';
1687
+ return isTag(el, 'video');
1670
1688
  }
1671
1689
 
1672
1690
  function isIFrame(el) {
1673
- return (el == null ? void 0 : el.tagName) === 'IFRAME' && (isYoutube(el) || isVimeo(el));
1691
+ return isTag(el, 'iframe') && (isYoutube(el) || isVimeo(el));
1674
1692
  }
1675
1693
 
1676
1694
  function isYoutube(el) {
@@ -1690,7 +1708,7 @@
1690
1708
 
1691
1709
  function post(el, cmd) {
1692
1710
  try {
1693
- el.contentWindow.postMessage(JSON.stringify(assign({ event: 'command' }, cmd)), '*');
1711
+ el.contentWindow.postMessage(JSON.stringify({ event: 'command', ...cmd }), '*');
1694
1712
  } catch (e) {
1695
1713
  // noop
1696
1714
  }
@@ -2070,6 +2088,7 @@
2070
2088
  flipPosition: flipPosition,
2071
2089
  toPx: toPx,
2072
2090
  ready: ready,
2091
+ isTag: isTag,
2073
2092
  empty: empty,
2074
2093
  html: html,
2075
2094
  replaceChildren: replaceChildren,
@@ -2163,6 +2182,9 @@
2163
2182
  memoize: memoize,
2164
2183
  Deferred: Deferred,
2165
2184
  MouseTracker: MouseTracker,
2185
+ hasIntersectionObserver: hasIntersectionObserver,
2186
+ observeIntersection: observeIntersection,
2187
+ observeResize: observeResize,
2166
2188
  mergeOptions: mergeOptions,
2167
2189
  parseOptions: parseOptions,
2168
2190
  play: play,
@@ -2340,8 +2362,8 @@
2340
2362
  };
2341
2363
 
2342
2364
  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)))) {
2365
+ for (const { read, write, events = [] } of this.$options.update) {
2366
+ if (!types.has('update') && !events.some((type) => types.has(type))) {
2345
2367
  continue;
2346
2368
  }
2347
2369
 
@@ -2364,7 +2386,7 @@
2364
2386
  const {
2365
2387
  $options: { computed } } =
2366
2388
  this;
2367
- const values = assign({}, this._computeds);
2389
+ const values = { ...this._computeds };
2368
2390
  this._computeds = {};
2369
2391
 
2370
2392
  for (const key in computed) {
@@ -2462,17 +2484,28 @@
2462
2484
  }
2463
2485
  }
2464
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
+ }
2465
2493
  };
2466
2494
 
2467
2495
  UIkit.prototype._unbindEvents = function () {
2468
2496
  this._events.forEach((unbind) => unbind());
2469
2497
  delete this._events;
2498
+ unregisterScrollListener(this._uid);
2470
2499
  };
2471
2500
 
2472
2501
  UIkit.prototype._initObservers = function () {
2473
2502
  this._observers = [initChildListObserver(this), initPropsObserver(this)];
2474
2503
  };
2475
2504
 
2505
+ UIkit.prototype.registerObserver = function (observer) {
2506
+ this._observers.push(observer);
2507
+ };
2508
+
2476
2509
  UIkit.prototype._disconnectObservers = function () {
2477
2510
  this._observers.forEach((observer) => observer == null ? void 0 : observer.disconnect());
2478
2511
  };
@@ -2549,7 +2582,7 @@
2549
2582
  el = isFunction(el) ? el.call(component) : el || component.$el;
2550
2583
 
2551
2584
  if (isArray(el)) {
2552
- el.forEach((el) => registerEvent(component, assign({}, event, { el }), key));
2585
+ el.forEach((el) => registerEvent(component, { ...event, el }, key));
2553
2586
  return;
2554
2587
  }
2555
2588
 
@@ -2661,6 +2694,27 @@
2661
2694
 
2662
2695
  return observer;
2663
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
+ }
2664
2718
  }
2665
2719
 
2666
2720
  function instanceAPI (UIkit) {
@@ -2783,7 +2837,7 @@
2783
2837
  }
2784
2838
  };
2785
2839
 
2786
- const opt = isPlainObject(options) ? assign({}, options) : options.options;
2840
+ const opt = isPlainObject(options) ? { ...options } : options.options;
2787
2841
 
2788
2842
  opt.name = name;
2789
2843
 
@@ -2836,7 +2890,7 @@
2836
2890
  UIkit.data = '__uikit__';
2837
2891
  UIkit.prefix = 'uk-';
2838
2892
  UIkit.options = {};
2839
- UIkit.version = '3.11.2-dev.44c622843';
2893
+ UIkit.version = '3.11.2-dev.45194f70c';
2840
2894
 
2841
2895
  globalAPI(UIkit);
2842
2896
  hooksAPI(UIkit);
@@ -2861,28 +2915,8 @@
2861
2915
  };
2862
2916
 
2863
2917
  on(window, 'load resize', handleResize);
2864
- 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
2918
 
2919
+ observeResize(document.documentElement, handleResize);
2886
2920
 
2887
2921
  let started = 0;
2888
2922
  on(
@@ -3004,6 +3038,19 @@
3004
3038
  !hasClass(this.$el, this.$name) && addClass(this.$el, this.$name);
3005
3039
  } };
3006
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
+
3007
3054
  var Togglable = {
3008
3055
  props: {
3009
3056
  cls: Boolean,
@@ -3159,7 +3206,7 @@
3159
3206
  show ?
3160
3207
  Transition.start(
3161
3208
  el,
3162
- assign({}, initProps, { overflow: 'hidden', height: endHeight }),
3209
+ { ...initProps, overflow: 'hidden', height: endHeight },
3163
3210
  Math.round(duration * (1 - currentHeight / endHeight)),
3164
3211
  transition) :
3165
3212
 
@@ -3191,7 +3238,7 @@
3191
3238
  }
3192
3239
 
3193
3240
  var Accordion = {
3194
- mixins: [Class, Togglable],
3241
+ mixins: [Class, Lazyload, Togglable],
3195
3242
 
3196
3243
  props: {
3197
3244
  targets: String,
@@ -3247,6 +3294,10 @@
3247
3294
  } },
3248
3295
 
3249
3296
 
3297
+ connected() {
3298
+ this.lazyload();
3299
+ },
3300
+
3250
3301
  events: [
3251
3302
  {
3252
3303
  name: 'click',
@@ -3331,7 +3382,7 @@
3331
3382
  animation: [true],
3332
3383
  selClose: '.uk-alert-close',
3333
3384
  duration: 150,
3334
- hideProps: assign({ opacity: 0 }, Togglable.data.hideProps) },
3385
+ hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3335
3386
 
3336
3387
 
3337
3388
  events: [
@@ -3382,6 +3433,8 @@
3382
3433
  if (this.automute) {
3383
3434
  mute(this.$el);
3384
3435
  }
3436
+
3437
+ this.registerObserver(observeIntersection(this.$el, () => this.$emit('resize')));
3385
3438
  },
3386
3439
 
3387
3440
  update: {
@@ -3418,6 +3471,10 @@
3418
3471
  automute: true },
3419
3472
 
3420
3473
 
3474
+ connected() {
3475
+ this.registerObserver(observeResize(this.$el, () => this.$emit('resize')));
3476
+ },
3477
+
3421
3478
  update: {
3422
3479
  read() {
3423
3480
  const el = this.$el;
@@ -3543,7 +3600,7 @@
3543
3600
  let active$1;
3544
3601
 
3545
3602
  var drop = {
3546
- mixins: [Container, Position, Togglable],
3603
+ mixins: [Container, Lazyload, Position, Togglable],
3547
3604
 
3548
3605
  args: 'pos',
3549
3606
 
@@ -3597,6 +3654,7 @@
3597
3654
  mode: this.mode }).
3598
3655
  $el;
3599
3656
  attr(this.target, 'aria-haspopup', true);
3657
+ this.lazyload(this.target);
3600
3658
  }
3601
3659
  },
3602
3660
 
@@ -3972,7 +4030,7 @@
3972
4030
  name: 'change',
3973
4031
 
3974
4032
  handler() {
3975
- this.$update();
4033
+ this.$emit();
3976
4034
  } },
3977
4035
 
3978
4036
 
@@ -3984,7 +4042,7 @@
3984
4042
  },
3985
4043
 
3986
4044
  handler() {
3987
- this.$update();
4045
+ this.$emit();
3988
4046
  } }] };
3989
4047
 
3990
4048
  // Deprecated
@@ -4341,6 +4399,8 @@
4341
4399
  }
4342
4400
 
4343
4401
  var heightViewport = {
4402
+ mixins: [Class],
4403
+
4344
4404
  props: {
4345
4405
  expand: Boolean,
4346
4406
  offsetTop: Boolean,
@@ -4488,6 +4548,12 @@
4488
4548
 
4489
4549
  methods: {
4490
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
+
4491
4557
  return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4492
4558
  },
4493
4559
 
@@ -4587,7 +4653,7 @@
4587
4653
  }
4588
4654
 
4589
4655
  function insertSVG(el, root) {
4590
- if (isVoidElement(root) || root.tagName === 'CANVAS') {
4656
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
4591
4657
  root.hidden = true;
4592
4658
 
4593
4659
  const next = root.nextElementSibling;
@@ -4599,11 +4665,7 @@
4599
4665
  }
4600
4666
 
4601
4667
  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';
4668
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4607
4669
  }
4608
4670
 
4609
4671
  function innerHTML(el) {
@@ -4684,14 +4746,14 @@
4684
4746
  },
4685
4747
 
4686
4748
  methods: {
4687
- getSvg() {
4749
+ async getSvg() {
4688
4750
  const icon = getIcon(this.icon);
4689
4751
 
4690
4752
  if (!icon) {
4691
- return Promise.reject('Icon not found.');
4753
+ throw 'Icon not found.';
4692
4754
  }
4693
4755
 
4694
- return Promise.resolve(icon);
4756
+ return icon;
4695
4757
  } } };
4696
4758
 
4697
4759
  const IconComponent = {
@@ -4749,10 +4811,17 @@
4749
4811
  const Spinner = {
4750
4812
  extends: IconComponent,
4751
4813
 
4752
- async connected() {
4753
- const svg = await this.svg;
4754
- svg && this.ratio !== 1 && css($('circle', svg), 'strokeWidth', 1 / this.ratio);
4755
- } };
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
+
4756
4825
 
4757
4826
 
4758
4827
  const parsed = {};
@@ -4790,120 +4859,93 @@
4790
4859
  return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4791
4860
  }
4792
4861
 
4862
+ const nativeLazyLoad = ('loading' in HTMLImageElement.prototype);
4863
+
4793
4864
  var img = {
4794
4865
  args: 'dataSrc',
4795
4866
 
4796
4867
  props: {
4797
4868
  dataSrc: String,
4798
- dataSrcset: Boolean,
4799
- sizes: String,
4800
- width: Number,
4801
- height: Number,
4869
+ sources: String,
4802
4870
  offsetTop: String,
4803
4871
  offsetLeft: String,
4804
- target: String },
4872
+ target: String,
4873
+ loading: String },
4805
4874
 
4806
4875
 
4807
4876
  data: {
4808
4877
  dataSrc: '',
4809
- dataSrcset: false,
4810
- sizes: false,
4811
- width: false,
4812
- height: false,
4878
+ sources: false,
4813
4879
  offsetTop: '50vh',
4814
4880
  offsetLeft: '50vw',
4815
- target: false },
4881
+ target: false,
4882
+ loading: 'lazy' },
4816
4883
 
4817
4884
 
4818
4885
  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
4886
  target: {
4840
- get(_ref5) {let { target } = _ref5;
4887
+ get(_ref) {let { target } = _ref;
4841
4888
  return [this.$el, ...queryAll(target, this.$el)];
4842
4889
  },
4843
4890
 
4844
4891
  watch() {
4845
- this.observe();
4846
- } },
4847
-
4848
-
4849
- offsetTop(_ref6) {let { offsetTop } = _ref6;
4850
- return toPx(offsetTop, 'height');
4851
- },
4892
+ this.$reset();
4893
+ } } },
4852
4894
 
4853
- offsetLeft(_ref7) {let { offsetLeft } = _ref7;
4854
- return toPx(offsetLeft, 'width');
4855
- } },
4856
4895
 
4857
4896
 
4858
4897
  connected() {
4859
- if (!window.IntersectionObserver) {
4860
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
4898
+ if (this.loading !== 'lazy' || !hasIntersectionObserver) {
4899
+ this.load();
4861
4900
  return;
4862
4901
  }
4863
4902
 
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));
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
+ }
4868
4910
  }
4869
4911
 
4870
- this.observer = new IntersectionObserver(this.load, {
4871
- 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
+
4872
4927
 
4873
4928
 
4874
- requestAnimationFrame(this.observe);
4875
4929
  },
4876
4930
 
4877
4931
  disconnected() {
4878
- this.observer && this.observer.disconnect();
4932
+ if (this._data.image) {
4933
+ this._data.image.onload = '';
4934
+ }
4879
4935
  },
4880
4936
 
4881
4937
  update: {
4882
- read(_ref8) {let { image } = _ref8;
4883
- if (!this.observer) {
4938
+ write(store) {
4939
+ if (!this.observer || isImg(this.$el)) {
4884
4940
  return false;
4885
4941
  }
4886
4942
 
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) {
4943
+ const srcset = data(this.$el, 'data-srcset');
4944
+ if (srcset && window.devicePixelRatio !== 1) {
4903
4945
  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");
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");
4907
4949
  }
4908
4950
  }
4909
4951
  },
@@ -4912,42 +4954,27 @@
4912
4954
 
4913
4955
 
4914
4956
  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;
4957
+ load() {
4958
+ if (this._data.image) {
4959
+ return this._data.image;
4921
4960
  }
4922
4961
 
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
-
4962
+ const image = isImg(this.$el) ?
4963
+ this.$el :
4964
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
4931
4965
 
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
- }
4940
- }
4966
+ removeAttr(image, 'loading');
4967
+ setSrcAttrs(this.$el, image.currentSrc);
4968
+ return this._data.image = image;
4941
4969
  } } };
4942
4970
 
4943
4971
 
4944
4972
 
4945
- function setSrcAttrs(el, src, srcset, sizes) {
4973
+ function setSrcAttrs(el, src) {
4946
4974
  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);
4975
+ const parentNode = parent(el);
4976
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
4977
+ elements.forEach((el) => setSourceProps(el, el));
4951
4978
  } else if (src) {
4952
4979
  const change = !includes(el.style.backgroundImage, src);
4953
4980
  if (change) {
@@ -4957,16 +4984,62 @@
4957
4984
  }
4958
4985
  }
4959
4986
 
4960
- function getPlaceholderImage(width, height, sizes) {
4961
- if (sizes) {
4962
- ({ width, height } = Dimensions.ratio(
4963
- { width, height },
4964
- 'width',
4965
- 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
+ }
4966
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 [];
4967
5026
  }
4968
5027
 
4969
- return "data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>";
5028
+ if (startsWith(sources, '[')) {
5029
+ try {
5030
+ sources = JSON.parse(sources);
5031
+ } catch (e) {
5032
+ sources = [];
5033
+ }
5034
+ } else {
5035
+ sources = parseOptions(sources);
5036
+ }
5037
+
5038
+ if (!isArray(sources)) {
5039
+ sources = [sources];
5040
+ }
5041
+
5042
+ return sources.filter((source) => !isEmpty(source));
4970
5043
  }
4971
5044
 
4972
5045
  const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -5006,24 +5079,18 @@
5006
5079
  return descriptors.filter((size) => size >= srcSize)[0] || descriptors.pop() || '';
5007
5080
  }
5008
5081
 
5009
- function isImg(el) {
5010
- 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
+ }
5011
5086
  }
5012
5087
 
5013
- function currentSrc(el) {
5014
- return el.currentSrc || el.src;
5088
+ function isPicture(el) {
5089
+ return isTag(el, 'picture');
5015
5090
  }
5016
5091
 
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 = {};
5092
+ function isImg(el) {
5093
+ return isTag(el, 'img');
5027
5094
  }
5028
5095
 
5029
5096
  var Media = {
@@ -5479,7 +5546,7 @@
5479
5546
 
5480
5547
 
5481
5548
  function openDialog(tmpl, options, hideFn, submitFn) {
5482
- options = assign({ bgClose: false, escClose: true, labels: modal.labels }, options);
5549
+ options = { bgClose: false, escClose: true, labels: modal.labels, ...options };
5483
5550
 
5484
5551
  const dialog = modal.dialog(tmpl(options), options);
5485
5552
  const deferred = new Deferred();
@@ -5608,10 +5675,11 @@
5608
5675
  this.$create(
5609
5676
  'drop',
5610
5677
  dropdowns.filter((el) => !this.getDropdown(el)),
5611
- assign({}, this.$props, {
5678
+ {
5679
+ ...this.$props,
5612
5680
  boundary: this.boundary,
5613
5681
  pos: this.pos,
5614
- offset: this.dropbar || this.offset }));
5682
+ offset: this.dropbar || this.offset });
5615
5683
 
5616
5684
 
5617
5685
  },
@@ -6503,26 +6571,11 @@
6503
6571
 
6504
6572
 
6505
6573
  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;
6574
+ selTarget(_ref, $el) {let { selTarget } = _ref;
6522
6575
  return selTarget && $(selTarget, $el) || $el;
6523
6576
  },
6524
6577
 
6525
- widthElement(_ref4, $el) {let { widthElement } = _ref4;
6578
+ widthElement(_ref2, $el) {let { widthElement } = _ref2;
6526
6579
  return query(widthElement, $el) || this.placeholder;
6527
6580
  },
6528
6581
 
@@ -6570,41 +6623,36 @@
6570
6623
  return window;
6571
6624
  },
6572
6625
 
6626
+ filter() {
6627
+ return this.targetOffset !== false;
6628
+ },
6629
+
6573
6630
  handler() {
6574
- if (!(this.targetOffset !== false && location.hash && scrollTop(window) > 0)) {
6631
+ if (!location.hash || scrollTop(window) === 0) {
6575
6632
  return;
6576
6633
  }
6577
6634
 
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;
6635
+ fastdom.read(() => {
6636
+ const targetOffset = offset($(location.hash));
6637
+ const elOffset = offset(this.$el);
6585
6638
 
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);
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'));
6597
6646
 
6598
- }
6599
- });
6600
- }
6647
+ }
6648
+ });
6601
6649
  } }],
6602
6650
 
6603
6651
 
6604
6652
 
6605
6653
  update: [
6606
6654
  {
6607
- read(_ref5, types) {let { height: height$1, margin } = _ref5;
6655
+ read(_ref3, types) {let { height: height$1, margin } = _ref3;
6608
6656
  this.inactive = !this.matchMedia || !isVisible(this.$el);
6609
6657
 
6610
6658
  if (this.inactive) {
@@ -6613,35 +6661,49 @@
6613
6661
 
6614
6662
  const hide = this.isActive && types.has('resize');
6615
6663
  if (hide) {
6664
+ css(this.selTarget, 'transition', '0s');
6616
6665
  this.hide();
6617
6666
  }
6618
6667
 
6619
6668
  if (!this.isActive) {
6620
- height$1 = this.$el.offsetHeight;
6669
+ height$1 = offset(this.$el).height;
6621
6670
  margin = css(this.$el, 'margin');
6622
6671
  }
6623
6672
 
6624
6673
  if (hide) {
6625
6674
  this.show();
6675
+ fastdom.write(() => css(this.selTarget, 'transition', ''));
6626
6676
  }
6627
6677
 
6628
- const overflow = Math.max(0, height$1 + this.offset - height(window));
6629
-
6630
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);
6631
6692
  const topOffset = offset(referenceElement).top;
6632
6693
  const offsetParentTop = offset(referenceElement.offsetParent).top;
6633
6694
 
6634
6695
  const top = parseProp(this.top, this.$el, topOffset);
6635
6696
  const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
6636
6697
 
6637
- const start = Math.max(top, topOffset) - this.offset;
6698
+ const start = Math.max(top, topOffset) - offset$1;
6638
6699
  const end = bottom ?
6639
- bottom - this.$el.offsetHeight + overflow - this.offset :
6640
- getScrollingElement(this.$el).scrollHeight - height(window);
6700
+ bottom - offset(this.$el).height + overflow - offset$1 :
6701
+ getScrollingElement(this.$el).scrollHeight - windowHeight;
6641
6702
 
6642
6703
  return {
6643
6704
  start,
6644
6705
  end,
6706
+ offset: offset$1,
6645
6707
  overflow,
6646
6708
  topOffset,
6647
6709
  offsetParentTop,
@@ -6649,11 +6711,11 @@
6649
6711
  margin,
6650
6712
  width: dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).
6651
6713
  width,
6652
- top: offsetPosition(this.placeholder)[0] };
6714
+ top: offsetPosition(referenceElement)[0] };
6653
6715
 
6654
6716
  },
6655
6717
 
6656
- write(_ref6) {let { height, margin } = _ref6;
6718
+ write(_ref4) {let { height, margin } = _ref4;
6657
6719
  const { placeholder } = this;
6658
6720
 
6659
6721
  css(placeholder, { height, margin });
@@ -6670,14 +6732,14 @@
6670
6732
 
6671
6733
 
6672
6734
  {
6673
- read(_ref7)
6735
+ read(_ref5)
6674
6736
 
6675
6737
 
6676
6738
 
6677
6739
 
6678
6740
 
6679
6741
 
6680
- {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;
6681
6743
  const scroll = scrollTop(window);
6682
6744
  const dir = prevScroll <= scroll ? 'down' : 'up';
6683
6745
 
@@ -6758,7 +6820,7 @@
6758
6820
  }
6759
6821
  } else if (this.isFixed) {
6760
6822
  this.update();
6761
- } else if (this.animation) {
6823
+ } else if (this.animation && scroll > topOffset) {
6762
6824
  Animation.cancel(this.$el);
6763
6825
  this.show();
6764
6826
  Animation.in(this.$el, this.animation).catch(noop);
@@ -6786,33 +6848,33 @@
6786
6848
  },
6787
6849
 
6788
6850
  update() {
6789
- const {
6851
+ let {
6790
6852
  width,
6791
6853
  scroll = 0,
6792
6854
  overflow,
6793
6855
  overflowScroll = 0,
6794
6856
  start,
6795
6857
  end,
6858
+ offset,
6796
6859
  topOffset,
6797
6860
  height,
6798
6861
  offsetParentTop } =
6799
6862
  this._data;
6800
6863
  const active = start !== 0 || scroll > start;
6801
- let top = this.offset;
6802
6864
  let position = 'fixed';
6803
6865
 
6804
6866
  if (scroll > end) {
6805
- top = end + this.offset - offsetParentTop;
6867
+ offset += end - offsetParentTop;
6806
6868
  position = 'absolute';
6807
6869
  }
6808
6870
 
6809
6871
  if (overflow) {
6810
- top -= overflowScroll;
6872
+ offset -= overflowScroll;
6811
6873
  }
6812
6874
 
6813
6875
  css(this.$el, {
6814
6876
  position,
6815
- top: top + "px",
6877
+ top: offset + "px",
6816
6878
  width });
6817
6879
 
6818
6880
 
@@ -6842,7 +6904,7 @@
6842
6904
  }
6843
6905
 
6844
6906
  var Switcher = {
6845
- mixins: [Togglable],
6907
+ mixins: [Lazyload, Togglable],
6846
6908
 
6847
6909
  args: 'connect',
6848
6910
 
@@ -6906,6 +6968,10 @@
6906
6968
  } },
6907
6969
 
6908
6970
 
6971
+ connected() {
6972
+ this.lazyload(this.$el, this.connects);
6973
+ },
6974
+
6909
6975
  events: [
6910
6976
  {
6911
6977
  name: 'click',
@@ -7014,7 +7080,7 @@
7014
7080
  const KEY_SPACE = 32;
7015
7081
 
7016
7082
  var toggle = {
7017
- mixins: [Media, Togglable],
7083
+ mixins: [Lazyload, Media, Togglable],
7018
7084
 
7019
7085
  args: 'target',
7020
7086
 
@@ -7036,6 +7102,7 @@
7036
7102
  if (!includes(this.mode, 'media') && !isFocusable(this.$el)) {
7037
7103
  attr(this.$el, 'tabindex', '0');
7038
7104
  }
7105
+ this.lazyload(this.$el, this.target);
7039
7106
  },
7040
7107
 
7041
7108
  computed: {
@@ -7127,7 +7194,7 @@
7127
7194
  name: 'keydown',
7128
7195
 
7129
7196
  filter() {
7130
- return includes(this.mode, 'click') && this.$el.tagName !== 'INPUT';
7197
+ return includes(this.mode, 'click') && !isTag(this.$el, 'input');
7131
7198
  },
7132
7199
 
7133
7200
  handler(e) {