uikit 3.11.2-dev.2b60845fb → 3.11.2-dev.2f4ac8e16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -18
- package/dist/css/uikit-core-rtl.css +80 -186
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +80 -186
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +82 -192
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +82 -192
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +6 -8
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +26 -55
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +27 -57
- 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 +85 -68
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +85 -68
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +60 -12
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +85 -68
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +52 -16
- 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 +2 -2
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +215 -220
- 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 +397 -355
- 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 +1 -1
- package/src/js/api/state.js +1 -1
- 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 +37 -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 +21 -1
- package/src/js/components/slideshow.js +8 -1
- package/src/js/components/sortable.js +1 -1
- package/src/js/core/alert.js +1 -2
- package/src/js/core/img.js +129 -114
- package/src/js/core/modal.js +1 -2
- package/src/js/core/navbar.js +3 -3
- package/src/js/core/sticky.js +1 -1
- package/src/js/core/svg.js +10 -6
- package/src/js/core/toggle.js +2 -1
- package/src/js/mixin/internal/animate-slide.js +9 -12
- package/src/js/mixin/parallax.js +85 -68
- package/src/js/mixin/slider.js +8 -16
- package/src/js/mixin/slideshow.js +2 -2
- package/src/js/mixin/togglable.js +1 -2
- package/src/js/util/ajax.js +9 -12
- package/src/js/util/animation.js +7 -12
- package/src/js/util/dom.js +27 -30
- package/src/js/util/lang.js +7 -6
- 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 +52 -97
- package/src/less/components/form.less +0 -1
- 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/scss/components/base.scss +10 -33
- package/src/scss/components/form-range.scss +52 -97
- package/src/scss/components/form.scss +0 -1
- 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/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/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 +14 -5
- 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 +47 -62
- 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 +33 -33
- package/tests/video.html +1 -1
- package/tests/width.html +1 -1
- package/tests/images/animated.gif +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.2f4ac8e16 | 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')) :
|
|
@@ -127,39 +127,35 @@
|
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
function transformFn(prop, el,
|
|
131
|
-
const unit = getUnit(
|
|
130
|
+
function transformFn(prop, el, stops) {
|
|
131
|
+
const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
132
|
+
let transformFn;
|
|
132
133
|
|
|
133
134
|
if (prop === 'x' || prop === 'y') {
|
|
134
135
|
prop = "translate" + uikitUtil.ucfirst(prop);
|
|
136
|
+
transformFn = (stop) => uikitUtil.toFloat(uikitUtil.toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
|
|
135
137
|
}
|
|
136
138
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (steps.length === 1) {
|
|
140
|
-
steps.unshift(prop === 'scale' ? 1 : 0);
|
|
139
|
+
if (stops.length === 1) {
|
|
140
|
+
stops.unshift(prop === 'scale' ? 1 : 0);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
let value = getValue(steps, percent);
|
|
143
|
+
stops = parseStops(stops, transformFn);
|
|
145
144
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
css.transform += " " + prop + "(" + value + unit + ")";
|
|
145
|
+
return (css, percent) => {
|
|
146
|
+
css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
|
|
151
147
|
};
|
|
152
148
|
}
|
|
153
149
|
|
|
154
|
-
function colorFn(prop, el,
|
|
155
|
-
if (
|
|
156
|
-
|
|
150
|
+
function colorFn(prop, el, stops) {
|
|
151
|
+
if (stops.length === 1) {
|
|
152
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
|
|
155
|
+
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
160
156
|
|
|
161
157
|
return (css, percent) => {
|
|
162
|
-
const [start, end, p] =
|
|
158
|
+
const [start, end, p] = getStop(stops, percent);
|
|
163
159
|
const value = start.
|
|
164
160
|
map((value, i) => {
|
|
165
161
|
value += p * (end[i] - value);
|
|
@@ -179,85 +175,83 @@
|
|
|
179
175
|
map(uikitUtil.toFloat);
|
|
180
176
|
}
|
|
181
177
|
|
|
182
|
-
function filterFn(prop, el,
|
|
183
|
-
if (
|
|
184
|
-
|
|
178
|
+
function filterFn(prop, el, stops) {
|
|
179
|
+
if (stops.length === 1) {
|
|
180
|
+
stops.unshift(0);
|
|
185
181
|
}
|
|
186
182
|
|
|
187
|
-
const unit = getUnit(
|
|
183
|
+
const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
188
184
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
189
|
-
|
|
185
|
+
stops = parseStops(stops);
|
|
190
186
|
|
|
191
187
|
return (css, percent) => {
|
|
192
|
-
const value = getValue(
|
|
188
|
+
const value = getValue(stops, percent);
|
|
193
189
|
css.filter += " " + prop + "(" + (value + unit) + ")";
|
|
194
190
|
};
|
|
195
191
|
}
|
|
196
192
|
|
|
197
|
-
function cssPropFn(prop, el,
|
|
198
|
-
if (
|
|
199
|
-
|
|
193
|
+
function cssPropFn(prop, el, stops) {
|
|
194
|
+
if (stops.length === 1) {
|
|
195
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
200
196
|
}
|
|
201
197
|
|
|
202
|
-
|
|
198
|
+
stops = parseStops(stops);
|
|
203
199
|
|
|
204
200
|
return (css, percent) => {
|
|
205
|
-
css[prop] = getValue(
|
|
201
|
+
css[prop] = getValue(stops, percent);
|
|
206
202
|
};
|
|
207
203
|
}
|
|
208
204
|
|
|
209
|
-
function strokeFn(prop, el,
|
|
210
|
-
if (
|
|
211
|
-
|
|
205
|
+
function strokeFn(prop, el, stops) {
|
|
206
|
+
if (stops.length === 1) {
|
|
207
|
+
stops.unshift(0);
|
|
212
208
|
}
|
|
213
209
|
|
|
214
|
-
const unit = getUnit(
|
|
215
|
-
|
|
210
|
+
const unit = getUnit(stops);
|
|
211
|
+
const length = getMaxPathLength(el);
|
|
212
|
+
stops = parseStops(stops.reverse(), (stop) => {
|
|
213
|
+
stop = uikitUtil.toFloat(stop);
|
|
214
|
+
return unit === '%' ? stop * length / 100 : stop;
|
|
215
|
+
});
|
|
216
216
|
|
|
217
|
-
if (!
|
|
217
|
+
if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
|
|
218
218
|
return uikitUtil.noop;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
const length = getMaxPathLength(el);
|
|
222
221
|
uikitUtil.css(el, 'strokeDasharray', length);
|
|
223
222
|
|
|
224
|
-
if (unit === '%') {
|
|
225
|
-
steps = steps.map((step) => step * length / 100);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
steps = steps.reverse();
|
|
229
|
-
|
|
230
223
|
return (css, percent) => {
|
|
231
|
-
css.strokeDashoffset = getValue(
|
|
224
|
+
css.strokeDashoffset = getValue(stops, percent);
|
|
232
225
|
};
|
|
233
226
|
}
|
|
234
227
|
|
|
235
|
-
function backgroundFn(prop, el,
|
|
236
|
-
if (
|
|
237
|
-
|
|
228
|
+
function backgroundFn(prop, el, stops) {
|
|
229
|
+
if (stops.length === 1) {
|
|
230
|
+
stops.unshift(0);
|
|
238
231
|
}
|
|
239
232
|
|
|
240
233
|
prop = prop.substr(-1);
|
|
241
234
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
242
|
-
|
|
235
|
+
stops = parseStops(stops, (stop) => uikitUtil.toPx(stop, attr, el));
|
|
243
236
|
|
|
244
237
|
const bgPos = getCssValue(el, "background-position-" + prop, '');
|
|
245
238
|
|
|
246
239
|
return getCssValue(el, 'backgroundSize', '') === 'cover' ?
|
|
247
|
-
backgroundCoverFn(prop, el,
|
|
248
|
-
setBackgroundPosFn(prop,
|
|
240
|
+
backgroundCoverFn(prop, el, stops, bgPos, attr) :
|
|
241
|
+
setBackgroundPosFn(prop, stops, bgPos);
|
|
249
242
|
}
|
|
250
243
|
|
|
251
|
-
function backgroundCoverFn(prop, el,
|
|
244
|
+
function backgroundCoverFn(prop, el, stops, bgPos, attr) {
|
|
252
245
|
const dimImage = getBackgroundImageDimensions(el);
|
|
253
246
|
|
|
254
247
|
if (!dimImage.width) {
|
|
255
248
|
return uikitUtil.noop;
|
|
256
249
|
}
|
|
257
250
|
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
251
|
+
const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
|
|
252
|
+
const min = Math.min(...values);
|
|
253
|
+
const max = Math.max(...values);
|
|
254
|
+
const down = values.indexOf(min) < values.indexOf(max);
|
|
261
255
|
|
|
262
256
|
const diff = max - min;
|
|
263
257
|
let pos = (down ? -diff : 0) - (down ? min : max);
|
|
@@ -282,7 +276,7 @@
|
|
|
282
276
|
|
|
283
277
|
const dim = uikitUtil.Dimensions.cover(dimImage, dimEl);
|
|
284
278
|
|
|
285
|
-
const fn = setBackgroundPosFn(prop,
|
|
279
|
+
const fn = setBackgroundPosFn(prop, stops, pos + "px");
|
|
286
280
|
return (css, percent) => {
|
|
287
281
|
fn(css, percent);
|
|
288
282
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -290,9 +284,9 @@
|
|
|
290
284
|
};
|
|
291
285
|
}
|
|
292
286
|
|
|
293
|
-
function setBackgroundPosFn(prop,
|
|
287
|
+
function setBackgroundPosFn(prop, stops, pos) {
|
|
294
288
|
return function (css, percent) {
|
|
295
|
-
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(
|
|
289
|
+
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
|
|
296
290
|
};
|
|
297
291
|
}
|
|
298
292
|
|
|
@@ -326,24 +320,47 @@
|
|
|
326
320
|
|
|
327
321
|
}
|
|
328
322
|
|
|
329
|
-
function
|
|
330
|
-
const
|
|
331
|
-
const
|
|
323
|
+
function parseStops(stops, fn) {if (fn === void 0) {fn = uikitUtil.toFloat;}
|
|
324
|
+
const result = [];
|
|
325
|
+
for (const stop of stops) {
|
|
326
|
+
const [value, percent] = uikitUtil.isString(stop) ? stop.trim().split(' ') : [stop];
|
|
327
|
+
result.push([fn(value), percent ? uikitUtil.toFloat(percent) / 100 : null]);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const { length } = result;
|
|
331
|
+
result[0][1] = 0;
|
|
332
|
+
result[length - 1][1] = 1;
|
|
333
|
+
for (let i = 1; i < length - 1; i++) {
|
|
334
|
+
if (result[i] === null) {
|
|
335
|
+
const nextIndex = uikitUtil.findIndex(result.slice(i + 1), (_ref3) => {let [, percent] = _ref3;return percent !== null;}) + 1;
|
|
336
|
+
const percent = (result[i + nextIndex] - result[i - 1][1]) / (nextIndex + 1);
|
|
337
|
+
for (let j = 0; j < nextIndex; j++) {
|
|
338
|
+
result[i + j][1] = percent * j + 1;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return result;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function getStop(stops, percent) {
|
|
347
|
+
const index = uikitUtil.findIndex(stops.slice(1), (_ref4) => {let [, targetPercent] = _ref4;return percent <= targetPercent;}) + 1;
|
|
348
|
+
return [
|
|
349
|
+
stops[index - 1][0],
|
|
350
|
+
stops[index][0],
|
|
351
|
+
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
|
|
332
352
|
|
|
333
|
-
return steps.
|
|
334
|
-
slice(index, index + 2).
|
|
335
|
-
concat(percent === 1 ? 1 : percent % (1 / count) * count);
|
|
336
353
|
}
|
|
337
354
|
|
|
338
|
-
function getValue(
|
|
339
|
-
const [start, end, p] =
|
|
355
|
+
function getValue(stops, percent) {
|
|
356
|
+
const [start, end, p] = getStop(stops, percent);
|
|
340
357
|
return uikitUtil.isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
341
358
|
}
|
|
342
359
|
|
|
343
|
-
function getUnit(
|
|
360
|
+
function getUnit(stops, defaultUnit) {
|
|
344
361
|
return (
|
|
345
|
-
|
|
346
|
-
(unit,
|
|
362
|
+
stops.reduce(
|
|
363
|
+
(unit, stop) => unit || uikitUtil.isString(stop) && stop.replace(/[\d-]/g, '').trim(),
|
|
347
364
|
'') ||
|
|
348
365
|
defaultUnit);
|
|
349
366
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.2f4ac8e16 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(r,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider_parallax",["uikit-util"],l):(r=typeof globalThis<"u"?globalThis:r||self,r.UIkitSlider_parallax=l(r.UIkit.util))})(this,function(r){"use strict";var l={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const n=q(this.media);return!n||window.matchMedia(n).matches}}};function q(n){if(r.isString(n)){if(n[0]==="@"){const t="breakpoint-"+n.substr(1);n=r.toFloat(r.getCssVar(t))}else if(isNaN(n))return n}return n&&!isNaN(n)?"(min-width: "+n+"px)":!1}r.memoize(async n=>n?r.startsWith(n,"data:")?decodeURIComponent(n.split(",")[1]):(await fetch(n)).text():Promise.reject());function H(n){return Math.ceil(Math.max(0,...r.$$("[stroke]",n).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const w={x:I,y:I,rotate:I,scale:I,color:M,backgroundColor:M,borderColor:M,blur:u,hue:u,fopacity:u,grayscale:u,invert:u,saturate:u,sepia:u,opacity:E,stroke:A,bgx:S,bgy:S},{keys:F}=Object;var L={mixins:[l],props:N(F(w),"list"),data:N(F(w),void 0),computed:{props(n,t){return F(w).reduce((e,o)=>(r.isUndefined(n[o])||(e[o]=w[o](o,t,n[o].slice())),e),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){r.each(this.getCss(0),(n,t)=>r.css(this.$el,t,""))},getCss(n){return F(this.props).reduce((t,e)=>(this.props[e](t,n),t),{transform:"",filter:""})}}};function I(n,t,e){const o=$(e)||{x:"px",y:"px",rotate:"deg"}[n]||"";let a;return(n==="x"||n==="y")&&(n="translate"+r.ucfirst(n),a=s=>r.toFloat(r.toFloat(s).toFixed(o==="px"?0:6))),e.length===1&&e.unshift(n==="scale"?1:0),e=g(e,a),(s,c)=>{s.transform+=" "+n+"("+x(e,c)+o+")"}}function M(n,t,e){return e.length===1&&e.unshift(b(t,n,"")),e=g(e,o=>R(t,o)),(o,a)=>{const[s,c,i]=T(e,a),h=s.map((m,d)=>(m+=i*(c[d]-m),d===3?r.toFloat(m):parseInt(m,10))).join(",");o[n]="rgba("+h+")"}}function R(n,t){return b(n,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(r.toFloat)}function u(n,t,e){e.length===1&&e.unshift(0);const o=$(e)||{blur:"px",hue:"deg"}[n]||"%";return n={fopacity:"opacity",hue:"hue-rotate"}[n]||n,e=g(e),(a,s)=>{const c=x(e,s);a.filter+=" "+n+"("+(c+o)+")"}}function E(n,t,e){return e.length===1&&e.unshift(b(t,n,"")),e=g(e),(o,a)=>{o[n]=x(e,a)}}function A(n,t,e){e.length===1&&e.unshift(0);const o=$(e),a=H(t);return e=g(e.reverse(),s=>(s=r.toFloat(s),o==="%"?s*a/100:s)),e.some(s=>{let[c]=s;return c})?(r.css(t,"strokeDasharray",a),(s,c)=>{s.strokeDashoffset=x(e,c)}):r.noop}function S(n,t,e){e.length===1&&e.unshift(0),n=n.substr(-1);const o=n==="y"?"height":"width";e=g(e,s=>r.toPx(s,o,t));const a=b(t,"background-position-"+n,"");return b(t,"backgroundSize","")==="cover"?G(n,t,e,a,o):D(n,e,a)}function G(n,t,e,o,a){const s=J(t);if(!s.width)return r.noop;const c=e.map(f=>{let[v]=f;return v}),i=Math.min(...c),h=Math.max(...c),m=c.indexOf(i)<c.indexOf(h),d=h-i;let B=(m?-d:0)-(m?i:h);const y={width:t.offsetWidth,height:t.offsetHeight},V=r.Dimensions.cover(s,y),P=V[a]-y[a];if(P<d)y[a]=V[a]+d-P;else if(P>d){const f=y[a]/r.toPx(o,a,t,!0);f&&(B-=(P-d)/f)}const _=r.Dimensions.cover(s,y),K=D(n,e,B+"px");return(f,v)=>{K(f,v),f.backgroundSize=_.width+"px "+_.height+"px",f.backgroundRepeat="no-repeat"}}function D(n,t,e){return function(o,a){o["background-position-"+n]="calc("+e+" + "+x(t,a)+"px)"}}const C={};function J(n){const t=r.css(n,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(C[t])return C[t];const e=new Image;return t&&(e.src=t,e.naturalWidth||(e.onload=()=>{C[t]=j(e),r.trigger(n,"bgimageload")})),C[t]=j(e)}function j(n){return{width:n.naturalWidth,height:n.naturalHeight}}function g(n,t){t===void 0&&(t=r.toFloat);const e=[];for(const a of n){const[s,c]=r.isString(a)?a.trim().split(" "):[a];e.push([t(s),c?r.toFloat(c)/100:null])}const{length:o}=e;e[0][1]=0,e[o-1][1]=1;for(let a=1;a<o-1;a++)if(e[a]===null){const s=r.findIndex(e.slice(a+1),i=>{let[,h]=i;return h!==null})+1,c=(e[a+s]-e[a-1][1])/(s+1);for(let i=0;i<s;i++)e[a+i][1]=c*i+1}return e}function T(n,t){const e=r.findIndex(n.slice(1),o=>{let[,a]=o;return t<=a})+1;return[n[e-1][0],n[e][0],(t-n[e-1][1])/(n[e][1]-n[e-1][1])]}function x(n,t){const[e,o,a]=T(n,t);return r.isNumber(e)?e+Math.abs(e-o)*a*(e<o?1:-1):+o}function $(n,t){return n.reduce((e,o)=>e||r.isString(o)&&o.replace(/[\d-]/g,"").trim(),"")||t}function b(n,t,e){const o=n.style[t],a=r.css(r.css(n,t,e),t);return n.style[t]=o,a}function N(n,t){return n.reduce((e,o)=>(e[o]=t,e),{})}var W={mixins:[L],data:{selItem:"!li"},computed:{item(n,t){let{selItem:e}=n;return r.query(e,t)}},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler(n){let{type:t,detail:{percent:e,duration:o,timing:a,dir:s}}=n;r.fastdom.read(()=>{const c=this.getCss(z(t,s,e)),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(n){let{type:t,detail:{percent:e,dir:o}}=n;r.fastdom.read(()=>{const a=this.getCss(z(t,o,e));r.fastdom.write(()=>r.css(this.$el,a))})}}]};function O(n){return r.endsWith(n,"in")}function z(n,t,e){return e/=2,O(n)^t<0?e:1-e}return typeof window<"u"&&window.UIkit&&window.UIkit.component("sliderParallax",W),W});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.2f4ac8e16 | 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')) :
|
|
@@ -503,20 +503,13 @@
|
|
|
503
503
|
},
|
|
504
504
|
|
|
505
505
|
_show(prev, next, force) {
|
|
506
|
-
this._transitioner = this._getTransitioner(
|
|
507
|
-
prev,
|
|
508
|
-
next,
|
|
509
|
-
this.dir,
|
|
510
|
-
uikitUtil.assign(
|
|
511
|
-
{
|
|
506
|
+
this._transitioner = this._getTransitioner(prev, next, this.dir, {
|
|
512
507
|
easing: force ?
|
|
513
508
|
next.offsetWidth < 600 ?
|
|
514
509
|
'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
|
|
515
510
|
'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
|
|
516
|
-
this.easing
|
|
517
|
-
|
|
518
|
-
this.transitionOptions));
|
|
519
|
-
|
|
511
|
+
this.easing,
|
|
512
|
+
...this.transitionOptions });
|
|
520
513
|
|
|
521
514
|
|
|
522
515
|
if (!force && !prev) {
|
|
@@ -581,6 +574,42 @@
|
|
|
581
574
|
|
|
582
575
|
events: ['resize'] } };
|
|
583
576
|
|
|
577
|
+
var SliderPreload = {
|
|
578
|
+
connected() {
|
|
579
|
+
if (window.IntersectionObserver) {
|
|
580
|
+
this.observer = new IntersectionObserver(
|
|
581
|
+
(entries) => {
|
|
582
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
583
|
+
removeLazyLoad(this.getAdjacentSlides());
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
{ rootMargin: '50% 50%' });
|
|
587
|
+
|
|
588
|
+
this.observer.observe(this.$el);
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
|
|
592
|
+
disconnected() {
|
|
593
|
+
this.observer && this.observer.disconnect();
|
|
594
|
+
},
|
|
595
|
+
|
|
596
|
+
update: {
|
|
597
|
+
read() {
|
|
598
|
+
if (uikitUtil.isVisible(this.$el)) {
|
|
599
|
+
removeLazyLoad(this.getAdjacentSlides());
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
|
|
603
|
+
events: ['resize'] } };
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
function removeLazyLoad(elements) {if (elements === void 0) {elements = [];}
|
|
608
|
+
for (const el of elements) {
|
|
609
|
+
el && uikitUtil.$$('img[loading="lazy"]', el).forEach((el) => uikitUtil.removeAttr(el, 'loading'));
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
584
613
|
function translate(value, unit) {if (value === void 0) {value = 0;}if (unit === void 0) {unit = '%';}
|
|
585
614
|
value += value ? unit : '';
|
|
586
615
|
return "translate3d(" + value + ", 0, 0)";
|
|
@@ -752,7 +781,7 @@
|
|
|
752
781
|
}
|
|
753
782
|
|
|
754
783
|
var Component = {
|
|
755
|
-
mixins: [Class, Slider, SliderReactive],
|
|
784
|
+
mixins: [Class, Slider, SliderReactive, SliderPreload],
|
|
756
785
|
|
|
757
786
|
props: {
|
|
758
787
|
center: Boolean,
|
|
@@ -989,6 +1018,25 @@
|
|
|
989
1018
|
} while (index !== prev);
|
|
990
1019
|
|
|
991
1020
|
return index;
|
|
1021
|
+
},
|
|
1022
|
+
|
|
1023
|
+
getAdjacentSlides() {
|
|
1024
|
+
const { width } = uikitUtil.dimensions(this.list);
|
|
1025
|
+
const left = -width;
|
|
1026
|
+
const right = width * 2;
|
|
1027
|
+
const slideWidth = uikitUtil.dimensions(this.slides[this.index]).width;
|
|
1028
|
+
const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
|
|
1029
|
+
const slides = new Set();
|
|
1030
|
+
for (const i of [-1, 1]) {
|
|
1031
|
+
let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
|
|
1032
|
+
let j = 0;
|
|
1033
|
+
do {
|
|
1034
|
+
const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
|
|
1035
|
+
currentLeft += uikitUtil.dimensions(slide).width * i;
|
|
1036
|
+
slides.add(slide);
|
|
1037
|
+
} while (this.slides.length > j && currentLeft > left && currentLeft < right);
|
|
1038
|
+
}
|
|
1039
|
+
return Array.from(slides);
|
|
992
1040
|
} } };
|
|
993
1041
|
|
|
994
1042
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.2b60845fb | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(e,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider",["uikit-util"],v):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkitSlider=v(e.UIkit.util))})(this,function(e){"use strict";var v={connected(){!e.hasClass(this.$el,this.$name)&&e.addClass(this.$el,this.$name)}},R={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){e.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||!e.$(":focus",this.$el))&&(!this.pauseOnHover||!e.matches(this.$el,":hover"))&&!this.stack.length&&this.show("next"),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)}}},S={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const s of["start","move","end"]){const t=this[s];this[s]=n=>{const i=e.getEventPos(n).x*(e.isRtl?-1:1);this.prevPos=i===this.pos?this.prevPos:this.pos,this.pos=i,t(n)}}},events:[{name:e.pointerDown,delegate(){return this.selSlides},handler(s){!this.draggable||!e.isTouch(s)&&T(s.target)||e.closest(s.target,e.selInput)||s.button>0||this.length<2||this.start(s)}},{name:"dragstart",handler(s){s.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,e.on(document,e.pointerMove,this.move,{passive:!1}),e.on(document,e.pointerUp+" "+e.pointerCancel+" input",this.end,!0),e.css(this.list,"userSelect","none")},move(s){const t=this.pos-this.drag;if(t===0||this.prevPos===this.pos||!this.dragging&&Math.abs(t)<this.threshold)return;e.css(this.list,"pointerEvents","none"),s.cancelable&&s.preventDefault(),this.dragging=!0,this.dir=t<0?1:-1;const{slides:n}=this;let{prevIndex:i}=this,o=Math.abs(t),r=this.getIndex(i+this.dir,i),h=this._getDistance(i,r)||n[i].offsetWidth;for(;r!==i&&o>h;)this.drag-=h*this.dir,i=r,o-=h,r=this.getIndex(i+this.dir,i),h=this._getDistance(i,r)||n[i].offsetWidth;this.percent=o/h;const g=n[i],c=n[r],l=this.index!==r,a=i===r;let d;[this.index,this.prevIndex].filter(f=>!e.includes([r,i],f)).forEach(f=>{e.trigger(n[f],"itemhidden",[this]),a&&(d=!0,this.prevIndex=i)}),(this.index===i&&this.prevIndex!==i||d)&&e.trigger(n[this.index],"itemshown",[this]),l&&(this.prevIndex=i,this.index=r,!a&&e.trigger(g,"beforeitemhide",[this]),e.trigger(c,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),g,!a&&c),l&&(!a&&e.trigger(g,"itemhide",[this]),e.trigger(c,"itemshow",[this]))},end(){if(e.off(document,e.pointerMove,this.move,{passive:!1}),e.off(document,e.pointerUp+" "+e.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 s=(e.isRtl?this.dir*(e.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=s?this.index:this.prevIndex,s&&(this.percent=1-this.percent),this.show(this.dir>0&&!s||this.dir<0&&s?"next":"previous",!0)}e.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function T(s){return!s.children.length&&s.childNodes.length}var D={data:{selNav:!1},computed:{nav(s,t){let{selNav:n}=s;return e.$(n,t)},selNavItem(s){let{attrItem:t}=s;return"["+t+"],[data-"+t+"]"},navItems(s,t){return e.$$(this.selNavItem,t)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&e.html(this.nav,this.slides.map((s,t)=>"<li "+this.attrItem+'="'+t+'"><a href></a></li>').join("")),this.navItems.concat(this.nav).forEach(s=>s&&(s.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(s){s.preventDefault(),this.show(e.data(s.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const s=this.getValidIndex();for(const t of this.navItems){const n=e.data(t,this.attrItem);e.toggleClass(t,this.clsActive,e.toNumber(n)===s),e.toggleClass(t,"uk-invisible",this.finite&&(n==="previous"&&s===0||n==="next"&&s>=this.maxIndex))}}}},E={mixins:[R,S,D],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(){e.removeClass(this.slides,this.clsActive)},computed:{duration(s,t){let{velocity:n}=s;return b(t.offsetWidth/n)},list(s,t){let{selList:n}=s;return e.$(n,t)},maxIndex(){return this.length-1},selSlides(s){let{selList:t,selSlides:n}=s;return t+" "+(n||"> *")},slides:{get(){return e.$$(this.selSlides,this.$el)},watch(){this.$reset()}},length(){return this.slides.length}},events:{itemshown(){this.$update(this.list)}},methods:{show(s,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,i=t?0:n.length,o=()=>{n.splice(i,1),n.length&&this.show(n.shift(),!0)};if(n[t?"unshift":"push"](s),!t&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const r=this.getIndex(this.index),h=e.hasClass(this.slides,this.clsActive)&&this.slides[r],g=this.getIndex(s,this.index),c=this.slides[g];if(h===c){o();return}if(this.dir=W(s,r),this.prevIndex=r,this.index=g,h&&!e.trigger(h,"beforeitemhide",[this])||!e.trigger(c,"beforeitemshow",[this,h])){this.index=this.prevIndex,o();return}const l=this._show(h,c,t).then(()=>(h&&e.trigger(h,"itemhidden",[this]),e.trigger(c,"itemshown",[this]),new Promise(a=>{e.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,a()})})));return h&&e.trigger(h,"itemhide",[this]),e.trigger(c,"itemshow",[this]),l},getIndex(s,t){return s===void 0&&(s=this.index),t===void 0&&(t=this.index),e.clamp(e.getIndex(s,this.slides,t,this.finite),0,this.maxIndex)},getValidIndex(s,t){return s===void 0&&(s=this.index),t===void 0&&(t=this.prevIndex),this.getIndex(s,t)},_show(s,t,n){if(this._transitioner=this._getTransitioner(s,t,this.dir,e.assign({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&&!s)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(s,t){return this._getTransitioner(s,s!==t&&t).getDistance()},_translate(s,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(s),i},_getTransitioner(s,t,n,i){return s===void 0&&(s=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),i===void 0&&(i=this.transitionOptions),new this.Transitioner(e.isNumber(s)?this.slides[s]:s,e.isNumber(t)?this.slides[t]:t,n*(e.isRtl?-1:1),i)}}};function W(s,t){return s==="next"?1:s==="previous"||s<t?-1:1}function b(s){return .5*s+300}var O={update:{write(){if(this.stack.length||this.dragging)return;const s=this.getValidIndex(this.index);(!~this.prevIndex||this.index!==s)&&this.show(s)},events:["resize"]}};function _(s,t){return s===void 0&&(s=0),t===void 0&&(t="%"),s+=s?t:"","translate3d("+s+", 0, 0)"}function B(s,t,n,i){let{center:o,easing:r,list:h}=i;const g=new e.Deferred,c=s?p(s,h,o):p(t,h,o)+e.dimensions(t).width*n,l=t?p(t,h,o):c+e.dimensions(s).width*n*(e.isRtl?-1:1);return{dir:n,show(a,d,f){d===void 0&&(d=0);const m=f?"linear":r;return a-=Math.round(a*e.clamp(d,-1,1)),this.translate(d),d=s?d:e.clamp(d,0,1),u(this.getItemIn(),"itemin",{percent:d,duration:a,timing:m,dir:n}),s&&u(this.getItemIn(!0),"itemout",{percent:1-d,duration:a,timing:m,dir:n}),e.Transition.start(h,{transform:_(-l*(e.isRtl?-1:1),"px")},a,m).then(g.resolve,e.noop),g.promise},cancel(){e.Transition.cancel(h)},reset(){e.css(h,"transform","")},forward(a,d){return d===void 0&&(d=this.percent()),e.Transition.cancel(h),this.show(a,d,!0)},translate(a){const d=this.getDistance()*n*(e.isRtl?-1:1);e.css(h,"transform",_(e.clamp(-l+(d-d*a),-I(h),e.dimensions(h).width)*(e.isRtl?-1:1),"px"));const f=this.getActives(),m=this.getItemIn(),L=this.getItemIn(!0);a=s?e.clamp(a,-1,1):0;for(const x of e.children(h)){const C=e.includes(f,x),M=x===m,N=x===L,z=M||!N&&(C||n*(e.isRtl?-1:1)===-1^w(x,h)>w(s||t));u(x,"itemtranslate"+(z?"in":"out"),{dir:n,percent:N?1-a:M?a:C?1:0})}},percent(){return Math.abs((e.css(h,"transform").split(",")[4]*(e.isRtl?-1:1)+c)/(l-c))},getDistance(){return Math.abs(l-c)},getItemIn(a){a===void 0&&(a=!1);let d=this.getActives(),f=A(h,p(t||s,h,o));if(a){const m=d;d=f,f=m}return f[e.findIndex(f,m=>!e.includes(d,m))]},getActives(){return A(h,p(s||t,h,o))}}}function p(s,t,n){const i=w(s,t);return n?i-P(s,t):Math.min(i,y(t))}function y(s){return Math.max(0,I(s)-e.dimensions(s).width)}function I(s){return e.children(s).reduce((t,n)=>e.dimensions(n).width+t,0)}function P(s,t){return e.dimensions(t).width/2-e.dimensions(s).width/2}function w(s,t){return s&&(e.position(s).left+(e.isRtl?e.dimensions(s).width-e.dimensions(t).width:0))*(e.isRtl?-1:1)||0}function A(s,t){t-=1;const n=e.dimensions(s).width,i=t+n+2;return e.children(s).filter(o=>{const r=w(o,s),h=r+Math.min(e.dimensions(o).width,n);return r>=t&&h<=i})}function u(s,t,n){e.trigger(s,e.createEvent(t,!1,!1,n))}var $={mixins:[v,E,O],props:{center:Boolean,sets:Boolean},data:{center:!1,sets:!1,attrItem:"uk-slider-item",selList:".uk-slider-items",selNav:".uk-slider-nav",clsContainer:"uk-slider-container",Transitioner:B},computed:{avgWidth(){return I(this.list)/this.length},finite(s){let{finite:t}=s;return t||Math.ceil(I(this.list))<Math.floor(e.dimensions(this.list).width+V(this.list)+this.center)},maxIndex(){if(!this.finite||this.center&&!this.sets)return this.length-1;if(this.center)return e.last(this.sets);let s=0;const t=y(this.list),n=e.findIndex(this.slides,i=>{if(s>=t)return!0;s+=e.dimensions(i).width});return~n?n:this.length-1},sets(s){let{sets:t}=s;if(!t)return;const n=e.dimensions(this.list).width/(this.center?2:1);let i=0,o=n,r=0;return t=e.sortBy(this.slides,"offsetLeft").reduce((h,g,c)=>{const l=e.dimensions(g).width;if(r+l>i&&(!this.center&&c>this.maxIndex&&(c=this.maxIndex),!e.includes(h,c))){const d=this.slides[c+1];this.center&&d&&l<o-e.dimensions(d).width/2?o-=l:(o=n,h.push(c),i=r+n+(this.center?l/2:0))}return r+=l,h},[]),!e.isEmpty(t)&&t},transitionOptions(){return{center:this.center,list:this.list}}},connected(){e.toggleClass(this.$el,this.clsContainer,!e.$("."+this.clsContainer,this.$el))},update:{write(){for(const n of this.navItems){const i=e.toNumber(e.data(n,this.attrItem));i!==!1&&(n.hidden=!this.maxIndex||i>this.maxIndex||this.sets&&!e.includes(this.sets,i))}this.length&&!this.dragging&&!this.stack.length&&(this.reorder(),this._translate(1));const s=this._getTransitioner(this.index).getActives(),t=[this.clsActive,(!this.sets||e.includes(this.sets,e.toFloat(this.index)))&&this.clsActivated||""];for(const n of this.slides)e.toggleClass(n,t,e.includes(s,n))},events:["resize"]},events:{beforeitemshow(s){!this.dragging&&this.sets&&this.stack.length<2&&!e.includes(this.sets,this.index)&&(this.index=this.getValidIndex());const t=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.index<this.prevIndex||this.dir<0&&this.index>this.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&t>1){for(let i=0;i<t;i++)this.stack.splice(1,0,this.dir>0?"next":"previous");s.preventDefault();return}const n=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex;this.duration=b(this.avgWidth/this.velocity)*(e.dimensions(this.slides[n]).width/this.avgWidth),this.reorder()},itemshow(){~this.prevIndex&&e.addClass(this._getTransitioner().getItemIn(),this.clsActive)}},methods:{reorder(){if(this.finite){e.css(this.slides,"order","");return}const s=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((o,r)=>e.css(o,"order",this.dir>0&&r<s?1:this.dir<0&&r>=this.index?-1:"")),!this.center)return;const t=this.slides[s];let n=e.dimensions(this.list).width/2-e.dimensions(t).width/2,i=0;for(;n>0;){const o=this.getIndex(--i+s,s),r=this.slides[o];e.css(r,"order",o>s?-2:-1),n-=e.dimensions(r).width}},getValidIndex(s,t){if(s===void 0&&(s=this.index),t===void 0&&(t=this.prevIndex),s=this.getIndex(s,t),!this.sets)return s;let n;do{if(e.includes(this.sets,s))return s;n=s,s=this.getIndex(s+this.dir,t)}while(s!==n);return s}}};function V(s){return Math.max(0,...e.children(s).map(t=>e.dimensions(t).width))}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slider",$),$});
|
|
1
|
+
/*! UIkit 3.11.2-dev.2f4ac8e16 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider",["uikit-util"],v):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitSlider=v(s.UIkit.util))})(this,function(s){"use strict";var v={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},R={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)}}},T={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)&&D(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,d=Math.abs(t),r=this.getIndex(i+this.dir,i),h=this._getDistance(i,r)||n[i].offsetWidth;for(;r!==i&&d>h;)this.drag-=h*this.dir,i=r,d-=h,r=this.getIndex(i+this.dir,i),h=this._getDistance(i,r)||n[i].offsetWidth;this.percent=d/h;const f=n[i],c=n[r],l=this.index!==r,a=i===r;let o;[this.index,this.prevIndex].filter(g=>!s.includes([r,i],g)).forEach(g=>{s.trigger(n[g],"itemhidden",[this]),a&&(o=!0,this.prevIndex=i)}),(this.index===i&&this.prevIndex!==i||o)&&s.trigger(n[this.index],"itemshown",[this]),l&&(this.prevIndex=i,this.index=r,!a&&s.trigger(f,"beforeitemhide",[this]),s.trigger(c,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),f,!a&&c),l&&(!a&&s.trigger(f,"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 D(e){return!e.children.length&&e.childNodes.length}var E={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))}}}},O={mixins:[R,T,E],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 b(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}},events:{itemshown(){this.$update(this.list)}},methods:{show(e,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,i=t?0:n.length,d=()=>{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),h=s.hasClass(this.slides,this.clsActive)&&this.slides[r],f=this.getIndex(e,this.index),c=this.slides[f];if(h===c){d();return}if(this.dir=W(e,r),this.prevIndex=r,this.index=f,h&&!s.trigger(h,"beforeitemhide",[this])||!s.trigger(c,"beforeitemshow",[this,h])){this.index=this.prevIndex,d();return}const l=this._show(h,c,t).then(()=>(h&&s.trigger(h,"itemhidden",[this]),s.trigger(c,"itemshown",[this]),new Promise(a=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,a()})})));return h&&s.trigger(h,"itemhide",[this]),s.trigger(c,"itemshow",[this]),l},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 W(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function b(e){return .5*e+300}var L={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"]}},z={connected(){window.IntersectionObserver&&(this.observer=new IntersectionObserver(e=>{e.some(t=>t.isIntersecting)&&y(this.getAdjacentSlides())},{rootMargin:"50% 50%"}),this.observer.observe(this.$el))},disconnected(){this.observer&&this.observer.disconnect()},update:{read(){s.isVisible(this.$el)&&y(this.getAdjacentSlides())},events:["resize"]}};function y(e){e===void 0&&(e=[]);for(const t of e)t&&s.$$('img[loading="lazy"]',t).forEach(n=>s.removeAttr(n,"loading"))}function _(e,t){return e===void 0&&(e=0),t===void 0&&(t="%"),e+=e?t:"","translate3d("+e+", 0, 0)"}function B(e,t,n,i){let{center:d,easing:r,list:h}=i;const f=new s.Deferred,c=e?p(e,h,d):p(t,h,d)+s.dimensions(t).width*n,l=t?p(t,h,d):c+s.dimensions(e).width*n*(s.isRtl?-1:1);return{dir:n,show(a,o,g){o===void 0&&(o=0);const m=g?"linear":r;return a-=Math.round(a*s.clamp(o,-1,1)),this.translate(o),o=e?o:s.clamp(o,0,1),u(this.getItemIn(),"itemin",{percent:o,duration:a,timing:m,dir:n}),e&&u(this.getItemIn(!0),"itemout",{percent:1-o,duration:a,timing:m,dir:n}),s.Transition.start(h,{transform:_(-l*(s.isRtl?-1:1),"px")},a,m).then(f.resolve,s.noop),f.promise},cancel(){s.Transition.cancel(h)},reset(){s.css(h,"transform","")},forward(a,o){return o===void 0&&(o=this.percent()),s.Transition.cancel(h),this.show(a,o,!0)},translate(a){const o=this.getDistance()*n*(s.isRtl?-1:1);s.css(h,"transform",_(s.clamp(-l+(o-o*a),-I(h),s.dimensions(h).width)*(s.isRtl?-1:1),"px"));const g=this.getActives(),m=this.getItemIn(),j=this.getItemIn(!0);a=e?s.clamp(a,-1,1):0;for(const x of s.children(h)){const M=s.includes(g,x),C=x===m,N=x===j,H=C||!N&&(M||n*(s.isRtl?-1:1)===-1^w(x,h)>w(e||t));u(x,"itemtranslate"+(H?"in":"out"),{dir:n,percent:N?1-a:C?a:M?1:0})}},percent(){return Math.abs((s.css(h,"transform").split(",")[4]*(s.isRtl?-1:1)+c)/(l-c))},getDistance(){return Math.abs(l-c)},getItemIn(a){a===void 0&&(a=!1);let o=this.getActives(),g=$(h,p(t||e,h,d));if(a){const m=o;o=g,g=m}return g[s.findIndex(g,m=>!s.includes(o,m))]},getActives(){return $(h,p(e||t,h,d))}}}function p(e,t,n){const i=w(e,t);return n?i-P(e,t):Math.min(i,A(t))}function A(e){return Math.max(0,I(e)-s.dimensions(e).width)}function I(e){return s.children(e).reduce((t,n)=>s.dimensions(n).width+t,0)}function P(e,t){return s.dimensions(t).width/2-s.dimensions(e).width/2}function w(e,t){return e&&(s.position(e).left+(s.isRtl?s.dimensions(e).width-s.dimensions(t).width:0))*(s.isRtl?-1:1)||0}function $(e,t){t-=1;const n=s.dimensions(e).width,i=t+n+2;return s.children(e).filter(d=>{const r=w(d,e),h=r+Math.min(s.dimensions(d).width,n);return r>=t&&h<=i})}function u(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var S={mixins:[v,O,L,z],props:{center:Boolean,sets:Boolean},data:{center:!1,sets:!1,attrItem:"uk-slider-item",selList:".uk-slider-items",selNav:".uk-slider-nav",clsContainer:"uk-slider-container",Transitioner:B},computed:{avgWidth(){return I(this.list)/this.length},finite(e){let{finite:t}=e;return t||Math.ceil(I(this.list))<Math.floor(s.dimensions(this.list).width+V(this.list)+this.center)},maxIndex(){if(!this.finite||this.center&&!this.sets)return this.length-1;if(this.center)return s.last(this.sets);let e=0;const t=A(this.list),n=s.findIndex(this.slides,i=>{if(e>=t)return!0;e+=s.dimensions(i).width});return~n?n:this.length-1},sets(e){let{sets:t}=e;if(!t)return;const n=s.dimensions(this.list).width/(this.center?2:1);let i=0,d=n,r=0;return t=s.sortBy(this.slides,"offsetLeft").reduce((h,f,c)=>{const l=s.dimensions(f).width;if(r+l>i&&(!this.center&&c>this.maxIndex&&(c=this.maxIndex),!s.includes(h,c))){const o=this.slides[c+1];this.center&&o&&l<d-s.dimensions(o).width/2?d-=l:(d=n,h.push(c),i=r+n+(this.center?l/2:0))}return r+=l,h},[]),!s.isEmpty(t)&&t},transitionOptions(){return{center:this.center,list:this.list}}},connected(){s.toggleClass(this.$el,this.clsContainer,!s.$("."+this.clsContainer,this.$el))},update:{write(){for(const n of this.navItems){const i=s.toNumber(s.data(n,this.attrItem));i!==!1&&(n.hidden=!this.maxIndex||i>this.maxIndex||this.sets&&!s.includes(this.sets,i))}this.length&&!this.dragging&&!this.stack.length&&(this.reorder(),this._translate(1));const e=this._getTransitioner(this.index).getActives(),t=[this.clsActive,(!this.sets||s.includes(this.sets,s.toFloat(this.index)))&&this.clsActivated||""];for(const n of this.slides)s.toggleClass(n,t,s.includes(e,n))},events:["resize"]},events:{beforeitemshow(e){!this.dragging&&this.sets&&this.stack.length<2&&!s.includes(this.sets,this.index)&&(this.index=this.getValidIndex());const t=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.index<this.prevIndex||this.dir<0&&this.index>this.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&t>1){for(let i=0;i<t;i++)this.stack.splice(1,0,this.dir>0?"next":"previous");e.preventDefault();return}const n=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex;this.duration=b(this.avgWidth/this.velocity)*(s.dimensions(this.slides[n]).width/this.avgWidth),this.reorder()},itemshow(){~this.prevIndex&&s.addClass(this._getTransitioner().getItemIn(),this.clsActive)}},methods:{reorder(){if(this.finite){s.css(this.slides,"order","");return}const e=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((d,r)=>s.css(d,"order",this.dir>0&&r<e?1:this.dir<0&&r>=this.index?-1:"")),!this.center)return;const t=this.slides[e];let n=s.dimensions(this.list).width/2-s.dimensions(t).width/2,i=0;for(;n>0;){const d=this.getIndex(--i+e,e),r=this.slides[d];s.css(r,"order",d>e?-2:-1),n-=s.dimensions(r).width}},getValidIndex(e,t){if(e===void 0&&(e=this.index),t===void 0&&(t=this.prevIndex),e=this.getIndex(e,t),!this.sets)return e;let n;do{if(s.includes(this.sets,e))return e;n=e,e=this.getIndex(e+this.dir,t)}while(e!==n);return e},getAdjacentSlides(){const{width:e}=s.dimensions(this.list),t=-e,n=e*2,i=s.dimensions(this.slides[this.index]).width,d=this.center?e/2-i/2:0,r=new Set;for(const h of[-1,1]){let f=d+(h>0?i:0),c=0;do{const l=this.slides[this.getIndex(this.index+h+c++*h)];f+=s.dimensions(l).width*h,r.add(l)}while(this.slides.length>c&&f>t&&f<n)}return Array.from(r)}}};function V(e){return Math.max(0,...s.children(e).map(t=>s.dimensions(t).width))}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slider",S),S});
|