uikit 3.11.2-dev.21a5b7139 → 3.11.2-dev.29f2881ed

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 (146) hide show
  1. package/CHANGELOG.md +36 -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 +10 -14
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +31 -60
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +34 -64
  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 +110 -72
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +110 -72
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +75 -28
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +110 -72
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +57 -21
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +16 -20
  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 +10 -14
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +340 -337
  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 +584 -518
  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 +1 -1
  45. package/src/js/api/state.js +3 -3
  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 +37 -0
  50. package/src/js/components/internal/slider-transitioner.js +2 -2
  51. package/src/js/components/internal/slideshow-animations.js +4 -3
  52. package/src/js/components/lightbox-panel.js +34 -58
  53. package/src/js/components/lightbox.js +3 -4
  54. package/src/js/components/slider.js +30 -11
  55. package/src/js/components/slideshow.js +8 -1
  56. package/src/js/components/sortable.js +8 -8
  57. package/src/js/components/upload.js +9 -13
  58. package/src/js/core/accordion.js +3 -3
  59. package/src/js/core/alert.js +1 -2
  60. package/src/js/core/height-match.js +3 -3
  61. package/src/js/core/icon.js +13 -6
  62. package/src/js/core/img.js +134 -115
  63. package/src/js/core/margin.js +11 -13
  64. package/src/js/core/modal.js +1 -2
  65. package/src/js/core/navbar.js +5 -5
  66. package/src/js/core/scrollspy.js +6 -6
  67. package/src/js/core/sticky.js +34 -35
  68. package/src/js/core/svg.js +10 -6
  69. package/src/js/core/toggle.js +4 -3
  70. package/src/js/mixin/internal/animate-slide.js +9 -12
  71. package/src/js/mixin/parallax.js +110 -72
  72. package/src/js/mixin/slider-drag.js +3 -3
  73. package/src/js/mixin/slider-nav.js +2 -2
  74. package/src/js/mixin/slider.js +8 -16
  75. package/src/js/mixin/slideshow.js +2 -2
  76. package/src/js/mixin/togglable.js +1 -2
  77. package/src/js/util/ajax.js +15 -14
  78. package/src/js/util/animation.js +7 -12
  79. package/src/js/util/attr.js +14 -12
  80. package/src/js/util/dimensions.js +4 -4
  81. package/src/js/util/dom.js +23 -32
  82. package/src/js/util/lang.js +7 -6
  83. package/src/js/util/options.js +2 -11
  84. package/src/js/util/player.js +5 -4
  85. package/src/js/util/position.js +2 -2
  86. package/src/js/util/selector.js +12 -18
  87. package/src/js/util/style.js +4 -4
  88. package/src/less/components/base.less +10 -33
  89. package/src/less/components/form-range.less +48 -95
  90. package/src/less/components/form.less +0 -1
  91. package/src/less/components/height.less +3 -0
  92. package/src/less/components/leader.less +0 -1
  93. package/src/less/components/lightbox.less +0 -1
  94. package/src/less/components/modal.less +3 -7
  95. package/src/less/components/progress.less +14 -36
  96. package/src/less/components/slider.less +0 -3
  97. package/src/less/components/slideshow.less +0 -3
  98. package/src/less/components/text.less +16 -32
  99. package/src/scss/components/base.scss +10 -33
  100. package/src/scss/components/form-range.scss +48 -95
  101. package/src/scss/components/form.scss +0 -1
  102. package/src/scss/components/height.scss +3 -0
  103. package/src/scss/components/leader.scss +0 -1
  104. package/src/scss/components/lightbox.scss +0 -1
  105. package/src/scss/components/modal.scss +3 -7
  106. package/src/scss/components/progress.scss +14 -36
  107. package/src/scss/components/slider.scss +0 -3
  108. package/src/scss/components/slideshow.scss +0 -3
  109. package/src/scss/components/text.scss +16 -32
  110. package/src/scss/mixins-theme.scss +1 -1
  111. package/src/scss/mixins.scss +1 -1
  112. package/src/scss/variables-theme.scss +3 -3
  113. package/src/scss/variables.scss +3 -3
  114. package/tests/align.html +10 -10
  115. package/tests/animation.html +2 -2
  116. package/tests/article.html +2 -2
  117. package/tests/base.html +3 -3
  118. package/tests/card.html +10 -10
  119. package/tests/column.html +3 -3
  120. package/tests/comment.html +9 -9
  121. package/tests/dotnav.html +3 -3
  122. package/tests/image.html +296 -64
  123. package/tests/images/image-type.avif +0 -0
  124. package/tests/images/image-type.jpeg +0 -0
  125. package/tests/images/image-type.webp +0 -0
  126. package/tests/index.html +8 -8
  127. package/tests/lightbox.html +10 -10
  128. package/tests/marker.html +2 -2
  129. package/tests/modal.html +8 -9
  130. package/tests/navbar.html +2 -2
  131. package/tests/overlay.html +7 -7
  132. package/tests/parallax.html +14 -5
  133. package/tests/position.html +12 -12
  134. package/tests/slidenav.html +12 -12
  135. package/tests/slider.html +20 -20
  136. package/tests/sortable.html +1 -1
  137. package/tests/sticky-parallax.html +55 -70
  138. package/tests/svg.html +6 -6
  139. package/tests/table.html +11 -11
  140. package/tests/thumbnav.html +12 -12
  141. package/tests/transition.html +30 -30
  142. package/tests/utility.html +33 -33
  143. package/tests/video.html +1 -1
  144. package/tests/width.html +1 -1
  145. package/src/js/util/promise.js +0 -0
  146. package/tests/images/animated.gif +0 -0
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.21a5b7139 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.29f2881ed | 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,
@@ -304,17 +305,17 @@
304
305
  if (isUndefined(value)) {var _toNode;
305
306
  return (_toNode = toNode(element)) == null ? void 0 : _toNode.getAttribute(name);
306
307
  } else {
307
- toNodes(element).forEach((element) => {
308
+ for (const el of toNodes(element)) {
308
309
  if (isFunction(value)) {
309
- value = value.call(element, attr(element, name));
310
+ value = value.call(el, attr(el, name));
310
311
  }
311
312
 
312
313
  if (value === null) {
313
- removeAttr(element, name);
314
+ removeAttr(el, name);
314
315
  } else {
315
- element.setAttribute(name, value);
316
+ el.setAttribute(name, value);
316
317
  }
317
- });
318
+ }
318
319
  }
319
320
  }
320
321
 
@@ -323,33 +324,22 @@
323
324
  }
324
325
 
325
326
  function removeAttr(element, name) {
326
- element = toNodes(element);
327
- name.split(' ').forEach((name) =>
328
- element.forEach((element) => element.hasAttribute(name) && element.removeAttribute(name)));
329
-
327
+ const elements = toNodes(element);
328
+ for (const attribute of name.split(' ')) {
329
+ for (const element of elements) {
330
+ element.removeAttribute(attribute);
331
+ }
332
+ }
330
333
  }
331
334
 
332
335
  function data(element, attribute) {
333
- for (let i = 0, attrs = [attribute, "data-" + attribute]; i < attrs.length; i++) {
334
- if (hasAttr(element, attrs[i])) {
335
- return attr(element, attrs[i]);
336
+ for (const name of [attribute, "data-" + attribute]) {
337
+ if (hasAttr(element, name)) {
338
+ return attr(element, name);
336
339
  }
337
340
  }
338
341
  }
339
342
 
340
- const inBrowser = typeof window !== 'undefined';
341
- const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
342
-
343
- const hasTouch = inBrowser && 'ontouchstart' in window;
344
- const hasPointerEvents = inBrowser && window.PointerEvent;
345
-
346
- const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
347
- const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
348
- const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
349
- const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
350
- const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
351
- const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
352
-
353
343
  const voidElements = {
354
344
  area: true,
355
345
  base: true,
@@ -449,12 +439,6 @@
449
439
  return findAll(selector, getContext(selector, context));
450
440
  }
451
441
 
452
- function getContext(selector, context) {if (context === void 0) {context = document;}
453
- return isString(selector) && isContextSelector(selector) || isDocument(context) ?
454
- context :
455
- context.ownerDocument;
456
- }
457
-
458
442
  function find(selector, context) {
459
443
  return toNode(_query(selector, context, 'querySelector'));
460
444
  }
@@ -463,6 +447,17 @@
463
447
  return toNodes(_query(selector, context, 'querySelectorAll'));
464
448
  }
465
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
+
466
461
  function _query(selector, context, queryFn) {if (context === void 0) {context = document;}
467
462
  if (!selector || !isString(selector)) {
468
463
  return selector;
@@ -507,11 +502,6 @@
507
502
  }
508
503
  }
509
504
 
510
- const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
511
- const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
512
-
513
- const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
514
-
515
505
  const selectorRe = /.*?[^\\](?:,|$)/g;
516
506
 
517
507
  const splitSelector = memoize((selector) =>
@@ -537,13 +527,8 @@
537
527
  return names.join(' > ');
538
528
  }
539
529
 
540
- const escapeFn =
541
- inBrowser && window.CSS && CSS.escape ||
542
- function (css) {
543
- return css.replace(/([^\x7f-\uFFFF\w-])/g, (match) => "\\" + match);
544
- };
545
530
  function escape(css) {
546
- return isString(css) ? escapeFn.call(null, css) : '';
531
+ return isString(css) ? CSS.escape(css) : '';
547
532
  }
548
533
 
549
534
  function on() {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}
@@ -686,17 +671,14 @@
686
671
  }
687
672
 
688
673
  function ajax(url, options) {
689
- const env = assign(
690
- {
674
+ const env = {
691
675
  data: null,
692
676
  method: 'GET',
693
677
  headers: {},
694
678
  xhr: new XMLHttpRequest(),
695
679
  beforeSend: noop,
696
- responseType: '' },
697
-
698
- options);
699
-
680
+ responseType: '',
681
+ ...options };
700
682
 
701
683
  return Promise.resolve().
702
684
  then(() => env.beforeSend(env)).
@@ -747,8 +729,12 @@
747
729
  return new Promise((resolve, reject) => {
748
730
  const img = new Image();
749
731
 
750
- img.onerror = (e) => reject(e);
751
- img.onload = () => resolve(img);
732
+ img.onerror = (e) => {
733
+ reject(e);
734
+ };
735
+ img.onload = () => {
736
+ resolve(img);
737
+ };
752
738
 
753
739
  sizes && (img.sizes = sizes);
754
740
  srcset && (img.srcset = srcset);
@@ -775,7 +761,8 @@
775
761
 
776
762
 
777
763
  function css(element, property, value, priority) {if (priority === void 0) {priority = '';}
778
- return toNodes(element).map((element) => {
764
+ const elements = toNodes(element);
765
+ for (const element of elements) {
779
766
  if (isString(property)) {
780
767
  property = propName(property);
781
768
 
@@ -801,9 +788,8 @@
801
788
  priority = value;
802
789
  each(property, (value, property) => css(element, property, value, priority));
803
790
  }
804
-
805
- return element;
806
- })[0];
791
+ }
792
+ return elements[0];
807
793
  }
808
794
 
809
795
  function getStyles(element, pseudoElt) {
@@ -930,16 +916,11 @@
930
916
 
931
917
 
932
918
  addClass(element, 'uk-transition');
933
- css(
934
- element,
935
- assign(
936
- {
919
+ css(element, {
937
920
  transitionProperty: Object.keys(props).map(propName).join(','),
938
921
  transitionDuration: duration + "ms",
939
- transitionTimingFunction: timing },
940
-
941
- props));
942
-
922
+ transitionTimingFunction: timing,
923
+ ...props });
943
924
 
944
925
  })));
945
926
 
@@ -1039,8 +1020,8 @@
1039
1020
  const currentOffset = dimensions(element);
1040
1021
 
1041
1022
  if (element) {
1042
- const { pageYOffset, pageXOffset } = toWindow(element);
1043
- const offsetBy = { height: pageYOffset, width: pageXOffset };
1023
+ const { scrollY, scrollX } = toWindow(element);
1024
+ const offsetBy = { height: scrollY, width: scrollX };
1044
1025
 
1045
1026
  for (const dir in dirs$1) {
1046
1027
  for (const i in dirs$1[dir]) {
@@ -1106,8 +1087,8 @@
1106
1087
 
1107
1088
  if (css(element, 'position') === 'fixed') {
1108
1089
  const win = toWindow(element);
1109
- offset[0] += win.pageYOffset;
1110
- offset[1] += win.pageXOffset;
1090
+ offset[0] += win.scrollY;
1091
+ offset[1] += win.scrollX;
1111
1092
  return offset;
1112
1093
  }
1113
1094
  } while (element = element.offsetParent);
@@ -1214,6 +1195,10 @@
1214
1195
  once(document, 'DOMContentLoaded', fn);
1215
1196
  }
1216
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
+
1217
1202
  function empty(element) {
1218
1203
  return replaceChildren(element, '');
1219
1204
  }
@@ -1222,34 +1207,20 @@
1222
1207
  return isUndefined(html) ? $(parent).innerHTML : replaceChildren(parent, html);
1223
1208
  }
1224
1209
 
1225
- function replaceChildren(parent, element) {
1226
- const nodes = $$(element);
1227
- $(parent).replaceChildren(...nodes);
1228
- return nodes;
1229
- }
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');
1230
1215
 
1231
- function prepend(parent, element) {
1232
- const nodes = $$(element);
1233
- $(parent).prepend(...nodes);
1234
- return nodes;
1235
- }
1236
-
1237
- function append(parent, element) {
1238
- const nodes = $$(element);
1239
- $(parent).append(...nodes);
1240
- return nodes;
1241
- }
1242
-
1243
- function before(ref, element) {
1244
- const nodes = $$(element);
1245
- $(ref).before(...nodes);
1246
- return nodes;
1247
- }
1248
-
1249
- function after(ref, element) {
1250
- const nodes = $$(element);
1251
- $(ref).after(...nodes);
1252
- 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
+ };
1253
1224
  }
1254
1225
 
1255
1226
  function remove$1(element) {
@@ -1282,10 +1253,7 @@
1282
1253
  toNodes(element).
1283
1254
  map(parent).
1284
1255
  filter((value, index, self) => self.indexOf(value) === index).
1285
- forEach((parent) => {
1286
- before(parent, parent.childNodes);
1287
- remove$1(parent);
1288
- });
1256
+ forEach((parent) => parent.replaceWith(...parent.childNodes));
1289
1257
  }
1290
1258
 
1291
1259
  const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
@@ -1304,7 +1272,11 @@
1304
1272
  container.textContent = html;
1305
1273
  }
1306
1274
 
1307
- 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];
1308
1280
  }
1309
1281
 
1310
1282
  function apply(node, fn) {
@@ -1333,6 +1305,19 @@
1333
1305
  return isString(str) && startsWith(str.trim(), '<');
1334
1306
  }
1335
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
+
1336
1321
  /*
1337
1322
  Based on:
1338
1323
  Copyright (c) 2016 Wilson Page wilsonpage@me.com
@@ -1524,7 +1509,7 @@
1524
1509
 
1525
1510
  // extend strategy
1526
1511
  strats.computed = strats.methods = function (parentVal, childVal) {
1527
- return childVal ? parentVal ? assign({}, parentVal, childVal) : childVal : parentVal;
1512
+ return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
1528
1513
  };
1529
1514
 
1530
1515
  // data strategy
@@ -1664,11 +1649,11 @@
1664
1649
  }
1665
1650
 
1666
1651
  function isHTML5(el) {
1667
- return (el == null ? void 0 : el.tagName) === 'VIDEO';
1652
+ return isTag(el, 'video');
1668
1653
  }
1669
1654
 
1670
1655
  function isIFrame(el) {
1671
- return (el == null ? void 0 : el.tagName) === 'IFRAME' && (isYoutube(el) || isVimeo(el));
1656
+ return isTag(el, 'iframe') && (isYoutube(el) || isVimeo(el));
1672
1657
  }
1673
1658
 
1674
1659
  function isYoutube(el) {
@@ -1688,7 +1673,7 @@
1688
1673
 
1689
1674
  function post(el, cmd) {
1690
1675
  try {
1691
- el.contentWindow.postMessage(JSON.stringify(assign({ event: 'command' }, cmd)), '*');
1676
+ el.contentWindow.postMessage(JSON.stringify({ event: 'command', ...cmd }), '*');
1692
1677
  } catch (e) {
1693
1678
  // noop
1694
1679
  }
@@ -1980,14 +1965,14 @@
1980
1965
  if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
1981
1966
  position[align] = newVal;
1982
1967
 
1983
- ['element', 'target'].forEach((el) => {
1968
+ for (const el of ['element', 'target']) {
1984
1969
  if (elemOffset) {
1985
1970
  flipped[el][dir] =
1986
1971
  flipped[el][dir] === dirs[prop][1] ?
1987
1972
  dirs[prop][2] :
1988
1973
  dirs[prop][1];
1989
1974
  }
1990
- });
1975
+ }
1991
1976
 
1992
1977
  return true;
1993
1978
  }
@@ -2068,6 +2053,7 @@
2068
2053
  flipPosition: flipPosition,
2069
2054
  toPx: toPx,
2070
2055
  ready: ready,
2056
+ isTag: isTag,
2071
2057
  empty: empty,
2072
2058
  html: html,
2073
2059
  replaceChildren: replaceChildren,
@@ -2362,7 +2348,7 @@
2362
2348
  const {
2363
2349
  $options: { computed } } =
2364
2350
  this;
2365
- const values = assign({}, this._computeds);
2351
+ const values = { ...this._computeds };
2366
2352
  this._computeds = {};
2367
2353
 
2368
2354
  for (const key in computed) {
@@ -2449,9 +2435,9 @@
2449
2435
  }
2450
2436
  };
2451
2437
 
2452
- UIkit.prototype._initEvents = function () {var _this$$options$events;
2438
+ UIkit.prototype._initEvents = function () {
2453
2439
  this._events = [];
2454
- (_this$$options$events = this.$options.events) == null ? void 0 : _this$$options$events.forEach((event) => {
2440
+ for (const event of this.$options.events || []) {
2455
2441
  if (hasOwn(event, 'handler')) {
2456
2442
  registerEvent(this, event);
2457
2443
  } else {
@@ -2459,7 +2445,7 @@
2459
2445
  registerEvent(this, event[key], key);
2460
2446
  }
2461
2447
  }
2462
- });
2448
+ }
2463
2449
  };
2464
2450
 
2465
2451
  UIkit.prototype._unbindEvents = function () {
@@ -2547,7 +2533,7 @@
2547
2533
  el = isFunction(el) ? el.call(component) : el || component.$el;
2548
2534
 
2549
2535
  if (isArray(el)) {
2550
- el.forEach((el) => registerEvent(component, assign({}, event, { el }), key));
2536
+ el.forEach((el) => registerEvent(component, { ...event, el }, key));
2551
2537
  return;
2552
2538
  }
2553
2539
 
@@ -2781,7 +2767,7 @@
2781
2767
  }
2782
2768
  };
2783
2769
 
2784
- const opt = isPlainObject(options) ? assign({}, options) : options.options;
2770
+ const opt = isPlainObject(options) ? { ...options } : options.options;
2785
2771
 
2786
2772
  opt.name = name;
2787
2773
 
@@ -2834,7 +2820,7 @@
2834
2820
  UIkit.data = '__uikit__';
2835
2821
  UIkit.prefix = 'uk-';
2836
2822
  UIkit.options = {};
2837
- UIkit.version = '3.11.2-dev.21a5b7139';
2823
+ UIkit.version = '3.11.2-dev.29f2881ed';
2838
2824
 
2839
2825
  globalAPI(UIkit);
2840
2826
  hooksAPI(UIkit);
@@ -3157,7 +3143,7 @@
3157
3143
  show ?
3158
3144
  Transition.start(
3159
3145
  el,
3160
- assign({}, initProps, { overflow: 'hidden', height: endHeight }),
3146
+ { ...initProps, overflow: 'hidden', height: endHeight },
3161
3147
  Math.round(duration * (1 - currentHeight / endHeight)),
3162
3148
  transition) :
3163
3149
 
@@ -3277,37 +3263,37 @@
3277
3263
  return;
3278
3264
  }
3279
3265
 
3280
- items.forEach((el) =>
3281
- this.toggleElement(el, !hasClass(el, this.clsOpen), async (el, show) => {
3282
- toggleClass(el, this.clsOpen, show);
3283
- attr($(this.$props.toggle, el), 'aria-expanded', show);
3266
+ for (const el of items) {
3267
+ this.toggleElement(el, !hasClass(el, this.clsOpen), async (el, show) => {
3268
+ toggleClass(el, this.clsOpen, show);
3269
+ attr($(this.$props.toggle, el), 'aria-expanded', show);
3284
3270
 
3285
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3271
+ const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3286
3272
 
3287
- if (animate === false || !this.hasTransition) {
3288
- hide(content, !show);
3289
- return;
3290
- }
3273
+ if (animate === false || !this.hasTransition) {
3274
+ hide(content, !show);
3275
+ return;
3276
+ }
3291
3277
 
3292
- if (!el._wrapper) {
3293
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3294
- }
3278
+ if (!el._wrapper) {
3279
+ el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3280
+ }
3295
3281
 
3296
- hide(content, false);
3297
- await toggleHeight(this)(el._wrapper, show);
3298
- hide(content, !show);
3282
+ hide(content, false);
3283
+ await toggleHeight(this)(el._wrapper, show);
3284
+ hide(content, !show);
3299
3285
 
3300
- delete el._wrapper;
3301
- unwrap(content);
3286
+ delete el._wrapper;
3287
+ unwrap(content);
3302
3288
 
3303
- if (show) {
3304
- const toggle = $(this.$props.toggle, el);
3305
- if (!isInView(toggle)) {
3306
- scrollIntoView(toggle, { offset: this.offset });
3289
+ if (show) {
3290
+ const toggle = $(this.$props.toggle, el);
3291
+ if (!isInView(toggle)) {
3292
+ scrollIntoView(toggle, { offset: this.offset });
3293
+ }
3307
3294
  }
3308
- }
3309
- }));
3310
-
3295
+ });
3296
+ }
3311
3297
  } } };
3312
3298
 
3313
3299
 
@@ -3329,7 +3315,7 @@
3329
3315
  animation: [true],
3330
3316
  selClose: '.uk-alert-close',
3331
3317
  duration: 150,
3332
- hideProps: assign({ opacity: 0 }, Togglable.data.hideProps) },
3318
+ hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3333
3319
 
3334
3320
 
3335
3321
  events: [
@@ -4026,10 +4012,10 @@
4026
4012
  },
4027
4013
 
4028
4014
  write(_ref) {let { columns, rows } = _ref;
4029
- for (let i = 0; i < rows.length; i++) {
4030
- for (let j = 0; j < rows[i].length; j++) {
4031
- toggleClass(rows[i][j], this.margin, i !== 0);
4032
- toggleClass(rows[i][j], this.firstColumn, !!~columns[0].indexOf(rows[i][j]));
4015
+ for (const row of rows) {
4016
+ for (const column of row) {
4017
+ toggleClass(column, this.margin, rows[0] !== row);
4018
+ toggleClass(column, this.firstColumn, !!~columns[0].indexOf(column));
4033
4019
  }
4034
4020
  }
4035
4021
  },
@@ -4045,10 +4031,10 @@
4045
4031
  function getColumns(rows) {
4046
4032
  const columns = [];
4047
4033
 
4048
- for (let i = 0; i < rows.length; i++) {
4049
- const sorted = sortBy(rows[i], 'left', 'right');
4034
+ for (const row of rows) {
4035
+ const sorted = sortBy(row, 'left', 'right');
4050
4036
  for (let j = 0; j < sorted.length; j++) {
4051
- columns[j] = !columns[j] ? sorted[j] : columns[j].concat(sorted[j]);
4037
+ columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4052
4038
  }
4053
4039
  }
4054
4040
 
@@ -4058,17 +4044,15 @@
4058
4044
  function sortBy(items, startProp, endProp) {
4059
4045
  const sorted = [[]];
4060
4046
 
4061
- for (let i = 0; i < items.length; i++) {
4062
- const el = items[i];
4063
-
4047
+ for (const el of items) {
4064
4048
  if (!isVisible(el)) {
4065
4049
  continue;
4066
4050
  }
4067
4051
 
4068
4052
  let dim = getOffset(el);
4069
4053
 
4070
- for (let j = sorted.length - 1; j >= 0; j--) {
4071
- const current = sorted[j];
4054
+ for (let i = sorted.length - 1; i >= 0; i--) {
4055
+ const current = sorted[i];
4072
4056
 
4073
4057
  if (!current[0]) {
4074
4058
  current.push(el);
@@ -4093,7 +4077,7 @@
4093
4077
  break;
4094
4078
  }
4095
4079
 
4096
- if (j === 0) {
4080
+ if (i === 0) {
4097
4081
  sorted.unshift([el]);
4098
4082
  break;
4099
4083
  }
@@ -4292,9 +4276,9 @@
4292
4276
  },
4293
4277
 
4294
4278
  write(_ref2) {let { rows } = _ref2;
4295
- rows.forEach((_ref3) => {let { heights, elements } = _ref3;return (
4296
- elements.forEach((el, i) => css(el, 'minHeight', heights[i])));});
4297
-
4279
+ for (const { heights, elements } of rows) {
4280
+ elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
4281
+ }
4298
4282
  },
4299
4283
 
4300
4284
  events: ['resize'] } };
@@ -4488,6 +4472,12 @@
4488
4472
 
4489
4473
  methods: {
4490
4474
  async getSvg() {
4475
+ if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4476
+ return new Promise((resolve) =>
4477
+ once(this.$el, 'load', () => resolve(this.getSvg())));
4478
+
4479
+ }
4480
+
4491
4481
  return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4492
4482
  },
4493
4483
 
@@ -4587,7 +4577,7 @@
4587
4577
  }
4588
4578
 
4589
4579
  function insertSVG(el, root) {
4590
- if (isVoidElement(root) || root.tagName === 'CANVAS') {
4580
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
4591
4581
  root.hidden = true;
4592
4582
 
4593
4583
  const next = root.nextElementSibling;
@@ -4599,11 +4589,7 @@
4599
4589
  }
4600
4590
 
4601
4591
  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';
4592
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4607
4593
  }
4608
4594
 
4609
4595
  function innerHTML(el) {
@@ -4684,14 +4670,14 @@
4684
4670
  },
4685
4671
 
4686
4672
  methods: {
4687
- getSvg() {
4673
+ async getSvg() {
4688
4674
  const icon = getIcon(this.icon);
4689
4675
 
4690
4676
  if (!icon) {
4691
- return Promise.reject('Icon not found.');
4677
+ throw 'Icon not found.';
4692
4678
  }
4693
4679
 
4694
- return Promise.resolve(icon);
4680
+ return icon;
4695
4681
  } } };
4696
4682
 
4697
4683
  const IconComponent = {
@@ -4749,10 +4735,17 @@
4749
4735
  const Spinner = {
4750
4736
  extends: IconComponent,
4751
4737
 
4752
- async connected() {
4753
- const svg = await this.svg;
4754
- svg && this.ratio !== 1 && css($('circle', svg), 'strokeWidth', 1 / this.ratio);
4755
- } };
4738
+ methods: {
4739
+ async getSvg() {
4740
+ const icon = await Icon.methods.getSvg.call(this);
4741
+
4742
+ if (this.ratio !== 1) {
4743
+ css($('circle', icon), 'strokeWidth', 1 / this.ratio);
4744
+ }
4745
+
4746
+ return icon;
4747
+ } } };
4748
+
4756
4749
 
4757
4750
 
4758
4751
  const parsed = {};
@@ -4790,120 +4783,95 @@
4790
4783
  return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4791
4784
  }
4792
4785
 
4786
+ const nativeLazyLoad = ('loading' in HTMLImageElement.prototype);
4787
+ const nativeIsIntersecting = ('isIntersecting' in IntersectionObserverEntry.prototype); // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
4788
+
4793
4789
  var img = {
4794
4790
  args: 'dataSrc',
4795
4791
 
4796
4792
  props: {
4797
4793
  dataSrc: String,
4798
- dataSrcset: Boolean,
4799
- sizes: String,
4800
- width: Number,
4801
- height: Number,
4794
+ sources: String,
4802
4795
  offsetTop: String,
4803
4796
  offsetLeft: String,
4804
- target: String },
4797
+ target: String,
4798
+ loading: String },
4805
4799
 
4806
4800
 
4807
4801
  data: {
4808
4802
  dataSrc: '',
4809
- dataSrcset: false,
4810
- sizes: false,
4811
- width: false,
4812
- height: false,
4803
+ sources: false,
4813
4804
  offsetTop: '50vh',
4814
4805
  offsetLeft: '50vw',
4815
- target: false },
4806
+ target: false,
4807
+ loading: 'lazy' },
4816
4808
 
4817
4809
 
4818
4810
  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
4811
  target: {
4840
- get(_ref5) {let { target } = _ref5;
4812
+ get(_ref) {let { target } = _ref;
4841
4813
  return [this.$el, ...queryAll(target, this.$el)];
4842
4814
  },
4843
4815
 
4844
4816
  watch() {
4845
4817
  this.observe();
4846
- } },
4847
-
4848
-
4849
- offsetTop(_ref6) {let { offsetTop } = _ref6;
4850
- return toPx(offsetTop, 'height');
4851
- },
4818
+ } } },
4852
4819
 
4853
- offsetLeft(_ref7) {let { offsetLeft } = _ref7;
4854
- return toPx(offsetLeft, 'width');
4855
- } },
4856
4820
 
4857
4821
 
4858
4822
  connected() {
4859
- if (!window.IntersectionObserver) {
4860
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
4823
+ if (this.loading !== 'lazy' || !window.IntersectionObserver || !nativeIsIntersecting) {
4824
+ this.load();
4861
4825
  return;
4862
4826
  }
4863
4827
 
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));
4828
+ if (nativeLazyLoad && isImg(this.$el)) {
4829
+ this.$el.loading = 'lazy';
4830
+ setSrcAttrs(this.$el);
4831
+
4832
+ if (this.target.length === 1) {
4833
+ return;
4834
+ }
4868
4835
  }
4869
4836
 
4870
- this.observer = new IntersectionObserver(this.load, {
4871
- rootMargin: this.offsetTop + "px " + this.offsetLeft + "px" });
4837
+ ensureSrcAttribute(this.$el);
4872
4838
 
4839
+ const rootMargin = toPx(this.offsetTop, 'height') + "px " + toPx(
4840
+ this.offsetLeft,
4841
+ 'width') + "px";
4873
4842
 
4874
- requestAnimationFrame(this.observe);
4875
- },
4843
+ this.observer = new IntersectionObserver(
4844
+ (entries) => {
4845
+ if (entries.some((entry) => entry.isIntersecting)) {
4846
+ this.load();
4847
+ this.observer.disconnect();
4848
+ }
4849
+ },
4850
+ { rootMargin });
4876
4851
 
4877
- disconnected() {
4878
- this.observer && this.observer.disconnect();
4852
+ this.observe();
4879
4853
  },
4880
4854
 
4881
- update: {
4882
- read(_ref8) {let { image } = _ref8;
4883
- if (!this.observer) {
4884
- return false;
4885
- }
4855
+ disconnected() {var _this$observer;
4856
+ if (this._data.image) {
4857
+ this._data.image.onload = '';
4858
+ }
4886
4859
 
4887
- if (!image && document.readyState === 'complete') {
4888
- this.load(this.observer.takeRecords());
4889
- }
4860
+ (_this$observer = this.observer) == null ? void 0 : _this$observer.disconnect();
4861
+ },
4890
4862
 
4891
- if (this.isImg) {
4863
+ update: {
4864
+ write(store) {
4865
+ if (!this.observer || isImg(this.$el)) {
4892
4866
  return false;
4893
4867
  }
4894
4868
 
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) {
4869
+ const srcset = data(this.$el, 'data-srcset');
4870
+ if (srcset && window.devicePixelRatio !== 1) {
4903
4871
  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");
4872
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
4873
+ store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
4874
+ css(this.$el, 'backgroundSize', store.bgSize + "px");
4907
4875
  }
4908
4876
  }
4909
4877
  },
@@ -4912,40 +4880,35 @@
4912
4880
 
4913
4881
 
4914
4882
  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;
4883
+ load() {
4884
+ if (this._data.image) {
4885
+ return this._data.image;
4921
4886
  }
4922
4887
 
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
-
4888
+ const image = isImg(this.$el) ?
4889
+ this.$el :
4890
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
4931
4891
 
4932
- this.observer.disconnect();
4892
+ removeAttr(image, 'loading');
4893
+ setSrcAttrs(this.$el, image.currentSrc);
4894
+ return this._data.image = image;
4933
4895
  },
4934
4896
 
4935
4897
  observe() {
4936
4898
  if (this._connected && !this._data.image) {
4937
- this.target.forEach((el) => this.observer.observe(el));
4899
+ for (const el of this.target) {
4900
+ this.observer.observe(el);
4901
+ }
4938
4902
  }
4939
4903
  } } };
4940
4904
 
4941
4905
 
4942
4906
 
4943
- function setSrcAttrs(el, src, srcset, sizes) {
4907
+ function setSrcAttrs(el, src) {
4944
4908
  if (isImg(el)) {
4945
- const set = (prop, val) => val && val !== el[prop] && (el[prop] = val);
4946
- set('sizes', sizes);
4947
- set('srcset', srcset);
4948
- set('src', src);
4909
+ const parentNode = parent(el);
4910
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
4911
+ elements.forEach((el) => setSourceProps(el, el));
4949
4912
  } else if (src) {
4950
4913
  const change = !includes(el.style.backgroundImage, src);
4951
4914
  if (change) {
@@ -4955,16 +4918,62 @@
4955
4918
  }
4956
4919
  }
4957
4920
 
4958
- function getPlaceholderImage(width, height, sizes) {
4959
- if (sizes) {
4960
- ({ width, height } = Dimensions.ratio(
4961
- { width, height },
4962
- 'width',
4963
- toPx(sizesToPixel(sizes))));
4921
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
4922
+ function setSourceProps(sourceEl, targetEl) {
4923
+ srcProps.forEach((prop) => {
4924
+ const value = data(sourceEl, prop);
4925
+ if (value) {
4926
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
4927
+ }
4928
+ });
4929
+ }
4930
+
4931
+ function getImageFromElement(el, src, sources) {
4932
+ const img = new Image();
4933
+
4934
+ wrapInPicture(img, sources);
4935
+ setSourceProps(el, img);
4936
+ img.onload = () => {
4937
+ setSrcAttrs(el, img.currentSrc);
4938
+ };
4939
+ attr(img, 'src', src);
4940
+ return img;
4941
+ }
4942
+
4943
+ function wrapInPicture(img, sources) {
4944
+ sources = parseSources(sources);
4945
+
4946
+ if (sources.length) {
4947
+ const picture = fragment('<picture>');
4948
+ for (const attrs of sources) {
4949
+ const source = fragment('<source>');
4950
+ attr(source, attrs);
4951
+ append(picture, source);
4952
+ }
4953
+ append(picture, img);
4954
+ }
4955
+ }
4956
+
4957
+ function parseSources(sources) {
4958
+ if (!sources) {
4959
+ return [];
4960
+ }
4964
4961
 
4962
+ if (startsWith(sources, '[')) {
4963
+ try {
4964
+ sources = JSON.parse(sources);
4965
+ } catch (e) {
4966
+ sources = [];
4967
+ }
4968
+ } else {
4969
+ sources = parseOptions(sources);
4970
+ }
4971
+
4972
+ if (!isArray(sources)) {
4973
+ sources = [sources];
4965
4974
  }
4966
4975
 
4967
- return "data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>";
4976
+ return sources.filter((source) => !isEmpty(source));
4968
4977
  }
4969
4978
 
4970
4979
  const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -5004,24 +5013,18 @@
5004
5013
  return descriptors.filter((size) => size >= srcSize)[0] || descriptors.pop() || '';
5005
5014
  }
5006
5015
 
5007
- function isImg(el) {
5008
- return el.tagName === 'IMG';
5016
+ function ensureSrcAttribute(el) {
5017
+ if (isImg(el) && !hasAttr(el, 'src')) {
5018
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5019
+ }
5009
5020
  }
5010
5021
 
5011
- function currentSrc(el) {
5012
- return el.currentSrc || el.src;
5022
+ function isPicture(el) {
5023
+ return isTag(el, 'picture');
5013
5024
  }
5014
5025
 
5015
- const key = '__test__';
5016
- let storage;
5017
-
5018
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
5019
- try {
5020
- storage = window.sessionStorage || {};
5021
- storage[key] = 1;
5022
- delete storage[key];
5023
- } catch (e) {
5024
- storage = {};
5026
+ function isImg(el) {
5027
+ return isTag(el, 'img');
5025
5028
  }
5026
5029
 
5027
5030
  var Media = {
@@ -5477,7 +5480,7 @@
5477
5480
 
5478
5481
 
5479
5482
  function openDialog(tmpl, options, hideFn, submitFn) {
5480
- options = assign({ bgClose: false, escClose: true, labels: modal.labels }, options);
5483
+ options = { bgClose: false, escClose: true, labels: modal.labels, ...options };
5481
5484
 
5482
5485
  const dialog = modal.dialog(tmpl(options), options);
5483
5486
  const deferred = new Deferred();
@@ -5591,12 +5594,12 @@
5591
5594
  const dropdowns = $$("." + clsDrop, $el);
5592
5595
 
5593
5596
  if (this.dropContainer !== $el) {
5594
- $$("." + clsDrop, this.dropContainer).forEach((el) => {var _this$getDropdown;
5597
+ for (const el of $$("." + clsDrop, this.dropContainer)) {var _this$getDropdown;
5595
5598
  const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.target;
5596
5599
  if (!includes(dropdowns, el) && target && within(target, this.$el)) {
5597
5600
  dropdowns.push(el);
5598
5601
  }
5599
- });
5602
+ }
5600
5603
  }
5601
5604
 
5602
5605
  return dropdowns;
@@ -5606,10 +5609,11 @@
5606
5609
  this.$create(
5607
5610
  'drop',
5608
5611
  dropdowns.filter((el) => !this.getDropdown(el)),
5609
- assign({}, this.$props, {
5612
+ {
5613
+ ...this.$props,
5610
5614
  boundary: this.boundary,
5611
5615
  pos: this.pos,
5612
- offset: this.dropbar || this.offset }));
5616
+ offset: this.dropbar || this.offset });
5613
5617
 
5614
5618
 
5615
5619
  },
@@ -6298,10 +6302,10 @@
6298
6302
 
6299
6303
 
6300
6304
  disconnected() {
6301
- this.elements.forEach((el) => {
6305
+ for (const el of this.elements) {
6302
6306
  removeClass(el, this.inViewClass, el[stateKey] ? el[stateKey].cls : '');
6303
6307
  delete el[stateKey];
6304
- });
6308
+ }
6305
6309
  },
6306
6310
 
6307
6311
  update: [
@@ -6316,17 +6320,17 @@
6316
6320
  return false;
6317
6321
  }
6318
6322
 
6319
- this.elements.forEach((el) => {
6323
+ for (const el of this.elements) {
6320
6324
  if (!el[stateKey]) {
6321
6325
  el[stateKey] = { cls: data(el, 'uk-scrollspy-class') || this.cls };
6322
6326
  }
6323
6327
 
6324
6328
  el[stateKey].show = isInView(el, this.offsetTop, this.offsetLeft);
6325
- });
6329
+ }
6326
6330
  },
6327
6331
 
6328
6332
  write(data) {
6329
- this.elements.forEach((el) => {
6333
+ for (const el of this.elements) {
6330
6334
  const state = el[stateKey];
6331
6335
 
6332
6336
  if (state.show && !state.inview && !state.queued) {
@@ -6344,7 +6348,7 @@
6344
6348
  } else if (!state.show && state.inview && !state.queued && this.repeat) {
6345
6349
  this.toggle(el, false);
6346
6350
  }
6347
- });
6351
+ }
6348
6352
  },
6349
6353
 
6350
6354
  events: ['scroll', 'resize'] }],
@@ -6501,26 +6505,11 @@
6501
6505
 
6502
6506
 
6503
6507
  computed: {
6504
- position(_ref, $el) {let { position } = _ref;
6505
- return position === 'auto' ?
6506
- (this.isFixed ? this.placeholder : $el).offsetHeight > height(window) ?
6507
- 'bottom' :
6508
- 'top' :
6509
- position;
6510
- },
6511
-
6512
- offset(_ref2, $el) {let { offset } = _ref2;
6513
- if (this.position === 'bottom') {
6514
- offset += '+100vh-100%';
6515
- }
6516
- return toPx(offset, 'height', $el);
6517
- },
6518
-
6519
- selTarget(_ref3, $el) {let { selTarget } = _ref3;
6508
+ selTarget(_ref, $el) {let { selTarget } = _ref;
6520
6509
  return selTarget && $(selTarget, $el) || $el;
6521
6510
  },
6522
6511
 
6523
- widthElement(_ref4, $el) {let { widthElement } = _ref4;
6512
+ widthElement(_ref2, $el) {let { widthElement } = _ref2;
6524
6513
  return query(widthElement, $el) || this.placeholder;
6525
6514
  },
6526
6515
 
@@ -6591,7 +6580,7 @@
6591
6580
  top -
6592
6581
  elHeight - (
6593
6582
  isNumeric(this.targetOffset) ? this.targetOffset : 0) -
6594
- this.offset);
6583
+ toPx(this.offset, 'height'));
6595
6584
 
6596
6585
  }
6597
6586
  });
@@ -6602,7 +6591,7 @@
6602
6591
 
6603
6592
  update: [
6604
6593
  {
6605
- read(_ref5, types) {let { height: height$1, margin } = _ref5;
6594
+ read(_ref3, types) {let { height: height$1, margin } = _ref3;
6606
6595
  this.inactive = !this.matchMedia || !isVisible(this.$el);
6607
6596
 
6608
6597
  if (this.inactive) {
@@ -6611,35 +6600,49 @@
6611
6600
 
6612
6601
  const hide = this.isActive && types.has('resize');
6613
6602
  if (hide) {
6603
+ css(this.selTarget, 'transition', '0s');
6614
6604
  this.hide();
6615
6605
  }
6616
6606
 
6617
6607
  if (!this.isActive) {
6618
- height$1 = this.$el.offsetHeight;
6608
+ height$1 = offset(this.$el).height;
6619
6609
  margin = css(this.$el, 'margin');
6620
6610
  }
6621
6611
 
6622
6612
  if (hide) {
6623
6613
  this.show();
6614
+ fastdom.write(() => css(this.selTarget, 'transition', ''));
6624
6615
  }
6625
6616
 
6626
- const overflow = Math.max(0, height$1 + this.offset - height(window));
6627
-
6628
6617
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
6618
+ const windowHeight = height(window);
6619
+
6620
+ let position = this.position;
6621
+ if (position === 'auto' && height$1 > windowHeight) {
6622
+ position = 'bottom';
6623
+ }
6624
+
6625
+ let offset$1 = toPx(this.offset, 'height', referenceElement);
6626
+ if (position === 'bottom') {
6627
+ offset$1 += windowHeight - height$1;
6628
+ }
6629
+
6630
+ const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
6629
6631
  const topOffset = offset(referenceElement).top;
6630
6632
  const offsetParentTop = offset(referenceElement.offsetParent).top;
6631
6633
 
6632
6634
  const top = parseProp(this.top, this.$el, topOffset);
6633
6635
  const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
6634
6636
 
6635
- const start = Math.max(top, topOffset) - this.offset;
6637
+ const start = Math.max(top, topOffset) - offset$1;
6636
6638
  const end = bottom ?
6637
- bottom - this.$el.offsetHeight + overflow - this.offset :
6638
- getScrollingElement(this.$el).scrollHeight - height(window);
6639
+ bottom - offset(this.$el).height + overflow - offset$1 :
6640
+ getScrollingElement(this.$el).scrollHeight - windowHeight;
6639
6641
 
6640
6642
  return {
6641
6643
  start,
6642
6644
  end,
6645
+ offset: offset$1,
6643
6646
  overflow,
6644
6647
  topOffset,
6645
6648
  offsetParentTop,
@@ -6647,11 +6650,11 @@
6647
6650
  margin,
6648
6651
  width: dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).
6649
6652
  width,
6650
- top: offsetPosition(this.placeholder)[0] };
6653
+ top: offsetPosition(referenceElement)[0] };
6651
6654
 
6652
6655
  },
6653
6656
 
6654
- write(_ref6) {let { height, margin } = _ref6;
6657
+ write(_ref4) {let { height, margin } = _ref4;
6655
6658
  const { placeholder } = this;
6656
6659
 
6657
6660
  css(placeholder, { height, margin });
@@ -6668,14 +6671,14 @@
6668
6671
 
6669
6672
 
6670
6673
  {
6671
- read(_ref7)
6674
+ read(_ref5)
6672
6675
 
6673
6676
 
6674
6677
 
6675
6678
 
6676
6679
 
6677
6680
 
6678
- {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref7;
6681
+ {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref5;
6679
6682
  const scroll = scrollTop(window);
6680
6683
  const dir = prevScroll <= scroll ? 'down' : 'up';
6681
6684
 
@@ -6756,7 +6759,7 @@
6756
6759
  }
6757
6760
  } else if (this.isFixed) {
6758
6761
  this.update();
6759
- } else if (this.animation) {
6762
+ } else if (this.animation && scroll > topOffset) {
6760
6763
  Animation.cancel(this.$el);
6761
6764
  this.show();
6762
6765
  Animation.in(this.$el, this.animation).catch(noop);
@@ -6784,33 +6787,33 @@
6784
6787
  },
6785
6788
 
6786
6789
  update() {
6787
- const {
6790
+ let {
6788
6791
  width,
6789
6792
  scroll = 0,
6790
6793
  overflow,
6791
6794
  overflowScroll = 0,
6792
6795
  start,
6793
6796
  end,
6797
+ offset,
6794
6798
  topOffset,
6795
6799
  height,
6796
6800
  offsetParentTop } =
6797
6801
  this._data;
6798
6802
  const active = start !== 0 || scroll > start;
6799
- let top = this.offset;
6800
6803
  let position = 'fixed';
6801
6804
 
6802
6805
  if (scroll > end) {
6803
- top = end + this.offset - offsetParentTop;
6806
+ offset += end - offsetParentTop;
6804
6807
  position = 'absolute';
6805
6808
  }
6806
6809
 
6807
6810
  if (overflow) {
6808
- top -= overflowScroll;
6811
+ offset -= overflowScroll;
6809
6812
  }
6810
6813
 
6811
6814
  css(this.$el, {
6812
6815
  position,
6813
- top: top + "px",
6816
+ top: offset + "px",
6814
6817
  width });
6815
6818
 
6816
6819
 
@@ -7125,7 +7128,7 @@
7125
7128
  name: 'keydown',
7126
7129
 
7127
7130
  filter() {
7128
- return includes(this.mode, 'click') && this.$el.tagName !== 'INPUT';
7131
+ return includes(this.mode, 'click') && !isTag(this.$el, 'input');
7129
7132
  },
7130
7133
 
7131
7134
  handler(e) {
@@ -7207,10 +7210,10 @@
7207
7210
  const leaving = this.target.filter((el) => hasClass(el, this.clsLeave));
7208
7211
 
7209
7212
  if (leaving.length) {
7210
- this.target.forEach((el) => {
7213
+ for (const el of this.target) {
7211
7214
  const isLeaving = includes(leaving, el);
7212
7215
  this.toggleElement(el, isLeaving, isLeaving);
7213
- });
7216
+ }
7214
7217
  return;
7215
7218
  }
7216
7219