uikit 3.14.4-dev.5e7e87ba7 → 3.14.4-dev.6002e7046

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 (77) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/dist/css/uikit-core-rtl.css +14 -3
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +14 -3
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +16 -28
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +16 -28
  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 +27 -17
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +27 -17
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +4 -2
  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 +17 -8
  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 +194 -161
  37. package/dist/js/uikit-core.min.js +15 -12
  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 +197 -162
  41. package/dist/js/uikit.min.js +15 -12
  42. package/package.json +11 -11
  43. package/src/images/components/navbar-toggle-icon.svg +17 -14
  44. package/src/js/api/hooks.js +5 -1
  45. package/src/js/api/state.js +1 -1
  46. package/src/js/components/notification.js +3 -1
  47. package/src/js/core/drop.js +32 -33
  48. package/src/js/core/navbar.js +3 -1
  49. package/src/js/core/offcanvas.js +8 -4
  50. package/src/js/core/toggle.js +3 -5
  51. package/src/js/mixin/modal.js +15 -12
  52. package/src/js/mixin/position.js +5 -4
  53. package/src/js/mixin/style.js +11 -0
  54. package/src/js/mixin/togglable.js +11 -3
  55. package/src/js/util/animation.js +5 -4
  56. package/src/js/util/class.js +3 -1
  57. package/src/js/util/position.js +96 -90
  58. package/src/less/components/dropbar.less +11 -0
  59. package/src/less/components/nav.less +3 -1
  60. package/src/less/components/navbar.less +17 -3
  61. package/src/less/theme/navbar.less +5 -32
  62. package/src/scss/components/dropbar.scss +11 -0
  63. package/src/scss/components/nav.scss +3 -1
  64. package/src/scss/components/navbar.scss +17 -3
  65. package/src/scss/mixins-theme.scss +3 -28
  66. package/src/scss/mixins.scss +2 -0
  67. package/src/scss/theme/navbar.scss +5 -5
  68. package/src/scss/variables-theme.scss +8 -4
  69. package/src/scss/variables.scss +7 -1
  70. package/tests/drop.html +4 -6
  71. package/tests/dropbar.html +10 -8
  72. package/tests/index.html +1 -1
  73. package/tests/js/index.js +1 -4
  74. package/tests/navbar.html +48 -21
  75. package/tests/position.html +17 -4
  76. package/tests/search.html +2 -2
  77. package/tests/sticky-navbar.html +12 -12
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.5e7e87ba7 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.6002e7046 | 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() :
@@ -814,7 +814,9 @@
814
814
  }
815
815
 
816
816
  function removeClasses(element, cls) {
817
- attr(element, 'class', (value) => (value || '').replace(new RegExp("\\b" + cls + "\\b", 'g'), ''));
817
+ attr(element, 'class', (value) =>
818
+ (value || '').replace(new RegExp("\\b" + cls + "\\b\\s?", 'g'), ''));
819
+
818
820
  }
819
821
 
820
822
  function replaceClass(element) {
@@ -950,7 +952,8 @@
950
952
 
951
953
  }
952
954
 
953
- const inProgress = new RegExp(animationPrefix + "(enter|leave)");
955
+ const inProgressRe = new RegExp(animationPrefix + "(enter|leave)");
956
+
954
957
  const Animation = {
955
958
  in: animate$2,
956
959
 
@@ -959,7 +962,7 @@
959
962
  },
960
963
 
961
964
  inProgress(element) {
962
- return inProgress.test(attr(element, 'class'));
965
+ return inProgressRe.test(attr(element, 'class'));
963
966
  },
964
967
 
965
968
  cancel(element) {
@@ -1933,6 +1936,7 @@
1933
1936
  ...options.attach },
1934
1937
 
1935
1938
  offset: [0, 0],
1939
+ placement: [],
1936
1940
  ...options };
1937
1941
 
1938
1942
 
@@ -1943,57 +1947,21 @@
1943
1947
  offset(element, getPosition(element, target, options));
1944
1948
  }
1945
1949
 
1946
- function attachTo(element, target, options) {
1947
- let { attach, offset: offsetBy } = {
1948
- attach: {
1949
- element: ['left', 'top'],
1950
- target: ['left', 'top'],
1951
- ...options.attach },
1952
-
1953
- offset: [0, 0],
1954
- ...options };
1955
-
1956
-
1957
- const position = offset(element);
1958
-
1959
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1960
- const targetOffset =
1961
- attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);
1962
-
1963
- position[start] = position[dir] =
1964
- targetOffset[start] +
1965
- moveBy(attach.target[i], end, targetOffset[prop]) -
1966
- moveBy(attach.element[i], end, position[prop]) +
1967
- +offsetBy[i];
1968
- position[end] = position[start] + position[prop];
1969
- }
1970
- return position;
1971
- }
1972
-
1973
- function moveBy(start, end, dim) {
1974
- return start === 'center' ? dim / 2 : start === end ? dim : 0;
1975
- }
1976
-
1977
1950
  function getPosition(element, target, options) {
1978
1951
  const position = attachTo(element, target, options);
1979
1952
 
1980
1953
  let {
1981
- flip,
1982
- shift,
1983
1954
  attach: { element: elAttach, target: targetAttach },
1984
1955
  offset: elOffset,
1985
1956
  boundary,
1986
- viewportOffset } =
1957
+ viewportOffset,
1958
+ placement } =
1987
1959
  options;
1988
1960
 
1989
- if (!flip && !shift) {
1990
- return position;
1991
- }
1992
-
1993
- const offsetPosition = { ...position };
1994
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1961
+ let offsetPosition = position;
1962
+ for (const [i, [prop,, start, end]] of Object.entries(dirs)) {
1995
1963
  let viewports = scrollParents(target[i]);
1996
- const [scrollElement] = viewports;
1964
+ const scrollArea = getScrollArea(viewports[0], viewportOffset, i);
1997
1965
 
1998
1966
  let viewport = getIntersectionArea(...viewports.map(offsetViewport));
1999
1967
 
@@ -2003,54 +1971,28 @@
2003
1971
  }
2004
1972
 
2005
1973
  if (boundary) {
2006
- viewport = getIntersectionArea(viewport, offsetViewport(boundary));
1974
+ viewport = getIntersectionArea(viewport, offset(boundary));
2007
1975
  }
2008
1976
 
2009
- const isInStartViewport = position[start] >= viewport[start];
2010
- const isInEndViewport = position[end] <= viewport[end];
2011
-
2012
- if (isInStartViewport && isInEndViewport) {
1977
+ if (isWithin(position, viewport, i)) {
2013
1978
  continue;
2014
1979
  }
2015
1980
 
2016
1981
  let offsetBy = 0;
2017
- const targetDim = offset(target[i]);
2018
1982
 
2019
1983
  // Flip
2020
- if (!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i)) {
1984
+ if (placement[i] === 'flip') {
2021
1985
  if (
2022
- !flip ||
2023
- elAttach[i] === end && isInStartViewport ||
2024
- elAttach[i] === start && isInEndViewport)
1986
+ targetAttach[i] === end && position[end] <= viewport[end] ||
1987
+ targetAttach[i] === start && position[start] >= viewport[start])
2025
1988
  {
2026
1989
  continue;
2027
1990
  }
2028
1991
 
2029
- offsetBy =
2030
- (elAttach[i] === start ?
2031
- -position[prop] :
2032
- elAttach[i] === end ?
2033
- position[prop] :
2034
- 0) + (
2035
- targetAttach[i] === start ?
2036
- targetDim[prop] :
2037
- targetAttach[i] === end ?
2038
- -targetDim[prop] :
2039
- 0) -
2040
- elOffset[i] * 2;
1992
+ offsetBy = flip(element, target, options, i)[start] - position[start];
2041
1993
 
2042
- if (
2043
- !isInScrollArea(
2044
- {
2045
- ...position,
2046
- [start]: position[start] + offsetBy,
2047
- [end]: position[end] + offsetBy },
2048
-
2049
- scrollElement,
2050
- i))
2051
-
2052
- {
2053
- if (isInScrollArea(position, scrollElement, i)) {
1994
+ if (!isWithin(applyOffset(position, offsetBy, i), scrollArea, i)) {
1995
+ if (isWithin(position, scrollArea, i)) {
2054
1996
  continue;
2055
1997
  }
2056
1998
 
@@ -2061,14 +2003,15 @@
2061
2003
  const newPos = getPosition(element, target, {
2062
2004
  ...options,
2063
2005
  attach: {
2064
- element: elAttach.map(flipDir).reverse(),
2065
- target: targetAttach.map(flipDir).reverse() },
2006
+ element: elAttach.map(flipAxis).reverse(),
2007
+ target: targetAttach.map(flipAxis).reverse() },
2066
2008
 
2067
2009
  offset: elOffset.reverse(),
2010
+ placement: placement.reverse(),
2068
2011
  recursion: true });
2069
2012
 
2070
2013
 
2071
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2014
+ if (newPos && isWithin(newPos, scrollArea, 1 - i)) {
2072
2015
  return newPos;
2073
2016
  }
2074
2017
 
@@ -2076,7 +2019,8 @@
2076
2019
  }
2077
2020
 
2078
2021
  // Shift
2079
- } else if (shift) {
2022
+ } else if (placement[i] === 'shift') {
2023
+ const targetDim = offset(target[i]);
2080
2024
  offsetBy =
2081
2025
  clamp(
2082
2026
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2085,13 +2029,54 @@
2085
2029
  position[start];
2086
2030
  }
2087
2031
 
2088
- offsetPosition[start] = position[dir] = position[start] + offsetBy;
2089
- offsetPosition[end] += offsetBy;
2032
+ offsetPosition = applyOffset(offsetPosition, offsetBy, i);
2090
2033
  }
2091
2034
 
2092
2035
  return offsetPosition;
2093
2036
  }
2094
2037
 
2038
+ function attachTo(element, target, options) {
2039
+ let { attach, offset: offsetBy } = {
2040
+ attach: {
2041
+ element: ['left', 'top'],
2042
+ target: ['left', 'top'],
2043
+ ...options.attach },
2044
+
2045
+ offset: [0, 0],
2046
+ ...options };
2047
+
2048
+
2049
+ let elOffset = offset(element);
2050
+
2051
+ for (const [i, [prop,, start, end]] of Object.entries(dirs)) {
2052
+ const targetOffset =
2053
+ attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);
2054
+
2055
+ elOffset = applyOffset(
2056
+ elOffset,
2057
+ targetOffset[start] -
2058
+ elOffset[start] +
2059
+ moveBy(attach.target[i], end, targetOffset[prop]) -
2060
+ moveBy(attach.element[i], end, elOffset[prop]) +
2061
+ +offsetBy[i],
2062
+ i);
2063
+
2064
+ }
2065
+ return elOffset;
2066
+ }
2067
+
2068
+ function applyOffset(position, offset, i) {
2069
+ const [, dir, start, end] = dirs[i];
2070
+ const newPos = { ...position };
2071
+ newPos[start] = position[dir] = position[start] + offset;
2072
+ newPos[end] += offset;
2073
+ return newPos;
2074
+ }
2075
+
2076
+ function moveBy(attach, end, dim) {
2077
+ return attach === 'center' ? dim / 2 : attach === end ? dim : 0;
2078
+ }
2079
+
2095
2080
  function getIntersectionArea() {
2096
2081
  let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2097
2082
  for (const rect of rects) {
@@ -2103,21 +2088,45 @@
2103
2088
  return area;
2104
2089
  }
2105
2090
 
2106
- function isInScrollArea(position, scrollElement, dir) {
2091
+ function getScrollArea(scrollElement, viewportOffset, i) {
2092
+ const [prop,, start, end] = dirs[i];
2107
2093
  const viewport = offsetViewport(scrollElement);
2108
- const [prop,, start, end] = dirs[dir];
2109
- viewport[start] -= scrollElement["scroll" + ucfirst(start)];
2110
- viewport[end] = viewport[start] + scrollElement["scroll" + ucfirst(prop)];
2094
+ viewport[start] -= scrollElement["scroll" + ucfirst(start)] - viewportOffset;
2095
+ viewport[end] = viewport[start] + scrollElement["scroll" + ucfirst(prop)] - viewportOffset;
2096
+ return viewport;
2097
+ }
2111
2098
 
2112
- return position[start] >= viewport[start] && position[end] <= viewport[end];
2099
+ function isWithin(positionA, positionB, i) {
2100
+ const [,, start, end] = dirs[i];
2101
+ return positionA[start] >= positionB[start] && positionA[end] <= positionB[end];
2113
2102
  }
2114
2103
 
2115
- function intersectLine(dimA, dimB, dir) {
2116
- const [,, start, end] = dirs[dir];
2117
- return dimA[end] > dimB[start] && dimB[end] > dimA[start];
2104
+ function flip(element, target, _ref, i) {let { offset, attach } = _ref;
2105
+ return attachTo(element, target, {
2106
+ attach: {
2107
+ element: flipAttach(attach.element, i),
2108
+ target: flipAttach(attach.target, i) },
2109
+
2110
+ offset: flipOffset(offset, i) });
2111
+
2112
+ }
2113
+
2114
+ function flipAttach(attach, i) {
2115
+ const newAttach = [...attach];
2116
+ const index = dirs[i].indexOf(attach[i]);
2117
+ if (~index) {
2118
+ newAttach[i] = dirs[i][1 - index % 2 + 2];
2119
+ }
2120
+ return newAttach;
2121
+ }
2122
+
2123
+ function flipOffset(offset, i) {
2124
+ offset = [...offset];
2125
+ offset[i] *= -1;
2126
+ return offset;
2118
2127
  }
2119
2128
 
2120
- function flipDir(prop) {
2129
+ function flipAxis(prop) {
2121
2130
  for (let i = 0; i < dirs.length; i++) {
2122
2131
  const index = dirs[i].indexOf(prop);
2123
2132
  if (~index) {
@@ -2130,9 +2139,7 @@
2130
2139
  __proto__: null,
2131
2140
  ajax: ajax,
2132
2141
  getImage: getImage,
2133
- transition: transition,
2134
2142
  Transition: Transition,
2135
- animate: animate$2,
2136
2143
  Animation: Animation,
2137
2144
  attr: attr,
2138
2145
  hasAttr: hasAttr,
@@ -2437,7 +2444,11 @@
2437
2444
  }
2438
2445
 
2439
2446
  if (write && result !== false) {
2440
- fastdom.write(() => write.call(this, this._data, types));
2447
+ fastdom.write(() => {
2448
+ if (this._connected) {
2449
+ write.call(this, this._data, types);
2450
+ }
2451
+ });
2441
2452
  }
2442
2453
  }
2443
2454
  }
@@ -2597,7 +2608,7 @@
2597
2608
 
2598
2609
  for (const key in options) {
2599
2610
  const prop = camelize(key);
2600
- if (props[prop] !== undefined) {
2611
+ if (!isUndefined(props[prop])) {
2601
2612
  data$1[prop] = coerce$1(props[prop], options[key]);
2602
2613
  }
2603
2614
  }
@@ -2926,7 +2937,7 @@
2926
2937
  UIkit.data = '__uikit__';
2927
2938
  UIkit.prefix = 'uk-';
2928
2939
  UIkit.options = {};
2929
- UIkit.version = '3.14.4-dev.5e7e87ba7';
2940
+ UIkit.version = '3.14.4-dev.6002e7046';
2930
2941
 
2931
2942
  globalAPI(UIkit);
2932
2943
  hooksAPI(UIkit);
@@ -3160,9 +3171,16 @@
3160
3171
  }
3161
3172
 
3162
3173
  const prevProps = Object.fromEntries(
3163
- ['padding', 'border', 'width', 'height', 'overflow', marginProp, marginStartProp].map(
3164
- (key) => [key, el.style[key]]));
3165
-
3174
+ [
3175
+ 'padding',
3176
+ 'border',
3177
+ 'width',
3178
+ 'height',
3179
+ 'overflowY',
3180
+ 'overflowX',
3181
+ marginProp,
3182
+ marginStartProp].
3183
+ map((key) => [key, el.style[key]]));
3166
3184
 
3167
3185
 
3168
3186
  const dim = dimensions$1(el);
@@ -3180,6 +3198,7 @@
3180
3198
  height: dim.height,
3181
3199
  width: dim.width,
3182
3200
  ...css(el, [
3201
+ 'overflow',
3183
3202
  'padding',
3184
3203
  'borderTop',
3185
3204
  'borderRight',
@@ -3616,6 +3635,7 @@
3616
3635
  methods: {
3617
3636
  positionAt(element, target, boundary) {
3618
3637
  let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3638
+ const placement = [this.flip && 'flip', this.shift && 'shift'];
3619
3639
 
3620
3640
  const attach = {
3621
3641
  element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
@@ -3624,9 +3644,10 @@
3624
3644
 
3625
3645
  if (this.axis === 'y') {
3626
3646
  for (const prop in attach) {
3627
- attach[prop] = attach[prop].reverse();
3647
+ attach[prop].reverse();
3628
3648
  }
3629
- offset = offset.reverse();
3649
+ offset.reverse();
3650
+ placement.reverse();
3630
3651
  }
3631
3652
 
3632
3653
  const [scrollElement] = scrollParents(element, /auto|scroll/);
@@ -3640,8 +3661,7 @@
3640
3661
  attach,
3641
3662
  offset,
3642
3663
  boundary,
3643
- flip: this.flip,
3644
- shift: this.shift,
3664
+ placement,
3645
3665
  viewportOffset: this.getViewportOffset(element) });
3646
3666
 
3647
3667
 
@@ -3676,6 +3696,15 @@
3676
3696
  return toPx(css(element, '--uk-position-viewport-offset'));
3677
3697
  } } };
3678
3698
 
3699
+ var Style = {
3700
+ beforeConnect() {
3701
+ this._style = attr(this.$el, 'style');
3702
+ },
3703
+
3704
+ disconnected() {
3705
+ attr(this.$el, 'style', this._style);
3706
+ } };
3707
+
3679
3708
  const active$1 = [];
3680
3709
 
3681
3710
  var Modal = {
@@ -3785,8 +3814,8 @@
3785
3814
 
3786
3815
 
3787
3816
  if (this.overlay) {
3788
- once(this.$el, 'hide', preventOverscroll(this.$el));
3789
- once(this.$el, 'hide', preventBackgroundScroll());
3817
+ once(this.$el, 'hidden', preventOverscroll(this.$el), { self: true });
3818
+ once(this.$el, 'hidden', preventBackgroundScroll(), { self: true });
3790
3819
  }
3791
3820
 
3792
3821
  if (this.stack) {
@@ -3868,10 +3897,6 @@
3868
3897
  active$1.splice(active$1.indexOf(this), 1);
3869
3898
  }
3870
3899
 
3871
- if (!active$1.length) {
3872
- css(document.body, 'overflowY', '');
3873
- }
3874
-
3875
3900
  css(this.$el, 'zIndex', '');
3876
3901
 
3877
3902
  if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
@@ -3988,16 +4013,22 @@
3988
4013
  return () => events.forEach((fn) => fn());
3989
4014
  }
3990
4015
 
4016
+ let prevented;
3991
4017
  function preventBackgroundScroll() {
3992
- const { body, documentElement } = document;
3993
- css(body, {
3994
- overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
3995
- touchAction: 'none' });
4018
+ if (prevented) {
4019
+ return noop;
4020
+ }
4021
+ prevented = true;
4022
+
4023
+ const { scrollingElement } = document;
4024
+ css(scrollingElement, {
4025
+ overflowY: 'hidden',
4026
+ touchAction: 'none',
4027
+ paddingRight: width(window) - scrollingElement.clientWidth });
3996
4028
 
3997
- css(documentElement, 'overflowY', 'hidden');
3998
4029
  return () => {
3999
- css(documentElement, 'overflowY', '');
4000
- css(body, { overflowY: '', touchAction: '' });
4030
+ prevented = false;
4031
+ css(scrollingElement, { overflowY: '', touchAction: '', paddingRight: '' });
4001
4032
  };
4002
4033
  }
4003
4034
 
@@ -4014,7 +4045,7 @@
4014
4045
  let active;
4015
4046
 
4016
4047
  var drop = {
4017
- mixins: [Container, Lazyload, Position, Togglable],
4048
+ mixins: [Container, Lazyload, Position, Style, Togglable],
4018
4049
 
4019
4050
  args: 'pos',
4020
4051
 
@@ -4028,7 +4059,7 @@
4028
4059
  stretch: Boolean,
4029
4060
  delayShow: Number,
4030
4061
  delayHide: Number,
4031
- display: String,
4062
+ autoUpdate: Boolean,
4032
4063
  clsDrop: String,
4033
4064
  animateOut: Boolean,
4034
4065
  bgScroll: Boolean },
@@ -4044,7 +4075,7 @@
4044
4075
  stretch: false,
4045
4076
  delayShow: 0,
4046
4077
  delayHide: 800,
4047
- display: null,
4078
+ autoUpdate: true,
4048
4079
  clsDrop: false,
4049
4080
  animateOut: false,
4050
4081
  bgScroll: true,
@@ -4088,6 +4119,7 @@
4088
4119
 
4089
4120
  disconnected() {
4090
4121
  if (this.isActive()) {
4122
+ this.hide(false);
4091
4123
  active = null;
4092
4124
  }
4093
4125
  },
@@ -4221,7 +4253,8 @@
4221
4253
 
4222
4254
  this.tracker.init();
4223
4255
 
4224
- for (const handler of [
4256
+ const update = () => this.$emit();
4257
+ const handlers = [
4225
4258
  on(
4226
4259
  document,
4227
4260
  pointerDown$1,
@@ -4250,29 +4283,28 @@
4250
4283
  }
4251
4284
  }),
4252
4285
 
4286
+ on(window, 'resize', update),
4287
+
4288
+ (() => {
4289
+ const observer = observeResize(
4290
+ scrollParents(this.$el).concat(this.targetEl),
4291
+ update);
4292
+
4293
+ return () => observer.disconnect();
4294
+ })(),
4295
+
4296
+ ...(this.autoUpdate ?
4297
+ [on([document, scrollParents(this.$el)], 'scroll', update)] :
4298
+ []),
4299
+
4253
4300
  ...(this.bgScroll ?
4254
4301
  [] :
4255
- [preventOverscroll(this.$el), preventBackgroundScroll()]),
4302
+ [preventOverscroll(this.$el), preventBackgroundScroll()])];
4303
+
4304
+
4305
+ once(this.$el, 'hide', () => handlers.forEach((handler) => handler()), {
4306
+ self: true });
4256
4307
 
4257
- ...(this.display === 'static' ?
4258
- [] :
4259
- (() => {
4260
- const handler = () => this.$emit();
4261
- return [
4262
- on(window, 'resize', handler),
4263
- on([document, scrollParents(this.$el)], 'scroll', handler),
4264
- (() => {
4265
- const observer = observeResize(
4266
- scrollParents(this.$el),
4267
- handler);
4268
-
4269
- return () => observer.disconnect();
4270
- })()];
4271
-
4272
- })())])
4273
- {
4274
- once(this.$el, 'hide', handler, { self: true });
4275
- }
4276
4308
  } },
4277
4309
 
4278
4310
 
@@ -4381,13 +4413,13 @@
4381
4413
 
4382
4414
  position() {
4383
4415
  removeClass(this.$el, this.clsDrop + "-stack");
4384
- css(this.$el, { maxWidth: '', top: '', left: '' });
4416
+ attr(this.$el, 'style', this._style);
4385
4417
 
4386
4418
  // Ensure none positioned element does not generate scrollbars
4387
4419
  this.$el.hidden = true;
4388
4420
 
4389
4421
  const boundary = query(this.boundary, this.$el);
4390
- const boundaryOffset = offsetViewport(boundary || window);
4422
+ const boundaryOffset = offset(boundary || window);
4391
4423
  const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4392
4424
  const viewportOffset = this.getViewportOffset(this.$el);
4393
4425
 
@@ -4397,12 +4429,9 @@
4397
4429
 
4398
4430
 
4399
4431
  for (const [i, [axis, prop]] of dirs) {
4400
- if (includes([axis, true], this.stretch)) {
4432
+ if (this.axis !== axis && includes([axis, true], this.stretch)) {
4401
4433
  css(this.$el, {
4402
- [prop]:
4403
- this.axis === axis ?
4404
- '' // Reset prop in main axis before positioning to not cause the drop to flip prematurely
4405
- : Math.min(
4434
+ [prop]: Math.min(
4406
4435
  boundaryOffset[prop],
4407
4436
  viewports[i][prop] - 2 * viewportOffset),
4408
4437
 
@@ -5218,7 +5247,7 @@
5218
5247
 
5219
5248
  var navbarParentIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" points=\"1 3.5 6 8.5 11 3.5\"/></svg>";
5220
5249
 
5221
- var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><style>.uk-navbar-toggle svg > [class*='line-'] {\n transition: 0.2s ease-in-out;\n transition-property: transform, opacity,;\n transform-origin: center;\n opacity: 1;\n }\n\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-2 { transform: rotate(45deg); }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-3 { transform: rotate(-45deg); }\n\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-1,\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-4 { opacity: 0; }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-1 { transform: translateY(6px) scaleX(0); }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-4 { transform: translateY(-6px) scaleX(0); }</style><rect class=\"line-1\" y=\"3\" width=\"20\" height=\"2\"/><rect class=\"line-2\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-3\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-4\" y=\"15\" width=\"20\" height=\"2\"/></svg>";
5250
+ var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><style>.uk-navbar-toggle-animate svg > [class*='line-'] {\n transition: 0.2s ease-in-out;\n transition-property: transform, opacity,;\n transform-origin: center;\n opacity: 1;\n }\n\n .uk-navbar-toggle svg > .line-3 { opacity: 0; }\n .uk-navbar-toggle-animate[aria-expanded=\"true\"] svg > .line-3 { opacity: 1; }\n\n .uk-navbar-toggle-animate[aria-expanded=\"true\"] svg > .line-2 { transform: rotate(45deg); }\n .uk-navbar-toggle-animate[aria-expanded=\"true\"] svg > .line-3 { transform: rotate(-45deg); }\n\n .uk-navbar-toggle-animate[aria-expanded=\"true\"] svg > .line-1,\n .uk-navbar-toggle-animate[aria-expanded=\"true\"] svg > .line-4 { opacity: 0; }\n .uk-navbar-toggle-animate[aria-expanded=\"true\"] svg > .line-1 { transform: translateY(6px) scaleX(0); }\n .uk-navbar-toggle-animate[aria-expanded=\"true\"] svg > .line-4 { transform: translateY(-6px) scaleX(0); }</style><rect class=\"line-1\" y=\"3\" width=\"20\" height=\"2\"/><rect class=\"line-2\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-3\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-4\" y=\"15\" width=\"20\" height=\"2\"/></svg>";
5222
5251
 
5223
5252
  var overlayIcon = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"19\" y=\"0\" width=\"1\" height=\"40\"/><rect x=\"0\" y=\"19\" width=\"40\" height=\"1\"/></svg>";
5224
5253
 
@@ -5821,6 +5850,8 @@
5821
5850
  offset: Number,
5822
5851
  boundary: Boolean,
5823
5852
  target: Boolean,
5853
+ targetX: Boolean,
5854
+ targetY: Boolean,
5824
5855
  clsDrop: String,
5825
5856
  delayShow: Number,
5826
5857
  delayHide: Number,
@@ -6169,7 +6200,7 @@
6169
6200
 
6170
6201
  methods: {
6171
6202
  getActive() {
6172
- return active && within(active.targetEl, this.$el) && active;
6203
+ return includes(this.dropdowns, active == null ? void 0 : active.$el) && active;
6173
6204
  },
6174
6205
 
6175
6206
  transitionTo(newHeight, el) {
@@ -6409,9 +6440,12 @@
6409
6440
  addClass(parent(this.panel), this.clsMode);
6410
6441
  }
6411
6442
 
6412
- addClass(document.body, this.clsContainer, this.clsFlip);
6413
- css(document.body, 'touch-action', 'pan-y pinch-zoom');
6443
+ const { body, scrollingElement } = document;
6444
+
6445
+ addClass(body, this.clsContainer, this.clsFlip);
6446
+ css(body, 'touch-action', 'pan-y pinch-zoom');
6414
6447
  css(this.$el, 'display', 'block');
6448
+ css(this.panel, 'maxWidth', scrollingElement.clientWidth);
6415
6449
  addClass(this.$el, this.clsOverlay);
6416
6450
  addClass(
6417
6451
  this.panel,
@@ -6419,8 +6453,8 @@
6419
6453
  this.mode === 'reveal' ? '' : this.clsMode);
6420
6454
 
6421
6455
 
6422
- height(document.body); // force reflow
6423
- addClass(document.body, this.clsContainerAnimation);
6456
+ height(body); // force reflow
6457
+ addClass(body, this.clsContainerAnimation);
6424
6458
 
6425
6459
  this.clsContainerAnimation && suppressUserScale();
6426
6460
  } },
@@ -6452,6 +6486,7 @@
6452
6486
  removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);
6453
6487
  removeClass(this.$el, this.clsOverlay);
6454
6488
  css(this.$el, 'display', '');
6489
+ css(this.panel, 'maxWidth', '');
6455
6490
  removeClass(document.body, this.clsContainer, this.clsFlip);
6456
6491
  } },
6457
6492
 
@@ -7588,7 +7623,7 @@
7588
7623
 
7589
7624
 
7590
7625
  {
7591
- name: 'toggled',
7626
+ name: 'hide show',
7592
7627
 
7593
7628
  self: true,
7594
7629
 
@@ -7596,10 +7631,8 @@
7596
7631
  return this.target;
7597
7632
  },
7598
7633
 
7599
- handler(e, toggled) {
7600
- if (e.target === this.target[0]) {
7601
- this.updateAria(toggled);
7602
- }
7634
+ handler(_ref2) {let { type } = _ref2;
7635
+ this.updateAria(type === 'show');
7603
7636
  } },
7604
7637
 
7605
7638
 
@@ -9480,7 +9513,9 @@
9480
9513
  this.$mount(
9481
9514
  append(
9482
9515
  container, "<div class=\"" +
9483
- this.clsMsg + (this.status ? " " + this.clsMsg + "-" + this.status : '') + "\"> <a href class=\"" +
9516
+ this.clsMsg + (
9517
+ this.status ? " " + this.clsMsg + "-" + this.status : '') + "\" role=\"alert\"> <a href class=\"" +
9518
+
9484
9519
  this.clsClose + "\" data-uk-close></a> <div>" +
9485
9520
  this.message + "</div> </div>"));
9486
9521