uikit 3.13.7-dev.120e5ee9c → 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 (74) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/css/uikit-core-rtl.css +34 -5
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +34 -5
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +34 -3
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +34 -3
  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 +13 -10
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +13 -10
  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 +13 -10
  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 +59 -29
  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 +211 -195
  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 +248 -199
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +5 -5
  43. package/src/js/api/hooks.js +1 -1
  44. package/src/js/components/tooltip.js +38 -3
  45. package/src/js/core/accordion.js +1 -1
  46. package/src/js/core/drop.js +10 -6
  47. package/src/js/core/height-match.js +7 -15
  48. package/src/js/core/navbar.js +1 -1
  49. package/src/js/core/scrollspy.js +39 -17
  50. package/src/js/core/sticky.js +2 -2
  51. package/src/js/mixin/media.js +12 -9
  52. package/src/js/mixin/position.js +22 -24
  53. package/src/js/util/position.js +128 -129
  54. package/src/less/components/dropdown.less +11 -1
  55. package/src/less/components/nav.less +22 -0
  56. package/src/less/components/navbar.less +22 -2
  57. package/src/less/theme/dropdown.less +2 -0
  58. package/src/less/theme/nav.less +4 -0
  59. package/src/less/theme/navbar.less +2 -0
  60. package/src/scss/components/dropdown.scss +11 -1
  61. package/src/scss/components/nav.scss +22 -0
  62. package/src/scss/components/navbar.scss +22 -2
  63. package/src/scss/mixins-theme.scss +4 -0
  64. package/src/scss/mixins.scss +4 -0
  65. package/src/scss/theme/dropdown.scss +2 -0
  66. package/src/scss/theme/nav.scss +4 -0
  67. package/src/scss/theme/navbar.scss +2 -0
  68. package/src/scss/variables-theme.scss +5 -1
  69. package/src/scss/variables.scss +5 -1
  70. package/tests/drop.html +0 -6
  71. package/tests/dropdown.html +18 -10
  72. package/tests/nav.html +27 -0
  73. package/tests/navbar.html +18 -4
  74. package/tests/position.html +38 -39
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.13.7-dev.120e5ee9c | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.13.8-dev.128538499 | 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() :
@@ -1933,157 +1933,156 @@
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(
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);
1941
+ function positionAt(element, target, options) {
1942
+ options = {
1943
+ attach: {
1944
+ element: ['left', 'top'],
1945
+ target: ['left', 'top'],
1946
+ ...options.attach },
1953
1947
 
1954
- const flipped = { element: elAttach, target: targetAttach };
1948
+ offset: [0, 0],
1949
+ ...options };
1955
1950
 
1956
- if (!element || !target) {
1957
- return flipped;
1958
- }
1959
1951
 
1960
- const dim = offset(element);
1961
- const targetDim = offset(target);
1962
- const position = targetDim;
1952
+ const dim = options.flip ?
1953
+ attachToWithFlip(element, target, options) :
1954
+ attachTo(element, target, options);
1963
1955
 
1964
- moveTo(position, elAttach, dim, -1);
1965
- moveTo(position, targetAttach, targetDim, 1);
1956
+ offset(element, dim);
1957
+ }
1966
1958
 
1967
- elOffset = getOffsets(elOffset, dim.width, dim.height);
1968
- targetOffset = getOffsets(targetOffset, targetDim.width, targetDim.height);
1959
+ function attachTo(element, target, options) {
1960
+ let { attach, offset: offsetBy } = {
1961
+ attach: {
1962
+ element: ['left', 'top'],
1963
+ target: ['left', 'top'],
1964
+ ...options.attach },
1969
1965
 
1970
- elOffset['x'] += targetOffset['x'];
1971
- elOffset['y'] += targetOffset['y'];
1966
+ offset: [0, 0],
1967
+ ...options };
1972
1968
 
1973
- position.left += elOffset['x'];
1974
- position.top += elOffset['y'];
1975
1969
 
1976
- if (flip) {
1977
- let boundaries = scrollParents(element).map(getViewport$1);
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
+ }
1978
1983
 
1979
- if (boundary && !includes(boundaries, boundary)) {
1980
- boundaries.unshift(boundary);
1981
- }
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);
1982
1988
 
1983
- boundaries = boundaries.map((el) => offset(el));
1989
+ let {
1990
+ flip,
1991
+ attach: { element: elAttach, target: targetAttach },
1992
+ offset: elOffset,
1993
+ boundary,
1994
+ viewport } =
1995
+ options;
1984
1996
 
1985
- each(dirs, (_ref, prop) => {let [dir, align, alignFlip] = _ref;
1986
- if (!(flip === true || includes(flip, dir))) {
1987
- return;
1988
- }
1997
+ viewports.push(viewport);
1989
1998
 
1990
- boundaries.some((boundary) => {
1991
- const elemOffset =
1992
- elAttach[dir] === align ?
1993
- -dim[prop] :
1994
- elAttach[dir] === alignFlip ?
1995
- dim[prop] :
1996
- 0;
1999
+ for (const i in dirs) {
2000
+ const [prop, dir, start, end] = dirs[i];
1997
2001
 
1998
- const targetOffset =
1999
- targetAttach[dir] === align ?
2000
- targetDim[prop] :
2001
- targetAttach[dir] === alignFlip ?
2002
- -targetDim[prop] :
2003
- 0;
2002
+ if (flip !== true && !includes(flip, dir)) {
2003
+ continue;
2004
+ }
2004
2005
 
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;
2006
+ const willFlip =
2007
+ !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
2012
2008
 
2013
- return (
2014
- elAttach[dir] === 'center' && (
2015
- apply(centerOffset, centerTargetOffset) ||
2016
- apply(-centerOffset, -centerTargetOffset)) ||
2017
- apply(elemOffset, targetOffset));
2009
+ viewport = getIntersectionArea(
2010
+ ...viewports,
2011
+ willFlip || position[prop] > offset(boundary)[prop] ? null : boundary);
2018
2012
 
2019
- }
2013
+ const isInStartBoundary = position[start] >= viewport[start];
2014
+ const isInEndBoundary = position[end] <= viewport[end];
2020
2015
 
2021
- function apply(elemOffset, targetOffset) {
2022
- const newVal = toFloat(
2023
- (position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4));
2016
+ if (isInStartBoundary && isInEndBoundary) {
2017
+ continue;
2018
+ }
2024
2019
 
2020
+ let offsetBy;
2025
2021
 
2026
- if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
2027
- position[align] = newVal;
2022
+ // Flip
2023
+ if (willFlip) {
2024
+ if (
2025
+ elAttach[i] === end && isInStartBoundary ||
2026
+ elAttach[i] === start && isInEndBoundary)
2027
+ {
2028
+ continue;
2029
+ }
2028
2030
 
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
- }
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
+ }
2037
2053
 
2038
- return true;
2039
- }
2040
- }
2041
- });
2042
- });
2054
+ position[start] = position[dir] = position[start] + offsetBy;
2055
+ position[end] += offsetBy;
2043
2056
  }
2044
2057
 
2045
- offset(element, position);
2046
-
2047
- return flipped;
2058
+ return position;
2048
2059
  }
2049
2060
 
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;
2056
- }
2057
- });
2061
+ function moveBy(start, end, dim) {
2062
+ return start === 'center' ? dim / 2 : start === end ? dim : 0;
2058
2063
  }
2059
2064
 
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'];
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]);
2078
+ }
2072
2079
  }
2073
-
2074
- return {
2075
- x: x.test(pos[0]) ? pos[0] : 'center',
2076
- y: y.test(pos[1]) ? pos[1] : 'center' };
2077
-
2080
+ return intersection;
2078
2081
  }
2079
2082
 
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
-
2083
+ function intersectLine(dimA, dimB, dir) {
2084
+ const [,, start, end] = dirs[dir];
2085
+ return dimA[end] > dimB[start] && dimB[end] > dimA[start];
2087
2086
  }
2088
2087
 
2089
2088
  var util = /*#__PURE__*/Object.freeze({
@@ -2412,7 +2411,7 @@
2412
2411
  const {
2413
2412
  $options: { computed } } =
2414
2413
  this;
2415
- const values = { ...this._computed };
2414
+ const values = { ...(initial ? {} : this._computed) };
2416
2415
  this._computed = {};
2417
2416
 
2418
2417
  for (const key in computed) {
@@ -2892,7 +2891,7 @@
2892
2891
  UIkit.data = '__uikit__';
2893
2892
  UIkit.prefix = 'uk-';
2894
2893
  UIkit.options = {};
2895
- UIkit.version = '3.13.7-dev.120e5ee9c';
2894
+ UIkit.version = '3.13.8-dev.128538499';
2896
2895
 
2897
2896
  globalAPI(UIkit);
2898
2897
  hooksAPI(UIkit);
@@ -3219,7 +3218,7 @@
3219
3218
  computed: {
3220
3219
  items: {
3221
3220
  get(_ref, $el) {let { targets } = _ref;
3222
- return $$(targets, $el);
3221
+ return $$(targets, $el).filter((el) => $(this.content, el));
3223
3222
  },
3224
3223
 
3225
3224
  watch(items, prev) {
@@ -3506,45 +3505,42 @@
3506
3505
 
3507
3506
  connected() {
3508
3507
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3509
- this.dir = this.pos[0];
3510
- this.align = this.pos[1];
3508
+ this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3511
3509
  },
3512
3510
 
3513
3511
  methods: {
3514
3512
  positionAt(element, target, boundary) {
3515
- const axis = this.getAxis();
3516
- const dir = this.pos[0];
3517
- const align = this.pos[1];
3513
+ const [dir, align] = this.pos;
3518
3514
 
3519
3515
  let { offset: offset$1 } = this;
3520
3516
  if (!isNumeric(offset$1)) {
3521
3517
  const node = $(offset$1);
3522
3518
  offset$1 = node ?
3523
- offset(node)[axis === 'x' ? 'left' : 'top'] -
3524
- offset(target)[axis === 'x' ? 'right' : 'bottom'] :
3519
+ offset(node)[this.axis === 'x' ? 'left' : 'top'] -
3520
+ offset(target)[this.axis === 'x' ? 'right' : 'bottom'] :
3525
3521
  0;
3526
3522
  }
3527
3523
  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] };
3528
3529
 
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
- },
3545
3530
 
3546
- getAxis() {
3547
- return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
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 });
3543
+
3548
3544
  } } };
3549
3545
 
3550
3546
  let active$1;
@@ -3581,8 +3577,11 @@
3581
3577
  this.tracker = new MouseTracker();
3582
3578
  },
3583
3579
 
3584
- connected() {
3580
+ beforeConnect() {
3585
3581
  this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
3582
+ },
3583
+
3584
+ connected() {
3586
3585
  addClass(this.$el, this.clsDrop);
3587
3586
 
3588
3587
  if (this.toggle && !this.target) {
@@ -3878,17 +3877,18 @@
3878
3877
  const boundaryOffset = offset(boundary);
3879
3878
  const targetOffset = offset(this.target);
3880
3879
  const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3880
+ const prop = this.axis === 'y' ? 'width' : 'height';
3881
+
3882
+ css(this.$el, "max-" + prop, '');
3881
3883
 
3882
3884
  if (this.pos[1] === 'justify') {
3883
- const prop = this.getAxis() === 'y' ? 'width' : 'height';
3884
3885
  css(this.$el, prop, alignTo[prop]);
3885
- } else if (
3886
- this.$el.offsetWidth >
3887
- Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left))
3888
- {
3886
+ } else if (this.$el.offsetWidth > boundaryOffset.width) {
3889
3887
  addClass(this.$el, this.clsDrop + "-stack");
3890
3888
  }
3891
3889
 
3890
+ css(this.$el, "max-" + prop, boundaryOffset[prop]);
3891
+
3892
3892
  this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
3893
3893
  } } };
3894
3894
 
@@ -4330,22 +4330,14 @@
4330
4330
  return { heights: [''], elements };
4331
4331
  }
4332
4332
 
4333
+ css(elements, 'minHeight', '');
4333
4334
  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);
4335
+ const max = Math.max(...heights);
4346
4336
 
4337
+ return {
4338
+ heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4339
+ elements };
4347
4340
 
4348
- return { heights, elements };
4349
4341
  }
4350
4342
 
4351
4343
  function getHeight(element) {
@@ -5002,16 +4994,19 @@
5002
4994
 
5003
4995
  connected() {
5004
4996
  const media = toMedia(this.media);
5005
- this.mediaObj = window.matchMedia(media);
5006
- const handler = () => {
5007
- this.matchMedia = this.mediaObj.matches;
5008
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5009
- };
5010
- this.offMediaObj = on(this.mediaObj, 'change', () => {
4997
+ this.matchMedia = true;
4998
+ if (media) {
4999
+ this.mediaObj = window.matchMedia(media);
5000
+ const handler = () => {
5001
+ this.matchMedia = this.mediaObj.matches;
5002
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5003
+ };
5004
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5005
+ handler();
5006
+ this.$emit('resize');
5007
+ });
5011
5008
  handler();
5012
- this.$emit('resize');
5013
- });
5014
- handler();
5009
+ }
5015
5010
  },
5016
5011
 
5017
5012
  disconnected() {var _this$offMediaObj;
@@ -5750,7 +5745,7 @@
5750
5745
  return this.dropbar;
5751
5746
  },
5752
5747
 
5753
- handler(_, _ref10) {let { $el, dir } = _ref10;
5748
+ handler(_, _ref10) {let { $el, pos: [dir] = [] } = _ref10;
5754
5749
  if (!hasClass($el, this.clsDrop)) {
5755
5750
  return;
5756
5751
  }
@@ -6328,27 +6323,26 @@
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
- },
6347
-
6348
- update: [
6349
- {
6350
- read() {
6351
- for (const el of this.elements) {
6340
+ connected() {
6341
+ this.registerObserver(
6342
+ observeIntersection(
6343
+ this.elements,
6344
+ (records) => {
6345
+ for (const { target: el, isIntersecting } of records) {
6352
6346
  if (!el[stateKey]) {
6353
6347
  el[stateKey] = { cls: data(el, 'uk-scrollspy-class') || this.cls };
6354
6348
  }
@@ -6357,14 +6351,38 @@
6357
6351
  continue;
6358
6352
  }
6359
6353
 
6360
- el[stateKey].show = isInView(el, this.offsetTop, this.offsetLeft);
6354
+ el[stateKey].show = isIntersecting;
6361
6355
  }
6356
+
6357
+ this.$emit();
6362
6358
  },
6359
+ {
6360
+ rootMargin: toPx(this.offsetTop, 'height') - 1 + "px " + (
6361
+ toPx(this.offsetLeft, 'width') - 1) + "px" },
6363
6362
 
6363
+
6364
+ false));
6365
+
6366
+
6367
+ },
6368
+
6369
+ disconnected() {
6370
+ for (const el of this.elements) {var _el$stateKey;
6371
+ removeClass(el, this.inViewClass, ((_el$stateKey = el[stateKey]) == null ? void 0 : _el$stateKey.cls) || '');
6372
+ delete el[stateKey];
6373
+ }
6374
+ },
6375
+
6376
+ update: [
6377
+ {
6364
6378
  write(data) {
6365
6379
  for (const el of this.elements) {
6366
6380
  const state = el[stateKey];
6367
6381
 
6382
+ if (!state) {
6383
+ continue;
6384
+ }
6385
+
6368
6386
  if (state.show && !state.inview && !state.queued) {
6369
6387
  state.queued = true;
6370
6388
 
@@ -6381,9 +6399,7 @@
6381
6399
  this.toggle(el, false);
6382
6400
  }
6383
6401
  }
6384
- },
6385
-
6386
- events: ['scroll', 'resize'] }],
6402
+ } }],
6387
6403
 
6388
6404
 
6389
6405
 
@@ -6612,13 +6628,13 @@
6612
6628
  return false;
6613
6629
  }
6614
6630
 
6615
- const hide = this.isActive && types.has('resize');
6631
+ const hide = this.active && types.has('resize');
6616
6632
  if (hide) {
6617
6633
  css(this.selTarget, 'transition', '0s');
6618
6634
  this.hide();
6619
6635
  }
6620
6636
 
6621
- if (!this.isActive) {
6637
+ if (!this.active) {
6622
6638
  height$1 = offset(this.$el).height;
6623
6639
  margin = css(this.$el, 'margin');
6624
6640
  }