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.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() :
|
|
@@ -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,
|
|
@@ -2446,6 +2444,121 @@
|
|
|
2446
2444
|
return $("a,button", el) || el;
|
|
2447
2445
|
}
|
|
2448
2446
|
|
|
2447
|
+
var img = {
|
|
2448
|
+
args: "dataSrc",
|
|
2449
|
+
props: {
|
|
2450
|
+
dataSrc: String,
|
|
2451
|
+
sources: String,
|
|
2452
|
+
margin: String,
|
|
2453
|
+
target: String,
|
|
2454
|
+
loading: String
|
|
2455
|
+
},
|
|
2456
|
+
data: {
|
|
2457
|
+
dataSrc: "",
|
|
2458
|
+
sources: false,
|
|
2459
|
+
margin: "50%",
|
|
2460
|
+
target: false,
|
|
2461
|
+
loading: "lazy"
|
|
2462
|
+
},
|
|
2463
|
+
connected() {
|
|
2464
|
+
if (this.loading !== "lazy") {
|
|
2465
|
+
this.load();
|
|
2466
|
+
} else if (isImg(this.$el)) {
|
|
2467
|
+
this.$el.loading = "lazy";
|
|
2468
|
+
setSrcAttrs(this.$el);
|
|
2469
|
+
}
|
|
2470
|
+
},
|
|
2471
|
+
disconnected() {
|
|
2472
|
+
if (this.img) {
|
|
2473
|
+
this.img.onload = "";
|
|
2474
|
+
}
|
|
2475
|
+
delete this.img;
|
|
2476
|
+
},
|
|
2477
|
+
observe: intersection({
|
|
2478
|
+
handler(entries, observer) {
|
|
2479
|
+
this.load();
|
|
2480
|
+
observer.disconnect();
|
|
2481
|
+
},
|
|
2482
|
+
options: ({ margin }) => ({ rootMargin: margin }),
|
|
2483
|
+
filter: ({ loading }) => loading === "lazy",
|
|
2484
|
+
target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
|
|
2485
|
+
}),
|
|
2486
|
+
methods: {
|
|
2487
|
+
load() {
|
|
2488
|
+
if (this.img) {
|
|
2489
|
+
return this.img;
|
|
2490
|
+
}
|
|
2491
|
+
const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);
|
|
2492
|
+
removeAttr(image, "loading");
|
|
2493
|
+
setSrcAttrs(this.$el, image.currentSrc);
|
|
2494
|
+
return this.img = image;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
};
|
|
2498
|
+
function setSrcAttrs(el, src) {
|
|
2499
|
+
if (isImg(el)) {
|
|
2500
|
+
const parentNode = parent(el);
|
|
2501
|
+
const elements = isTag(parentNode, "picture") ? children(parentNode) : [el];
|
|
2502
|
+
elements.forEach((el2) => setSourceProps(el2, el2));
|
|
2503
|
+
} else if (src) {
|
|
2504
|
+
const change = !includes(el.style.backgroundImage, src);
|
|
2505
|
+
if (change) {
|
|
2506
|
+
css(el, "backgroundImage", `url(${escape(src)})`);
|
|
2507
|
+
trigger(el, createEvent("load", false));
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
const srcProps = ["data-src", "data-srcset", "sizes"];
|
|
2512
|
+
function setSourceProps(sourceEl, targetEl) {
|
|
2513
|
+
for (const prop of srcProps) {
|
|
2514
|
+
const value = data(sourceEl, prop);
|
|
2515
|
+
if (value) {
|
|
2516
|
+
attr(targetEl, prop.replace(/data-/g, ""), value);
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
function getImageFromElement(el, src, sources) {
|
|
2521
|
+
const img = new Image();
|
|
2522
|
+
wrapInPicture(img, sources);
|
|
2523
|
+
setSourceProps(el, img);
|
|
2524
|
+
img.onload = () => setSrcAttrs(el, img.currentSrc);
|
|
2525
|
+
attr(img, "src", src);
|
|
2526
|
+
return img;
|
|
2527
|
+
}
|
|
2528
|
+
function wrapInPicture(img, sources) {
|
|
2529
|
+
sources = parseSources(sources);
|
|
2530
|
+
if (sources.length) {
|
|
2531
|
+
const picture = fragment("<picture>");
|
|
2532
|
+
for (const attrs of sources) {
|
|
2533
|
+
const source = fragment("<source>");
|
|
2534
|
+
attr(source, attrs);
|
|
2535
|
+
append(picture, source);
|
|
2536
|
+
}
|
|
2537
|
+
append(picture, img);
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
function parseSources(sources) {
|
|
2541
|
+
if (!sources) {
|
|
2542
|
+
return [];
|
|
2543
|
+
}
|
|
2544
|
+
if (startsWith(sources, "[")) {
|
|
2545
|
+
try {
|
|
2546
|
+
sources = JSON.parse(sources);
|
|
2547
|
+
} catch (e) {
|
|
2548
|
+
sources = [];
|
|
2549
|
+
}
|
|
2550
|
+
} else {
|
|
2551
|
+
sources = parseOptions(sources);
|
|
2552
|
+
}
|
|
2553
|
+
if (!isArray(sources)) {
|
|
2554
|
+
sources = [sources];
|
|
2555
|
+
}
|
|
2556
|
+
return sources.filter((source) => !isEmpty(source));
|
|
2557
|
+
}
|
|
2558
|
+
function isImg(el) {
|
|
2559
|
+
return isTag(el, "img");
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2449
2562
|
let prevented;
|
|
2450
2563
|
function preventBackgroundScroll(el) {
|
|
2451
2564
|
const off = on(
|
|
@@ -2512,6 +2625,82 @@
|
|
|
2512
2625
|
}
|
|
2513
2626
|
};
|
|
2514
2627
|
|
|
2628
|
+
var Position = {
|
|
2629
|
+
props: {
|
|
2630
|
+
pos: String,
|
|
2631
|
+
offset: Boolean,
|
|
2632
|
+
flip: Boolean,
|
|
2633
|
+
shift: Boolean,
|
|
2634
|
+
inset: Boolean
|
|
2635
|
+
},
|
|
2636
|
+
data: {
|
|
2637
|
+
pos: `bottom-${isRtl ? "right" : "left"}`,
|
|
2638
|
+
offset: false,
|
|
2639
|
+
flip: true,
|
|
2640
|
+
shift: true,
|
|
2641
|
+
inset: false
|
|
2642
|
+
},
|
|
2643
|
+
connected() {
|
|
2644
|
+
this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
|
|
2645
|
+
[this.dir, this.align] = this.pos;
|
|
2646
|
+
this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
|
|
2647
|
+
},
|
|
2648
|
+
methods: {
|
|
2649
|
+
positionAt(element, target, boundary) {
|
|
2650
|
+
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
2651
|
+
const placement = [this.flip && "flip", this.shift && "shift"];
|
|
2652
|
+
const attach = {
|
|
2653
|
+
element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
|
|
2654
|
+
target: [this.dir, this.align]
|
|
2655
|
+
};
|
|
2656
|
+
if (this.axis === "y") {
|
|
2657
|
+
for (const prop in attach) {
|
|
2658
|
+
attach[prop].reverse();
|
|
2659
|
+
}
|
|
2660
|
+
offset.reverse();
|
|
2661
|
+
placement.reverse();
|
|
2662
|
+
}
|
|
2663
|
+
const restoreScrollPosition = storeScrollPosition(element);
|
|
2664
|
+
const elDim = dimensions$1(element);
|
|
2665
|
+
css(element, { top: -elDim.height, left: -elDim.width });
|
|
2666
|
+
positionAt(element, target, {
|
|
2667
|
+
attach,
|
|
2668
|
+
offset,
|
|
2669
|
+
boundary,
|
|
2670
|
+
placement,
|
|
2671
|
+
viewportOffset: this.getViewportOffset(element)
|
|
2672
|
+
});
|
|
2673
|
+
restoreScrollPosition();
|
|
2674
|
+
},
|
|
2675
|
+
getPositionOffset(element = this.$el) {
|
|
2676
|
+
return toPx(
|
|
2677
|
+
this.offset === false ? css(element, "--uk-position-offset") : this.offset,
|
|
2678
|
+
this.axis === "x" ? "width" : "height",
|
|
2679
|
+
element
|
|
2680
|
+
) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
|
|
2681
|
+
},
|
|
2682
|
+
getShiftOffset(element = this.$el) {
|
|
2683
|
+
return this.align === "center" ? 0 : toPx(
|
|
2684
|
+
css(element, "--uk-position-shift-offset"),
|
|
2685
|
+
this.axis === "y" ? "width" : "height",
|
|
2686
|
+
element
|
|
2687
|
+
) * (includes(["left", "top"], this.align) ? 1 : -1);
|
|
2688
|
+
},
|
|
2689
|
+
getViewportOffset(element) {
|
|
2690
|
+
return toPx(css(element, "--uk-position-viewport-offset"));
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
};
|
|
2694
|
+
function storeScrollPosition(element) {
|
|
2695
|
+
const scrollElement = scrollParent(element);
|
|
2696
|
+
const { scrollTop } = scrollElement;
|
|
2697
|
+
return () => {
|
|
2698
|
+
if (scrollTop !== scrollElement.scrollTop) {
|
|
2699
|
+
scrollElement.scrollTop = scrollTop;
|
|
2700
|
+
}
|
|
2701
|
+
};
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2515
2704
|
var Togglable = {
|
|
2516
2705
|
props: {
|
|
2517
2706
|
cls: Boolean,
|
|
@@ -2549,8 +2738,14 @@
|
|
|
2549
2738
|
addClass(el, cls);
|
|
2550
2739
|
trigger(el, show ? "show" : "hide", [this]);
|
|
2551
2740
|
const done = () => {
|
|
2741
|
+
var _a;
|
|
2552
2742
|
removeClass(el, cls);
|
|
2553
2743
|
trigger(el, show ? "shown" : "hidden", [this]);
|
|
2744
|
+
if (show) {
|
|
2745
|
+
const restoreScrollPosition = storeScrollPosition(el);
|
|
2746
|
+
(_a = $$("[autofocus]", el).find(isVisible)) == null ? void 0 : _a.focus();
|
|
2747
|
+
restoreScrollPosition();
|
|
2748
|
+
}
|
|
2554
2749
|
};
|
|
2555
2750
|
return promise ? promise.then(done, () => {
|
|
2556
2751
|
removeClass(el, cls);
|
|
@@ -2583,7 +2778,6 @@
|
|
|
2583
2778
|
if (changed) {
|
|
2584
2779
|
trigger(el, "toggled", [toggled, this]);
|
|
2585
2780
|
}
|
|
2586
|
-
$$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
|
|
2587
2781
|
}
|
|
2588
2782
|
}
|
|
2589
2783
|
};
|
|
@@ -2714,9 +2908,6 @@
|
|
|
2714
2908
|
panel: ({ selPanel }, $el) => $(selPanel, $el),
|
|
2715
2909
|
transitionElement() {
|
|
2716
2910
|
return this.panel;
|
|
2717
|
-
},
|
|
2718
|
-
bgClose({ bgClose }) {
|
|
2719
|
-
return bgClose && this.panel;
|
|
2720
2911
|
}
|
|
2721
2912
|
},
|
|
2722
2913
|
connected() {
|
|
@@ -2879,7 +3070,7 @@
|
|
|
2879
3070
|
}
|
|
2880
3071
|
function listenForBackgroundClose$1(modal) {
|
|
2881
3072
|
return on(document, pointerDown$1, ({ target }) => {
|
|
2882
|
-
if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {
|
|
3073
|
+
if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || !modal.panel || modal.panel.contains(target)) {
|
|
2883
3074
|
return;
|
|
2884
3075
|
}
|
|
2885
3076
|
once(
|
|
@@ -2922,11 +3113,7 @@
|
|
|
2922
3113
|
return Math.abs(new DOMMatrix(css(el, "transform")).m41 / el.offsetWidth);
|
|
2923
3114
|
}
|
|
2924
3115
|
function translate(value = 0, unit = "%") {
|
|
2925
|
-
value
|
|
2926
|
-
return `translate3d(${value}, 0, 0)`;
|
|
2927
|
-
}
|
|
2928
|
-
function scale3d(value) {
|
|
2929
|
-
return `scale3d(${value}, ${value}, 1)`;
|
|
3116
|
+
return value ? `translate3d(${value + unit}, 0, 0)` : "";
|
|
2930
3117
|
}
|
|
2931
3118
|
|
|
2932
3119
|
function Transitioner$1(prev, next, dir, { animation, easing }) {
|
|
@@ -3060,7 +3247,6 @@
|
|
|
3060
3247
|
const pointerDown = "touchstart mousedown";
|
|
3061
3248
|
const pointerMove = "touchmove mousemove";
|
|
3062
3249
|
const pointerUp = "touchend touchcancel mouseup click input scroll";
|
|
3063
|
-
const preventClick = (e) => e.preventDefault();
|
|
3064
3250
|
var SliderDrag = {
|
|
3065
3251
|
props: {
|
|
3066
3252
|
draggable: Boolean
|
|
@@ -3128,9 +3314,6 @@
|
|
|
3128
3314
|
if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {
|
|
3129
3315
|
return;
|
|
3130
3316
|
}
|
|
3131
|
-
if (!this.dragging) {
|
|
3132
|
-
on(this.list, "click", preventClick, pointerOptions);
|
|
3133
|
-
}
|
|
3134
3317
|
e.cancelable && e.preventDefault();
|
|
3135
3318
|
this.dragging = true;
|
|
3136
3319
|
this.dir = distance < 0 ? 1 : -1;
|
|
@@ -3179,6 +3362,7 @@
|
|
|
3179
3362
|
off(document, pointerMove, this.move, pointerOptions);
|
|
3180
3363
|
off(document, pointerUp, this.end, pointerUpOptions);
|
|
3181
3364
|
if (this.dragging) {
|
|
3365
|
+
setTimeout(on(this.list, "click", (e) => e.preventDefault(), pointerOptions));
|
|
3182
3366
|
this.dragging = null;
|
|
3183
3367
|
if (this.index === this.prevIndex) {
|
|
3184
3368
|
this.percent = 1 - this.percent;
|
|
@@ -3189,6 +3373,8 @@
|
|
|
3189
3373
|
const dirChange = (isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;
|
|
3190
3374
|
this.index = dirChange ? this.index : this.prevIndex;
|
|
3191
3375
|
if (dirChange) {
|
|
3376
|
+
trigger(this.slides[this.prevIndex], "itemhidden", [this]);
|
|
3377
|
+
trigger(this.slides[this.index], "itemshown", [this]);
|
|
3192
3378
|
this.percent = 1 - this.percent;
|
|
3193
3379
|
}
|
|
3194
3380
|
this.show(
|
|
@@ -3197,7 +3383,6 @@
|
|
|
3197
3383
|
);
|
|
3198
3384
|
}
|
|
3199
3385
|
}
|
|
3200
|
-
setTimeout(() => off(this.list, "click", preventClick, pointerOptions));
|
|
3201
3386
|
css(this.list, { userSelect: "" });
|
|
3202
3387
|
this.drag = this.percent = null;
|
|
3203
3388
|
}
|
|
@@ -3531,7 +3716,7 @@
|
|
|
3531
3716
|
};
|
|
3532
3717
|
App.util = util;
|
|
3533
3718
|
App.options = {};
|
|
3534
|
-
App.version = "3.21.14-dev.
|
|
3719
|
+
App.version = "3.21.14-dev.8b3dfa6cd";
|
|
3535
3720
|
|
|
3536
3721
|
const PREFIX = "uk-";
|
|
3537
3722
|
const DATA = "__uikit__";
|
|
@@ -3650,7 +3835,7 @@
|
|
|
3650
3835
|
const instance = this;
|
|
3651
3836
|
attachToElement(el, instance);
|
|
3652
3837
|
instance.$options.el = el;
|
|
3653
|
-
if (
|
|
3838
|
+
if (el.isConnected) {
|
|
3654
3839
|
callConnected(instance);
|
|
3655
3840
|
}
|
|
3656
3841
|
};
|
|
@@ -3836,7 +4021,7 @@
|
|
|
3836
4021
|
const item = toNumber(cmd);
|
|
3837
4022
|
const active = item === index;
|
|
3838
4023
|
toggleClass(el, this.clsActive, active);
|
|
3839
|
-
toggleClass(button, "uk-disabled", this.parallax);
|
|
4024
|
+
toggleClass(button, "uk-disabled", !!this.parallax);
|
|
3840
4025
|
attr(button, {
|
|
3841
4026
|
"aria-selected": active,
|
|
3842
4027
|
tabindex: active && !this.parallax ? null : -1
|
|
@@ -3939,7 +4124,7 @@
|
|
|
3939
4124
|
}
|
|
3940
4125
|
},
|
|
3941
4126
|
methods: {
|
|
3942
|
-
show(index, force = false) {
|
|
4127
|
+
async show(index, force = false) {
|
|
3943
4128
|
var _a;
|
|
3944
4129
|
if (this.dragging || !this.length || this.parallax) {
|
|
3945
4130
|
return;
|
|
@@ -3975,18 +4160,16 @@
|
|
|
3975
4160
|
reset();
|
|
3976
4161
|
return;
|
|
3977
4162
|
}
|
|
3978
|
-
const promise = this._show(prev, next, force).then(() => {
|
|
3979
|
-
prev && trigger(prev, "itemhidden", [this]);
|
|
3980
|
-
trigger(next, "itemshown", [this]);
|
|
3981
|
-
stack.shift();
|
|
3982
|
-
this._transitioner = null;
|
|
3983
|
-
if (stack.length) {
|
|
3984
|
-
requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));
|
|
3985
|
-
}
|
|
3986
|
-
});
|
|
3987
4163
|
prev && trigger(prev, "itemhide", [this]);
|
|
3988
4164
|
trigger(next, "itemshow", [this]);
|
|
3989
|
-
|
|
4165
|
+
await this._show(prev, next, force);
|
|
4166
|
+
prev && trigger(prev, "itemhidden", [this]);
|
|
4167
|
+
trigger(next, "itemshown", [this]);
|
|
4168
|
+
stack.shift();
|
|
4169
|
+
this._transitioner = null;
|
|
4170
|
+
if (stack.length) {
|
|
4171
|
+
requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));
|
|
4172
|
+
}
|
|
3990
4173
|
},
|
|
3991
4174
|
getIndex(index = this.index, prev = this.index) {
|
|
3992
4175
|
return clamp(
|
|
@@ -4056,7 +4239,7 @@
|
|
|
4056
4239
|
},
|
|
4057
4240
|
observe: resize(),
|
|
4058
4241
|
events: {
|
|
4059
|
-
|
|
4242
|
+
itemshow({ target }) {
|
|
4060
4243
|
addClass(target, this.clsActive);
|
|
4061
4244
|
},
|
|
4062
4245
|
itemshown({ target }) {
|
|
@@ -4072,80 +4255,186 @@
|
|
|
4072
4255
|
...Animations$2,
|
|
4073
4256
|
fade: {
|
|
4074
4257
|
show() {
|
|
4075
|
-
return [{ opacity: 0 }, {
|
|
4258
|
+
return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
|
|
4076
4259
|
},
|
|
4077
4260
|
percent(current) {
|
|
4078
4261
|
return 1 - css(current, "opacity");
|
|
4079
4262
|
},
|
|
4080
4263
|
translate(percent) {
|
|
4081
|
-
return [{ opacity: 1 - percent }, {
|
|
4264
|
+
return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];
|
|
4082
4265
|
}
|
|
4083
4266
|
},
|
|
4084
4267
|
scale: {
|
|
4085
4268
|
show() {
|
|
4086
|
-
return [
|
|
4087
|
-
{ opacity: 0, transform: scale3d(1 - 0.2) },
|
|
4088
|
-
{ opacity: 1, transform: scale3d(1) }
|
|
4089
|
-
];
|
|
4269
|
+
return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];
|
|
4090
4270
|
},
|
|
4091
4271
|
percent(current) {
|
|
4092
4272
|
return 1 - css(current, "opacity");
|
|
4093
4273
|
},
|
|
4094
4274
|
translate(percent) {
|
|
4095
4275
|
return [
|
|
4096
|
-
{ opacity: 1 - percent, transform: scale3d(1
|
|
4097
|
-
{
|
|
4276
|
+
{ opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },
|
|
4277
|
+
{ zIndex: -1 }
|
|
4098
4278
|
];
|
|
4099
4279
|
}
|
|
4100
|
-
}
|
|
4101
|
-
};
|
|
4102
|
-
|
|
4103
|
-
var LightboxPanel = {
|
|
4104
|
-
mixins: [Modal, Slideshow],
|
|
4105
|
-
functional: true,
|
|
4106
|
-
props: {
|
|
4107
|
-
delayControls: Number,
|
|
4108
|
-
preload: Number,
|
|
4109
|
-
videoAutoplay: Boolean,
|
|
4110
|
-
template: String
|
|
4111
|
-
},
|
|
4112
|
-
data: () => ({
|
|
4113
|
-
preload: 1,
|
|
4114
|
-
videoAutoplay: false,
|
|
4115
|
-
delayControls: 3e3,
|
|
4116
|
-
items: [],
|
|
4117
|
-
cls: "uk-open",
|
|
4118
|
-
clsPage: "uk-lightbox-page",
|
|
4119
|
-
selList: ".uk-lightbox-items",
|
|
4120
|
-
attrItem: "uk-lightbox-item",
|
|
4121
|
-
selClose: ".uk-close-large",
|
|
4122
|
-
selCaption: ".uk-lightbox-caption",
|
|
4123
|
-
pauseOnHover: false,
|
|
4124
|
-
velocity: 2,
|
|
4125
|
-
Animations: Animations$1,
|
|
4126
|
-
template: `<div class="uk-lightbox uk-overflow-hidden"> <div class="uk-lightbox-items"></div> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>`
|
|
4127
|
-
}),
|
|
4128
|
-
created() {
|
|
4129
|
-
const $el = $(this.template);
|
|
4130
|
-
const list = $(this.selList, $el);
|
|
4131
|
-
this.items.forEach(() => append(list, "<div>"));
|
|
4132
|
-
const close = $("[uk-close]", $el);
|
|
4133
|
-
const closeLabel = this.t("close");
|
|
4134
|
-
if (close && closeLabel) {
|
|
4135
|
-
close.dataset.i18n = JSON.stringify({ label: closeLabel });
|
|
4136
|
-
}
|
|
4137
|
-
this.$mount(append(this.container, $el));
|
|
4138
4280
|
},
|
|
4139
|
-
|
|
4140
|
-
{
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4281
|
+
pull: {
|
|
4282
|
+
show(dir) {
|
|
4283
|
+
return dir < 0 ? [
|
|
4284
|
+
{ transform: translate(30), zIndex: -1 },
|
|
4285
|
+
{ transform: translate(), zIndex: 0 }
|
|
4286
|
+
] : [
|
|
4287
|
+
{ transform: translate(-100), zIndex: 0 },
|
|
4288
|
+
{ transform: translate(), zIndex: -1 }
|
|
4289
|
+
];
|
|
4290
|
+
},
|
|
4291
|
+
percent(current, next, dir) {
|
|
4292
|
+
return dir < 0 ? 1 - translated(next) : translated(current);
|
|
4293
|
+
},
|
|
4294
|
+
translate(percent, dir) {
|
|
4295
|
+
return dir < 0 ? [
|
|
4296
|
+
{ transform: translate(30 * percent), zIndex: -1 },
|
|
4297
|
+
{ transform: translate(-100 * (1 - percent)), zIndex: 0 }
|
|
4298
|
+
] : [
|
|
4299
|
+
{ transform: translate(-percent * 100), zIndex: 0 },
|
|
4300
|
+
{ transform: translate(30 * (1 - percent)), zIndex: -1 }
|
|
4301
|
+
];
|
|
4302
|
+
}
|
|
4303
|
+
},
|
|
4304
|
+
push: {
|
|
4305
|
+
show(dir) {
|
|
4306
|
+
return dir < 0 ? [
|
|
4307
|
+
{ transform: translate(100), zIndex: 0 },
|
|
4308
|
+
{ transform: translate(), zIndex: -1 }
|
|
4309
|
+
] : [
|
|
4310
|
+
{ transform: translate(-30), zIndex: -1 },
|
|
4311
|
+
{ transform: translate(), zIndex: 0 }
|
|
4312
|
+
];
|
|
4313
|
+
},
|
|
4314
|
+
percent(current, next, dir) {
|
|
4315
|
+
return dir > 0 ? 1 - translated(next) : translated(current);
|
|
4316
|
+
},
|
|
4317
|
+
translate(percent, dir) {
|
|
4318
|
+
return dir < 0 ? [
|
|
4319
|
+
{ transform: translate(percent * 100), zIndex: 0 },
|
|
4320
|
+
{ transform: translate(-30 * (1 - percent)), zIndex: -1 }
|
|
4321
|
+
] : [
|
|
4322
|
+
{ transform: translate(-30 * percent), zIndex: -1 },
|
|
4323
|
+
{ transform: translate(100 * (1 - percent)), zIndex: 0 }
|
|
4324
|
+
];
|
|
4325
|
+
}
|
|
4326
|
+
}
|
|
4327
|
+
};
|
|
4328
|
+
function scale3d(value) {
|
|
4329
|
+
return `scale3d(${value}, ${value}, 1)`;
|
|
4330
|
+
}
|
|
4331
|
+
|
|
4332
|
+
var Animations = {
|
|
4333
|
+
...Animations$2,
|
|
4334
|
+
fade: {
|
|
4335
|
+
show() {
|
|
4336
|
+
return [{ opacity: 0 }, { opacity: 1 }];
|
|
4337
|
+
},
|
|
4338
|
+
percent(current) {
|
|
4339
|
+
return 1 - css(current, "opacity");
|
|
4340
|
+
},
|
|
4341
|
+
translate(percent) {
|
|
4342
|
+
return [{ opacity: 1 - percent }, { opacity: percent }];
|
|
4343
|
+
}
|
|
4344
|
+
},
|
|
4345
|
+
scale: {
|
|
4346
|
+
show() {
|
|
4347
|
+
return [
|
|
4348
|
+
{ opacity: 0, transform: scale3d(1 - 0.2) },
|
|
4349
|
+
{ opacity: 1, transform: scale3d(1) }
|
|
4350
|
+
];
|
|
4351
|
+
},
|
|
4352
|
+
percent(current) {
|
|
4353
|
+
return 1 - css(current, "opacity");
|
|
4145
4354
|
},
|
|
4355
|
+
translate(percent) {
|
|
4356
|
+
return [
|
|
4357
|
+
{ opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },
|
|
4358
|
+
{ opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }
|
|
4359
|
+
];
|
|
4360
|
+
}
|
|
4361
|
+
}
|
|
4362
|
+
};
|
|
4363
|
+
|
|
4364
|
+
var LightboxPanel = {
|
|
4365
|
+
i18n: {
|
|
4366
|
+
counter: "%s / %s"
|
|
4367
|
+
},
|
|
4368
|
+
mixins: [Modal, Slideshow],
|
|
4369
|
+
functional: true,
|
|
4370
|
+
props: {
|
|
4371
|
+
counter: Boolean,
|
|
4372
|
+
preload: Number,
|
|
4373
|
+
nav: Boolean,
|
|
4374
|
+
slidenav: Boolean,
|
|
4375
|
+
delayControls: Number,
|
|
4376
|
+
videoAutoplay: Boolean,
|
|
4377
|
+
template: String
|
|
4378
|
+
},
|
|
4379
|
+
data: () => ({
|
|
4380
|
+
counter: false,
|
|
4381
|
+
preload: 1,
|
|
4382
|
+
nav: false,
|
|
4383
|
+
slidenav: true,
|
|
4384
|
+
delayControls: 3e3,
|
|
4385
|
+
videoAutoplay: false,
|
|
4386
|
+
items: [],
|
|
4387
|
+
cls: "uk-open",
|
|
4388
|
+
clsPage: "uk-lightbox-page",
|
|
4389
|
+
clsFit: "uk-lightbox-items-fit",
|
|
4390
|
+
clsZoom: "uk-lightbox-zoom",
|
|
4391
|
+
attrItem: "uk-lightbox-item",
|
|
4392
|
+
selList: ".uk-lightbox-items",
|
|
4393
|
+
selClose: ".uk-close-large",
|
|
4394
|
+
selNav: ".uk-lightbox-thumbnav, .uk-lightbox-dotnav",
|
|
4395
|
+
selCaption: ".uk-lightbox-caption",
|
|
4396
|
+
selCounter: ".uk-lightbox-counter",
|
|
4397
|
+
pauseOnHover: false,
|
|
4398
|
+
velocity: 2,
|
|
4399
|
+
Animations,
|
|
4400
|
+
template: `<div class="uk-lightbox uk-overflow-hidden"> <div class="uk-lightbox-items"></div> <div class="uk-position-top-right uk-position-small uk-transition-fade" uk-inverse> <button class="uk-lightbox-close uk-close-large" type="button" uk-close></button> </div> <div class="uk-lightbox-slidenav uk-position-center-left uk-position-medium uk-transition-fade" uk-inverse> <a href uk-slidenav-previous uk-lightbox-item="previous"></a> </div> <div class="uk-lightbox-slidenav uk-position-center-right uk-position-medium uk-transition-fade" uk-inverse> <a href uk-slidenav-next uk-lightbox-item="next"></a> </div> <div class="uk-position-center-right uk-position-medium uk-transition-fade" uk-inverse style="max-height: 90vh; overflow: auto;"> <ul class="uk-lightbox-thumbnav uk-lightbox-thumbnav-vertical uk-thumbnav uk-thumbnav-vertical"></ul> <ul class="uk-lightbox-dotnav uk-dotnav uk-dotnav-vertical"></ul> </div> <div class="uk-lightbox-counter uk-text-large uk-position-top-left uk-position-small uk-transition-fade" uk-inverse></div> <div class="uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>`
|
|
4401
|
+
}),
|
|
4402
|
+
created() {
|
|
4403
|
+
let $el = $(this.template);
|
|
4404
|
+
if (isTag($el, "template")) {
|
|
4405
|
+
$el = fragment(html($el));
|
|
4406
|
+
}
|
|
4407
|
+
const list = $(this.selList, $el);
|
|
4408
|
+
const navType = this.$props.nav;
|
|
4409
|
+
remove$1($$(this.selNav, $el).filter((el) => !matches(el, `.uk-${navType}`)));
|
|
4410
|
+
for (const [i, item] of this.items.entries()) {
|
|
4411
|
+
append(list, "<div>");
|
|
4412
|
+
if (navType === "thumbnav") {
|
|
4413
|
+
wrapAll(
|
|
4414
|
+
toThumbnavItem(item, this.videoAutoplay),
|
|
4415
|
+
append($(this.selNav, $el), `<li uk-lightbox-item="${i}"><a href></a></li>`)
|
|
4416
|
+
);
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
if (!this.slidenav) {
|
|
4420
|
+
remove$1($$(".uk-lightbox-slidenav", $el));
|
|
4421
|
+
}
|
|
4422
|
+
if (!this.counter) {
|
|
4423
|
+
remove$1($(this.selCounter, $el));
|
|
4424
|
+
}
|
|
4425
|
+
addClass(list, this.clsFit);
|
|
4426
|
+
const close = $("[uk-close]", $el);
|
|
4427
|
+
const closeLabel = this.t("close");
|
|
4428
|
+
if (close && closeLabel) {
|
|
4429
|
+
close.dataset.i18n = JSON.stringify({ label: closeLabel });
|
|
4430
|
+
}
|
|
4431
|
+
this.$mount(append(this.container, $el));
|
|
4432
|
+
},
|
|
4433
|
+
events: [
|
|
4146
4434
|
{
|
|
4147
4435
|
name: "click",
|
|
4148
4436
|
self: true,
|
|
4437
|
+
filter: ({ bgClose }) => bgClose,
|
|
4149
4438
|
delegate: ({ selList }) => `${selList} > *`,
|
|
4150
4439
|
handler(e) {
|
|
4151
4440
|
if (!e.defaultPrevented) {
|
|
@@ -4153,6 +4442,23 @@
|
|
|
4153
4442
|
}
|
|
4154
4443
|
}
|
|
4155
4444
|
},
|
|
4445
|
+
{
|
|
4446
|
+
name: "click",
|
|
4447
|
+
self: true,
|
|
4448
|
+
delegate: ({ clsZoom }) => `.${clsZoom}`,
|
|
4449
|
+
handler(e) {
|
|
4450
|
+
if (!e.defaultPrevented) {
|
|
4451
|
+
toggleClass(this.list, this.clsFit);
|
|
4452
|
+
}
|
|
4453
|
+
}
|
|
4454
|
+
},
|
|
4455
|
+
{
|
|
4456
|
+
name: `${pointerMove$1} ${pointerDown$1} keydown`,
|
|
4457
|
+
filter: ({ delayControls }) => delayControls,
|
|
4458
|
+
handler() {
|
|
4459
|
+
this.showControls();
|
|
4460
|
+
}
|
|
4461
|
+
},
|
|
4156
4462
|
{
|
|
4157
4463
|
name: "shown",
|
|
4158
4464
|
self: true,
|
|
@@ -4201,26 +4507,25 @@
|
|
|
4201
4507
|
{
|
|
4202
4508
|
name: "beforeitemshow",
|
|
4203
4509
|
handler(e) {
|
|
4510
|
+
html($(this.selCaption, this.$el), this.getItem().caption || "");
|
|
4511
|
+
html(
|
|
4512
|
+
$(this.selCounter, this.$el),
|
|
4513
|
+
this.t("counter", this.index + 1, this.slides.length)
|
|
4514
|
+
);
|
|
4515
|
+
for (let j = -this.preload; j <= this.preload; j++) {
|
|
4516
|
+
this.loadItem(this.index + j);
|
|
4517
|
+
}
|
|
4204
4518
|
if (this.isToggled()) {
|
|
4205
4519
|
return;
|
|
4206
4520
|
}
|
|
4207
4521
|
this.draggable = false;
|
|
4208
4522
|
e.preventDefault();
|
|
4209
4523
|
this.toggleElement(this.$el, true, false);
|
|
4210
|
-
this.animation = Animations
|
|
4524
|
+
this.animation = Animations.scale;
|
|
4211
4525
|
removeClass(e.target, this.clsActive);
|
|
4212
4526
|
this.stack.splice(1, 0, this.index);
|
|
4213
4527
|
}
|
|
4214
4528
|
},
|
|
4215
|
-
{
|
|
4216
|
-
name: "itemshow",
|
|
4217
|
-
handler() {
|
|
4218
|
-
html($(this.selCaption, this.$el), this.getItem().caption || "");
|
|
4219
|
-
for (let j = -this.preload; j <= this.preload; j++) {
|
|
4220
|
-
this.loadItem(this.index + j);
|
|
4221
|
-
}
|
|
4222
|
-
}
|
|
4223
|
-
},
|
|
4224
4529
|
{
|
|
4225
4530
|
name: "itemshown",
|
|
4226
4531
|
handler() {
|
|
@@ -4230,29 +4535,36 @@
|
|
|
4230
4535
|
{
|
|
4231
4536
|
name: "itemload",
|
|
4232
4537
|
async handler(_, item) {
|
|
4233
|
-
const { source: src, type,
|
|
4234
|
-
this.setItem(item, "<span uk-spinner></span>");
|
|
4538
|
+
const { source: src, type, attrs = {} } = item;
|
|
4539
|
+
this.setItem(item, "<span uk-spinner uk-inverse></span>");
|
|
4235
4540
|
if (!src) {
|
|
4236
4541
|
return;
|
|
4237
4542
|
}
|
|
4238
|
-
let
|
|
4543
|
+
let matches2;
|
|
4239
4544
|
const iframeAttrs = {
|
|
4240
4545
|
allowfullscreen: "",
|
|
4241
4546
|
style: "max-width: 100%; box-sizing: border-box;",
|
|
4242
4547
|
"uk-responsive": "",
|
|
4243
|
-
"uk-video": `${this.videoAutoplay}`
|
|
4548
|
+
"uk-video": `${Boolean(this.videoAutoplay)}`
|
|
4244
4549
|
};
|
|
4245
|
-
if (type === "image" || src
|
|
4246
|
-
const img = createEl("img"
|
|
4247
|
-
|
|
4550
|
+
if (type === "image" || isImage(src)) {
|
|
4551
|
+
const img = createEl("img");
|
|
4552
|
+
wrapInPicture(img, item.sources);
|
|
4553
|
+
attr(img, {
|
|
4554
|
+
src,
|
|
4555
|
+
...pick(item, ["alt", "srcset", "sizes"]),
|
|
4556
|
+
...attrs
|
|
4557
|
+
});
|
|
4558
|
+
on(img, "load", () => this.setItem(item, parent(img) || img));
|
|
4248
4559
|
on(img, "error", () => this.setError(item));
|
|
4249
|
-
} else if (type === "video" || src
|
|
4560
|
+
} else if (type === "video" || isVideo(src)) {
|
|
4561
|
+
const inline = this.videoAutoplay === "inline";
|
|
4250
4562
|
const video = createEl("video", {
|
|
4251
4563
|
src,
|
|
4252
|
-
poster,
|
|
4253
|
-
controls: "",
|
|
4254
4564
|
playsinline: "",
|
|
4255
|
-
"
|
|
4565
|
+
controls: inline ? null : "",
|
|
4566
|
+
poster: this.videoAutoplay ? null : item.poster,
|
|
4567
|
+
"uk-video": inline ? "automute: true" : Boolean(this.videoAutoplay),
|
|
4256
4568
|
...attrs
|
|
4257
4569
|
});
|
|
4258
4570
|
on(video, "loadedmetadata", () => this.setItem(item, video));
|
|
@@ -4267,20 +4579,20 @@
|
|
|
4267
4579
|
...attrs
|
|
4268
4580
|
})
|
|
4269
4581
|
);
|
|
4270
|
-
} else if (
|
|
4582
|
+
} else if (matches2 = src.match(
|
|
4271
4583
|
/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/
|
|
4272
4584
|
)) {
|
|
4273
4585
|
this.setItem(
|
|
4274
4586
|
item,
|
|
4275
4587
|
createEl("iframe", {
|
|
4276
|
-
src: `https://www.youtube${
|
|
4588
|
+
src: `https://www.youtube${matches2[1] || ""}.com/embed/${matches2[2]}${matches2[3] ? `?${matches2[3]}` : ""}`,
|
|
4277
4589
|
width: 1920,
|
|
4278
4590
|
height: 1080,
|
|
4279
4591
|
...iframeAttrs,
|
|
4280
4592
|
...attrs
|
|
4281
4593
|
})
|
|
4282
4594
|
);
|
|
4283
|
-
} else if (
|
|
4595
|
+
} else if (matches2 = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
|
|
4284
4596
|
try {
|
|
4285
4597
|
const { height, width } = await (await fetch(
|
|
4286
4598
|
`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
|
|
@@ -4291,7 +4603,7 @@
|
|
|
4291
4603
|
this.setItem(
|
|
4292
4604
|
item,
|
|
4293
4605
|
createEl("iframe", {
|
|
4294
|
-
src: `https://player.vimeo.com/video/${
|
|
4606
|
+
src: `https://player.vimeo.com/video/${matches2[1]}${matches2[2] ? `?${matches2[2]}` : ""}`,
|
|
4295
4607
|
width,
|
|
4296
4608
|
height,
|
|
4297
4609
|
...iframeAttrs,
|
|
@@ -4303,8 +4615,29 @@
|
|
|
4303
4615
|
}
|
|
4304
4616
|
}
|
|
4305
4617
|
}
|
|
4618
|
+
},
|
|
4619
|
+
{
|
|
4620
|
+
name: "itemloaded",
|
|
4621
|
+
handler() {
|
|
4622
|
+
this.$emit("resize");
|
|
4623
|
+
}
|
|
4306
4624
|
}
|
|
4307
4625
|
],
|
|
4626
|
+
update: {
|
|
4627
|
+
read() {
|
|
4628
|
+
for (const media of $$(`${this.selList} :not([controls]):is(img,video)`, this.$el)) {
|
|
4629
|
+
toggleClass(
|
|
4630
|
+
media,
|
|
4631
|
+
this.clsZoom,
|
|
4632
|
+
(media.naturalHeight || media.videoHeight) - this.$el.offsetHeight > Math.max(
|
|
4633
|
+
0,
|
|
4634
|
+
(media.naturalWidth || media.videoWidth) - this.$el.offsetWidth
|
|
4635
|
+
)
|
|
4636
|
+
);
|
|
4637
|
+
}
|
|
4638
|
+
},
|
|
4639
|
+
events: ["resize"]
|
|
4640
|
+
},
|
|
4308
4641
|
methods: {
|
|
4309
4642
|
loadItem(index = this.index) {
|
|
4310
4643
|
const item = this.getItem(index);
|
|
@@ -4322,11 +4655,11 @@
|
|
|
4322
4655
|
return this.slides[this.items.indexOf(item)];
|
|
4323
4656
|
},
|
|
4324
4657
|
setError(item) {
|
|
4325
|
-
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2"></span>');
|
|
4658
|
+
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2" uk-inverse></span>');
|
|
4326
4659
|
},
|
|
4327
4660
|
showControls() {
|
|
4328
4661
|
clearTimeout(this.controlsTimer);
|
|
4329
|
-
this.controlsTimer = setTimeout(this.hideControls, this.delayControls);
|
|
4662
|
+
this.controlsTimer = this.delayControls && setTimeout(this.hideControls, this.delayControls);
|
|
4330
4663
|
addClass(this.$el, "uk-active", "uk-transition-active");
|
|
4331
4664
|
},
|
|
4332
4665
|
hideControls() {
|
|
@@ -4339,7 +4672,26 @@
|
|
|
4339
4672
|
attr(el, attrs);
|
|
4340
4673
|
return el;
|
|
4341
4674
|
}
|
|
4675
|
+
function toThumbnavItem(item, videoAutoplay) {
|
|
4676
|
+
const el = item.poster || item.thumb && (item.type === "image" || isImage(item.thumb)) ? createEl("img", { src: item.poster || item.thumb, alt: "" }) : item.thumb && (item.type === "video" || isVideo(item.thumb)) ? createEl("video", {
|
|
4677
|
+
src: item.thumb,
|
|
4678
|
+
loop: "",
|
|
4679
|
+
playsinline: "",
|
|
4680
|
+
"uk-video": `autoplay: ${Boolean(videoAutoplay)}; automute: true`
|
|
4681
|
+
}) : createEl("canvas");
|
|
4682
|
+
if (item.thumbRatio) {
|
|
4683
|
+
el.style.aspectRatio = item.thumbRatio;
|
|
4684
|
+
}
|
|
4685
|
+
return el;
|
|
4686
|
+
}
|
|
4687
|
+
function isImage(src) {
|
|
4688
|
+
return src == null ? void 0 : src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i);
|
|
4689
|
+
}
|
|
4690
|
+
function isVideo(src) {
|
|
4691
|
+
return src == null ? void 0 : src.match(/\.(mp4|webm|ogv)($|\?)/i);
|
|
4692
|
+
}
|
|
4342
4693
|
|
|
4694
|
+
const selDisabled$1 = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
4343
4695
|
var lightbox = {
|
|
4344
4696
|
install: install$3,
|
|
4345
4697
|
props: { toggle: String },
|
|
@@ -4362,17 +4714,23 @@
|
|
|
4362
4714
|
},
|
|
4363
4715
|
events: {
|
|
4364
4716
|
name: "click",
|
|
4365
|
-
delegate: ({ toggle }) =>
|
|
4717
|
+
delegate: ({ toggle }) => toggle,
|
|
4366
4718
|
handler(e) {
|
|
4367
4719
|
if (!e.defaultPrevented) {
|
|
4368
4720
|
e.preventDefault();
|
|
4369
|
-
|
|
4721
|
+
if (!matches(e.current, selDisabled$1)) {
|
|
4722
|
+
this.show(e.current);
|
|
4723
|
+
}
|
|
4370
4724
|
}
|
|
4371
4725
|
}
|
|
4372
4726
|
},
|
|
4373
4727
|
methods: {
|
|
4374
4728
|
show(index) {
|
|
4375
|
-
|
|
4729
|
+
let items = this.toggles.map(toItem);
|
|
4730
|
+
if (this.nav === "thumbnav") {
|
|
4731
|
+
ensureThumb.call(this, this.toggles, items);
|
|
4732
|
+
}
|
|
4733
|
+
items = uniqueBy(items, "source");
|
|
4376
4734
|
if (isElement(index)) {
|
|
4377
4735
|
const { source } = toItem(index);
|
|
4378
4736
|
index = findIndex(items, ({ source: src }) => source === src);
|
|
@@ -4393,10 +4751,29 @@
|
|
|
4393
4751
|
}
|
|
4394
4752
|
assign(Lightbox.props, UIkit.component("lightboxPanel").options.props);
|
|
4395
4753
|
}
|
|
4754
|
+
function ensureThumb(toggles, items) {
|
|
4755
|
+
for (const [i, toggle] of Object.entries(toggles)) {
|
|
4756
|
+
if (items[i].thumb) {
|
|
4757
|
+
continue;
|
|
4758
|
+
}
|
|
4759
|
+
const parent = parents(toggle).reverse().concat(toggle).find(
|
|
4760
|
+
(parent2) => this.$el.contains(parent2) && (parent2 === toggle || $$(this.toggle, parent2).length === 1)
|
|
4761
|
+
);
|
|
4762
|
+
if (!parent) {
|
|
4763
|
+
continue;
|
|
4764
|
+
}
|
|
4765
|
+
const media = $("img,video", parent);
|
|
4766
|
+
if (media) {
|
|
4767
|
+
items[i].thumb = media.currentSrc || media.poster || media.src;
|
|
4768
|
+
items[i].thumbRatio = (media.naturalWidth || media.videoWidth) / (media.naturalHeight || media.videoHeight);
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
}
|
|
4396
4772
|
function toItem(el) {
|
|
4397
4773
|
const item = {};
|
|
4398
|
-
for (const
|
|
4399
|
-
|
|
4774
|
+
for (const attribute of el.getAttributeNames()) {
|
|
4775
|
+
const key = attribute.replace(/^data-/, "");
|
|
4776
|
+
item[key === "href" ? "source" : key] = el.getAttribute(attribute);
|
|
4400
4777
|
}
|
|
4401
4778
|
item.attrs = parseOptions(item.attrs);
|
|
4402
4779
|
return item;
|
|
@@ -5504,106 +5881,30 @@
|
|
|
5504
5881
|
return isIn(type) ^ dir < 0 ? percent : 1 - percent;
|
|
5505
5882
|
}
|
|
5506
5883
|
|
|
5507
|
-
var
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
percent(current) {
|
|
5514
|
-
return 1 - css(current, "opacity");
|
|
5515
|
-
},
|
|
5516
|
-
translate(percent) {
|
|
5517
|
-
return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];
|
|
5518
|
-
}
|
|
5884
|
+
var slideshow = {
|
|
5885
|
+
mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],
|
|
5886
|
+
props: {
|
|
5887
|
+
ratio: String,
|
|
5888
|
+
minHeight: String,
|
|
5889
|
+
maxHeight: String
|
|
5519
5890
|
},
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
return [
|
|
5529
|
-
{ opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },
|
|
5530
|
-
{ zIndex: -1 }
|
|
5531
|
-
];
|
|
5532
|
-
}
|
|
5891
|
+
data: {
|
|
5892
|
+
ratio: "16:9",
|
|
5893
|
+
minHeight: void 0,
|
|
5894
|
+
maxHeight: void 0,
|
|
5895
|
+
selList: ".uk-slideshow-items",
|
|
5896
|
+
attrItem: "uk-slideshow-item",
|
|
5897
|
+
selNav: ".uk-slideshow-nav",
|
|
5898
|
+
Animations: Animations$1
|
|
5533
5899
|
},
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
];
|
|
5543
|
-
},
|
|
5544
|
-
percent(current, next, dir) {
|
|
5545
|
-
return dir < 0 ? 1 - translated(next) : translated(current);
|
|
5546
|
-
},
|
|
5547
|
-
translate(percent, dir) {
|
|
5548
|
-
return dir < 0 ? [
|
|
5549
|
-
{ transform: translate(30 * percent), zIndex: -1 },
|
|
5550
|
-
{ transform: translate(-100 * (1 - percent)), zIndex: 0 }
|
|
5551
|
-
] : [
|
|
5552
|
-
{ transform: translate(-percent * 100), zIndex: 0 },
|
|
5553
|
-
{ transform: translate(30 * (1 - percent)), zIndex: -1 }
|
|
5554
|
-
];
|
|
5555
|
-
}
|
|
5556
|
-
},
|
|
5557
|
-
push: {
|
|
5558
|
-
show(dir) {
|
|
5559
|
-
return dir < 0 ? [
|
|
5560
|
-
{ transform: translate(100), zIndex: 0 },
|
|
5561
|
-
{ transform: translate(), zIndex: -1 }
|
|
5562
|
-
] : [
|
|
5563
|
-
{ transform: translate(-30), zIndex: -1 },
|
|
5564
|
-
{ transform: translate(), zIndex: 0 }
|
|
5565
|
-
];
|
|
5566
|
-
},
|
|
5567
|
-
percent(current, next, dir) {
|
|
5568
|
-
return dir > 0 ? 1 - translated(next) : translated(current);
|
|
5569
|
-
},
|
|
5570
|
-
translate(percent, dir) {
|
|
5571
|
-
return dir < 0 ? [
|
|
5572
|
-
{ transform: translate(percent * 100), zIndex: 0 },
|
|
5573
|
-
{ transform: translate(-30 * (1 - percent)), zIndex: -1 }
|
|
5574
|
-
] : [
|
|
5575
|
-
{ transform: translate(-30 * percent), zIndex: -1 },
|
|
5576
|
-
{ transform: translate(100 * (1 - percent)), zIndex: 0 }
|
|
5577
|
-
];
|
|
5578
|
-
}
|
|
5579
|
-
}
|
|
5580
|
-
};
|
|
5581
|
-
|
|
5582
|
-
var slideshow = {
|
|
5583
|
-
mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],
|
|
5584
|
-
props: {
|
|
5585
|
-
ratio: String,
|
|
5586
|
-
minHeight: String,
|
|
5587
|
-
maxHeight: String
|
|
5588
|
-
},
|
|
5589
|
-
data: {
|
|
5590
|
-
ratio: "16:9",
|
|
5591
|
-
minHeight: void 0,
|
|
5592
|
-
maxHeight: void 0,
|
|
5593
|
-
selList: ".uk-slideshow-items",
|
|
5594
|
-
attrItem: "uk-slideshow-item",
|
|
5595
|
-
selNav: ".uk-slideshow-nav",
|
|
5596
|
-
Animations
|
|
5597
|
-
},
|
|
5598
|
-
watch: {
|
|
5599
|
-
list(list) {
|
|
5600
|
-
css(list, {
|
|
5601
|
-
aspectRatio: this.ratio ? this.ratio.replace(":", "/") : void 0,
|
|
5602
|
-
minHeight: this.minHeight,
|
|
5603
|
-
maxHeight: this.maxHeight,
|
|
5604
|
-
minWidth: "100%",
|
|
5605
|
-
maxWidth: "100%"
|
|
5606
|
-
});
|
|
5900
|
+
watch: {
|
|
5901
|
+
list(list) {
|
|
5902
|
+
css(list, {
|
|
5903
|
+
aspectRatio: this.ratio ? this.ratio.replace(":", "/") : void 0,
|
|
5904
|
+
minHeight: this.minHeight,
|
|
5905
|
+
maxHeight: this.maxHeight,
|
|
5906
|
+
width: "100%"
|
|
5907
|
+
});
|
|
5607
5908
|
}
|
|
5608
5909
|
},
|
|
5609
5910
|
methods: {
|
|
@@ -5923,82 +6224,6 @@
|
|
|
5923
6224
|
};
|
|
5924
6225
|
}
|
|
5925
6226
|
|
|
5926
|
-
var Position = {
|
|
5927
|
-
props: {
|
|
5928
|
-
pos: String,
|
|
5929
|
-
offset: Boolean,
|
|
5930
|
-
flip: Boolean,
|
|
5931
|
-
shift: Boolean,
|
|
5932
|
-
inset: Boolean
|
|
5933
|
-
},
|
|
5934
|
-
data: {
|
|
5935
|
-
pos: `bottom-${isRtl ? "right" : "left"}`,
|
|
5936
|
-
offset: false,
|
|
5937
|
-
flip: true,
|
|
5938
|
-
shift: true,
|
|
5939
|
-
inset: false
|
|
5940
|
-
},
|
|
5941
|
-
connected() {
|
|
5942
|
-
this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
|
|
5943
|
-
[this.dir, this.align] = this.pos;
|
|
5944
|
-
this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
|
|
5945
|
-
},
|
|
5946
|
-
methods: {
|
|
5947
|
-
positionAt(element, target, boundary) {
|
|
5948
|
-
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
5949
|
-
const placement = [this.flip && "flip", this.shift && "shift"];
|
|
5950
|
-
const attach = {
|
|
5951
|
-
element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
|
|
5952
|
-
target: [this.dir, this.align]
|
|
5953
|
-
};
|
|
5954
|
-
if (this.axis === "y") {
|
|
5955
|
-
for (const prop in attach) {
|
|
5956
|
-
attach[prop].reverse();
|
|
5957
|
-
}
|
|
5958
|
-
offset.reverse();
|
|
5959
|
-
placement.reverse();
|
|
5960
|
-
}
|
|
5961
|
-
const restoreScrollPosition = storeScrollPosition(element);
|
|
5962
|
-
const elDim = dimensions$1(element);
|
|
5963
|
-
css(element, { top: -elDim.height, left: -elDim.width });
|
|
5964
|
-
positionAt(element, target, {
|
|
5965
|
-
attach,
|
|
5966
|
-
offset,
|
|
5967
|
-
boundary,
|
|
5968
|
-
placement,
|
|
5969
|
-
viewportOffset: this.getViewportOffset(element)
|
|
5970
|
-
});
|
|
5971
|
-
restoreScrollPosition();
|
|
5972
|
-
},
|
|
5973
|
-
getPositionOffset(element = this.$el) {
|
|
5974
|
-
return toPx(
|
|
5975
|
-
this.offset === false ? css(element, "--uk-position-offset") : this.offset,
|
|
5976
|
-
this.axis === "x" ? "width" : "height",
|
|
5977
|
-
element
|
|
5978
|
-
) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
|
|
5979
|
-
},
|
|
5980
|
-
getShiftOffset(element = this.$el) {
|
|
5981
|
-
return this.align === "center" ? 0 : toPx(
|
|
5982
|
-
css(element, "--uk-position-shift-offset"),
|
|
5983
|
-
this.axis === "y" ? "width" : "height",
|
|
5984
|
-
element
|
|
5985
|
-
) * (includes(["left", "top"], this.align) ? 1 : -1);
|
|
5986
|
-
},
|
|
5987
|
-
getViewportOffset(element) {
|
|
5988
|
-
return toPx(css(element, "--uk-position-viewport-offset"));
|
|
5989
|
-
}
|
|
5990
|
-
}
|
|
5991
|
-
};
|
|
5992
|
-
function storeScrollPosition(element) {
|
|
5993
|
-
const scrollElement = scrollParent(element);
|
|
5994
|
-
const { scrollTop } = scrollElement;
|
|
5995
|
-
return () => {
|
|
5996
|
-
if (scrollTop !== scrollElement.scrollTop) {
|
|
5997
|
-
scrollElement.scrollTop = scrollTop;
|
|
5998
|
-
}
|
|
5999
|
-
};
|
|
6000
|
-
}
|
|
6001
|
-
|
|
6002
6227
|
var tooltip = {
|
|
6003
6228
|
mixins: [Container, Togglable, Position],
|
|
6004
6229
|
data: {
|
|
@@ -6084,7 +6309,7 @@
|
|
|
6084
6309
|
// Clicking a button does not give it focus on all browsers and platforms
|
|
6085
6310
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
|
|
6086
6311
|
[`focus ${pointerEnter} ${pointerDown$1}`](e) {
|
|
6087
|
-
if (!isTouch(e) || e.type === pointerDown$1) {
|
|
6312
|
+
if ((!isTouch(e) || e.type === pointerDown$1) && document.readyState !== "loading") {
|
|
6088
6313
|
this.show();
|
|
6089
6314
|
}
|
|
6090
6315
|
}
|
|
@@ -6687,7 +6912,7 @@
|
|
|
6687
6912
|
],
|
|
6688
6913
|
observe: [
|
|
6689
6914
|
intersection({
|
|
6690
|
-
filter: ({
|
|
6915
|
+
filter: ({ autoplay }) => autoplay !== "hover",
|
|
6691
6916
|
handler([{ isIntersecting }]) {
|
|
6692
6917
|
if (!document.fullscreenElement) {
|
|
6693
6918
|
if (isIntersecting) {
|
|
@@ -6700,7 +6925,9 @@
|
|
|
6700
6925
|
}
|
|
6701
6926
|
},
|
|
6702
6927
|
args: { intersecting: false },
|
|
6703
|
-
options: ({ $el, autoplay }) => ({
|
|
6928
|
+
options: ({ $el, autoplay }) => ({
|
|
6929
|
+
root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
|
|
6930
|
+
})
|
|
6704
6931
|
})
|
|
6705
6932
|
]
|
|
6706
6933
|
};
|
|
@@ -7600,7 +7827,7 @@
|
|
|
7600
7827
|
let rowHeights = 0;
|
|
7601
7828
|
for (let row of rows) {
|
|
7602
7829
|
if (isRtl) {
|
|
7603
|
-
row
|
|
7830
|
+
row.reverse();
|
|
7604
7831
|
}
|
|
7605
7832
|
let height = 0;
|
|
7606
7833
|
for (const j in row) {
|
|
@@ -7895,107 +8122,6 @@
|
|
|
7895
8122
|
dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
|
|
7896
8123
|
}
|
|
7897
8124
|
|
|
7898
|
-
var svg = {
|
|
7899
|
-
mixins: [Svg],
|
|
7900
|
-
args: "src",
|
|
7901
|
-
props: {
|
|
7902
|
-
src: String,
|
|
7903
|
-
icon: String,
|
|
7904
|
-
attributes: "list",
|
|
7905
|
-
strokeAnimation: Boolean
|
|
7906
|
-
},
|
|
7907
|
-
data: {
|
|
7908
|
-
strokeAnimation: false
|
|
7909
|
-
},
|
|
7910
|
-
observe: [
|
|
7911
|
-
mutation({
|
|
7912
|
-
async handler() {
|
|
7913
|
-
const svg = await this.svg;
|
|
7914
|
-
if (svg) {
|
|
7915
|
-
applyAttributes.call(this, svg);
|
|
7916
|
-
}
|
|
7917
|
-
},
|
|
7918
|
-
options: {
|
|
7919
|
-
attributes: true,
|
|
7920
|
-
attributeFilter: ["id", "class", "style"]
|
|
7921
|
-
}
|
|
7922
|
-
})
|
|
7923
|
-
],
|
|
7924
|
-
async connected() {
|
|
7925
|
-
if (includes(this.src, "#")) {
|
|
7926
|
-
[this.src, this.icon] = this.src.split("#");
|
|
7927
|
-
}
|
|
7928
|
-
const svg = await this.svg;
|
|
7929
|
-
if (svg) {
|
|
7930
|
-
applyAttributes.call(this, svg);
|
|
7931
|
-
if (this.strokeAnimation) {
|
|
7932
|
-
applyAnimation(svg);
|
|
7933
|
-
}
|
|
7934
|
-
}
|
|
7935
|
-
},
|
|
7936
|
-
methods: {
|
|
7937
|
-
async getSvg() {
|
|
7938
|
-
if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
|
|
7939
|
-
await new Promise((resolve) => once(this.$el, "load", resolve));
|
|
7940
|
-
}
|
|
7941
|
-
return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
|
|
7942
|
-
}
|
|
7943
|
-
}
|
|
7944
|
-
};
|
|
7945
|
-
function applyAttributes(el) {
|
|
7946
|
-
const { $el } = this;
|
|
7947
|
-
addClass(el, attr($el, "class"), "uk-svg");
|
|
7948
|
-
for (let i = 0; i < $el.style.length; i++) {
|
|
7949
|
-
const prop = $el.style[i];
|
|
7950
|
-
css(el, prop, css($el, prop));
|
|
7951
|
-
}
|
|
7952
|
-
for (const attribute in this.attributes) {
|
|
7953
|
-
const [prop, value] = this.attributes[attribute].split(":", 2);
|
|
7954
|
-
attr(el, prop, value);
|
|
7955
|
-
}
|
|
7956
|
-
if (!this.$el.id) {
|
|
7957
|
-
removeAttr(el, "id");
|
|
7958
|
-
}
|
|
7959
|
-
}
|
|
7960
|
-
const loadSVG = memoize(async (src) => {
|
|
7961
|
-
if (src) {
|
|
7962
|
-
if (startsWith(src, "data:")) {
|
|
7963
|
-
return decodeURIComponent(src.split(",")[1]);
|
|
7964
|
-
} else {
|
|
7965
|
-
return (await fetch(src)).text();
|
|
7966
|
-
}
|
|
7967
|
-
} else {
|
|
7968
|
-
return Promise.reject();
|
|
7969
|
-
}
|
|
7970
|
-
});
|
|
7971
|
-
function parseSVG(svg, icon) {
|
|
7972
|
-
if (icon && includes(svg, "<symbol")) {
|
|
7973
|
-
svg = parseSymbols(svg)[icon] || svg;
|
|
7974
|
-
}
|
|
7975
|
-
return stringToSvg(svg);
|
|
7976
|
-
}
|
|
7977
|
-
const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
|
|
7978
|
-
const parseSymbols = memoize(function(svg) {
|
|
7979
|
-
const symbols = {};
|
|
7980
|
-
symbolRe.lastIndex = 0;
|
|
7981
|
-
let match;
|
|
7982
|
-
while (match = symbolRe.exec(svg)) {
|
|
7983
|
-
symbols[match[3]] = `<svg ${match[1]}svg>`;
|
|
7984
|
-
}
|
|
7985
|
-
return symbols;
|
|
7986
|
-
});
|
|
7987
|
-
function applyAnimation(el) {
|
|
7988
|
-
const length = getMaxPathLength(el);
|
|
7989
|
-
if (length) {
|
|
7990
|
-
css(el, "--uk-animation-stroke", length);
|
|
7991
|
-
}
|
|
7992
|
-
}
|
|
7993
|
-
function stringToSvg(string) {
|
|
7994
|
-
const container = document.createElement("template");
|
|
7995
|
-
container.innerHTML = string;
|
|
7996
|
-
return container.content.firstElementChild;
|
|
7997
|
-
}
|
|
7998
|
-
|
|
7999
8125
|
const icons = {
|
|
8000
8126
|
spinner,
|
|
8001
8127
|
totop,
|
|
@@ -8166,7 +8292,7 @@
|
|
|
8166
8292
|
return null;
|
|
8167
8293
|
}
|
|
8168
8294
|
if (!parsed[icon]) {
|
|
8169
|
-
parsed[icon] =
|
|
8295
|
+
parsed[icon] = fragment(icons[applyRtl(icon)] || icons[icon]);
|
|
8170
8296
|
}
|
|
8171
8297
|
return parsed[icon].cloneNode(true);
|
|
8172
8298
|
}
|
|
@@ -8174,123 +8300,6 @@
|
|
|
8174
8300
|
return isRtl ? swap(swap(icon, "left", "right"), "previous", "next") : icon;
|
|
8175
8301
|
}
|
|
8176
8302
|
|
|
8177
|
-
var img = {
|
|
8178
|
-
args: "dataSrc",
|
|
8179
|
-
props: {
|
|
8180
|
-
dataSrc: String,
|
|
8181
|
-
sources: String,
|
|
8182
|
-
margin: String,
|
|
8183
|
-
target: String,
|
|
8184
|
-
loading: String
|
|
8185
|
-
},
|
|
8186
|
-
data: {
|
|
8187
|
-
dataSrc: "",
|
|
8188
|
-
sources: false,
|
|
8189
|
-
margin: "50%",
|
|
8190
|
-
target: false,
|
|
8191
|
-
loading: "lazy"
|
|
8192
|
-
},
|
|
8193
|
-
connected() {
|
|
8194
|
-
if (this.loading !== "lazy") {
|
|
8195
|
-
this.load();
|
|
8196
|
-
} else if (isImg(this.$el)) {
|
|
8197
|
-
this.$el.loading = "lazy";
|
|
8198
|
-
setSrcAttrs(this.$el);
|
|
8199
|
-
}
|
|
8200
|
-
},
|
|
8201
|
-
disconnected() {
|
|
8202
|
-
if (this.img) {
|
|
8203
|
-
this.img.onload = "";
|
|
8204
|
-
}
|
|
8205
|
-
delete this.img;
|
|
8206
|
-
},
|
|
8207
|
-
observe: intersection({
|
|
8208
|
-
handler(entries, observer) {
|
|
8209
|
-
this.load();
|
|
8210
|
-
observer.disconnect();
|
|
8211
|
-
},
|
|
8212
|
-
options: ({ margin }) => ({ rootMargin: margin }),
|
|
8213
|
-
filter: ({ loading }) => loading === "lazy",
|
|
8214
|
-
target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
|
|
8215
|
-
}),
|
|
8216
|
-
methods: {
|
|
8217
|
-
load() {
|
|
8218
|
-
if (this.img) {
|
|
8219
|
-
return this.img;
|
|
8220
|
-
}
|
|
8221
|
-
const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);
|
|
8222
|
-
removeAttr(image, "loading");
|
|
8223
|
-
setSrcAttrs(this.$el, image.currentSrc);
|
|
8224
|
-
return this.img = image;
|
|
8225
|
-
}
|
|
8226
|
-
}
|
|
8227
|
-
};
|
|
8228
|
-
function setSrcAttrs(el, src) {
|
|
8229
|
-
if (isImg(el)) {
|
|
8230
|
-
const parentNode = parent(el);
|
|
8231
|
-
const elements = isTag(parentNode, "picture") ? children(parentNode) : [el];
|
|
8232
|
-
elements.forEach((el2) => setSourceProps(el2, el2));
|
|
8233
|
-
} else if (src) {
|
|
8234
|
-
const change = !includes(el.style.backgroundImage, src);
|
|
8235
|
-
if (change) {
|
|
8236
|
-
css(el, "backgroundImage", `url(${escape(src)})`);
|
|
8237
|
-
trigger(el, createEvent("load", false));
|
|
8238
|
-
}
|
|
8239
|
-
}
|
|
8240
|
-
}
|
|
8241
|
-
const srcProps = ["data-src", "data-srcset", "sizes"];
|
|
8242
|
-
function setSourceProps(sourceEl, targetEl) {
|
|
8243
|
-
for (const prop of srcProps) {
|
|
8244
|
-
const value = data(sourceEl, prop);
|
|
8245
|
-
if (value) {
|
|
8246
|
-
attr(targetEl, prop.replace(/^(data-)+/, ""), value);
|
|
8247
|
-
}
|
|
8248
|
-
}
|
|
8249
|
-
}
|
|
8250
|
-
function getImageFromElement(el, src, sources) {
|
|
8251
|
-
const img = new Image();
|
|
8252
|
-
wrapInPicture(img, sources);
|
|
8253
|
-
setSourceProps(el, img);
|
|
8254
|
-
img.onload = () => {
|
|
8255
|
-
setSrcAttrs(el, img.currentSrc);
|
|
8256
|
-
};
|
|
8257
|
-
attr(img, "src", src);
|
|
8258
|
-
return img;
|
|
8259
|
-
}
|
|
8260
|
-
function wrapInPicture(img, sources) {
|
|
8261
|
-
sources = parseSources(sources);
|
|
8262
|
-
if (sources.length) {
|
|
8263
|
-
const picture = fragment("<picture>");
|
|
8264
|
-
for (const attrs of sources) {
|
|
8265
|
-
const source = fragment("<source>");
|
|
8266
|
-
attr(source, attrs);
|
|
8267
|
-
append(picture, source);
|
|
8268
|
-
}
|
|
8269
|
-
append(picture, img);
|
|
8270
|
-
}
|
|
8271
|
-
}
|
|
8272
|
-
function parseSources(sources) {
|
|
8273
|
-
if (!sources) {
|
|
8274
|
-
return [];
|
|
8275
|
-
}
|
|
8276
|
-
if (startsWith(sources, "[")) {
|
|
8277
|
-
try {
|
|
8278
|
-
sources = JSON.parse(sources);
|
|
8279
|
-
} catch (e) {
|
|
8280
|
-
sources = [];
|
|
8281
|
-
}
|
|
8282
|
-
} else {
|
|
8283
|
-
sources = parseOptions(sources);
|
|
8284
|
-
}
|
|
8285
|
-
if (!isArray(sources)) {
|
|
8286
|
-
sources = [sources];
|
|
8287
|
-
}
|
|
8288
|
-
return sources.filter((source) => !isEmpty(source));
|
|
8289
|
-
}
|
|
8290
|
-
function isImg(el) {
|
|
8291
|
-
return isTag(el, "img");
|
|
8292
|
-
}
|
|
8293
|
-
|
|
8294
8303
|
var inverse = {
|
|
8295
8304
|
props: {
|
|
8296
8305
|
target: String,
|
|
@@ -8605,7 +8614,10 @@
|
|
|
8605
8614
|
{
|
|
8606
8615
|
name: "hide",
|
|
8607
8616
|
el: ({ dropContainer }) => dropContainer,
|
|
8608
|
-
async handler() {
|
|
8617
|
+
async handler(e) {
|
|
8618
|
+
if (parent(e.target) !== this.dropContainer) {
|
|
8619
|
+
return;
|
|
8620
|
+
}
|
|
8609
8621
|
await awaitMacroTask();
|
|
8610
8622
|
if (!this.getActive() && this._transparent) {
|
|
8611
8623
|
addClass(this.navbarContainer, clsNavbarTransparent);
|
|
@@ -8994,7 +9006,7 @@
|
|
|
8994
9006
|
update: [
|
|
8995
9007
|
{
|
|
8996
9008
|
read() {
|
|
8997
|
-
const targets = this.links.map((el) => getTargetedElement(el)
|
|
9009
|
+
const targets = this.links.map((el) => getTargetedElement(el)).filter(Boolean);
|
|
8998
9010
|
const { length } = targets;
|
|
8999
9011
|
if (!length || !isVisible(this.$el)) {
|
|
9000
9012
|
return false;
|
|
@@ -9393,6 +9405,104 @@
|
|
|
9393
9405
|
}
|
|
9394
9406
|
}
|
|
9395
9407
|
|
|
9408
|
+
var svg = {
|
|
9409
|
+
mixins: [Svg],
|
|
9410
|
+
args: "src",
|
|
9411
|
+
props: {
|
|
9412
|
+
src: String,
|
|
9413
|
+
icon: String,
|
|
9414
|
+
attributes: "list",
|
|
9415
|
+
strokeAnimation: Boolean
|
|
9416
|
+
},
|
|
9417
|
+
data: {
|
|
9418
|
+
strokeAnimation: false
|
|
9419
|
+
},
|
|
9420
|
+
observe: [
|
|
9421
|
+
mutation({
|
|
9422
|
+
async handler() {
|
|
9423
|
+
const svg = await this.svg;
|
|
9424
|
+
if (svg) {
|
|
9425
|
+
applyAttributes.call(this, svg);
|
|
9426
|
+
}
|
|
9427
|
+
},
|
|
9428
|
+
options: {
|
|
9429
|
+
attributes: true,
|
|
9430
|
+
attributeFilter: ["id", "class", "style"]
|
|
9431
|
+
}
|
|
9432
|
+
})
|
|
9433
|
+
],
|
|
9434
|
+
async connected() {
|
|
9435
|
+
if (includes(this.src, "#")) {
|
|
9436
|
+
[this.src, this.icon] = this.src.split("#");
|
|
9437
|
+
}
|
|
9438
|
+
const svg = await this.svg;
|
|
9439
|
+
if (svg) {
|
|
9440
|
+
applyAttributes.call(this, svg);
|
|
9441
|
+
if (this.strokeAnimation) {
|
|
9442
|
+
applyAnimation(svg);
|
|
9443
|
+
}
|
|
9444
|
+
}
|
|
9445
|
+
},
|
|
9446
|
+
methods: {
|
|
9447
|
+
async getSvg() {
|
|
9448
|
+
if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
|
|
9449
|
+
await new Promise((resolve) => once(this.$el, "load", resolve));
|
|
9450
|
+
}
|
|
9451
|
+
return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
|
|
9452
|
+
}
|
|
9453
|
+
}
|
|
9454
|
+
};
|
|
9455
|
+
function applyAttributes(el) {
|
|
9456
|
+
const { $el } = this;
|
|
9457
|
+
addClass(el, attr($el, "class"), "uk-svg");
|
|
9458
|
+
for (let i = 0; i < $el.style.length; i++) {
|
|
9459
|
+
const prop = $el.style[i];
|
|
9460
|
+
css(el, prop, css($el, prop));
|
|
9461
|
+
}
|
|
9462
|
+
for (const attribute in this.attributes) {
|
|
9463
|
+
const [prop, value] = this.attributes[attribute].split(":", 2);
|
|
9464
|
+
attr(el, prop, value);
|
|
9465
|
+
}
|
|
9466
|
+
if (!this.$el.id) {
|
|
9467
|
+
removeAttr(el, "id");
|
|
9468
|
+
}
|
|
9469
|
+
}
|
|
9470
|
+
const loadSVG = memoize(async (src) => {
|
|
9471
|
+
if (src) {
|
|
9472
|
+
if (startsWith(src, "data:")) {
|
|
9473
|
+
return decodeURIComponent(src.split(",")[1]);
|
|
9474
|
+
} else {
|
|
9475
|
+
const response = await fetch(src);
|
|
9476
|
+
if (response.headers.get("Content-Type") === "image/svg+xml") {
|
|
9477
|
+
return response.text();
|
|
9478
|
+
}
|
|
9479
|
+
}
|
|
9480
|
+
}
|
|
9481
|
+
return Promise.reject();
|
|
9482
|
+
});
|
|
9483
|
+
function parseSVG(svg, icon) {
|
|
9484
|
+
if (icon && includes(svg, "<symbol")) {
|
|
9485
|
+
svg = parseSymbols(svg)[icon] || svg;
|
|
9486
|
+
}
|
|
9487
|
+
return fragment(svg);
|
|
9488
|
+
}
|
|
9489
|
+
const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
|
|
9490
|
+
const parseSymbols = memoize(function(svg) {
|
|
9491
|
+
const symbols = {};
|
|
9492
|
+
symbolRe.lastIndex = 0;
|
|
9493
|
+
let match;
|
|
9494
|
+
while (match = symbolRe.exec(svg)) {
|
|
9495
|
+
symbols[match[3]] = `<svg ${match[1]}svg>`;
|
|
9496
|
+
}
|
|
9497
|
+
return symbols;
|
|
9498
|
+
});
|
|
9499
|
+
function applyAnimation(el) {
|
|
9500
|
+
const length = getMaxPathLength(el);
|
|
9501
|
+
if (length) {
|
|
9502
|
+
css(el, "--uk-animation-stroke", length);
|
|
9503
|
+
}
|
|
9504
|
+
}
|
|
9505
|
+
|
|
9396
9506
|
const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
9397
9507
|
var Switcher = {
|
|
9398
9508
|
mixins: [Togglable],
|
|
@@ -9645,7 +9755,7 @@
|
|
|
9645
9755
|
name: `mouseenter mouseleave ${pointerEnter} ${pointerLeave} focus blur`,
|
|
9646
9756
|
filter: ({ mode }) => includes(mode, "hover"),
|
|
9647
9757
|
handler(e) {
|
|
9648
|
-
if (isTouch(e) || this.$el.disabled) {
|
|
9758
|
+
if (isTouch(e) || this.$el.disabled || document.readyState === "loading") {
|
|
9649
9759
|
return;
|
|
9650
9760
|
}
|
|
9651
9761
|
const show = includes(["mouseenter", pointerEnter, "focus"], e.type);
|