uikit 3.13.8-dev.06ac04d2b → 3.13.8-dev.128538499

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 (46) hide show
  1. package/CHANGELOG.md +2 -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 +2 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +2 -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 +2 -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 +43 -21
  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 +43 -21
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/hooks.js +1 -1
  44. package/src/js/core/scrollspy.js +39 -17
  45. package/src/js/core/sticky.js +2 -2
  46. package/src/js/mixin/media.js +1 -0
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.8-dev.06ac04d2b",
5
+ "version": "3.13.8-dev.128538499",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -105,7 +105,7 @@ export default function (UIkit) {
105
105
  const {
106
106
  $options: { computed },
107
107
  } = this;
108
- const values = { ...this._computed };
108
+ const values = { ...(initial ? {} : this._computed) };
109
109
  this._computed = {};
110
110
 
111
111
  for (const key in computed) {
@@ -4,11 +4,12 @@ import {
4
4
  css,
5
5
  filter,
6
6
  data as getData,
7
- isInView,
7
+ observeIntersection,
8
8
  once,
9
9
  removeClass,
10
10
  removeClasses,
11
11
  toggleClass,
12
+ toPx,
12
13
  trigger,
13
14
  } from 'uikit-util';
14
15
 
@@ -45,16 +46,49 @@ export default {
45
46
  return target ? $$(target, $el) : [$el];
46
47
  },
47
48
 
48
- watch(elements) {
49
+ watch(elements, prev) {
49
50
  if (this.hidden) {
50
51
  css(filter(elements, `:not(.${this.inViewClass})`), 'visibility', 'hidden');
51
52
  }
53
+
54
+ if (prev) {
55
+ this.$reset();
56
+ }
52
57
  },
53
58
 
54
59
  immediate: true,
55
60
  },
56
61
  },
57
62
 
63
+ connected() {
64
+ this.registerObserver(
65
+ observeIntersection(
66
+ this.elements,
67
+ (records) => {
68
+ for (const { target: el, isIntersecting } of records) {
69
+ if (!el[stateKey]) {
70
+ el[stateKey] = { cls: getData(el, 'uk-scrollspy-class') || this.cls };
71
+ }
72
+
73
+ if (!this.repeat && el[stateKey].show) {
74
+ continue;
75
+ }
76
+
77
+ el[stateKey].show = isIntersecting;
78
+ }
79
+
80
+ this.$emit();
81
+ },
82
+ {
83
+ rootMargin: `${toPx(this.offsetTop, 'height') - 1}px ${
84
+ toPx(this.offsetLeft, 'width') - 1
85
+ }px`,
86
+ },
87
+ false
88
+ )
89
+ );
90
+ },
91
+
58
92
  disconnected() {
59
93
  for (const el of this.elements) {
60
94
  removeClass(el, this.inViewClass, el[stateKey]?.cls || '');
@@ -64,24 +98,14 @@ export default {
64
98
 
65
99
  update: [
66
100
  {
67
- read() {
101
+ write(data) {
68
102
  for (const el of this.elements) {
69
- if (!el[stateKey]) {
70
- el[stateKey] = { cls: getData(el, 'uk-scrollspy-class') || this.cls };
71
- }
103
+ const state = el[stateKey];
72
104
 
73
- if (!this.repeat && el[stateKey].show) {
105
+ if (!state) {
74
106
  continue;
75
107
  }
76
108
 
77
- el[stateKey].show = isInView(el, this.offsetTop, this.offsetLeft);
78
- }
79
- },
80
-
81
- write(data) {
82
- for (const el of this.elements) {
83
- const state = el[stateKey];
84
-
85
109
  if (state.show && !state.inview && !state.queued) {
86
110
  state.queued = true;
87
111
 
@@ -99,8 +123,6 @@ export default {
99
123
  }
100
124
  }
101
125
  },
102
-
103
- events: ['scroll', 'resize'],
104
126
  },
105
127
  ],
106
128
 
@@ -137,13 +137,13 @@ export default {
137
137
  return false;
138
138
  }
139
139
 
140
- const hide = this.isActive && types.has('resize');
140
+ const hide = this.active && types.has('resize');
141
141
  if (hide) {
142
142
  css(this.selTarget, 'transition', '0s');
143
143
  this.hide();
144
144
  }
145
145
 
146
- if (!this.isActive) {
146
+ if (!this.active) {
147
147
  height = getOffset(this.$el).height;
148
148
  margin = css(this.$el, 'margin');
149
149
  }
@@ -20,6 +20,7 @@ export default {
20
20
 
21
21
  connected() {
22
22
  const media = toMedia(this.media);
23
+ this.matchMedia = true;
23
24
  if (media) {
24
25
  this.mediaObj = window.matchMedia(media);
25
26
  const handler = () => {