uikit 3.21.14-dev.028df7be8 → 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.
- package/CHANGELOG.md +34 -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 +3 -3
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +8 -12
- 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 +225 -221
- 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 +644 -530
- 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/events.js +15 -14
- 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/sortable.js +2 -2
- 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/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.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,
|
|
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,
|
|
@@ -1818,23 +1816,27 @@
|
|
|
1818
1816
|
registerEvent(instance, event);
|
|
1819
1817
|
} else {
|
|
1820
1818
|
for (const key in event) {
|
|
1821
|
-
registerEvent(instance, event[key]
|
|
1819
|
+
registerEvent(instance, { name: key, handler: event[key] });
|
|
1822
1820
|
}
|
|
1823
1821
|
}
|
|
1824
1822
|
}
|
|
1825
1823
|
}
|
|
1826
|
-
function registerEvent(instance,
|
|
1827
|
-
|
|
1828
|
-
el = el ? el.call(instance, instance) : 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
|
-
on(
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1829
|
+
on(
|
|
1830
|
+
el ? el.call(instance, instance) : instance.$el,
|
|
1831
|
+
name,
|
|
1832
|
+
delegate == null ? void 0 : delegate.call(instance, instance),
|
|
1833
|
+
handler.bind(instance),
|
|
1834
|
+
{
|
|
1835
|
+
passive,
|
|
1836
|
+
capture,
|
|
1837
|
+
self
|
|
1838
|
+
}
|
|
1839
|
+
)
|
|
1838
1840
|
);
|
|
1839
1841
|
}
|
|
1840
1842
|
|
|
@@ -2150,7 +2152,7 @@
|
|
|
2150
2152
|
};
|
|
2151
2153
|
App.util = util;
|
|
2152
2154
|
App.options = {};
|
|
2153
|
-
App.version = "3.21.14-dev.
|
|
2155
|
+
App.version = "3.21.14-dev.2e8a07c7e";
|
|
2154
2156
|
|
|
2155
2157
|
const PREFIX = "uk-";
|
|
2156
2158
|
const DATA = "__uikit__";
|
|
@@ -2338,7 +2340,7 @@
|
|
|
2338
2340
|
const instance = this;
|
|
2339
2341
|
attachToElement(el, instance);
|
|
2340
2342
|
instance.$options.el = el;
|
|
2341
|
-
if (
|
|
2343
|
+
if (el.isConnected) {
|
|
2342
2344
|
callConnected(instance);
|
|
2343
2345
|
}
|
|
2344
2346
|
};
|
|
@@ -2472,6 +2474,82 @@
|
|
|
2472
2474
|
}
|
|
2473
2475
|
};
|
|
2474
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
|
+
|
|
2475
2553
|
var Togglable = {
|
|
2476
2554
|
props: {
|
|
2477
2555
|
cls: Boolean,
|
|
@@ -2509,8 +2587,14 @@
|
|
|
2509
2587
|
addClass(el, cls);
|
|
2510
2588
|
trigger(el, show ? "show" : "hide", [this]);
|
|
2511
2589
|
const done = () => {
|
|
2590
|
+
var _a;
|
|
2512
2591
|
removeClass(el, cls);
|
|
2513
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
|
+
}
|
|
2514
2598
|
};
|
|
2515
2599
|
return promise ? promise.then(done, () => {
|
|
2516
2600
|
removeClass(el, cls);
|
|
@@ -2543,7 +2627,6 @@
|
|
|
2543
2627
|
if (changed) {
|
|
2544
2628
|
trigger(el, "toggled", [toggled, this]);
|
|
2545
2629
|
}
|
|
2546
|
-
$$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
|
|
2547
2630
|
}
|
|
2548
2631
|
}
|
|
2549
2632
|
};
|
|
@@ -2936,7 +3019,7 @@
|
|
|
2936
3019
|
],
|
|
2937
3020
|
observe: [
|
|
2938
3021
|
intersection({
|
|
2939
|
-
filter: ({
|
|
3022
|
+
filter: ({ autoplay }) => autoplay !== "hover",
|
|
2940
3023
|
handler([{ isIntersecting }]) {
|
|
2941
3024
|
if (!document.fullscreenElement) {
|
|
2942
3025
|
if (isIntersecting) {
|
|
@@ -2949,7 +3032,9 @@
|
|
|
2949
3032
|
}
|
|
2950
3033
|
},
|
|
2951
3034
|
args: { intersecting: false },
|
|
2952
|
-
options: ({ $el, autoplay }) => ({
|
|
3035
|
+
options: ({ $el, autoplay }) => ({
|
|
3036
|
+
root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
|
|
3037
|
+
})
|
|
2953
3038
|
})
|
|
2954
3039
|
]
|
|
2955
3040
|
};
|
|
@@ -3029,82 +3114,6 @@
|
|
|
3029
3114
|
}
|
|
3030
3115
|
};
|
|
3031
3116
|
|
|
3032
|
-
var Position = {
|
|
3033
|
-
props: {
|
|
3034
|
-
pos: String,
|
|
3035
|
-
offset: Boolean,
|
|
3036
|
-
flip: Boolean,
|
|
3037
|
-
shift: Boolean,
|
|
3038
|
-
inset: Boolean
|
|
3039
|
-
},
|
|
3040
|
-
data: {
|
|
3041
|
-
pos: `bottom-${isRtl ? "right" : "left"}`,
|
|
3042
|
-
offset: false,
|
|
3043
|
-
flip: true,
|
|
3044
|
-
shift: true,
|
|
3045
|
-
inset: false
|
|
3046
|
-
},
|
|
3047
|
-
connected() {
|
|
3048
|
-
this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
|
|
3049
|
-
[this.dir, this.align] = this.pos;
|
|
3050
|
-
this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
|
|
3051
|
-
},
|
|
3052
|
-
methods: {
|
|
3053
|
-
positionAt(element, target, boundary) {
|
|
3054
|
-
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
3055
|
-
const placement = [this.flip && "flip", this.shift && "shift"];
|
|
3056
|
-
const attach = {
|
|
3057
|
-
element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
|
|
3058
|
-
target: [this.dir, this.align]
|
|
3059
|
-
};
|
|
3060
|
-
if (this.axis === "y") {
|
|
3061
|
-
for (const prop in attach) {
|
|
3062
|
-
attach[prop].reverse();
|
|
3063
|
-
}
|
|
3064
|
-
offset.reverse();
|
|
3065
|
-
placement.reverse();
|
|
3066
|
-
}
|
|
3067
|
-
const restoreScrollPosition = storeScrollPosition(element);
|
|
3068
|
-
const elDim = dimensions(element);
|
|
3069
|
-
css(element, { top: -elDim.height, left: -elDim.width });
|
|
3070
|
-
positionAt(element, target, {
|
|
3071
|
-
attach,
|
|
3072
|
-
offset,
|
|
3073
|
-
boundary,
|
|
3074
|
-
placement,
|
|
3075
|
-
viewportOffset: this.getViewportOffset(element)
|
|
3076
|
-
});
|
|
3077
|
-
restoreScrollPosition();
|
|
3078
|
-
},
|
|
3079
|
-
getPositionOffset(element = this.$el) {
|
|
3080
|
-
return toPx(
|
|
3081
|
-
this.offset === false ? css(element, "--uk-position-offset") : this.offset,
|
|
3082
|
-
this.axis === "x" ? "width" : "height",
|
|
3083
|
-
element
|
|
3084
|
-
) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
|
|
3085
|
-
},
|
|
3086
|
-
getShiftOffset(element = this.$el) {
|
|
3087
|
-
return this.align === "center" ? 0 : toPx(
|
|
3088
|
-
css(element, "--uk-position-shift-offset"),
|
|
3089
|
-
this.axis === "y" ? "width" : "height",
|
|
3090
|
-
element
|
|
3091
|
-
) * (includes(["left", "top"], this.align) ? 1 : -1);
|
|
3092
|
-
},
|
|
3093
|
-
getViewportOffset(element) {
|
|
3094
|
-
return toPx(css(element, "--uk-position-viewport-offset"));
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
};
|
|
3098
|
-
function storeScrollPosition(element) {
|
|
3099
|
-
const scrollElement = scrollParent(element);
|
|
3100
|
-
const { scrollTop } = scrollElement;
|
|
3101
|
-
return () => {
|
|
3102
|
-
if (scrollTop !== scrollElement.scrollTop) {
|
|
3103
|
-
scrollElement.scrollTop = scrollTop;
|
|
3104
|
-
}
|
|
3105
|
-
};
|
|
3106
|
-
}
|
|
3107
|
-
|
|
3108
3117
|
let prevented;
|
|
3109
3118
|
function preventBackgroundScroll(el) {
|
|
3110
3119
|
const off = on(
|
|
@@ -4087,7 +4096,7 @@
|
|
|
4087
4096
|
let rowHeights = 0;
|
|
4088
4097
|
for (let row of rows) {
|
|
4089
4098
|
if (isRtl) {
|
|
4090
|
-
row
|
|
4099
|
+
row.reverse();
|
|
4091
4100
|
}
|
|
4092
4101
|
let height = 0;
|
|
4093
4102
|
for (const j in row) {
|
|
@@ -4401,116 +4410,6 @@
|
|
|
4401
4410
|
dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
|
|
4402
4411
|
}
|
|
4403
4412
|
|
|
4404
|
-
function getMaxPathLength(el) {
|
|
4405
|
-
return isVisible(el) ? Math.ceil(
|
|
4406
|
-
Math.max(0, ...$$("[stroke]", el).map((stroke) => {
|
|
4407
|
-
var _a;
|
|
4408
|
-
return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
|
|
4409
|
-
}))
|
|
4410
|
-
) : 0;
|
|
4411
|
-
}
|
|
4412
|
-
|
|
4413
|
-
var svg = {
|
|
4414
|
-
mixins: [Svg],
|
|
4415
|
-
args: "src",
|
|
4416
|
-
props: {
|
|
4417
|
-
src: String,
|
|
4418
|
-
icon: String,
|
|
4419
|
-
attributes: "list",
|
|
4420
|
-
strokeAnimation: Boolean
|
|
4421
|
-
},
|
|
4422
|
-
data: {
|
|
4423
|
-
strokeAnimation: false
|
|
4424
|
-
},
|
|
4425
|
-
observe: [
|
|
4426
|
-
mutation({
|
|
4427
|
-
async handler() {
|
|
4428
|
-
const svg = await this.svg;
|
|
4429
|
-
if (svg) {
|
|
4430
|
-
applyAttributes.call(this, svg);
|
|
4431
|
-
}
|
|
4432
|
-
},
|
|
4433
|
-
options: {
|
|
4434
|
-
attributes: true,
|
|
4435
|
-
attributeFilter: ["id", "class", "style"]
|
|
4436
|
-
}
|
|
4437
|
-
})
|
|
4438
|
-
],
|
|
4439
|
-
async connected() {
|
|
4440
|
-
if (includes(this.src, "#")) {
|
|
4441
|
-
[this.src, this.icon] = this.src.split("#");
|
|
4442
|
-
}
|
|
4443
|
-
const svg = await this.svg;
|
|
4444
|
-
if (svg) {
|
|
4445
|
-
applyAttributes.call(this, svg);
|
|
4446
|
-
if (this.strokeAnimation) {
|
|
4447
|
-
applyAnimation(svg);
|
|
4448
|
-
}
|
|
4449
|
-
}
|
|
4450
|
-
},
|
|
4451
|
-
methods: {
|
|
4452
|
-
async getSvg() {
|
|
4453
|
-
if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
|
|
4454
|
-
await new Promise((resolve) => once(this.$el, "load", resolve));
|
|
4455
|
-
}
|
|
4456
|
-
return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
|
|
4457
|
-
}
|
|
4458
|
-
}
|
|
4459
|
-
};
|
|
4460
|
-
function applyAttributes(el) {
|
|
4461
|
-
const { $el } = this;
|
|
4462
|
-
addClass(el, attr($el, "class"), "uk-svg");
|
|
4463
|
-
for (let i = 0; i < $el.style.length; i++) {
|
|
4464
|
-
const prop = $el.style[i];
|
|
4465
|
-
css(el, prop, css($el, prop));
|
|
4466
|
-
}
|
|
4467
|
-
for (const attribute in this.attributes) {
|
|
4468
|
-
const [prop, value] = this.attributes[attribute].split(":", 2);
|
|
4469
|
-
attr(el, prop, value);
|
|
4470
|
-
}
|
|
4471
|
-
if (!this.$el.id) {
|
|
4472
|
-
removeAttr(el, "id");
|
|
4473
|
-
}
|
|
4474
|
-
}
|
|
4475
|
-
const loadSVG = memoize(async (src) => {
|
|
4476
|
-
if (src) {
|
|
4477
|
-
if (startsWith(src, "data:")) {
|
|
4478
|
-
return decodeURIComponent(src.split(",")[1]);
|
|
4479
|
-
} else {
|
|
4480
|
-
return (await fetch(src)).text();
|
|
4481
|
-
}
|
|
4482
|
-
} else {
|
|
4483
|
-
return Promise.reject();
|
|
4484
|
-
}
|
|
4485
|
-
});
|
|
4486
|
-
function parseSVG(svg, icon) {
|
|
4487
|
-
if (icon && includes(svg, "<symbol")) {
|
|
4488
|
-
svg = parseSymbols(svg)[icon] || svg;
|
|
4489
|
-
}
|
|
4490
|
-
return stringToSvg(svg);
|
|
4491
|
-
}
|
|
4492
|
-
const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
|
|
4493
|
-
const parseSymbols = memoize(function(svg) {
|
|
4494
|
-
const symbols = {};
|
|
4495
|
-
symbolRe.lastIndex = 0;
|
|
4496
|
-
let match;
|
|
4497
|
-
while (match = symbolRe.exec(svg)) {
|
|
4498
|
-
symbols[match[3]] = `<svg ${match[1]}svg>`;
|
|
4499
|
-
}
|
|
4500
|
-
return symbols;
|
|
4501
|
-
});
|
|
4502
|
-
function applyAnimation(el) {
|
|
4503
|
-
const length = getMaxPathLength(el);
|
|
4504
|
-
if (length) {
|
|
4505
|
-
css(el, "--uk-animation-stroke", length);
|
|
4506
|
-
}
|
|
4507
|
-
}
|
|
4508
|
-
function stringToSvg(string) {
|
|
4509
|
-
const container = document.createElement("template");
|
|
4510
|
-
container.innerHTML = string;
|
|
4511
|
-
return container.content.firstElementChild;
|
|
4512
|
-
}
|
|
4513
|
-
|
|
4514
4413
|
const icons = {
|
|
4515
4414
|
spinner,
|
|
4516
4415
|
totop,
|
|
@@ -4681,7 +4580,7 @@
|
|
|
4681
4580
|
return null;
|
|
4682
4581
|
}
|
|
4683
4582
|
if (!parsed[icon]) {
|
|
4684
|
-
parsed[icon] =
|
|
4583
|
+
parsed[icon] = fragment(icons[applyRtl(icon)] || icons[icon]);
|
|
4685
4584
|
}
|
|
4686
4585
|
return parsed[icon].cloneNode(true);
|
|
4687
4586
|
}
|
|
@@ -4758,7 +4657,7 @@
|
|
|
4758
4657
|
for (const prop of srcProps) {
|
|
4759
4658
|
const value = data(sourceEl, prop);
|
|
4760
4659
|
if (value) {
|
|
4761
|
-
attr(targetEl, prop.replace(
|
|
4660
|
+
attr(targetEl, prop.replace(/data-/g, ""), value);
|
|
4762
4661
|
}
|
|
4763
4662
|
}
|
|
4764
4663
|
}
|
|
@@ -4766,9 +4665,7 @@
|
|
|
4766
4665
|
const img = new Image();
|
|
4767
4666
|
wrapInPicture(img, sources);
|
|
4768
4667
|
setSourceProps(el, img);
|
|
4769
|
-
img.onload = () =>
|
|
4770
|
-
setSrcAttrs(el, img.currentSrc);
|
|
4771
|
-
};
|
|
4668
|
+
img.onload = () => setSrcAttrs(el, img.currentSrc);
|
|
4772
4669
|
attr(img, "src", src);
|
|
4773
4670
|
return img;
|
|
4774
4671
|
}
|
|
@@ -5022,9 +4919,6 @@
|
|
|
5022
4919
|
panel: ({ selPanel }, $el) => $(selPanel, $el),
|
|
5023
4920
|
transitionElement() {
|
|
5024
4921
|
return this.panel;
|
|
5025
|
-
},
|
|
5026
|
-
bgClose({ bgClose }) {
|
|
5027
|
-
return bgClose && this.panel;
|
|
5028
4922
|
}
|
|
5029
4923
|
},
|
|
5030
4924
|
connected() {
|
|
@@ -5187,7 +5081,7 @@
|
|
|
5187
5081
|
}
|
|
5188
5082
|
function listenForBackgroundClose(modal) {
|
|
5189
5083
|
return on(document, pointerDown, ({ target }) => {
|
|
5190
|
-
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)) {
|
|
5191
5085
|
return;
|
|
5192
5086
|
}
|
|
5193
5087
|
once(
|
|
@@ -5370,7 +5264,10 @@
|
|
|
5370
5264
|
{
|
|
5371
5265
|
name: "hide",
|
|
5372
5266
|
el: ({ dropContainer }) => dropContainer,
|
|
5373
|
-
async handler() {
|
|
5267
|
+
async handler(e) {
|
|
5268
|
+
if (parent(e.target) !== this.dropContainer) {
|
|
5269
|
+
return;
|
|
5270
|
+
}
|
|
5374
5271
|
await awaitMacroTask();
|
|
5375
5272
|
if (!this.getActive() && this._transparent) {
|
|
5376
5273
|
addClass(this.navbarContainer, clsNavbarTransparent);
|
|
@@ -5759,7 +5656,7 @@
|
|
|
5759
5656
|
update: [
|
|
5760
5657
|
{
|
|
5761
5658
|
read() {
|
|
5762
|
-
const targets = this.links.map((el) => getTargetedElement(el)
|
|
5659
|
+
const targets = this.links.map((el) => getTargetedElement(el)).filter(Boolean);
|
|
5763
5660
|
const { length } = targets;
|
|
5764
5661
|
if (!length || !isVisible(this.$el)) {
|
|
5765
5662
|
return false;
|
|
@@ -6158,6 +6055,113 @@
|
|
|
6158
6055
|
}
|
|
6159
6056
|
}
|
|
6160
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
|
+
|
|
6161
6165
|
const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
6162
6166
|
var Switcher = {
|
|
6163
6167
|
mixins: [Togglable],
|