uikit 3.11.2-dev.44c622843 → 3.11.2-dev.536e1a374
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 +40 -19
- package/dist/css/uikit-core-rtl.css +97 -190
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +97 -190
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +99 -196
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +99 -196
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +24 -51
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +6 -8
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +30 -69
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +31 -71
- 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 +117 -80
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +117 -80
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +87 -58
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +117 -80
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +43 -29
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +5 -7
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +3 -3
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +2 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +600 -508
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +857 -764
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/component.js +2 -11
- package/src/js/api/hooks.js +3 -3
- package/src/js/api/state.js +173 -140
- package/src/js/components/countdown.js +24 -51
- package/src/js/components/filter.js +2 -3
- package/src/js/components/internal/lightbox-animations.js +4 -3
- package/src/js/components/internal/slider-preload.js +9 -0
- package/src/js/components/internal/slideshow-animations.js +4 -3
- package/src/js/components/lightbox-panel.js +34 -58
- package/src/js/components/lightbox.js +1 -2
- package/src/js/components/slider.js +60 -43
- package/src/js/components/slideshow.js +8 -1
- package/src/js/components/sortable.js +1 -1
- package/src/js/components/upload.js +2 -1
- package/src/js/core/accordion.js +6 -1
- package/src/js/core/alert.js +1 -2
- package/src/js/core/core.js +2 -75
- package/src/js/core/cover.js +5 -1
- package/src/js/core/drop.js +3 -1
- package/src/js/core/form-custom.js +2 -2
- package/src/js/core/height-viewport.js +3 -0
- package/src/js/core/icon.js +13 -6
- package/src/js/core/img.js +131 -122
- package/src/js/core/modal.js +1 -2
- package/src/js/core/navbar.js +3 -3
- package/src/js/core/offcanvas.js +2 -1
- package/src/js/core/sticky.js +51 -57
- package/src/js/core/svg.js +10 -6
- package/src/js/core/switcher.js +11 -3
- package/src/js/core/toggle.js +5 -2
- package/src/js/core/video.js +13 -1
- package/src/js/mixin/internal/animate-slide.js +9 -12
- package/src/js/mixin/lazyload.js +20 -0
- package/src/js/mixin/parallax.js +118 -81
- package/src/js/mixin/slider.js +8 -22
- package/src/js/mixin/slideshow.js +2 -6
- package/src/js/mixin/swipe.js +72 -0
- package/src/js/mixin/togglable.js +2 -3
- package/src/js/util/ajax.js +15 -14
- package/src/js/util/animation.js +7 -12
- package/src/js/util/dimensions.js +4 -4
- package/src/js/util/dom.js +22 -33
- package/src/js/util/filter.js +1 -2
- package/src/js/util/index.js +1 -0
- package/src/js/util/lang.js +7 -6
- package/src/js/util/observer.js +36 -0
- package/src/js/util/options.js +2 -11
- package/src/js/util/player.js +5 -4
- package/src/js/util/selector.js +12 -18
- package/src/js/util/style.js +4 -4
- package/src/less/components/base.less +10 -33
- package/src/less/components/form-range.less +48 -95
- package/src/less/components/form.less +0 -1
- package/src/less/components/height.less +3 -0
- package/src/less/components/leader.less +0 -1
- package/src/less/components/lightbox.less +0 -1
- package/src/less/components/modal.less +3 -7
- package/src/less/components/progress.less +14 -36
- package/src/less/components/slider.less +0 -3
- package/src/less/components/slideshow.less +0 -3
- package/src/less/components/text.less +16 -32
- package/src/less/components/utility.less +6 -3
- package/src/scss/components/base.scss +10 -33
- package/src/scss/components/form-range.scss +48 -95
- package/src/scss/components/form.scss +0 -1
- package/src/scss/components/height.scss +3 -0
- package/src/scss/components/leader.scss +0 -1
- package/src/scss/components/lightbox.scss +0 -1
- package/src/scss/components/modal.scss +3 -7
- package/src/scss/components/progress.scss +14 -36
- package/src/scss/components/slider.scss +0 -3
- package/src/scss/components/slideshow.scss +0 -3
- package/src/scss/components/text.scss +16 -32
- package/src/scss/components/utility.scss +6 -3
- package/src/scss/mixins-theme.scss +1 -1
- package/src/scss/mixins.scss +1 -1
- package/src/scss/variables-theme.scss +3 -3
- package/src/scss/variables.scss +3 -3
- package/tests/align.html +10 -10
- package/tests/animation.html +2 -2
- package/tests/article.html +2 -2
- package/tests/base.html +3 -3
- package/tests/card.html +10 -10
- package/tests/column.html +3 -3
- package/tests/comment.html +9 -9
- package/tests/countdown.html +10 -8
- package/tests/dotnav.html +3 -3
- package/tests/image.html +296 -64
- package/tests/images/image-type.avif +0 -0
- package/tests/images/image-type.jpeg +0 -0
- package/tests/images/image-type.webp +0 -0
- package/tests/index.html +8 -8
- package/tests/lightbox.html +10 -10
- package/tests/marker.html +2 -2
- package/tests/modal.html +8 -9
- package/tests/navbar.html +2 -2
- package/tests/overlay.html +7 -7
- package/tests/parallax.html +16 -7
- package/tests/position.html +12 -12
- package/tests/slidenav.html +12 -12
- package/tests/slider.html +20 -20
- package/tests/sortable.html +1 -1
- package/tests/sticky-parallax.html +56 -71
- package/tests/svg.html +6 -6
- package/tests/table.html +11 -11
- package/tests/thumbnav.html +12 -12
- package/tests/transition.html +30 -30
- package/tests/utility.html +50 -33
- package/tests/video.html +1 -1
- package/tests/width.html +1 -1
- package/src/js/util/promise.js +0 -0
- package/tests/images/animated.gif +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.536e1a374 | 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')) :
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
events: {
|
|
108
|
-
|
|
108
|
+
load() {
|
|
109
109
|
this.$emit();
|
|
110
110
|
} },
|
|
111
111
|
|
|
@@ -116,50 +116,44 @@
|
|
|
116
116
|
},
|
|
117
117
|
|
|
118
118
|
getCss(percent) {
|
|
119
|
-
|
|
120
|
-
(
|
|
119
|
+
const css = { transform: '', filter: '' };
|
|
120
|
+
for (const prop in this.props) {
|
|
121
121
|
this.props[prop](css, percent);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
{ transform: '', filter: '' });
|
|
125
|
-
|
|
122
|
+
}
|
|
123
|
+
return css;
|
|
126
124
|
} } };
|
|
127
125
|
|
|
128
126
|
|
|
129
127
|
|
|
130
|
-
function transformFn(prop, el,
|
|
131
|
-
const unit = getUnit(
|
|
128
|
+
function transformFn(prop, el, stops) {
|
|
129
|
+
const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
130
|
+
let transformFn;
|
|
132
131
|
|
|
133
132
|
if (prop === 'x' || prop === 'y') {
|
|
134
133
|
prop = "translate" + uikitUtil.ucfirst(prop);
|
|
134
|
+
transformFn = (stop) => uikitUtil.toFloat(uikitUtil.toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (steps.length === 1) {
|
|
140
|
-
steps.unshift(prop === 'scale' ? 1 : 0);
|
|
137
|
+
if (stops.length === 1) {
|
|
138
|
+
stops.unshift(prop === 'scale' ? 1 : 0);
|
|
141
139
|
}
|
|
142
140
|
|
|
143
|
-
|
|
144
|
-
let value = getValue(steps, percent);
|
|
145
|
-
|
|
146
|
-
if (uikitUtil.startsWith(prop, 'translate')) {
|
|
147
|
-
value = uikitUtil.toFloat(value).toFixed(unit === 'px' ? 0 : 6);
|
|
148
|
-
}
|
|
141
|
+
stops = parseStops(stops, transformFn);
|
|
149
142
|
|
|
150
|
-
|
|
143
|
+
return (css, percent) => {
|
|
144
|
+
css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
|
|
151
145
|
};
|
|
152
146
|
}
|
|
153
147
|
|
|
154
|
-
function colorFn(prop, el,
|
|
155
|
-
if (
|
|
156
|
-
|
|
148
|
+
function colorFn(prop, el, stops) {
|
|
149
|
+
if (stops.length === 1) {
|
|
150
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
157
151
|
}
|
|
158
152
|
|
|
159
|
-
|
|
153
|
+
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
160
154
|
|
|
161
155
|
return (css, percent) => {
|
|
162
|
-
const [start, end, p] =
|
|
156
|
+
const [start, end, p] = getStop(stops, percent);
|
|
163
157
|
const value = start.
|
|
164
158
|
map((value, i) => {
|
|
165
159
|
value += p * (end[i] - value);
|
|
@@ -179,85 +173,83 @@
|
|
|
179
173
|
map(uikitUtil.toFloat);
|
|
180
174
|
}
|
|
181
175
|
|
|
182
|
-
function filterFn(prop, el,
|
|
183
|
-
if (
|
|
184
|
-
|
|
176
|
+
function filterFn(prop, el, stops) {
|
|
177
|
+
if (stops.length === 1) {
|
|
178
|
+
stops.unshift(0);
|
|
185
179
|
}
|
|
186
180
|
|
|
187
|
-
const unit = getUnit(
|
|
181
|
+
const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
188
182
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
189
|
-
|
|
183
|
+
stops = parseStops(stops);
|
|
190
184
|
|
|
191
185
|
return (css, percent) => {
|
|
192
|
-
const value = getValue(
|
|
186
|
+
const value = getValue(stops, percent);
|
|
193
187
|
css.filter += " " + prop + "(" + (value + unit) + ")";
|
|
194
188
|
};
|
|
195
189
|
}
|
|
196
190
|
|
|
197
|
-
function cssPropFn(prop, el,
|
|
198
|
-
if (
|
|
199
|
-
|
|
191
|
+
function cssPropFn(prop, el, stops) {
|
|
192
|
+
if (stops.length === 1) {
|
|
193
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
200
194
|
}
|
|
201
195
|
|
|
202
|
-
|
|
196
|
+
stops = parseStops(stops);
|
|
203
197
|
|
|
204
198
|
return (css, percent) => {
|
|
205
|
-
css[prop] = getValue(
|
|
199
|
+
css[prop] = getValue(stops, percent);
|
|
206
200
|
};
|
|
207
201
|
}
|
|
208
202
|
|
|
209
|
-
function strokeFn(prop, el,
|
|
210
|
-
if (
|
|
211
|
-
|
|
203
|
+
function strokeFn(prop, el, stops) {
|
|
204
|
+
if (stops.length === 1) {
|
|
205
|
+
stops.unshift(0);
|
|
212
206
|
}
|
|
213
207
|
|
|
214
|
-
const unit = getUnit(
|
|
215
|
-
|
|
208
|
+
const unit = getUnit(stops);
|
|
209
|
+
const length = getMaxPathLength(el);
|
|
210
|
+
stops = parseStops(stops.reverse(), (stop) => {
|
|
211
|
+
stop = uikitUtil.toFloat(stop);
|
|
212
|
+
return unit === '%' ? stop * length / 100 : stop;
|
|
213
|
+
});
|
|
216
214
|
|
|
217
|
-
if (!
|
|
215
|
+
if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
|
|
218
216
|
return uikitUtil.noop;
|
|
219
217
|
}
|
|
220
218
|
|
|
221
|
-
const length = getMaxPathLength(el);
|
|
222
219
|
uikitUtil.css(el, 'strokeDasharray', length);
|
|
223
220
|
|
|
224
|
-
if (unit === '%') {
|
|
225
|
-
steps = steps.map((step) => step * length / 100);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
steps = steps.reverse();
|
|
229
|
-
|
|
230
221
|
return (css, percent) => {
|
|
231
|
-
css.strokeDashoffset = getValue(
|
|
222
|
+
css.strokeDashoffset = getValue(stops, percent);
|
|
232
223
|
};
|
|
233
224
|
}
|
|
234
225
|
|
|
235
|
-
function backgroundFn(prop, el,
|
|
236
|
-
if (
|
|
237
|
-
|
|
226
|
+
function backgroundFn(prop, el, stops) {
|
|
227
|
+
if (stops.length === 1) {
|
|
228
|
+
stops.unshift(0);
|
|
238
229
|
}
|
|
239
230
|
|
|
240
231
|
prop = prop.substr(-1);
|
|
241
232
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
242
|
-
|
|
233
|
+
stops = parseStops(stops, (stop) => uikitUtil.toPx(stop, attr, el));
|
|
243
234
|
|
|
244
235
|
const bgPos = getCssValue(el, "background-position-" + prop, '');
|
|
245
236
|
|
|
246
237
|
return getCssValue(el, 'backgroundSize', '') === 'cover' ?
|
|
247
|
-
backgroundCoverFn(prop, el,
|
|
248
|
-
setBackgroundPosFn(prop,
|
|
238
|
+
backgroundCoverFn(prop, el, stops, bgPos, attr) :
|
|
239
|
+
setBackgroundPosFn(prop, stops, bgPos);
|
|
249
240
|
}
|
|
250
241
|
|
|
251
|
-
function backgroundCoverFn(prop, el,
|
|
242
|
+
function backgroundCoverFn(prop, el, stops, bgPos, attr) {
|
|
252
243
|
const dimImage = getBackgroundImageDimensions(el);
|
|
253
244
|
|
|
254
245
|
if (!dimImage.width) {
|
|
255
246
|
return uikitUtil.noop;
|
|
256
247
|
}
|
|
257
248
|
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
249
|
+
const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
|
|
250
|
+
const min = Math.min(...values);
|
|
251
|
+
const max = Math.max(...values);
|
|
252
|
+
const down = values.indexOf(min) < values.indexOf(max);
|
|
261
253
|
|
|
262
254
|
const diff = max - min;
|
|
263
255
|
let pos = (down ? -diff : 0) - (down ? min : max);
|
|
@@ -282,7 +274,7 @@
|
|
|
282
274
|
|
|
283
275
|
const dim = uikitUtil.Dimensions.cover(dimImage, dimEl);
|
|
284
276
|
|
|
285
|
-
const fn = setBackgroundPosFn(prop,
|
|
277
|
+
const fn = setBackgroundPosFn(prop, stops, pos + "px");
|
|
286
278
|
return (css, percent) => {
|
|
287
279
|
fn(css, percent);
|
|
288
280
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -290,9 +282,9 @@
|
|
|
290
282
|
};
|
|
291
283
|
}
|
|
292
284
|
|
|
293
|
-
function setBackgroundPosFn(prop,
|
|
285
|
+
function setBackgroundPosFn(prop, stops, pos) {
|
|
294
286
|
return function (css, percent) {
|
|
295
|
-
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(
|
|
287
|
+
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
|
|
296
288
|
};
|
|
297
289
|
}
|
|
298
290
|
|
|
@@ -311,8 +303,9 @@
|
|
|
311
303
|
if (!image.naturalWidth) {
|
|
312
304
|
image.onload = () => {
|
|
313
305
|
dimensions[src] = toDimensions(image);
|
|
314
|
-
uikitUtil.trigger(el, '
|
|
306
|
+
uikitUtil.trigger(el, 'load');
|
|
315
307
|
};
|
|
308
|
+
return toDimensions(image);
|
|
316
309
|
}
|
|
317
310
|
}
|
|
318
311
|
|
|
@@ -326,27 +319,71 @@
|
|
|
326
319
|
|
|
327
320
|
}
|
|
328
321
|
|
|
329
|
-
function
|
|
330
|
-
const
|
|
331
|
-
const
|
|
322
|
+
function parseStops(stops, fn) {if (fn === void 0) {fn = uikitUtil.toFloat;}
|
|
323
|
+
const result = [];
|
|
324
|
+
const { length } = stops;
|
|
325
|
+
let nullIndex = 0;
|
|
326
|
+
for (let i = 0; i < length; i++) {
|
|
327
|
+
let [value, percent] = uikitUtil.isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
|
|
328
|
+
value = fn(value);
|
|
329
|
+
percent = percent ? uikitUtil.toFloat(percent) / 100 : null;
|
|
330
|
+
|
|
331
|
+
if (i === 0) {
|
|
332
|
+
if (percent === null) {
|
|
333
|
+
percent = 0;
|
|
334
|
+
} else if (percent) {
|
|
335
|
+
result.push([value, 0]);
|
|
336
|
+
}
|
|
337
|
+
} else if (i === length - 1) {
|
|
338
|
+
if (percent === null) {
|
|
339
|
+
percent = 1;
|
|
340
|
+
} else if (percent !== 1) {
|
|
341
|
+
result.push([value, percent]);
|
|
342
|
+
percent = 1;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
332
345
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
346
|
+
result.push([value, percent]);
|
|
347
|
+
|
|
348
|
+
if (percent === null) {
|
|
349
|
+
nullIndex++;
|
|
350
|
+
} else if (nullIndex) {
|
|
351
|
+
const leftPercent = result[i - nullIndex - 1][1];
|
|
352
|
+
const p = (percent - leftPercent) / (nullIndex + 1);
|
|
353
|
+
for (let j = nullIndex; j > 0; j--) {
|
|
354
|
+
result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
nullIndex = 0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return result;
|
|
336
362
|
}
|
|
337
363
|
|
|
338
|
-
function
|
|
339
|
-
const
|
|
340
|
-
return
|
|
364
|
+
function getStop(stops, percent) {
|
|
365
|
+
const index = uikitUtil.findIndex(stops.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
|
|
366
|
+
return [
|
|
367
|
+
stops[index - 1][0],
|
|
368
|
+
stops[index][0],
|
|
369
|
+
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
|
|
370
|
+
|
|
341
371
|
}
|
|
342
372
|
|
|
343
|
-
function
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
'') ||
|
|
348
|
-
defaultUnit);
|
|
373
|
+
function getValue(stops, percent) {
|
|
374
|
+
const [start, end, p] = getStop(stops, percent);
|
|
375
|
+
return uikitUtil.isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
376
|
+
}
|
|
349
377
|
|
|
378
|
+
const unitRe = /^-?\d+([^\s]*)/;
|
|
379
|
+
function getUnit(stops, defaultUnit) {
|
|
380
|
+
for (const stop of stops) {
|
|
381
|
+
const match = stop.match == null ? void 0 : stop.match(unitRe);
|
|
382
|
+
if (match) {
|
|
383
|
+
return match[1];
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
return defaultUnit;
|
|
350
387
|
}
|
|
351
388
|
|
|
352
389
|
function getCssValue(el, prop, value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.536e1a374 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(r,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslideshow_parallax",["uikit-util"],g):(r=typeof globalThis<"u"?globalThis:r||self,r.UIkitSlideshow_parallax=g(r.UIkit.util))})(this,function(r){"use strict";var g={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const e=_(this.media);return!e||window.matchMedia(e).matches}}};function _(e){if(r.isString(e)){if(e[0]==="@"){const t="breakpoint-"+e.substr(1);e=r.toFloat(r.getCssVar(t))}else if(isNaN(e))return e}return e&&!isNaN(e)?"(min-width: "+e+"px)":!1}r.memoize(async e=>e?r.startsWith(e,"data:")?decodeURIComponent(e.split(",")[1]):(await fetch(e)).text():Promise.reject());function q(e){return Math.ceil(Math.max(0,...r.$$("[stroke]",e).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const y={x:F,y:F,rotate:F,scale:F,color:v,backgroundColor:v,borderColor:v,blur:l,hue:l,fopacity:l,grayscale:l,invert:l,saturate:l,sepia:l,opacity:E,stroke:A,bgx:S,bgy:S},{keys:P}=Object;var H={mixins:[g],props:N(P(y),"list"),data:N(P(y),void 0),computed:{props(e,t){return P(y).reduce((n,o)=>(r.isUndefined(e[o])||(n[o]=y[o](o,t,e[o].slice())),n),{})}},events:{load(){this.$emit()}},methods:{reset(){r.each(this.getCss(0),(e,t)=>r.css(this.$el,t,""))},getCss(e){const t={transform:"",filter:""};for(const n in this.props)this.props[n](t,e);return t}}};function F(e,t,n){const o=$(n)||{x:"px",y:"px",rotate:"deg"}[e]||"";let a;return(e==="x"||e==="y")&&(e="translate"+r.ucfirst(e),a=s=>r.toFloat(r.toFloat(s).toFixed(o==="px"?0:6))),n.length===1&&n.unshift(e==="scale"?1:0),n=m(n,a),(s,c)=>{s.transform+=" "+e+"("+x(n,c)+o+")"}}function v(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=m(n,o=>L(t,o)),(o,a)=>{const[s,c,i]=T(n,a),u=s.map((d,f)=>(d+=i*(c[f]-d),f===3?r.toFloat(d):parseInt(d,10))).join(",");o[e]="rgba("+u+")"}}function L(e,t){return b(e,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(r.toFloat)}function l(e,t,n){n.length===1&&n.unshift(0);const o=$(n)||{blur:"px",hue:"deg"}[e]||"%";return e={fopacity:"opacity",hue:"hue-rotate"}[e]||e,n=m(n),(a,s)=>{const c=x(n,s);a.filter+=" "+e+"("+(c+o)+")"}}function E(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=m(n),(o,a)=>{o[e]=x(n,a)}}function A(e,t,n){n.length===1&&n.unshift(0);const o=$(n),a=q(t);return n=m(n.reverse(),s=>(s=r.toFloat(s),o==="%"?s*a/100:s)),n.some(s=>{let[c]=s;return c})?(r.css(t,"strokeDasharray",a),(s,c)=>{s.strokeDashoffset=x(n,c)}):r.noop}function S(e,t,n){n.length===1&&n.unshift(0),e=e.substr(-1);const o=e==="y"?"height":"width";n=m(n,s=>r.toPx(s,o,t));const a=b(t,"background-position-"+e,"");return b(t,"backgroundSize","")==="cover"?G(e,t,n,a,o):j(e,n,a)}function G(e,t,n,o,a){const s=J(t);if(!s.width)return r.noop;const c=n.map(h=>{let[D]=h;return D}),i=Math.min(...c),u=Math.max(...c),d=c.indexOf(i)<c.indexOf(u),f=u-i;let B=(d?-f:0)-(d?i:u);const w={width:t.offsetWidth,height:t.offsetHeight},R=r.Dimensions.cover(s,w),C=R[a]-w[a];if(C<f)w[a]=R[a]+f-C;else if(C>f){const h=w[a]/r.toPx(o,a,t,!0);h&&(B-=(C-f)/h)}const V=r.Dimensions.cover(s,w),Q=j(e,n,B+"px");return(h,D)=>{Q(h,D),h.backgroundSize=V.width+"px "+V.height+"px",h.backgroundRepeat="no-repeat"}}function j(e,t,n){return function(o,a){o["background-position-"+e]="calc("+n+" + "+x(t,a)+"px)"}}const I={};function J(e){const t=r.css(e,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(I[t])return I[t];const n=new Image;return t&&(n.src=t,!n.naturalWidth)?(n.onload=()=>{I[t]=M(n),r.trigger(e,"load")},M(n)):I[t]=M(n)}function M(e){return{width:e.naturalWidth,height:e.naturalHeight}}function m(e,t){t===void 0&&(t=r.toFloat);const n=[],{length:o}=e;let a=0;for(let s=0;s<o;s++){let[c,i]=r.isString(e[s])?e[s].trim().split(" "):[e[s]];if(c=t(c),i=i?r.toFloat(i)/100:null,s===0?i===null?i=0:i&&n.push([c,0]):s===o-1&&(i===null?i=1:i!==1&&(n.push([c,i]),i=1)),n.push([c,i]),i===null)a++;else if(a){const u=n[s-a-1][1],d=(i-u)/(a+1);for(let f=a;f>0;f--)n[s-f][1]=u+d*(a-f+1);a=0}}return n}function T(e,t){const n=r.findIndex(e.slice(1),o=>{let[,a]=o;return t<=a})+1;return[e[n-1][0],e[n][0],(t-e[n-1][1])/(e[n][1]-e[n-1][1])]}function x(e,t){const[n,o,a]=T(e,t);return r.isNumber(n)?n+Math.abs(n-o)*a*(n<o?1:-1):+o}const K=/^-?\d+([^\s]*)/;function $(e,t){for(const n of e){const o=n.match==null?void 0:n.match(K);if(o)return o[1]}return t}function b(e,t,n){const o=e.style[t],a=r.css(r.css(e,t,n),t);return e.style[t]=o,a}function N(e,t){return e.reduce((n,o)=>(n[o]=t,n),{})}var W={mixins:[H],data:{selItem:"!li"},computed:{item(e,t){let{selItem:n}=e;return r.query(n,t)}},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler(e){let{type:t,detail:{percent:n,duration:o,timing:a,dir:s}}=e;r.fastdom.read(()=>{const c=this.getCss(z(t,s,n)),i=this.getCss(O(t)?.5:s>0?1:0);r.fastdom.write(()=>{r.css(this.$el,c),r.Transition.start(this.$el,i,o,a).catch(r.noop)})})}},{name:"transitioncanceled transitionend",self:!0,el(){return this.item},handler(){r.Transition.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el(){return this.item},handler(e){let{type:t,detail:{percent:n,dir:o}}=e;r.fastdom.read(()=>{const a=this.getCss(z(t,o,n));r.fastdom.write(()=>r.css(this.$el,a))})}}]};function O(e){return r.endsWith(e,"in")}function z(e,t,n){return n/=2,O(e)^t<0?n:1-n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshowParallax",W),W});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.536e1a374 | 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')) :
|
|
@@ -515,12 +515,6 @@
|
|
|
515
515
|
} },
|
|
516
516
|
|
|
517
517
|
|
|
518
|
-
events: {
|
|
519
|
-
itemshown() {
|
|
520
|
-
this.$update(this.list);
|
|
521
|
-
} },
|
|
522
|
-
|
|
523
|
-
|
|
524
518
|
methods: {
|
|
525
519
|
show(index, force) {if (force === void 0) {force = false;}
|
|
526
520
|
if (this.dragging || !this.length) {
|
|
@@ -602,20 +596,13 @@
|
|
|
602
596
|
},
|
|
603
597
|
|
|
604
598
|
_show(prev, next, force) {
|
|
605
|
-
this._transitioner = this._getTransitioner(
|
|
606
|
-
prev,
|
|
607
|
-
next,
|
|
608
|
-
this.dir,
|
|
609
|
-
uikitUtil.assign(
|
|
610
|
-
{
|
|
599
|
+
this._transitioner = this._getTransitioner(prev, next, this.dir, {
|
|
611
600
|
easing: force ?
|
|
612
601
|
next.offsetWidth < 600 ?
|
|
613
602
|
'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
|
|
614
603
|
'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
|
|
615
|
-
this.easing
|
|
616
|
-
|
|
617
|
-
this.transitionOptions));
|
|
618
|
-
|
|
604
|
+
this.easing,
|
|
605
|
+
...this.transitionOptions });
|
|
619
606
|
|
|
620
607
|
|
|
621
608
|
if (!force && !prev) {
|
|
@@ -680,7 +667,7 @@
|
|
|
680
667
|
|
|
681
668
|
computed: {
|
|
682
669
|
animation(_ref) {let { animation, Animations } = _ref;
|
|
683
|
-
return
|
|
670
|
+
return { ...(Animations[animation] || Animations.slide), name: animation };
|
|
684
671
|
},
|
|
685
672
|
|
|
686
673
|
transitionOptions() {
|
|
@@ -689,23 +676,20 @@
|
|
|
689
676
|
|
|
690
677
|
|
|
691
678
|
events: {
|
|
692
|
-
|
|
693
|
-
this.$update(target);
|
|
694
|
-
},
|
|
695
|
-
|
|
696
|
-
beforeitemshow(_ref3) {let { target } = _ref3;
|
|
679
|
+
beforeitemshow(_ref2) {let { target } = _ref2;
|
|
697
680
|
uikitUtil.addClass(target, this.clsActive);
|
|
698
681
|
},
|
|
699
682
|
|
|
700
|
-
itemshown(
|
|
683
|
+
itemshown(_ref3) {let { target } = _ref3;
|
|
701
684
|
uikitUtil.addClass(target, this.clsActivated);
|
|
702
685
|
},
|
|
703
686
|
|
|
704
|
-
itemhidden(
|
|
687
|
+
itemhidden(_ref4) {let { target } = _ref4;
|
|
705
688
|
uikitUtil.removeClass(target, this.clsActive, this.clsActivated);
|
|
706
689
|
} } };
|
|
707
690
|
|
|
708
|
-
var Animations =
|
|
691
|
+
var Animations = {
|
|
692
|
+
...Animations$1,
|
|
709
693
|
fade: {
|
|
710
694
|
show() {
|
|
711
695
|
return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
|
|
@@ -794,7 +778,7 @@
|
|
|
794
778
|
{ transform: translate(-30 * percent), zIndex: -1 },
|
|
795
779
|
{ transform: translate(100 * (1 - percent)), zIndex: 0 }];
|
|
796
780
|
|
|
797
|
-
} } }
|
|
781
|
+
} } };
|
|
798
782
|
|
|
799
783
|
var SliderReactive = {
|
|
800
784
|
update: {
|
|
@@ -812,8 +796,32 @@
|
|
|
812
796
|
|
|
813
797
|
events: ['resize'] } };
|
|
814
798
|
|
|
799
|
+
var Lazyload = {
|
|
800
|
+
methods: {
|
|
801
|
+
lazyload(observeTargets, targets) {if (observeTargets === void 0) {observeTargets = this.$el;}if (targets === void 0) {targets = this.$el;}
|
|
802
|
+
this.registerObserver(
|
|
803
|
+
uikitUtil.observeIntersection(observeTargets, (entries, observer) => {
|
|
804
|
+
for (const el of uikitUtil.toNodes(uikitUtil.isFunction(targets) ? targets() : targets)) {
|
|
805
|
+
uikitUtil.$$('[loading="lazy"]', el).forEach((el) => uikitUtil.removeAttr(el, 'loading'));
|
|
806
|
+
}
|
|
807
|
+
for (const el of entries.
|
|
808
|
+
filter((_ref) => {let { isIntersecting } = _ref;return isIntersecting;}).
|
|
809
|
+
map((_ref2) => {let { target } = _ref2;return target;})) {
|
|
810
|
+
observer.unobserve(el);
|
|
811
|
+
}
|
|
812
|
+
}));
|
|
813
|
+
|
|
814
|
+
} } };
|
|
815
|
+
|
|
816
|
+
var SliderPreload = {
|
|
817
|
+
mixins: [Lazyload],
|
|
818
|
+
|
|
819
|
+
connected() {
|
|
820
|
+
this.lazyload(this.slides, this.getAdjacentSlides);
|
|
821
|
+
} };
|
|
822
|
+
|
|
815
823
|
var Component = {
|
|
816
|
-
mixins: [Class, Slideshow, SliderReactive],
|
|
824
|
+
mixins: [Class, Slideshow, SliderReactive, SliderPreload],
|
|
817
825
|
|
|
818
826
|
props: {
|
|
819
827
|
ratio: String,
|
|
@@ -856,7 +864,13 @@
|
|
|
856
864
|
height > 0 && uikitUtil.css(this.list, 'minHeight', height);
|
|
857
865
|
},
|
|
858
866
|
|
|
859
|
-
events: ['resize'] }
|
|
867
|
+
events: ['resize'] },
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
methods: {
|
|
871
|
+
getAdjacentSlides() {
|
|
872
|
+
return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
|
|
873
|
+
} } };
|
|
860
874
|
|
|
861
875
|
if (typeof window !== 'undefined' && window.UIkit) {
|
|
862
876
|
window.UIkit.component('slideshow', Component);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.44c622843 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslideshow",["uikit-util"],p):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitSlideshow=p(s.UIkit.util))})(this,function(s){"use strict";var p={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},I={slide:{show(t){return[{transform:r(t*-100)},{transform:r()}]},percent(t){return v(t)},translate(t,e){return[{transform:r(e*-100*t)},{transform:r(e*100*(1-t))}]}}};function v(t){return Math.abs(s.css(t,"transform").split(",")[4]/t.offsetWidth)||0}function r(t,e){return t===void 0&&(t=0),e===void 0&&(e="%"),t+=t?e:"","translate3d("+t+", 0, 0)"}function w(t){return"scale3d("+t+", "+t+", 1)"}function y(t,e,n,i){let{animation:m,easing:d}=i;const{percent:a,translate:f,show:l=s.noop}=m,g=l(n),c=new s.Deferred;return{dir:n,show(h,o,M){o===void 0&&(o=0);const x=M?"linear":d;return h-=Math.round(h*s.clamp(o,-1,1)),this.translate(o),u(e,"itemin",{percent:o,duration:h,timing:x,dir:n}),u(t,"itemout",{percent:1-o,duration:h,timing:x,dir:n}),Promise.all([s.Transition.start(e,g[1],h,x),s.Transition.start(t,g[0],h,x)]).then(()=>{this.reset(),c.resolve()},s.noop),c.promise},cancel(){s.Transition.cancel([e,t])},reset(){for(const h in g[0])s.css([e,t],h,"")},forward(h,o){return o===void 0&&(o=this.percent()),s.Transition.cancel([e,t]),this.show(h,o,!0)},translate(h){this.reset();const o=f(h,n);s.css(e,o[1]),s.css(t,o[0]),u(e,"itemtranslatein",{percent:h,dir:n}),u(t,"itemtranslateout",{percent:1-h,dir:n})},percent(){return a(t||e,e,n)},getDistance(){return t==null?void 0:t.offsetWidth}}}function u(t,e,n){s.trigger(t,s.createEvent(e,!1,!1,n))}var z={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)}}},_={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const t of["start","move","end"]){const e=this[t];this[t]=n=>{const i=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=i===this.pos?this.prevPos:this.pos,this.pos=i,e(n)}}},events:[{name:s.pointerDown,delegate(){return this.selSlides},handler(t){!this.draggable||!s.isTouch(t)&&A(t.target)||s.closest(t.target,s.selInput)||t.button>0||this.length<2||this.start(t)}},{name:"dragstart",handler(t){t.preventDefault()}}],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,s.pointerMove,this.move,{passive:!1}),s.on(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),s.css(this.list,"userSelect","none")},move(t){const e=this.pos-this.drag;if(e===0||this.prevPos===this.pos||!this.dragging&&Math.abs(e)<this.threshold)return;s.css(this.list,"pointerEvents","none"),t.cancelable&&t.preventDefault(),this.dragging=!0,this.dir=e<0?1:-1;const{slides:n}=this;let{prevIndex:i}=this,m=Math.abs(e),d=this.getIndex(i+this.dir,i),a=this._getDistance(i,d)||n[i].offsetWidth;for(;d!==i&&m>a;)this.drag-=a*this.dir,i=d,m-=a,d=this.getIndex(i+this.dir,i),a=this._getDistance(i,d)||n[i].offsetWidth;this.percent=m/a;const f=n[i],l=n[d],g=this.index!==d,c=i===d;let h;[this.index,this.prevIndex].filter(o=>!s.includes([d,i],o)).forEach(o=>{s.trigger(n[o],"itemhidden",[this]),c&&(h=!0,this.prevIndex=i)}),(this.index===i&&this.prevIndex!==i||h)&&s.trigger(n[this.index],"itemshown",[this]),g&&(this.prevIndex=i,this.index=d,!c&&s.trigger(f,"beforeitemhide",[this]),s.trigger(l,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),f,!c&&l),g&&(!c&&s.trigger(f,"itemhide",[this]),s.trigger(l,"itemshow",[this]))},end(){if(s.off(document,s.pointerMove,this.move,{passive:!1}),s.off(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),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 t=(s.isRtl?this.dir*(s.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=t?this.index:this.prevIndex,t&&(this.percent=1-this.percent),this.show(this.dir>0&&!t||this.dir<0&&t?"next":"previous",!0)}s.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function A(t){return!t.children.length&&t.childNodes.length}var N={data:{selNav:!1},computed:{nav(t,e){let{selNav:n}=t;return s.$(n,e)},selNavItem(t){let{attrItem:e}=t;return"["+e+"],[data-"+e+"]"},navItems(t,e){return s.$$(this.selNavItem,e)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&s.html(this.nav,this.slides.map((t,e)=>"<li "+this.attrItem+'="'+e+'"><a href></a></li>').join("")),this.navItems.concat(this.nav).forEach(t=>t&&(t.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(t){t.preventDefault(),this.show(s.data(t.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const t=this.getValidIndex();for(const e of this.navItems){const n=s.data(e,this.attrItem);s.toggleClass(e,this.clsActive,s.toNumber(n)===t),s.toggleClass(e,"uk-invisible",this.finite&&(n==="previous"&&t===0||n==="next"&&t>=this.maxIndex))}}}},S={mixins:[z,_,N],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(t,e){let{velocity:n}=t;return T(e.offsetWidth/n)},list(t,e){let{selList:n}=t;return s.$(n,e)},maxIndex(){return this.length-1},selSlides(t){let{selList:e,selSlides:n}=t;return e+" "+(n||"> *")},slides:{get(){return s.$$(this.selSlides,this.$el)},watch(){this.$reset()}},length(){return this.slides.length}},events:{itemshown(){this.$update(this.list)}},methods:{show(t,e){if(e===void 0&&(e=!1),this.dragging||!this.length)return;const{stack:n}=this,i=e?0:n.length,m=()=>{n.splice(i,1),n.length&&this.show(n.shift(),!0)};if(n[e?"unshift":"push"](t),!e&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const d=this.getIndex(this.index),a=s.hasClass(this.slides,this.clsActive)&&this.slides[d],f=this.getIndex(t,this.index),l=this.slides[f];if(a===l){m();return}if(this.dir=$(t,d),this.prevIndex=d,this.index=f,a&&!s.trigger(a,"beforeitemhide",[this])||!s.trigger(l,"beforeitemshow",[this,a])){this.index=this.prevIndex,m();return}const g=this._show(a,l,e).then(()=>(a&&s.trigger(a,"itemhidden",[this]),s.trigger(l,"itemshown",[this]),new Promise(c=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,c()})})));return a&&s.trigger(a,"itemhide",[this]),s.trigger(l,"itemshow",[this]),g},getIndex(t,e){return t===void 0&&(t=this.index),e===void 0&&(e=this.index),s.clamp(s.getIndex(t,this.slides,e,this.finite),0,this.maxIndex)},getValidIndex(t,e){return t===void 0&&(t=this.index),e===void 0&&(e=this.prevIndex),this.getIndex(t,e)},_show(t,e,n){if(this._transitioner=this._getTransitioner(t,e,this.dir,s.assign({easing:n?e.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&&!t)return this._translate(1),Promise.resolve();const{length:i}=this.stack;return this._transitioner[i>1?"forward":"show"](i>1?Math.min(this.duration,75+75/(i-1)):this.duration,this.percent)},_getDistance(t,e){return this._getTransitioner(t,t!==e&&e).getDistance()},_translate(t,e,n){e===void 0&&(e=this.prevIndex),n===void 0&&(n=this.index);const i=this._getTransitioner(e!==n?e:!1,n);return i.translate(t),i},_getTransitioner(t,e,n,i){return t===void 0&&(t=this.prevIndex),e===void 0&&(e=this.index),n===void 0&&(n=this.dir||1),i===void 0&&(i=this.transitionOptions),new this.Transitioner(s.isNumber(t)?this.slides[t]:t,s.isNumber(e)?this.slides[e]:e,n*(s.isRtl?-1:1),i)}}};function $(t,e){return t==="next"?1:t==="previous"||t<e?-1:1}function T(t){return .5*t+300}var C={mixins:[S],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:I,Transitioner:y},computed:{animation(t){let{animation:e,Animations:n}=t;return s.assign(n[e]||n.slide,{name:e})},transitionOptions(){return{animation:this.animation}}},events:{"itemshow itemhide itemshown itemhidden"(t){let{target:e}=t;this.$update(e)},beforeitemshow(t){let{target:e}=t;s.addClass(e,this.clsActive)},itemshown(t){let{target:e}=t;s.addClass(e,this.clsActivated)},itemhidden(t){let{target:e}=t;s.removeClass(e,this.clsActive,this.clsActivated)}}},D=s.assign({},I,{fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(t){return 1-s.css(t,"opacity")},translate(t){return[{opacity:1-t,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:w(1+.5),zIndex:0},{zIndex:-1}]},percent(t){return 1-s.css(t,"opacity")},translate(t){return[{opacity:1-t,transform:w(1+.5*t),zIndex:0},{zIndex:-1}]}},pull:{show(t){return t<0?[{transform:r(30),zIndex:-1},{transform:r(),zIndex:0}]:[{transform:r(-100),zIndex:0},{transform:r(),zIndex:-1}]},percent(t,e,n){return n<0?1-v(e):v(t)},translate(t,e){return e<0?[{transform:r(30*t),zIndex:-1},{transform:r(-100*(1-t)),zIndex:0}]:[{transform:r(-t*100),zIndex:0},{transform:r(30*(1-t)),zIndex:-1}]}},push:{show(t){return t<0?[{transform:r(100),zIndex:0},{transform:r(),zIndex:-1}]:[{transform:r(-30),zIndex:-1},{transform:r(),zIndex:0}]},percent(t,e,n){return n>0?1-v(e):v(t)},translate(t,e){return e<0?[{transform:r(t*100),zIndex:0},{transform:r(-30*(1-t)),zIndex:-1}]:[{transform:r(-30*t),zIndex:-1},{transform:r(100*(1-t)),zIndex:0}]}}}),H={update:{write(){if(this.stack.length||this.dragging)return;const t=this.getValidIndex(this.index);(!~this.prevIndex||this.index!==t)&&this.show(t)},events:["resize"]}},b={mixins:[p,C,H],props:{ratio:String,minHeight:Number,maxHeight:Number},data:{ratio:"16:9",minHeight:!1,maxHeight:!1,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:D},update:{read(){if(!this.list)return!1;let[t,e]=this.ratio.split(":").map(Number);return e=e*this.list.offsetWidth/t||0,this.minHeight&&(e=Math.max(this.minHeight,e)),this.maxHeight&&(e=Math.min(this.maxHeight,e)),{height:e-s.boxModelAdjust(this.list,"height","content-box")}},write(t){let{height:e}=t;e>0&&s.css(this.list,"minHeight",e)},events:["resize"]}};return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshow",b),b});
|
|
1
|
+
/*! UIkit 3.11.2-dev.536e1a374 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslideshow",["uikit-util"],p):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitSlideshow=p(s.UIkit.util))})(this,function(s){"use strict";var p={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},I={slide:{show(e){return[{transform:h(e*-100)},{transform:h()}]},percent(e){return v(e)},translate(e,t){return[{transform:h(t*-100*e)},{transform:h(t*100*(1-e))}]}}};function v(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function h(e,t){return e===void 0&&(e=0),t===void 0&&(t="%"),e+=e?t:"","translate3d("+e+", 0, 0)"}function w(e){return"scale3d("+e+", "+e+", 1)"}function y(e,t,n,i){let{animation:l,easing:r}=i;const{percent:a,translate:m,show:c=s.noop}=l,g=c(n),f=new s.Deferred;return{dir:n,show(o,d,P){d===void 0&&(d=0);const x=P?"linear":r;return o-=Math.round(o*s.clamp(d,-1,1)),this.translate(d),u(t,"itemin",{percent:d,duration:o,timing:x,dir:n}),u(e,"itemout",{percent:1-d,duration:o,timing:x,dir:n}),Promise.all([s.Transition.start(t,g[1],o,x),s.Transition.start(e,g[0],o,x)]).then(()=>{this.reset(),f.resolve()},s.noop),f.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const o in g[0])s.css([t,e],o,"")},forward(o,d){return d===void 0&&(d=this.percent()),s.Transition.cancel([t,e]),this.show(o,d,!0)},translate(o){this.reset();const d=m(o,n);s.css(t,d[1]),s.css(e,d[0]),u(t,"itemtranslatein",{percent:o,dir:n}),u(e,"itemtranslateout",{percent:1-o,dir:n})},percent(){return a(e||t,t,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function u(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var z={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)}}},A={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const i=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=i===this.pos?this.prevPos:this.pos,this.pos=i,t(n)}}},events:[{name:s.pointerDown,delegate(){return this.selSlides},handler(e){!this.draggable||!s.isTouch(e)&&_(e.target)||s.closest(e.target,s.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(e){e.preventDefault()}}],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,s.pointerMove,this.move,{passive:!1}),s.on(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),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:i}=this,l=Math.abs(t),r=this.getIndex(i+this.dir,i),a=this._getDistance(i,r)||n[i].offsetWidth;for(;r!==i&&l>a;)this.drag-=a*this.dir,i=r,l-=a,r=this.getIndex(i+this.dir,i),a=this._getDistance(i,r)||n[i].offsetWidth;this.percent=l/a;const m=n[i],c=n[r],g=this.index!==r,f=i===r;let o;[this.index,this.prevIndex].filter(d=>!s.includes([r,i],d)).forEach(d=>{s.trigger(n[d],"itemhidden",[this]),f&&(o=!0,this.prevIndex=i)}),(this.index===i&&this.prevIndex!==i||o)&&s.trigger(n[this.index],"itemshown",[this]),g&&(this.prevIndex=i,this.index=r,!f&&s.trigger(m,"beforeitemhide",[this]),s.trigger(c,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),m,!f&&c),g&&(!f&&s.trigger(m,"itemhide",[this]),s.trigger(c,"itemshow",[this]))},end(){if(s.off(document,s.pointerMove,this.move,{passive:!1}),s.off(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),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 _(e){return!e.children.length&&e.childNodes.length}var N={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))}}}},S={mixins:[z,A,N],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 C(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.$reset()}},length(){return this.slides.length}},methods:{show(e,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,i=t?0:n.length,l=()=>{n.splice(i,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),a=s.hasClass(this.slides,this.clsActive)&&this.slides[r],m=this.getIndex(e,this.index),c=this.slides[m];if(a===c){l();return}if(this.dir=$(e,r),this.prevIndex=r,this.index=m,a&&!s.trigger(a,"beforeitemhide",[this])||!s.trigger(c,"beforeitemshow",[this,a])){this.index=this.prevIndex,l();return}const g=this._show(a,c,t).then(()=>(a&&s.trigger(a,"itemhidden",[this]),s.trigger(c,"itemshown",[this]),new Promise(f=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,f()})})));return a&&s.trigger(a,"itemhide",[this]),s.trigger(c,"itemshow",[this]),g},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:i}=this.stack;return this._transitioner[i>1?"forward":"show"](i>1?Math.min(this.duration,75+75/(i-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 i=this._getTransitioner(t!==n?t:!1,n);return i.translate(e),i},_getTransitioner(e,t,n,i){return e===void 0&&(e=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),i===void 0&&(i=this.transitionOptions),new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),i)}}};function $(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function C(e){return .5*e+300}var D={mixins:[S],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:I,Transitioner:y},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)}}},T={...I,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:w(1+.5),zIndex:0},{zIndex:-1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:w(1+.5*e),zIndex:0},{zIndex:-1}]}},pull:{show(e){return e<0?[{transform:h(30),zIndex:-1},{transform:h(),zIndex:0}]:[{transform:h(-100),zIndex:0},{transform:h(),zIndex:-1}]},percent(e,t,n){return n<0?1-v(t):v(e)},translate(e,t){return t<0?[{transform:h(30*e),zIndex:-1},{transform:h(-100*(1-e)),zIndex:0}]:[{transform:h(-e*100),zIndex:0},{transform:h(30*(1-e)),zIndex:-1}]}},push:{show(e){return e<0?[{transform:h(100),zIndex:0},{transform:h(),zIndex:-1}]:[{transform:h(-30),zIndex:-1},{transform:h(),zIndex:0}]},percent(e,t,n){return n>0?1-v(t):v(e)},translate(e,t){return t<0?[{transform:h(e*100),zIndex:0},{transform:h(-30*(1-e)),zIndex:-1}]:[{transform:h(-30*e),zIndex:-1},{transform:h(100*(1-e)),zIndex:0}]}}},H={update:{write(){if(this.stack.length||this.dragging)return;const e=this.getValidIndex(this.index);(!~this.prevIndex||this.index!==e)&&this.show(e)},events:["resize"]}},M={methods:{lazyload(e,t){e===void 0&&(e=this.$el),t===void 0&&(t=this.$el),this.registerObserver(s.observeIntersection(e,(n,i)=>{for(const l of s.toNodes(s.isFunction(t)?t():t))s.$$('[loading="lazy"]',l).forEach(r=>s.removeAttr(r,"loading"));for(const l of n.filter(r=>{let{isIntersecting:a}=r;return a}).map(r=>{let{target:a}=r;return a}))i.unobserve(l)}))}}},O={mixins:[M],connected(){this.lazyload(this.slides,this.getAdjacentSlides)}},b={mixins:[p,D,H,O],props:{ratio:String,minHeight:Number,maxHeight:Number},data:{ratio:"16:9",minHeight:!1,maxHeight:!1,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:T},update:{read(){if(!this.list)return!1;let[e,t]=this.ratio.split(":").map(Number);return t=t*this.list.offsetWidth/e||0,this.minHeight&&(t=Math.max(this.minHeight,t)),this.maxHeight&&(t=Math.min(this.maxHeight,t)),{height:t-s.boxModelAdjust(this.list,"height","content-box")}},write(e){let{height:t}=e;t>0&&s.css(this.list,"minHeight",t)},events:["resize"]},methods:{getAdjacentSlides(){return[1,-1].map(e=>this.slides[this.getIndex(this.index+e)])}}};return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshow",b),b});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.536e1a374 | 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')) :
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
|
|
229
229
|
// Reset to previous state
|
|
230
230
|
nodes.forEach((el, i) => propsFrom[i] && uikitUtil.css(el, propsFrom[i]));
|
|
231
|
-
uikitUtil.css(target,
|
|
231
|
+
uikitUtil.css(target, { display: 'block', ...targetProps });
|
|
232
232
|
|
|
233
233
|
// Start transitions on next frame
|
|
234
234
|
requestAnimationFrame(() => {
|
|
@@ -260,15 +260,13 @@
|
|
|
260
260
|
const zIndex = uikitUtil.css(el, 'zIndex');
|
|
261
261
|
|
|
262
262
|
return uikitUtil.isVisible(el) ?
|
|
263
|
-
uikitUtil.assign(
|
|
264
263
|
{
|
|
265
264
|
display: '',
|
|
266
265
|
opacity: opacity ? uikitUtil.css(el, 'opacity') : '0',
|
|
267
266
|
pointerEvents: 'none',
|
|
268
267
|
position: 'absolute',
|
|
269
|
-
zIndex: zIndex === 'auto' ? uikitUtil.index(el) : zIndex
|
|
270
|
-
|
|
271
|
-
getPositionWithMargin(el)) :
|
|
268
|
+
zIndex: zIndex === 'auto' ? uikitUtil.index(el) : zIndex,
|
|
269
|
+
...getPositionWithMargin(el) } :
|
|
272
270
|
|
|
273
271
|
false;
|
|
274
272
|
}
|
|
@@ -542,7 +540,7 @@
|
|
|
542
540
|
|
|
543
541
|
this.touched = new Set([this]);
|
|
544
542
|
this.placeholder = placeholder;
|
|
545
|
-
this.origin =
|
|
543
|
+
this.origin = { target, index: uikitUtil.index(placeholder), ...this.pos };
|
|
546
544
|
|
|
547
545
|
uikitUtil.on(document, uikitUtil.pointerMove, this.move);
|
|
548
546
|
uikitUtil.on(document, uikitUtil.pointerUp, this.end);
|