uikit 3.11.2-dev.31cd2ba38 → 3.11.2-dev.9433cd5fd
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 +41 -24
- 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 +41 -24
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/core/img.js +40 -19
- package/src/js/util/options.js +2 -2
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.9433cd5fd",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/core/img.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {append, attr, children, createEvent, css, data, escape, fragment, includes, isArray,
|
|
1
|
+
import {append, attr, children, createEvent, css, data, escape, fragment, includes, isArray, isEmpty, isUndefined, parent, parseOptions, queryAll, startsWith, toFloat, toPx, trigger} from 'uikit-util';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
|
|
@@ -55,18 +55,10 @@ export default {
|
|
|
55
55
|
|
|
56
56
|
update: {
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
write(store) {
|
|
60
59
|
if (!this.observer || isImg(this.$el)) {
|
|
61
60
|
return false;
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
setSrcAttrs(this.$el, image && image.currentSrc);
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
write(store) {
|
|
69
|
-
|
|
70
62
|
const srcset = data(this.$el, 'data-srcset');
|
|
71
63
|
if (srcset && window.devicePixelRatio !== 1) {
|
|
72
64
|
|
|
@@ -99,10 +91,14 @@ export default {
|
|
|
99
91
|
|
|
100
92
|
const image = isImg(this.$el)
|
|
101
93
|
? this.$el
|
|
102
|
-
: getImageFromElement(
|
|
94
|
+
: getImageFromElement(
|
|
95
|
+
this.$el,
|
|
96
|
+
this.dataSrc,
|
|
97
|
+
this.dataSources
|
|
98
|
+
);
|
|
103
99
|
|
|
104
100
|
this._data.image = image;
|
|
105
|
-
setSrcAttrs(this.$el, image.currentSrc
|
|
101
|
+
setSrcAttrs(this.$el, image.currentSrc);
|
|
106
102
|
|
|
107
103
|
this.observer.disconnect();
|
|
108
104
|
},
|
|
@@ -148,7 +144,7 @@ function setSourceProps(sourceEl, targetEl) {
|
|
|
148
144
|
});
|
|
149
145
|
}
|
|
150
146
|
|
|
151
|
-
function getImageFromElement(el, src, sources
|
|
147
|
+
function getImageFromElement(el, src, sources) {
|
|
152
148
|
|
|
153
149
|
if (!src) {
|
|
154
150
|
return false;
|
|
@@ -156,9 +152,16 @@ function getImageFromElement(el, src, sources = []) {
|
|
|
156
152
|
|
|
157
153
|
const img = new Image();
|
|
158
154
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
wrapInPicture(img, sources);
|
|
156
|
+
setSourceProps(el, img);
|
|
157
|
+
img.onload = () => setSrcAttrs(el, img.currentSrc);
|
|
158
|
+
attr(img, 'src', src);
|
|
159
|
+
return img;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function wrapInPicture(img, sources) {
|
|
163
|
+
|
|
164
|
+
sources = parseSources(sources);
|
|
162
165
|
|
|
163
166
|
if (sources.length) {
|
|
164
167
|
const picture = fragment('<picture>');
|
|
@@ -169,10 +172,28 @@ function getImageFromElement(el, src, sources = []) {
|
|
|
169
172
|
});
|
|
170
173
|
append(picture, img);
|
|
171
174
|
}
|
|
175
|
+
}
|
|
172
176
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
function parseSources(sources) {
|
|
178
|
+
if (!sources) {
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (startsWith(sources, '[')) {
|
|
183
|
+
try {
|
|
184
|
+
sources = JSON.parse(sources);
|
|
185
|
+
} catch (e) {
|
|
186
|
+
sources = [];
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
sources = parseOptions(sources);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (!isArray(sources)) {
|
|
193
|
+
sources = [sources];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return sources.filter(source => !isEmpty(source));
|
|
176
197
|
}
|
|
177
198
|
|
|
178
199
|
const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
|
package/src/js/util/options.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {assign, hasOwn, includes, isArray, isFunction, isUndefined, sortBy} from './lang';
|
|
1
|
+
import {assign, hasOwn, includes, isArray, isFunction, isUndefined, sortBy, startsWith} from './lang';
|
|
2
2
|
|
|
3
3
|
const strats = {};
|
|
4
4
|
|
|
@@ -135,7 +135,7 @@ export function parseOptions(options, args = []) {
|
|
|
135
135
|
try {
|
|
136
136
|
|
|
137
137
|
return options
|
|
138
|
-
? options
|
|
138
|
+
? startsWith(options, '{')
|
|
139
139
|
? JSON.parse(options)
|
|
140
140
|
: args.length && !includes(options, ':')
|
|
141
141
|
? ({[args[0]]: options})
|