uikit 3.11.2-dev.7dd548556 → 3.11.2-dev.93483bd3e
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 +3 -3
- 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 +31 -60
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +34 -64
- 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 +108 -72
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +108 -72
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +75 -28
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +108 -72
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +57 -21
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +12 -14
- 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 +4 -4
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +271 -287
- 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 +507 -458
- 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 +3 -3
- package/src/js/components/countdown.js +2 -2
- 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/slider-transitioner.js +2 -2
- 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 +3 -4
- package/src/js/components/slider.js +30 -11
- package/src/js/components/slideshow.js +8 -1
- package/src/js/components/sortable.js +8 -8
- package/src/js/components/upload.js +3 -3
- package/src/js/core/accordion.js +3 -3
- package/src/js/core/alert.js +1 -2
- package/src/js/core/height-match.js +3 -3
- package/src/js/core/img.js +132 -115
- package/src/js/core/modal.js +1 -2
- package/src/js/core/navbar.js +5 -5
- package/src/js/core/scrollspy.js +6 -6
- package/src/js/core/sticky.js +1 -1
- package/src/js/core/svg.js +10 -6
- package/src/js/core/toggle.js +4 -3
- package/src/js/mixin/internal/animate-slide.js +9 -12
- package/src/js/mixin/parallax.js +108 -72
- package/src/js/mixin/slider-drag.js +3 -3
- package/src/js/mixin/slider-nav.js +2 -2
- 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/attr.js +11 -9
- package/src/js/util/dom.js +27 -45
- 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/position.js +2 -2
- 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/src/js/util/promise.js +0 -0
- package/tests/images/animated.gif +0 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "uikit",
|
|
3
3
|
"title": "UIkit",
|
|
4
4
|
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
|
|
5
|
-
"version": "3.11.2-dev.
|
|
5
|
+
"version": "3.11.2-dev.93483bd3e",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/api/component.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
$$,
|
|
3
|
-
assign,
|
|
4
|
-
camelize,
|
|
5
|
-
fastdom,
|
|
6
|
-
hyphenate,
|
|
7
|
-
isPlainObject,
|
|
8
|
-
memoize,
|
|
9
|
-
startsWith,
|
|
10
|
-
} from 'uikit-util';
|
|
1
|
+
import { $$, camelize, fastdom, hyphenate, isPlainObject, memoize, startsWith } from 'uikit-util';
|
|
11
2
|
|
|
12
3
|
export default function (UIkit) {
|
|
13
4
|
const DATA = UIkit.data;
|
|
@@ -51,7 +42,7 @@ export default function (UIkit) {
|
|
|
51
42
|
}
|
|
52
43
|
};
|
|
53
44
|
|
|
54
|
-
const opt = isPlainObject(options) ?
|
|
45
|
+
const opt = isPlainObject(options) ? { ...options } : options.options;
|
|
55
46
|
|
|
56
47
|
opt.name = name;
|
|
57
48
|
|
package/src/js/api/hooks.js
CHANGED
package/src/js/api/state.js
CHANGED
|
@@ -91,7 +91,7 @@ export default function (UIkit) {
|
|
|
91
91
|
|
|
92
92
|
UIkit.prototype._initEvents = function () {
|
|
93
93
|
this._events = [];
|
|
94
|
-
this.$options.events
|
|
94
|
+
for (const event of this.$options.events || []) {
|
|
95
95
|
if (hasOwn(event, 'handler')) {
|
|
96
96
|
registerEvent(this, event);
|
|
97
97
|
} else {
|
|
@@ -99,7 +99,7 @@ export default function (UIkit) {
|
|
|
99
99
|
registerEvent(this, event[key], key);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
}
|
|
102
|
+
}
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
UIkit.prototype._unbindEvents = function () {
|
|
@@ -187,7 +187,7 @@ export default function (UIkit) {
|
|
|
187
187
|
el = isFunction(el) ? el.call(component) : el || component.$el;
|
|
188
188
|
|
|
189
189
|
if (isArray(el)) {
|
|
190
|
-
el.forEach((el) => registerEvent(component,
|
|
190
|
+
el.forEach((el) => registerEvent(component, { ...event, el }, key));
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
77
77
|
timespan.days = timespan.hours = timespan.minutes = timespan.seconds = 0;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
this.units
|
|
80
|
+
for (const unit of this.units) {
|
|
81
81
|
let digits = String(Math.floor(timespan[unit]));
|
|
82
82
|
|
|
83
83
|
digits = digits.length < 2 ? `0${digits}` : digits;
|
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
|
|
93
93
|
digits.forEach((digit, i) => (el.children[i].textContent = digit));
|
|
94
94
|
}
|
|
95
|
-
}
|
|
95
|
+
}
|
|
96
96
|
},
|
|
97
97
|
},
|
|
98
98
|
|
|
@@ -2,7 +2,6 @@ import Animate from '../mixin/animate';
|
|
|
2
2
|
import {
|
|
3
3
|
$$,
|
|
4
4
|
append,
|
|
5
|
-
assign,
|
|
6
5
|
css,
|
|
7
6
|
data,
|
|
8
7
|
each,
|
|
@@ -105,7 +104,7 @@ export default {
|
|
|
105
104
|
},
|
|
106
105
|
|
|
107
106
|
setState(state, animate = true) {
|
|
108
|
-
state =
|
|
107
|
+
state = { filter: { '': '' }, sort: [], ...state };
|
|
109
108
|
|
|
110
109
|
trigger(this.$el, 'beforeFilter', [this, state]);
|
|
111
110
|
|
|
@@ -205,7 +204,7 @@ function getSelector({ filter }) {
|
|
|
205
204
|
}
|
|
206
205
|
|
|
207
206
|
function sortItems(nodes, sort, order) {
|
|
208
|
-
return
|
|
207
|
+
return [...nodes].sort(
|
|
209
208
|
(a, b) =>
|
|
210
209
|
data(a, sort).localeCompare(data(b, sort), undefined, { numeric: true }) *
|
|
211
210
|
(order === 'asc' || -1)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Animations, { scale3d } from '../../mixin/internal/slideshow-animations';
|
|
2
|
-
import {
|
|
2
|
+
import { css } from 'uikit-util';
|
|
3
3
|
|
|
4
|
-
export default
|
|
4
|
+
export default {
|
|
5
|
+
...Animations,
|
|
5
6
|
fade: {
|
|
6
7
|
show() {
|
|
7
8
|
return [{ opacity: 0 }, { opacity: 1 }];
|
|
@@ -35,4 +36,4 @@ export default assign({}, Animations, {
|
|
|
35
36
|
];
|
|
36
37
|
},
|
|
37
38
|
},
|
|
38
|
-
}
|
|
39
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { $$, isVisible, removeAttr } from 'uikit-util';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
connected() {
|
|
5
|
+
if (window.IntersectionObserver) {
|
|
6
|
+
this.observer = new IntersectionObserver(
|
|
7
|
+
(entries) => {
|
|
8
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
9
|
+
removeLazyLoad(this.getAdjacentSlides());
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
{ rootMargin: '50% 50%' }
|
|
13
|
+
);
|
|
14
|
+
this.observer.observe(this.$el);
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
disconnected() {
|
|
19
|
+
this.observer && this.observer.disconnect();
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
update: {
|
|
23
|
+
read() {
|
|
24
|
+
if (isVisible(this.$el)) {
|
|
25
|
+
removeLazyLoad(this.getAdjacentSlides());
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
events: ['resize'],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function removeLazyLoad(elements = []) {
|
|
34
|
+
for (const el of elements) {
|
|
35
|
+
el && $$('img[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -89,7 +89,7 @@ export default function (prev, next, dir, { center, easing, list }) {
|
|
|
89
89
|
|
|
90
90
|
percent = prev ? clamp(percent, -1, 1) : 0;
|
|
91
91
|
|
|
92
|
-
children(list)
|
|
92
|
+
for (const slide of children(list)) {
|
|
93
93
|
const isActive = includes(actives, slide);
|
|
94
94
|
const isIn = slide === itemIn;
|
|
95
95
|
const isOut = slide === itemOut;
|
|
@@ -104,7 +104,7 @@ export default function (prev, next, dir, { center, easing, list }) {
|
|
|
104
104
|
dir,
|
|
105
105
|
percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0,
|
|
106
106
|
});
|
|
107
|
-
}
|
|
107
|
+
}
|
|
108
108
|
},
|
|
109
109
|
|
|
110
110
|
percent() {
|
|
@@ -3,9 +3,10 @@ import Animations, {
|
|
|
3
3
|
translate,
|
|
4
4
|
translated,
|
|
5
5
|
} from '../../mixin/internal/slideshow-animations';
|
|
6
|
-
import {
|
|
6
|
+
import { css } from 'uikit-util';
|
|
7
7
|
|
|
8
|
-
export default
|
|
8
|
+
export default {
|
|
9
|
+
...Animations,
|
|
9
10
|
fade: {
|
|
10
11
|
show() {
|
|
11
12
|
return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
|
|
@@ -96,4 +97,4 @@ export default assign({}, Animations, {
|
|
|
96
97
|
];
|
|
97
98
|
},
|
|
98
99
|
},
|
|
99
|
-
}
|
|
100
|
+
};
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
$,
|
|
8
8
|
addClass,
|
|
9
9
|
append,
|
|
10
|
-
assign,
|
|
11
10
|
attr,
|
|
12
11
|
fragment,
|
|
13
12
|
getImage,
|
|
@@ -219,29 +218,21 @@ export default {
|
|
|
219
218
|
if (type === 'image' || src.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i)) {
|
|
220
219
|
try {
|
|
221
220
|
const { width, height } = await getImage(src, attrs.srcset, attrs.size);
|
|
222
|
-
this.setItem(
|
|
223
|
-
item,
|
|
224
|
-
createEl('img', assign({ src, width, height, alt }, attrs))
|
|
225
|
-
);
|
|
221
|
+
this.setItem(item, createEl('img', { src, width, height, alt, ...attrs }));
|
|
226
222
|
} catch (e) {
|
|
227
223
|
this.setError(item);
|
|
228
224
|
}
|
|
229
225
|
|
|
230
226
|
// Video
|
|
231
227
|
} else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
|
|
232
|
-
const video = createEl(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
'uk-video': `${this.videoAutoplay}`,
|
|
241
|
-
},
|
|
242
|
-
attrs
|
|
243
|
-
)
|
|
244
|
-
);
|
|
228
|
+
const video = createEl('video', {
|
|
229
|
+
src,
|
|
230
|
+
poster,
|
|
231
|
+
controls: '',
|
|
232
|
+
playsinline: '',
|
|
233
|
+
'uk-video': `${this.videoAutoplay}`,
|
|
234
|
+
...attrs,
|
|
235
|
+
});
|
|
245
236
|
|
|
246
237
|
on(video, 'loadedmetadata', () => {
|
|
247
238
|
attr(video, { width: video.videoWidth, height: video.videoHeight });
|
|
@@ -253,18 +244,13 @@ export default {
|
|
|
253
244
|
} else if (type === 'iframe' || src.match(/\.(html|php)($|\?)/i)) {
|
|
254
245
|
this.setItem(
|
|
255
246
|
item,
|
|
256
|
-
createEl(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
class: 'uk-lightbox-iframe',
|
|
264
|
-
},
|
|
265
|
-
attrs
|
|
266
|
-
)
|
|
267
|
-
)
|
|
247
|
+
createEl('iframe', {
|
|
248
|
+
src,
|
|
249
|
+
frameborder: '0',
|
|
250
|
+
allowfullscreen: '',
|
|
251
|
+
class: 'uk-lightbox-iframe',
|
|
252
|
+
...attrs,
|
|
253
|
+
})
|
|
268
254
|
);
|
|
269
255
|
|
|
270
256
|
// YouTube
|
|
@@ -275,20 +261,15 @@ export default {
|
|
|
275
261
|
) {
|
|
276
262
|
this.setItem(
|
|
277
263
|
item,
|
|
278
|
-
createEl(
|
|
279
|
-
'
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
iframeAttrs,
|
|
289
|
-
attrs
|
|
290
|
-
)
|
|
291
|
-
)
|
|
264
|
+
createEl('iframe', {
|
|
265
|
+
src: `https://www.youtube${matches[1] || ''}.com/embed/${matches[2]}${
|
|
266
|
+
matches[3] ? `?${matches[3]}` : ''
|
|
267
|
+
}`,
|
|
268
|
+
width: 1920,
|
|
269
|
+
height: 1080,
|
|
270
|
+
...iframeAttrs,
|
|
271
|
+
...attrs,
|
|
272
|
+
})
|
|
292
273
|
);
|
|
293
274
|
|
|
294
275
|
// Vimeo
|
|
@@ -307,20 +288,15 @@ export default {
|
|
|
307
288
|
|
|
308
289
|
this.setItem(
|
|
309
290
|
item,
|
|
310
|
-
createEl(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
},
|
|
320
|
-
iframeAttrs,
|
|
321
|
-
attrs
|
|
322
|
-
)
|
|
323
|
-
)
|
|
291
|
+
createEl('iframe', {
|
|
292
|
+
src: `https://player.vimeo.com/video/${matches[1]}${
|
|
293
|
+
matches[2] ? `?${matches[2]}` : ''
|
|
294
|
+
}`,
|
|
295
|
+
width,
|
|
296
|
+
height,
|
|
297
|
+
...iframeAttrs,
|
|
298
|
+
...attrs,
|
|
299
|
+
})
|
|
324
300
|
);
|
|
325
301
|
} catch (e) {
|
|
326
302
|
this.setError(item);
|
|
@@ -48,8 +48,7 @@ export default {
|
|
|
48
48
|
index = findIndex(items, ({ source: src }) => source === src);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
this.panel =
|
|
52
|
-
this.panel || this.$create('lightboxPanel', assign({}, this.$props, { items }));
|
|
51
|
+
this.panel = this.panel || this.$create('lightboxPanel', { ...this.$props, items });
|
|
53
52
|
|
|
54
53
|
on(this.panel.$el, 'hidden', () => (this.panel = false));
|
|
55
54
|
|
|
@@ -73,9 +72,9 @@ function install(UIkit, Lightbox) {
|
|
|
73
72
|
function toItem(el) {
|
|
74
73
|
const item = {};
|
|
75
74
|
|
|
76
|
-
['href', 'caption', 'type', 'poster', 'alt', 'attrs']
|
|
75
|
+
for (const attr of ['href', 'caption', 'type', 'poster', 'alt', 'attrs']) {
|
|
77
76
|
item[attr === 'href' ? 'source' : attr] = data(el, attr);
|
|
78
|
-
}
|
|
77
|
+
}
|
|
79
78
|
|
|
80
79
|
item.attrs = parseOptions(item.attrs);
|
|
81
80
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Class from '../mixin/class';
|
|
2
2
|
import Slider, { speedUp } from '../mixin/slider';
|
|
3
3
|
import SliderReactive from '../mixin/slider-reactive';
|
|
4
|
+
import SliderPreload from './internal/slider-preload';
|
|
4
5
|
import Transitioner, { getMax, getWidth } from './internal/slider-transitioner';
|
|
5
6
|
import {
|
|
6
7
|
$,
|
|
@@ -20,7 +21,7 @@ import {
|
|
|
20
21
|
} from 'uikit-util';
|
|
21
22
|
|
|
22
23
|
export default {
|
|
23
|
-
mixins: [Class, Slider, SliderReactive],
|
|
24
|
+
mixins: [Class, Slider, SliderReactive, SliderPreload],
|
|
24
25
|
|
|
25
26
|
props: {
|
|
26
27
|
center: Boolean,
|
|
@@ -130,7 +131,7 @@ export default {
|
|
|
130
131
|
|
|
131
132
|
update: {
|
|
132
133
|
write() {
|
|
133
|
-
this.navItems
|
|
134
|
+
for (const el of this.navItems) {
|
|
134
135
|
const index = toNumber(data(el, this.attrItem));
|
|
135
136
|
if (index !== false) {
|
|
136
137
|
el.hidden =
|
|
@@ -138,7 +139,7 @@ export default {
|
|
|
138
139
|
index > this.maxIndex ||
|
|
139
140
|
(this.sets && !includes(this.sets, index));
|
|
140
141
|
}
|
|
141
|
-
}
|
|
142
|
+
}
|
|
142
143
|
|
|
143
144
|
if (this.length && !this.dragging && !this.stack.length) {
|
|
144
145
|
this.reorder();
|
|
@@ -146,14 +147,13 @@ export default {
|
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
const actives = this._getTransitioner(this.index).getActives();
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
);
|
|
150
|
+
const activeClasses = [
|
|
151
|
+
this.clsActive,
|
|
152
|
+
((!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated) ||
|
|
153
|
+
'',
|
|
154
|
+
];
|
|
155
|
+
for (const slide of this.slides) {
|
|
156
|
+
toggleClass(slide, activeClasses, includes(actives, slide));
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
159
|
|
|
@@ -259,6 +259,25 @@ export default {
|
|
|
259
259
|
|
|
260
260
|
return index;
|
|
261
261
|
},
|
|
262
|
+
|
|
263
|
+
getAdjacentSlides() {
|
|
264
|
+
const { width } = dimensions(this.list);
|
|
265
|
+
const left = -width;
|
|
266
|
+
const right = width * 2;
|
|
267
|
+
const slideWidth = dimensions(this.slides[this.index]).width;
|
|
268
|
+
const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
|
|
269
|
+
const slides = new Set();
|
|
270
|
+
for (const i of [-1, 1]) {
|
|
271
|
+
let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
|
|
272
|
+
let j = 0;
|
|
273
|
+
do {
|
|
274
|
+
const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
|
|
275
|
+
currentLeft += dimensions(slide).width * i;
|
|
276
|
+
slides.add(slide);
|
|
277
|
+
} while (this.slides.length > j && currentLeft > left && currentLeft < right);
|
|
278
|
+
}
|
|
279
|
+
return Array.from(slides);
|
|
280
|
+
},
|
|
262
281
|
},
|
|
263
282
|
};
|
|
264
283
|
|
|
@@ -2,10 +2,11 @@ import Class from '../mixin/class';
|
|
|
2
2
|
import Slideshow from '../mixin/slideshow';
|
|
3
3
|
import Animations from './internal/slideshow-animations';
|
|
4
4
|
import SliderReactive from '../mixin/slider-reactive';
|
|
5
|
+
import SliderPreload from './internal/slider-preload';
|
|
5
6
|
import { boxModelAdjust, css } from 'uikit-util';
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
|
-
mixins: [Class, Slideshow, SliderReactive],
|
|
9
|
+
mixins: [Class, Slideshow, SliderReactive, SliderPreload],
|
|
9
10
|
|
|
10
11
|
props: {
|
|
11
12
|
ratio: String,
|
|
@@ -50,4 +51,10 @@ export default {
|
|
|
50
51
|
|
|
51
52
|
events: ['resize'],
|
|
52
53
|
},
|
|
54
|
+
|
|
55
|
+
methods: {
|
|
56
|
+
getAdjacentSlides() {
|
|
57
|
+
return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
|
|
58
|
+
},
|
|
59
|
+
},
|
|
53
60
|
};
|
|
@@ -67,13 +67,13 @@ export default {
|
|
|
67
67
|
},
|
|
68
68
|
|
|
69
69
|
created() {
|
|
70
|
-
['init', 'start', 'move', 'end']
|
|
70
|
+
for (const key of ['init', 'start', 'move', 'end']) {
|
|
71
71
|
const fn = this[key];
|
|
72
72
|
this[key] = (e) => {
|
|
73
73
|
assign(this.pos, getEventPos(e));
|
|
74
74
|
fn(e);
|
|
75
75
|
};
|
|
76
|
-
}
|
|
76
|
+
}
|
|
77
77
|
},
|
|
78
78
|
|
|
79
79
|
events: {
|
|
@@ -205,7 +205,7 @@ export default {
|
|
|
205
205
|
|
|
206
206
|
this.touched = new Set([this]);
|
|
207
207
|
this.placeholder = placeholder;
|
|
208
|
-
this.origin =
|
|
208
|
+
this.origin = { target, index: index(placeholder), ...this.pos };
|
|
209
209
|
|
|
210
210
|
on(document, pointerMove, this.move);
|
|
211
211
|
on(document, pointerUp, this.end);
|
|
@@ -269,11 +269,11 @@ export default {
|
|
|
269
269
|
remove(this.drag);
|
|
270
270
|
this.drag = null;
|
|
271
271
|
|
|
272
|
-
|
|
273
|
-
this.touched
|
|
274
|
-
removeClass(sortable.items, clsPlaceholder, clsItem)
|
|
275
|
-
|
|
276
|
-
|
|
272
|
+
for (const { clsPlaceholder, clsItem } of this.touched) {
|
|
273
|
+
for (const sortable of this.touched) {
|
|
274
|
+
removeClass(sortable.items, clsPlaceholder, clsItem);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
277
|
this.touched = null;
|
|
278
278
|
removeClass(document.documentElement, this.clsDragState);
|
|
279
279
|
},
|
|
@@ -139,9 +139,9 @@ export default {
|
|
|
139
139
|
beforeSend: (env) => {
|
|
140
140
|
const { xhr } = env;
|
|
141
141
|
xhr.upload && on(xhr.upload, 'progress', this.progress);
|
|
142
|
-
['loadStart', 'load', 'loadEnd', 'abort']
|
|
143
|
-
on(xhr, type.toLowerCase(), this[type])
|
|
144
|
-
|
|
142
|
+
for (const type of ['loadStart', 'load', 'loadEnd', 'abort']) {
|
|
143
|
+
on(xhr, type.toLowerCase(), this[type]);
|
|
144
|
+
}
|
|
145
145
|
|
|
146
146
|
return this.beforeSend(env);
|
|
147
147
|
},
|
package/src/js/core/accordion.js
CHANGED
|
@@ -105,7 +105,7 @@ export default {
|
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
for (const el of items) {
|
|
109
109
|
this.toggleElement(el, !hasClass(el, this.clsOpen), async (el, show) => {
|
|
110
110
|
toggleClass(el, this.clsOpen, show);
|
|
111
111
|
attr($(this.$props.toggle, el), 'aria-expanded', show);
|
|
@@ -134,8 +134,8 @@ export default {
|
|
|
134
134
|
scrollIntoView(toggle, { offset: this.offset });
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
})
|
|
138
|
-
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
139
|
},
|
|
140
140
|
},
|
|
141
141
|
};
|
package/src/js/core/alert.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Class from '../mixin/class';
|
|
2
2
|
import Togglable from '../mixin/togglable';
|
|
3
|
-
import { assign } from 'uikit-util';
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
5
|
mixins: [Class, Togglable],
|
|
@@ -15,7 +14,7 @@ export default {
|
|
|
15
14
|
animation: [true],
|
|
16
15
|
selClose: '.uk-alert-close',
|
|
17
16
|
duration: 150,
|
|
18
|
-
hideProps:
|
|
17
|
+
hideProps: { opacity: 0, ...Togglable.data.hideProps },
|
|
19
18
|
},
|
|
20
19
|
|
|
21
20
|
events: [
|
|
@@ -29,9 +29,9 @@ export default {
|
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
write({ rows }) {
|
|
32
|
-
|
|
33
|
-
elements.forEach((el, i) => css(el, 'minHeight', heights[i]))
|
|
34
|
-
|
|
32
|
+
for (const { heights, elements } of rows) {
|
|
33
|
+
elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
|
|
34
|
+
}
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
events: ['resize'],
|