uikit 3.21.13 → 3.21.14-dev.2e8a07c7e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/css/uikit-core-rtl.css +233 -85
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +233 -85
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +237 -81
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +237 -81
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +2 -11
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +432 -127
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +449 -132
- 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 +20 -28
- 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 +25 -34
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +4 -2
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +8 -12
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +242 -241
- 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 +668 -549
- 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/api/boot.js +16 -20
- package/src/js/api/events.js +12 -13
- 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 +184 -45
- package/src/js/components/lightbox.js +59 -6
- package/src/js/components/slideshow.js +1 -2
- package/src/js/components/sortable.js +3 -1
- package/src/js/core/drop.js +3 -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/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 +4 -2
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.21.
|
|
1
|
+
/*! UIkit 3.21.14-dev.2e8a07c7e | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|
|
@@ -6,6 +6,191 @@
|
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkitLightbox_panel = factory(global.UIkit.util));
|
|
7
7
|
})(this, (function (util) { 'use strict';
|
|
8
8
|
|
|
9
|
+
function callUpdate(instance, e = "update") {
|
|
10
|
+
if (!instance._connected) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (!instance._updates.length) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!instance._queued) {
|
|
17
|
+
instance._queued = /* @__PURE__ */ new Set();
|
|
18
|
+
util.fastdom.read(() => {
|
|
19
|
+
if (instance._connected) {
|
|
20
|
+
runUpdates(instance, instance._queued);
|
|
21
|
+
}
|
|
22
|
+
instance._queued = null;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
instance._queued.add(e.type || e);
|
|
26
|
+
}
|
|
27
|
+
function runUpdates(instance, types) {
|
|
28
|
+
for (const { read, write, events = [] } of instance._updates) {
|
|
29
|
+
if (!types.has("update") && !events.some((type) => types.has(type))) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
let result;
|
|
33
|
+
if (read) {
|
|
34
|
+
result = read.call(instance, instance._data, types);
|
|
35
|
+
if (result && util.isPlainObject(result)) {
|
|
36
|
+
util.assign(instance._data, result);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (write && result !== false) {
|
|
40
|
+
util.fastdom.write(() => {
|
|
41
|
+
if (instance._connected) {
|
|
42
|
+
write.call(instance, instance._data, types);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function resize(options) {
|
|
50
|
+
return observe(util.observeResize, options, "resize");
|
|
51
|
+
}
|
|
52
|
+
function intersection(options) {
|
|
53
|
+
return observe(util.observeIntersection, options);
|
|
54
|
+
}
|
|
55
|
+
function observe(observe2, options, emit) {
|
|
56
|
+
return {
|
|
57
|
+
observe: observe2,
|
|
58
|
+
handler() {
|
|
59
|
+
callUpdate(this, emit);
|
|
60
|
+
},
|
|
61
|
+
...options
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function parseOptions(options, args = []) {
|
|
66
|
+
try {
|
|
67
|
+
return options ? util.startsWith(options, "{") ? JSON.parse(options) : args.length && !util.includes(options, ":") ? { [args[0]]: options } : options.split(";").reduce((options2, option) => {
|
|
68
|
+
const [key, value] = option.split(/:(.*)/);
|
|
69
|
+
if (key && !util.isUndefined(value)) {
|
|
70
|
+
options2[key.trim()] = value.trim();
|
|
71
|
+
}
|
|
72
|
+
return options2;
|
|
73
|
+
}, {}) : {};
|
|
74
|
+
} catch (e) {
|
|
75
|
+
return {};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
({
|
|
80
|
+
args: "dataSrc",
|
|
81
|
+
props: {
|
|
82
|
+
dataSrc: String,
|
|
83
|
+
sources: String,
|
|
84
|
+
margin: String,
|
|
85
|
+
target: String,
|
|
86
|
+
loading: String
|
|
87
|
+
},
|
|
88
|
+
data: {
|
|
89
|
+
dataSrc: "",
|
|
90
|
+
sources: false,
|
|
91
|
+
margin: "50%",
|
|
92
|
+
target: false,
|
|
93
|
+
loading: "lazy"
|
|
94
|
+
},
|
|
95
|
+
connected() {
|
|
96
|
+
if (this.loading !== "lazy") {
|
|
97
|
+
this.load();
|
|
98
|
+
} else if (isImg(this.$el)) {
|
|
99
|
+
this.$el.loading = "lazy";
|
|
100
|
+
setSrcAttrs(this.$el);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
disconnected() {
|
|
104
|
+
if (this.img) {
|
|
105
|
+
this.img.onload = "";
|
|
106
|
+
}
|
|
107
|
+
delete this.img;
|
|
108
|
+
},
|
|
109
|
+
observe: intersection({
|
|
110
|
+
handler(entries, observer) {
|
|
111
|
+
this.load();
|
|
112
|
+
observer.disconnect();
|
|
113
|
+
},
|
|
114
|
+
options: ({ margin }) => ({ rootMargin: margin }),
|
|
115
|
+
filter: ({ loading }) => loading === "lazy",
|
|
116
|
+
target: ({ $el, $props }) => $props.target ? [$el, ...util.queryAll($props.target, $el)] : $el
|
|
117
|
+
}),
|
|
118
|
+
methods: {
|
|
119
|
+
load() {
|
|
120
|
+
if (this.img) {
|
|
121
|
+
return this.img;
|
|
122
|
+
}
|
|
123
|
+
const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);
|
|
124
|
+
util.removeAttr(image, "loading");
|
|
125
|
+
setSrcAttrs(this.$el, image.currentSrc);
|
|
126
|
+
return this.img = image;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
function setSrcAttrs(el, src) {
|
|
131
|
+
if (isImg(el)) {
|
|
132
|
+
const parentNode = util.parent(el);
|
|
133
|
+
const elements = util.isTag(parentNode, "picture") ? util.children(parentNode) : [el];
|
|
134
|
+
elements.forEach((el2) => setSourceProps(el2, el2));
|
|
135
|
+
} else if (src) {
|
|
136
|
+
const change = !util.includes(el.style.backgroundImage, src);
|
|
137
|
+
if (change) {
|
|
138
|
+
util.css(el, "backgroundImage", `url(${util.escape(src)})`);
|
|
139
|
+
util.trigger(el, util.createEvent("load", false));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const srcProps = ["data-src", "data-srcset", "sizes"];
|
|
144
|
+
function setSourceProps(sourceEl, targetEl) {
|
|
145
|
+
for (const prop of srcProps) {
|
|
146
|
+
const value = util.data(sourceEl, prop);
|
|
147
|
+
if (value) {
|
|
148
|
+
util.attr(targetEl, prop.replace(/data-/g, ""), value);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function getImageFromElement(el, src, sources) {
|
|
153
|
+
const img = new Image();
|
|
154
|
+
wrapInPicture(img, sources);
|
|
155
|
+
setSourceProps(el, img);
|
|
156
|
+
img.onload = () => setSrcAttrs(el, img.currentSrc);
|
|
157
|
+
util.attr(img, "src", src);
|
|
158
|
+
return img;
|
|
159
|
+
}
|
|
160
|
+
function wrapInPicture(img, sources) {
|
|
161
|
+
sources = parseSources(sources);
|
|
162
|
+
if (sources.length) {
|
|
163
|
+
const picture = util.fragment("<picture>");
|
|
164
|
+
for (const attrs of sources) {
|
|
165
|
+
const source = util.fragment("<source>");
|
|
166
|
+
util.attr(source, attrs);
|
|
167
|
+
util.append(picture, source);
|
|
168
|
+
}
|
|
169
|
+
util.append(picture, img);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function parseSources(sources) {
|
|
173
|
+
if (!sources) {
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
if (util.startsWith(sources, "[")) {
|
|
177
|
+
try {
|
|
178
|
+
sources = JSON.parse(sources);
|
|
179
|
+
} catch (e) {
|
|
180
|
+
sources = [];
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
sources = parseOptions(sources);
|
|
184
|
+
}
|
|
185
|
+
if (!util.isArray(sources)) {
|
|
186
|
+
sources = [sources];
|
|
187
|
+
}
|
|
188
|
+
return sources.filter((source) => !util.isEmpty(source));
|
|
189
|
+
}
|
|
190
|
+
function isImg(el) {
|
|
191
|
+
return util.isTag(el, "img");
|
|
192
|
+
}
|
|
193
|
+
|
|
9
194
|
let prevented;
|
|
10
195
|
function preventBackgroundScroll(el) {
|
|
11
196
|
const off = util.on(
|
|
@@ -78,6 +263,16 @@
|
|
|
78
263
|
}
|
|
79
264
|
};
|
|
80
265
|
|
|
266
|
+
function storeScrollPosition(element) {
|
|
267
|
+
const scrollElement = util.scrollParent(element);
|
|
268
|
+
const { scrollTop } = scrollElement;
|
|
269
|
+
return () => {
|
|
270
|
+
if (scrollTop !== scrollElement.scrollTop) {
|
|
271
|
+
scrollElement.scrollTop = scrollTop;
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
|
|
81
276
|
var Togglable = {
|
|
82
277
|
props: {
|
|
83
278
|
cls: Boolean,
|
|
@@ -115,8 +310,14 @@
|
|
|
115
310
|
util.addClass(el, cls);
|
|
116
311
|
util.trigger(el, show ? "show" : "hide", [this]);
|
|
117
312
|
const done = () => {
|
|
313
|
+
var _a;
|
|
118
314
|
util.removeClass(el, cls);
|
|
119
315
|
util.trigger(el, show ? "shown" : "hidden", [this]);
|
|
316
|
+
if (show) {
|
|
317
|
+
const restoreScrollPosition = storeScrollPosition(el);
|
|
318
|
+
(_a = util.$$("[autofocus]", el).find(util.isVisible)) == null ? void 0 : _a.focus();
|
|
319
|
+
restoreScrollPosition();
|
|
320
|
+
}
|
|
120
321
|
};
|
|
121
322
|
return promise ? promise.then(done, () => {
|
|
122
323
|
util.removeClass(el, cls);
|
|
@@ -149,7 +350,6 @@
|
|
|
149
350
|
if (changed) {
|
|
150
351
|
util.trigger(el, "toggled", [toggled, this]);
|
|
151
352
|
}
|
|
152
|
-
util.$$("[autofocus]", el).some((el2) => util.isVisible(el2) ? el2.focus() || true : el2.blur());
|
|
153
353
|
}
|
|
154
354
|
}
|
|
155
355
|
};
|
|
@@ -280,9 +480,6 @@
|
|
|
280
480
|
panel: ({ selPanel }, $el) => util.$(selPanel, $el),
|
|
281
481
|
transitionElement() {
|
|
282
482
|
return this.panel;
|
|
283
|
-
},
|
|
284
|
-
bgClose({ bgClose }) {
|
|
285
|
-
return bgClose && this.panel;
|
|
286
483
|
}
|
|
287
484
|
},
|
|
288
485
|
connected() {
|
|
@@ -445,7 +642,7 @@
|
|
|
445
642
|
}
|
|
446
643
|
function listenForBackgroundClose(modal) {
|
|
447
644
|
return util.on(document, util.pointerDown, ({ target }) => {
|
|
448
|
-
if (util.last(active) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {
|
|
645
|
+
if (util.last(active) !== modal || modal.overlay && !modal.$el.contains(target) || !modal.panel || modal.panel.contains(target)) {
|
|
449
646
|
return;
|
|
450
647
|
}
|
|
451
648
|
util.once(
|
|
@@ -468,59 +665,6 @@
|
|
|
468
665
|
});
|
|
469
666
|
}
|
|
470
667
|
|
|
471
|
-
function callUpdate(instance, e = "update") {
|
|
472
|
-
if (!instance._connected) {
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
if (!instance._updates.length) {
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
if (!instance._queued) {
|
|
479
|
-
instance._queued = /* @__PURE__ */ new Set();
|
|
480
|
-
util.fastdom.read(() => {
|
|
481
|
-
if (instance._connected) {
|
|
482
|
-
runUpdates(instance, instance._queued);
|
|
483
|
-
}
|
|
484
|
-
instance._queued = null;
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
instance._queued.add(e.type || e);
|
|
488
|
-
}
|
|
489
|
-
function runUpdates(instance, types) {
|
|
490
|
-
for (const { read, write, events = [] } of instance._updates) {
|
|
491
|
-
if (!types.has("update") && !events.some((type) => types.has(type))) {
|
|
492
|
-
continue;
|
|
493
|
-
}
|
|
494
|
-
let result;
|
|
495
|
-
if (read) {
|
|
496
|
-
result = read.call(instance, instance._data, types);
|
|
497
|
-
if (result && util.isPlainObject(result)) {
|
|
498
|
-
util.assign(instance._data, result);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
if (write && result !== false) {
|
|
502
|
-
util.fastdom.write(() => {
|
|
503
|
-
if (instance._connected) {
|
|
504
|
-
write.call(instance, instance._data, types);
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
function resize(options) {
|
|
512
|
-
return observe(util.observeResize, options, "resize");
|
|
513
|
-
}
|
|
514
|
-
function observe(observe2, options, emit) {
|
|
515
|
-
return {
|
|
516
|
-
observe: observe2,
|
|
517
|
-
handler() {
|
|
518
|
-
callUpdate(this, emit);
|
|
519
|
-
},
|
|
520
|
-
...options
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
|
|
524
668
|
var Animations$1 = {
|
|
525
669
|
slide: {
|
|
526
670
|
show(dir) {
|
|
@@ -541,11 +685,7 @@
|
|
|
541
685
|
return Math.abs(new DOMMatrix(util.css(el, "transform")).m41 / el.offsetWidth);
|
|
542
686
|
}
|
|
543
687
|
function translate(value = 0, unit = "%") {
|
|
544
|
-
value
|
|
545
|
-
return `translate3d(${value}, 0, 0)`;
|
|
546
|
-
}
|
|
547
|
-
function scale3d(value) {
|
|
548
|
-
return `scale3d(${value}, ${value}, 1)`;
|
|
688
|
+
return value ? `translate3d(${value + unit}, 0, 0)` : "";
|
|
549
689
|
}
|
|
550
690
|
|
|
551
691
|
function Transitioner(prev, next, dir, { animation, easing }) {
|
|
@@ -679,7 +819,6 @@
|
|
|
679
819
|
const pointerDown = "touchstart mousedown";
|
|
680
820
|
const pointerMove = "touchmove mousemove";
|
|
681
821
|
const pointerUp = "touchend touchcancel mouseup click input scroll";
|
|
682
|
-
const preventClick = (e) => e.preventDefault();
|
|
683
822
|
var SliderDrag = {
|
|
684
823
|
props: {
|
|
685
824
|
draggable: Boolean
|
|
@@ -747,9 +886,6 @@
|
|
|
747
886
|
if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {
|
|
748
887
|
return;
|
|
749
888
|
}
|
|
750
|
-
if (!this.dragging) {
|
|
751
|
-
util.on(this.list, "click", preventClick, pointerOptions);
|
|
752
|
-
}
|
|
753
889
|
e.cancelable && e.preventDefault();
|
|
754
890
|
this.dragging = true;
|
|
755
891
|
this.dir = distance < 0 ? 1 : -1;
|
|
@@ -798,6 +934,7 @@
|
|
|
798
934
|
util.off(document, pointerMove, this.move, pointerOptions);
|
|
799
935
|
util.off(document, pointerUp, this.end, pointerUpOptions);
|
|
800
936
|
if (this.dragging) {
|
|
937
|
+
setTimeout(util.on(this.list, "click", (e) => e.preventDefault(), pointerOptions));
|
|
801
938
|
this.dragging = null;
|
|
802
939
|
if (this.index === this.prevIndex) {
|
|
803
940
|
this.percent = 1 - this.percent;
|
|
@@ -808,6 +945,8 @@
|
|
|
808
945
|
const dirChange = (util.isRtl ? this.dir * (util.isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;
|
|
809
946
|
this.index = dirChange ? this.index : this.prevIndex;
|
|
810
947
|
if (dirChange) {
|
|
948
|
+
util.trigger(this.slides[this.prevIndex], "itemhidden", [this]);
|
|
949
|
+
util.trigger(this.slides[this.index], "itemshown", [this]);
|
|
811
950
|
this.percent = 1 - this.percent;
|
|
812
951
|
}
|
|
813
952
|
this.show(
|
|
@@ -816,7 +955,6 @@
|
|
|
816
955
|
);
|
|
817
956
|
}
|
|
818
957
|
}
|
|
819
|
-
setTimeout(() => util.off(this.list, "click", preventClick, pointerOptions));
|
|
820
958
|
util.css(this.list, { userSelect: "" });
|
|
821
959
|
this.drag = this.percent = null;
|
|
822
960
|
}
|
|
@@ -841,16 +979,11 @@
|
|
|
841
979
|
}
|
|
842
980
|
|
|
843
981
|
const keyMap = {
|
|
844
|
-
TAB: 9,
|
|
845
|
-
ESC: 27,
|
|
846
982
|
SPACE: 32,
|
|
847
983
|
END: 35,
|
|
848
984
|
HOME: 36,
|
|
849
985
|
LEFT: 37,
|
|
850
|
-
|
|
851
|
-
RIGHT: 39,
|
|
852
|
-
DOWN: 40
|
|
853
|
-
};
|
|
986
|
+
RIGHT: 39};
|
|
854
987
|
|
|
855
988
|
var SliderNav = {
|
|
856
989
|
i18n: {
|
|
@@ -964,7 +1097,9 @@
|
|
|
964
1097
|
},
|
|
965
1098
|
{
|
|
966
1099
|
name: "itemshow",
|
|
967
|
-
handler
|
|
1100
|
+
handler() {
|
|
1101
|
+
this.updateNav();
|
|
1102
|
+
}
|
|
968
1103
|
},
|
|
969
1104
|
{
|
|
970
1105
|
name: "keydown",
|
|
@@ -994,7 +1129,7 @@
|
|
|
994
1129
|
const item = util.toNumber(cmd);
|
|
995
1130
|
const active = item === index;
|
|
996
1131
|
util.toggleClass(el, this.clsActive, active);
|
|
997
|
-
util.toggleClass(button, "uk-disabled", this.parallax);
|
|
1132
|
+
util.toggleClass(button, "uk-disabled", !!this.parallax);
|
|
998
1133
|
util.attr(button, {
|
|
999
1134
|
"aria-selected": active,
|
|
1000
1135
|
tabindex: active && !this.parallax ? null : -1
|
|
@@ -1097,7 +1232,7 @@
|
|
|
1097
1232
|
}
|
|
1098
1233
|
},
|
|
1099
1234
|
methods: {
|
|
1100
|
-
show(index, force = false) {
|
|
1235
|
+
async show(index, force = false) {
|
|
1101
1236
|
var _a;
|
|
1102
1237
|
if (this.dragging || !this.length || this.parallax) {
|
|
1103
1238
|
return;
|
|
@@ -1133,18 +1268,16 @@
|
|
|
1133
1268
|
reset();
|
|
1134
1269
|
return;
|
|
1135
1270
|
}
|
|
1136
|
-
const promise = this._show(prev, next, force).then(() => {
|
|
1137
|
-
prev && util.trigger(prev, "itemhidden", [this]);
|
|
1138
|
-
util.trigger(next, "itemshown", [this]);
|
|
1139
|
-
stack.shift();
|
|
1140
|
-
this._transitioner = null;
|
|
1141
|
-
if (stack.length) {
|
|
1142
|
-
requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));
|
|
1143
|
-
}
|
|
1144
|
-
});
|
|
1145
1271
|
prev && util.trigger(prev, "itemhide", [this]);
|
|
1146
1272
|
util.trigger(next, "itemshow", [this]);
|
|
1147
|
-
|
|
1273
|
+
await this._show(prev, next, force);
|
|
1274
|
+
prev && util.trigger(prev, "itemhidden", [this]);
|
|
1275
|
+
util.trigger(next, "itemshown", [this]);
|
|
1276
|
+
stack.shift();
|
|
1277
|
+
this._transitioner = null;
|
|
1278
|
+
if (stack.length) {
|
|
1279
|
+
requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));
|
|
1280
|
+
}
|
|
1148
1281
|
},
|
|
1149
1282
|
getIndex(index = this.index, prev = this.index) {
|
|
1150
1283
|
return util.clamp(
|
|
@@ -1214,7 +1347,7 @@
|
|
|
1214
1347
|
},
|
|
1215
1348
|
observe: resize(),
|
|
1216
1349
|
events: {
|
|
1217
|
-
|
|
1350
|
+
itemshow({ target }) {
|
|
1218
1351
|
util.addClass(target, this.clsActive);
|
|
1219
1352
|
},
|
|
1220
1353
|
itemshown({ target }) {
|
|
@@ -1226,6 +1359,84 @@
|
|
|
1226
1359
|
}
|
|
1227
1360
|
};
|
|
1228
1361
|
|
|
1362
|
+
({
|
|
1363
|
+
...Animations$1,
|
|
1364
|
+
fade: {
|
|
1365
|
+
show() {
|
|
1366
|
+
return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
|
|
1367
|
+
},
|
|
1368
|
+
percent(current) {
|
|
1369
|
+
return 1 - util.css(current, "opacity");
|
|
1370
|
+
},
|
|
1371
|
+
translate(percent) {
|
|
1372
|
+
return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];
|
|
1373
|
+
}
|
|
1374
|
+
},
|
|
1375
|
+
scale: {
|
|
1376
|
+
show() {
|
|
1377
|
+
return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];
|
|
1378
|
+
},
|
|
1379
|
+
percent(current) {
|
|
1380
|
+
return 1 - util.css(current, "opacity");
|
|
1381
|
+
},
|
|
1382
|
+
translate(percent) {
|
|
1383
|
+
return [
|
|
1384
|
+
{ opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },
|
|
1385
|
+
{ zIndex: -1 }
|
|
1386
|
+
];
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
pull: {
|
|
1390
|
+
show(dir) {
|
|
1391
|
+
return dir < 0 ? [
|
|
1392
|
+
{ transform: translate(30), zIndex: -1 },
|
|
1393
|
+
{ transform: translate(), zIndex: 0 }
|
|
1394
|
+
] : [
|
|
1395
|
+
{ transform: translate(-100), zIndex: 0 },
|
|
1396
|
+
{ transform: translate(), zIndex: -1 }
|
|
1397
|
+
];
|
|
1398
|
+
},
|
|
1399
|
+
percent(current, next, dir) {
|
|
1400
|
+
return dir < 0 ? 1 - translated(next) : translated(current);
|
|
1401
|
+
},
|
|
1402
|
+
translate(percent, dir) {
|
|
1403
|
+
return dir < 0 ? [
|
|
1404
|
+
{ transform: translate(30 * percent), zIndex: -1 },
|
|
1405
|
+
{ transform: translate(-100 * (1 - percent)), zIndex: 0 }
|
|
1406
|
+
] : [
|
|
1407
|
+
{ transform: translate(-percent * 100), zIndex: 0 },
|
|
1408
|
+
{ transform: translate(30 * (1 - percent)), zIndex: -1 }
|
|
1409
|
+
];
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
push: {
|
|
1413
|
+
show(dir) {
|
|
1414
|
+
return dir < 0 ? [
|
|
1415
|
+
{ transform: translate(100), zIndex: 0 },
|
|
1416
|
+
{ transform: translate(), zIndex: -1 }
|
|
1417
|
+
] : [
|
|
1418
|
+
{ transform: translate(-30), zIndex: -1 },
|
|
1419
|
+
{ transform: translate(), zIndex: 0 }
|
|
1420
|
+
];
|
|
1421
|
+
},
|
|
1422
|
+
percent(current, next, dir) {
|
|
1423
|
+
return dir > 0 ? 1 - translated(next) : translated(current);
|
|
1424
|
+
},
|
|
1425
|
+
translate(percent, dir) {
|
|
1426
|
+
return dir < 0 ? [
|
|
1427
|
+
{ transform: translate(percent * 100), zIndex: 0 },
|
|
1428
|
+
{ transform: translate(-30 * (1 - percent)), zIndex: -1 }
|
|
1429
|
+
] : [
|
|
1430
|
+
{ transform: translate(-30 * percent), zIndex: -1 },
|
|
1431
|
+
{ transform: translate(100 * (1 - percent)), zIndex: 0 }
|
|
1432
|
+
];
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
});
|
|
1436
|
+
function scale3d(value) {
|
|
1437
|
+
return `scale3d(${value}, ${value}, 1)`;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1229
1440
|
var Animations = {
|
|
1230
1441
|
...Animations$1,
|
|
1231
1442
|
fade: {
|
|
@@ -1259,34 +1470,67 @@
|
|
|
1259
1470
|
};
|
|
1260
1471
|
|
|
1261
1472
|
var Component = {
|
|
1473
|
+
i18n: {
|
|
1474
|
+
counter: "%s / %s"
|
|
1475
|
+
},
|
|
1262
1476
|
mixins: [Modal, Slideshow],
|
|
1263
1477
|
functional: true,
|
|
1264
1478
|
props: {
|
|
1265
|
-
|
|
1479
|
+
counter: Boolean,
|
|
1266
1480
|
preload: Number,
|
|
1481
|
+
nav: Boolean,
|
|
1482
|
+
slidenav: Boolean,
|
|
1483
|
+
delayControls: Number,
|
|
1267
1484
|
videoAutoplay: Boolean,
|
|
1268
1485
|
template: String
|
|
1269
1486
|
},
|
|
1270
1487
|
data: () => ({
|
|
1488
|
+
counter: false,
|
|
1271
1489
|
preload: 1,
|
|
1272
|
-
|
|
1490
|
+
nav: false,
|
|
1491
|
+
slidenav: true,
|
|
1273
1492
|
delayControls: 3e3,
|
|
1493
|
+
videoAutoplay: false,
|
|
1274
1494
|
items: [],
|
|
1275
1495
|
cls: "uk-open",
|
|
1276
1496
|
clsPage: "uk-lightbox-page",
|
|
1277
|
-
|
|
1497
|
+
clsFit: "uk-lightbox-items-fit",
|
|
1498
|
+
clsZoom: "uk-lightbox-zoom",
|
|
1278
1499
|
attrItem: "uk-lightbox-item",
|
|
1500
|
+
selList: ".uk-lightbox-items",
|
|
1279
1501
|
selClose: ".uk-close-large",
|
|
1502
|
+
selNav: ".uk-lightbox-thumbnav, .uk-lightbox-dotnav",
|
|
1280
1503
|
selCaption: ".uk-lightbox-caption",
|
|
1504
|
+
selCounter: ".uk-lightbox-counter",
|
|
1281
1505
|
pauseOnHover: false,
|
|
1282
1506
|
velocity: 2,
|
|
1283
1507
|
Animations,
|
|
1284
|
-
template: `<div class="uk-lightbox uk-overflow-hidden"> <div class="uk-lightbox-items"></div> <div class="uk-
|
|
1508
|
+
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>`
|
|
1285
1509
|
}),
|
|
1286
1510
|
created() {
|
|
1287
|
-
|
|
1511
|
+
let $el = util.$(this.template);
|
|
1512
|
+
if (util.isTag($el, "template")) {
|
|
1513
|
+
$el = util.fragment(util.html($el));
|
|
1514
|
+
}
|
|
1288
1515
|
const list = util.$(this.selList, $el);
|
|
1289
|
-
|
|
1516
|
+
const navType = this.$props.nav;
|
|
1517
|
+
util.remove(util.$$(this.selNav, $el).filter((el) => !util.matches(el, `.uk-${navType}`)));
|
|
1518
|
+
for (const [i, item] of this.items.entries()) {
|
|
1519
|
+
util.append(list, "<div>");
|
|
1520
|
+
if (navType === "thumbnav") {
|
|
1521
|
+
util.wrapAll(
|
|
1522
|
+
toThumbnavItem(item, this.videoAutoplay),
|
|
1523
|
+
util.append(util.$(this.selNav, $el), `<li uk-lightbox-item="${i}"><a href></a></li>`)
|
|
1524
|
+
);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
if (!this.slidenav) {
|
|
1528
|
+
util.remove(util.$$(".uk-lightbox-slidenav", $el));
|
|
1529
|
+
}
|
|
1530
|
+
if (!this.counter) {
|
|
1531
|
+
util.remove(util.$(this.selCounter, $el));
|
|
1532
|
+
}
|
|
1533
|
+
util.addClass(list, this.clsFit);
|
|
1290
1534
|
const close = util.$("[uk-close]", $el);
|
|
1291
1535
|
const closeLabel = this.t("close");
|
|
1292
1536
|
if (close && closeLabel) {
|
|
@@ -1295,13 +1539,10 @@
|
|
|
1295
1539
|
this.$mount(util.append(this.container, $el));
|
|
1296
1540
|
},
|
|
1297
1541
|
events: [
|
|
1298
|
-
{
|
|
1299
|
-
name: `${util.pointerMove} ${util.pointerDown} keydown`,
|
|
1300
|
-
handler: "showControls"
|
|
1301
|
-
},
|
|
1302
1542
|
{
|
|
1303
1543
|
name: "click",
|
|
1304
1544
|
self: true,
|
|
1545
|
+
filter: ({ bgClose }) => bgClose,
|
|
1305
1546
|
delegate: ({ selList }) => `${selList} > *`,
|
|
1306
1547
|
handler(e) {
|
|
1307
1548
|
if (!e.defaultPrevented) {
|
|
@@ -1309,10 +1550,29 @@
|
|
|
1309
1550
|
}
|
|
1310
1551
|
}
|
|
1311
1552
|
},
|
|
1553
|
+
{
|
|
1554
|
+
name: "click",
|
|
1555
|
+
self: true,
|
|
1556
|
+
delegate: ({ clsZoom }) => `.${clsZoom}`,
|
|
1557
|
+
handler(e) {
|
|
1558
|
+
if (!e.defaultPrevented) {
|
|
1559
|
+
util.toggleClass(this.list, this.clsFit);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
},
|
|
1563
|
+
{
|
|
1564
|
+
name: `${util.pointerMove} ${util.pointerDown} keydown`,
|
|
1565
|
+
filter: ({ delayControls }) => delayControls,
|
|
1566
|
+
handler() {
|
|
1567
|
+
this.showControls();
|
|
1568
|
+
}
|
|
1569
|
+
},
|
|
1312
1570
|
{
|
|
1313
1571
|
name: "shown",
|
|
1314
1572
|
self: true,
|
|
1315
|
-
handler
|
|
1573
|
+
handler() {
|
|
1574
|
+
this.showControls();
|
|
1575
|
+
}
|
|
1316
1576
|
},
|
|
1317
1577
|
{
|
|
1318
1578
|
name: "hide",
|
|
@@ -1355,26 +1615,25 @@
|
|
|
1355
1615
|
{
|
|
1356
1616
|
name: "beforeitemshow",
|
|
1357
1617
|
handler(e) {
|
|
1618
|
+
util.html(util.$(this.selCaption, this.$el), this.getItem().caption || "");
|
|
1619
|
+
util.html(
|
|
1620
|
+
util.$(this.selCounter, this.$el),
|
|
1621
|
+
this.t("counter", this.index + 1, this.slides.length)
|
|
1622
|
+
);
|
|
1623
|
+
for (let j = -this.preload; j <= this.preload; j++) {
|
|
1624
|
+
this.loadItem(this.index + j);
|
|
1625
|
+
}
|
|
1358
1626
|
if (this.isToggled()) {
|
|
1359
1627
|
return;
|
|
1360
1628
|
}
|
|
1361
1629
|
this.draggable = false;
|
|
1362
1630
|
e.preventDefault();
|
|
1363
1631
|
this.toggleElement(this.$el, true, false);
|
|
1364
|
-
this.animation = Animations
|
|
1632
|
+
this.animation = Animations.scale;
|
|
1365
1633
|
util.removeClass(e.target, this.clsActive);
|
|
1366
1634
|
this.stack.splice(1, 0, this.index);
|
|
1367
1635
|
}
|
|
1368
1636
|
},
|
|
1369
|
-
{
|
|
1370
|
-
name: "itemshow",
|
|
1371
|
-
handler() {
|
|
1372
|
-
util.html(util.$(this.selCaption, this.$el), this.getItem().caption || "");
|
|
1373
|
-
for (let j = -this.preload; j <= this.preload; j++) {
|
|
1374
|
-
this.loadItem(this.index + j);
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
},
|
|
1378
1637
|
{
|
|
1379
1638
|
name: "itemshown",
|
|
1380
1639
|
handler() {
|
|
@@ -1384,29 +1643,36 @@
|
|
|
1384
1643
|
{
|
|
1385
1644
|
name: "itemload",
|
|
1386
1645
|
async handler(_, item) {
|
|
1387
|
-
const { source: src, type,
|
|
1388
|
-
this.setItem(item, "<span uk-spinner></span>");
|
|
1646
|
+
const { source: src, type, attrs = {} } = item;
|
|
1647
|
+
this.setItem(item, "<span uk-spinner uk-inverse></span>");
|
|
1389
1648
|
if (!src) {
|
|
1390
1649
|
return;
|
|
1391
1650
|
}
|
|
1392
|
-
let
|
|
1651
|
+
let matches2;
|
|
1393
1652
|
const iframeAttrs = {
|
|
1394
1653
|
allowfullscreen: "",
|
|
1395
1654
|
style: "max-width: 100%; box-sizing: border-box;",
|
|
1396
1655
|
"uk-responsive": "",
|
|
1397
|
-
"uk-video": `${this.videoAutoplay}`
|
|
1656
|
+
"uk-video": `${Boolean(this.videoAutoplay)}`
|
|
1398
1657
|
};
|
|
1399
|
-
if (type === "image" || src
|
|
1400
|
-
const img = createEl("img"
|
|
1401
|
-
|
|
1658
|
+
if (type === "image" || isImage(src)) {
|
|
1659
|
+
const img = createEl("img");
|
|
1660
|
+
wrapInPicture(img, item.sources);
|
|
1661
|
+
util.attr(img, {
|
|
1662
|
+
src,
|
|
1663
|
+
...util.pick(item, ["alt", "srcset", "sizes"]),
|
|
1664
|
+
...attrs
|
|
1665
|
+
});
|
|
1666
|
+
util.on(img, "load", () => this.setItem(item, util.parent(img) || img));
|
|
1402
1667
|
util.on(img, "error", () => this.setError(item));
|
|
1403
|
-
} else if (type === "video" || src
|
|
1668
|
+
} else if (type === "video" || isVideo(src)) {
|
|
1669
|
+
const inline = this.videoAutoplay === "inline";
|
|
1404
1670
|
const video = createEl("video", {
|
|
1405
1671
|
src,
|
|
1406
|
-
poster,
|
|
1407
|
-
controls: "",
|
|
1408
1672
|
playsinline: "",
|
|
1409
|
-
"
|
|
1673
|
+
controls: inline ? null : "",
|
|
1674
|
+
poster: this.videoAutoplay ? null : item.poster,
|
|
1675
|
+
"uk-video": inline ? "automute: true" : Boolean(this.videoAutoplay),
|
|
1410
1676
|
...attrs
|
|
1411
1677
|
});
|
|
1412
1678
|
util.on(video, "loadedmetadata", () => this.setItem(item, video));
|
|
@@ -1421,20 +1687,20 @@
|
|
|
1421
1687
|
...attrs
|
|
1422
1688
|
})
|
|
1423
1689
|
);
|
|
1424
|
-
} else if (
|
|
1690
|
+
} else if (matches2 = src.match(
|
|
1425
1691
|
/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/
|
|
1426
1692
|
)) {
|
|
1427
1693
|
this.setItem(
|
|
1428
1694
|
item,
|
|
1429
1695
|
createEl("iframe", {
|
|
1430
|
-
src: `https://www.youtube${
|
|
1696
|
+
src: `https://www.youtube${matches2[1] || ""}.com/embed/${matches2[2]}${matches2[3] ? `?${matches2[3]}` : ""}`,
|
|
1431
1697
|
width: 1920,
|
|
1432
1698
|
height: 1080,
|
|
1433
1699
|
...iframeAttrs,
|
|
1434
1700
|
...attrs
|
|
1435
1701
|
})
|
|
1436
1702
|
);
|
|
1437
|
-
} else if (
|
|
1703
|
+
} else if (matches2 = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
|
|
1438
1704
|
try {
|
|
1439
1705
|
const { height, width } = await (await fetch(
|
|
1440
1706
|
`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
|
|
@@ -1445,7 +1711,7 @@
|
|
|
1445
1711
|
this.setItem(
|
|
1446
1712
|
item,
|
|
1447
1713
|
createEl("iframe", {
|
|
1448
|
-
src: `https://player.vimeo.com/video/${
|
|
1714
|
+
src: `https://player.vimeo.com/video/${matches2[1]}${matches2[2] ? `?${matches2[2]}` : ""}`,
|
|
1449
1715
|
width,
|
|
1450
1716
|
height,
|
|
1451
1717
|
...iframeAttrs,
|
|
@@ -1457,8 +1723,29 @@
|
|
|
1457
1723
|
}
|
|
1458
1724
|
}
|
|
1459
1725
|
}
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
name: "itemloaded",
|
|
1729
|
+
handler() {
|
|
1730
|
+
this.$emit("resize");
|
|
1731
|
+
}
|
|
1460
1732
|
}
|
|
1461
1733
|
],
|
|
1734
|
+
update: {
|
|
1735
|
+
read() {
|
|
1736
|
+
for (const media of util.$$(`${this.selList} :not([controls]):is(img,video)`, this.$el)) {
|
|
1737
|
+
util.toggleClass(
|
|
1738
|
+
media,
|
|
1739
|
+
this.clsZoom,
|
|
1740
|
+
(media.naturalHeight || media.videoHeight) - this.$el.offsetHeight > Math.max(
|
|
1741
|
+
0,
|
|
1742
|
+
(media.naturalWidth || media.videoWidth) - this.$el.offsetWidth
|
|
1743
|
+
)
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
},
|
|
1747
|
+
events: ["resize"]
|
|
1748
|
+
},
|
|
1462
1749
|
methods: {
|
|
1463
1750
|
loadItem(index = this.index) {
|
|
1464
1751
|
const item = this.getItem(index);
|
|
@@ -1476,11 +1763,11 @@
|
|
|
1476
1763
|
return this.slides[this.items.indexOf(item)];
|
|
1477
1764
|
},
|
|
1478
1765
|
setError(item) {
|
|
1479
|
-
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2"></span>');
|
|
1766
|
+
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2" uk-inverse></span>');
|
|
1480
1767
|
},
|
|
1481
1768
|
showControls() {
|
|
1482
1769
|
clearTimeout(this.controlsTimer);
|
|
1483
|
-
this.controlsTimer = setTimeout(this.hideControls, this.delayControls);
|
|
1770
|
+
this.controlsTimer = this.delayControls && setTimeout(this.hideControls, this.delayControls);
|
|
1484
1771
|
util.addClass(this.$el, "uk-active", "uk-transition-active");
|
|
1485
1772
|
},
|
|
1486
1773
|
hideControls() {
|
|
@@ -1493,6 +1780,24 @@
|
|
|
1493
1780
|
util.attr(el, attrs);
|
|
1494
1781
|
return el;
|
|
1495
1782
|
}
|
|
1783
|
+
function toThumbnavItem(item, videoAutoplay) {
|
|
1784
|
+
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", {
|
|
1785
|
+
src: item.thumb,
|
|
1786
|
+
loop: "",
|
|
1787
|
+
playsinline: "",
|
|
1788
|
+
"uk-video": `autoplay: ${Boolean(videoAutoplay)}; automute: true`
|
|
1789
|
+
}) : createEl("canvas");
|
|
1790
|
+
if (item.thumbRatio) {
|
|
1791
|
+
el.style.aspectRatio = item.thumbRatio;
|
|
1792
|
+
}
|
|
1793
|
+
return el;
|
|
1794
|
+
}
|
|
1795
|
+
function isImage(src) {
|
|
1796
|
+
return src == null ? void 0 : src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i);
|
|
1797
|
+
}
|
|
1798
|
+
function isVideo(src) {
|
|
1799
|
+
return src == null ? void 0 : src.match(/\.(mp4|webm|ogv)($|\?)/i);
|
|
1800
|
+
}
|
|
1496
1801
|
|
|
1497
1802
|
if (typeof window !== "undefined" && window.UIkit) {
|
|
1498
1803
|
window.UIkit.component("lightboxPanel", Component);
|