uikit 3.21.13 → 3.21.14-dev.2e8a07c7e

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 (142) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/css/uikit-core-rtl.css +233 -85
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +233 -85
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +237 -81
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +237 -81
  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 +2 -11
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +432 -127
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +449 -132
  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 +2 -2
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +2 -2
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +20 -28
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +2 -2
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +25 -34
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +4 -2
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +8 -12
  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 +242 -241
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +20 -17
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +668 -549
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +3 -3
  43. package/src/images/icons/arrow-down-arrow-up.svg +6 -0
  44. package/src/images/icons/arrow-down.svg +3 -3
  45. package/src/images/icons/arrow-left.svg +3 -3
  46. package/src/images/icons/arrow-right.svg +3 -3
  47. package/src/images/icons/arrow-up-right.svg +3 -3
  48. package/src/images/icons/arrow-up.svg +3 -3
  49. package/src/images/icons/close-circle.svg +5 -0
  50. package/src/images/icons/cloud-download.svg +4 -4
  51. package/src/images/icons/cloud-upload.svg +4 -4
  52. package/src/images/icons/download.svg +4 -4
  53. package/src/images/icons/expand.svg +5 -5
  54. package/src/images/icons/link-external.svg +4 -4
  55. package/src/images/icons/pull.svg +4 -4
  56. package/src/images/icons/push.svg +3 -3
  57. package/src/images/icons/shrink.svg +5 -5
  58. package/src/images/icons/sign-in.svg +4 -3
  59. package/src/images/icons/sign-out.svg +4 -3
  60. package/src/images/icons/sorting.svg +6 -0
  61. package/src/images/icons/upload.svg +4 -4
  62. package/src/js/api/boot.js +16 -20
  63. package/src/js/api/events.js +12 -13
  64. package/src/js/api/instance.js +1 -1
  65. package/src/js/components/internal/lightbox-animations.js +2 -1
  66. package/src/js/components/internal/slideshow-animations.js +5 -5
  67. package/src/js/components/lightbox-panel.js +184 -45
  68. package/src/js/components/lightbox.js +59 -6
  69. package/src/js/components/slideshow.js +1 -2
  70. package/src/js/components/sortable.js +3 -1
  71. package/src/js/core/drop.js +3 -1
  72. package/src/js/core/grid.js +1 -1
  73. package/src/js/core/icon.js +2 -2
  74. package/src/js/core/img.js +3 -5
  75. package/src/js/core/navbar.js +6 -2
  76. package/src/js/core/scrollspy-nav.js +1 -1
  77. package/src/js/core/svg.js +8 -10
  78. package/src/js/core/video.js +4 -3
  79. package/src/js/mixin/internal/slideshow-animations.js +1 -6
  80. package/src/js/mixin/modal.js +1 -4
  81. package/src/js/mixin/slider-drag.js +5 -6
  82. package/src/js/mixin/slider-nav.js +4 -2
  83. package/src/js/mixin/slider.js +11 -13
  84. package/src/js/mixin/slideshow.js +1 -1
  85. package/src/js/mixin/togglable.js +7 -2
  86. package/src/js/util/dom.js +3 -1
  87. package/src/js/util/filter.js +3 -1
  88. package/src/js/util/player.js +0 -4
  89. package/src/less/components/background.less +1 -9
  90. package/src/less/components/breadcrumb.less +6 -2
  91. package/src/less/components/button.less +1 -1
  92. package/src/less/components/form-range.less +52 -0
  93. package/src/less/components/form.less +1 -1
  94. package/src/less/components/lightbox.less +57 -89
  95. package/src/less/components/margin.less +14 -0
  96. package/src/less/components/search.less +49 -23
  97. package/src/less/components/sticky.less +1 -10
  98. package/src/less/components/totop.less +1 -1
  99. package/src/less/components/transition.less +4 -4
  100. package/src/less/components/visibility.less +3 -2
  101. package/src/less/theme/form-range.less +12 -0
  102. package/src/less/theme/lightbox.less +2 -20
  103. package/src/less/theme/search.less +24 -10
  104. package/src/scss/components/background.scss +1 -9
  105. package/src/scss/components/breadcrumb.scss +6 -2
  106. package/src/scss/components/button.scss +1 -1
  107. package/src/scss/components/form-range.scss +12 -0
  108. package/src/scss/components/form.scss +1 -1
  109. package/src/scss/components/lightbox.scss +50 -77
  110. package/src/scss/components/margin.scss +13 -0
  111. package/src/scss/components/search.scss +30 -12
  112. package/src/scss/components/sticky.scss +1 -10
  113. package/src/scss/components/totop.scss +1 -1
  114. package/src/scss/components/transition.scss +4 -4
  115. package/src/scss/components/visibility.scss +3 -2
  116. package/src/scss/mixins-theme.scss +51 -12
  117. package/src/scss/mixins.scss +45 -6
  118. package/src/scss/theme/form-range.scss +10 -0
  119. package/src/scss/theme/lightbox.scss +2 -20
  120. package/src/scss/theme/search.scss +10 -6
  121. package/src/scss/variables-theme.scss +32 -20
  122. package/src/scss/variables.scss +29 -24
  123. package/tests/badge.html +2 -2
  124. package/tests/base.html +1 -1
  125. package/tests/breadcrumb.html +23 -5
  126. package/tests/card.html +24 -24
  127. package/tests/dropbar.html +15 -15
  128. package/tests/dropdown.html +6 -6
  129. package/tests/dropnav.html +100 -100
  130. package/tests/icon.html +8 -0
  131. package/tests/index.html +15 -15
  132. package/tests/lightbox.html +379 -28
  133. package/tests/margin.html +19 -0
  134. package/tests/nav.html +21 -21
  135. package/tests/navbar.html +292 -292
  136. package/tests/offcanvas.html +27 -27
  137. package/tests/placeholder.html +2 -2
  138. package/tests/slider.html +0 -1
  139. package/tests/slideshow.html +1 -1
  140. package/tests/sortable.html +5 -5
  141. package/tests/sticky-navbar.html +114 -114
  142. package/tests/transition.html +2 -1
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.21.13 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.21.14-dev.2e8a07c7e | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -173,7 +173,7 @@
173
173
  }
174
174
  return dimensions;
175
175
  }
176
- const Dimensions = { ratio, contain, cover: cover$1 };
176
+ const Dimensions = { ratio, cover: cover$1 };
177
177
  function getIndex(i, elements, current = 0, finite = false) {
178
178
  elements = toNodes(elements);
179
179
  const { length } = elements;
@@ -350,7 +350,7 @@
350
350
  if (isSameSiteAnchor(el)) {
351
351
  const { hash, ownerDocument } = toNode(el);
352
352
  const id = decodeURIComponent(hash).slice(1);
353
- return ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0];
353
+ return id ? ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0] : ownerDocument;
354
354
  }
355
355
  }
356
356
 
@@ -746,7 +746,9 @@
746
746
  }
747
747
  function empty(element) {
748
748
  element = $(element);
749
- element.innerHTML = "";
749
+ if (element) {
750
+ element.innerHTML = "";
751
+ }
750
752
  return element;
751
753
  }
752
754
  function html(parent2, html2) {
@@ -1138,9 +1140,6 @@
1138
1140
  el.muted = true;
1139
1141
  }
1140
1142
  }
1141
- function isVideo(el) {
1142
- return isHTML5(el) || isIFrame(el);
1143
- }
1144
1143
  function isHTML5(el) {
1145
1144
  return isTag(el, "video");
1146
1145
  }
@@ -1606,7 +1605,6 @@
1606
1605
  isTag: isTag,
1607
1606
  isTouch: isTouch,
1608
1607
  isUndefined: isUndefined,
1609
- isVideo: isVideo,
1610
1608
  isVisible: isVisible,
1611
1609
  isVoidElement: isVoidElement,
1612
1610
  isWindow: isWindow,
@@ -1818,24 +1816,26 @@
1818
1816
  registerEvent(instance, event);
1819
1817
  } else {
1820
1818
  for (const key in event) {
1821
- registerEvent(instance, event[key], key);
1819
+ registerEvent(instance, { name: key, handler: event[key] });
1822
1820
  }
1823
1821
  }
1824
1822
  }
1825
1823
  }
1826
- function registerEvent(instance, event, key) {
1827
- let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event) ? event : { name: key, handler: event };
1828
- el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;
1829
- if (!el || isArray(el) && !el.length || filter && !filter.call(instance, instance)) {
1824
+ function registerEvent(instance, { name, el, handler, capture, passive, delegate, filter, self }) {
1825
+ if (filter && !filter.call(instance, instance)) {
1830
1826
  return;
1831
1827
  }
1832
1828
  instance._disconnect.push(
1833
1829
  on(
1834
- el,
1830
+ el ? el.call(instance, instance) : instance.$el,
1835
1831
  name,
1836
- delegate ? isString(delegate) ? delegate : delegate.call(instance, instance) : null,
1837
- isString(handler) ? instance[handler] : handler.bind(instance),
1838
- { passive, capture, self }
1832
+ delegate == null ? void 0 : delegate.call(instance, instance),
1833
+ handler.bind(instance),
1834
+ {
1835
+ passive,
1836
+ capture,
1837
+ self
1838
+ }
1839
1839
  )
1840
1840
  );
1841
1841
  }
@@ -2152,7 +2152,7 @@
2152
2152
  };
2153
2153
  App.util = util;
2154
2154
  App.options = {};
2155
- App.version = "3.21.13";
2155
+ App.version = "3.21.14-dev.2e8a07c7e";
2156
2156
 
2157
2157
  const PREFIX = "uk-";
2158
2158
  const DATA = "__uikit__";
@@ -2231,32 +2231,29 @@
2231
2231
  if (document.body) {
2232
2232
  apply(document.body, connect);
2233
2233
  }
2234
- new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(document, {
2235
- subtree: true,
2236
- childList: true
2237
- });
2238
- new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(document, {
2234
+ new MutationObserver(handleMutation).observe(document, {
2239
2235
  subtree: true,
2236
+ childList: true,
2240
2237
  attributes: true
2241
2238
  });
2242
2239
  App._initialized = true;
2243
2240
  }
2244
- function applyChildListMutation({ addedNodes, removedNodes }) {
2245
- for (const node of addedNodes) {
2246
- apply(node, connect);
2247
- }
2248
- for (const node of removedNodes) {
2249
- apply(node, disconnect);
2250
- }
2251
- }
2252
- function applyAttributeMutation({ target, attributeName }) {
2241
+ function handleMutation(records) {
2253
2242
  var _a;
2254
- const name = getComponentName(attributeName);
2255
- if (name) {
2256
- if (hasAttr(target, attributeName)) {
2257
- createComponent(name, target);
2258
- } else {
2259
- (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
2243
+ for (const { addedNodes, removedNodes, target, attributeName } of records) {
2244
+ for (const node of addedNodes) {
2245
+ apply(node, connect);
2246
+ }
2247
+ for (const node of removedNodes) {
2248
+ apply(node, disconnect);
2249
+ }
2250
+ const name = attributeName && getComponentName(attributeName);
2251
+ if (name) {
2252
+ if (hasAttr(target, attributeName)) {
2253
+ createComponent(name, target);
2254
+ } else {
2255
+ (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
2256
+ }
2260
2257
  }
2261
2258
  }
2262
2259
  }
@@ -2343,7 +2340,7 @@
2343
2340
  const instance = this;
2344
2341
  attachToElement(el, instance);
2345
2342
  instance.$options.el = el;
2346
- if (document.contains(el)) {
2343
+ if (el.isConnected) {
2347
2344
  callConnected(instance);
2348
2345
  }
2349
2346
  };
@@ -2477,6 +2474,82 @@
2477
2474
  }
2478
2475
  };
2479
2476
 
2477
+ var Position = {
2478
+ props: {
2479
+ pos: String,
2480
+ offset: Boolean,
2481
+ flip: Boolean,
2482
+ shift: Boolean,
2483
+ inset: Boolean
2484
+ },
2485
+ data: {
2486
+ pos: `bottom-${isRtl ? "right" : "left"}`,
2487
+ offset: false,
2488
+ flip: true,
2489
+ shift: true,
2490
+ inset: false
2491
+ },
2492
+ connected() {
2493
+ this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
2494
+ [this.dir, this.align] = this.pos;
2495
+ this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
2496
+ },
2497
+ methods: {
2498
+ positionAt(element, target, boundary) {
2499
+ let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
2500
+ const placement = [this.flip && "flip", this.shift && "shift"];
2501
+ const attach = {
2502
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
2503
+ target: [this.dir, this.align]
2504
+ };
2505
+ if (this.axis === "y") {
2506
+ for (const prop in attach) {
2507
+ attach[prop].reverse();
2508
+ }
2509
+ offset.reverse();
2510
+ placement.reverse();
2511
+ }
2512
+ const restoreScrollPosition = storeScrollPosition(element);
2513
+ const elDim = dimensions(element);
2514
+ css(element, { top: -elDim.height, left: -elDim.width });
2515
+ positionAt(element, target, {
2516
+ attach,
2517
+ offset,
2518
+ boundary,
2519
+ placement,
2520
+ viewportOffset: this.getViewportOffset(element)
2521
+ });
2522
+ restoreScrollPosition();
2523
+ },
2524
+ getPositionOffset(element = this.$el) {
2525
+ return toPx(
2526
+ this.offset === false ? css(element, "--uk-position-offset") : this.offset,
2527
+ this.axis === "x" ? "width" : "height",
2528
+ element
2529
+ ) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
2530
+ },
2531
+ getShiftOffset(element = this.$el) {
2532
+ return this.align === "center" ? 0 : toPx(
2533
+ css(element, "--uk-position-shift-offset"),
2534
+ this.axis === "y" ? "width" : "height",
2535
+ element
2536
+ ) * (includes(["left", "top"], this.align) ? 1 : -1);
2537
+ },
2538
+ getViewportOffset(element) {
2539
+ return toPx(css(element, "--uk-position-viewport-offset"));
2540
+ }
2541
+ }
2542
+ };
2543
+ function storeScrollPosition(element) {
2544
+ const scrollElement = scrollParent(element);
2545
+ const { scrollTop } = scrollElement;
2546
+ return () => {
2547
+ if (scrollTop !== scrollElement.scrollTop) {
2548
+ scrollElement.scrollTop = scrollTop;
2549
+ }
2550
+ };
2551
+ }
2552
+
2480
2553
  var Togglable = {
2481
2554
  props: {
2482
2555
  cls: Boolean,
@@ -2514,8 +2587,14 @@
2514
2587
  addClass(el, cls);
2515
2588
  trigger(el, show ? "show" : "hide", [this]);
2516
2589
  const done = () => {
2590
+ var _a;
2517
2591
  removeClass(el, cls);
2518
2592
  trigger(el, show ? "shown" : "hidden", [this]);
2593
+ if (show) {
2594
+ const restoreScrollPosition = storeScrollPosition(el);
2595
+ (_a = $$("[autofocus]", el).find(isVisible)) == null ? void 0 : _a.focus();
2596
+ restoreScrollPosition();
2597
+ }
2519
2598
  };
2520
2599
  return promise ? promise.then(done, () => {
2521
2600
  removeClass(el, cls);
@@ -2548,7 +2627,6 @@
2548
2627
  if (changed) {
2549
2628
  trigger(el, "toggled", [toggled, this]);
2550
2629
  }
2551
- $$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
2552
2630
  }
2553
2631
  }
2554
2632
  };
@@ -2941,7 +3019,7 @@
2941
3019
  ],
2942
3020
  observe: [
2943
3021
  intersection({
2944
- filter: ({ $el, autoplay }) => autoplay !== "hover" && isVideo($el),
3022
+ filter: ({ autoplay }) => autoplay !== "hover",
2945
3023
  handler([{ isIntersecting }]) {
2946
3024
  if (!document.fullscreenElement) {
2947
3025
  if (isIntersecting) {
@@ -2954,7 +3032,9 @@
2954
3032
  }
2955
3033
  },
2956
3034
  args: { intersecting: false },
2957
- options: ({ $el, autoplay }) => ({ root: autoplay === "inview" ? null : parent($el) })
3035
+ options: ({ $el, autoplay }) => ({
3036
+ root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
3037
+ })
2958
3038
  })
2959
3039
  ]
2960
3040
  };
@@ -3034,82 +3114,6 @@
3034
3114
  }
3035
3115
  };
3036
3116
 
3037
- var Position = {
3038
- props: {
3039
- pos: String,
3040
- offset: Boolean,
3041
- flip: Boolean,
3042
- shift: Boolean,
3043
- inset: Boolean
3044
- },
3045
- data: {
3046
- pos: `bottom-${isRtl ? "right" : "left"}`,
3047
- offset: false,
3048
- flip: true,
3049
- shift: true,
3050
- inset: false
3051
- },
3052
- connected() {
3053
- this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
3054
- [this.dir, this.align] = this.pos;
3055
- this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
3056
- },
3057
- methods: {
3058
- positionAt(element, target, boundary) {
3059
- let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3060
- const placement = [this.flip && "flip", this.shift && "shift"];
3061
- const attach = {
3062
- element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3063
- target: [this.dir, this.align]
3064
- };
3065
- if (this.axis === "y") {
3066
- for (const prop in attach) {
3067
- attach[prop].reverse();
3068
- }
3069
- offset.reverse();
3070
- placement.reverse();
3071
- }
3072
- const restoreScrollPosition = storeScrollPosition(element);
3073
- const elDim = dimensions(element);
3074
- css(element, { top: -elDim.height, left: -elDim.width });
3075
- positionAt(element, target, {
3076
- attach,
3077
- offset,
3078
- boundary,
3079
- placement,
3080
- viewportOffset: this.getViewportOffset(element)
3081
- });
3082
- restoreScrollPosition();
3083
- },
3084
- getPositionOffset(element = this.$el) {
3085
- return toPx(
3086
- this.offset === false ? css(element, "--uk-position-offset") : this.offset,
3087
- this.axis === "x" ? "width" : "height",
3088
- element
3089
- ) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
3090
- },
3091
- getShiftOffset(element = this.$el) {
3092
- return this.align === "center" ? 0 : toPx(
3093
- css(element, "--uk-position-shift-offset"),
3094
- this.axis === "y" ? "width" : "height",
3095
- element
3096
- ) * (includes(["left", "top"], this.align) ? 1 : -1);
3097
- },
3098
- getViewportOffset(element) {
3099
- return toPx(css(element, "--uk-position-viewport-offset"));
3100
- }
3101
- }
3102
- };
3103
- function storeScrollPosition(element) {
3104
- const scrollElement = scrollParent(element);
3105
- const { scrollTop } = scrollElement;
3106
- return () => {
3107
- if (scrollTop !== scrollElement.scrollTop) {
3108
- scrollElement.scrollTop = scrollTop;
3109
- }
3110
- };
3111
- }
3112
-
3113
3117
  let prevented;
3114
3118
  function preventBackgroundScroll(el) {
3115
3119
  const off = on(
@@ -3349,7 +3353,9 @@
3349
3353
  {
3350
3354
  name: "beforehide",
3351
3355
  self: true,
3352
- handler: "clearTimers"
3356
+ handler() {
3357
+ this.clearTimers();
3358
+ }
3353
3359
  },
3354
3360
  {
3355
3361
  name: "hide",
@@ -4090,7 +4096,7 @@
4090
4096
  let rowHeights = 0;
4091
4097
  for (let row of rows) {
4092
4098
  if (isRtl) {
4093
- row = row.reverse();
4099
+ row.reverse();
4094
4100
  }
4095
4101
  let height = 0;
4096
4102
  for (const j in row) {
@@ -4404,116 +4410,6 @@
4404
4410
  dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
4405
4411
  }
4406
4412
 
4407
- function getMaxPathLength(el) {
4408
- return isVisible(el) ? Math.ceil(
4409
- Math.max(0, ...$$("[stroke]", el).map((stroke) => {
4410
- var _a;
4411
- return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
4412
- }))
4413
- ) : 0;
4414
- }
4415
-
4416
- var svg = {
4417
- mixins: [Svg],
4418
- args: "src",
4419
- props: {
4420
- src: String,
4421
- icon: String,
4422
- attributes: "list",
4423
- strokeAnimation: Boolean
4424
- },
4425
- data: {
4426
- strokeAnimation: false
4427
- },
4428
- observe: [
4429
- mutation({
4430
- async handler() {
4431
- const svg = await this.svg;
4432
- if (svg) {
4433
- applyAttributes.call(this, svg);
4434
- }
4435
- },
4436
- options: {
4437
- attributes: true,
4438
- attributeFilter: ["id", "class", "style"]
4439
- }
4440
- })
4441
- ],
4442
- async connected() {
4443
- if (includes(this.src, "#")) {
4444
- [this.src, this.icon] = this.src.split("#");
4445
- }
4446
- const svg = await this.svg;
4447
- if (svg) {
4448
- applyAttributes.call(this, svg);
4449
- if (this.strokeAnimation) {
4450
- applyAnimation(svg);
4451
- }
4452
- }
4453
- },
4454
- methods: {
4455
- async getSvg() {
4456
- if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
4457
- await new Promise((resolve) => once(this.$el, "load", resolve));
4458
- }
4459
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
4460
- }
4461
- }
4462
- };
4463
- function applyAttributes(el) {
4464
- const { $el } = this;
4465
- addClass(el, attr($el, "class"), "uk-svg");
4466
- for (let i = 0; i < $el.style.length; i++) {
4467
- const prop = $el.style[i];
4468
- css(el, prop, css($el, prop));
4469
- }
4470
- for (const attribute in this.attributes) {
4471
- const [prop, value] = this.attributes[attribute].split(":", 2);
4472
- attr(el, prop, value);
4473
- }
4474
- if (!this.$el.id) {
4475
- removeAttr(el, "id");
4476
- }
4477
- }
4478
- const loadSVG = memoize(async (src) => {
4479
- if (src) {
4480
- if (startsWith(src, "data:")) {
4481
- return decodeURIComponent(src.split(",")[1]);
4482
- } else {
4483
- return (await fetch(src)).text();
4484
- }
4485
- } else {
4486
- return Promise.reject();
4487
- }
4488
- });
4489
- function parseSVG(svg, icon) {
4490
- if (icon && includes(svg, "<symbol")) {
4491
- svg = parseSymbols(svg)[icon] || svg;
4492
- }
4493
- return stringToSvg(svg);
4494
- }
4495
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
4496
- const parseSymbols = memoize(function(svg) {
4497
- const symbols = {};
4498
- symbolRe.lastIndex = 0;
4499
- let match;
4500
- while (match = symbolRe.exec(svg)) {
4501
- symbols[match[3]] = `<svg ${match[1]}svg>`;
4502
- }
4503
- return symbols;
4504
- });
4505
- function applyAnimation(el) {
4506
- const length = getMaxPathLength(el);
4507
- if (length) {
4508
- css(el, "--uk-animation-stroke", length);
4509
- }
4510
- }
4511
- function stringToSvg(string) {
4512
- const container = document.createElement("template");
4513
- container.innerHTML = string;
4514
- return container.content.firstElementChild;
4515
- }
4516
-
4517
4413
  const icons = {
4518
4414
  spinner,
4519
4415
  totop,
@@ -4684,7 +4580,7 @@
4684
4580
  return null;
4685
4581
  }
4686
4582
  if (!parsed[icon]) {
4687
- parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);
4583
+ parsed[icon] = fragment(icons[applyRtl(icon)] || icons[icon]);
4688
4584
  }
4689
4585
  return parsed[icon].cloneNode(true);
4690
4586
  }
@@ -4761,7 +4657,7 @@
4761
4657
  for (const prop of srcProps) {
4762
4658
  const value = data(sourceEl, prop);
4763
4659
  if (value) {
4764
- attr(targetEl, prop.replace(/^(data-)+/, ""), value);
4660
+ attr(targetEl, prop.replace(/data-/g, ""), value);
4765
4661
  }
4766
4662
  }
4767
4663
  }
@@ -4769,9 +4665,7 @@
4769
4665
  const img = new Image();
4770
4666
  wrapInPicture(img, sources);
4771
4667
  setSourceProps(el, img);
4772
- img.onload = () => {
4773
- setSrcAttrs(el, img.currentSrc);
4774
- };
4668
+ img.onload = () => setSrcAttrs(el, img.currentSrc);
4775
4669
  attr(img, "src", src);
4776
4670
  return img;
4777
4671
  }
@@ -5025,9 +4919,6 @@
5025
4919
  panel: ({ selPanel }, $el) => $(selPanel, $el),
5026
4920
  transitionElement() {
5027
4921
  return this.panel;
5028
- },
5029
- bgClose({ bgClose }) {
5030
- return bgClose && this.panel;
5031
4922
  }
5032
4923
  },
5033
4924
  connected() {
@@ -5190,7 +5081,7 @@
5190
5081
  }
5191
5082
  function listenForBackgroundClose(modal) {
5192
5083
  return on(document, pointerDown, ({ target }) => {
5193
- if (last(active) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {
5084
+ if (last(active) !== modal || modal.overlay && !modal.$el.contains(target) || !modal.panel || modal.panel.contains(target)) {
5194
5085
  return;
5195
5086
  }
5196
5087
  once(
@@ -5373,7 +5264,10 @@
5373
5264
  {
5374
5265
  name: "hide",
5375
5266
  el: ({ dropContainer }) => dropContainer,
5376
- async handler() {
5267
+ async handler(e) {
5268
+ if (parent(e.target) !== this.dropContainer) {
5269
+ return;
5270
+ }
5377
5271
  await awaitMacroTask();
5378
5272
  if (!this.getActive() && this._transparent) {
5379
5273
  addClass(this.navbarContainer, clsNavbarTransparent);
@@ -5762,7 +5656,7 @@
5762
5656
  update: [
5763
5657
  {
5764
5658
  read() {
5765
- const targets = this.links.map((el) => getTargetedElement(el) || el.ownerDocument);
5659
+ const targets = this.links.map((el) => getTargetedElement(el)).filter(Boolean);
5766
5660
  const { length } = targets;
5767
5661
  if (!length || !isVisible(this.$el)) {
5768
5662
  return false;
@@ -6161,6 +6055,113 @@
6161
6055
  }
6162
6056
  }
6163
6057
 
6058
+ function getMaxPathLength(el) {
6059
+ return isVisible(el) ? Math.ceil(
6060
+ Math.max(0, ...$$("[stroke]", el).map((stroke) => {
6061
+ var _a;
6062
+ return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
6063
+ }))
6064
+ ) : 0;
6065
+ }
6066
+
6067
+ var svg = {
6068
+ mixins: [Svg],
6069
+ args: "src",
6070
+ props: {
6071
+ src: String,
6072
+ icon: String,
6073
+ attributes: "list",
6074
+ strokeAnimation: Boolean
6075
+ },
6076
+ data: {
6077
+ strokeAnimation: false
6078
+ },
6079
+ observe: [
6080
+ mutation({
6081
+ async handler() {
6082
+ const svg = await this.svg;
6083
+ if (svg) {
6084
+ applyAttributes.call(this, svg);
6085
+ }
6086
+ },
6087
+ options: {
6088
+ attributes: true,
6089
+ attributeFilter: ["id", "class", "style"]
6090
+ }
6091
+ })
6092
+ ],
6093
+ async connected() {
6094
+ if (includes(this.src, "#")) {
6095
+ [this.src, this.icon] = this.src.split("#");
6096
+ }
6097
+ const svg = await this.svg;
6098
+ if (svg) {
6099
+ applyAttributes.call(this, svg);
6100
+ if (this.strokeAnimation) {
6101
+ applyAnimation(svg);
6102
+ }
6103
+ }
6104
+ },
6105
+ methods: {
6106
+ async getSvg() {
6107
+ if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
6108
+ await new Promise((resolve) => once(this.$el, "load", resolve));
6109
+ }
6110
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
6111
+ }
6112
+ }
6113
+ };
6114
+ function applyAttributes(el) {
6115
+ const { $el } = this;
6116
+ addClass(el, attr($el, "class"), "uk-svg");
6117
+ for (let i = 0; i < $el.style.length; i++) {
6118
+ const prop = $el.style[i];
6119
+ css(el, prop, css($el, prop));
6120
+ }
6121
+ for (const attribute in this.attributes) {
6122
+ const [prop, value] = this.attributes[attribute].split(":", 2);
6123
+ attr(el, prop, value);
6124
+ }
6125
+ if (!this.$el.id) {
6126
+ removeAttr(el, "id");
6127
+ }
6128
+ }
6129
+ const loadSVG = memoize(async (src) => {
6130
+ if (src) {
6131
+ if (startsWith(src, "data:")) {
6132
+ return decodeURIComponent(src.split(",")[1]);
6133
+ } else {
6134
+ const response = await fetch(src);
6135
+ if (response.headers.get("Content-Type") === "image/svg+xml") {
6136
+ return response.text();
6137
+ }
6138
+ }
6139
+ }
6140
+ return Promise.reject();
6141
+ });
6142
+ function parseSVG(svg, icon) {
6143
+ if (icon && includes(svg, "<symbol")) {
6144
+ svg = parseSymbols(svg)[icon] || svg;
6145
+ }
6146
+ return fragment(svg);
6147
+ }
6148
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
6149
+ const parseSymbols = memoize(function(svg) {
6150
+ const symbols = {};
6151
+ symbolRe.lastIndex = 0;
6152
+ let match;
6153
+ while (match = symbolRe.exec(svg)) {
6154
+ symbols[match[3]] = `<svg ${match[1]}svg>`;
6155
+ }
6156
+ return symbols;
6157
+ });
6158
+ function applyAnimation(el) {
6159
+ const length = getMaxPathLength(el);
6160
+ if (length) {
6161
+ css(el, "--uk-animation-stroke", length);
6162
+ }
6163
+ }
6164
+
6164
6165
  const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
6165
6166
  var Switcher = {
6166
6167
  mixins: [Togglable],