uikit 3.11.1 → 3.11.2-dev.4c11be04b

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +32 -25
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +32 -25
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +2 -2
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +32 -25
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +2 -2
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +61 -54
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/slider.js +1 -1
  44. package/src/js/mixin/parallax.js +32 -21
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.1",
5
+ "version": "3.11.2-dev.4c11be04b",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -30,7 +30,7 @@ export default {
30
30
  },
31
31
 
32
32
  finite({finite}) {
33
- return finite || Math.ceil(getWidth(this.list)) < dimensions(this.list).width + getMaxElWidth(this.list) + this.center;
33
+ return finite || Math.ceil(getWidth(this.list)) < Math.floor(dimensions(this.list).width + getMaxElWidth(this.list) + this.center);
34
34
  },
35
35
 
36
36
  maxIndex() {
@@ -1,6 +1,6 @@
1
1
  import Media from '../mixin/media';
2
2
  import {getMaxPathLength} from '../core/svg';
3
- import {css, Dimensions, each, isNumber, isString, isUndefined, noop, startsWith, toFloat, toPx, ucfirst} from 'uikit-util';
3
+ import {css, Dimensions, each, isNumber, isString, isUndefined, noop, startsWith, toFloat, toPx, trigger, ucfirst} from 'uikit-util';
4
4
 
5
5
  const props = {
6
6
  x: transformFn,
@@ -38,7 +38,7 @@ export default {
38
38
  props(properties, $el) {
39
39
  return keys(props).reduce((result, prop) => {
40
40
  if (!isUndefined(properties[prop])) {
41
- result[prop] = props[prop].call(this, prop, $el, properties[prop].slice());
41
+ result[prop] = props[prop](prop, $el, properties[prop].slice());
42
42
  }
43
43
  return result;
44
44
  }, {});
@@ -46,6 +46,12 @@ export default {
46
46
 
47
47
  },
48
48
 
49
+ events: {
50
+ bgimageload() {
51
+ this.$emit();
52
+ }
53
+ },
54
+
49
55
  methods: {
50
56
 
51
57
  reset() {
@@ -186,15 +192,15 @@ function backgroundFn(prop, el, steps) {
186
192
  const bgPos = css(el, 'backgroundPosition').split(' ')[prop === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
187
193
 
188
194
  return getCssValue(el, 'backgroundSize', '') === 'cover'
189
- ? backgroundCoverFn.call(this, prop, el, steps, bgPos, attr)
195
+ ? backgroundCoverFn(prop, el, steps, bgPos, attr)
190
196
  : setBackgroundPosFn(prop, steps, bgPos);
191
197
  }
192
198
 
193
199
  function backgroundCoverFn(prop, el, steps, bgPos, attr) {
194
200
 
195
- const image = getBackgroundImage.call(this, el);
201
+ const dimImage = getBackgroundImageDimensions(el);
196
202
 
197
- if (!image.naturalWidth) {
203
+ if (!dimImage.width) {
198
204
  return noop;
199
205
  }
200
206
 
@@ -210,11 +216,6 @@ function backgroundCoverFn(prop, el, steps, bgPos, attr) {
210
216
  height: el.offsetHeight
211
217
  };
212
218
 
213
- const dimImage = {
214
- width: image.naturalWidth,
215
- height: image.naturalHeight
216
- };
217
-
218
219
  const baseDim = Dimensions.cover(dimImage, dimEl);
219
220
  const span = baseDim[attr] - dimEl[attr];
220
221
 
@@ -245,24 +246,34 @@ function setBackgroundPosFn(prop, steps, pos) {
245
246
  };
246
247
  }
247
248
 
248
- function getBackgroundImage(el) {
249
+ const dimensions = {};
250
+ function getBackgroundImageDimensions(el) {
249
251
  const src = css(el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
250
252
 
251
- const data = this._data;
252
-
253
- if (data[src]) {
254
- return data[src];
253
+ if (dimensions[src]) {
254
+ return dimensions[src];
255
255
  }
256
256
 
257
+ const image = new Image();
257
258
  if (src) {
258
- const img = new Image();
259
- img.src = src;
260
- if (!img.naturalWidth) {
261
- img.onload = () => this.$update();
262
- }
259
+ image.src = src;
263
260
 
264
- return data[src] = img;
261
+ if (!image.naturalWidth) {
262
+ image.onload = () => {
263
+ dimensions[src] = toDimensions(image);
264
+ trigger(el, 'bgimageload');
265
+ };
266
+ }
265
267
  }
268
+
269
+ return dimensions[src] = toDimensions(image);
270
+ }
271
+
272
+ function toDimensions(image) {
273
+ return {
274
+ width: image.naturalWidth,
275
+ height: image.naturalHeight
276
+ };
266
277
  }
267
278
 
268
279
  function getStep(steps, percent) {