uikit 3.21.5-dev.7a232f5a3 → 3.21.5-dev.e2ff6bd90

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 (51) hide show
  1. package/CHANGELOG.md +8 -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 +2 -2
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +18 -10
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +18 -10
  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 +21 -13
  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 +18 -10
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +2 -2
  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 +17 -18
  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 +38 -31
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/slider.js +3 -3
  44. package/src/js/core/cover.js +1 -4
  45. package/src/js/core/dropnav.js +3 -2
  46. package/src/js/core/height-viewport.js +2 -3
  47. package/src/js/core/scrollspy-nav.js +4 -1
  48. package/src/js/core/sticky.js +4 -3
  49. package/src/js/mixin/internal/animate-slide.js +2 -2
  50. package/src/js/mixin/slider-nav.js +23 -11
  51. package/src/js/util/viewport.js +9 -5
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.21.5-dev.7a232f5a3",
5
+ "version": "3.21.5-dev.e2ff6bd90",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -94,14 +94,14 @@ export default {
94
94
  left < width / 2 &&
95
95
  left +
96
96
  slideWidth +
97
- dimensions(this.slides[getIndex(+i + 1, this.slides)]).width / 2 >
97
+ dimensions(this.slides[getIndex(i + 1, this.slides)]).width / 2 >
98
98
  width / 2
99
99
  ) {
100
- sets.push(+i);
100
+ sets.push(i);
101
101
  left = width / 2 - slideWidth / 2;
102
102
  }
103
103
  } else if (left === 0) {
104
- sets.push(Math.min(+i, this.maxIndex));
104
+ sets.push(Math.min(i, this.maxIndex));
105
105
  }
106
106
 
107
107
  left += slideWidth;
@@ -51,10 +51,7 @@ export default {
51
51
 
52
52
  const { offsetHeight: coverHeight, offsetWidth: coverWidth } =
53
53
  getPositionedParent($el) || parent($el);
54
- const coverDim = cover(dim, {
55
- width: coverWidth + (coverWidth % 2 ? 1 : 0),
56
- height: coverHeight + (coverHeight % 2 ? 1 : 0),
57
- });
54
+ const coverDim = cover(dim, { width: coverWidth, height: coverHeight });
58
55
 
59
56
  if (!coverDim.width || !coverDim.height) {
60
57
  return false;
@@ -9,6 +9,7 @@ import {
9
9
  hasClass,
10
10
  height,
11
11
  includes,
12
+ isInput,
12
13
  isRtl,
13
14
  matches,
14
15
  noop,
@@ -172,9 +173,9 @@ export default {
172
173
  delegate: ({ clsDrop }) => `.${clsDrop}`,
173
174
 
174
175
  handler(e) {
175
- const { current, keyCode } = e;
176
+ const { current, keyCode, target } = e;
176
177
 
177
- if (!includes(this.dropdowns, current)) {
178
+ if (isInput(target) || !includes(this.dropdowns, current)) {
178
179
  return;
179
180
  }
180
181
 
@@ -6,7 +6,7 @@ import {
6
6
  isNumeric,
7
7
  isString,
8
8
  isVisible,
9
- offsetPosition,
9
+ offset,
10
10
  offsetViewport,
11
11
  query,
12
12
  scrollParent,
@@ -64,8 +64,7 @@ export default {
64
64
  if (isScrollingElement) {
65
65
  const offsetTopEl =
66
66
  this.offsetTop === true ? this.$el : query(this.offsetTop, this.$el);
67
- const top =
68
- offsetPosition(offsetTopEl)[0] - offsetPosition(scrollElement)[0];
67
+ const { top } = offset(offsetTopEl);
69
68
  minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : '';
70
69
  } else {
71
70
  minHeight += ` - ${boxModelAdjust(scrollElement, 'height', css(scrollElement, 'boxSizing'))}px`;
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  $$,
3
+ dimensions,
3
4
  getCoveringElement,
4
5
  getTargetedElement,
5
6
  hasClass,
@@ -69,7 +70,9 @@ export default {
69
70
  active = length - 1;
70
71
  } else {
71
72
  const offsetBy =
72
- this.offset + offset(getCoveringElement()).height + viewport.height * 0.1;
73
+ this.offset +
74
+ dimensions(getCoveringElement()).height +
75
+ viewport.height * 0.1;
73
76
 
74
77
  for (let i = 0; i < targets.length; i++) {
75
78
  if (offset(targets[i]).top - viewport.top - offsetBy > 0) {
@@ -6,6 +6,7 @@ import {
6
6
  before,
7
7
  clamp,
8
8
  css,
9
+ dimensions,
9
10
  height as getHeight,
10
11
  offset as getOffset,
11
12
  hasClass,
@@ -146,7 +147,7 @@ export default {
146
147
  update: [
147
148
  {
148
149
  read({ height, width, margin, sticky }, types) {
149
- this.inactive = !this.matchMedia || !isVisible(this.$el);
150
+ this.inactive = !this.matchMedia || !isVisible(this.$el) || !this.$el.offsetHeight;
150
151
 
151
152
  if (this.inactive) {
152
153
  return;
@@ -159,7 +160,7 @@ export default {
159
160
  }
160
161
 
161
162
  if (!this.active) {
162
- ({ height, width } = getOffset(this.$el));
163
+ ({ height, width } = dimensions(this.$el));
163
164
  margin = css(this.$el, 'margin');
164
165
  }
165
166
 
@@ -187,7 +188,7 @@ export default {
187
188
 
188
189
  const overflow = this.overflowFlip ? 0 : Math.max(0, height + offset - viewport);
189
190
  const topOffset = getOffset(referenceElement).top;
190
- const elHeight = getOffset(this.$el).height;
191
+ const elHeight = dimensions(this.$el).height;
191
192
 
192
193
  const start =
193
194
  (this.start === false
@@ -2,10 +2,10 @@ import {
2
2
  attr,
3
3
  children,
4
4
  css,
5
+ dimensions,
5
6
  includes,
6
7
  index,
7
8
  isVisible,
8
- offset,
9
9
  parent,
10
10
  position,
11
11
  Transition,
@@ -134,7 +134,7 @@ function resetProps(el, props) {
134
134
  }
135
135
 
136
136
  function getPositionWithMargin(el) {
137
- const { height, width } = offset(el);
137
+ const { height, width } = dimensions(el);
138
138
 
139
139
  return {
140
140
  height,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  $,
3
3
  $$,
4
- append,
5
4
  attr,
6
5
  children,
7
6
  data,
8
- empty,
7
+ html,
8
+ isEqual,
9
9
  isNumeric,
10
10
  isTag,
11
11
  matches,
@@ -48,6 +48,7 @@ export default {
48
48
  watch: {
49
49
  nav(nav, prev) {
50
50
  attr(nav, 'role', 'tablist');
51
+ this.padNavitems();
51
52
 
52
53
  if (prev) {
53
54
  this.$emit();
@@ -62,6 +63,8 @@ export default {
62
63
 
63
64
  navChildren(children) {
64
65
  attr(children, 'role', 'presentation');
66
+ this.padNavitems();
67
+ this.updateNav();
65
68
  },
66
69
 
67
70
  navItems(items) {
@@ -112,16 +115,8 @@ export default {
112
115
  'aria-roledescription': this.nav ? null : 'slide',
113
116
  }),
114
117
  );
115
- },
116
118
 
117
- length(length) {
118
- const navLength = this.navChildren.length;
119
- if (this.nav && length !== navLength) {
120
- empty(this.nav);
121
- for (let i = 0; i < length; i++) {
122
- append(this.nav, `<li ${this.attrItem}="${i}"><a href></a></li>`);
123
- }
124
- }
119
+ this.padNavitems();
125
120
  },
126
121
  },
127
122
 
@@ -235,5 +230,22 @@ export default {
235
230
  }
236
231
  }
237
232
  },
233
+
234
+ padNavitems() {
235
+ if (!this.nav) {
236
+ return;
237
+ }
238
+
239
+ const children = [];
240
+ for (let i = 0; i < this.length; i++) {
241
+ const attr = `${this.attrItem}="${i}"`;
242
+ children[i] =
243
+ this.navChildren.findLast((el) => el.matches(`[${attr}]`)) ||
244
+ $(`<li ${attr}><a href></a></li>`);
245
+ }
246
+ if (!isEqual(children, this.navChildren)) {
247
+ html(this.nav, children);
248
+ }
249
+ },
238
250
  },
239
251
  };
@@ -84,9 +84,8 @@ export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
84
84
  diff =
85
85
  offset(targetEl).top +
86
86
  (isScrollingElement ? 0 : element.scrollTop) -
87
- targetTop;
88
- const coverEl = getCoveringElement(targetEl);
89
- diff -= coverEl ? offset(coverEl).height : 0;
87
+ targetTop -
88
+ dimensions(getCoveringElement(targetEl)).height;
90
89
  }
91
90
 
92
91
  element.scrollTop = scroll + (top + diff) * percent;
@@ -200,6 +199,7 @@ export function offsetViewport(scrollElement) {
200
199
  export function getCoveringElement(target) {
201
200
  const { left, width, top } = dimensions(target);
202
201
  for (const position of top ? [0, top] : [0]) {
202
+ let coverEl;
203
203
  for (const el of toWindow(target).document.elementsFromPoint(left + width / 2, position)) {
204
204
  if (
205
205
  !el.contains(target) &&
@@ -213,11 +213,15 @@ export function getCoveringElement(target) {
213
213
  (parent) => !parent.contains(el) && !hasPosition(parent, 'static'),
214
214
  ),
215
215
  ) < zIndex(el)) ||
216
- (hasPosition(el, 'sticky') && parent(el).contains(target)))
216
+ (hasPosition(el, 'sticky') && parent(el).contains(target))) &&
217
+ (!coverEl || dimensions(coverEl).height < dimensions(el).height)
217
218
  ) {
218
- return el;
219
+ coverEl = el;
219
220
  }
220
221
  }
222
+ if (coverEl) {
223
+ return coverEl;
224
+ }
221
225
  }
222
226
  }
223
227