uikit 3.21.17 → 3.21.18-dev.27bfd7d2b
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 +32 -0
- package/dist/css/uikit-core-rtl.css +243 -69
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +243 -69
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +247 -65
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +247 -65
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +13 -8
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +334 -103
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +351 -108
- 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 +1 -1
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +1 -1
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +3 -7
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +1 -1
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +3 -7
- 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 +7 -2
- 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 +92 -93
- 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 +379 -262
- package/dist/js/uikit.min.js +1 -1
- package/package.json +3 -3
- 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/components/countdown.js +10 -5
- package/src/js/components/lightbox-panel.js +181 -45
- package/src/js/components/lightbox.js +59 -6
- package/src/js/core/img.js +3 -5
- package/src/js/core/navbar.js +3 -6
- package/src/js/mixin/modal.js +1 -4
- package/src/js/mixin/slider-drag.js +3 -6
- package/src/js/mixin/slider-nav.js +1 -1
- package/src/js/mixin/togglable.js +7 -2
- package/src/js/util/dom.js +3 -1
- 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/subnav.less +8 -0
- package/src/less/components/text.less +11 -0
- package/src/less/components/totop.less +1 -1
- package/src/less/components/utility.less +2 -1
- package/src/less/components/visibility.less +2 -1
- package/src/less/theme/form-range.less +20 -8
- package/src/less/theme/lightbox.less +2 -20
- package/src/less/theme/search.less +24 -10
- 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/subnav.scss +7 -0
- package/src/scss/components/text.scss +10 -0
- package/src/scss/components/totop.scss +1 -1
- package/src/scss/components/utility.scss +1 -1
- package/src/scss/components/visibility.scss +2 -1
- package/src/scss/mixins-theme.scss +51 -12
- package/src/scss/mixins.scss +45 -6
- package/src/scss/theme/form-range.scss +14 -4
- package/src/scss/theme/lightbox.scss +2 -20
- package/src/scss/theme/search.scss +10 -6
- package/src/scss/variables-theme.scss +36 -21
- package/src/scss/variables.scss +32 -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/countdown.html +6 -0
- 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 +273 -273
- package/tests/offcanvas.html +27 -27
- package/tests/placeholder.html +2 -2
- package/tests/sortable.html +5 -5
- package/tests/sticky-navbar.html +114 -114
- package/tests/sticky.html +1 -1
- package/tests/text.html +8 -0
package/dist/js/uikit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.21.
|
|
1
|
+
/*! UIkit 3.21.18-dev.27bfd7d2b | https://www.getuikit.com | (c) 2014 - 2025 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -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) {
|
|
@@ -1686,17 +1688,19 @@
|
|
|
1686
1688
|
props: {
|
|
1687
1689
|
date: String,
|
|
1688
1690
|
clsWrapper: String,
|
|
1689
|
-
role: String
|
|
1691
|
+
role: String,
|
|
1692
|
+
reload: Boolean
|
|
1690
1693
|
},
|
|
1691
1694
|
data: {
|
|
1692
1695
|
date: "",
|
|
1693
1696
|
clsWrapper: ".uk-countdown-%unit%",
|
|
1694
|
-
role: "timer"
|
|
1697
|
+
role: "timer",
|
|
1698
|
+
reload: false
|
|
1695
1699
|
},
|
|
1696
1700
|
connected() {
|
|
1697
1701
|
attr(this.$el, "role", this.role);
|
|
1698
1702
|
this.date = toFloat(Date.parse(this.$props.date));
|
|
1699
|
-
this.end = false;
|
|
1703
|
+
this.started = this.end = false;
|
|
1700
1704
|
this.start();
|
|
1701
1705
|
},
|
|
1702
1706
|
disconnected() {
|
|
@@ -1717,10 +1721,6 @@
|
|
|
1717
1721
|
start() {
|
|
1718
1722
|
this.stop();
|
|
1719
1723
|
this.update();
|
|
1720
|
-
if (!this.timer) {
|
|
1721
|
-
trigger(this.$el, "countdownstart");
|
|
1722
|
-
this.timer = setInterval(this.update, 1e3);
|
|
1723
|
-
}
|
|
1724
1724
|
},
|
|
1725
1725
|
stop() {
|
|
1726
1726
|
if (this.timer) {
|
|
@@ -1736,7 +1736,14 @@
|
|
|
1736
1736
|
if (!this.end) {
|
|
1737
1737
|
trigger(this.$el, "countdownend");
|
|
1738
1738
|
this.end = true;
|
|
1739
|
+
if (this.reload && this.started) {
|
|
1740
|
+
window.location.reload();
|
|
1741
|
+
}
|
|
1739
1742
|
}
|
|
1743
|
+
} else if (!this.timer) {
|
|
1744
|
+
this.started = true;
|
|
1745
|
+
trigger(this.$el, "countdownstart");
|
|
1746
|
+
this.timer = setInterval(this.update, 1e3);
|
|
1740
1747
|
}
|
|
1741
1748
|
for (const unit of units) {
|
|
1742
1749
|
const el = $(this.clsWrapper.replace("%unit%", unit), this.$el);
|
|
@@ -2442,6 +2449,121 @@
|
|
|
2442
2449
|
return $("a,button", el) || el;
|
|
2443
2450
|
}
|
|
2444
2451
|
|
|
2452
|
+
var img = {
|
|
2453
|
+
args: "dataSrc",
|
|
2454
|
+
props: {
|
|
2455
|
+
dataSrc: String,
|
|
2456
|
+
sources: String,
|
|
2457
|
+
margin: String,
|
|
2458
|
+
target: String,
|
|
2459
|
+
loading: String
|
|
2460
|
+
},
|
|
2461
|
+
data: {
|
|
2462
|
+
dataSrc: "",
|
|
2463
|
+
sources: false,
|
|
2464
|
+
margin: "50%",
|
|
2465
|
+
target: false,
|
|
2466
|
+
loading: "lazy"
|
|
2467
|
+
},
|
|
2468
|
+
connected() {
|
|
2469
|
+
if (this.loading !== "lazy") {
|
|
2470
|
+
this.load();
|
|
2471
|
+
} else if (isImg(this.$el)) {
|
|
2472
|
+
this.$el.loading = "lazy";
|
|
2473
|
+
setSrcAttrs(this.$el);
|
|
2474
|
+
}
|
|
2475
|
+
},
|
|
2476
|
+
disconnected() {
|
|
2477
|
+
if (this.img) {
|
|
2478
|
+
this.img.onload = "";
|
|
2479
|
+
}
|
|
2480
|
+
delete this.img;
|
|
2481
|
+
},
|
|
2482
|
+
observe: intersection({
|
|
2483
|
+
handler(entries, observer) {
|
|
2484
|
+
this.load();
|
|
2485
|
+
observer.disconnect();
|
|
2486
|
+
},
|
|
2487
|
+
options: ({ margin }) => ({ rootMargin: margin }),
|
|
2488
|
+
filter: ({ loading }) => loading === "lazy",
|
|
2489
|
+
target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
|
|
2490
|
+
}),
|
|
2491
|
+
methods: {
|
|
2492
|
+
load() {
|
|
2493
|
+
if (this.img) {
|
|
2494
|
+
return this.img;
|
|
2495
|
+
}
|
|
2496
|
+
const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);
|
|
2497
|
+
removeAttr(image, "loading");
|
|
2498
|
+
setSrcAttrs(this.$el, image.currentSrc);
|
|
2499
|
+
return this.img = image;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
};
|
|
2503
|
+
function setSrcAttrs(el, src) {
|
|
2504
|
+
if (isImg(el)) {
|
|
2505
|
+
const parentNode = parent(el);
|
|
2506
|
+
const elements = isTag(parentNode, "picture") ? children(parentNode) : [el];
|
|
2507
|
+
elements.forEach((el2) => setSourceProps(el2, el2));
|
|
2508
|
+
} else if (src) {
|
|
2509
|
+
const change = !includes(el.style.backgroundImage, src);
|
|
2510
|
+
if (change) {
|
|
2511
|
+
css(el, "backgroundImage", `url(${escape(src)})`);
|
|
2512
|
+
trigger(el, createEvent("load", false));
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
const srcProps = ["data-src", "data-srcset", "sizes"];
|
|
2517
|
+
function setSourceProps(sourceEl, targetEl) {
|
|
2518
|
+
for (const prop of srcProps) {
|
|
2519
|
+
const value = data(sourceEl, prop);
|
|
2520
|
+
if (value) {
|
|
2521
|
+
attr(targetEl, prop.replace(/data-/g, ""), value);
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
function getImageFromElement(el, src, sources) {
|
|
2526
|
+
const img = new Image();
|
|
2527
|
+
wrapInPicture(img, sources);
|
|
2528
|
+
setSourceProps(el, img);
|
|
2529
|
+
img.onload = () => setSrcAttrs(el, img.currentSrc);
|
|
2530
|
+
attr(img, "src", src);
|
|
2531
|
+
return img;
|
|
2532
|
+
}
|
|
2533
|
+
function wrapInPicture(img, sources) {
|
|
2534
|
+
sources = parseSources(sources);
|
|
2535
|
+
if (sources.length) {
|
|
2536
|
+
const picture = fragment("<picture>");
|
|
2537
|
+
for (const attrs of sources) {
|
|
2538
|
+
const source = fragment("<source>");
|
|
2539
|
+
attr(source, attrs);
|
|
2540
|
+
append(picture, source);
|
|
2541
|
+
}
|
|
2542
|
+
append(picture, img);
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
function parseSources(sources) {
|
|
2546
|
+
if (!sources) {
|
|
2547
|
+
return [];
|
|
2548
|
+
}
|
|
2549
|
+
if (startsWith(sources, "[")) {
|
|
2550
|
+
try {
|
|
2551
|
+
sources = JSON.parse(sources);
|
|
2552
|
+
} catch (e) {
|
|
2553
|
+
sources = [];
|
|
2554
|
+
}
|
|
2555
|
+
} else {
|
|
2556
|
+
sources = parseOptions(sources);
|
|
2557
|
+
}
|
|
2558
|
+
if (!isArray(sources)) {
|
|
2559
|
+
sources = [sources];
|
|
2560
|
+
}
|
|
2561
|
+
return sources.filter((source) => !isEmpty(source));
|
|
2562
|
+
}
|
|
2563
|
+
function isImg(el) {
|
|
2564
|
+
return isTag(el, "img");
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2445
2567
|
let prevented;
|
|
2446
2568
|
function preventBackgroundScroll(el) {
|
|
2447
2569
|
const off = on(
|
|
@@ -2508,6 +2630,82 @@
|
|
|
2508
2630
|
}
|
|
2509
2631
|
};
|
|
2510
2632
|
|
|
2633
|
+
var Position = {
|
|
2634
|
+
props: {
|
|
2635
|
+
pos: String,
|
|
2636
|
+
offset: Boolean,
|
|
2637
|
+
flip: Boolean,
|
|
2638
|
+
shift: Boolean,
|
|
2639
|
+
inset: Boolean
|
|
2640
|
+
},
|
|
2641
|
+
data: {
|
|
2642
|
+
pos: `bottom-${isRtl ? "right" : "left"}`,
|
|
2643
|
+
offset: false,
|
|
2644
|
+
flip: true,
|
|
2645
|
+
shift: true,
|
|
2646
|
+
inset: false
|
|
2647
|
+
},
|
|
2648
|
+
connected() {
|
|
2649
|
+
this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
|
|
2650
|
+
[this.dir, this.align] = this.pos;
|
|
2651
|
+
this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
|
|
2652
|
+
},
|
|
2653
|
+
methods: {
|
|
2654
|
+
positionAt(element, target, boundary) {
|
|
2655
|
+
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
2656
|
+
const placement = [this.flip && "flip", this.shift && "shift"];
|
|
2657
|
+
const attach = {
|
|
2658
|
+
element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
|
|
2659
|
+
target: [this.dir, this.align]
|
|
2660
|
+
};
|
|
2661
|
+
if (this.axis === "y") {
|
|
2662
|
+
for (const prop in attach) {
|
|
2663
|
+
attach[prop].reverse();
|
|
2664
|
+
}
|
|
2665
|
+
offset.reverse();
|
|
2666
|
+
placement.reverse();
|
|
2667
|
+
}
|
|
2668
|
+
const restoreScrollPosition = storeScrollPosition(element);
|
|
2669
|
+
const elDim = dimensions$1(element);
|
|
2670
|
+
css(element, { top: -elDim.height, left: -elDim.width });
|
|
2671
|
+
positionAt(element, target, {
|
|
2672
|
+
attach,
|
|
2673
|
+
offset,
|
|
2674
|
+
boundary,
|
|
2675
|
+
placement,
|
|
2676
|
+
viewportOffset: this.getViewportOffset(element)
|
|
2677
|
+
});
|
|
2678
|
+
restoreScrollPosition();
|
|
2679
|
+
},
|
|
2680
|
+
getPositionOffset(element = this.$el) {
|
|
2681
|
+
return toPx(
|
|
2682
|
+
this.offset === false ? css(element, "--uk-position-offset") : this.offset,
|
|
2683
|
+
this.axis === "x" ? "width" : "height",
|
|
2684
|
+
element
|
|
2685
|
+
) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
|
|
2686
|
+
},
|
|
2687
|
+
getShiftOffset(element = this.$el) {
|
|
2688
|
+
return this.align === "center" ? 0 : toPx(
|
|
2689
|
+
css(element, "--uk-position-shift-offset"),
|
|
2690
|
+
this.axis === "y" ? "width" : "height",
|
|
2691
|
+
element
|
|
2692
|
+
) * (includes(["left", "top"], this.align) ? 1 : -1);
|
|
2693
|
+
},
|
|
2694
|
+
getViewportOffset(element) {
|
|
2695
|
+
return toPx(css(element, "--uk-position-viewport-offset"));
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
};
|
|
2699
|
+
function storeScrollPosition(element) {
|
|
2700
|
+
const scrollElement = scrollParent(element);
|
|
2701
|
+
const { scrollTop } = scrollElement;
|
|
2702
|
+
return () => {
|
|
2703
|
+
if (scrollTop !== scrollElement.scrollTop) {
|
|
2704
|
+
scrollElement.scrollTop = scrollTop;
|
|
2705
|
+
}
|
|
2706
|
+
};
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2511
2709
|
var Togglable = {
|
|
2512
2710
|
props: {
|
|
2513
2711
|
cls: Boolean,
|
|
@@ -2545,8 +2743,14 @@
|
|
|
2545
2743
|
addClass(el, cls);
|
|
2546
2744
|
trigger(el, show ? "show" : "hide", [this]);
|
|
2547
2745
|
const done = () => {
|
|
2746
|
+
var _a;
|
|
2548
2747
|
removeClass(el, cls);
|
|
2549
2748
|
trigger(el, show ? "shown" : "hidden", [this]);
|
|
2749
|
+
if (show) {
|
|
2750
|
+
const restoreScrollPosition = storeScrollPosition(el);
|
|
2751
|
+
(_a = $$("[autofocus]", el).find(isVisible)) == null ? void 0 : _a.focus();
|
|
2752
|
+
restoreScrollPosition();
|
|
2753
|
+
}
|
|
2550
2754
|
};
|
|
2551
2755
|
return promise ? promise.then(done, () => {
|
|
2552
2756
|
removeClass(el, cls);
|
|
@@ -2579,7 +2783,6 @@
|
|
|
2579
2783
|
if (changed) {
|
|
2580
2784
|
trigger(el, "toggled", [toggled, this]);
|
|
2581
2785
|
}
|
|
2582
|
-
$$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
|
|
2583
2786
|
}
|
|
2584
2787
|
}
|
|
2585
2788
|
};
|
|
@@ -2710,9 +2913,6 @@
|
|
|
2710
2913
|
panel: ({ selPanel }, $el) => $(selPanel, $el),
|
|
2711
2914
|
transitionElement() {
|
|
2712
2915
|
return this.panel;
|
|
2713
|
-
},
|
|
2714
|
-
bgClose({ bgClose }) {
|
|
2715
|
-
return bgClose && this.panel;
|
|
2716
2916
|
}
|
|
2717
2917
|
},
|
|
2718
2918
|
connected() {
|
|
@@ -2875,7 +3075,7 @@
|
|
|
2875
3075
|
}
|
|
2876
3076
|
function listenForBackgroundClose$1(modal) {
|
|
2877
3077
|
return on(document, pointerDown$1, ({ target }) => {
|
|
2878
|
-
if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {
|
|
3078
|
+
if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || !modal.panel || modal.panel.contains(target)) {
|
|
2879
3079
|
return;
|
|
2880
3080
|
}
|
|
2881
3081
|
once(
|
|
@@ -3052,7 +3252,6 @@
|
|
|
3052
3252
|
const pointerDown = "touchstart mousedown";
|
|
3053
3253
|
const pointerMove = "touchmove mousemove";
|
|
3054
3254
|
const pointerUp = "touchend touchcancel mouseup click input scroll";
|
|
3055
|
-
const preventClick = (e) => e.preventDefault();
|
|
3056
3255
|
var SliderDrag = {
|
|
3057
3256
|
props: {
|
|
3058
3257
|
draggable: Boolean
|
|
@@ -3120,9 +3319,6 @@
|
|
|
3120
3319
|
if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {
|
|
3121
3320
|
return;
|
|
3122
3321
|
}
|
|
3123
|
-
if (!this.dragging) {
|
|
3124
|
-
on(this.list, "click", preventClick, pointerOptions);
|
|
3125
|
-
}
|
|
3126
3322
|
e.cancelable && e.preventDefault();
|
|
3127
3323
|
this.dragging = true;
|
|
3128
3324
|
this.dir = distance < 0 ? 1 : -1;
|
|
@@ -3171,6 +3367,7 @@
|
|
|
3171
3367
|
off(document, pointerMove, this.move, pointerOptions);
|
|
3172
3368
|
off(document, pointerUp, this.end, pointerUpOptions);
|
|
3173
3369
|
if (this.dragging) {
|
|
3370
|
+
setTimeout(on(this.list, "click", (e) => e.preventDefault(), pointerOptions));
|
|
3174
3371
|
this.dragging = null;
|
|
3175
3372
|
if (this.index === this.prevIndex) {
|
|
3176
3373
|
this.percent = 1 - this.percent;
|
|
@@ -3191,7 +3388,6 @@
|
|
|
3191
3388
|
);
|
|
3192
3389
|
}
|
|
3193
3390
|
}
|
|
3194
|
-
setTimeout(() => off(this.list, "click", preventClick, pointerOptions));
|
|
3195
3391
|
css(this.list, { userSelect: "" });
|
|
3196
3392
|
this.drag = this.percent = null;
|
|
3197
3393
|
}
|
|
@@ -3525,7 +3721,7 @@
|
|
|
3525
3721
|
};
|
|
3526
3722
|
App.util = util;
|
|
3527
3723
|
App.options = {};
|
|
3528
|
-
App.version = "3.21.
|
|
3724
|
+
App.version = "3.21.18-dev.27bfd7d2b";
|
|
3529
3725
|
|
|
3530
3726
|
const PREFIX = "uk-";
|
|
3531
3727
|
const DATA = "__uikit__";
|
|
@@ -3830,7 +4026,7 @@
|
|
|
3830
4026
|
const item = toNumber(cmd);
|
|
3831
4027
|
const active = item === index;
|
|
3832
4028
|
toggleClass(el, this.clsActive, active);
|
|
3833
|
-
toggleClass(button, "uk-disabled", this.parallax);
|
|
4029
|
+
toggleClass(button, "uk-disabled", !!this.parallax);
|
|
3834
4030
|
attr(button, {
|
|
3835
4031
|
"aria-selected": active,
|
|
3836
4032
|
tabindex: active && !this.parallax ? null : -1
|
|
@@ -4171,34 +4367,67 @@
|
|
|
4171
4367
|
};
|
|
4172
4368
|
|
|
4173
4369
|
var LightboxPanel = {
|
|
4370
|
+
i18n: {
|
|
4371
|
+
counter: "%s / %s"
|
|
4372
|
+
},
|
|
4174
4373
|
mixins: [Modal, Slideshow],
|
|
4175
4374
|
functional: true,
|
|
4176
4375
|
props: {
|
|
4177
|
-
|
|
4376
|
+
counter: Boolean,
|
|
4178
4377
|
preload: Number,
|
|
4378
|
+
nav: Boolean,
|
|
4379
|
+
slidenav: Boolean,
|
|
4380
|
+
delayControls: Number,
|
|
4179
4381
|
videoAutoplay: Boolean,
|
|
4180
4382
|
template: String
|
|
4181
4383
|
},
|
|
4182
4384
|
data: () => ({
|
|
4385
|
+
counter: false,
|
|
4183
4386
|
preload: 1,
|
|
4184
|
-
|
|
4387
|
+
nav: false,
|
|
4388
|
+
slidenav: true,
|
|
4185
4389
|
delayControls: 3e3,
|
|
4390
|
+
videoAutoplay: false,
|
|
4186
4391
|
items: [],
|
|
4187
4392
|
cls: "uk-open",
|
|
4188
4393
|
clsPage: "uk-lightbox-page",
|
|
4189
|
-
|
|
4394
|
+
clsFit: "uk-lightbox-items-fit",
|
|
4395
|
+
clsZoom: "uk-lightbox-zoom",
|
|
4190
4396
|
attrItem: "uk-lightbox-item",
|
|
4397
|
+
selList: ".uk-lightbox-items",
|
|
4191
4398
|
selClose: ".uk-close-large",
|
|
4399
|
+
selNav: ".uk-lightbox-thumbnav, .uk-lightbox-dotnav",
|
|
4192
4400
|
selCaption: ".uk-lightbox-caption",
|
|
4401
|
+
selCounter: ".uk-lightbox-counter",
|
|
4193
4402
|
pauseOnHover: false,
|
|
4194
4403
|
velocity: 2,
|
|
4195
4404
|
Animations,
|
|
4196
|
-
template: `<div class="uk-lightbox uk-overflow-hidden"> <div class="uk-lightbox-items"></div> <div class="uk-
|
|
4405
|
+
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>`
|
|
4197
4406
|
}),
|
|
4198
4407
|
created() {
|
|
4199
|
-
|
|
4408
|
+
let $el = $(this.template);
|
|
4409
|
+
if (isTag($el, "template")) {
|
|
4410
|
+
$el = fragment(html($el));
|
|
4411
|
+
}
|
|
4200
4412
|
const list = $(this.selList, $el);
|
|
4201
|
-
|
|
4413
|
+
const navType = this.$props.nav;
|
|
4414
|
+
remove$1($$(this.selNav, $el).filter((el) => !matches(el, `.uk-${navType}`)));
|
|
4415
|
+
for (const [i, item] of this.items.entries()) {
|
|
4416
|
+
append(list, "<div>");
|
|
4417
|
+
if (navType === "thumbnav") {
|
|
4418
|
+
wrapAll(
|
|
4419
|
+
toThumbnavItem(item, this.videoAutoplay),
|
|
4420
|
+
append($(this.selNav, $el), `<li uk-lightbox-item="${i}"><a href></a></li>`)
|
|
4421
|
+
);
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
if (!this.slidenav) {
|
|
4425
|
+
remove$1($$(".uk-lightbox-slidenav", $el));
|
|
4426
|
+
}
|
|
4427
|
+
if (!this.counter) {
|
|
4428
|
+
remove$1($(this.selCounter, $el));
|
|
4429
|
+
}
|
|
4430
|
+
addClass(list, this.clsFit);
|
|
4202
4431
|
const close = $("[uk-close]", $el);
|
|
4203
4432
|
const closeLabel = this.t("close");
|
|
4204
4433
|
if (close && closeLabel) {
|
|
@@ -4208,21 +4437,33 @@
|
|
|
4208
4437
|
},
|
|
4209
4438
|
events: [
|
|
4210
4439
|
{
|
|
4211
|
-
name:
|
|
4212
|
-
|
|
4213
|
-
|
|
4440
|
+
name: "click",
|
|
4441
|
+
self: true,
|
|
4442
|
+
filter: ({ bgClose }) => bgClose,
|
|
4443
|
+
delegate: ({ selList }) => `${selList} > *`,
|
|
4444
|
+
handler(e) {
|
|
4445
|
+
if (!e.defaultPrevented) {
|
|
4446
|
+
this.hide();
|
|
4447
|
+
}
|
|
4214
4448
|
}
|
|
4215
4449
|
},
|
|
4216
4450
|
{
|
|
4217
4451
|
name: "click",
|
|
4218
4452
|
self: true,
|
|
4219
|
-
delegate: ({
|
|
4453
|
+
delegate: ({ clsZoom }) => `.${clsZoom}`,
|
|
4220
4454
|
handler(e) {
|
|
4221
4455
|
if (!e.defaultPrevented) {
|
|
4222
|
-
this.
|
|
4456
|
+
toggleClass(this.list, this.clsFit);
|
|
4223
4457
|
}
|
|
4224
4458
|
}
|
|
4225
4459
|
},
|
|
4460
|
+
{
|
|
4461
|
+
name: `${pointerMove$1} ${pointerDown$1} keydown`,
|
|
4462
|
+
filter: ({ delayControls }) => delayControls,
|
|
4463
|
+
handler() {
|
|
4464
|
+
this.showControls();
|
|
4465
|
+
}
|
|
4466
|
+
},
|
|
4226
4467
|
{
|
|
4227
4468
|
name: "shown",
|
|
4228
4469
|
self: true,
|
|
@@ -4271,26 +4512,25 @@
|
|
|
4271
4512
|
{
|
|
4272
4513
|
name: "beforeitemshow",
|
|
4273
4514
|
handler(e) {
|
|
4515
|
+
html($(this.selCaption, this.$el), this.getItem().caption || "");
|
|
4516
|
+
html(
|
|
4517
|
+
$(this.selCounter, this.$el),
|
|
4518
|
+
this.t("counter", this.index + 1, this.slides.length)
|
|
4519
|
+
);
|
|
4520
|
+
for (let j = -this.preload; j <= this.preload; j++) {
|
|
4521
|
+
this.loadItem(this.index + j);
|
|
4522
|
+
}
|
|
4274
4523
|
if (this.isToggled()) {
|
|
4275
4524
|
return;
|
|
4276
4525
|
}
|
|
4277
4526
|
this.draggable = false;
|
|
4278
4527
|
e.preventDefault();
|
|
4279
4528
|
this.toggleElement(this.$el, true, false);
|
|
4280
|
-
this.animation = Animations
|
|
4529
|
+
this.animation = Animations.scale;
|
|
4281
4530
|
removeClass(e.target, this.clsActive);
|
|
4282
4531
|
this.stack.splice(1, 0, this.index);
|
|
4283
4532
|
}
|
|
4284
4533
|
},
|
|
4285
|
-
{
|
|
4286
|
-
name: "itemshow",
|
|
4287
|
-
handler() {
|
|
4288
|
-
html($(this.selCaption, this.$el), this.getItem().caption || "");
|
|
4289
|
-
for (let j = -this.preload; j <= this.preload; j++) {
|
|
4290
|
-
this.loadItem(this.index + j);
|
|
4291
|
-
}
|
|
4292
|
-
}
|
|
4293
|
-
},
|
|
4294
4534
|
{
|
|
4295
4535
|
name: "itemshown",
|
|
4296
4536
|
handler() {
|
|
@@ -4300,29 +4540,37 @@
|
|
|
4300
4540
|
{
|
|
4301
4541
|
name: "itemload",
|
|
4302
4542
|
async handler(_, item) {
|
|
4303
|
-
const { source: src, type,
|
|
4304
|
-
this.setItem(item, "<span uk-spinner></span>");
|
|
4543
|
+
const { source: src, type, attrs = {} } = item;
|
|
4544
|
+
this.setItem(item, "<span uk-spinner uk-inverse></span>");
|
|
4305
4545
|
if (!src) {
|
|
4306
4546
|
return;
|
|
4307
4547
|
}
|
|
4308
|
-
let
|
|
4548
|
+
let matches2;
|
|
4309
4549
|
const iframeAttrs = {
|
|
4310
4550
|
allowfullscreen: "",
|
|
4311
4551
|
style: "max-width: 100%; box-sizing: border-box;",
|
|
4312
4552
|
"uk-responsive": "",
|
|
4313
|
-
"uk-video": `${this.videoAutoplay}`
|
|
4553
|
+
"uk-video": `${Boolean(this.videoAutoplay)}`
|
|
4314
4554
|
};
|
|
4315
|
-
if (type === "image" || src
|
|
4316
|
-
const img = createEl("img"
|
|
4317
|
-
|
|
4555
|
+
if (type === "image" || isImage(src)) {
|
|
4556
|
+
const img = createEl("img");
|
|
4557
|
+
wrapInPicture(img, item.sources);
|
|
4558
|
+
attr(img, {
|
|
4559
|
+
src,
|
|
4560
|
+
...pick(item, ["alt", "srcset", "sizes"]),
|
|
4561
|
+
...attrs
|
|
4562
|
+
});
|
|
4563
|
+
on(img, "load", () => this.setItem(item, parent(img) || img));
|
|
4318
4564
|
on(img, "error", () => this.setError(item));
|
|
4319
|
-
} else if (type === "video" || src
|
|
4565
|
+
} else if (type === "video" || isVideo(src)) {
|
|
4566
|
+
const inline = this.videoAutoplay === "inline";
|
|
4320
4567
|
const video = createEl("video", {
|
|
4321
4568
|
src,
|
|
4322
|
-
poster,
|
|
4323
|
-
controls: "",
|
|
4324
4569
|
playsinline: "",
|
|
4325
|
-
"
|
|
4570
|
+
controls: inline ? null : "",
|
|
4571
|
+
loop: inline ? "" : null,
|
|
4572
|
+
poster: this.videoAutoplay ? null : item.poster,
|
|
4573
|
+
"uk-video": inline ? "automute: true" : Boolean(this.videoAutoplay),
|
|
4326
4574
|
...attrs
|
|
4327
4575
|
});
|
|
4328
4576
|
on(video, "loadedmetadata", () => this.setItem(item, video));
|
|
@@ -4337,20 +4585,20 @@
|
|
|
4337
4585
|
...attrs
|
|
4338
4586
|
})
|
|
4339
4587
|
);
|
|
4340
|
-
} else if (
|
|
4588
|
+
} else if (matches2 = src.match(
|
|
4341
4589
|
/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/
|
|
4342
4590
|
)) {
|
|
4343
4591
|
this.setItem(
|
|
4344
4592
|
item,
|
|
4345
4593
|
createEl("iframe", {
|
|
4346
|
-
src: `https://www.youtube${
|
|
4594
|
+
src: `https://www.youtube${matches2[1] || ""}.com/embed/${matches2[2]}${matches2[3] ? `?${matches2[3]}` : ""}`,
|
|
4347
4595
|
width: 1920,
|
|
4348
4596
|
height: 1080,
|
|
4349
4597
|
...iframeAttrs,
|
|
4350
4598
|
...attrs
|
|
4351
4599
|
})
|
|
4352
4600
|
);
|
|
4353
|
-
} else if (
|
|
4601
|
+
} else if (matches2 = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
|
|
4354
4602
|
try {
|
|
4355
4603
|
const { height, width } = await (await fetch(
|
|
4356
4604
|
`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
|
|
@@ -4361,7 +4609,7 @@
|
|
|
4361
4609
|
this.setItem(
|
|
4362
4610
|
item,
|
|
4363
4611
|
createEl("iframe", {
|
|
4364
|
-
src: `https://player.vimeo.com/video/${
|
|
4612
|
+
src: `https://player.vimeo.com/video/${matches2[1]}${matches2[2] ? `?${matches2[2]}` : ""}`,
|
|
4365
4613
|
width,
|
|
4366
4614
|
height,
|
|
4367
4615
|
...iframeAttrs,
|
|
@@ -4373,8 +4621,29 @@
|
|
|
4373
4621
|
}
|
|
4374
4622
|
}
|
|
4375
4623
|
}
|
|
4624
|
+
},
|
|
4625
|
+
{
|
|
4626
|
+
name: "itemloaded",
|
|
4627
|
+
handler() {
|
|
4628
|
+
this.$emit("resize");
|
|
4629
|
+
}
|
|
4376
4630
|
}
|
|
4377
4631
|
],
|
|
4632
|
+
update: {
|
|
4633
|
+
read() {
|
|
4634
|
+
for (const media of $$(`${this.selList} :not([controls]):is(img,video)`, this.$el)) {
|
|
4635
|
+
toggleClass(
|
|
4636
|
+
media,
|
|
4637
|
+
this.clsZoom,
|
|
4638
|
+
(media.naturalHeight || media.videoHeight) - this.$el.offsetHeight > Math.max(
|
|
4639
|
+
0,
|
|
4640
|
+
(media.naturalWidth || media.videoWidth) - this.$el.offsetWidth
|
|
4641
|
+
)
|
|
4642
|
+
);
|
|
4643
|
+
}
|
|
4644
|
+
},
|
|
4645
|
+
events: ["resize"]
|
|
4646
|
+
},
|
|
4378
4647
|
methods: {
|
|
4379
4648
|
loadItem(index = this.index) {
|
|
4380
4649
|
const item = this.getItem(index);
|
|
@@ -4392,11 +4661,11 @@
|
|
|
4392
4661
|
return this.slides[this.items.indexOf(item)];
|
|
4393
4662
|
},
|
|
4394
4663
|
setError(item) {
|
|
4395
|
-
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2"></span>');
|
|
4664
|
+
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2" uk-inverse></span>');
|
|
4396
4665
|
},
|
|
4397
4666
|
showControls() {
|
|
4398
4667
|
clearTimeout(this.controlsTimer);
|
|
4399
|
-
this.controlsTimer = setTimeout(this.hideControls, this.delayControls);
|
|
4668
|
+
this.controlsTimer = this.delayControls && setTimeout(this.hideControls, this.delayControls);
|
|
4400
4669
|
addClass(this.$el, "uk-active", "uk-transition-active");
|
|
4401
4670
|
},
|
|
4402
4671
|
hideControls() {
|
|
@@ -4409,7 +4678,26 @@
|
|
|
4409
4678
|
attr(el, attrs);
|
|
4410
4679
|
return el;
|
|
4411
4680
|
}
|
|
4681
|
+
function toThumbnavItem(item, videoAutoplay) {
|
|
4682
|
+
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", {
|
|
4683
|
+
src: item.thumb,
|
|
4684
|
+
loop: "",
|
|
4685
|
+
playsinline: "",
|
|
4686
|
+
"uk-video": `autoplay: ${Boolean(videoAutoplay)}; automute: true`
|
|
4687
|
+
}) : createEl("canvas");
|
|
4688
|
+
if (item.thumbRatio) {
|
|
4689
|
+
el.style.aspectRatio = item.thumbRatio;
|
|
4690
|
+
}
|
|
4691
|
+
return el;
|
|
4692
|
+
}
|
|
4693
|
+
function isImage(src) {
|
|
4694
|
+
return src == null ? void 0 : src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i);
|
|
4695
|
+
}
|
|
4696
|
+
function isVideo(src) {
|
|
4697
|
+
return src == null ? void 0 : src.match(/\.(mp4|webm|ogv)($|\?)/i);
|
|
4698
|
+
}
|
|
4412
4699
|
|
|
4700
|
+
const selDisabled$1 = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
4413
4701
|
var lightbox = {
|
|
4414
4702
|
install: install$3,
|
|
4415
4703
|
props: { toggle: String },
|
|
@@ -4432,17 +4720,23 @@
|
|
|
4432
4720
|
},
|
|
4433
4721
|
events: {
|
|
4434
4722
|
name: "click",
|
|
4435
|
-
delegate: ({ toggle }) =>
|
|
4723
|
+
delegate: ({ toggle }) => toggle,
|
|
4436
4724
|
handler(e) {
|
|
4437
4725
|
if (!e.defaultPrevented) {
|
|
4438
4726
|
e.preventDefault();
|
|
4439
|
-
|
|
4727
|
+
if (!matches(e.current, selDisabled$1)) {
|
|
4728
|
+
this.show(e.current);
|
|
4729
|
+
}
|
|
4440
4730
|
}
|
|
4441
4731
|
}
|
|
4442
4732
|
},
|
|
4443
4733
|
methods: {
|
|
4444
4734
|
show(index) {
|
|
4445
|
-
|
|
4735
|
+
let items = this.toggles.map(toItem);
|
|
4736
|
+
if (this.nav === "thumbnav") {
|
|
4737
|
+
ensureThumb.call(this, this.toggles, items);
|
|
4738
|
+
}
|
|
4739
|
+
items = uniqueBy(items, "source");
|
|
4446
4740
|
if (isElement(index)) {
|
|
4447
4741
|
const { source } = toItem(index);
|
|
4448
4742
|
index = findIndex(items, ({ source: src }) => source === src);
|
|
@@ -4463,10 +4757,29 @@
|
|
|
4463
4757
|
}
|
|
4464
4758
|
assign(Lightbox.props, UIkit.component("lightboxPanel").options.props);
|
|
4465
4759
|
}
|
|
4760
|
+
function ensureThumb(toggles, items) {
|
|
4761
|
+
for (const [i, toggle] of Object.entries(toggles)) {
|
|
4762
|
+
if (items[i].thumb) {
|
|
4763
|
+
continue;
|
|
4764
|
+
}
|
|
4765
|
+
const parent = parents(toggle).reverse().concat(toggle).find(
|
|
4766
|
+
(parent2) => this.$el.contains(parent2) && (parent2 === toggle || $$(this.toggle, parent2).length === 1)
|
|
4767
|
+
);
|
|
4768
|
+
if (!parent) {
|
|
4769
|
+
continue;
|
|
4770
|
+
}
|
|
4771
|
+
const media = $("img,video", parent);
|
|
4772
|
+
if (media) {
|
|
4773
|
+
items[i].thumb = media.currentSrc || media.poster || media.src;
|
|
4774
|
+
items[i].thumbRatio = (media.naturalWidth || media.videoWidth) / (media.naturalHeight || media.videoHeight);
|
|
4775
|
+
}
|
|
4776
|
+
}
|
|
4777
|
+
}
|
|
4466
4778
|
function toItem(el) {
|
|
4467
4779
|
const item = {};
|
|
4468
|
-
for (const
|
|
4469
|
-
|
|
4780
|
+
for (const attribute of el.getAttributeNames()) {
|
|
4781
|
+
const key = attribute.replace(/^data-/, "");
|
|
4782
|
+
item[key === "href" ? "source" : key] = el.getAttribute(attribute);
|
|
4470
4783
|
}
|
|
4471
4784
|
item.attrs = parseOptions(item.attrs);
|
|
4472
4785
|
return item;
|
|
@@ -5917,82 +6230,6 @@
|
|
|
5917
6230
|
};
|
|
5918
6231
|
}
|
|
5919
6232
|
|
|
5920
|
-
var Position = {
|
|
5921
|
-
props: {
|
|
5922
|
-
pos: String,
|
|
5923
|
-
offset: Boolean,
|
|
5924
|
-
flip: Boolean,
|
|
5925
|
-
shift: Boolean,
|
|
5926
|
-
inset: Boolean
|
|
5927
|
-
},
|
|
5928
|
-
data: {
|
|
5929
|
-
pos: `bottom-${isRtl ? "right" : "left"}`,
|
|
5930
|
-
offset: false,
|
|
5931
|
-
flip: true,
|
|
5932
|
-
shift: true,
|
|
5933
|
-
inset: false
|
|
5934
|
-
},
|
|
5935
|
-
connected() {
|
|
5936
|
-
this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
|
|
5937
|
-
[this.dir, this.align] = this.pos;
|
|
5938
|
-
this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
|
|
5939
|
-
},
|
|
5940
|
-
methods: {
|
|
5941
|
-
positionAt(element, target, boundary) {
|
|
5942
|
-
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
5943
|
-
const placement = [this.flip && "flip", this.shift && "shift"];
|
|
5944
|
-
const attach = {
|
|
5945
|
-
element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
|
|
5946
|
-
target: [this.dir, this.align]
|
|
5947
|
-
};
|
|
5948
|
-
if (this.axis === "y") {
|
|
5949
|
-
for (const prop in attach) {
|
|
5950
|
-
attach[prop].reverse();
|
|
5951
|
-
}
|
|
5952
|
-
offset.reverse();
|
|
5953
|
-
placement.reverse();
|
|
5954
|
-
}
|
|
5955
|
-
const restoreScrollPosition = storeScrollPosition(element);
|
|
5956
|
-
const elDim = dimensions$1(element);
|
|
5957
|
-
css(element, { top: -elDim.height, left: -elDim.width });
|
|
5958
|
-
positionAt(element, target, {
|
|
5959
|
-
attach,
|
|
5960
|
-
offset,
|
|
5961
|
-
boundary,
|
|
5962
|
-
placement,
|
|
5963
|
-
viewportOffset: this.getViewportOffset(element)
|
|
5964
|
-
});
|
|
5965
|
-
restoreScrollPosition();
|
|
5966
|
-
},
|
|
5967
|
-
getPositionOffset(element = this.$el) {
|
|
5968
|
-
return toPx(
|
|
5969
|
-
this.offset === false ? css(element, "--uk-position-offset") : this.offset,
|
|
5970
|
-
this.axis === "x" ? "width" : "height",
|
|
5971
|
-
element
|
|
5972
|
-
) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
|
|
5973
|
-
},
|
|
5974
|
-
getShiftOffset(element = this.$el) {
|
|
5975
|
-
return this.align === "center" ? 0 : toPx(
|
|
5976
|
-
css(element, "--uk-position-shift-offset"),
|
|
5977
|
-
this.axis === "y" ? "width" : "height",
|
|
5978
|
-
element
|
|
5979
|
-
) * (includes(["left", "top"], this.align) ? 1 : -1);
|
|
5980
|
-
},
|
|
5981
|
-
getViewportOffset(element) {
|
|
5982
|
-
return toPx(css(element, "--uk-position-viewport-offset"));
|
|
5983
|
-
}
|
|
5984
|
-
}
|
|
5985
|
-
};
|
|
5986
|
-
function storeScrollPosition(element) {
|
|
5987
|
-
const scrollElement = scrollParent(element);
|
|
5988
|
-
const { scrollTop } = scrollElement;
|
|
5989
|
-
return () => {
|
|
5990
|
-
if (scrollTop !== scrollElement.scrollTop) {
|
|
5991
|
-
scrollElement.scrollTop = scrollTop;
|
|
5992
|
-
}
|
|
5993
|
-
};
|
|
5994
|
-
}
|
|
5995
|
-
|
|
5996
6233
|
var tooltip = {
|
|
5997
6234
|
mixins: [Container, Togglable, Position],
|
|
5998
6235
|
data: {
|
|
@@ -8085,123 +8322,6 @@
|
|
|
8085
8322
|
return isRtl ? swap(swap(icon, "left", "right"), "previous", "next") : icon;
|
|
8086
8323
|
}
|
|
8087
8324
|
|
|
8088
|
-
var img = {
|
|
8089
|
-
args: "dataSrc",
|
|
8090
|
-
props: {
|
|
8091
|
-
dataSrc: String,
|
|
8092
|
-
sources: String,
|
|
8093
|
-
margin: String,
|
|
8094
|
-
target: String,
|
|
8095
|
-
loading: String
|
|
8096
|
-
},
|
|
8097
|
-
data: {
|
|
8098
|
-
dataSrc: "",
|
|
8099
|
-
sources: false,
|
|
8100
|
-
margin: "50%",
|
|
8101
|
-
target: false,
|
|
8102
|
-
loading: "lazy"
|
|
8103
|
-
},
|
|
8104
|
-
connected() {
|
|
8105
|
-
if (this.loading !== "lazy") {
|
|
8106
|
-
this.load();
|
|
8107
|
-
} else if (isImg(this.$el)) {
|
|
8108
|
-
this.$el.loading = "lazy";
|
|
8109
|
-
setSrcAttrs(this.$el);
|
|
8110
|
-
}
|
|
8111
|
-
},
|
|
8112
|
-
disconnected() {
|
|
8113
|
-
if (this.img) {
|
|
8114
|
-
this.img.onload = "";
|
|
8115
|
-
}
|
|
8116
|
-
delete this.img;
|
|
8117
|
-
},
|
|
8118
|
-
observe: intersection({
|
|
8119
|
-
handler(entries, observer) {
|
|
8120
|
-
this.load();
|
|
8121
|
-
observer.disconnect();
|
|
8122
|
-
},
|
|
8123
|
-
options: ({ margin }) => ({ rootMargin: margin }),
|
|
8124
|
-
filter: ({ loading }) => loading === "lazy",
|
|
8125
|
-
target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
|
|
8126
|
-
}),
|
|
8127
|
-
methods: {
|
|
8128
|
-
load() {
|
|
8129
|
-
if (this.img) {
|
|
8130
|
-
return this.img;
|
|
8131
|
-
}
|
|
8132
|
-
const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);
|
|
8133
|
-
removeAttr(image, "loading");
|
|
8134
|
-
setSrcAttrs(this.$el, image.currentSrc);
|
|
8135
|
-
return this.img = image;
|
|
8136
|
-
}
|
|
8137
|
-
}
|
|
8138
|
-
};
|
|
8139
|
-
function setSrcAttrs(el, src) {
|
|
8140
|
-
if (isImg(el)) {
|
|
8141
|
-
const parentNode = parent(el);
|
|
8142
|
-
const elements = isTag(parentNode, "picture") ? children(parentNode) : [el];
|
|
8143
|
-
elements.forEach((el2) => setSourceProps(el2, el2));
|
|
8144
|
-
} else if (src) {
|
|
8145
|
-
const change = !includes(el.style.backgroundImage, src);
|
|
8146
|
-
if (change) {
|
|
8147
|
-
css(el, "backgroundImage", `url(${escape(src)})`);
|
|
8148
|
-
trigger(el, createEvent("load", false));
|
|
8149
|
-
}
|
|
8150
|
-
}
|
|
8151
|
-
}
|
|
8152
|
-
const srcProps = ["data-src", "data-srcset", "sizes"];
|
|
8153
|
-
function setSourceProps(sourceEl, targetEl) {
|
|
8154
|
-
for (const prop of srcProps) {
|
|
8155
|
-
const value = data(sourceEl, prop);
|
|
8156
|
-
if (value) {
|
|
8157
|
-
attr(targetEl, prop.replace(/^(data-)+/, ""), value);
|
|
8158
|
-
}
|
|
8159
|
-
}
|
|
8160
|
-
}
|
|
8161
|
-
function getImageFromElement(el, src, sources) {
|
|
8162
|
-
const img = new Image();
|
|
8163
|
-
wrapInPicture(img, sources);
|
|
8164
|
-
setSourceProps(el, img);
|
|
8165
|
-
img.onload = () => {
|
|
8166
|
-
setSrcAttrs(el, img.currentSrc);
|
|
8167
|
-
};
|
|
8168
|
-
attr(img, "src", src);
|
|
8169
|
-
return img;
|
|
8170
|
-
}
|
|
8171
|
-
function wrapInPicture(img, sources) {
|
|
8172
|
-
sources = parseSources(sources);
|
|
8173
|
-
if (sources.length) {
|
|
8174
|
-
const picture = fragment("<picture>");
|
|
8175
|
-
for (const attrs of sources) {
|
|
8176
|
-
const source = fragment("<source>");
|
|
8177
|
-
attr(source, attrs);
|
|
8178
|
-
append(picture, source);
|
|
8179
|
-
}
|
|
8180
|
-
append(picture, img);
|
|
8181
|
-
}
|
|
8182
|
-
}
|
|
8183
|
-
function parseSources(sources) {
|
|
8184
|
-
if (!sources) {
|
|
8185
|
-
return [];
|
|
8186
|
-
}
|
|
8187
|
-
if (startsWith(sources, "[")) {
|
|
8188
|
-
try {
|
|
8189
|
-
sources = JSON.parse(sources);
|
|
8190
|
-
} catch (e) {
|
|
8191
|
-
sources = [];
|
|
8192
|
-
}
|
|
8193
|
-
} else {
|
|
8194
|
-
sources = parseOptions(sources);
|
|
8195
|
-
}
|
|
8196
|
-
if (!isArray(sources)) {
|
|
8197
|
-
sources = [sources];
|
|
8198
|
-
}
|
|
8199
|
-
return sources.filter((source) => !isEmpty(source));
|
|
8200
|
-
}
|
|
8201
|
-
function isImg(el) {
|
|
8202
|
-
return isTag(el, "img");
|
|
8203
|
-
}
|
|
8204
|
-
|
|
8205
8325
|
var inverse = {
|
|
8206
8326
|
props: {
|
|
8207
8327
|
target: String,
|
|
@@ -8516,12 +8636,9 @@
|
|
|
8516
8636
|
{
|
|
8517
8637
|
name: "hide",
|
|
8518
8638
|
el: ({ dropContainer }) => dropContainer,
|
|
8519
|
-
async handler(
|
|
8520
|
-
if (!this.getDropdown(e.target)) {
|
|
8521
|
-
return;
|
|
8522
|
-
}
|
|
8639
|
+
async handler() {
|
|
8523
8640
|
await awaitMacroTask();
|
|
8524
|
-
if (
|
|
8641
|
+
if (this._transparent && (!active || !this.dropContainer.contains(active.$el))) {
|
|
8525
8642
|
addClass(this.navbarContainer, clsNavbarTransparent);
|
|
8526
8643
|
this._transparent = null;
|
|
8527
8644
|
}
|