uikit 3.11.2-dev.54d67da03 → 3.11.2-dev.a08b20474
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/dist/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- 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 +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- 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 +1 -1
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +1 -1
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +1 -1
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +1 -1
- 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 +33 -25
- 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 +33 -25
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/component.js +1 -1
- package/src/js/api/state.js +16 -20
- package/src/js/core/img.js +14 -2
- package/tests/image.html +6 -6
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.a08b20474",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/api/component.js
CHANGED
|
@@ -28,7 +28,7 @@ export default function (UIkit) {
|
|
|
28
28
|
|
|
29
29
|
return component.options.functional
|
|
30
30
|
? new component({data: isPlainObject(element) ? element : [...arguments]})
|
|
31
|
-
:
|
|
31
|
+
: element ? $$(element).map(init)[0] : init();
|
|
32
32
|
|
|
33
33
|
function init(element) {
|
|
34
34
|
|
package/src/js/api/state.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {assign, camelize, data as getData, hasOwn, hyphenate, isArray,
|
|
1
|
+
import {assign, camelize, data as getData, hasOwn, hyphenate, isArray, isFunction, isNumeric, isPlainObject, isString, isUndefined, mergeOptions, on, parseOptions, startsWith, toBoolean, toNumber} from 'uikit-util';
|
|
2
2
|
|
|
3
3
|
export default function (UIkit) {
|
|
4
4
|
|
|
@@ -250,27 +250,23 @@ export default function (UIkit) {
|
|
|
250
250
|
: [value];
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
function normalizeData({data}, {args, props = {}}) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
assign(data, value);
|
|
259
|
-
} else {
|
|
260
|
-
data[args[index]] = value;
|
|
261
|
-
}
|
|
262
|
-
return data;
|
|
263
|
-
}, {})
|
|
264
|
-
: undefined
|
|
265
|
-
: data;
|
|
266
|
-
|
|
267
|
-
if (data) {
|
|
268
|
-
for (const key in data) {
|
|
269
|
-
if (isUndefined(data[key])) {
|
|
270
|
-
delete data[key];
|
|
253
|
+
function normalizeData({data = {}}, {args = [], props = {}}) {
|
|
254
|
+
if (isArray(data)) {
|
|
255
|
+
data = data.slice(0, args.length).reduce((data, value, index) => {
|
|
256
|
+
if (isPlainObject(value)) {
|
|
257
|
+
assign(data, value);
|
|
271
258
|
} else {
|
|
272
|
-
data[
|
|
259
|
+
data[args[index]] = value;
|
|
273
260
|
}
|
|
261
|
+
return data;
|
|
262
|
+
}, {});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
for (const key in data) {
|
|
266
|
+
if (isUndefined(data[key])) {
|
|
267
|
+
delete data[key];
|
|
268
|
+
} else if (props[key]) {
|
|
269
|
+
data[key] = coerce(props[key], data[key]);
|
|
274
270
|
}
|
|
275
271
|
}
|
|
276
272
|
|
package/src/js/core/img.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {append, attr, children, createEvent, css, data, escape, fragment, hasAttr, includes, isArray, isEmpty, isUndefined, parent, parseOptions, queryAll, startsWith, toFloat, toPx, trigger} from 'uikit-util';
|
|
2
2
|
|
|
3
|
+
const nativeLazyLoad = 'loading' in HTMLImageElement.prototype;
|
|
4
|
+
|
|
3
5
|
export default {
|
|
4
6
|
|
|
5
7
|
args: 'dataSrc',
|
|
@@ -43,7 +45,16 @@ export default {
|
|
|
43
45
|
return;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
if (nativeLazyLoad && isImg(this.$el)) {
|
|
49
|
+
this.$el.loading = 'lazy';
|
|
50
|
+
setSrcAttrs(this.$el);
|
|
51
|
+
|
|
52
|
+
if (this.target.length === 1) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ensureSrcAttribute(this.$el);
|
|
47
58
|
|
|
48
59
|
const rootMargin = `${toPx(this.offsetTop, 'height')}px ${toPx(this.offsetLeft, 'width')}px`;
|
|
49
60
|
this.observer = new IntersectionObserver(this.load, {rootMargin});
|
|
@@ -100,6 +111,7 @@ export default {
|
|
|
100
111
|
);
|
|
101
112
|
|
|
102
113
|
this._data.image = image;
|
|
114
|
+
image.loading = 'eager';
|
|
103
115
|
setSrcAttrs(this.$el, image.currentSrc);
|
|
104
116
|
|
|
105
117
|
this.observer.disconnect();
|
|
@@ -234,7 +246,7 @@ function getSourceSize(srcset, sizes) {
|
|
|
234
246
|
return descriptors.filter(size => size >= srcSize)[0] || descriptors.pop() || '';
|
|
235
247
|
}
|
|
236
248
|
|
|
237
|
-
function
|
|
249
|
+
function ensureSrcAttribute(el) {
|
|
238
250
|
if (isImg(el) && !hasAttr(el, 'src')) {
|
|
239
251
|
attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
|
|
240
252
|
}
|
package/tests/image.html
CHANGED
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
|
|
15
15
|
<h1>Image</h1>
|
|
16
16
|
|
|
17
|
-
<div class="uk-child-width-1-2@m" uk-grid>
|
|
17
|
+
<div class="uk-child-width-1-2@m uk-background-secondary" uk-grid>
|
|
18
18
|
<div>
|
|
19
|
-
<img
|
|
19
|
+
<img src="https://images.unsplash.com/photo-1522201949034-507737bce479?fit=crop&w=900&h=600&q=80" width="900" height="600" alt="">
|
|
20
20
|
</div>
|
|
21
21
|
<div>
|
|
22
|
-
<img
|
|
22
|
+
<img src="https://images.unsplash.com/photo-1503481766315-7a586b20f66d?fit=crop&w=900&h=600&q=80" width="900" height="600" alt="">
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
|
-
<div>
|
|
26
|
+
<div class="uk-background-primary">
|
|
27
27
|
<picture>
|
|
28
|
-
<source type="image/webp" sizes="(min-width: 780px) 780px"
|
|
29
|
-
<img
|
|
28
|
+
<source type="image/webp" sizes="(min-width: 780px) 780px" srcset="http://localhost/site/image?src=WyJzaXRlXC9pbWFnZXNcL2hvbWVcL3lvb3RoZW1lLXByby5qcGciLFtbInR5cGUiLFsid2VicCIsIjg1Il1dLFsiZG9SZXNpemUiLFs3ODEsNDg4LDc4MSw0ODhdXSxbImRvQ3JvcCIsWzc4MCw0ODgsMCwwXV1dXQ%3D%3D&hash=9a3c6f9c 780w, /site/cache/images/yootheme-pro-5db7acab.webp 1560w">
|
|
29
|
+
<img src="/site/cache/images/yootheme-pro-0d67d545.jpeg" width="780" height="488" alt="Introduction Video on using the YOOtheme Pro Page Builder for WordPress and Joomla">
|
|
30
30
|
</picture>
|
|
31
31
|
</div>
|
|
32
32
|
<div class="uk-height-large uk-background-cover uk-margin-medium uk-flex uk-flex-center uk-flex-middle uk-light" data-src="https://images.unsplash.com/photo-1490822180406-880c226c150b?fit=crop&w=1200&h=450&q=80" data-sources="srcset: images/test.avif; type: image/avif" uk-img>
|