uikit 3.21.14-dev.60ed95dfb → 3.21.14-dev.8b3dfa6cd
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.
- package/CHANGELOG.md +35 -0
- package/dist/css/uikit-core-rtl.css +233 -85
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +233 -85
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +237 -81
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +237 -81
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +2 -11
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +425 -126
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +442 -131
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +2 -2
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +2 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +17 -27
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +2 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +22 -33
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +9 -13
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +212 -212
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +20 -17
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +631 -521
- package/dist/js/uikit.min.js +1 -1
- package/package.json +2 -2
- package/src/images/icons/arrow-down-arrow-up.svg +6 -0
- package/src/images/icons/arrow-down.svg +3 -3
- package/src/images/icons/arrow-left.svg +3 -3
- package/src/images/icons/arrow-right.svg +3 -3
- package/src/images/icons/arrow-up-right.svg +3 -3
- package/src/images/icons/arrow-up.svg +3 -3
- package/src/images/icons/close-circle.svg +5 -0
- package/src/images/icons/cloud-download.svg +4 -4
- package/src/images/icons/cloud-upload.svg +4 -4
- package/src/images/icons/download.svg +4 -4
- package/src/images/icons/expand.svg +5 -5
- package/src/images/icons/link-external.svg +4 -4
- package/src/images/icons/pull.svg +4 -4
- package/src/images/icons/push.svg +3 -3
- package/src/images/icons/shrink.svg +5 -5
- package/src/images/icons/sign-in.svg +4 -3
- package/src/images/icons/sign-out.svg +4 -3
- package/src/images/icons/sorting.svg +6 -0
- package/src/images/icons/upload.svg +4 -4
- package/src/js/api/instance.js +1 -1
- package/src/js/components/internal/lightbox-animations.js +2 -1
- package/src/js/components/internal/slideshow-animations.js +5 -5
- package/src/js/components/lightbox-panel.js +180 -45
- package/src/js/components/lightbox.js +59 -6
- package/src/js/components/slideshow.js +1 -2
- package/src/js/components/tooltip.js +1 -1
- package/src/js/core/grid.js +1 -1
- package/src/js/core/icon.js +2 -2
- package/src/js/core/img.js +3 -5
- package/src/js/core/navbar.js +6 -2
- package/src/js/core/scrollspy-nav.js +1 -1
- package/src/js/core/svg.js +8 -10
- package/src/js/core/toggle.js +1 -1
- package/src/js/core/video.js +4 -3
- package/src/js/mixin/internal/slideshow-animations.js +1 -6
- package/src/js/mixin/modal.js +1 -4
- package/src/js/mixin/slider-drag.js +5 -6
- package/src/js/mixin/slider-nav.js +1 -1
- package/src/js/mixin/slider.js +11 -13
- package/src/js/mixin/slideshow.js +1 -1
- package/src/js/mixin/togglable.js +7 -2
- package/src/js/util/dom.js +3 -1
- package/src/js/util/filter.js +3 -1
- package/src/js/util/player.js +0 -4
- package/src/less/components/background.less +1 -9
- package/src/less/components/breadcrumb.less +6 -2
- package/src/less/components/button.less +1 -1
- package/src/less/components/form-range.less +52 -0
- package/src/less/components/form.less +1 -1
- package/src/less/components/lightbox.less +57 -89
- package/src/less/components/margin.less +14 -0
- package/src/less/components/search.less +49 -23
- package/src/less/components/sticky.less +1 -10
- package/src/less/components/totop.less +1 -1
- package/src/less/components/transition.less +4 -4
- package/src/less/components/visibility.less +3 -2
- package/src/less/theme/form-range.less +12 -0
- package/src/less/theme/lightbox.less +2 -20
- package/src/less/theme/search.less +24 -10
- package/src/scss/components/background.scss +1 -9
- package/src/scss/components/breadcrumb.scss +6 -2
- package/src/scss/components/button.scss +1 -1
- package/src/scss/components/form-range.scss +12 -0
- package/src/scss/components/form.scss +1 -1
- package/src/scss/components/lightbox.scss +50 -77
- package/src/scss/components/margin.scss +13 -0
- package/src/scss/components/search.scss +30 -12
- package/src/scss/components/sticky.scss +1 -10
- package/src/scss/components/totop.scss +1 -1
- package/src/scss/components/transition.scss +4 -4
- package/src/scss/components/visibility.scss +3 -2
- package/src/scss/mixins-theme.scss +51 -12
- package/src/scss/mixins.scss +45 -6
- package/src/scss/theme/form-range.scss +10 -0
- package/src/scss/theme/lightbox.scss +2 -20
- package/src/scss/theme/search.scss +10 -6
- package/src/scss/variables-theme.scss +32 -20
- package/src/scss/variables.scss +29 -24
- package/tests/badge.html +2 -2
- package/tests/base.html +1 -1
- package/tests/breadcrumb.html +23 -5
- package/tests/card.html +24 -24
- package/tests/dropbar.html +15 -15
- package/tests/dropdown.html +6 -6
- package/tests/dropnav.html +100 -100
- package/tests/icon.html +8 -0
- package/tests/index.html +15 -15
- package/tests/lightbox.html +379 -28
- package/tests/margin.html +19 -0
- package/tests/nav.html +21 -21
- package/tests/navbar.html +292 -292
- package/tests/offcanvas.html +27 -27
- package/tests/placeholder.html +2 -2
- package/tests/slider.html +0 -1
- package/tests/slideshow.html +1 -1
- package/tests/sortable.html +5 -5
- package/tests/sticky-navbar.html +114 -114
- package/tests/transition.html +2 -1
package/dist/js/uikit-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.21.14-dev.
|
|
1
|
+
/*! UIkit 3.21.14-dev.8b3dfa6cd | 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,
|
|
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
|
|
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,
|
|
@@ -2154,7 +2152,7 @@
|
|
|
2154
2152
|
};
|
|
2155
2153
|
App.util = util;
|
|
2156
2154
|
App.options = {};
|
|
2157
|
-
App.version = "3.21.14-dev.
|
|
2155
|
+
App.version = "3.21.14-dev.8b3dfa6cd";
|
|
2158
2156
|
|
|
2159
2157
|
const PREFIX = "uk-";
|
|
2160
2158
|
const DATA = "__uikit__";
|
|
@@ -2342,7 +2340,7 @@
|
|
|
2342
2340
|
const instance = this;
|
|
2343
2341
|
attachToElement(el, instance);
|
|
2344
2342
|
instance.$options.el = el;
|
|
2345
|
-
if (
|
|
2343
|
+
if (el.isConnected) {
|
|
2346
2344
|
callConnected(instance);
|
|
2347
2345
|
}
|
|
2348
2346
|
};
|
|
@@ -2476,6 +2474,82 @@
|
|
|
2476
2474
|
}
|
|
2477
2475
|
};
|
|
2478
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
|
+
|
|
2479
2553
|
var Togglable = {
|
|
2480
2554
|
props: {
|
|
2481
2555
|
cls: Boolean,
|
|
@@ -2513,8 +2587,14 @@
|
|
|
2513
2587
|
addClass(el, cls);
|
|
2514
2588
|
trigger(el, show ? "show" : "hide", [this]);
|
|
2515
2589
|
const done = () => {
|
|
2590
|
+
var _a;
|
|
2516
2591
|
removeClass(el, cls);
|
|
2517
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
|
+
}
|
|
2518
2598
|
};
|
|
2519
2599
|
return promise ? promise.then(done, () => {
|
|
2520
2600
|
removeClass(el, cls);
|
|
@@ -2547,7 +2627,6 @@
|
|
|
2547
2627
|
if (changed) {
|
|
2548
2628
|
trigger(el, "toggled", [toggled, this]);
|
|
2549
2629
|
}
|
|
2550
|
-
$$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
|
|
2551
2630
|
}
|
|
2552
2631
|
}
|
|
2553
2632
|
};
|
|
@@ -2940,7 +3019,7 @@
|
|
|
2940
3019
|
],
|
|
2941
3020
|
observe: [
|
|
2942
3021
|
intersection({
|
|
2943
|
-
filter: ({
|
|
3022
|
+
filter: ({ autoplay }) => autoplay !== "hover",
|
|
2944
3023
|
handler([{ isIntersecting }]) {
|
|
2945
3024
|
if (!document.fullscreenElement) {
|
|
2946
3025
|
if (isIntersecting) {
|
|
@@ -2953,7 +3032,9 @@
|
|
|
2953
3032
|
}
|
|
2954
3033
|
},
|
|
2955
3034
|
args: { intersecting: false },
|
|
2956
|
-
options: ({ $el, autoplay }) => ({
|
|
3035
|
+
options: ({ $el, autoplay }) => ({
|
|
3036
|
+
root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
|
|
3037
|
+
})
|
|
2957
3038
|
})
|
|
2958
3039
|
]
|
|
2959
3040
|
};
|
|
@@ -3033,82 +3114,6 @@
|
|
|
3033
3114
|
}
|
|
3034
3115
|
};
|
|
3035
3116
|
|
|
3036
|
-
var Position = {
|
|
3037
|
-
props: {
|
|
3038
|
-
pos: String,
|
|
3039
|
-
offset: Boolean,
|
|
3040
|
-
flip: Boolean,
|
|
3041
|
-
shift: Boolean,
|
|
3042
|
-
inset: Boolean
|
|
3043
|
-
},
|
|
3044
|
-
data: {
|
|
3045
|
-
pos: `bottom-${isRtl ? "right" : "left"}`,
|
|
3046
|
-
offset: false,
|
|
3047
|
-
flip: true,
|
|
3048
|
-
shift: true,
|
|
3049
|
-
inset: false
|
|
3050
|
-
},
|
|
3051
|
-
connected() {
|
|
3052
|
-
this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
|
|
3053
|
-
[this.dir, this.align] = this.pos;
|
|
3054
|
-
this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
|
|
3055
|
-
},
|
|
3056
|
-
methods: {
|
|
3057
|
-
positionAt(element, target, boundary) {
|
|
3058
|
-
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
3059
|
-
const placement = [this.flip && "flip", this.shift && "shift"];
|
|
3060
|
-
const attach = {
|
|
3061
|
-
element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
|
|
3062
|
-
target: [this.dir, this.align]
|
|
3063
|
-
};
|
|
3064
|
-
if (this.axis === "y") {
|
|
3065
|
-
for (const prop in attach) {
|
|
3066
|
-
attach[prop].reverse();
|
|
3067
|
-
}
|
|
3068
|
-
offset.reverse();
|
|
3069
|
-
placement.reverse();
|
|
3070
|
-
}
|
|
3071
|
-
const restoreScrollPosition = storeScrollPosition(element);
|
|
3072
|
-
const elDim = dimensions(element);
|
|
3073
|
-
css(element, { top: -elDim.height, left: -elDim.width });
|
|
3074
|
-
positionAt(element, target, {
|
|
3075
|
-
attach,
|
|
3076
|
-
offset,
|
|
3077
|
-
boundary,
|
|
3078
|
-
placement,
|
|
3079
|
-
viewportOffset: this.getViewportOffset(element)
|
|
3080
|
-
});
|
|
3081
|
-
restoreScrollPosition();
|
|
3082
|
-
},
|
|
3083
|
-
getPositionOffset(element = this.$el) {
|
|
3084
|
-
return toPx(
|
|
3085
|
-
this.offset === false ? css(element, "--uk-position-offset") : this.offset,
|
|
3086
|
-
this.axis === "x" ? "width" : "height",
|
|
3087
|
-
element
|
|
3088
|
-
) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
|
|
3089
|
-
},
|
|
3090
|
-
getShiftOffset(element = this.$el) {
|
|
3091
|
-
return this.align === "center" ? 0 : toPx(
|
|
3092
|
-
css(element, "--uk-position-shift-offset"),
|
|
3093
|
-
this.axis === "y" ? "width" : "height",
|
|
3094
|
-
element
|
|
3095
|
-
) * (includes(["left", "top"], this.align) ? 1 : -1);
|
|
3096
|
-
},
|
|
3097
|
-
getViewportOffset(element) {
|
|
3098
|
-
return toPx(css(element, "--uk-position-viewport-offset"));
|
|
3099
|
-
}
|
|
3100
|
-
}
|
|
3101
|
-
};
|
|
3102
|
-
function storeScrollPosition(element) {
|
|
3103
|
-
const scrollElement = scrollParent(element);
|
|
3104
|
-
const { scrollTop } = scrollElement;
|
|
3105
|
-
return () => {
|
|
3106
|
-
if (scrollTop !== scrollElement.scrollTop) {
|
|
3107
|
-
scrollElement.scrollTop = scrollTop;
|
|
3108
|
-
}
|
|
3109
|
-
};
|
|
3110
|
-
}
|
|
3111
|
-
|
|
3112
3117
|
let prevented;
|
|
3113
3118
|
function preventBackgroundScroll(el) {
|
|
3114
3119
|
const off = on(
|
|
@@ -4091,7 +4096,7 @@
|
|
|
4091
4096
|
let rowHeights = 0;
|
|
4092
4097
|
for (let row of rows) {
|
|
4093
4098
|
if (isRtl) {
|
|
4094
|
-
row
|
|
4099
|
+
row.reverse();
|
|
4095
4100
|
}
|
|
4096
4101
|
let height = 0;
|
|
4097
4102
|
for (const j in row) {
|
|
@@ -4405,116 +4410,6 @@
|
|
|
4405
4410
|
dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
|
|
4406
4411
|
}
|
|
4407
4412
|
|
|
4408
|
-
function getMaxPathLength(el) {
|
|
4409
|
-
return isVisible(el) ? Math.ceil(
|
|
4410
|
-
Math.max(0, ...$$("[stroke]", el).map((stroke) => {
|
|
4411
|
-
var _a;
|
|
4412
|
-
return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
|
|
4413
|
-
}))
|
|
4414
|
-
) : 0;
|
|
4415
|
-
}
|
|
4416
|
-
|
|
4417
|
-
var svg = {
|
|
4418
|
-
mixins: [Svg],
|
|
4419
|
-
args: "src",
|
|
4420
|
-
props: {
|
|
4421
|
-
src: String,
|
|
4422
|
-
icon: String,
|
|
4423
|
-
attributes: "list",
|
|
4424
|
-
strokeAnimation: Boolean
|
|
4425
|
-
},
|
|
4426
|
-
data: {
|
|
4427
|
-
strokeAnimation: false
|
|
4428
|
-
},
|
|
4429
|
-
observe: [
|
|
4430
|
-
mutation({
|
|
4431
|
-
async handler() {
|
|
4432
|
-
const svg = await this.svg;
|
|
4433
|
-
if (svg) {
|
|
4434
|
-
applyAttributes.call(this, svg);
|
|
4435
|
-
}
|
|
4436
|
-
},
|
|
4437
|
-
options: {
|
|
4438
|
-
attributes: true,
|
|
4439
|
-
attributeFilter: ["id", "class", "style"]
|
|
4440
|
-
}
|
|
4441
|
-
})
|
|
4442
|
-
],
|
|
4443
|
-
async connected() {
|
|
4444
|
-
if (includes(this.src, "#")) {
|
|
4445
|
-
[this.src, this.icon] = this.src.split("#");
|
|
4446
|
-
}
|
|
4447
|
-
const svg = await this.svg;
|
|
4448
|
-
if (svg) {
|
|
4449
|
-
applyAttributes.call(this, svg);
|
|
4450
|
-
if (this.strokeAnimation) {
|
|
4451
|
-
applyAnimation(svg);
|
|
4452
|
-
}
|
|
4453
|
-
}
|
|
4454
|
-
},
|
|
4455
|
-
methods: {
|
|
4456
|
-
async getSvg() {
|
|
4457
|
-
if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
|
|
4458
|
-
await new Promise((resolve) => once(this.$el, "load", resolve));
|
|
4459
|
-
}
|
|
4460
|
-
return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
|
|
4461
|
-
}
|
|
4462
|
-
}
|
|
4463
|
-
};
|
|
4464
|
-
function applyAttributes(el) {
|
|
4465
|
-
const { $el } = this;
|
|
4466
|
-
addClass(el, attr($el, "class"), "uk-svg");
|
|
4467
|
-
for (let i = 0; i < $el.style.length; i++) {
|
|
4468
|
-
const prop = $el.style[i];
|
|
4469
|
-
css(el, prop, css($el, prop));
|
|
4470
|
-
}
|
|
4471
|
-
for (const attribute in this.attributes) {
|
|
4472
|
-
const [prop, value] = this.attributes[attribute].split(":", 2);
|
|
4473
|
-
attr(el, prop, value);
|
|
4474
|
-
}
|
|
4475
|
-
if (!this.$el.id) {
|
|
4476
|
-
removeAttr(el, "id");
|
|
4477
|
-
}
|
|
4478
|
-
}
|
|
4479
|
-
const loadSVG = memoize(async (src) => {
|
|
4480
|
-
if (src) {
|
|
4481
|
-
if (startsWith(src, "data:")) {
|
|
4482
|
-
return decodeURIComponent(src.split(",")[1]);
|
|
4483
|
-
} else {
|
|
4484
|
-
return (await fetch(src)).text();
|
|
4485
|
-
}
|
|
4486
|
-
} else {
|
|
4487
|
-
return Promise.reject();
|
|
4488
|
-
}
|
|
4489
|
-
});
|
|
4490
|
-
function parseSVG(svg, icon) {
|
|
4491
|
-
if (icon && includes(svg, "<symbol")) {
|
|
4492
|
-
svg = parseSymbols(svg)[icon] || svg;
|
|
4493
|
-
}
|
|
4494
|
-
return stringToSvg(svg);
|
|
4495
|
-
}
|
|
4496
|
-
const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
|
|
4497
|
-
const parseSymbols = memoize(function(svg) {
|
|
4498
|
-
const symbols = {};
|
|
4499
|
-
symbolRe.lastIndex = 0;
|
|
4500
|
-
let match;
|
|
4501
|
-
while (match = symbolRe.exec(svg)) {
|
|
4502
|
-
symbols[match[3]] = `<svg ${match[1]}svg>`;
|
|
4503
|
-
}
|
|
4504
|
-
return symbols;
|
|
4505
|
-
});
|
|
4506
|
-
function applyAnimation(el) {
|
|
4507
|
-
const length = getMaxPathLength(el);
|
|
4508
|
-
if (length) {
|
|
4509
|
-
css(el, "--uk-animation-stroke", length);
|
|
4510
|
-
}
|
|
4511
|
-
}
|
|
4512
|
-
function stringToSvg(string) {
|
|
4513
|
-
const container = document.createElement("template");
|
|
4514
|
-
container.innerHTML = string;
|
|
4515
|
-
return container.content.firstElementChild;
|
|
4516
|
-
}
|
|
4517
|
-
|
|
4518
4413
|
const icons = {
|
|
4519
4414
|
spinner,
|
|
4520
4415
|
totop,
|
|
@@ -4685,7 +4580,7 @@
|
|
|
4685
4580
|
return null;
|
|
4686
4581
|
}
|
|
4687
4582
|
if (!parsed[icon]) {
|
|
4688
|
-
parsed[icon] =
|
|
4583
|
+
parsed[icon] = fragment(icons[applyRtl(icon)] || icons[icon]);
|
|
4689
4584
|
}
|
|
4690
4585
|
return parsed[icon].cloneNode(true);
|
|
4691
4586
|
}
|
|
@@ -4762,7 +4657,7 @@
|
|
|
4762
4657
|
for (const prop of srcProps) {
|
|
4763
4658
|
const value = data(sourceEl, prop);
|
|
4764
4659
|
if (value) {
|
|
4765
|
-
attr(targetEl, prop.replace(
|
|
4660
|
+
attr(targetEl, prop.replace(/data-/g, ""), value);
|
|
4766
4661
|
}
|
|
4767
4662
|
}
|
|
4768
4663
|
}
|
|
@@ -4770,9 +4665,7 @@
|
|
|
4770
4665
|
const img = new Image();
|
|
4771
4666
|
wrapInPicture(img, sources);
|
|
4772
4667
|
setSourceProps(el, img);
|
|
4773
|
-
img.onload = () =>
|
|
4774
|
-
setSrcAttrs(el, img.currentSrc);
|
|
4775
|
-
};
|
|
4668
|
+
img.onload = () => setSrcAttrs(el, img.currentSrc);
|
|
4776
4669
|
attr(img, "src", src);
|
|
4777
4670
|
return img;
|
|
4778
4671
|
}
|
|
@@ -5026,9 +4919,6 @@
|
|
|
5026
4919
|
panel: ({ selPanel }, $el) => $(selPanel, $el),
|
|
5027
4920
|
transitionElement() {
|
|
5028
4921
|
return this.panel;
|
|
5029
|
-
},
|
|
5030
|
-
bgClose({ bgClose }) {
|
|
5031
|
-
return bgClose && this.panel;
|
|
5032
4922
|
}
|
|
5033
4923
|
},
|
|
5034
4924
|
connected() {
|
|
@@ -5191,7 +5081,7 @@
|
|
|
5191
5081
|
}
|
|
5192
5082
|
function listenForBackgroundClose(modal) {
|
|
5193
5083
|
return on(document, pointerDown, ({ target }) => {
|
|
5194
|
-
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)) {
|
|
5195
5085
|
return;
|
|
5196
5086
|
}
|
|
5197
5087
|
once(
|
|
@@ -5374,7 +5264,10 @@
|
|
|
5374
5264
|
{
|
|
5375
5265
|
name: "hide",
|
|
5376
5266
|
el: ({ dropContainer }) => dropContainer,
|
|
5377
|
-
async handler() {
|
|
5267
|
+
async handler(e) {
|
|
5268
|
+
if (parent(e.target) !== this.dropContainer) {
|
|
5269
|
+
return;
|
|
5270
|
+
}
|
|
5378
5271
|
await awaitMacroTask();
|
|
5379
5272
|
if (!this.getActive() && this._transparent) {
|
|
5380
5273
|
addClass(this.navbarContainer, clsNavbarTransparent);
|
|
@@ -5763,7 +5656,7 @@
|
|
|
5763
5656
|
update: [
|
|
5764
5657
|
{
|
|
5765
5658
|
read() {
|
|
5766
|
-
const targets = this.links.map((el) => getTargetedElement(el)
|
|
5659
|
+
const targets = this.links.map((el) => getTargetedElement(el)).filter(Boolean);
|
|
5767
5660
|
const { length } = targets;
|
|
5768
5661
|
if (!length || !isVisible(this.$el)) {
|
|
5769
5662
|
return false;
|
|
@@ -6162,6 +6055,113 @@
|
|
|
6162
6055
|
}
|
|
6163
6056
|
}
|
|
6164
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
|
+
|
|
6165
6165
|
const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
6166
6166
|
var Switcher = {
|
|
6167
6167
|
mixins: [Togglable],
|
|
@@ -6414,7 +6414,7 @@
|
|
|
6414
6414
|
name: `mouseenter mouseleave ${pointerEnter} ${pointerLeave} focus blur`,
|
|
6415
6415
|
filter: ({ mode }) => includes(mode, "hover"),
|
|
6416
6416
|
handler(e) {
|
|
6417
|
-
if (isTouch(e) || this.$el.disabled) {
|
|
6417
|
+
if (isTouch(e) || this.$el.disabled || document.readyState === "loading") {
|
|
6418
6418
|
return;
|
|
6419
6419
|
}
|
|
6420
6420
|
const show = includes(["mouseenter", pointerEnter, "focus"], e.type);
|