uikit 3.17.4 → 3.17.5-dev.2224f20af

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 (48) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/css/uikit-core-rtl.css +1 -2
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -2
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -2
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -2
  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 +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 +1 -1
  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 +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 +17 -16
  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 +17 -16
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/core/scrollspy-nav.js +2 -8
  44. package/src/js/util/viewport.js +21 -11
  45. package/src/less/components/cover.less +0 -1
  46. package/src/scss/components/cover.scss +0 -1
  47. package/tests/cover.html +1 -1
  48. package/tests/slideshow.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.17.4",
5
+ "version": "3.17.5-dev.2224f20af",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  $$,
3
3
  closest,
4
- css,
4
+ getCoveringElement,
5
5
  getTargetedElement,
6
6
  hasClass,
7
7
  isSameSiteAnchor,
@@ -70,7 +70,7 @@ export default {
70
70
  active = length - 1;
71
71
  } else {
72
72
  for (let i = 0; i < targets.length; i++) {
73
- const fixedEl = findFixedElement(targets[i]);
73
+ const fixedEl = getCoveringElement(targets[i]);
74
74
  const offsetBy = this.offset + (fixedEl ? offset(fixedEl).height : 0);
75
75
  if (offset(targets[i]).top - viewport.top - offsetBy > 0) {
76
76
  break;
@@ -103,9 +103,3 @@ export default {
103
103
  },
104
104
  ],
105
105
  };
106
-
107
- function findFixedElement(target) {
108
- return target.ownerDocument
109
- .elementsFromPoint(offset(target).left, 1)
110
- .find((el) => ['fixed', 'sticky'].includes(css(el, 'position')) && !el.contains(target));
111
- }
@@ -1,5 +1,5 @@
1
1
  import { offset, offsetPosition } from './dimensions';
2
- import { isVisible, parents } from './filter';
2
+ import { isVisible, parent, parents, within } from './filter';
3
3
  import {
4
4
  clamp,
5
5
  findIndex,
@@ -79,8 +79,8 @@ export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
79
79
  let diff = 0;
80
80
  if (parents[0] === element && scroll + top < maxScroll) {
81
81
  diff = offset(targetEl).top - targetTop;
82
- const fixedEl = findFixedElement(targetEl);
83
- diff -= fixedEl ? offset(fixedEl).height : 0;
82
+ const coverEl = getCoveringElement(targetEl);
83
+ diff -= coverEl ? offset(coverEl).height : 0;
84
84
  }
85
85
 
86
86
  element.scrollTop = Math[top + diff > 0 ? 'max' : 'min'](
@@ -107,14 +107,6 @@ export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
107
107
  function ease(k) {
108
108
  return 0.5 * (1 - Math.cos(Math.PI * k));
109
109
  }
110
-
111
- function findFixedElement(target) {
112
- return target.ownerDocument
113
- .elementsFromPoint(offset(target).left, 0)
114
- .find(
115
- (el) => ['fixed', 'sticky'].includes(css(el, 'position')) && !el.contains(target),
116
- );
117
- }
118
110
  }
119
111
 
120
112
  export function scrolledOver(element, startOffset = 0, endOffset = 0) {
@@ -206,6 +198,24 @@ export function offsetViewport(scrollElement) {
206
198
  return rect;
207
199
  }
208
200
 
201
+ export function getCoveringElement(target) {
202
+ return target.ownerDocument
203
+ .elementsFromPoint(offset(target).left, 0)
204
+ .find(
205
+ (el) =>
206
+ !el.contains(target) &&
207
+ ((css(el, 'position') === 'fixed' && !hasHigherZIndex(target, el)) ||
208
+ (css(el, 'position') === 'sticky' && within(target, el.parentElement))),
209
+ );
210
+ }
211
+
212
+ function hasHigherZIndex(element1, element2) {
213
+ return (
214
+ parent(element1) === parent(element2) &&
215
+ toFloat(css(element1, 'zIndex')) > toFloat(css(element2, 'zIndex'))
216
+ );
217
+ }
218
+
209
219
  function scrollingElement(element) {
210
220
  return toWindow(element).document.scrollingElement;
211
221
  }
@@ -41,7 +41,6 @@ video[data-uk-cover] {
41
41
  /* 1 */
42
42
  :not(img,video)[uk-cover],
43
43
  :not(img,video)[data-uk-cover] {
44
- pointer-events: none;
45
44
  /* 2 */
46
45
  max-width: none;
47
46
  /* 3 */
@@ -41,7 +41,6 @@ video[data-uk-cover] {
41
41
  /* 1 */
42
42
  :not(img,video)[uk-cover],
43
43
  :not(img,video)[data-uk-cover] {
44
- pointer-events: none;
45
44
  /* 2 */
46
45
  max-width: none;
47
46
  /* 3 */
package/tests/cover.html CHANGED
@@ -63,7 +63,7 @@
63
63
  <h3>Iframe (Vimeo)</h3>
64
64
 
65
65
  <div class="test-height uk-cover-container uk-light">
66
- <iframe src="https://player.vimeo.com/video/1084537?title=0&amp;byline=0&amp;autoplay=1&amp;loop=1&amp;setVolume=0" width="500" height="281" allowfullscreen uk-cover></iframe>
66
+ <iframe src="https://player.vimeo.com/video/1084537?title=0&amp;background=1&amp;keyboard=0" width="500" height="281" allowfullscreen uk-cover></iframe>
67
67
  <div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
68
68
  <h1>Heading</h1>
69
69
  </div>
@@ -112,7 +112,7 @@
112
112
  </div>
113
113
  </li>
114
114
  <li>
115
- <iframe src="https://player.vimeo.com/video/1084537?title=0&amp;byline=0&amp;autoplay=1&amp;loop=1&amp;setVolume=0" width="500" height="281" allowfullscreen uk-cover></iframe>
115
+ <iframe src="https://player.vimeo.com/video/1084537?title=0&amp;background=1&amp;keyboard=0" width="500" height="281" allowfullscreen uk-cover></iframe>
116
116
  <div class="uk-position-center uk-position-small uk-text-center">
117
117
  <h2 uk-slideshow-parallax="x: 100,-100">Vimeo</h2>
118
118
  <p uk-slideshow-parallax="x: 200,-200">Lorem ipsum dolor sit amet.</p>