uikit 3.10.2-dev.c8aa7eda2 → 3.11.1

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 (61) hide show
  1. package/CHANGELOG.md +35 -14
  2. package/build/icons.js +4 -4
  3. package/build/scope.js +4 -6
  4. package/dist/css/uikit-core-rtl.css +10 -1
  5. package/dist/css/uikit-core-rtl.min.css +1 -1
  6. package/dist/css/uikit-core.css +10 -1
  7. package/dist/css/uikit-core.min.css +1 -1
  8. package/dist/css/uikit-rtl.css +10 -1
  9. package/dist/css/uikit-rtl.min.css +1 -1
  10. package/dist/css/uikit.css +10 -1
  11. package/dist/css/uikit.min.css +1 -1
  12. package/dist/js/components/countdown.js +1 -1
  13. package/dist/js/components/countdown.min.js +1 -1
  14. package/dist/js/components/filter.js +1 -1
  15. package/dist/js/components/filter.min.js +1 -1
  16. package/dist/js/components/lightbox-panel.js +1 -1
  17. package/dist/js/components/lightbox-panel.min.js +1 -1
  18. package/dist/js/components/lightbox.js +1 -1
  19. package/dist/js/components/lightbox.min.js +1 -1
  20. package/dist/js/components/notification.js +1 -1
  21. package/dist/js/components/notification.min.js +1 -1
  22. package/dist/js/components/parallax.js +257 -264
  23. package/dist/js/components/parallax.min.js +1 -1
  24. package/dist/js/components/slider-parallax.js +215 -257
  25. package/dist/js/components/slider-parallax.min.js +1 -1
  26. package/dist/js/components/slider.js +1 -1
  27. package/dist/js/components/slider.min.js +1 -1
  28. package/dist/js/components/slideshow-parallax.js +215 -257
  29. package/dist/js/components/slideshow-parallax.min.js +1 -1
  30. package/dist/js/components/slideshow.js +1 -1
  31. package/dist/js/components/slideshow.min.js +1 -1
  32. package/dist/js/components/sortable.js +1 -1
  33. package/dist/js/components/sortable.min.js +1 -1
  34. package/dist/js/components/tooltip.js +1 -1
  35. package/dist/js/components/tooltip.min.js +1 -1
  36. package/dist/js/components/upload.js +1 -1
  37. package/dist/js/components/upload.min.js +1 -1
  38. package/dist/js/uikit-core.js +28 -26
  39. package/dist/js/uikit-core.min.js +1 -1
  40. package/dist/js/uikit-icons.js +1 -1
  41. package/dist/js/uikit-icons.min.js +1 -1
  42. package/dist/js/uikit.js +284 -289
  43. package/dist/js/uikit.min.js +1 -1
  44. package/package.json +5 -5
  45. package/src/js/components/parallax.js +38 -8
  46. package/src/js/core/grid.js +2 -2
  47. package/src/js/core/svg.js +9 -7
  48. package/src/js/mixin/parallax.js +209 -242
  49. package/src/js/util/dimensions.js +4 -2
  50. package/src/js/util/viewport.js +9 -13
  51. package/src/less/components/position.less +2 -0
  52. package/src/less/components/sticky.less +6 -0
  53. package/src/scss/components/position.scss +2 -0
  54. package/src/scss/components/sticky.scss +6 -0
  55. package/tests/index.html +1 -1
  56. package/tests/js/index.js +1 -1
  57. package/tests/notification.html +5 -5
  58. package/tests/parallax.html +66 -50
  59. package/tests/sticky-parallax.html +274 -0
  60. package/tests/sticky.html +2 -2
  61. package/tests/tab.html +1 -1
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.10.2-dev.c8aa7eda2",
5
+ "version": "3.11.1",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -39,10 +39,10 @@
39
39
  "@rollup/plugin-replace": "^3.0.1",
40
40
  "archiver": "^5.3.0",
41
41
  "camelcase": "^6.3.0",
42
- "clean-css": "^5.2.2",
42
+ "clean-css": "^5.2.4",
43
43
  "dateformat": "^5.0.2",
44
- "esbuild": "^0.14.13",
45
- "eslint": "^8.7.0",
44
+ "esbuild": "^0.14.19",
45
+ "eslint": "^8.8.0",
46
46
  "fs-extra": "^10.0.0",
47
47
  "glob": "^7.2.0",
48
48
  "inquirer": "^8.2.0",
@@ -50,7 +50,7 @@
50
50
  "minimist": "^1.2.5",
51
51
  "number-precision": "^1.5.1",
52
52
  "p-limit": "^4.0.0",
53
- "rollup": "^2.66.0",
53
+ "rollup": "^2.67.1",
54
54
  "rollup-plugin-esbuild": "^4.8.2",
55
55
  "rollup-plugin-html": "^0.2.1",
56
56
  "rollup-plugin-modify": "^3.0.0",
@@ -1,5 +1,5 @@
1
1
  import Parallax from '../mixin/parallax';
2
- import {clamp, css, parent, query, scrolledOver} from 'uikit-util';
2
+ import {css, parent, query, scrolledOver, toPx} from 'uikit-util';
3
3
 
4
4
  export default {
5
5
 
@@ -7,20 +7,35 @@ export default {
7
7
 
8
8
  props: {
9
9
  target: String,
10
- viewport: Number,
11
- easing: Number
10
+ viewport: Number, // Deprecated
11
+ easing: Number,
12
+ start: String,
13
+ end: String
12
14
  },
13
15
 
14
16
  data: {
15
17
  target: false,
16
18
  viewport: 1,
17
- easing: 1
19
+ easing: 1,
20
+ start: 0,
21
+ end: 0
18
22
  },
19
23
 
20
24
  computed: {
21
25
 
22
26
  target({target}, $el) {
23
27
  return getOffsetElement(target && query(target, $el) || $el);
28
+ },
29
+
30
+ start({start}) {
31
+ return parseCalc(start, this.target);
32
+ },
33
+
34
+ end({end, viewport}) {
35
+ return parseCalc(
36
+ end || (viewport = (1 - viewport) * 100) && `${viewport}vh+${viewport}%`,
37
+ this.target
38
+ );
24
39
  }
25
40
 
26
41
  },
@@ -38,11 +53,11 @@ export default {
38
53
  }
39
54
 
40
55
  const prev = percent;
41
- percent = ease(scrolledOver(this.target) / (this.viewport || 1), this.easing);
56
+ percent = ease(scrolledOver(this.target, this.start, this.end), this.easing);
42
57
 
43
58
  return {
44
59
  percent,
45
- style: prev !== percent ? this.getCss(percent) : false
60
+ style: prev === percent ? false : this.getCss(percent)
46
61
  };
47
62
  },
48
63
 
@@ -62,8 +77,23 @@ export default {
62
77
 
63
78
  };
64
79
 
80
+ const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
81
+ function parseCalc(calc, el) {
82
+ let match;
83
+ let result = 0;
84
+ calc = calc.toString().replace(/\s/g, '');
85
+ calcRe.lastIndex = 0;
86
+ while ((match = calcRe.exec(calc)) !== null) {
87
+ result += toPx(match[0], 'height', el, true);
88
+ }
89
+
90
+ return result;
91
+ }
92
+
65
93
  function ease(percent, easing) {
66
- return clamp(percent * (1 - (easing - easing * percent)));
94
+ return easing >= 0
95
+ ? Math.pow(percent, easing + 1)
96
+ : 1 - Math.pow(1 - percent, -easing + 1);
67
97
  }
68
98
 
69
99
  // SVG elements do not inherit from HTMLElement
@@ -72,5 +102,5 @@ function getOffsetElement(el) {
72
102
  ? 'offsetTop' in el
73
103
  ? el
74
104
  : getOffsetElement(parent(el))
75
- : document.body;
105
+ : document.documentElement;
76
106
  }
@@ -1,6 +1,6 @@
1
1
  import Margin from './margin';
2
2
  import Class from '../mixin/class';
3
- import {addClass, children, css, height as getHeight, hasClass, scrolledOver, sortBy, toFloat, toggleClass} from 'uikit-util';
3
+ import {addClass, children, css, hasClass, scrolledOver, sortBy, toFloat, toggleClass} from 'uikit-util';
4
4
 
5
5
  export default {
6
6
 
@@ -94,7 +94,7 @@ export default {
94
94
 
95
95
  return {
96
96
  scrolled: this.parallax
97
- ? scrolledOver(this.$el, height ? height - getHeight(this.$el) : 0) * Math.abs(this.parallax)
97
+ ? scrolledOver(this.$el) * Math.abs(this.parallax)
98
98
  : false
99
99
  };
100
100
  },
@@ -57,15 +57,17 @@ export default {
57
57
  disconnected() {
58
58
 
59
59
  this.svg.then(svg => {
60
- if (!this._connected) {
61
-
62
- if (isVoidElement(this.$el)) {
63
- this.$el.hidden = false;
64
- }
60
+ if (this._connected) {
61
+ return;
62
+ }
65
63
 
66
- remove(svg);
67
- this.svgEl = null;
64
+ if (isVoidElement(this.$el)) {
65
+ this.$el.hidden = false;
68
66
  }
67
+
68
+ remove(svg);
69
+ this.svgEl = null;
70
+
69
71
  });
70
72
 
71
73
  this.svg = null;