uikit 3.21.17 → 3.21.18-dev.993e34374
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 +30 -0
- package/dist/css/uikit-core-rtl.css +237 -69
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +237 -69
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +241 -65
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +241 -65
- 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 +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 +367 -255
- 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/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/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/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 +35 -21
- package/src/scss/variables.scss +31 -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 +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/dist/js/uikit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.21.
|
|
1
|
+
/*! UIkit 3.21.18-dev.993e34374 | 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) {
|
|
@@ -2442,6 +2444,121 @@
|
|
|
2442
2444
|
return $("a,button", el) || el;
|
|
2443
2445
|
}
|
|
2444
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
|
+
|
|
2445
2562
|
let prevented;
|
|
2446
2563
|
function preventBackgroundScroll(el) {
|
|
2447
2564
|
const off = on(
|
|
@@ -2508,6 +2625,82 @@
|
|
|
2508
2625
|
}
|
|
2509
2626
|
};
|
|
2510
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
|
+
|
|
2511
2704
|
var Togglable = {
|
|
2512
2705
|
props: {
|
|
2513
2706
|
cls: Boolean,
|
|
@@ -2545,8 +2738,14 @@
|
|
|
2545
2738
|
addClass(el, cls);
|
|
2546
2739
|
trigger(el, show ? "show" : "hide", [this]);
|
|
2547
2740
|
const done = () => {
|
|
2741
|
+
var _a;
|
|
2548
2742
|
removeClass(el, cls);
|
|
2549
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
|
+
}
|
|
2550
2749
|
};
|
|
2551
2750
|
return promise ? promise.then(done, () => {
|
|
2552
2751
|
removeClass(el, cls);
|
|
@@ -2579,7 +2778,6 @@
|
|
|
2579
2778
|
if (changed) {
|
|
2580
2779
|
trigger(el, "toggled", [toggled, this]);
|
|
2581
2780
|
}
|
|
2582
|
-
$$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
|
|
2583
2781
|
}
|
|
2584
2782
|
}
|
|
2585
2783
|
};
|
|
@@ -2710,9 +2908,6 @@
|
|
|
2710
2908
|
panel: ({ selPanel }, $el) => $(selPanel, $el),
|
|
2711
2909
|
transitionElement() {
|
|
2712
2910
|
return this.panel;
|
|
2713
|
-
},
|
|
2714
|
-
bgClose({ bgClose }) {
|
|
2715
|
-
return bgClose && this.panel;
|
|
2716
2911
|
}
|
|
2717
2912
|
},
|
|
2718
2913
|
connected() {
|
|
@@ -2875,7 +3070,7 @@
|
|
|
2875
3070
|
}
|
|
2876
3071
|
function listenForBackgroundClose$1(modal) {
|
|
2877
3072
|
return on(document, pointerDown$1, ({ target }) => {
|
|
2878
|
-
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)) {
|
|
2879
3074
|
return;
|
|
2880
3075
|
}
|
|
2881
3076
|
once(
|
|
@@ -3052,7 +3247,6 @@
|
|
|
3052
3247
|
const pointerDown = "touchstart mousedown";
|
|
3053
3248
|
const pointerMove = "touchmove mousemove";
|
|
3054
3249
|
const pointerUp = "touchend touchcancel mouseup click input scroll";
|
|
3055
|
-
const preventClick = (e) => e.preventDefault();
|
|
3056
3250
|
var SliderDrag = {
|
|
3057
3251
|
props: {
|
|
3058
3252
|
draggable: Boolean
|
|
@@ -3120,9 +3314,6 @@
|
|
|
3120
3314
|
if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {
|
|
3121
3315
|
return;
|
|
3122
3316
|
}
|
|
3123
|
-
if (!this.dragging) {
|
|
3124
|
-
on(this.list, "click", preventClick, pointerOptions);
|
|
3125
|
-
}
|
|
3126
3317
|
e.cancelable && e.preventDefault();
|
|
3127
3318
|
this.dragging = true;
|
|
3128
3319
|
this.dir = distance < 0 ? 1 : -1;
|
|
@@ -3171,6 +3362,7 @@
|
|
|
3171
3362
|
off(document, pointerMove, this.move, pointerOptions);
|
|
3172
3363
|
off(document, pointerUp, this.end, pointerUpOptions);
|
|
3173
3364
|
if (this.dragging) {
|
|
3365
|
+
setTimeout(on(this.list, "click", (e) => e.preventDefault(), pointerOptions));
|
|
3174
3366
|
this.dragging = null;
|
|
3175
3367
|
if (this.index === this.prevIndex) {
|
|
3176
3368
|
this.percent = 1 - this.percent;
|
|
@@ -3191,7 +3383,6 @@
|
|
|
3191
3383
|
);
|
|
3192
3384
|
}
|
|
3193
3385
|
}
|
|
3194
|
-
setTimeout(() => off(this.list, "click", preventClick, pointerOptions));
|
|
3195
3386
|
css(this.list, { userSelect: "" });
|
|
3196
3387
|
this.drag = this.percent = null;
|
|
3197
3388
|
}
|
|
@@ -3525,7 +3716,7 @@
|
|
|
3525
3716
|
};
|
|
3526
3717
|
App.util = util;
|
|
3527
3718
|
App.options = {};
|
|
3528
|
-
App.version = "3.21.
|
|
3719
|
+
App.version = "3.21.18-dev.993e34374";
|
|
3529
3720
|
|
|
3530
3721
|
const PREFIX = "uk-";
|
|
3531
3722
|
const DATA = "__uikit__";
|
|
@@ -3830,7 +4021,7 @@
|
|
|
3830
4021
|
const item = toNumber(cmd);
|
|
3831
4022
|
const active = item === index;
|
|
3832
4023
|
toggleClass(el, this.clsActive, active);
|
|
3833
|
-
toggleClass(button, "uk-disabled", this.parallax);
|
|
4024
|
+
toggleClass(button, "uk-disabled", !!this.parallax);
|
|
3834
4025
|
attr(button, {
|
|
3835
4026
|
"aria-selected": active,
|
|
3836
4027
|
tabindex: active && !this.parallax ? null : -1
|
|
@@ -4171,34 +4362,67 @@
|
|
|
4171
4362
|
};
|
|
4172
4363
|
|
|
4173
4364
|
var LightboxPanel = {
|
|
4365
|
+
i18n: {
|
|
4366
|
+
counter: "%s / %s"
|
|
4367
|
+
},
|
|
4174
4368
|
mixins: [Modal, Slideshow],
|
|
4175
4369
|
functional: true,
|
|
4176
4370
|
props: {
|
|
4177
|
-
|
|
4371
|
+
counter: Boolean,
|
|
4178
4372
|
preload: Number,
|
|
4373
|
+
nav: Boolean,
|
|
4374
|
+
slidenav: Boolean,
|
|
4375
|
+
delayControls: Number,
|
|
4179
4376
|
videoAutoplay: Boolean,
|
|
4180
4377
|
template: String
|
|
4181
4378
|
},
|
|
4182
4379
|
data: () => ({
|
|
4380
|
+
counter: false,
|
|
4183
4381
|
preload: 1,
|
|
4184
|
-
|
|
4382
|
+
nav: false,
|
|
4383
|
+
slidenav: true,
|
|
4185
4384
|
delayControls: 3e3,
|
|
4385
|
+
videoAutoplay: false,
|
|
4186
4386
|
items: [],
|
|
4187
4387
|
cls: "uk-open",
|
|
4188
4388
|
clsPage: "uk-lightbox-page",
|
|
4189
|
-
|
|
4389
|
+
clsFit: "uk-lightbox-items-fit",
|
|
4390
|
+
clsZoom: "uk-lightbox-zoom",
|
|
4190
4391
|
attrItem: "uk-lightbox-item",
|
|
4392
|
+
selList: ".uk-lightbox-items",
|
|
4191
4393
|
selClose: ".uk-close-large",
|
|
4394
|
+
selNav: ".uk-lightbox-thumbnav, .uk-lightbox-dotnav",
|
|
4192
4395
|
selCaption: ".uk-lightbox-caption",
|
|
4396
|
+
selCounter: ".uk-lightbox-counter",
|
|
4193
4397
|
pauseOnHover: false,
|
|
4194
4398
|
velocity: 2,
|
|
4195
4399
|
Animations,
|
|
4196
|
-
template: `<div class="uk-lightbox uk-overflow-hidden"> <div class="uk-lightbox-items"></div> <div class="uk-
|
|
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>`
|
|
4197
4401
|
}),
|
|
4198
4402
|
created() {
|
|
4199
|
-
|
|
4403
|
+
let $el = $(this.template);
|
|
4404
|
+
if (isTag($el, "template")) {
|
|
4405
|
+
$el = fragment(html($el));
|
|
4406
|
+
}
|
|
4200
4407
|
const list = $(this.selList, $el);
|
|
4201
|
-
|
|
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);
|
|
4202
4426
|
const close = $("[uk-close]", $el);
|
|
4203
4427
|
const closeLabel = this.t("close");
|
|
4204
4428
|
if (close && closeLabel) {
|
|
@@ -4208,21 +4432,33 @@
|
|
|
4208
4432
|
},
|
|
4209
4433
|
events: [
|
|
4210
4434
|
{
|
|
4211
|
-
name:
|
|
4212
|
-
|
|
4213
|
-
|
|
4435
|
+
name: "click",
|
|
4436
|
+
self: true,
|
|
4437
|
+
filter: ({ bgClose }) => bgClose,
|
|
4438
|
+
delegate: ({ selList }) => `${selList} > *`,
|
|
4439
|
+
handler(e) {
|
|
4440
|
+
if (!e.defaultPrevented) {
|
|
4441
|
+
this.hide();
|
|
4442
|
+
}
|
|
4214
4443
|
}
|
|
4215
4444
|
},
|
|
4216
4445
|
{
|
|
4217
4446
|
name: "click",
|
|
4218
4447
|
self: true,
|
|
4219
|
-
delegate: ({
|
|
4448
|
+
delegate: ({ clsZoom }) => `.${clsZoom}`,
|
|
4220
4449
|
handler(e) {
|
|
4221
4450
|
if (!e.defaultPrevented) {
|
|
4222
|
-
this.
|
|
4451
|
+
toggleClass(this.list, this.clsFit);
|
|
4223
4452
|
}
|
|
4224
4453
|
}
|
|
4225
4454
|
},
|
|
4455
|
+
{
|
|
4456
|
+
name: `${pointerMove$1} ${pointerDown$1} keydown`,
|
|
4457
|
+
filter: ({ delayControls }) => delayControls,
|
|
4458
|
+
handler() {
|
|
4459
|
+
this.showControls();
|
|
4460
|
+
}
|
|
4461
|
+
},
|
|
4226
4462
|
{
|
|
4227
4463
|
name: "shown",
|
|
4228
4464
|
self: true,
|
|
@@ -4271,26 +4507,25 @@
|
|
|
4271
4507
|
{
|
|
4272
4508
|
name: "beforeitemshow",
|
|
4273
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
|
+
}
|
|
4274
4518
|
if (this.isToggled()) {
|
|
4275
4519
|
return;
|
|
4276
4520
|
}
|
|
4277
4521
|
this.draggable = false;
|
|
4278
4522
|
e.preventDefault();
|
|
4279
4523
|
this.toggleElement(this.$el, true, false);
|
|
4280
|
-
this.animation = Animations
|
|
4524
|
+
this.animation = Animations.scale;
|
|
4281
4525
|
removeClass(e.target, this.clsActive);
|
|
4282
4526
|
this.stack.splice(1, 0, this.index);
|
|
4283
4527
|
}
|
|
4284
4528
|
},
|
|
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
4529
|
{
|
|
4295
4530
|
name: "itemshown",
|
|
4296
4531
|
handler() {
|
|
@@ -4300,29 +4535,37 @@
|
|
|
4300
4535
|
{
|
|
4301
4536
|
name: "itemload",
|
|
4302
4537
|
async handler(_, item) {
|
|
4303
|
-
const { source: src, type,
|
|
4304
|
-
this.setItem(item, "<span uk-spinner></span>");
|
|
4538
|
+
const { source: src, type, attrs = {} } = item;
|
|
4539
|
+
this.setItem(item, "<span uk-spinner uk-inverse></span>");
|
|
4305
4540
|
if (!src) {
|
|
4306
4541
|
return;
|
|
4307
4542
|
}
|
|
4308
|
-
let
|
|
4543
|
+
let matches2;
|
|
4309
4544
|
const iframeAttrs = {
|
|
4310
4545
|
allowfullscreen: "",
|
|
4311
4546
|
style: "max-width: 100%; box-sizing: border-box;",
|
|
4312
4547
|
"uk-responsive": "",
|
|
4313
|
-
"uk-video": `${this.videoAutoplay}`
|
|
4548
|
+
"uk-video": `${Boolean(this.videoAutoplay)}`
|
|
4314
4549
|
};
|
|
4315
|
-
if (type === "image" || src
|
|
4316
|
-
const img = createEl("img"
|
|
4317
|
-
|
|
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));
|
|
4318
4559
|
on(img, "error", () => this.setError(item));
|
|
4319
|
-
} else if (type === "video" || src
|
|
4560
|
+
} else if (type === "video" || isVideo(src)) {
|
|
4561
|
+
const inline = this.videoAutoplay === "inline";
|
|
4320
4562
|
const video = createEl("video", {
|
|
4321
4563
|
src,
|
|
4322
|
-
poster,
|
|
4323
|
-
controls: "",
|
|
4324
4564
|
playsinline: "",
|
|
4325
|
-
"
|
|
4565
|
+
controls: inline ? null : "",
|
|
4566
|
+
loop: inline ? "" : null,
|
|
4567
|
+
poster: this.videoAutoplay ? null : item.poster,
|
|
4568
|
+
"uk-video": inline ? "automute: true" : Boolean(this.videoAutoplay),
|
|
4326
4569
|
...attrs
|
|
4327
4570
|
});
|
|
4328
4571
|
on(video, "loadedmetadata", () => this.setItem(item, video));
|
|
@@ -4337,20 +4580,20 @@
|
|
|
4337
4580
|
...attrs
|
|
4338
4581
|
})
|
|
4339
4582
|
);
|
|
4340
|
-
} else if (
|
|
4583
|
+
} else if (matches2 = src.match(
|
|
4341
4584
|
/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/
|
|
4342
4585
|
)) {
|
|
4343
4586
|
this.setItem(
|
|
4344
4587
|
item,
|
|
4345
4588
|
createEl("iframe", {
|
|
4346
|
-
src: `https://www.youtube${
|
|
4589
|
+
src: `https://www.youtube${matches2[1] || ""}.com/embed/${matches2[2]}${matches2[3] ? `?${matches2[3]}` : ""}`,
|
|
4347
4590
|
width: 1920,
|
|
4348
4591
|
height: 1080,
|
|
4349
4592
|
...iframeAttrs,
|
|
4350
4593
|
...attrs
|
|
4351
4594
|
})
|
|
4352
4595
|
);
|
|
4353
|
-
} else if (
|
|
4596
|
+
} else if (matches2 = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
|
|
4354
4597
|
try {
|
|
4355
4598
|
const { height, width } = await (await fetch(
|
|
4356
4599
|
`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
|
|
@@ -4361,7 +4604,7 @@
|
|
|
4361
4604
|
this.setItem(
|
|
4362
4605
|
item,
|
|
4363
4606
|
createEl("iframe", {
|
|
4364
|
-
src: `https://player.vimeo.com/video/${
|
|
4607
|
+
src: `https://player.vimeo.com/video/${matches2[1]}${matches2[2] ? `?${matches2[2]}` : ""}`,
|
|
4365
4608
|
width,
|
|
4366
4609
|
height,
|
|
4367
4610
|
...iframeAttrs,
|
|
@@ -4373,8 +4616,29 @@
|
|
|
4373
4616
|
}
|
|
4374
4617
|
}
|
|
4375
4618
|
}
|
|
4619
|
+
},
|
|
4620
|
+
{
|
|
4621
|
+
name: "itemloaded",
|
|
4622
|
+
handler() {
|
|
4623
|
+
this.$emit("resize");
|
|
4624
|
+
}
|
|
4376
4625
|
}
|
|
4377
4626
|
],
|
|
4627
|
+
update: {
|
|
4628
|
+
read() {
|
|
4629
|
+
for (const media of $$(`${this.selList} :not([controls]):is(img,video)`, this.$el)) {
|
|
4630
|
+
toggleClass(
|
|
4631
|
+
media,
|
|
4632
|
+
this.clsZoom,
|
|
4633
|
+
(media.naturalHeight || media.videoHeight) - this.$el.offsetHeight > Math.max(
|
|
4634
|
+
0,
|
|
4635
|
+
(media.naturalWidth || media.videoWidth) - this.$el.offsetWidth
|
|
4636
|
+
)
|
|
4637
|
+
);
|
|
4638
|
+
}
|
|
4639
|
+
},
|
|
4640
|
+
events: ["resize"]
|
|
4641
|
+
},
|
|
4378
4642
|
methods: {
|
|
4379
4643
|
loadItem(index = this.index) {
|
|
4380
4644
|
const item = this.getItem(index);
|
|
@@ -4392,11 +4656,11 @@
|
|
|
4392
4656
|
return this.slides[this.items.indexOf(item)];
|
|
4393
4657
|
},
|
|
4394
4658
|
setError(item) {
|
|
4395
|
-
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2"></span>');
|
|
4659
|
+
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2" uk-inverse></span>');
|
|
4396
4660
|
},
|
|
4397
4661
|
showControls() {
|
|
4398
4662
|
clearTimeout(this.controlsTimer);
|
|
4399
|
-
this.controlsTimer = setTimeout(this.hideControls, this.delayControls);
|
|
4663
|
+
this.controlsTimer = this.delayControls && setTimeout(this.hideControls, this.delayControls);
|
|
4400
4664
|
addClass(this.$el, "uk-active", "uk-transition-active");
|
|
4401
4665
|
},
|
|
4402
4666
|
hideControls() {
|
|
@@ -4409,7 +4673,26 @@
|
|
|
4409
4673
|
attr(el, attrs);
|
|
4410
4674
|
return el;
|
|
4411
4675
|
}
|
|
4676
|
+
function toThumbnavItem(item, videoAutoplay) {
|
|
4677
|
+
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", {
|
|
4678
|
+
src: item.thumb,
|
|
4679
|
+
loop: "",
|
|
4680
|
+
playsinline: "",
|
|
4681
|
+
"uk-video": `autoplay: ${Boolean(videoAutoplay)}; automute: true`
|
|
4682
|
+
}) : createEl("canvas");
|
|
4683
|
+
if (item.thumbRatio) {
|
|
4684
|
+
el.style.aspectRatio = item.thumbRatio;
|
|
4685
|
+
}
|
|
4686
|
+
return el;
|
|
4687
|
+
}
|
|
4688
|
+
function isImage(src) {
|
|
4689
|
+
return src == null ? void 0 : src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i);
|
|
4690
|
+
}
|
|
4691
|
+
function isVideo(src) {
|
|
4692
|
+
return src == null ? void 0 : src.match(/\.(mp4|webm|ogv)($|\?)/i);
|
|
4693
|
+
}
|
|
4412
4694
|
|
|
4695
|
+
const selDisabled$1 = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
4413
4696
|
var lightbox = {
|
|
4414
4697
|
install: install$3,
|
|
4415
4698
|
props: { toggle: String },
|
|
@@ -4432,17 +4715,23 @@
|
|
|
4432
4715
|
},
|
|
4433
4716
|
events: {
|
|
4434
4717
|
name: "click",
|
|
4435
|
-
delegate: ({ toggle }) =>
|
|
4718
|
+
delegate: ({ toggle }) => toggle,
|
|
4436
4719
|
handler(e) {
|
|
4437
4720
|
if (!e.defaultPrevented) {
|
|
4438
4721
|
e.preventDefault();
|
|
4439
|
-
|
|
4722
|
+
if (!matches(e.current, selDisabled$1)) {
|
|
4723
|
+
this.show(e.current);
|
|
4724
|
+
}
|
|
4440
4725
|
}
|
|
4441
4726
|
}
|
|
4442
4727
|
},
|
|
4443
4728
|
methods: {
|
|
4444
4729
|
show(index) {
|
|
4445
|
-
|
|
4730
|
+
let items = this.toggles.map(toItem);
|
|
4731
|
+
if (this.nav === "thumbnav") {
|
|
4732
|
+
ensureThumb.call(this, this.toggles, items);
|
|
4733
|
+
}
|
|
4734
|
+
items = uniqueBy(items, "source");
|
|
4446
4735
|
if (isElement(index)) {
|
|
4447
4736
|
const { source } = toItem(index);
|
|
4448
4737
|
index = findIndex(items, ({ source: src }) => source === src);
|
|
@@ -4463,10 +4752,29 @@
|
|
|
4463
4752
|
}
|
|
4464
4753
|
assign(Lightbox.props, UIkit.component("lightboxPanel").options.props);
|
|
4465
4754
|
}
|
|
4755
|
+
function ensureThumb(toggles, items) {
|
|
4756
|
+
for (const [i, toggle] of Object.entries(toggles)) {
|
|
4757
|
+
if (items[i].thumb) {
|
|
4758
|
+
continue;
|
|
4759
|
+
}
|
|
4760
|
+
const parent = parents(toggle).reverse().concat(toggle).find(
|
|
4761
|
+
(parent2) => this.$el.contains(parent2) && (parent2 === toggle || $$(this.toggle, parent2).length === 1)
|
|
4762
|
+
);
|
|
4763
|
+
if (!parent) {
|
|
4764
|
+
continue;
|
|
4765
|
+
}
|
|
4766
|
+
const media = $("img,video", parent);
|
|
4767
|
+
if (media) {
|
|
4768
|
+
items[i].thumb = media.currentSrc || media.poster || media.src;
|
|
4769
|
+
items[i].thumbRatio = (media.naturalWidth || media.videoWidth) / (media.naturalHeight || media.videoHeight);
|
|
4770
|
+
}
|
|
4771
|
+
}
|
|
4772
|
+
}
|
|
4466
4773
|
function toItem(el) {
|
|
4467
4774
|
const item = {};
|
|
4468
|
-
for (const
|
|
4469
|
-
|
|
4775
|
+
for (const attribute of el.getAttributeNames()) {
|
|
4776
|
+
const key = attribute.replace(/^data-/, "");
|
|
4777
|
+
item[key === "href" ? "source" : key] = el.getAttribute(attribute);
|
|
4470
4778
|
}
|
|
4471
4779
|
item.attrs = parseOptions(item.attrs);
|
|
4472
4780
|
return item;
|
|
@@ -5917,82 +6225,6 @@
|
|
|
5917
6225
|
};
|
|
5918
6226
|
}
|
|
5919
6227
|
|
|
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
6228
|
var tooltip = {
|
|
5997
6229
|
mixins: [Container, Togglable, Position],
|
|
5998
6230
|
data: {
|
|
@@ -8085,123 +8317,6 @@
|
|
|
8085
8317
|
return isRtl ? swap(swap(icon, "left", "right"), "previous", "next") : icon;
|
|
8086
8318
|
}
|
|
8087
8319
|
|
|
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
8320
|
var inverse = {
|
|
8206
8321
|
props: {
|
|
8207
8322
|
target: String,
|
|
@@ -8516,12 +8631,9 @@
|
|
|
8516
8631
|
{
|
|
8517
8632
|
name: "hide",
|
|
8518
8633
|
el: ({ dropContainer }) => dropContainer,
|
|
8519
|
-
async handler(
|
|
8520
|
-
if (!this.getDropdown(e.target)) {
|
|
8521
|
-
return;
|
|
8522
|
-
}
|
|
8634
|
+
async handler() {
|
|
8523
8635
|
await awaitMacroTask();
|
|
8524
|
-
if (
|
|
8636
|
+
if (this._transparent && (!active || !this.dropContainer.contains(active.$el))) {
|
|
8525
8637
|
addClass(this.navbarContainer, clsNavbarTransparent);
|
|
8526
8638
|
this._transparent = null;
|
|
8527
8639
|
}
|