uikit 3.11.2-dev.2b60845fb → 3.11.2-dev.2f4ac8e16

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 (130) hide show
  1. package/CHANGELOG.md +32 -18
  2. package/dist/css/uikit-core-rtl.css +80 -186
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +80 -186
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +82 -192
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +82 -192
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  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 +26 -55
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +27 -57
  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 +85 -68
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +85 -68
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +60 -12
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +85 -68
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +52 -16
  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 +215 -220
  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 +397 -355
  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 +1 -1
  46. package/src/js/components/filter.js +2 -3
  47. package/src/js/components/internal/lightbox-animations.js +4 -3
  48. package/src/js/components/internal/slider-preload.js +37 -0
  49. package/src/js/components/internal/slideshow-animations.js +4 -3
  50. package/src/js/components/lightbox-panel.js +34 -58
  51. package/src/js/components/lightbox.js +1 -2
  52. package/src/js/components/slider.js +21 -1
  53. package/src/js/components/slideshow.js +8 -1
  54. package/src/js/components/sortable.js +1 -1
  55. package/src/js/core/alert.js +1 -2
  56. package/src/js/core/img.js +129 -114
  57. package/src/js/core/modal.js +1 -2
  58. package/src/js/core/navbar.js +3 -3
  59. package/src/js/core/sticky.js +1 -1
  60. package/src/js/core/svg.js +10 -6
  61. package/src/js/core/toggle.js +2 -1
  62. package/src/js/mixin/internal/animate-slide.js +9 -12
  63. package/src/js/mixin/parallax.js +85 -68
  64. package/src/js/mixin/slider.js +8 -16
  65. package/src/js/mixin/slideshow.js +2 -2
  66. package/src/js/mixin/togglable.js +1 -2
  67. package/src/js/util/ajax.js +9 -12
  68. package/src/js/util/animation.js +7 -12
  69. package/src/js/util/dom.js +27 -30
  70. package/src/js/util/lang.js +7 -6
  71. package/src/js/util/options.js +2 -11
  72. package/src/js/util/player.js +5 -4
  73. package/src/js/util/selector.js +12 -18
  74. package/src/js/util/style.js +4 -4
  75. package/src/less/components/base.less +10 -33
  76. package/src/less/components/form-range.less +52 -97
  77. package/src/less/components/form.less +0 -1
  78. package/src/less/components/leader.less +0 -1
  79. package/src/less/components/lightbox.less +0 -1
  80. package/src/less/components/modal.less +3 -7
  81. package/src/less/components/progress.less +14 -36
  82. package/src/less/components/slider.less +0 -3
  83. package/src/less/components/slideshow.less +0 -3
  84. package/src/less/components/text.less +16 -32
  85. package/src/scss/components/base.scss +10 -33
  86. package/src/scss/components/form-range.scss +52 -97
  87. package/src/scss/components/form.scss +0 -1
  88. package/src/scss/components/leader.scss +0 -1
  89. package/src/scss/components/lightbox.scss +0 -1
  90. package/src/scss/components/modal.scss +3 -7
  91. package/src/scss/components/progress.scss +14 -36
  92. package/src/scss/components/slider.scss +0 -3
  93. package/src/scss/components/slideshow.scss +0 -3
  94. package/src/scss/components/text.scss +16 -32
  95. package/src/scss/mixins-theme.scss +1 -1
  96. package/src/scss/mixins.scss +1 -1
  97. package/src/scss/variables-theme.scss +3 -3
  98. package/src/scss/variables.scss +3 -3
  99. package/tests/align.html +10 -10
  100. package/tests/animation.html +2 -2
  101. package/tests/article.html +2 -2
  102. package/tests/base.html +3 -3
  103. package/tests/card.html +10 -10
  104. package/tests/column.html +3 -3
  105. package/tests/comment.html +9 -9
  106. package/tests/dotnav.html +3 -3
  107. package/tests/image.html +296 -64
  108. package/tests/images/image-type.avif +0 -0
  109. package/tests/images/image-type.jpeg +0 -0
  110. package/tests/images/image-type.webp +0 -0
  111. package/tests/index.html +8 -8
  112. package/tests/lightbox.html +10 -10
  113. package/tests/marker.html +2 -2
  114. package/tests/modal.html +8 -9
  115. package/tests/navbar.html +2 -2
  116. package/tests/overlay.html +7 -7
  117. package/tests/parallax.html +14 -5
  118. package/tests/position.html +12 -12
  119. package/tests/slidenav.html +12 -12
  120. package/tests/slider.html +20 -20
  121. package/tests/sortable.html +1 -1
  122. package/tests/sticky-parallax.html +47 -62
  123. package/tests/svg.html +6 -6
  124. package/tests/table.html +11 -11
  125. package/tests/thumbnav.html +12 -12
  126. package/tests/transition.html +30 -30
  127. package/tests/utility.html +33 -33
  128. package/tests/video.html +1 -1
  129. package/tests/width.html +1 -1
  130. package/tests/images/animated.gif +0 -0
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.2b60845fb | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.2f4ac8e16 | 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)).
@@ -777,7 +757,8 @@
777
757
 
778
758
 
779
759
  function css(element, property, value, priority) {if (priority === void 0) {priority = '';}
780
- return toNodes(element).map((element) => {
760
+ const elements = toNodes(element);
761
+ for (const element of elements) {
781
762
  if (isString(property)) {
782
763
  property = propName(property);
783
764
 
@@ -803,9 +784,8 @@
803
784
  priority = value;
804
785
  each(property, (value, property) => css(element, property, value, priority));
805
786
  }
806
-
807
- return element;
808
- })[0];
787
+ }
788
+ return elements[0];
809
789
  }
810
790
 
811
791
  function getStyles(element, pseudoElt) {
@@ -932,16 +912,11 @@
932
912
 
933
913
 
934
914
  addClass(element, 'uk-transition');
935
- css(
936
- element,
937
- assign(
938
- {
915
+ css(element, {
939
916
  transitionProperty: Object.keys(props).map(propName).join(','),
940
917
  transitionDuration: duration + "ms",
941
- transitionTimingFunction: timing },
942
-
943
- props));
944
-
918
+ transitionTimingFunction: timing,
919
+ ...props });
945
920
 
946
921
  })));
947
922
 
@@ -1216,6 +1191,10 @@
1216
1191
  once(document, 'DOMContentLoaded', fn);
1217
1192
  }
1218
1193
 
1194
+ function isTag(element, tagName) {var _element$tagName;
1195
+ return (element == null ? void 0 : (_element$tagName = element.tagName) == null ? void 0 : _element$tagName.toLowerCase()) === tagName.toLowerCase();
1196
+ }
1197
+
1219
1198
  function empty(element) {
1220
1199
  return replaceChildren(element, '');
1221
1200
  }
@@ -1224,34 +1203,20 @@
1224
1203
  return isUndefined(html) ? $(parent).innerHTML : replaceChildren(parent, html);
1225
1204
  }
1226
1205
 
1227
- function replaceChildren(parent, element) {
1228
- const nodes = $$(element);
1229
- $(parent).replaceChildren(...nodes);
1230
- return nodes;
1231
- }
1232
-
1233
- function prepend(parent, element) {
1234
- const nodes = $$(element);
1235
- $(parent).prepend(...nodes);
1236
- return nodes;
1237
- }
1238
-
1239
- function append(parent, element) {
1240
- const nodes = $$(element);
1241
- $(parent).append(...nodes);
1242
- return nodes;
1243
- }
1244
-
1245
- function before(ref, element) {
1246
- const nodes = $$(element);
1247
- $(ref).before(...nodes);
1248
- return nodes;
1249
- }
1206
+ const replaceChildren = applyFn('replaceChildren');
1207
+ const prepend = applyFn('prepend');
1208
+ const append = applyFn('append');
1209
+ const before = applyFn('before');
1210
+ const after = applyFn('after');
1250
1211
 
1251
- function after(ref, element) {
1252
- const nodes = $$(element);
1253
- $(ref).after(...nodes);
1254
- return nodes;
1212
+ function applyFn(fn) {
1213
+ return function (ref, element) {
1214
+ const nodes = toNodes(isString(element) ? fragment(element) : element);
1215
+ if (nodes.length) {
1216
+ $(ref)[fn](...nodes);
1217
+ }
1218
+ return unwrapSingle(nodes);
1219
+ };
1255
1220
  }
1256
1221
 
1257
1222
  function remove$1(element) {
@@ -1289,9 +1254,16 @@
1289
1254
 
1290
1255
  function fragment(html) {
1291
1256
  const template = document.createElement('template');
1292
- template.innerHTML = html;
1293
- const { childNodes } = template.content;
1294
- return childNodes.length > 1 ? toNodes(childNodes) : childNodes[0];
1257
+ template.innerHTML = html.trim();
1258
+ const nodes = toNodes(template.content.childNodes);
1259
+ for (const node of nodes) {
1260
+ document.adoptNode(node);
1261
+ }
1262
+ return unwrapSingle(nodes);
1263
+ }
1264
+
1265
+ function unwrapSingle(nodes) {
1266
+ return nodes.length > 1 ? nodes : nodes[0];
1295
1267
  }
1296
1268
 
1297
1269
  function apply(node, fn) {
@@ -1320,6 +1292,19 @@
1320
1292
  return isString(str) && startsWith(str.trim(), '<');
1321
1293
  }
1322
1294
 
1295
+ const inBrowser = typeof window !== 'undefined';
1296
+ const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
1297
+
1298
+ const hasTouch = inBrowser && 'ontouchstart' in window;
1299
+ const hasPointerEvents = inBrowser && window.PointerEvent;
1300
+
1301
+ const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1302
+ const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1303
+ const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
1304
+ const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
1305
+ const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
1306
+ const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
1307
+
1323
1308
  /*
1324
1309
  Based on:
1325
1310
  Copyright (c) 2016 Wilson Page wilsonpage@me.com
@@ -1511,7 +1496,7 @@
1511
1496
 
1512
1497
  // extend strategy
1513
1498
  strats.computed = strats.methods = function (parentVal, childVal) {
1514
- return childVal ? parentVal ? assign({}, parentVal, childVal) : childVal : parentVal;
1499
+ return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
1515
1500
  };
1516
1501
 
1517
1502
  // data strategy
@@ -1651,11 +1636,11 @@
1651
1636
  }
1652
1637
 
1653
1638
  function isHTML5(el) {
1654
- return (el == null ? void 0 : el.tagName) === 'VIDEO';
1639
+ return isTag(el, 'video');
1655
1640
  }
1656
1641
 
1657
1642
  function isIFrame(el) {
1658
- return (el == null ? void 0 : el.tagName) === 'IFRAME' && (isYoutube(el) || isVimeo(el));
1643
+ return isTag(el, 'iframe') && (isYoutube(el) || isVimeo(el));
1659
1644
  }
1660
1645
 
1661
1646
  function isYoutube(el) {
@@ -1675,7 +1660,7 @@
1675
1660
 
1676
1661
  function post(el, cmd) {
1677
1662
  try {
1678
- el.contentWindow.postMessage(JSON.stringify(assign({ event: 'command' }, cmd)), '*');
1663
+ el.contentWindow.postMessage(JSON.stringify({ event: 'command', ...cmd }), '*');
1679
1664
  } catch (e) {
1680
1665
  // noop
1681
1666
  }
@@ -2055,6 +2040,7 @@
2055
2040
  flipPosition: flipPosition,
2056
2041
  toPx: toPx,
2057
2042
  ready: ready,
2043
+ isTag: isTag,
2058
2044
  empty: empty,
2059
2045
  html: html,
2060
2046
  replaceChildren: replaceChildren,
@@ -2349,7 +2335,7 @@
2349
2335
  const {
2350
2336
  $options: { computed } } =
2351
2337
  this;
2352
- const values = assign({}, this._computeds);
2338
+ const values = { ...this._computeds };
2353
2339
  this._computeds = {};
2354
2340
 
2355
2341
  for (const key in computed) {
@@ -2534,7 +2520,7 @@
2534
2520
  el = isFunction(el) ? el.call(component) : el || component.$el;
2535
2521
 
2536
2522
  if (isArray(el)) {
2537
- el.forEach((el) => registerEvent(component, assign({}, event, { el }), key));
2523
+ el.forEach((el) => registerEvent(component, { ...event, el }, key));
2538
2524
  return;
2539
2525
  }
2540
2526
 
@@ -2768,7 +2754,7 @@
2768
2754
  }
2769
2755
  };
2770
2756
 
2771
- const opt = isPlainObject(options) ? assign({}, options) : options.options;
2757
+ const opt = isPlainObject(options) ? { ...options } : options.options;
2772
2758
 
2773
2759
  opt.name = name;
2774
2760
 
@@ -2821,7 +2807,7 @@
2821
2807
  UIkit.data = '__uikit__';
2822
2808
  UIkit.prefix = 'uk-';
2823
2809
  UIkit.options = {};
2824
- UIkit.version = '3.11.2-dev.2b60845fb';
2810
+ UIkit.version = '3.11.2-dev.2f4ac8e16';
2825
2811
 
2826
2812
  globalAPI(UIkit);
2827
2813
  hooksAPI(UIkit);
@@ -3144,7 +3130,7 @@
3144
3130
  show ?
3145
3131
  Transition.start(
3146
3132
  el,
3147
- assign({}, initProps, { overflow: 'hidden', height: endHeight }),
3133
+ { ...initProps, overflow: 'hidden', height: endHeight },
3148
3134
  Math.round(duration * (1 - currentHeight / endHeight)),
3149
3135
  transition) :
3150
3136
 
@@ -3316,7 +3302,7 @@
3316
3302
  animation: [true],
3317
3303
  selClose: '.uk-alert-close',
3318
3304
  duration: 150,
3319
- hideProps: assign({ opacity: 0 }, Togglable.data.hideProps) },
3305
+ hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3320
3306
 
3321
3307
 
3322
3308
  events: [
@@ -4473,6 +4459,12 @@
4473
4459
 
4474
4460
  methods: {
4475
4461
  async getSvg() {
4462
+ if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4463
+ return new Promise((resolve) =>
4464
+ once(this.$el, 'load', () => resolve(this.getSvg())));
4465
+
4466
+ }
4467
+
4476
4468
  return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4477
4469
  },
4478
4470
 
@@ -4572,7 +4564,7 @@
4572
4564
  }
4573
4565
 
4574
4566
  function insertSVG(el, root) {
4575
- if (isVoidElement(root) || root.tagName === 'CANVAS') {
4567
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
4576
4568
  root.hidden = true;
4577
4569
 
4578
4570
  const next = root.nextElementSibling;
@@ -4584,11 +4576,7 @@
4584
4576
  }
4585
4577
 
4586
4578
  function equals(el, other) {
4587
- return isSVG(el) && isSVG(other) && innerHTML(el) === innerHTML(other);
4588
- }
4589
-
4590
- function isSVG(el) {
4591
- return (el == null ? void 0 : el.tagName) === 'svg';
4579
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4592
4580
  }
4593
4581
 
4594
4582
  function innerHTML(el) {
@@ -4775,120 +4763,95 @@
4775
4763
  return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4776
4764
  }
4777
4765
 
4766
+ const nativeLazyLoad = ('loading' in HTMLImageElement.prototype);
4767
+ const nativeIsIntersecting = ('isIntersecting' in IntersectionObserverEntry.prototype); // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
4768
+
4778
4769
  var img = {
4779
4770
  args: 'dataSrc',
4780
4771
 
4781
4772
  props: {
4782
4773
  dataSrc: String,
4783
- dataSrcset: Boolean,
4784
- sizes: String,
4785
- width: Number,
4786
- height: Number,
4774
+ sources: String,
4787
4775
  offsetTop: String,
4788
4776
  offsetLeft: String,
4789
- target: String },
4777
+ target: String,
4778
+ loading: String },
4790
4779
 
4791
4780
 
4792
4781
  data: {
4793
4782
  dataSrc: '',
4794
- dataSrcset: false,
4795
- sizes: false,
4796
- width: false,
4797
- height: false,
4783
+ sources: false,
4798
4784
  offsetTop: '50vh',
4799
4785
  offsetLeft: '50vw',
4800
- target: false },
4786
+ target: false,
4787
+ loading: 'lazy' },
4801
4788
 
4802
4789
 
4803
4790
  computed: {
4804
- cacheKey(_ref) {let { dataSrc } = _ref;
4805
- return this.$name + "." + dataSrc;
4806
- },
4807
-
4808
- width(_ref2) {let { width, dataWidth } = _ref2;
4809
- return width || dataWidth;
4810
- },
4811
-
4812
- height(_ref3) {let { height, dataHeight } = _ref3;
4813
- return height || dataHeight;
4814
- },
4815
-
4816
- sizes(_ref4) {let { sizes, dataSizes } = _ref4;
4817
- return sizes || dataSizes;
4818
- },
4819
-
4820
- isImg(_, $el) {
4821
- return isImg($el);
4822
- },
4823
-
4824
4791
  target: {
4825
- get(_ref5) {let { target } = _ref5;
4792
+ get(_ref) {let { target } = _ref;
4826
4793
  return [this.$el, ...queryAll(target, this.$el)];
4827
4794
  },
4828
4795
 
4829
4796
  watch() {
4830
4797
  this.observe();
4831
- } },
4832
-
4833
-
4834
- offsetTop(_ref6) {let { offsetTop } = _ref6;
4835
- return toPx(offsetTop, 'height');
4836
- },
4798
+ } } },
4837
4799
 
4838
- offsetLeft(_ref7) {let { offsetLeft } = _ref7;
4839
- return toPx(offsetLeft, 'width');
4840
- } },
4841
4800
 
4842
4801
 
4843
4802
  connected() {
4844
- if (!window.IntersectionObserver) {
4845
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
4803
+ if (this.loading !== 'lazy' || !window.IntersectionObserver || !nativeIsIntersecting) {
4804
+ this.load();
4846
4805
  return;
4847
4806
  }
4848
4807
 
4849
- if (storage[this.cacheKey]) {
4850
- setSrcAttrs(this.$el, storage[this.cacheKey], this.dataSrcset, this.sizes);
4851
- } else if (this.isImg && this.width && this.height) {
4852
- setSrcAttrs(this.$el, getPlaceholderImage(this.width, this.height, this.sizes));
4808
+ if (nativeLazyLoad && isImg(this.$el)) {
4809
+ this.$el.loading = 'lazy';
4810
+ setSrcAttrs(this.$el);
4811
+
4812
+ if (this.target.length === 1) {
4813
+ return;
4814
+ }
4853
4815
  }
4854
4816
 
4855
- this.observer = new IntersectionObserver(this.load, {
4856
- rootMargin: this.offsetTop + "px " + this.offsetLeft + "px" });
4817
+ ensureSrcAttribute(this.$el);
4857
4818
 
4819
+ const rootMargin = toPx(this.offsetTop, 'height') + "px " + toPx(
4820
+ this.offsetLeft,
4821
+ 'width') + "px";
4858
4822
 
4859
- requestAnimationFrame(this.observe);
4860
- },
4823
+ this.observer = new IntersectionObserver(
4824
+ (entries) => {
4825
+ if (entries.some((entry) => entry.isIntersecting)) {
4826
+ this.load();
4827
+ this.observer.disconnect();
4828
+ }
4829
+ },
4830
+ { rootMargin });
4861
4831
 
4862
- disconnected() {
4863
- this.observer && this.observer.disconnect();
4832
+ this.observe();
4864
4833
  },
4865
4834
 
4866
- update: {
4867
- read(_ref8) {let { image } = _ref8;
4868
- if (!this.observer) {
4869
- return false;
4870
- }
4835
+ disconnected() {var _this$observer;
4836
+ if (this._data.image) {
4837
+ this._data.image.onload = '';
4838
+ }
4871
4839
 
4872
- if (!image && document.readyState === 'complete') {
4873
- this.load(this.observer.takeRecords());
4874
- }
4840
+ (_this$observer = this.observer) == null ? void 0 : _this$observer.disconnect();
4841
+ },
4875
4842
 
4876
- if (this.isImg) {
4843
+ update: {
4844
+ write(store) {
4845
+ if (!this.observer || isImg(this.$el)) {
4877
4846
  return false;
4878
4847
  }
4879
4848
 
4880
- image &&
4881
- image.then(
4882
- (img) => img && img.currentSrc !== '' && setSrcAttrs(this.$el, currentSrc(img)));
4883
-
4884
- },
4885
-
4886
- write(data) {
4887
- if (this.dataSrcset && window.devicePixelRatio !== 1) {
4849
+ const srcset = data(this.$el, 'data-srcset');
4850
+ if (srcset && window.devicePixelRatio !== 1) {
4888
4851
  const bgSize = css(this.$el, 'backgroundSize');
4889
- if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === data.bgSize) {
4890
- data.bgSize = getSourceSize(this.dataSrcset, this.sizes);
4891
- css(this.$el, 'backgroundSize', data.bgSize + "px");
4852
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
4853
+ store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
4854
+ css(this.$el, 'backgroundSize', store.bgSize + "px");
4892
4855
  }
4893
4856
  }
4894
4857
  },
@@ -4897,24 +4860,18 @@
4897
4860
 
4898
4861
 
4899
4862
  methods: {
4900
- load(entries) {
4901
- // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
4902
- if (
4903
- !entries.some((entry) => isUndefined(entry.isIntersecting) || entry.isIntersecting))
4904
- {
4905
- return;
4863
+ load() {
4864
+ if (this._data.image) {
4865
+ return this._data.image;
4906
4866
  }
4907
4867
 
4908
- this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(
4909
- (img) => {
4910
- setSrcAttrs(this.$el, currentSrc(img), img.srcset, img.sizes);
4911
- storage[this.cacheKey] = currentSrc(img);
4912
- return img;
4913
- },
4914
- (e) => trigger(this.$el, new e.constructor(e.type, e)));
4915
-
4868
+ const image = isImg(this.$el) ?
4869
+ this.$el :
4870
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
4916
4871
 
4917
- this.observer.disconnect();
4872
+ removeAttr(image, 'loading');
4873
+ setSrcAttrs(this.$el, image.currentSrc);
4874
+ return this._data.image = image;
4918
4875
  },
4919
4876
 
4920
4877
  observe() {
@@ -4927,12 +4884,11 @@
4927
4884
 
4928
4885
 
4929
4886
 
4930
- function setSrcAttrs(el, src, srcset, sizes) {
4887
+ function setSrcAttrs(el, src) {
4931
4888
  if (isImg(el)) {
4932
- const set = (prop, val) => val && val !== el[prop] && (el[prop] = val);
4933
- set('sizes', sizes);
4934
- set('srcset', srcset);
4935
- set('src', src);
4889
+ const parentNode = parent(el);
4890
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
4891
+ elements.forEach((el) => setSourceProps(el, el));
4936
4892
  } else if (src) {
4937
4893
  const change = !includes(el.style.backgroundImage, src);
4938
4894
  if (change) {
@@ -4942,16 +4898,60 @@
4942
4898
  }
4943
4899
  }
4944
4900
 
4945
- function getPlaceholderImage(width, height, sizes) {
4946
- if (sizes) {
4947
- ({ width, height } = Dimensions.ratio(
4948
- { width, height },
4949
- 'width',
4950
- toPx(sizesToPixel(sizes))));
4901
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
4902
+ function setSourceProps(sourceEl, targetEl) {
4903
+ srcProps.forEach((prop) => {
4904
+ const value = data(sourceEl, prop);
4905
+ if (value) {
4906
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
4907
+ }
4908
+ });
4909
+ }
4910
+
4911
+ function getImageFromElement(el, src, sources) {
4912
+ const img = new Image();
4913
+
4914
+ wrapInPicture(img, sources);
4915
+ setSourceProps(el, img);
4916
+ img.onload = () => setSrcAttrs(el, img.currentSrc);
4917
+ attr(img, 'src', src);
4918
+ return img;
4919
+ }
4951
4920
 
4921
+ function wrapInPicture(img, sources) {
4922
+ sources = parseSources(sources);
4923
+
4924
+ if (sources.length) {
4925
+ const picture = fragment('<picture>');
4926
+ for (const attrs of sources) {
4927
+ const source = fragment('<source>');
4928
+ attr(source, attrs);
4929
+ append(picture, source);
4930
+ }
4931
+ append(picture, img);
4932
+ }
4933
+ }
4934
+
4935
+ function parseSources(sources) {
4936
+ if (!sources) {
4937
+ return [];
4938
+ }
4939
+
4940
+ if (startsWith(sources, '[')) {
4941
+ try {
4942
+ sources = JSON.parse(sources);
4943
+ } catch (e) {
4944
+ sources = [];
4945
+ }
4946
+ } else {
4947
+ sources = parseOptions(sources);
4952
4948
  }
4953
4949
 
4954
- return "data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>";
4950
+ if (!isArray(sources)) {
4951
+ sources = [sources];
4952
+ }
4953
+
4954
+ return sources.filter((source) => !isEmpty(source));
4955
4955
  }
4956
4956
 
4957
4957
  const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -4991,24 +4991,18 @@
4991
4991
  return descriptors.filter((size) => size >= srcSize)[0] || descriptors.pop() || '';
4992
4992
  }
4993
4993
 
4994
- function isImg(el) {
4995
- return el.tagName === 'IMG';
4994
+ function ensureSrcAttribute(el) {
4995
+ if (isImg(el) && !hasAttr(el, 'src')) {
4996
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
4997
+ }
4996
4998
  }
4997
4999
 
4998
- function currentSrc(el) {
4999
- return el.currentSrc || el.src;
5000
+ function isPicture(el) {
5001
+ return isTag(el, 'picture');
5000
5002
  }
5001
5003
 
5002
- const key = '__test__';
5003
- let storage;
5004
-
5005
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
5006
- try {
5007
- storage = window.sessionStorage || {};
5008
- storage[key] = 1;
5009
- delete storage[key];
5010
- } catch (e) {
5011
- storage = {};
5004
+ function isImg(el) {
5005
+ return isTag(el, 'img');
5012
5006
  }
5013
5007
 
5014
5008
  var Media = {
@@ -5464,7 +5458,7 @@
5464
5458
 
5465
5459
 
5466
5460
  function openDialog(tmpl, options, hideFn, submitFn) {
5467
- options = assign({ bgClose: false, escClose: true, labels: modal.labels }, options);
5461
+ options = { bgClose: false, escClose: true, labels: modal.labels, ...options };
5468
5462
 
5469
5463
  const dialog = modal.dialog(tmpl(options), options);
5470
5464
  const deferred = new Deferred();
@@ -5593,10 +5587,11 @@
5593
5587
  this.$create(
5594
5588
  'drop',
5595
5589
  dropdowns.filter((el) => !this.getDropdown(el)),
5596
- assign({}, this.$props, {
5590
+ {
5591
+ ...this.$props,
5597
5592
  boundary: this.boundary,
5598
5593
  pos: this.pos,
5599
- offset: this.dropbar || this.offset }));
5594
+ offset: this.dropbar || this.offset });
5600
5595
 
5601
5596
 
5602
5597
  },
@@ -6634,7 +6629,7 @@
6634
6629
  margin,
6635
6630
  width: dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).
6636
6631
  width,
6637
- top: offsetPosition(this.placeholder)[0] };
6632
+ top: offsetPosition(referenceElement)[0] };
6638
6633
 
6639
6634
  },
6640
6635
 
@@ -7112,7 +7107,7 @@
7112
7107
  name: 'keydown',
7113
7108
 
7114
7109
  filter() {
7115
- return includes(this.mode, 'click') && this.$el.tagName !== 'INPUT';
7110
+ return includes(this.mode, 'click') && isTag(this.$el, 'input');
7116
7111
  },
7117
7112
 
7118
7113
  handler(e) {