uikit 3.13.8-dev.f030a8b39 → 3.13.9

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 (75) hide show
  1. package/CHANGELOG.md +13 -6
  2. package/dist/css/uikit-core-rtl.css +5 -34
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +5 -34
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +3 -34
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +3 -34
  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 +5 -2
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +5 -2
  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 +29 -59
  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 +219 -205
  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 +227 -243
  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/components/lightbox-panel.js +4 -1
  45. package/src/js/components/tooltip.js +3 -38
  46. package/src/js/core/accordion.js +1 -1
  47. package/src/js/core/drop.js +12 -9
  48. package/src/js/core/height-match.js +8 -17
  49. package/src/js/core/margin.js +1 -1
  50. package/src/js/core/navbar.js +1 -3
  51. package/src/js/core/scrollspy.js +45 -26
  52. package/src/js/core/sticky.js +2 -2
  53. package/src/js/core/toggle.js +1 -1
  54. package/src/js/mixin/position.js +24 -22
  55. package/src/js/util/position.js +129 -128
  56. package/src/less/components/dropdown.less +1 -11
  57. package/src/less/components/nav.less +0 -22
  58. package/src/less/components/navbar.less +2 -22
  59. package/src/less/theme/dropdown.less +0 -2
  60. package/src/less/theme/nav.less +0 -4
  61. package/src/less/theme/navbar.less +0 -2
  62. package/src/scss/components/dropdown.scss +1 -11
  63. package/src/scss/components/nav.scss +0 -22
  64. package/src/scss/components/navbar.scss +2 -22
  65. package/src/scss/mixins-theme.scss +0 -4
  66. package/src/scss/mixins.scss +0 -4
  67. package/src/scss/theme/dropdown.scss +0 -2
  68. package/src/scss/theme/nav.scss +0 -4
  69. package/src/scss/theme/navbar.scss +0 -2
  70. package/src/scss/variables-theme.scss +1 -5
  71. package/src/scss/variables.scss +1 -5
  72. package/tests/dropdown.html +2 -16
  73. package/tests/nav.html +0 -27
  74. package/tests/navbar.html +4 -18
  75. package/tests/position.html +39 -38
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.13.8-dev.f030a8b39 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.13.9 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1740,11 +1740,11 @@
1740
1740
  }
1741
1741
  }
1742
1742
 
1743
- const stateKey$1 = '_ukPlayer';
1743
+ const stateKey = '_ukPlayer';
1744
1744
  let counter = 0;
1745
1745
  function enableApi(el) {
1746
- if (el[stateKey$1]) {
1747
- return el[stateKey$1];
1746
+ if (el[stateKey]) {
1747
+ return el[stateKey];
1748
1748
  }
1749
1749
 
1750
1750
  const youtube = isYoutube(el);
@@ -1753,7 +1753,7 @@
1753
1753
  const id = ++counter;
1754
1754
  let poller;
1755
1755
 
1756
- return el[stateKey$1] = new Promise((resolve) => {
1756
+ return el[stateKey] = new Promise((resolve) => {
1757
1757
  youtube &&
1758
1758
  once(el, 'load', () => {
1759
1759
  const listener = () => post(el, { event: 'listening', id });
@@ -1933,156 +1933,157 @@
1933
1933
  return document.scrollingElement || document.documentElement;
1934
1934
  }
1935
1935
 
1936
- const dirs = [
1937
- ['width', 'x', 'left', 'right'],
1938
- ['height', 'y', 'top', 'bottom']];
1936
+ const dirs = {
1937
+ width: ['x', 'left', 'right'],
1938
+ height: ['y', 'top', 'bottom'] };
1939
1939
 
1940
1940
 
1941
- function positionAt(element, target, options) {
1942
- options = {
1943
- attach: {
1944
- element: ['left', 'top'],
1945
- target: ['left', 'top'],
1946
- ...options.attach },
1941
+ function positionAt(
1942
+ element,
1943
+ target,
1944
+ elAttach,
1945
+ targetAttach,
1946
+ elOffset,
1947
+ targetOffset,
1948
+ flip,
1949
+ boundary)
1950
+ {
1951
+ elAttach = getPos(elAttach);
1952
+ targetAttach = getPos(targetAttach);
1947
1953
 
1948
- offset: [0, 0],
1949
- ...options };
1954
+ const flipped = { element: elAttach, target: targetAttach };
1950
1955
 
1956
+ if (!element || !target) {
1957
+ return flipped;
1958
+ }
1951
1959
 
1952
- const dim = options.flip ?
1953
- attachToWithFlip(element, target, options) :
1954
- attachTo(element, target, options);
1960
+ const dim = offset(element);
1961
+ const targetDim = offset(target);
1962
+ const position = targetDim;
1955
1963
 
1956
- offset(element, dim);
1957
- }
1964
+ moveTo(position, elAttach, dim, -1);
1965
+ moveTo(position, targetAttach, targetDim, 1);
1958
1966
 
1959
- function attachTo(element, target, options) {
1960
- let { attach, offset: offsetBy } = {
1961
- attach: {
1962
- element: ['left', 'top'],
1963
- target: ['left', 'top'],
1964
- ...options.attach },
1967
+ elOffset = getOffsets(elOffset, dim.width, dim.height);
1968
+ targetOffset = getOffsets(targetOffset, targetDim.width, targetDim.height);
1965
1969
 
1966
- offset: [0, 0],
1967
- ...options };
1970
+ elOffset['x'] += targetOffset['x'];
1971
+ elOffset['y'] += targetOffset['y'];
1968
1972
 
1973
+ position.left += elOffset['x'];
1974
+ position.top += elOffset['y'];
1969
1975
 
1970
- const position = offset(element);
1971
- const targetOffset = offset(target);
1972
- for (const i in dirs) {
1973
- const [prop, dir, start, end] = dirs[i];
1974
- position[start] = position[dir] =
1975
- targetOffset[start] +
1976
- moveBy(attach.target[i], end, targetOffset[prop]) -
1977
- moveBy(attach.element[i], end, position[prop]) +
1978
- +offsetBy[i];
1979
- position[end] = position[start] + position[prop];
1980
- }
1981
- return position;
1982
- }
1976
+ if (flip) {
1977
+ let boundaries = scrollParents(element).map(getViewport$1);
1983
1978
 
1984
- function attachToWithFlip(element, target, options) {
1985
- const position = attachTo(element, target, options);
1986
- const targetDim = offset(target);
1987
- const viewports = scrollParents(element).map(getViewport$1);
1979
+ if (boundary && !includes(boundaries, boundary)) {
1980
+ boundaries.unshift(boundary);
1981
+ }
1988
1982
 
1989
- let {
1990
- flip,
1991
- attach: { element: elAttach, target: targetAttach },
1992
- offset: elOffset,
1993
- boundary,
1994
- viewport } =
1995
- options;
1983
+ boundaries = boundaries.map((el) => offset(el));
1996
1984
 
1997
- viewports.push(viewport);
1985
+ each(dirs, (_ref, prop) => {let [dir, align, alignFlip] = _ref;
1986
+ if (!(flip === true || includes(flip, dir))) {
1987
+ return;
1988
+ }
1998
1989
 
1999
- for (const i in dirs) {
2000
- const [prop, dir, start, end] = dirs[i];
1990
+ boundaries.some((boundary) => {
1991
+ const elemOffset =
1992
+ elAttach[dir] === align ?
1993
+ -dim[prop] :
1994
+ elAttach[dir] === alignFlip ?
1995
+ dim[prop] :
1996
+ 0;
2001
1997
 
2002
- if (flip !== true && !includes(flip, dir)) {
2003
- continue;
2004
- }
1998
+ const targetOffset =
1999
+ targetAttach[dir] === align ?
2000
+ targetDim[prop] :
2001
+ targetAttach[dir] === alignFlip ?
2002
+ -targetDim[prop] :
2003
+ 0;
2005
2004
 
2006
- const willFlip =
2007
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
2005
+ if (
2006
+ position[align] < boundary[align] ||
2007
+ position[align] + dim[prop] > boundary[alignFlip])
2008
+ {
2009
+ const centerOffset = dim[prop] / 2;
2010
+ const centerTargetOffset =
2011
+ targetAttach[dir] === 'center' ? -targetDim[prop] / 2 : 0;
2008
2012
 
2009
- viewport = getIntersectionArea(
2010
- ...viewports,
2011
- willFlip || position[prop] > offset(boundary)[prop] ? null : boundary);
2013
+ return (
2014
+ elAttach[dir] === 'center' && (
2015
+ apply(centerOffset, centerTargetOffset) ||
2016
+ apply(-centerOffset, -centerTargetOffset)) ||
2017
+ apply(elemOffset, targetOffset));
2012
2018
 
2013
- const isInStartBoundary = position[start] >= viewport[start];
2014
- const isInEndBoundary = position[end] <= viewport[end];
2019
+ }
2015
2020
 
2016
- if (isInStartBoundary && isInEndBoundary) {
2017
- continue;
2018
- }
2021
+ function apply(elemOffset, targetOffset) {
2022
+ const newVal = toFloat(
2023
+ (position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4));
2019
2024
 
2020
- let offsetBy;
2021
2025
 
2022
- // Flip
2023
- if (willFlip) {
2024
- if (
2025
- elAttach[i] === end && isInStartBoundary ||
2026
- elAttach[i] === start && isInEndBoundary)
2027
- {
2028
- continue;
2029
- }
2026
+ if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
2027
+ position[align] = newVal;
2030
2028
 
2031
- offsetBy =
2032
- (elAttach[i] === start ?
2033
- -position[prop] :
2034
- elAttach[i] === end ?
2035
- position[prop] :
2036
- 0) + (
2037
- targetAttach[i] === start ?
2038
- targetDim[prop] :
2039
- targetAttach[i] === end ?
2040
- -targetDim[prop] :
2041
- 0) -
2042
- elOffset[i] * 2;
2043
-
2044
- // Move
2045
- } else {
2046
- offsetBy =
2047
- clamp(
2048
- clamp(position[start], viewport[start], viewport[end] - position[prop]),
2049
- targetDim[start] - position[prop] + elOffset[i],
2050
- targetDim[end] - elOffset[i]) -
2051
- position[start];
2052
- }
2029
+ for (const el of ['element', 'target']) {
2030
+ if (elemOffset) {
2031
+ flipped[el][dir] =
2032
+ flipped[el][dir] === dirs[prop][1] ?
2033
+ dirs[prop][2] :
2034
+ dirs[prop][1];
2035
+ }
2036
+ }
2053
2037
 
2054
- position[start] = position[dir] = position[start] + offsetBy;
2055
- position[end] += offsetBy;
2038
+ return true;
2039
+ }
2040
+ }
2041
+ });
2042
+ });
2056
2043
  }
2057
2044
 
2058
- return position;
2059
- }
2045
+ offset(element, position);
2060
2046
 
2061
- function moveBy(start, end, dim) {
2062
- return start === 'center' ? dim / 2 : start === end ? dim : 0;
2047
+ return flipped;
2063
2048
  }
2064
2049
 
2065
- function getIntersectionArea() {
2066
- let intersection;for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) {elements[_key] = arguments[_key];}
2067
- for (const el of elements.filter(Boolean)) {
2068
- const rect = offset(el);
2069
- if (!intersection) {
2070
- intersection = rect;
2071
- continue;
2072
- }
2073
- for (const prop of ['left', 'top']) {
2074
- intersection[prop] = Math.max(rect[prop], intersection[prop]);
2075
- }
2076
- for (const prop of ['right', 'bottom']) {
2077
- intersection[prop] = Math.min(rect[prop], intersection[prop]);
2050
+ function moveTo(position, attach, dim, factor) {
2051
+ each(dirs, (_ref2, prop) => {let [dir, align, alignFlip] = _ref2;
2052
+ if (attach[dir] === alignFlip) {
2053
+ position[align] += dim[prop] * factor;
2054
+ } else if (attach[dir] === 'center') {
2055
+ position[align] += dim[prop] * factor / 2;
2078
2056
  }
2057
+ });
2058
+ }
2059
+
2060
+ function getPos(pos) {
2061
+ const x = /left|center|right/;
2062
+ const y = /top|center|bottom/;
2063
+
2064
+ pos = (pos || '').split(' ');
2065
+
2066
+ if (pos.length === 1) {
2067
+ pos = x.test(pos[0]) ?
2068
+ pos.concat('center') :
2069
+ y.test(pos[0]) ?
2070
+ ['center'].concat(pos) :
2071
+ ['center', 'center'];
2079
2072
  }
2080
- return intersection;
2073
+
2074
+ return {
2075
+ x: x.test(pos[0]) ? pos[0] : 'center',
2076
+ y: y.test(pos[1]) ? pos[1] : 'center' };
2077
+
2081
2078
  }
2082
2079
 
2083
- function intersectLine(dimA, dimB, dir) {
2084
- const [,, start, end] = dirs[dir];
2085
- return dimA[end] > dimB[start] && dimB[end] > dimA[start];
2080
+ function getOffsets(offsets, width, height) {
2081
+ const [x, y] = (offsets || '').split(' ');
2082
+
2083
+ return {
2084
+ x: x ? toFloat(x) * (endsWith(x, '%') ? width / 100 : 1) : 0,
2085
+ y: y ? toFloat(y) * (endsWith(y, '%') ? height / 100 : 1) : 0 };
2086
+
2086
2087
  }
2087
2088
 
2088
2089
  var util = /*#__PURE__*/Object.freeze({
@@ -2411,7 +2412,7 @@
2411
2412
  const {
2412
2413
  $options: { computed } } =
2413
2414
  this;
2414
- const values = { ...this._computed };
2415
+ const values = { ...(initial ? {} : this._computed) };
2415
2416
  this._computed = {};
2416
2417
 
2417
2418
  for (const key in computed) {
@@ -2891,7 +2892,7 @@
2891
2892
  UIkit.data = '__uikit__';
2892
2893
  UIkit.prefix = 'uk-';
2893
2894
  UIkit.options = {};
2894
- UIkit.version = '3.13.8-dev.f030a8b39';
2895
+ UIkit.version = '3.13.9';
2895
2896
 
2896
2897
  globalAPI(UIkit);
2897
2898
  hooksAPI(UIkit);
@@ -3218,7 +3219,7 @@
3218
3219
  computed: {
3219
3220
  items: {
3220
3221
  get(_ref, $el) {let { targets } = _ref;
3221
- return $$(targets, $el);
3222
+ return $$(targets, $el).filter((el) => $(this.content, el));
3222
3223
  },
3223
3224
 
3224
3225
  watch(items, prev) {
@@ -3505,42 +3506,45 @@
3505
3506
 
3506
3507
  connected() {
3507
3508
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3508
- this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3509
+ this.dir = this.pos[0];
3510
+ this.align = this.pos[1];
3509
3511
  },
3510
3512
 
3511
3513
  methods: {
3512
3514
  positionAt(element, target, boundary) {
3513
- const [dir, align] = this.pos;
3515
+ const axis = this.getAxis();
3516
+ const dir = this.pos[0];
3517
+ const align = this.pos[1];
3514
3518
 
3515
3519
  let { offset: offset$1 } = this;
3516
3520
  if (!isNumeric(offset$1)) {
3517
3521
  const node = $(offset$1);
3518
3522
  offset$1 = node ?
3519
- offset(node)[this.axis === 'x' ? 'left' : 'top'] -
3520
- offset(target)[this.axis === 'x' ? 'right' : 'bottom'] :
3523
+ offset(node)[axis === 'x' ? 'left' : 'top'] -
3524
+ offset(target)[axis === 'x' ? 'right' : 'bottom'] :
3521
3525
  0;
3522
3526
  }
3523
3527
  offset$1 = toPx(offset$1) + toPx(getCssVar('position-offset', element));
3524
- offset$1 = [includes(['left', 'top'], dir) ? -offset$1 : +offset$1, 0];
3525
-
3526
- const attach = {
3527
- element: [flipPosition(dir), align],
3528
- target: [dir, align] };
3529
-
3530
3528
 
3531
- if (this.axis === 'y') {
3532
- for (const prop in attach) {
3533
- attach[prop] = attach[prop].reverse();
3534
- }
3535
- offset$1 = offset$1.reverse();
3536
- }
3537
-
3538
- positionAt(element, target, {
3539
- attach,
3540
- offset: offset$1,
3541
- boundary,
3542
- flip: this.flip });
3529
+ const { x, y } = positionAt(
3530
+ element,
3531
+ target,
3532
+ axis === 'x' ? flipPosition(dir) + " " + align : align + " " + flipPosition(dir),
3533
+ axis === 'x' ? dir + " " + align : align + " " + dir,
3534
+ axis === 'x' ? "" + (
3535
+ dir === 'left' ? -offset$1 : offset$1) : " " + (
3536
+ dir === 'top' ? -offset$1 : offset$1),
3537
+ null,
3538
+ this.flip,
3539
+ boundary).
3540
+ target;
3541
+
3542
+ this.dir = axis === 'x' ? x : y;
3543
+ this.align = axis === 'x' ? y : x;
3544
+ },
3543
3545
 
3546
+ getAxis() {
3547
+ return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
3544
3548
  } } };
3545
3549
 
3546
3550
  let active$1;
@@ -3757,7 +3761,13 @@
3757
3761
  this.hide(false);
3758
3762
  }
3759
3763
  }),
3760
- on(window, 'resize', () => this.$emit('resize'))])
3764
+ on(window, 'resize', () => this.$emit()),
3765
+ on(
3766
+ document,
3767
+ 'scroll',
3768
+ (_ref4) => {let { target } = _ref4;return target.contains(this.$el) && this.$emit();},
3769
+ true)])
3770
+
3761
3771
  {
3762
3772
  once(this.$el, 'hide', handler, { self: true });
3763
3773
  }
@@ -3777,7 +3787,7 @@
3777
3787
  {
3778
3788
  name: 'hide',
3779
3789
 
3780
- handler(_ref4) {let { target } = _ref4;
3790
+ handler(_ref5) {let { target } = _ref5;
3781
3791
  if (this.$el !== target) {
3782
3792
  active$1 =
3783
3793
  active$1 === null && within(target, this.$el) && this.isToggled() ?
@@ -3797,9 +3807,7 @@
3797
3807
  if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
3798
3808
  this.position();
3799
3809
  }
3800
- },
3801
-
3802
- events: ['resize'] },
3810
+ } },
3803
3811
 
3804
3812
 
3805
3813
  methods: {
@@ -3877,18 +3885,17 @@
3877
3885
  const boundaryOffset = offset(boundary);
3878
3886
  const targetOffset = offset(this.target);
3879
3887
  const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3880
- const prop = this.axis === 'y' ? 'width' : 'height';
3881
-
3882
- css(this.$el, "max-" + prop, '');
3883
3888
 
3884
3889
  if (this.pos[1] === 'justify') {
3890
+ const prop = this.getAxis() === 'y' ? 'width' : 'height';
3885
3891
  css(this.$el, prop, alignTo[prop]);
3886
- } else if (this.$el.offsetWidth > boundaryOffset.width) {
3892
+ } else if (
3893
+ this.$el.offsetWidth >
3894
+ Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left))
3895
+ {
3887
3896
  addClass(this.$el, this.clsDrop + "-stack");
3888
3897
  }
3889
3898
 
3890
- css(this.$el, "max-" + prop, boundaryOffset[prop]);
3891
-
3892
3899
  this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
3893
3900
  } } };
3894
3901
 
@@ -3987,7 +3994,7 @@
3987
3994
 
3988
3995
 
3989
3996
  resizeTargets() {
3990
- return this.$el.children;
3997
+ return [this.$el, this.$el.children];
3991
3998
  },
3992
3999
 
3993
4000
  connected() {
@@ -4288,8 +4295,7 @@
4288
4295
 
4289
4296
  data: {
4290
4297
  target: '> *',
4291
- row: true,
4292
- forceHeight: true },
4298
+ row: true },
4293
4299
 
4294
4300
 
4295
4301
  computed: {
@@ -4305,7 +4311,7 @@
4305
4311
 
4306
4312
 
4307
4313
  resizeTargets() {
4308
- return this.elements;
4314
+ return [this.$el, this.elements];
4309
4315
  },
4310
4316
 
4311
4317
  update: {
@@ -4330,22 +4336,14 @@
4330
4336
  return { heights: [''], elements };
4331
4337
  }
4332
4338
 
4339
+ css(elements, 'minHeight', '');
4333
4340
  let heights = elements.map(getHeight);
4334
- let max = Math.max(...heights);
4335
- const hasMinHeight = elements.some((el) => el.style.minHeight);
4336
- const hasShrunk = elements.some((el, i) => !el.style.minHeight && heights[i] < max);
4337
-
4338
- if (hasMinHeight && hasShrunk) {
4339
- css(elements, 'minHeight', '');
4340
- heights = elements.map(getHeight);
4341
- max = Math.max(...heights);
4342
- }
4343
-
4344
- heights = elements.map((el, i) =>
4345
- heights[i] === max && toFloat(el.style.minHeight).toFixed(2) !== max.toFixed(2) ? '' : max);
4341
+ const max = Math.max(...heights);
4346
4342
 
4343
+ return {
4344
+ heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4345
+ elements };
4347
4346
 
4348
- return { heights, elements };
4349
4347
  }
4350
4348
 
4351
4349
  function getHeight(element) {
@@ -5512,8 +5510,6 @@
5512
5510
  dropbar: false,
5513
5511
  dropbarAnchor: false,
5514
5512
  duration: 200,
5515
- forceHeight: true,
5516
- selMinHeight: navItem,
5517
5513
  container: false },
5518
5514
 
5519
5515
 
@@ -5750,7 +5746,7 @@
5750
5746
  return this.dropbar;
5751
5747
  },
5752
5748
 
5753
- handler(_, _ref10) {let { $el, pos: [dir] = [] } = _ref10;
5749
+ handler(_, _ref10) {let { $el, dir } = _ref10;
5754
5750
  if (!hasClass($el, this.clsDrop)) {
5755
5751
  return;
5756
5752
  }
@@ -6295,7 +6291,6 @@
6295
6291
  return document.getElementById(decodeURIComponent(el.hash).substring(1));
6296
6292
  }
6297
6293
 
6298
- const stateKey = '_ukScrollspy';
6299
6294
  var scrollspy = {
6300
6295
  mixins: [Scroll],
6301
6296
 
@@ -6328,43 +6323,64 @@
6328
6323
  return target ? $$(target, $el) : [$el];
6329
6324
  },
6330
6325
 
6331
- watch(elements) {
6326
+ watch(elements, prev) {
6332
6327
  if (this.hidden) {
6333
6328
  css(filter(elements, ":not(." + this.inViewClass + ")"), 'visibility', 'hidden');
6334
6329
  }
6330
+
6331
+ if (prev) {
6332
+ this.$reset();
6333
+ }
6335
6334
  },
6336
6335
 
6337
6336
  immediate: true } },
6338
6337
 
6339
6338
 
6340
6339
 
6341
- disconnected() {
6342
- for (const el of this.elements) {var _el$stateKey;
6343
- removeClass(el, this.inViewClass, ((_el$stateKey = el[stateKey]) == null ? void 0 : _el$stateKey.cls) || '');
6344
- delete el[stateKey];
6345
- }
6346
- },
6340
+ connected() {
6341
+ this._data.elements = new Map();
6342
+ this.registerObserver(
6343
+ observeIntersection(
6344
+ this.elements,
6345
+ (records) => {
6346
+ const elements = this._data.elements;
6347
+ for (const { target: el, isIntersecting } of records) {
6348
+ if (!elements.has(el)) {
6349
+ elements.set(el, {
6350
+ cls: data(el, 'uk-scrollspy-class') || this.cls });
6347
6351
 
6348
- update: [
6349
- {
6350
- read() {
6351
- for (const el of this.elements) {
6352
- if (!el[stateKey]) {
6353
- el[stateKey] = { cls: data(el, 'uk-scrollspy-class') || this.cls };
6354
6352
  }
6355
6353
 
6356
- if (!this.repeat && el[stateKey].show) {
6354
+ const state = elements.get(el);
6355
+ if (!this.repeat && state.show) {
6357
6356
  continue;
6358
6357
  }
6359
6358
 
6360
- el[stateKey].show = isInView(el, this.offsetTop, this.offsetLeft);
6359
+ state.show = isIntersecting;
6361
6360
  }
6361
+
6362
+ this.$emit();
6362
6363
  },
6364
+ {
6365
+ rootMargin: toPx(this.offsetTop, 'height') - 1 + "px " + (
6366
+ toPx(this.offsetLeft, 'width') - 1) + "px" },
6367
+
6368
+
6369
+ false));
6363
6370
 
6364
- write(data) {
6365
- for (const el of this.elements) {
6366
- const state = el[stateKey];
6367
6371
 
6372
+ },
6373
+
6374
+ disconnected() {
6375
+ for (const [el, state] of this._data.elements.entries()) {
6376
+ removeClass(el, this.inViewClass, (state == null ? void 0 : state.cls) || '');
6377
+ }
6378
+ },
6379
+
6380
+ update: [
6381
+ {
6382
+ write(data) {
6383
+ for (const [el, state] of data.elements.entries()) {
6368
6384
  if (state.show && !state.inview && !state.queued) {
6369
6385
  state.queued = true;
6370
6386
 
@@ -6381,15 +6397,13 @@
6381
6397
  this.toggle(el, false);
6382
6398
  }
6383
6399
  }
6384
- },
6385
-
6386
- events: ['scroll', 'resize'] }],
6400
+ } }],
6387
6401
 
6388
6402
 
6389
6403
 
6390
6404
  methods: {
6391
6405
  toggle(el, inview) {
6392
- const state = el[stateKey];
6406
+ const state = this._data.elements.get(el);
6393
6407
 
6394
6408
  state.off == null ? void 0 : state.off();
6395
6409
 
@@ -6612,13 +6626,13 @@
6612
6626
  return false;
6613
6627
  }
6614
6628
 
6615
- const hide = this.isActive && types.has('resize');
6629
+ const hide = this.active && types.has('resize');
6616
6630
  if (hide) {
6617
6631
  css(this.selTarget, 'transition', '0s');
6618
6632
  this.hide();
6619
6633
  }
6620
6634
 
6621
- if (!this.isActive) {
6635
+ if (!this.active) {
6622
6636
  height$1 = offset(this.$el).height;
6623
6637
  margin = css(this.$el, 'margin');
6624
6638
  }
@@ -7140,7 +7154,7 @@
7140
7154
  }
7141
7155
 
7142
7156
  // Skip if state does not change e.g. hover + focus received
7143
- if (this._showState && show === (expanded !== this._showState)) {
7157
+ if (this._showState && show && expanded !== this._showState) {
7144
7158
  // Ensure reset if state has changed through click
7145
7159
  if (!show) {
7146
7160
  this._showState = null;