uikit 3.13.11-dev.3b88fea57 → 3.13.11-dev.9f2f619d7

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 (43) hide show
  1. package/CHANGELOG.md +1 -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 +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  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 +27 -14
  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 +27 -14
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/core/cover.js +27 -14
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.13.11-dev.3b88fea57",
5
+ "version": "3.13.11-dev.9f2f619d7",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -26,25 +26,38 @@ export default {
26
26
 
27
27
  update: {
28
28
  read() {
29
- const el = this.$el;
30
- const { offsetHeight: height, offsetWidth: width } =
31
- getPositionedParent(el) || parent(el);
32
- const dim = Dimensions.cover(
33
- {
34
- width: this.width || el.naturalWidth || el.videoWidth || el.clientWidth,
35
- height: this.height || el.naturalHeight || el.videoHeight || el.clientHeight,
36
- },
37
- {
38
- width: width + (width % 2 ? 1 : 0),
39
- height: height + (height % 2 ? 1 : 0),
40
- }
41
- );
29
+ const { ratio, cover } = Dimensions;
30
+ const { $el, width, height } = this;
31
+
32
+ let dim = { width, height };
42
33
 
43
34
  if (!dim.width || !dim.height) {
35
+ const intrinsic = {
36
+ width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,
37
+ height: $el.naturalHeight || $el.videoHeight || $el.clientHeight,
38
+ };
39
+
40
+ if (dim.width) {
41
+ dim = ratio(intrinsic, 'width', dim.width);
42
+ } else if (height) {
43
+ dim = ratio(intrinsic, 'height', dim.height);
44
+ } else {
45
+ dim = intrinsic;
46
+ }
47
+ }
48
+
49
+ const { offsetHeight: coverHeight, offsetWidth: coverWidth } =
50
+ getPositionedParent($el) || parent($el);
51
+ const coverDim = cover(dim, {
52
+ width: coverWidth + (coverWidth % 2 ? 1 : 0),
53
+ height: coverHeight + (coverHeight % 2 ? 1 : 0),
54
+ });
55
+
56
+ if (!coverDim.width || !coverDim.height) {
44
57
  return false;
45
58
  }
46
59
 
47
- return dim;
60
+ return coverDim;
48
61
  },
49
62
 
50
63
  write({ height, width }) {