uikit 3.10.1 → 3.11.1-dev.fbcf9eec9

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 (65) hide show
  1. package/CHANGELOG.md +45 -17
  2. package/build/icons.js +4 -4
  3. package/build/scope.js +4 -6
  4. package/build/scss.js +4 -4
  5. package/dist/css/uikit-core-rtl.css +10 -1
  6. package/dist/css/uikit-core-rtl.min.css +1 -1
  7. package/dist/css/uikit-core.css +10 -1
  8. package/dist/css/uikit-core.min.css +1 -1
  9. package/dist/css/uikit-rtl.css +10 -1
  10. package/dist/css/uikit-rtl.min.css +1 -1
  11. package/dist/css/uikit.css +10 -1
  12. package/dist/css/uikit.min.css +1 -1
  13. package/dist/js/components/countdown.js +1 -1
  14. package/dist/js/components/countdown.min.js +1 -1
  15. package/dist/js/components/filter.js +1 -1
  16. package/dist/js/components/filter.min.js +1 -1
  17. package/dist/js/components/lightbox-panel.js +1 -1
  18. package/dist/js/components/lightbox-panel.min.js +1 -1
  19. package/dist/js/components/lightbox.js +1 -1
  20. package/dist/js/components/lightbox.min.js +1 -1
  21. package/dist/js/components/notification.js +1 -1
  22. package/dist/js/components/notification.min.js +1 -1
  23. package/dist/js/components/parallax.js +257 -264
  24. package/dist/js/components/parallax.min.js +1 -1
  25. package/dist/js/components/slider-parallax.js +215 -257
  26. package/dist/js/components/slider-parallax.min.js +1 -1
  27. package/dist/js/components/slider.js +1 -1
  28. package/dist/js/components/slider.min.js +1 -1
  29. package/dist/js/components/slideshow-parallax.js +215 -257
  30. package/dist/js/components/slideshow-parallax.min.js +1 -1
  31. package/dist/js/components/slideshow.js +1 -1
  32. package/dist/js/components/slideshow.min.js +1 -1
  33. package/dist/js/components/sortable.js +1 -1
  34. package/dist/js/components/sortable.min.js +1 -1
  35. package/dist/js/components/tooltip.js +1 -1
  36. package/dist/js/components/tooltip.min.js +1 -1
  37. package/dist/js/components/upload.js +1 -1
  38. package/dist/js/components/upload.min.js +1 -1
  39. package/dist/js/uikit-core.js +38 -37
  40. package/dist/js/uikit-core.min.js +1 -1
  41. package/dist/js/uikit-icons.js +1 -1
  42. package/dist/js/uikit-icons.min.js +1 -1
  43. package/dist/js/uikit.js +294 -300
  44. package/dist/js/uikit.min.js +1 -1
  45. package/package.json +5 -5
  46. package/src/js/api/hooks.js +6 -10
  47. package/src/js/components/parallax.js +38 -8
  48. package/src/js/core/grid.js +2 -2
  49. package/src/js/core/scrollspy.js +1 -1
  50. package/src/js/core/svg.js +9 -7
  51. package/src/js/mixin/parallax.js +209 -242
  52. package/src/js/util/dimensions.js +4 -2
  53. package/src/js/util/lang.js +4 -0
  54. package/src/js/util/viewport.js +9 -13
  55. package/src/less/components/position.less +2 -0
  56. package/src/less/components/sticky.less +6 -0
  57. package/src/scss/components/position.scss +2 -0
  58. package/src/scss/components/sticky.scss +6 -0
  59. package/tests/index.html +1 -1
  60. package/tests/js/index.js +1 -1
  61. package/tests/notification.html +5 -5
  62. package/tests/parallax.html +66 -50
  63. package/tests/sticky-parallax.html +274 -0
  64. package/tests/sticky.html +2 -2
  65. 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.1",
5
+ "version": "3.11.1-dev.fbcf9eec9",
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.11",
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.64.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",
@@ -123,23 +123,19 @@ export default function (UIkit) {
123
123
 
124
124
  function runWatches(initial) {
125
125
 
126
- const {$options: {computed}, _computeds} = this;
126
+ const {$options: {computed}} = this;
127
+ const values = assign({}, this._computeds);
128
+ this._computeds = {};
127
129
 
128
130
  for (const key in computed) {
129
-
130
- const hasPrev = hasOwn(_computeds, key);
131
- const prev = _computeds[key];
132
-
133
- delete _computeds[key];
134
-
135
131
  const {watch, immediate} = computed[key];
136
132
  if (watch && (
137
133
  initial && immediate
138
- || hasPrev && !isEqual(prev, this[key])
134
+ || hasOwn(values, key) && !isEqual(values[key], this[key])
139
135
  )) {
140
- watch.call(this, this[key], prev);
136
+ watch.call(this, this[key], values[key]);
141
137
  }
142
-
143
138
  }
139
+
144
140
  }
145
141
  }
@@ -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, '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
  },
@@ -16,7 +16,7 @@ export default {
16
16
  },
17
17
 
18
18
  data: () => ({
19
- cls: false,
19
+ cls: '',
20
20
  target: false,
21
21
  hidden: true,
22
22
  offsetTop: 0,
@@ -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;