uikit 3.15.18-dev.9cbbb510d → 3.15.19-dev.699ab5a7f
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 +12 -0
- package/build/util.js +4 -4
- package/dist/css/uikit-core-rtl.css +5 -2
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +5 -2
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +5 -2
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +5 -2
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +2 -2
- package/dist/js/components/countdown.min.js +2 -1
- package/dist/js/components/filter.js +22 -30
- package/dist/js/components/filter.min.js +2 -1
- package/dist/js/components/lightbox-panel.js +75 -96
- package/dist/js/components/lightbox-panel.min.js +2 -1
- package/dist/js/components/lightbox.js +78 -99
- package/dist/js/components/lightbox.min.js +2 -1
- package/dist/js/components/notification.js +11 -14
- package/dist/js/components/notification.min.js +2 -1
- package/dist/js/components/parallax.js +24 -26
- package/dist/js/components/parallax.min.js +2 -1
- package/dist/js/components/slider-parallax.js +19 -20
- package/dist/js/components/slider-parallax.min.js +2 -1
- package/dist/js/components/slider.js +95 -51
- package/dist/js/components/slider.min.js +2 -1
- package/dist/js/components/slideshow-parallax.js +19 -20
- package/dist/js/components/slideshow-parallax.min.js +2 -1
- package/dist/js/components/slideshow.js +35 -42
- package/dist/js/components/slideshow.min.js +2 -1
- package/dist/js/components/sortable.js +12 -18
- package/dist/js/components/sortable.min.js +2 -1
- package/dist/js/components/tooltip.js +25 -30
- package/dist/js/components/tooltip.min.js +2 -1
- package/dist/js/components/upload.js +7 -7
- package/dist/js/components/upload.min.js +2 -1
- package/dist/js/uikit-core.js +277 -330
- package/dist/js/uikit-core.min.js +2 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +2 -1
- package/dist/js/uikit.js +470 -503
- package/dist/js/uikit.min.js +2 -1
- package/package.json +2 -2
- package/src/js/components/lightbox-panel.js +3 -5
- package/src/js/components/slider.js +62 -7
- package/src/js/core/accordion.js +5 -4
- package/src/js/core/sticky.js +6 -7
- package/src/js/mixin/slider-drag.js +1 -1
- package/src/js/mixin/slider.js +2 -7
- package/src/js/util/attr.js +1 -6
- package/src/less/components/sticky.less +4 -1
- package/src/scss/components/sticky.scss +4 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.15.
|
|
1
|
+
/*! UIkit 3.15.19-dev.699ab5a7f | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
return Math.abs(uikitUtil.css(el, 'transform').split(',')[4] / el.offsetWidth) || 0;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function translate(value
|
|
32
|
+
function translate(value = 0, unit = '%') {
|
|
33
33
|
value += value ? unit : '';
|
|
34
|
-
return
|
|
34
|
+
return `translate3d(${value}, 0, 0)`;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function scale3d(value) {
|
|
38
|
-
return
|
|
38
|
+
return `scale3d(${value}, ${value}, 1)`;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
var Animations = {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
|
|
87
87
|
computed: {
|
|
88
|
-
container(
|
|
88
|
+
container({ container }) {
|
|
89
89
|
return container === true && this.$container || container && uikitUtil.$(container);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -119,23 +119,22 @@
|
|
|
119
119
|
},
|
|
120
120
|
|
|
121
121
|
computed: {
|
|
122
|
-
hasAnimation(
|
|
122
|
+
hasAnimation({ animation }) {
|
|
123
123
|
return !!animation[0];
|
|
124
124
|
},
|
|
125
125
|
|
|
126
|
-
hasTransition(
|
|
126
|
+
hasTransition({ animation }) {
|
|
127
127
|
return ['slide', 'reveal'].some((transition) => uikitUtil.startsWith(animation[0], transition));
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
|
|
131
131
|
methods: {
|
|
132
132
|
toggleElement(targets, toggle, animate) {
|
|
133
|
-
return new Promise((resolve) =>
|
|
134
|
-
Promise.all(
|
|
133
|
+
return new Promise((resolve) => Promise.all(
|
|
135
134
|
uikitUtil.toNodes(targets).map((el) => {
|
|
136
135
|
const show = uikitUtil.isBoolean(toggle) ? toggle : !this.isToggled(el);
|
|
137
136
|
|
|
138
|
-
if (!uikitUtil.trigger(el,
|
|
137
|
+
if (!uikitUtil.trigger(el, `before${show ? 'show' : 'hide'}`, [this])) {
|
|
139
138
|
return Promise.reject();
|
|
140
139
|
}
|
|
141
140
|
|
|
@@ -171,7 +170,7 @@
|
|
|
171
170
|
|
|
172
171
|
},
|
|
173
172
|
|
|
174
|
-
isToggled(el
|
|
173
|
+
isToggled(el = this.$el) {
|
|
175
174
|
[el] = uikitUtil.toNodes(el);
|
|
176
175
|
return uikitUtil.hasClass(el, this.clsEnter) ?
|
|
177
176
|
true :
|
|
@@ -207,7 +206,7 @@
|
|
|
207
206
|
}
|
|
208
207
|
};
|
|
209
208
|
|
|
210
|
-
function toggleInstant(el, show,
|
|
209
|
+
function toggleInstant(el, show, { _toggle }) {
|
|
211
210
|
uikitUtil.Animation.cancel(el);
|
|
212
211
|
uikitUtil.Transition.cancel(el);
|
|
213
212
|
return _toggle(el, show);
|
|
@@ -215,9 +214,9 @@
|
|
|
215
214
|
|
|
216
215
|
async function toggleTransition(
|
|
217
216
|
el,
|
|
218
|
-
show,
|
|
219
|
-
|
|
220
|
-
{var _animation$;
|
|
217
|
+
show,
|
|
218
|
+
{ animation, duration, velocity, transition, _toggle })
|
|
219
|
+
{var _animation$;
|
|
221
220
|
const [mode = 'reveal', startProp = 'top'] = ((_animation$ = animation[0]) == null ? void 0 : _animation$.split('-')) || [];
|
|
222
221
|
|
|
223
222
|
const dirs = [
|
|
@@ -228,8 +227,8 @@
|
|
|
228
227
|
const end = dir[1] === startProp;
|
|
229
228
|
const props = ['width', 'height'];
|
|
230
229
|
const dimProp = props[dirs.indexOf(dir)];
|
|
231
|
-
const marginProp =
|
|
232
|
-
const marginStartProp =
|
|
230
|
+
const marginProp = `margin-${dir[0]}`;
|
|
231
|
+
const marginStartProp = `margin-${startProp}`;
|
|
233
232
|
|
|
234
233
|
let currentDim = uikitUtil.dimensions(el)[dimProp];
|
|
235
234
|
|
|
@@ -329,8 +328,7 @@
|
|
|
329
328
|
return uikitUtil.Animation.in(el, animation[0], duration, cmp.origin);
|
|
330
329
|
}
|
|
331
330
|
|
|
332
|
-
return uikitUtil.Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(() =>
|
|
333
|
-
_toggle(el, false));
|
|
331
|
+
return uikitUtil.Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(() => _toggle(el, false));
|
|
334
332
|
|
|
335
333
|
}
|
|
336
334
|
|
|
@@ -356,7 +354,7 @@
|
|
|
356
354
|
},
|
|
357
355
|
|
|
358
356
|
computed: {
|
|
359
|
-
panel(
|
|
357
|
+
panel({ selPanel }, $el) {
|
|
360
358
|
return uikitUtil.$(selPanel, $el);
|
|
361
359
|
},
|
|
362
360
|
|
|
@@ -364,7 +362,7 @@
|
|
|
364
362
|
return this.panel;
|
|
365
363
|
},
|
|
366
364
|
|
|
367
|
-
bgClose(
|
|
365
|
+
bgClose({ bgClose }) {
|
|
368
366
|
return bgClose && this.panel;
|
|
369
367
|
}
|
|
370
368
|
},
|
|
@@ -380,7 +378,7 @@
|
|
|
380
378
|
name: 'click',
|
|
381
379
|
|
|
382
380
|
delegate() {
|
|
383
|
-
return this.selClose
|
|
381
|
+
return `${this.selClose},a[href*="#"]`;
|
|
384
382
|
},
|
|
385
383
|
|
|
386
384
|
handler(e) {
|
|
@@ -469,7 +467,7 @@
|
|
|
469
467
|
uikitUtil.once(
|
|
470
468
|
this.$el,
|
|
471
469
|
'hide',
|
|
472
|
-
uikitUtil.on(document, uikitUtil.pointerDown, (
|
|
470
|
+
uikitUtil.on(document, uikitUtil.pointerDown, ({ target }) => {
|
|
473
471
|
if (
|
|
474
472
|
uikitUtil.last(active) !== this ||
|
|
475
473
|
this.overlay && !uikitUtil.within(target, this.$el) ||
|
|
@@ -480,8 +478,8 @@
|
|
|
480
478
|
|
|
481
479
|
uikitUtil.once(
|
|
482
480
|
document,
|
|
483
|
-
uikitUtil.pointerUp
|
|
484
|
-
(
|
|
481
|
+
`${uikitUtil.pointerUp} ${uikitUtil.pointerCancel} scroll`,
|
|
482
|
+
({ defaultPrevented, type, target: newTarget }) => {
|
|
485
483
|
if (
|
|
486
484
|
!defaultPrevented &&
|
|
487
485
|
type === uikitUtil.pointerUp &&
|
|
@@ -555,8 +553,7 @@
|
|
|
555
553
|
show() {
|
|
556
554
|
if (this.container && uikitUtil.parent(this.$el) !== this.container) {
|
|
557
555
|
uikitUtil.append(this.container, this.$el);
|
|
558
|
-
return new Promise((resolve) =>
|
|
559
|
-
requestAnimationFrame(() => this.show().then(resolve)));
|
|
556
|
+
return new Promise((resolve) => requestAnimationFrame(() => this.show().then(resolve)));
|
|
560
557
|
|
|
561
558
|
}
|
|
562
559
|
|
|
@@ -569,9 +566,8 @@
|
|
|
569
566
|
}
|
|
570
567
|
};
|
|
571
568
|
|
|
572
|
-
function animate(el, show,
|
|
573
|
-
return new Promise((resolve, reject) =>
|
|
574
|
-
uikitUtil.once(el, 'show hide', () => {
|
|
569
|
+
function animate(el, show, { transitionElement, _toggle }) {
|
|
570
|
+
return new Promise((resolve, reject) => uikitUtil.once(el, 'show hide', () => {
|
|
575
571
|
el._reject == null ? void 0 : el._reject();
|
|
576
572
|
el._reject = reject;
|
|
577
573
|
|
|
@@ -617,7 +613,7 @@
|
|
|
617
613
|
uikitUtil.on(
|
|
618
614
|
el,
|
|
619
615
|
'touchstart',
|
|
620
|
-
(
|
|
616
|
+
({ targetTouches }) => {
|
|
621
617
|
if (targetTouches.length === 1) {
|
|
622
618
|
startClientY = targetTouches[0].clientY;
|
|
623
619
|
}
|
|
@@ -689,7 +685,7 @@
|
|
|
689
685
|
return ['origin', 'pathname', 'search'].every((part) => a[part] === location[part]);
|
|
690
686
|
}
|
|
691
687
|
|
|
692
|
-
function Transitioner(prev, next, dir,
|
|
688
|
+
function Transitioner(prev, next, dir, { animation, easing }) {
|
|
693
689
|
const { percent, translate, show = uikitUtil.noop } = animation;
|
|
694
690
|
const props = show(dir);
|
|
695
691
|
const deferred = new uikitUtil.Deferred();
|
|
@@ -697,7 +693,7 @@
|
|
|
697
693
|
return {
|
|
698
694
|
dir,
|
|
699
695
|
|
|
700
|
-
show(duration, percent, linear) {
|
|
696
|
+
show(duration, percent = 0, linear) {
|
|
701
697
|
const timing = linear ? 'linear' : easing;
|
|
702
698
|
duration -= Math.round(duration * uikitUtil.clamp(percent, -1, 1));
|
|
703
699
|
|
|
@@ -727,7 +723,7 @@
|
|
|
727
723
|
}
|
|
728
724
|
},
|
|
729
725
|
|
|
730
|
-
forward(duration, percent
|
|
726
|
+
forward(duration, percent = this.percent()) {
|
|
731
727
|
uikitUtil.Transition.cancel([next, prev]);
|
|
732
728
|
return this.show(duration, percent, true);
|
|
733
729
|
},
|
|
@@ -759,8 +755,7 @@
|
|
|
759
755
|
var Resize = {
|
|
760
756
|
connected() {var _this$$options$resize;
|
|
761
757
|
this.registerObserver(
|
|
762
|
-
uikitUtil.observeResize(((_this$$options$resize = this.$options.resizeTargets) == null ? void 0 : _this$$options$resize.call(this)) || this.$el, () =>
|
|
763
|
-
this.$emit('resize')));
|
|
758
|
+
uikitUtil.observeResize(((_this$$options$resize = this.$options.resizeTargets) == null ? void 0 : _this$$options$resize.call(this)) || this.$el, () => this.$emit('resize')));
|
|
764
759
|
|
|
765
760
|
|
|
766
761
|
}
|
|
@@ -818,8 +813,7 @@
|
|
|
818
813
|
this.stopAutoplay();
|
|
819
814
|
|
|
820
815
|
this.interval = setInterval(
|
|
821
|
-
() =>
|
|
822
|
-
(!this.draggable || !uikitUtil.$(':focus', this.$el)) && (
|
|
816
|
+
() => (!this.draggable || !uikitUtil.$(':focus', this.$el)) && (
|
|
823
817
|
!this.pauseOnHover || !uikitUtil.matches(this.$el, ':hover')) &&
|
|
824
818
|
!this.stack.length &&
|
|
825
819
|
this.show('next'),
|
|
@@ -870,7 +864,7 @@
|
|
|
870
864
|
passive: true,
|
|
871
865
|
|
|
872
866
|
delegate() {
|
|
873
|
-
return this.
|
|
867
|
+
return `${this.selList} > *`;
|
|
874
868
|
},
|
|
875
869
|
|
|
876
870
|
handler(e) {
|
|
@@ -1058,12 +1052,12 @@
|
|
|
1058
1052
|
},
|
|
1059
1053
|
|
|
1060
1054
|
computed: {
|
|
1061
|
-
nav(
|
|
1055
|
+
nav({ selNav }, $el) {
|
|
1062
1056
|
return uikitUtil.$(selNav, $el);
|
|
1063
1057
|
},
|
|
1064
1058
|
|
|
1065
|
-
selNavItem(
|
|
1066
|
-
return
|
|
1059
|
+
selNavItem({ attrItem }) {
|
|
1060
|
+
return `[${attrItem}],[data-${attrItem}]`;
|
|
1067
1061
|
},
|
|
1068
1062
|
|
|
1069
1063
|
navItems(_, $el) {
|
|
@@ -1077,7 +1071,7 @@
|
|
|
1077
1071
|
uikitUtil.html(
|
|
1078
1072
|
this.nav,
|
|
1079
1073
|
this.slides.
|
|
1080
|
-
map((_, i) =>
|
|
1074
|
+
map((_, i) => `<li ${this.attrItem}="${i}"><a href></a></li>`).
|
|
1081
1075
|
join(''));
|
|
1082
1076
|
|
|
1083
1077
|
}
|
|
@@ -1136,8 +1130,7 @@
|
|
|
1136
1130
|
easing: String,
|
|
1137
1131
|
index: Number,
|
|
1138
1132
|
finite: Boolean,
|
|
1139
|
-
velocity: Number
|
|
1140
|
-
selSlides: String
|
|
1133
|
+
velocity: Number
|
|
1141
1134
|
},
|
|
1142
1135
|
|
|
1143
1136
|
data: () => ({
|
|
@@ -1165,11 +1158,11 @@
|
|
|
1165
1158
|
},
|
|
1166
1159
|
|
|
1167
1160
|
computed: {
|
|
1168
|
-
duration(
|
|
1161
|
+
duration({ velocity }, $el) {
|
|
1169
1162
|
return speedUp($el.offsetWidth / velocity);
|
|
1170
1163
|
},
|
|
1171
1164
|
|
|
1172
|
-
list(
|
|
1165
|
+
list({ selList }, $el) {
|
|
1173
1166
|
return uikitUtil.$(selList, $el);
|
|
1174
1167
|
},
|
|
1175
1168
|
|
|
@@ -1177,13 +1170,9 @@
|
|
|
1177
1170
|
return this.length - 1;
|
|
1178
1171
|
},
|
|
1179
1172
|
|
|
1180
|
-
selSlides(_ref3) {let { selList, selSlides } = _ref3;
|
|
1181
|
-
return selList + " " + (selSlides || '> *');
|
|
1182
|
-
},
|
|
1183
|
-
|
|
1184
1173
|
slides: {
|
|
1185
1174
|
get() {
|
|
1186
|
-
return uikitUtil
|
|
1175
|
+
return uikitUtil.children(this.list);
|
|
1187
1176
|
},
|
|
1188
1177
|
|
|
1189
1178
|
watch() {
|
|
@@ -1197,7 +1186,7 @@
|
|
|
1197
1186
|
},
|
|
1198
1187
|
|
|
1199
1188
|
methods: {
|
|
1200
|
-
show(index, force
|
|
1189
|
+
show(index, force = false) {
|
|
1201
1190
|
if (this.dragging || !this.length) {
|
|
1202
1191
|
return;
|
|
1203
1192
|
}
|
|
@@ -1268,11 +1257,11 @@
|
|
|
1268
1257
|
return promise;
|
|
1269
1258
|
},
|
|
1270
1259
|
|
|
1271
|
-
getIndex(index
|
|
1260
|
+
getIndex(index = this.index, prev = this.index) {
|
|
1272
1261
|
return uikitUtil.clamp(uikitUtil.getIndex(index, this.slides, prev, this.finite), 0, this.maxIndex);
|
|
1273
1262
|
},
|
|
1274
1263
|
|
|
1275
|
-
getValidIndex(index
|
|
1264
|
+
getValidIndex(index = this.index, prevIndex = this.prevIndex) {
|
|
1276
1265
|
return this.getIndex(index, prevIndex);
|
|
1277
1266
|
},
|
|
1278
1267
|
|
|
@@ -1302,18 +1291,18 @@
|
|
|
1302
1291
|
return this._getTransitioner(prev, prev !== next && next).getDistance();
|
|
1303
1292
|
},
|
|
1304
1293
|
|
|
1305
|
-
_translate(percent, prev
|
|
1294
|
+
_translate(percent, prev = this.prevIndex, next = this.index) {
|
|
1306
1295
|
const transitioner = this._getTransitioner(prev !== next ? prev : false, next);
|
|
1307
1296
|
transitioner.translate(percent);
|
|
1308
1297
|
return transitioner;
|
|
1309
1298
|
},
|
|
1310
1299
|
|
|
1311
1300
|
_getTransitioner(
|
|
1312
|
-
prev,
|
|
1313
|
-
next,
|
|
1314
|
-
dir,
|
|
1315
|
-
options)
|
|
1316
|
-
{
|
|
1301
|
+
prev = this.prevIndex,
|
|
1302
|
+
next = this.index,
|
|
1303
|
+
dir = this.dir || 1,
|
|
1304
|
+
options = this.transitionOptions)
|
|
1305
|
+
{
|
|
1317
1306
|
return new this.Transitioner(
|
|
1318
1307
|
uikitUtil.isNumber(prev) ? this.slides[prev] : prev,
|
|
1319
1308
|
uikitUtil.isNumber(next) ? this.slides[next] : next,
|
|
@@ -1347,7 +1336,7 @@
|
|
|
1347
1336
|
},
|
|
1348
1337
|
|
|
1349
1338
|
computed: {
|
|
1350
|
-
animation(
|
|
1339
|
+
animation({ animation, Animations }) {
|
|
1351
1340
|
return { ...(Animations[animation] || Animations.slide), name: animation };
|
|
1352
1341
|
},
|
|
1353
1342
|
|
|
@@ -1357,15 +1346,15 @@
|
|
|
1357
1346
|
},
|
|
1358
1347
|
|
|
1359
1348
|
events: {
|
|
1360
|
-
beforeitemshow(
|
|
1349
|
+
beforeitemshow({ target }) {
|
|
1361
1350
|
uikitUtil.addClass(target, this.clsActive);
|
|
1362
1351
|
},
|
|
1363
1352
|
|
|
1364
|
-
itemshown(
|
|
1353
|
+
itemshown({ target }) {
|
|
1365
1354
|
uikitUtil.addClass(target, this.clsActivated);
|
|
1366
1355
|
},
|
|
1367
1356
|
|
|
1368
|
-
itemhidden(
|
|
1357
|
+
itemhidden({ target }) {
|
|
1369
1358
|
uikitUtil.removeClass(target, this.clsActive, this.clsActivated);
|
|
1370
1359
|
}
|
|
1371
1360
|
}
|
|
@@ -1397,15 +1386,7 @@
|
|
|
1397
1386
|
pauseOnHover: false,
|
|
1398
1387
|
velocity: 2,
|
|
1399
1388
|
Animations,
|
|
1400
|
-
template:
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1389
|
+
template: `<div class="uk-lightbox uk-overflow-hidden"> <ul class="uk-lightbox-items"></ul> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>`
|
|
1409
1390
|
}),
|
|
1410
1391
|
|
|
1411
1392
|
created() {
|
|
@@ -1417,14 +1398,14 @@
|
|
|
1417
1398
|
},
|
|
1418
1399
|
|
|
1419
1400
|
computed: {
|
|
1420
|
-
caption(
|
|
1401
|
+
caption({ selCaption }, $el) {
|
|
1421
1402
|
return uikitUtil.$(selCaption, $el);
|
|
1422
1403
|
}
|
|
1423
1404
|
},
|
|
1424
1405
|
|
|
1425
1406
|
events: [
|
|
1426
1407
|
{
|
|
1427
|
-
name: uikitUtil.pointerMove
|
|
1408
|
+
name: `${uikitUtil.pointerMove} ${uikitUtil.pointerDown} keydown`,
|
|
1428
1409
|
|
|
1429
1410
|
handler: 'showControls'
|
|
1430
1411
|
},
|
|
@@ -1435,15 +1416,13 @@
|
|
|
1435
1416
|
self: true,
|
|
1436
1417
|
|
|
1437
1418
|
delegate() {
|
|
1438
|
-
return this.
|
|
1419
|
+
return `${this.selList} > *`;
|
|
1439
1420
|
},
|
|
1440
1421
|
|
|
1441
1422
|
handler(e) {
|
|
1442
|
-
if (e.defaultPrevented) {
|
|
1443
|
-
|
|
1423
|
+
if (!e.defaultPrevented) {
|
|
1424
|
+
this.hide();
|
|
1444
1425
|
}
|
|
1445
|
-
|
|
1446
|
-
this.hide();
|
|
1447
1426
|
}
|
|
1448
1427
|
},
|
|
1449
1428
|
|
|
@@ -1560,7 +1539,7 @@
|
|
|
1560
1539
|
allowfullscreen: '',
|
|
1561
1540
|
style: 'max-width: 100%; box-sizing: border-box;',
|
|
1562
1541
|
'uk-responsive': '',
|
|
1563
|
-
'uk-video':
|
|
1542
|
+
'uk-video': `${this.videoAutoplay}`
|
|
1564
1543
|
};
|
|
1565
1544
|
|
|
1566
1545
|
// Image
|
|
@@ -1582,7 +1561,7 @@
|
|
|
1582
1561
|
poster,
|
|
1583
1562
|
controls: '',
|
|
1584
1563
|
playsinline: '',
|
|
1585
|
-
'uk-video':
|
|
1564
|
+
'uk-video': `${this.videoAutoplay}`
|
|
1586
1565
|
});
|
|
1587
1566
|
|
|
1588
1567
|
uikitUtil.on(video, 'loadedmetadata', () => {
|
|
@@ -1616,9 +1595,9 @@
|
|
|
1616
1595
|
this.setItem(
|
|
1617
1596
|
item,
|
|
1618
1597
|
createEl('iframe', {
|
|
1619
|
-
src:
|
|
1620
|
-
|
|
1621
|
-
|
|
1598
|
+
src: `https://www.youtube${matches[1] || ''}.com/embed/${matches[2]}${
|
|
1599
|
+
matches[3] ? `?${matches[3]}` : ''
|
|
1600
|
+
}`,
|
|
1622
1601
|
width: 1920,
|
|
1623
1602
|
height: 1080,
|
|
1624
1603
|
...iframeAttrs,
|
|
@@ -1630,10 +1609,10 @@
|
|
|
1630
1609
|
} else if (matches = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
|
|
1631
1610
|
try {
|
|
1632
1611
|
const { height, width } = await (
|
|
1633
|
-
await fetch(
|
|
1634
|
-
encodeURI(
|
|
1635
|
-
|
|
1636
|
-
|
|
1612
|
+
await fetch(
|
|
1613
|
+
`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
|
|
1614
|
+
src)
|
|
1615
|
+
}`,
|
|
1637
1616
|
{
|
|
1638
1617
|
credentials: 'omit'
|
|
1639
1618
|
})).
|
|
@@ -1643,9 +1622,9 @@
|
|
|
1643
1622
|
this.setItem(
|
|
1644
1623
|
item,
|
|
1645
1624
|
createEl('iframe', {
|
|
1646
|
-
src:
|
|
1647
|
-
|
|
1648
|
-
|
|
1625
|
+
src: `https://player.vimeo.com/video/${matches[1]}${
|
|
1626
|
+
matches[2] ? `?${matches[2]}` : ''
|
|
1627
|
+
}`,
|
|
1649
1628
|
width,
|
|
1650
1629
|
height,
|
|
1651
1630
|
...iframeAttrs,
|
|
@@ -1661,7 +1640,7 @@
|
|
|
1661
1640
|
|
|
1662
1641
|
|
|
1663
1642
|
methods: {
|
|
1664
|
-
loadItem(index
|
|
1643
|
+
loadItem(index = this.index) {
|
|
1665
1644
|
const item = this.getItem(index);
|
|
1666
1645
|
|
|
1667
1646
|
if (!this.getSlide(item).childElementCount) {
|
|
@@ -1669,7 +1648,7 @@
|
|
|
1669
1648
|
}
|
|
1670
1649
|
},
|
|
1671
1650
|
|
|
1672
|
-
getItem(index
|
|
1651
|
+
getItem(index = this.index) {
|
|
1673
1652
|
return this.items[uikitUtil.getIndex(index, this.slides)];
|
|
1674
1653
|
},
|
|
1675
1654
|
|
|
@@ -1699,7 +1678,7 @@
|
|
|
1699
1678
|
};
|
|
1700
1679
|
|
|
1701
1680
|
function createEl(tag, attrs) {
|
|
1702
|
-
const el = uikitUtil.fragment(
|
|
1681
|
+
const el = uikitUtil.fragment(`<${tag}>`);
|
|
1703
1682
|
uikitUtil.attr(el, attrs);
|
|
1704
1683
|
return el;
|
|
1705
1684
|
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
/*! UIkit 3.15.18-dev.9cbbb510d | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox_panel",["uikit-util"],u):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitLightbox_panel=u(s.UIkit.util))})(this,function(s){"use strict";var u={slide:{show(e){return[{transform:y(e*-100)},{transform:y()}]},percent(e){return q(e)},translate(e,t){return[{transform:y(t*-100*e)},{transform:y(t*100*(1-e))}]}}};function q(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function y(e,t){return e===void 0&&(e=0),t===void 0&&(t="%"),e+=e?t:"","translate3d("+e+", 0, 0)"}function $(e){return"scale3d("+e+", "+e+", 1)"}var B={...u,fade:{show(){return[{opacity:0},{opacity:1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e},{opacity:e}]}},scale:{show(){return[{opacity:0,transform:$(1-.2)},{opacity:1,transform:$(1)}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:$(1-.2*e)},{opacity:e,transform:$(1-.2+.2*e)}]}}},z={props:{container:Boolean},data:{container:!0},computed:{container(e){let{container:t}=e;return t===!0&&this.$container||t&&s.$(t)}}},V={connected(){s.addClass(this.$el,this.$options.id)}},O={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave"},computed:{hasAnimation(e){let{animation:t}=e;return!!t[0]},hasTransition(e){let{animation:t}=e;return["slide","reveal"].some(n=>s.startsWith(t[0],n))}},methods:{toggleElement(e,t,n){return new Promise(o=>Promise.all(s.toNodes(e).map(a=>{const r=s.isBoolean(t)?t:!this.isToggled(a);if(!s.trigger(a,"before"+(r?"show":"hide"),[this]))return Promise.reject();const i=(s.isFunction(n)?n:n===!1||!this.hasAnimation?X:this.hasTransition?G:J)(a,r,this),h=r?this.clsEnter:this.clsLeave;s.addClass(a,h),s.trigger(a,r?"show":"hide",[this]);const d=()=>{s.removeClass(a,h),s.trigger(a,r?"shown":"hidden",[this])};return i?i.then(d,()=>(s.removeClass(a,h),Promise.reject())):d()})).then(o,s.noop))},isToggled(e){return e===void 0&&(e=this.$el),[e]=s.toNodes(e),s.hasClass(e,this.clsEnter)?!0:s.hasClass(e,this.clsLeave)?!1:this.cls?s.hasClass(e,this.cls.split(" ")[0]):s.isVisible(e)},_toggle(e,t){if(!e)return;t=Boolean(t);let n;this.cls?(n=s.includes(this.cls," ")||t!==s.hasClass(e,this.cls),n&&s.toggleClass(e,this.cls,s.includes(this.cls," ")?void 0:t)):(n=t===e.hidden,n&&(e.hidden=!t)),s.$$("[autofocus]",e).some(o=>s.isVisible(o)?o.focus()||!0:o.blur()),n&&s.trigger(e,"toggled",[t,this])}}};function X(e,t,n){let{_toggle:o}=n;return s.Animation.cancel(e),s.Transition.cancel(e),o(e,t)}async function G(e,t,n){var o;let{animation:a,duration:r,velocity:i,transition:h,_toggle:d}=n;const[c="reveal",g="top"]=((o=a[0])==null?void 0:o.split("-"))||[],l=[["left","right"],["top","bottom"]],m=l[s.includes(l[0],g)?0:1],T=m[1]===g,A=["width","height"][l.indexOf(m)],v="margin-"+m[0],_="margin-"+g;let x=s.dimensions(e)[A];const me=s.Transition.inProgress(e);await s.Transition.cancel(e),t&&d(e,!0);const ge=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",v,_].map(Y=>[Y,e.style[Y]])),I=s.dimensions(e),N=s.toFloat(s.css(e,v)),F=s.toFloat(s.css(e,_)),p=I[A]+F;!me&&!t&&(x+=F);const[P]=s.wrapInner(e,"<div>");s.css(P,{boxSizing:"border-box",height:I.height,width:I.width,...s.css(e,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",_])}),s.css(e,{padding:0,border:0,minWidth:0,minHeight:0,[_]:0,width:I.width,height:I.height,overflow:"hidden",[A]:x});const H=x/p;r=(i*p+r)*(t?1-H:H);const L={[A]:t?p:0};T&&(s.css(e,v,p-x+N),L[v]=t?N:p+N),!T^c==="reveal"&&(s.css(P,v,-p+x),s.Transition.start(P,{[v]:t?0:-p},r,h));try{await s.Transition.start(e,L,r,h)}finally{s.css(e,ge),s.unwrap(P.firstChild),t||d(e,!1)}}function J(e,t,n){s.Animation.cancel(e);const{animation:o,duration:a,_toggle:r}=n;return t?(r(e,!0),s.Animation.in(e,o[0],a,n.origin)):s.Animation.out(e,o[1]||o[0],a,n.origin).then(()=>r(e,!1))}const f=[];var K={mixins:[V,z,O],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1},computed:{panel(e,t){let{selPanel:n}=e;return s.$(n,t)},transitionElement(){return this.panel},bgClose(e){let{bgClose:t}=e;return t&&this.panel}},beforeDisconnect(){s.includes(f,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate(){return this.selClose+',a[href*="#"]'},handler(e){const{current:t,defaultPrevented:n}=e,{hash:o}=t;!n&&o&&ee(t)&&!s.within(o,this.$el)&&s.$(o,document.body)?this.hide():s.matches(t,this.selClose)&&(e.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(e){e.defaultPrevented||(e.preventDefault(),this.isToggled()===s.includes(f,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(e){if(s.includes(f,this))return!1;!this.stack&&f.length?(Promise.all(f.map(t=>t.hide())).then(this.show),e.preventDefault()):f.push(this)}},{name:"show",self:!0,handler(){s.once(this.$el,"hide",s.on(document,"focusin",e=>{s.last(f)===this&&!s.within(e.target,this.$el)&&this.$el.focus()})),this.overlay&&(s.once(this.$el,"hidden",Z(this.$el),{self:!0}),s.once(this.$el,"hidden",k(),{self:!0})),this.stack&&s.css(this.$el,"zIndex",s.toFloat(s.css(this.$el,"zIndex"))+f.length),s.addClass(document.documentElement,this.clsPage),this.bgClose&&s.once(this.$el,"hide",s.on(document,s.pointerDown,e=>{let{target:t}=e;s.last(f)!==this||this.overlay&&!s.within(t,this.$el)||s.within(t,this.panel)||s.once(document,s.pointerUp+" "+s.pointerCancel+" scroll",n=>{let{defaultPrevented:o,type:a,target:r}=n;!o&&a===s.pointerUp&&t===r&&this.hide()},!0)}),{self:!0}),this.escClose&&s.once(this.$el,"hide",s.on(document,"keydown",e=>{e.keyCode===27&&s.last(f)===this&&this.hide()}),{self:!0})}},{name:"shown",self:!0,handler(){s.isFocusable(this.$el)||s.attr(this.$el,"tabindex","-1"),s.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler(){s.includes(f,this)&&f.splice(f.indexOf(this),1),s.css(this.$el,"zIndex",""),f.some(e=>e.clsPage===this.clsPage)||s.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&s.parent(this.$el)!==this.container?(s.append(this.container,this.$el),new Promise(e=>requestAnimationFrame(()=>this.show().then(e)))):this.toggleElement(this.$el,!0,j)},hide(){return this.toggleElement(this.$el,!1,j)}}};function j(e,t,n){let{transitionElement:o,_toggle:a}=n;return new Promise((r,i)=>s.once(e,"show hide",()=>{e._reject==null||e._reject(),e._reject=i,a(e,t);const h=s.once(o,"transitionstart",()=>{s.once(o,"transitionend transitioncancel",r,{self:!0}),clearTimeout(d)},{self:!0}),d=setTimeout(()=>{h(),r()},Q(s.css(o,"transitionDuration")))})).then(()=>delete e._reject)}function Q(e){return e?s.endsWith(e,"ms")?s.toFloat(e):s.toFloat(e)*1e3:0}function Z(e){if(CSS.supports("overscroll-behavior","contain")){const o=[e,...U(e,a=>/auto|scroll/.test(s.css(a,"overflow")))];return s.css(o,"overscrollBehavior","contain"),()=>s.css(o,"overscrollBehavior","")}let t;const n=[s.on(e,"touchstart",o=>{let{targetTouches:a}=o;a.length===1&&(t=a[0].clientY)},{passive:!0}),s.on(e,"touchmove",o=>{if(o.targetTouches.length!==1)return;let[a]=s.scrollParents(o.target,/auto|scroll/);s.within(a,e)||(a=e);const r=o.targetTouches[0].clientY-t,{scrollTop:i,scrollHeight:h,clientHeight:d}=a;(d>=h||i===0&&r>0||h-i<=d&&r<0)&&o.cancelable&&o.preventDefault()},{passive:!1})];return()=>n.forEach(o=>o())}let S;function k(){if(S)return s.noop;S=!0;const{scrollingElement:e}=document;return s.css(e,{overflowY:"hidden",touchAction:"none",paddingRight:s.width(window)-e.clientWidth}),()=>{S=!1,s.css(e,{overflowY:"",touchAction:"",paddingRight:""})}}function U(e,t){const n=[];return s.apply(e,o=>{t(o)&&n.push(o)}),n}function ee(e){return["origin","pathname","search"].every(t=>e[t]===location[t])}function se(e,t,n,o){let{animation:a,easing:r}=o;const{percent:i,translate:h,show:d=s.noop}=a,c=d(n),g=new s.Deferred;return{dir:n,show(l,m,T){m===void 0&&(m=0);const b=T?"linear":r;return l-=Math.round(l*s.clamp(m,-1,1)),this.translate(m),C(t,"itemin",{percent:m,duration:l,timing:b,dir:n}),C(e,"itemout",{percent:1-m,duration:l,timing:b,dir:n}),Promise.all([s.Transition.start(t,c[1],l,b),s.Transition.start(e,c[0],l,b)]).then(()=>{this.reset(),g.resolve()},s.noop),g.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const l in c[0])s.css([t,e],l,"")},forward(l,m){return m===void 0&&(m=this.percent()),s.Transition.cancel([t,e]),this.show(l,m,!0)},translate(l){this.reset();const m=h(l,n);s.css(t,m[1]),s.css(e,m[0]),C(t,"itemtranslatein",{percent:l,dir:n}),C(e,"itemtranslateout",{percent:1-l,dir:n})},percent(){return i(e||t,t,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function C(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var te={connected(){var e;this.registerObserver(s.observeResize(((e=this.$options.resizeTargets)==null?void 0:e.call(this))||this.$el,()=>this.$emit("resize")))}},ne={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){s.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el(){return document},filter(){return this.autoplay},handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>(!this.draggable||!s.$(":focus",this.$el))&&(!this.pauseOnHover||!s.matches(this.$el,":hover"))&&!this.stack.length&&this.show("next"),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)}}};const E={passive:!1,capture:!0},M={passive:!0,capture:!0},oe="touchstart mousedown",D="touchmove mousemove",W="touchend touchcancel mouseup click input scroll";var re={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const o=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=o===this.pos?this.prevPos:this.pos,this.pos=o,t(n)}}},events:[{name:oe,passive:!0,delegate(){return this.selSlides},handler(e){!this.draggable||!s.isTouch(e)&&ae(e.target)||s.closest(e.target,s.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(e){e.preventDefault()}},{name:D,el(){return this.list},handler:s.noop,...E}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,s.on(document,D,this.move,E),s.on(document,W,this.end,M),s.css(this.list,"userSelect","none")},move(e){const t=this.pos-this.drag;if(t===0||this.prevPos===this.pos||!this.dragging&&Math.abs(t)<this.threshold)return;s.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=t<0?1:-1;const{slides:n}=this;let{prevIndex:o}=this,a=Math.abs(t),r=this.getIndex(o+this.dir,o),i=this._getDistance(o,r)||n[o].offsetWidth;for(;r!==o&&a>i;)this.drag-=i*this.dir,o=r,a-=i,r=this.getIndex(o+this.dir,o),i=this._getDistance(o,r)||n[o].offsetWidth;this.percent=a/i;const h=n[o],d=n[r],c=this.index!==r,g=o===r;let l;[this.index,this.prevIndex].filter(m=>!s.includes([r,o],m)).forEach(m=>{s.trigger(n[m],"itemhidden",[this]),g&&(l=!0,this.prevIndex=o)}),(this.index===o&&this.prevIndex!==o||l)&&s.trigger(n[this.index],"itemshown",[this]),c&&(this.prevIndex=o,this.index=r,!g&&s.trigger(h,"beforeitemhide",[this]),s.trigger(d,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),h,!g&&d),c&&(!g&&s.trigger(h,"itemhide",[this]),s.trigger(d,"itemshow",[this]))},end(){if(s.off(document,D,this.move,E),s.off(document,W,this.end,M),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{const e=(s.isRtl?this.dir*(s.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=e?this.index:this.prevIndex,e&&(this.percent=1-this.percent),this.show(this.dir>0&&!e||this.dir<0&&e?"next":"previous",!0)}s.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function ae(e){return s.css(e,"userSelect")!=="none"&&s.toNodes(e.childNodes).some(t=>t.nodeType===3&&t.textContent.trim())}var ie={data:{selNav:!1},computed:{nav(e,t){let{selNav:n}=e;return s.$(n,t)},selNavItem(e){let{attrItem:t}=e;return"["+t+"],[data-"+t+"]"},navItems(e,t){return s.$$(this.selNavItem,t)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&s.html(this.nav,this.slides.map((e,t)=>"<li "+this.attrItem+'="'+t+'"><a href></a></li>').join("")),this.navItems.concat(this.nav).forEach(e=>e&&(e.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(e){e.preventDefault(),this.show(s.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const e=this.getValidIndex();for(const t of this.navItems){const n=s.data(t,this.attrItem);s.toggleClass(t,this.clsActive,s.toNumber(n)===e),s.toggleClass(t,"uk-invisible",this.finite&&(n==="previous"&&e===0||n==="next"&&e>=this.maxIndex))}}}},he={mixins:[ne,re,ie,te],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number,selSlides:String},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){s.removeClass(this.slides,this.clsActive)},computed:{duration(e,t){let{velocity:n}=e;return ce(t.offsetWidth/n)},list(e,t){let{selList:n}=e;return s.$(n,t)},maxIndex(){return this.length-1},selSlides(e){let{selList:t,selSlides:n}=e;return t+" "+(n||"> *")},slides:{get(){return s.$$(this.selSlides,this.$el)},watch(){this.$emit("resize")}},length(){return this.slides.length}},methods:{show(e,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,o=t?0:n.length,a=()=>{n.splice(o,1),n.length&&this.show(n.shift(),!0)};if(n[t?"unshift":"push"](e),!t&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const r=this.getIndex(this.index),i=s.hasClass(this.slides,this.clsActive)&&this.slides[r],h=this.getIndex(e,this.index),d=this.slides[h];if(i===d){a();return}if(this.dir=de(e,r),this.prevIndex=r,this.index=h,i&&!s.trigger(i,"beforeitemhide",[this])||!s.trigger(d,"beforeitemshow",[this,i])){this.index=this.prevIndex,a();return}const c=this._show(i,d,t).then(()=>(i&&s.trigger(i,"itemhidden",[this]),s.trigger(d,"itemshown",[this]),new Promise(g=>{requestAnimationFrame(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,g()})})));return i&&s.trigger(i,"itemhide",[this]),s.trigger(d,"itemshow",[this]),c},getIndex(e,t){return e===void 0&&(e=this.index),t===void 0&&(t=this.index),s.clamp(s.getIndex(e,this.slides,t,this.finite),0,this.maxIndex)},getValidIndex(e,t){return e===void 0&&(e=this.index),t===void 0&&(t=this.prevIndex),this.getIndex(e,t)},_show(e,t,n){if(this._transitioner=this._getTransitioner(e,t,this.dir,{easing:n?t.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":this.easing,...this.transitionOptions}),!n&&!e)return this._translate(1),Promise.resolve();const{length:o}=this.stack;return this._transitioner[o>1?"forward":"show"](o>1?Math.min(this.duration,75+75/(o-1)):this.duration,this.percent)},_getDistance(e,t){return this._getTransitioner(e,e!==t&&t).getDistance()},_translate(e,t,n){t===void 0&&(t=this.prevIndex),n===void 0&&(n=this.index);const o=this._getTransitioner(t!==n?t:!1,n);return o.translate(e),o},_getTransitioner(e,t,n,o){return e===void 0&&(e=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),o===void 0&&(o=this.transitionOptions),new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),o)}}};function de(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function ce(e){return .5*e+300}var le={mixins:[he],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:u,Transitioner:se},computed:{animation(e){let{animation:t,Animations:n}=e;return{...n[t]||n.slide,name:t}},transitionOptions(){return{animation:this.animation}}},events:{beforeitemshow(e){let{target:t}=e;s.addClass(t,this.clsActive)},itemshown(e){let{target:t}=e;s.addClass(t,this.clsActivated)},itemhidden(e){let{target:t}=e;s.removeClass(t,this.clsActive,this.clsActivated)}}},R={mixins:[z,K,O,le],functional:!0,props:{delayControls:Number,preload:Number,videoAutoplay:Boolean,template:String},data:()=>({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:B,template:'<div class="uk-lightbox uk-overflow-hidden"> <ul class="uk-lightbox-items"></ul> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>'}),created(){const e=s.$(this.template),t=s.$(this.selList,e);this.items.forEach(()=>s.append(t,"<li>")),this.$mount(s.append(this.container,e))},computed:{caption(e,t){let{selCaption:n}=e;return s.$(n,t)}},events:[{name:s.pointerMove+" "+s.pointerDown+" keydown",handler:"showControls"},{name:"click",self:!0,delegate(){return this.selSlides},handler(e){e.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler(){this.showControls()}},{name:"hide",self:!0,handler(){this.hideControls(),s.removeClass(this.slides,this.clsActive),s.Transition.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el(){return document},handler(e){if(!(!this.isToggled(this.$el)||!this.draggable))switch(e.keyCode){case 37:this.show("previous");break;case 39:this.show("next");break}}},{name:"beforeitemshow",handler(e){this.isToggled()||(this.draggable=!1,e.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=B.scale,s.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){s.html(this.caption,this.getItem().caption||"");for(let e=-this.preload;e<=this.preload;e++)this.loadItem(this.index+e)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(e,t){const{source:n,type:o,alt:a="",poster:r,attrs:i={}}=t;if(this.setItem(t,"<span uk-spinner></span>"),!n)return;let h;const d={allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":""+this.videoAutoplay};if(o==="image"||n.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i))try{const{width:c,height:g}=await s.getImage(n,i.srcset,i.size);this.setItem(t,w("img",{src:n,width:c,height:g,alt:a,...i}))}catch{this.setError(t)}else if(o==="video"||n.match(/\.(mp4|webm|ogv)($|\?)/i)){const c=w("video",{src:n,poster:r,controls:"",playsinline:"","uk-video":""+this.videoAutoplay});s.on(c,"loadedmetadata",()=>{s.attr(c,{width:c.videoWidth,height:c.videoHeight,...i}),this.setItem(t,c)}),s.on(c,"error",()=>this.setError(t))}else if(o==="iframe"||n.match(/\.(html|php)($|\?)/i))this.setItem(t,w("iframe",{src:n,allowfullscreen:"",class:"uk-lightbox-iframe",...i}));else if(h=n.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(t,w("iframe",{src:"https://www.youtube"+(h[1]||"")+".com/embed/"+h[2]+(h[3]?"?"+h[3]:""),width:1920,height:1080,...d,...i}));else if(h=n.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{const{height:c,width:g}=await(await fetch("https://vimeo.com/api/oembed.json?maxwidth=1920&url="+encodeURI(n),{credentials:"omit"})).json();this.setItem(t,w("iframe",{src:"https://player.vimeo.com/video/"+h[1]+(h[2]?"?"+h[2]:""),width:g,height:c,...d,...i}))}catch{this.setError(t)}}}],methods:{loadItem(e){e===void 0&&(e=this.index);const t=this.getItem(e);this.getSlide(t).childElementCount||s.trigger(this.$el,"itemload",[t])},getItem(e){return e===void 0&&(e=this.index),this.items[s.getIndex(e,this.slides)]},setItem(e,t){s.trigger(this.$el,"itemloaded",[this,s.html(this.getSlide(e),t)])},getSlide(e){return this.slides[this.items.indexOf(e)]},setError(e){this.setItem(e,'<span uk-icon="icon: bolt; ratio: 2"></span>')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),s.addClass(this.$el,"uk-active","uk-transition-active")},hideControls(){s.removeClass(this.$el,"uk-active","uk-transition-active")}}};function w(e,t){const n=s.fragment("<"+e+">");return s.attr(n,t),n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightboxPanel",R),R});
|
|
1
|
+
/*! UIkit 3.15.19-dev.699ab5a7f | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
|
|
2
|
+
(function(s,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox_panel",["uikit-util"],u):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitLightbox_panel=u(s.UIkit.util))})(this,function(s){"use strict";var u={slide:{show(e){return[{transform:I(e*-100)},{transform:I()}]},percent(e){return Y(e)},translate(e,t){return[{transform:I(t*-100*e)},{transform:I(t*100*(1-e))}]}}};function Y(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function I(e=0,t="%"){return e+=e?t:"",`translate3d(${e}, 0, 0)`}function y(e){return`scale3d(${e}, ${e}, 1)`}var N={...u,fade:{show(){return[{opacity:0},{opacity:1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e},{opacity:e}]}},scale:{show(){return[{opacity:0,transform:y(1-.2)},{opacity:1,transform:y(1)}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:y(1-.2*e)},{opacity:e,transform:y(1-.2+.2*e)}]}}},B={props:{container:Boolean},data:{container:!0},computed:{container({container:e}){return e===!0&&this.$container||e&&s.$(e)}}},q={connected(){s.addClass(this.$el,this.$options.id)}},z={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave"},computed:{hasAnimation({animation:e}){return!!e[0]},hasTransition({animation:e}){return["slide","reveal"].some(t=>s.startsWith(e[0],t))}},methods:{toggleElement(e,t,n){return new Promise(r=>Promise.all(s.toNodes(e).map(h=>{const a=s.isBoolean(t)?t:!this.isToggled(h);if(!s.trigger(h,`before${a?"show":"hide"}`,[this]))return Promise.reject();const o=(s.isFunction(n)?n:n===!1||!this.hasAnimation?V:this.hasTransition?X:G)(h,a,this),i=a?this.clsEnter:this.clsLeave;s.addClass(h,i),s.trigger(h,a?"show":"hide",[this]);const d=()=>{s.removeClass(h,i),s.trigger(h,a?"shown":"hidden",[this])};return o?o.then(d,()=>(s.removeClass(h,i),Promise.reject())):d()})).then(r,s.noop))},isToggled(e=this.$el){return[e]=s.toNodes(e),s.hasClass(e,this.clsEnter)?!0:s.hasClass(e,this.clsLeave)?!1:this.cls?s.hasClass(e,this.cls.split(" ")[0]):s.isVisible(e)},_toggle(e,t){if(!e)return;t=Boolean(t);let n;this.cls?(n=s.includes(this.cls," ")||t!==s.hasClass(e,this.cls),n&&s.toggleClass(e,this.cls,s.includes(this.cls," ")?void 0:t)):(n=t===e.hidden,n&&(e.hidden=!t)),s.$$("[autofocus]",e).some(r=>s.isVisible(r)?r.focus()||!0:r.blur()),n&&s.trigger(e,"toggled",[t,this])}}};function V(e,t,{_toggle:n}){return s.Animation.cancel(e),s.Transition.cancel(e),n(e,t)}async function X(e,t,{animation:n,duration:r,velocity:h,transition:a,_toggle:o}){var i;const[d="reveal",l="top"]=((i=n[0])==null?void 0:i.split("-"))||[],c=[["left","right"],["top","bottom"]],m=c[s.includes(c[0],l)?0:1],g=m[1]===l,T=["width","height"][c.indexOf(m)],v=`margin-${m[0]}`,A=`margin-${l}`;let x=s.dimensions(e)[T];const le=s.Transition.inProgress(e);await s.Transition.cancel(e),t&&o(e,!0);const me=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",v,A].map(L=>[L,e.style[L]])),$=s.dimensions(e),D=s.toFloat(s.css(e,v)),R=s.toFloat(s.css(e,A)),f=$[T]+R;!le&&!t&&(x+=R);const[_]=s.wrapInner(e,"<div>");s.css(_,{boxSizing:"border-box",height:$.height,width:$.width,...s.css(e,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",A])}),s.css(e,{padding:0,border:0,minWidth:0,minHeight:0,[A]:0,width:$.width,height:$.height,overflow:"hidden",[T]:x});const F=x/f;r=(h*f+r)*(t?1-F:F);const H={[T]:t?f:0};g&&(s.css(e,v,f-x+D),H[v]=t?D:f+D),!g^d==="reveal"&&(s.css(_,v,-f+x),s.Transition.start(_,{[v]:t?0:-f},r,a));try{await s.Transition.start(e,H,r,a)}finally{s.css(e,me),s.unwrap(_.firstChild),t||o(e,!1)}}function G(e,t,n){s.Animation.cancel(e);const{animation:r,duration:h,_toggle:a}=n;return t?(a(e,!0),s.Animation.in(e,r[0],h,n.origin)):s.Animation.out(e,r[1]||r[0],h,n.origin).then(()=>a(e,!1))}const p=[];var J={mixins:[q,B,z],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1},computed:{panel({selPanel:e},t){return s.$(e,t)},transitionElement(){return this.panel},bgClose({bgClose:e}){return e&&this.panel}},beforeDisconnect(){s.includes(p,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate(){return`${this.selClose},a[href*="#"]`},handler(e){const{current:t,defaultPrevented:n}=e,{hash:r}=t;!n&&r&&U(t)&&!s.within(r,this.$el)&&s.$(r,document.body)?this.hide():s.matches(t,this.selClose)&&(e.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(e){e.defaultPrevented||(e.preventDefault(),this.isToggled()===s.includes(p,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(e){if(s.includes(p,this))return!1;!this.stack&&p.length?(Promise.all(p.map(t=>t.hide())).then(this.show),e.preventDefault()):p.push(this)}},{name:"show",self:!0,handler(){s.once(this.$el,"hide",s.on(document,"focusin",e=>{s.last(p)===this&&!s.within(e.target,this.$el)&&this.$el.focus()})),this.overlay&&(s.once(this.$el,"hidden",Q(this.$el),{self:!0}),s.once(this.$el,"hidden",Z(),{self:!0})),this.stack&&s.css(this.$el,"zIndex",s.toFloat(s.css(this.$el,"zIndex"))+p.length),s.addClass(document.documentElement,this.clsPage),this.bgClose&&s.once(this.$el,"hide",s.on(document,s.pointerDown,({target:e})=>{s.last(p)!==this||this.overlay&&!s.within(e,this.$el)||s.within(e,this.panel)||s.once(document,`${s.pointerUp} ${s.pointerCancel} scroll`,({defaultPrevented:t,type:n,target:r})=>{!t&&n===s.pointerUp&&e===r&&this.hide()},!0)}),{self:!0}),this.escClose&&s.once(this.$el,"hide",s.on(document,"keydown",e=>{e.keyCode===27&&s.last(p)===this&&this.hide()}),{self:!0})}},{name:"shown",self:!0,handler(){s.isFocusable(this.$el)||s.attr(this.$el,"tabindex","-1"),s.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler(){s.includes(p,this)&&p.splice(p.indexOf(this),1),s.css(this.$el,"zIndex",""),p.some(e=>e.clsPage===this.clsPage)||s.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&s.parent(this.$el)!==this.container?(s.append(this.container,this.$el),new Promise(e=>requestAnimationFrame(()=>this.show().then(e)))):this.toggleElement(this.$el,!0,O)},hide(){return this.toggleElement(this.$el,!1,O)}}};function O(e,t,{transitionElement:n,_toggle:r}){return new Promise((h,a)=>s.once(e,"show hide",()=>{e._reject==null||e._reject(),e._reject=a,r(e,t);const o=s.once(n,"transitionstart",()=>{s.once(n,"transitionend transitioncancel",h,{self:!0}),clearTimeout(i)},{self:!0}),i=setTimeout(()=>{o(),h()},K(s.css(n,"transitionDuration")))})).then(()=>delete e._reject)}function K(e){return e?s.endsWith(e,"ms")?s.toFloat(e):s.toFloat(e)*1e3:0}function Q(e){if(CSS.supports("overscroll-behavior","contain")){const r=[e,...k(e,h=>/auto|scroll/.test(s.css(h,"overflow")))];return s.css(r,"overscrollBehavior","contain"),()=>s.css(r,"overscrollBehavior","")}let t;const n=[s.on(e,"touchstart",({targetTouches:r})=>{r.length===1&&(t=r[0].clientY)},{passive:!0}),s.on(e,"touchmove",r=>{if(r.targetTouches.length!==1)return;let[h]=s.scrollParents(r.target,/auto|scroll/);s.within(h,e)||(h=e);const a=r.targetTouches[0].clientY-t,{scrollTop:o,scrollHeight:i,clientHeight:d}=h;(d>=i||o===0&&a>0||i-o<=d&&a<0)&&r.cancelable&&r.preventDefault()},{passive:!1})];return()=>n.forEach(r=>r())}let P;function Z(){if(P)return s.noop;P=!0;const{scrollingElement:e}=document;return s.css(e,{overflowY:"hidden",touchAction:"none",paddingRight:s.width(window)-e.clientWidth}),()=>{P=!1,s.css(e,{overflowY:"",touchAction:"",paddingRight:""})}}function k(e,t){const n=[];return s.apply(e,r=>{t(r)&&n.push(r)}),n}function U(e){return["origin","pathname","search"].every(t=>e[t]===location[t])}function ee(e,t,n,{animation:r,easing:h}){const{percent:a,translate:o,show:i=s.noop}=r,d=i(n),l=new s.Deferred;return{dir:n,show(c,m=0,g){const b=g?"linear":h;return c-=Math.round(c*s.clamp(m,-1,1)),this.translate(m),C(t,"itemin",{percent:m,duration:c,timing:b,dir:n}),C(e,"itemout",{percent:1-m,duration:c,timing:b,dir:n}),Promise.all([s.Transition.start(t,d[1],c,b),s.Transition.start(e,d[0],c,b)]).then(()=>{this.reset(),l.resolve()},s.noop),l.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const c in d[0])s.css([t,e],c,"")},forward(c,m=this.percent()){return s.Transition.cancel([t,e]),this.show(c,m,!0)},translate(c){this.reset();const m=o(c,n);s.css(t,m[1]),s.css(e,m[0]),C(t,"itemtranslatein",{percent:c,dir:n}),C(e,"itemtranslateout",{percent:1-c,dir:n})},percent(){return a(e||t,t,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function C(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var se={connected(){var e;this.registerObserver(s.observeResize(((e=this.$options.resizeTargets)==null?void 0:e.call(this))||this.$el,()=>this.$emit("resize")))}},te={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){s.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el(){return document},filter(){return this.autoplay},handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>(!this.draggable||!s.$(":focus",this.$el))&&(!this.pauseOnHover||!s.matches(this.$el,":hover"))&&!this.stack.length&&this.show("next"),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)}}};const S={passive:!1,capture:!0},j={passive:!0,capture:!0},ne="touchstart mousedown",E="touchmove mousemove",M="touchend touchcancel mouseup click input scroll";var re={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const r=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=r===this.pos?this.prevPos:this.pos,this.pos=r,t(n)}}},events:[{name:ne,passive:!0,delegate(){return`${this.selList} > *`},handler(e){!this.draggable||!s.isTouch(e)&&oe(e.target)||s.closest(e.target,s.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(e){e.preventDefault()}},{name:E,el(){return this.list},handler:s.noop,...S}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,s.on(document,E,this.move,S),s.on(document,M,this.end,j),s.css(this.list,"userSelect","none")},move(e){const t=this.pos-this.drag;if(t===0||this.prevPos===this.pos||!this.dragging&&Math.abs(t)<this.threshold)return;s.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=t<0?1:-1;const{slides:n}=this;let{prevIndex:r}=this,h=Math.abs(t),a=this.getIndex(r+this.dir,r),o=this._getDistance(r,a)||n[r].offsetWidth;for(;a!==r&&h>o;)this.drag-=o*this.dir,r=a,h-=o,a=this.getIndex(r+this.dir,r),o=this._getDistance(r,a)||n[r].offsetWidth;this.percent=h/o;const i=n[r],d=n[a],l=this.index!==a,c=r===a;let m;[this.index,this.prevIndex].filter(g=>!s.includes([a,r],g)).forEach(g=>{s.trigger(n[g],"itemhidden",[this]),c&&(m=!0,this.prevIndex=r)}),(this.index===r&&this.prevIndex!==r||m)&&s.trigger(n[this.index],"itemshown",[this]),l&&(this.prevIndex=r,this.index=a,!c&&s.trigger(i,"beforeitemhide",[this]),s.trigger(d,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),i,!c&&d),l&&(!c&&s.trigger(i,"itemhide",[this]),s.trigger(d,"itemshow",[this]))},end(){if(s.off(document,E,this.move,S),s.off(document,M,this.end,j),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{const e=(s.isRtl?this.dir*(s.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=e?this.index:this.prevIndex,e&&(this.percent=1-this.percent),this.show(this.dir>0&&!e||this.dir<0&&e?"next":"previous",!0)}s.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function oe(e){return s.css(e,"userSelect")!=="none"&&s.toNodes(e.childNodes).some(t=>t.nodeType===3&&t.textContent.trim())}var ae={data:{selNav:!1},computed:{nav({selNav:e},t){return s.$(e,t)},selNavItem({attrItem:e}){return`[${e}],[data-${e}]`},navItems(e,t){return s.$$(this.selNavItem,t)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&s.html(this.nav,this.slides.map((e,t)=>`<li ${this.attrItem}="${t}"><a href></a></li>`).join("")),this.navItems.concat(this.nav).forEach(e=>e&&(e.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(e){e.preventDefault(),this.show(s.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const e=this.getValidIndex();for(const t of this.navItems){const n=s.data(t,this.attrItem);s.toggleClass(t,this.clsActive,s.toNumber(n)===e),s.toggleClass(t,"uk-invisible",this.finite&&(n==="previous"&&e===0||n==="next"&&e>=this.maxIndex))}}}},he={mixins:[te,re,ae,se],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){s.removeClass(this.slides,this.clsActive)},computed:{duration({velocity:e},t){return ce(t.offsetWidth/e)},list({selList:e},t){return s.$(e,t)},maxIndex(){return this.length-1},slides:{get(){return s.children(this.list)},watch(){this.$emit("resize")}},length(){return this.slides.length}},methods:{show(e,t=!1){if(this.dragging||!this.length)return;const{stack:n}=this,r=t?0:n.length,h=()=>{n.splice(r,1),n.length&&this.show(n.shift(),!0)};if(n[t?"unshift":"push"](e),!t&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const a=this.getIndex(this.index),o=s.hasClass(this.slides,this.clsActive)&&this.slides[a],i=this.getIndex(e,this.index),d=this.slides[i];if(o===d){h();return}if(this.dir=ie(e,a),this.prevIndex=a,this.index=i,o&&!s.trigger(o,"beforeitemhide",[this])||!s.trigger(d,"beforeitemshow",[this,o])){this.index=this.prevIndex,h();return}const l=this._show(o,d,t).then(()=>(o&&s.trigger(o,"itemhidden",[this]),s.trigger(d,"itemshown",[this]),new Promise(c=>{requestAnimationFrame(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,c()})})));return o&&s.trigger(o,"itemhide",[this]),s.trigger(d,"itemshow",[this]),l},getIndex(e=this.index,t=this.index){return s.clamp(s.getIndex(e,this.slides,t,this.finite),0,this.maxIndex)},getValidIndex(e=this.index,t=this.prevIndex){return this.getIndex(e,t)},_show(e,t,n){if(this._transitioner=this._getTransitioner(e,t,this.dir,{easing:n?t.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":this.easing,...this.transitionOptions}),!n&&!e)return this._translate(1),Promise.resolve();const{length:r}=this.stack;return this._transitioner[r>1?"forward":"show"](r>1?Math.min(this.duration,75+75/(r-1)):this.duration,this.percent)},_getDistance(e,t){return this._getTransitioner(e,e!==t&&t).getDistance()},_translate(e,t=this.prevIndex,n=this.index){const r=this._getTransitioner(t!==n?t:!1,n);return r.translate(e),r},_getTransitioner(e=this.prevIndex,t=this.index,n=this.dir||1,r=this.transitionOptions){return new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),r)}}};function ie(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function ce(e){return .5*e+300}var de={mixins:[he],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:u,Transitioner:ee},computed:{animation({animation:e,Animations:t}){return{...t[e]||t.slide,name:e}},transitionOptions(){return{animation:this.animation}}},events:{beforeitemshow({target:e}){s.addClass(e,this.clsActive)},itemshown({target:e}){s.addClass(e,this.clsActivated)},itemhidden({target:e}){s.removeClass(e,this.clsActive,this.clsActivated)}}},W={mixins:[B,J,z,de],functional:!0,props:{delayControls:Number,preload:Number,videoAutoplay:Boolean,template:String},data:()=>({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:N,template:'<div class="uk-lightbox uk-overflow-hidden"> <ul class="uk-lightbox-items"></ul> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>'}),created(){const e=s.$(this.template),t=s.$(this.selList,e);this.items.forEach(()=>s.append(t,"<li>")),this.$mount(s.append(this.container,e))},computed:{caption({selCaption:e},t){return s.$(e,t)}},events:[{name:`${s.pointerMove} ${s.pointerDown} keydown`,handler:"showControls"},{name:"click",self:!0,delegate(){return`${this.selList} > *`},handler(e){e.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler(){this.showControls()}},{name:"hide",self:!0,handler(){this.hideControls(),s.removeClass(this.slides,this.clsActive),s.Transition.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el(){return document},handler(e){if(!(!this.isToggled(this.$el)||!this.draggable))switch(e.keyCode){case 37:this.show("previous");break;case 39:this.show("next");break}}},{name:"beforeitemshow",handler(e){this.isToggled()||(this.draggable=!1,e.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=N.scale,s.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){s.html(this.caption,this.getItem().caption||"");for(let e=-this.preload;e<=this.preload;e++)this.loadItem(this.index+e)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(e,t){const{source:n,type:r,alt:h="",poster:a,attrs:o={}}=t;if(this.setItem(t,"<span uk-spinner></span>"),!n)return;let i;const d={allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":`${this.videoAutoplay}`};if(r==="image"||n.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i))try{const{width:l,height:c}=await s.getImage(n,o.srcset,o.size);this.setItem(t,w("img",{src:n,width:l,height:c,alt:h,...o}))}catch{this.setError(t)}else if(r==="video"||n.match(/\.(mp4|webm|ogv)($|\?)/i)){const l=w("video",{src:n,poster:a,controls:"",playsinline:"","uk-video":`${this.videoAutoplay}`});s.on(l,"loadedmetadata",()=>{s.attr(l,{width:l.videoWidth,height:l.videoHeight,...o}),this.setItem(t,l)}),s.on(l,"error",()=>this.setError(t))}else if(r==="iframe"||n.match(/\.(html|php)($|\?)/i))this.setItem(t,w("iframe",{src:n,allowfullscreen:"",class:"uk-lightbox-iframe",...o}));else if(i=n.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(t,w("iframe",{src:`https://www.youtube${i[1]||""}.com/embed/${i[2]}${i[3]?`?${i[3]}`:""}`,width:1920,height:1080,...d,...o}));else if(i=n.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{const{height:l,width:c}=await(await fetch(`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(n)}`,{credentials:"omit"})).json();this.setItem(t,w("iframe",{src:`https://player.vimeo.com/video/${i[1]}${i[2]?`?${i[2]}`:""}`,width:c,height:l,...d,...o}))}catch{this.setError(t)}}}],methods:{loadItem(e=this.index){const t=this.getItem(e);this.getSlide(t).childElementCount||s.trigger(this.$el,"itemload",[t])},getItem(e=this.index){return this.items[s.getIndex(e,this.slides)]},setItem(e,t){s.trigger(this.$el,"itemloaded",[this,s.html(this.getSlide(e),t)])},getSlide(e){return this.slides[this.items.indexOf(e)]},setError(e){this.setItem(e,'<span uk-icon="icon: bolt; ratio: 2"></span>')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),s.addClass(this.$el,"uk-active","uk-transition-active")},hideControls(){s.removeClass(this.$el,"uk-active","uk-transition-active")}}};function w(e,t){const n=s.fragment(`<${e}>`);return s.attr(n,t),n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightboxPanel",W),W});
|