uikit 3.21.5-dev.ed4adca92 → 3.21.6-dev.4d6c5e2f9

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 (53) hide show
  1. package/CHANGELOG.md +10 -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 +7 -2
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +7 -2
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +7 -2
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +7 -2
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +7 -2
  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 +30 -17
  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 +30 -17
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/core/drop.js +5 -1
  44. package/src/js/core/dropnav.js +3 -2
  45. package/src/js/core/height-viewport.js +2 -3
  46. package/src/js/core/icon.js +1 -1
  47. package/src/js/core/scrollspy-nav.js +1 -1
  48. package/src/js/core/sticky.js +14 -5
  49. package/src/js/mixin/position.js +1 -1
  50. package/src/js/util/dom.js +1 -2
  51. package/src/js/util/player.js +2 -2
  52. package/src/js/util/svg.js +3 -1
  53. package/tests/js/index.js +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.21.5-dev.ed4adca92",
5
+ "version": "3.21.6-dev.4d6c5e2f9",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -29,7 +29,7 @@ import {
29
29
  removeClass,
30
30
  } from 'uikit-util';
31
31
  import Container from '../mixin/container';
32
- import Position from '../mixin/position';
32
+ import Position, { storeScrollPosition } from '../mixin/position';
33
33
  import Togglable from '../mixin/togglable';
34
34
  import { keyMap } from '../util/keys';
35
35
  import { preventBackgroundScroll } from '../util/scroll';
@@ -375,6 +375,8 @@ export default {
375
375
  },
376
376
 
377
377
  position() {
378
+ const restoreScrollPosition = storeScrollPosition(this.$el);
379
+
378
380
  removeClass(this.$el, 'uk-drop-stack');
379
381
  css(this.$el, this._style);
380
382
 
@@ -439,6 +441,8 @@ export default {
439
441
  this.positionAt(this.$el, this.target, this.boundary);
440
442
  }
441
443
  }
444
+
445
+ restoreScrollPosition();
442
446
  },
443
447
  },
444
448
  };
@@ -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`;
@@ -25,8 +25,8 @@ import overlayIcon from '../../images/components/overlay-icon.svg';
25
25
  import paginationNext from '../../images/components/pagination-next.svg';
26
26
  import paginationPrevious from '../../images/components/pagination-previous.svg';
27
27
  import searchIcon from '../../images/components/search-icon.svg';
28
- import searchMedium from '../../images/components/search-medium.svg';
29
28
  import searchLarge from '../../images/components/search-large.svg';
29
+ import searchMedium from '../../images/components/search-medium.svg';
30
30
  import slidenavNextLarge from '../../images/components/slidenav-next-large.svg';
31
31
  import slidenavNext from '../../images/components/slidenav-next.svg';
32
32
  import slidenavPreviousLarge from '../../images/components/slidenav-previous-large.svg';
@@ -27,7 +27,7 @@ export default {
27
27
  cls: 'uk-active',
28
28
  closest: false,
29
29
  scroll: false,
30
- target: 'a[href]',
30
+ target: 'a[href]:not([role="button"])',
31
31
  offset: 0,
32
32
  },
33
33
 
@@ -100,10 +100,11 @@ export default {
100
100
  viewport(),
101
101
  scroll({ target: () => document.scrollingElement }),
102
102
  resize({
103
- target: ({ $el }) => [$el, parent($el), document.scrollingElement],
103
+ target: ({ $el }) => [$el, getVisibleParent($el), document.scrollingElement],
104
104
  handler(entries) {
105
105
  this.$emit(
106
- this._data.resized && entries.some(({ target }) => target === parent(this.$el))
106
+ this._data.resized &&
107
+ entries.some(({ target }) => target === getVisibleParent(this.$el))
107
108
  ? 'update'
108
109
  : 'resize',
109
110
  );
@@ -147,7 +148,7 @@ export default {
147
148
  update: [
148
149
  {
149
150
  read({ height, width, margin, sticky }, types) {
150
- this.inactive = !this.matchMedia || !isVisible(this.$el);
151
+ this.inactive = !this.matchMedia || !isVisible(this.$el) || !this.$el.offsetHeight;
151
152
 
152
153
  if (this.inactive) {
153
154
  return;
@@ -214,7 +215,7 @@ export default {
214
215
  maxScrollHeight,
215
216
  parseProp(true, this.$el, 0, true) - elHeight - offset + overflow,
216
217
  ) &&
217
- css(parent(this.$el), 'overflowY') === 'visible';
218
+ css(getVisibleParent(this.$el), 'overflowY') === 'visible';
218
219
 
219
220
  return {
220
221
  start,
@@ -456,7 +457,7 @@ function parseProp(value, el, propOffset, padding) {
456
457
  if (isNumeric(value) || (isString(value) && value.match(/^-?\d/))) {
457
458
  return propOffset + toPx(value, 'height', el, true);
458
459
  } else {
459
- const refElement = value === true ? parent(el) : query(value, el);
460
+ const refElement = value === true ? getVisibleParent(el) : query(value, el);
460
461
  return (
461
462
  getOffset(refElement).bottom -
462
463
  (padding && refElement?.contains(el) ? toFloat(css(refElement, 'paddingBottom')) : 0)
@@ -484,3 +485,11 @@ function preventTransition(element) {
484
485
  requestAnimationFrame(() => removeClass(element, clsTransitionDisable));
485
486
  }
486
487
  }
488
+
489
+ function getVisibleParent(element) {
490
+ while ((element = parent(element))) {
491
+ if (isVisible(element)) {
492
+ return element;
493
+ }
494
+ }
495
+ }
@@ -95,7 +95,7 @@ export default {
95
95
  },
96
96
  };
97
97
 
98
- function storeScrollPosition(element) {
98
+ export function storeScrollPosition(element) {
99
99
  const scrollElement = scrollParent(element);
100
100
  const { scrollTop } = scrollElement;
101
101
 
@@ -98,9 +98,8 @@ export function apply(node, fn) {
98
98
  fn(node);
99
99
  node = node.firstElementChild;
100
100
  while (node) {
101
- const next = node.nextElementSibling;
102
101
  apply(node, fn);
103
- node = next;
102
+ node = node.nextElementSibling;
104
103
  }
105
104
  }
106
105
 
@@ -1,6 +1,6 @@
1
1
  import { isTag } from './dom';
2
2
  import { once } from './event';
3
- import { includes } from './lang';
3
+ import { includes, noop } from './lang';
4
4
 
5
5
  export function play(el) {
6
6
  if (isIFrame(el)) {
@@ -8,7 +8,7 @@ export function play(el) {
8
8
  }
9
9
 
10
10
  if (isHTML5(el)) {
11
- el.play();
11
+ el.play().catch(noop);
12
12
  }
13
13
  }
14
14
 
@@ -3,6 +3,8 @@ import { isVisible } from './filter.js';
3
3
 
4
4
  export function getMaxPathLength(el) {
5
5
  return isVisible(el)
6
- ? Math.ceil(Math.max(0, ...$$('[stroke]', el).map((stroke) => stroke.getTotalLength())))
6
+ ? Math.ceil(
7
+ Math.max(0, ...$$('[stroke]', el).map((stroke) => stroke.getTotalLength?.() || 0)),
8
+ )
7
9
  : 0;
8
10
  }
package/tests/js/index.js CHANGED
@@ -38,7 +38,7 @@ storage[keyinverse] = storage[keyinverse] || '';
38
38
  const dir = storage._uikit_dir || 'ltr';
39
39
 
40
40
  // set dir
41
- document.documentElement.dir = dir;
41
+ document.dir = dir;
42
42
 
43
43
  const style = styles[storage[key]] || styles.theme;
44
44