uikit 3.14.4-dev.a02c81d72 → 3.14.4-dev.ae765cd84

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 (132) hide show
  1. package/CHANGELOG.md +34 -17
  2. package/build/util.js +1 -0
  3. package/dist/css/uikit-core-rtl.css +339 -109
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +339 -109
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +359 -113
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +359 -113
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +1 -1
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +1 -1
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +78 -129
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +78 -129
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +1 -1
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +4 -5
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +4 -5
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +1 -1
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +4 -5
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +1 -1
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +1 -1
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +92 -145
  34. package/dist/js/components/tooltip.min.js +1 -1
  35. package/dist/js/components/upload.js +1 -1
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +460 -446
  38. package/dist/js/uikit-core.min.js +14 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +460 -446
  42. package/dist/js/uikit.min.js +14 -1
  43. package/package.json +1 -1
  44. package/src/images/{backgrounds/nav-parent-close.svg → components/nav-parent-icon-large.svg} +0 -0
  45. package/src/images/{backgrounds/navbar-parent-close.svg → components/nav-parent-icon.svg} +0 -0
  46. package/src/images/{backgrounds/navbar-parent-open.svg → components/navbar-parent-icon.svg} +1 -1
  47. package/src/images/components/navbar-toggle-icon.svg +22 -3
  48. package/src/js/api/state.js +2 -2
  49. package/src/js/core/accordion.js +9 -17
  50. package/src/js/core/alert.js +35 -14
  51. package/src/js/core/drop.js +89 -62
  52. package/src/js/core/height-viewport.js +4 -2
  53. package/src/js/core/icon.js +16 -0
  54. package/src/js/core/index.js +2 -0
  55. package/src/js/core/leader.js +2 -2
  56. package/src/js/core/navbar.js +30 -45
  57. package/src/js/core/scroll.js +37 -10
  58. package/src/js/core/toggle.js +3 -5
  59. package/src/js/mixin/media.js +4 -5
  60. package/src/js/mixin/modal.js +9 -6
  61. package/src/js/mixin/position.js +24 -26
  62. package/src/js/mixin/style.js +11 -0
  63. package/src/js/mixin/togglable.js +80 -133
  64. package/src/js/util/animation.js +4 -3
  65. package/src/js/util/filter.js +3 -7
  66. package/src/js/util/position.js +107 -107
  67. package/src/js/util/style.js +4 -13
  68. package/src/js/util/viewport.js +3 -5
  69. package/src/less/components/_import.less +1 -0
  70. package/src/less/components/drop.less +1 -18
  71. package/src/less/components/dropbar.less +115 -0
  72. package/src/less/components/dropdown.less +11 -19
  73. package/src/less/components/leader.less +1 -1
  74. package/src/less/components/nav.less +218 -59
  75. package/src/less/components/navbar.less +54 -47
  76. package/src/less/components/utility.less +10 -2
  77. package/src/less/theme/_import.less +1 -0
  78. package/src/less/theme/dropbar.less +44 -0
  79. package/src/less/theme/dropdown.less +0 -11
  80. package/src/less/theme/nav.less +45 -7
  81. package/src/less/theme/navbar.less +1 -5
  82. package/src/scss/components/_import.scss +1 -0
  83. package/src/scss/components/drop.scss +1 -18
  84. package/src/scss/components/dropbar.scss +115 -0
  85. package/src/scss/components/dropdown.scss +11 -19
  86. package/src/scss/components/leader.scss +1 -1
  87. package/src/scss/components/nav.scss +167 -47
  88. package/src/scss/components/navbar.scss +42 -47
  89. package/src/scss/components/utility.scss +8 -1
  90. package/src/scss/mixins-theme.scss +92 -21
  91. package/src/scss/mixins.scss +89 -17
  92. package/src/scss/theme/_import.scss +1 -0
  93. package/src/scss/theme/dropbar.scss +44 -0
  94. package/src/scss/theme/dropdown.scss +0 -8
  95. package/src/scss/theme/nav.scss +43 -7
  96. package/src/scss/theme/navbar.scss +1 -5
  97. package/src/scss/variables-theme.scss +56 -19
  98. package/src/scss/variables.scss +45 -17
  99. package/tests/accordion.html +2 -2
  100. package/tests/alert.html +2 -2
  101. package/tests/countdown.html +1 -1
  102. package/tests/drop.html +442 -412
  103. package/tests/dropbar.html +456 -0
  104. package/tests/dropdown.html +8 -470
  105. package/tests/filter.html +9 -12
  106. package/tests/form.html +1 -1
  107. package/tests/index.html +126 -107
  108. package/tests/js/index.js +1 -4
  109. package/tests/lightbox.html +5 -5
  110. package/tests/list.html +8 -8
  111. package/tests/modal.html +13 -13
  112. package/tests/nav.html +117 -75
  113. package/tests/navbar.html +102 -237
  114. package/tests/offcanvas.html +17 -21
  115. package/tests/parallax.html +1 -1
  116. package/tests/position.html +18 -16
  117. package/tests/progress.html +9 -9
  118. package/tests/scroll.html +7 -10
  119. package/tests/search.html +5 -5
  120. package/tests/slider.html +6 -5
  121. package/tests/slideshow.html +8 -8
  122. package/tests/sortable.html +6 -8
  123. package/tests/sticky-navbar.html +6 -6
  124. package/tests/sticky.html +8 -8
  125. package/tests/switcher.html +1 -1
  126. package/tests/tab.html +1 -1
  127. package/tests/table.html +7 -7
  128. package/tests/toggle.html +2 -2
  129. package/tests/tooltip.html +1 -1
  130. package/tests/upload.html +11 -11
  131. package/tests/utility.html +19 -0
  132. package/src/images/backgrounds/nav-parent-open.svg +0 -3
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.a02c81d72 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.ae765cd84 | 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() :
@@ -383,12 +383,8 @@
383
383
  }
384
384
 
385
385
  function closest(element, selector) {
386
- if (startsWith(selector, '>')) {
387
- selector = selector.slice(1);
388
- }
389
-
390
386
  return isElement(element) ?
391
- element.closest(selector) :
387
+ element.closest(startsWith(selector, '>') ? selector.slice(1) : selector) :
392
388
  toNodes(element).
393
389
  map((element) => closest(element, selector)).
394
390
  filter(Boolean);
@@ -396,8 +392,8 @@
396
392
 
397
393
  function within(element, selector) {
398
394
  return isString(selector) ?
399
- matches(element, selector) || !!closest(element, selector) :
400
- element === selector || toNode(selector).contains(toNode(element));
395
+ !!closest(element, selector) :
396
+ toNode(selector).contains(toNode(element));
401
397
  }
402
398
 
403
399
  function parents(element, selector) {
@@ -785,18 +781,11 @@
785
781
  return elements[0];
786
782
  }
787
783
 
788
- const propertyRe = /^\s*(["'])?(.*?)\1\s*$/;
789
- function getCssVar(name, element) {if (element === void 0) {element = document.documentElement;}
790
- return css(element, "--uk-" + name).replace(propertyRe, '$2');
791
- }
792
-
793
784
  // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
794
785
  const propName = memoize((name) => vendorPropName(name));
795
786
 
796
- const cssPrefixes = ['webkit', 'moz'];
797
-
798
787
  function vendorPropName(name) {
799
- if (name[0] === '-') {
788
+ if (startsWith(name, '--')) {
800
789
  return name;
801
790
  }
802
791
 
@@ -808,11 +797,8 @@
808
797
  return name;
809
798
  }
810
799
 
811
- let i = cssPrefixes.length,
812
- prefixedName;
813
-
814
- while (i--) {
815
- prefixedName = "-" + cssPrefixes[i] + "-" + name;
800
+ for (const prefix of ['webkit', 'moz']) {
801
+ const prefixedName = "-" + prefix + "-" + name;
816
802
  if (prefixedName in style) {
817
803
  return prefixedName;
818
804
  }
@@ -913,13 +899,14 @@
913
899
  const Transition = {
914
900
  start: transition,
915
901
 
916
- stop(element) {
902
+ async stop(element) {
917
903
  trigger(element, 'transitionend');
918
- return Promise.resolve();
904
+ await Promise.resolve();
919
905
  },
920
906
 
921
- cancel(element) {
907
+ async cancel(element) {
922
908
  trigger(element, 'transitioncanceled');
909
+ await Promise.resolve();
923
910
  },
924
911
 
925
912
  inProgress(element) {
@@ -929,7 +916,7 @@
929
916
 
930
917
  const animationPrefix = 'uk-animation-';
931
918
 
932
- function animate$1(element, animation, duration, origin, out) {if (duration === void 0) {duration = 200;}
919
+ function animate$2(element, animation, duration, origin, out) {if (duration === void 0) {duration = 200;}
933
920
  return Promise.all(
934
921
  toNodes(element).map(
935
922
  (element) =>
@@ -965,10 +952,10 @@
965
952
 
966
953
  const inProgress = new RegExp(animationPrefix + "(enter|leave)");
967
954
  const Animation = {
968
- in: animate$1,
955
+ in: animate$2,
969
956
 
970
957
  out(element, animation, duration, origin) {
971
- return animate$1(element, animation, duration, origin, true);
958
+ return animate$2(element, animation, duration, origin, true);
972
959
  },
973
960
 
974
961
  inProgress(element) {
@@ -1899,12 +1886,10 @@
1899
1886
  function offsetViewport(scrollElement) {
1900
1887
  const window = toWindow(scrollElement);
1901
1888
  const {
1902
- document: { body, documentElement } } =
1889
+ document: { documentElement } } =
1903
1890
  window;
1904
1891
  let viewportElement =
1905
- scrollElement === scrollingElement(scrollElement) || scrollElement === body ?
1906
- window :
1907
- scrollElement;
1892
+ scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1908
1893
 
1909
1894
  const { visualViewport } = window;
1910
1895
  if (isWindow(viewportElement) && visualViewport) {
@@ -1923,7 +1908,7 @@
1923
1908
  // iOS 12 returns <body> as scrollingElement
1924
1909
  viewportElement = documentElement;
1925
1910
  } else {
1926
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1911
+ rect[start] += toFloat(css(viewportElement, "border-" + start + "-width"));
1927
1912
  }
1928
1913
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1929
1914
  rect[end] = rect[prop] + rect[start];
@@ -1948,126 +1933,65 @@
1948
1933
  ...options.attach },
1949
1934
 
1950
1935
  offset: [0, 0],
1936
+ placement: [],
1951
1937
  ...options };
1952
1938
 
1953
1939
 
1954
- const dim = options.flip ?
1955
- attachToWithFlip(element, target, options) :
1956
- attachTo(element, target, options);
1957
-
1958
- offset(element, dim);
1959
- }
1960
-
1961
- function attachTo(element, target, options) {
1962
- let { attach, offset: offsetBy } = {
1963
- attach: {
1964
- element: ['left', 'top'],
1965
- target: ['left', 'top'],
1966
- ...options.attach },
1967
-
1968
- offset: [0, 0],
1969
- ...options };
1970
-
1971
-
1972
- const position = offset(element);
1973
- const targetOffset = offset(target);
1974
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1975
- position[start] = position[dir] =
1976
- targetOffset[start] +
1977
- moveBy(attach.target[i], end, targetOffset[prop]) -
1978
- moveBy(attach.element[i], end, position[prop]) +
1979
- +offsetBy[i];
1980
- position[end] = position[start] + position[prop];
1940
+ if (!isArray(target)) {
1941
+ target = [target, target];
1981
1942
  }
1982
- return position;
1983
- }
1984
1943
 
1985
- function moveBy(start, end, dim) {
1986
- return start === 'center' ? dim / 2 : start === end ? dim : 0;
1944
+ offset(element, getPosition(element, target, options));
1987
1945
  }
1988
1946
 
1989
- function attachToWithFlip(element, target, options) {
1947
+ function getPosition(element, target, options) {
1990
1948
  const position = attachTo(element, target, options);
1991
- const targetDim = offset(target);
1992
1949
 
1993
1950
  let {
1994
- flip,
1995
1951
  attach: { element: elAttach, target: targetAttach },
1996
1952
  offset: elOffset,
1997
1953
  boundary,
1998
- viewport,
1999
- viewportOffset } =
1954
+ viewportOffset,
1955
+ placement } =
2000
1956
  options;
2001
1957
 
2002
- let viewports = scrollParents(element);
2003
- if (boundary === target) {
2004
- viewports = viewports.filter((viewport) => viewport !== boundary);
2005
- }
2006
- const [scrollElement] = viewports;
2007
- viewports.push(viewport);
2008
-
2009
- const offsetPosition = { ...position };
2010
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2011
- if (flip !== true && !includes(flip, dir)) {
2012
- continue;
2013
- }
2014
-
2015
- const willFlip =
2016
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
1958
+ let offsetPosition = position;
1959
+ for (const [i, [prop,, start, end]] of Object.entries(dirs)) {
1960
+ let viewports = scrollParents(target[i]);
1961
+ const [scrollElement] = viewports;
2017
1962
 
2018
- viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1963
+ let viewport = getIntersectionArea(...viewports.map(offsetViewport));
2019
1964
 
2020
1965
  if (viewportOffset) {
2021
1966
  viewport[start] += viewportOffset;
2022
1967
  viewport[end] -= viewportOffset;
2023
1968
  }
2024
1969
 
2025
- if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2026
- viewport = getIntersectionArea(viewport, offset(boundary));
1970
+ if (boundary) {
1971
+ viewport = getIntersectionArea(viewport, offsetViewport(boundary));
2027
1972
  }
2028
1973
 
2029
- const isInStartBoundary = position[start] >= viewport[start];
2030
- const isInEndBoundary = position[end] <= viewport[end];
1974
+ const isInStartViewport = position[start] >= viewport[start];
1975
+ const isInEndViewport = position[end] <= viewport[end];
2031
1976
 
2032
- if (isInStartBoundary && isInEndBoundary) {
1977
+ if (isInStartViewport && isInEndViewport) {
2033
1978
  continue;
2034
1979
  }
2035
1980
 
2036
- let offsetBy;
1981
+ let offsetBy = 0;
2037
1982
 
2038
1983
  // Flip
2039
- if (willFlip) {
1984
+ if (placement[i] === 'flip') {
2040
1985
  if (
2041
- elAttach[i] === end && isInStartBoundary ||
2042
- elAttach[i] === start && isInEndBoundary)
1986
+ targetAttach[i] === end && isInEndViewport ||
1987
+ targetAttach[i] === start && isInStartViewport)
2043
1988
  {
2044
1989
  continue;
2045
1990
  }
2046
1991
 
2047
- offsetBy =
2048
- (elAttach[i] === start ?
2049
- -position[prop] :
2050
- elAttach[i] === end ?
2051
- position[prop] :
2052
- 0) + (
2053
- targetAttach[i] === start ?
2054
- targetDim[prop] :
2055
- targetAttach[i] === end ?
2056
- -targetDim[prop] :
2057
- 0) -
2058
- elOffset[i] * 2;
2059
-
2060
- if (
2061
- !isInScrollArea(
2062
- {
2063
- ...position,
2064
- [start]: position[start] + offsetBy,
2065
- [end]: position[end] + offsetBy },
1992
+ offsetBy = flip(element, target, options, i)[start] - position[start];
2066
1993
 
2067
- scrollElement,
2068
- i))
2069
-
2070
- {
1994
+ if (!isInScrollArea(applyOffset(position, offsetBy, i), scrollElement, i)) {
2071
1995
  if (isInScrollArea(position, scrollElement, i)) {
2072
1996
  continue;
2073
1997
  }
@@ -2076,27 +2000,27 @@
2076
2000
  return false;
2077
2001
  }
2078
2002
 
2079
- if (flip === true || includes(flip, dirs[1 - i][1])) {
2080
- const newPos = attachToWithFlip(element, target, {
2081
- ...options,
2082
- attach: {
2083
- element: elAttach.map(flipDir).reverse(),
2084
- target: targetAttach.map(flipDir).reverse() },
2003
+ const newPos = getPosition(element, target, {
2004
+ ...options,
2005
+ attach: {
2006
+ element: elAttach.map(flipAxis).reverse(),
2007
+ target: targetAttach.map(flipAxis).reverse() },
2085
2008
 
2086
- offset: elOffset.reverse(),
2087
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2088
- recursion: true });
2009
+ offset: elOffset.reverse(),
2010
+ placement: placement.reverse(),
2011
+ recursion: true });
2089
2012
 
2090
2013
 
2091
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2092
- return newPos;
2093
- }
2014
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2015
+ return newPos;
2094
2016
  }
2017
+
2095
2018
  continue;
2096
2019
  }
2097
2020
 
2098
- // Move
2099
- } else {
2021
+ // Shift
2022
+ } else if (placement[i] === 'shift') {
2023
+ const targetDim = offset(target[i]);
2100
2024
  offsetBy =
2101
2025
  clamp(
2102
2026
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2105,13 +2029,54 @@
2105
2029
  position[start];
2106
2030
  }
2107
2031
 
2108
- offsetPosition[start] = position[dir] = position[start] + offsetBy;
2109
- offsetPosition[end] += offsetBy;
2032
+ offsetPosition = applyOffset(offsetPosition, offsetBy, i);
2110
2033
  }
2111
2034
 
2112
2035
  return offsetPosition;
2113
2036
  }
2114
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
+
2115
2080
  function getIntersectionArea() {
2116
2081
  let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2117
2082
  for (const rect of rects) {
@@ -2132,12 +2097,32 @@
2132
2097
  return position[start] >= viewport[start] && position[end] <= viewport[end];
2133
2098
  }
2134
2099
 
2135
- function intersectLine(dimA, dimB, dir) {
2136
- const [,, start, end] = dirs[dir];
2137
- return dimA[end] > dimB[start] && dimB[end] > dimA[start];
2100
+ function flip(element, target, _ref, i) {let { offset, attach } = _ref;
2101
+ return attachTo(element, target, {
2102
+ attach: {
2103
+ element: flipAttach(attach.element, i),
2104
+ target: flipAttach(attach.target, i) },
2105
+
2106
+ offset: flipOffset(offset, i) });
2107
+
2138
2108
  }
2139
2109
 
2140
- function flipDir(prop) {
2110
+ function flipAttach(attach, i) {
2111
+ const newAttach = [...attach];
2112
+ const index = dirs[i].indexOf(attach[i]);
2113
+ if (~index) {
2114
+ newAttach[i] = dirs[i][1 - index % 2 + 2];
2115
+ }
2116
+ return newAttach;
2117
+ }
2118
+
2119
+ function flipOffset(offset, i) {
2120
+ offset = [...offset];
2121
+ offset[i] *= -1;
2122
+ return offset;
2123
+ }
2124
+
2125
+ function flipAxis(prop) {
2141
2126
  for (let i = 0; i < dirs.length; i++) {
2142
2127
  const index = dirs[i].indexOf(prop);
2143
2128
  if (~index) {
@@ -2152,7 +2137,7 @@
2152
2137
  getImage: getImage,
2153
2138
  transition: transition,
2154
2139
  Transition: Transition,
2155
- animate: animate$1,
2140
+ animate: animate$2,
2156
2141
  Animation: Animation,
2157
2142
  attr: attr,
2158
2143
  hasAttr: hasAttr,
@@ -2282,7 +2267,6 @@
2282
2267
  findAll: findAll,
2283
2268
  escape: escape,
2284
2269
  css: css,
2285
- getCssVar: getCssVar,
2286
2270
  propName: propName,
2287
2271
  isInView: isInView,
2288
2272
  scrollIntoView: scrollIntoView,
@@ -2607,7 +2591,7 @@
2607
2591
 
2608
2592
  value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2609
2593
 
2610
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2594
+ if (prop === 'target' && startsWith(value, '_')) {
2611
2595
  continue;
2612
2596
  }
2613
2597
 
@@ -2618,7 +2602,7 @@
2618
2602
 
2619
2603
  for (const key in options) {
2620
2604
  const prop = camelize(key);
2621
- if (props[prop] !== undefined) {
2605
+ if (!isUndefined(props[prop])) {
2622
2606
  data$1[prop] = coerce$1(props[prop], options[key]);
2623
2607
  }
2624
2608
  }
@@ -2947,7 +2931,7 @@
2947
2931
  UIkit.data = '__uikit__';
2948
2932
  UIkit.prefix = 'uk-';
2949
2933
  UIkit.options = {};
2950
- UIkit.version = '3.14.4-dev.a02c81d72';
2934
+ UIkit.version = '3.14.4-dev.ae765cd84';
2951
2935
 
2952
2936
  globalAPI(UIkit);
2953
2937
  hooksAPI(UIkit);
@@ -3052,27 +3036,7 @@
3052
3036
  origin: false,
3053
3037
  transition: 'ease',
3054
3038
  clsEnter: 'uk-togglabe-enter',
3055
- clsLeave: 'uk-togglabe-leave',
3056
-
3057
- initProps: {
3058
- overflow: '',
3059
- maxHeight: '',
3060
- paddingTop: '',
3061
- paddingBottom: '',
3062
- marginTop: '',
3063
- marginBottom: '',
3064
- boxShadow: '' },
3065
-
3066
-
3067
- hideProps: {
3068
- overflow: 'hidden',
3069
- maxHeight: 0,
3070
- paddingTop: 0,
3071
- paddingBottom: 0,
3072
- marginTop: 0,
3073
- marginBottom: 0,
3074
- boxShadow: 'none' } },
3075
-
3039
+ clsLeave: 'uk-togglabe-leave' },
3076
3040
 
3077
3041
 
3078
3042
  computed: {
@@ -3081,7 +3045,7 @@
3081
3045
  },
3082
3046
 
3083
3047
  hasTransition(_ref2) {let { animation } = _ref2;
3084
- return startsWith(animation[0], 'slide');
3048
+ return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
3085
3049
  } },
3086
3050
 
3087
3051
 
@@ -3174,130 +3138,97 @@
3174
3138
  };
3175
3139
  }
3176
3140
 
3177
- function toggleTransition(cmp) {
3178
- switch (cmp.animation[0]) {
3179
- case 'slide-left':
3180
- return slideHorizontal(cmp);
3181
- case 'slide-right':
3182
- return slideHorizontal(cmp, true);}
3183
-
3184
- return slide$1(cmp);
3185
- }
3186
-
3187
- function slide$1(_ref4)
3188
-
3189
-
3141
+ function toggleTransition(cmp) {var _cmp$animation$;
3142
+ const [mode = 'reveal', startProp = 'top'] = ((_cmp$animation$ = cmp.animation[0]) == null ? void 0 : _cmp$animation$.split('-')) || [];
3190
3143
 
3144
+ const dirs = [
3145
+ ['left', 'right'],
3146
+ ['top', 'bottom']];
3191
3147
 
3148
+ const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];
3149
+ const end = dir[1] === startProp;
3150
+ const props = ['width', 'height'];
3151
+ const dimProp = props[dirs.indexOf(dir)];
3152
+ const marginProp = "margin-" + dir[0];
3153
+ const marginStartProp = "margin-" + startProp;
3192
3154
 
3155
+ return async (el, show) => {
3156
+ let { duration, velocity, transition, _toggle } = cmp;
3193
3157
 
3158
+ let currentDim = dimensions$1(el)[dimProp];
3194
3159
 
3195
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3196
- return (el, show) => {
3197
3160
  const inProgress = Transition.inProgress(el);
3198
- const inner =
3199
- !inProgress && el.hasChildNodes() ?
3200
- toFloat(css(el.firstElementChild, 'marginTop')) +
3201
- toFloat(css(el.lastElementChild, 'marginBottom')) :
3202
- 0;
3203
- const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3204
-
3205
- const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3206
-
3207
- Transition.cancel(el);
3161
+ await Transition.cancel(el);
3208
3162
 
3209
- if (!isToggled(el)) {
3163
+ if (show) {
3210
3164
  _toggle(el, true);
3211
3165
  }
3212
3166
 
3213
- css(el, 'maxHeight', '');
3214
-
3215
- // Update child components first
3216
- fastdom.flush();
3217
-
3218
- const endHeight = toFloat(css(el, 'height')) + inner;
3219
- duration = velocity * endHeight + duration;
3220
-
3221
- css(el, { ...props, maxHeight: currentHeight });
3222
-
3223
- return (
3224
- show ?
3225
- Transition.start(
3226
- el,
3227
- { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3228
- duration * (1 - currentHeight / endHeight),
3229
- transition) :
3230
-
3231
- Transition.start(
3232
- el,
3233
- hideProps,
3234
- duration * (currentHeight / endHeight),
3235
- transition).
3236
- then(() => _toggle(el, false))).
3237
- then(() => css(el, initProps));
3238
- };
3239
- }
3167
+ const prevProps = Object.fromEntries(
3168
+ ['padding', 'border', 'width', 'height', 'overflow', marginProp, marginStartProp].map(
3169
+ (key) => [key, el.style[key]]));
3240
3170
 
3241
- function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3242
- return (el, show) => {
3243
- const visible = isVisible(el);
3244
- const marginLeft = toFloat(css(el, 'marginLeft'));
3245
3171
 
3246
- Transition.cancel(el);
3247
3172
 
3248
- const [scrollElement] = scrollParents(el);
3249
- css(scrollElement, 'overflowX', 'hidden');
3173
+ const dim = dimensions$1(el);
3174
+ const currentMargin = toFloat(css(el, marginProp));
3175
+ const marginStart = toFloat(css(el, marginStartProp));
3176
+ const endDim = dim[dimProp] + marginStart;
3250
3177
 
3251
- if (!isToggled(el)) {
3252
- _toggle(el, true);
3178
+ if (!inProgress && !show) {
3179
+ currentDim += marginStart;
3253
3180
  }
3254
3181
 
3255
- const width = toFloat(css(el, 'width'));
3256
- duration = velocity * width + duration;
3182
+ const [wrapper] = wrapInner(el, '<div>');
3183
+ css(wrapper, {
3184
+ boxSizing: 'border-box',
3185
+ height: dim.height,
3186
+ width: dim.width,
3187
+ ...css(el, [
3188
+ 'padding',
3189
+ 'borderTop',
3190
+ 'borderRight',
3191
+ 'borderBottom',
3192
+ 'borderLeft',
3193
+ 'borderImage',
3194
+ marginStartProp]) });
3257
3195
 
3258
- const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3259
- const offsetEl = offset(el);
3260
- const useClipPath = right ?
3261
- offsetEl.right < scrollElement.clientWidth :
3262
- Math.round(offsetEl.left) > 0;
3263
3196
 
3264
- css(el, {
3265
- clipPath: useClipPath ?
3266
- right ? "polygon(0 0," +
3267
- percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3268
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
3269
- '',
3270
- marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3271
3197
 
3198
+ css(el, {
3199
+ padding: 0,
3200
+ border: 0,
3201
+ [marginStartProp]: 0,
3202
+ width: dim.width,
3203
+ height: dim.height,
3204
+ overflow: 'hidden',
3205
+ [dimProp]: currentDim });
3272
3206
 
3273
- return (
3274
- show ?
3275
- Transition.start(
3276
- el,
3277
- {
3278
- clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
3279
- marginLeft: 0 },
3280
3207
 
3281
- duration * (1 - percent / 100),
3282
- transition) :
3208
+ const percent = currentDim / endDim;
3209
+ duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
3210
+ const endProps = { [dimProp]: show ? endDim : 0 };
3283
3211
 
3284
- Transition.start(
3285
- el,
3286
- {
3287
- clipPath: useClipPath ?
3288
- right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
3212
+ if (end) {
3213
+ css(el, marginProp, endDim - currentDim + currentMargin);
3214
+ endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
3215
+ }
3289
3216
 
3217
+ if (!end ^ mode === 'reveal') {
3218
+ css(wrapper, marginProp, -endDim + currentDim);
3219
+ Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
3220
+ }
3290
3221
 
3291
- '',
3292
- marginLeft: (right ? 1 : -1) * width },
3222
+ try {
3223
+ await Transition.start(el, endProps, duration, transition);
3224
+ } finally {
3225
+ css(el, prevProps);
3226
+ unwrap(wrapper.firstChild);
3293
3227
 
3294
- duration * (percent / 100),
3295
- transition).
3296
- then(() => _toggle(el, false))).
3297
- then(() => {
3298
- css(scrollElement, 'overflowX', '');
3299
- css(el, { clipPath: '', marginLeft: '' });
3300
- });
3228
+ if (!show) {
3229
+ _toggle(el, false);
3230
+ }
3231
+ }
3301
3232
  };
3302
3233
  }
3303
3234
 
@@ -3322,6 +3253,7 @@
3322
3253
  mixins: [Class, Lazyload, Togglable],
3323
3254
 
3324
3255
  props: {
3256
+ animation: Boolean,
3325
3257
  targets: String,
3326
3258
  active: null,
3327
3259
  collapsible: Boolean,
@@ -3334,7 +3266,7 @@
3334
3266
  data: {
3335
3267
  targets: '> *',
3336
3268
  active: false,
3337
- animation: ['slide'],
3269
+ animation: true,
3338
3270
  collapsible: true,
3339
3271
  multiple: false,
3340
3272
  clsOpen: 'uk-open',
@@ -3380,7 +3312,7 @@
3380
3312
  hide(
3381
3313
  el,
3382
3314
  !hasClass(
3383
- this.items.find((item) => item.contains(el)),
3315
+ this.items.find((item) => within(el, item)),
3384
3316
  this.clsOpen));
3385
3317
 
3386
3318
 
@@ -3432,23 +3364,15 @@
3432
3364
  toggleClass(el, this.clsOpen, show);
3433
3365
  attr($(this.$props.toggle, el), 'aria-expanded', show);
3434
3366
 
3435
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3367
+ const content = $(this.content, el);
3436
3368
 
3437
- if (animate === false || !this.hasTransition) {
3369
+ if (animate === false || !this.animation) {
3370
+ content.hidden = !show;
3438
3371
  hide(content, !show);
3439
3372
  return;
3440
3373
  }
3441
3374
 
3442
- if (!el._wrapper) {
3443
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3444
- }
3445
-
3446
- hide(content, false);
3447
- await slide$1(this)(el._wrapper, show);
3448
- hide(content, !show);
3449
-
3450
- delete el._wrapper;
3451
- unwrap(content);
3375
+ await toggleTransition(this)(content, show);
3452
3376
 
3453
3377
  if (show) {
3454
3378
  const toggle = $(this.$props.toggle, el);
@@ -3474,18 +3398,17 @@
3474
3398
  args: 'animation',
3475
3399
 
3476
3400
  props: {
3401
+ animation: Boolean,
3477
3402
  close: String },
3478
3403
 
3479
3404
 
3480
3405
  data: {
3481
- animation: ['slide'],
3406
+ animation: true,
3482
3407
  selClose: '.uk-alert-close',
3483
- duration: 150,
3484
- hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3408
+ duration: 150 },
3485
3409
 
3486
3410
 
3487
- events: [
3488
- {
3411
+ events: {
3489
3412
  name: 'click',
3490
3413
 
3491
3414
  delegate() {
@@ -3495,16 +3418,39 @@
3495
3418
  handler(e) {
3496
3419
  e.preventDefault();
3497
3420
  this.close();
3498
- } }],
3499
-
3421
+ } },
3500
3422
 
3501
3423
 
3502
3424
  methods: {
3503
3425
  async close() {
3504
- await this.toggleElement(this.$el);
3426
+ await this.toggleElement(this.$el, false, animate$1(this));
3505
3427
  this.$destroy(true);
3506
3428
  } } };
3507
3429
 
3430
+
3431
+
3432
+ function animate$1(_ref) {let { duration, transition, velocity } = _ref;
3433
+ return (el) => {
3434
+ const height = toFloat(css(el, 'height'));
3435
+ css(el, 'height', height);
3436
+ return Transition.start(
3437
+ el,
3438
+ {
3439
+ height: 0,
3440
+ marginTop: 0,
3441
+ marginBottom: 0,
3442
+ paddingTop: 0,
3443
+ paddingBottom: 0,
3444
+ borderTop: 0,
3445
+ borderBottom: 0,
3446
+ opacity: 0 },
3447
+
3448
+ velocity * height + duration,
3449
+ transition);
3450
+
3451
+ };
3452
+ }
3453
+
3508
3454
  var Video = {
3509
3455
  args: 'autoplay',
3510
3456
 
@@ -3653,13 +3599,17 @@
3653
3599
  props: {
3654
3600
  pos: String,
3655
3601
  offset: null,
3656
- flip: Boolean },
3602
+ flip: Boolean,
3603
+ shift: Boolean,
3604
+ inset: Boolean },
3657
3605
 
3658
3606
 
3659
3607
  data: {
3660
3608
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3609
+ offset: false,
3661
3610
  flip: true,
3662
- offset: false },
3611
+ shift: true,
3612
+ inset: false },
3663
3613
 
3664
3614
 
3665
3615
  connected() {
@@ -3671,17 +3621,19 @@
3671
3621
  methods: {
3672
3622
  positionAt(element, target, boundary) {
3673
3623
  let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3624
+ const placement = [this.flip && 'flip', this.shift && 'shift'];
3674
3625
 
3675
3626
  const attach = {
3676
- element: [flipPosition(this.dir), this.align],
3627
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3677
3628
  target: [this.dir, this.align] };
3678
3629
 
3679
3630
 
3680
3631
  if (this.axis === 'y') {
3681
3632
  for (const prop in attach) {
3682
- attach[prop] = attach[prop].reverse();
3633
+ attach[prop].reverse();
3683
3634
  }
3684
- offset = offset.reverse();
3635
+ offset.reverse();
3636
+ placement.reverse();
3685
3637
  }
3686
3638
 
3687
3639
  const [scrollElement] = scrollParents(element, /auto|scroll/);
@@ -3691,22 +3643,14 @@
3691
3643
  const elDim = dimensions$1(element);
3692
3644
  css(element, { top: -elDim.height, left: -elDim.width });
3693
3645
 
3694
- const args = [
3695
- element,
3696
- target,
3697
- {
3646
+ positionAt(element, target, {
3698
3647
  attach,
3699
3648
  offset,
3700
3649
  boundary,
3701
- flip: this.flip,
3702
- viewportOffset: this.getViewportOffset(element) }];
3703
-
3650
+ placement,
3651
+ viewportOffset: this.getViewportOffset(element) });
3704
3652
 
3705
3653
 
3706
- trigger(element, 'beforeposition', args);
3707
-
3708
- positionAt(...args);
3709
-
3710
3654
  // Restore scroll position
3711
3655
  scrollElement.scrollTop = scrollTop;
3712
3656
  scrollElement.scrollLeft = scrollLeft;
@@ -3715,27 +3659,38 @@
3715
3659
  getPositionOffset(element) {
3716
3660
  return (
3717
3661
  toPx(
3718
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3662
+ this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3719
3663
  this.axis === 'x' ? 'width' : 'height',
3720
3664
  element) * (
3721
- includes(['left', 'top'], this.dir) ? -1 : 1));
3665
+
3666
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3667
+ this.inset ? -1 : 1));
3722
3668
 
3723
3669
  },
3724
3670
 
3725
3671
  getShiftOffset(element) {
3726
- return includes(['center', 'justify', 'stretch'], this.align) ?
3672
+ return this.align === 'center' ?
3727
3673
  0 :
3728
3674
  toPx(
3729
- getCssVar('position-shift-offset', element),
3675
+ css(element, '--uk-position-shift-offset'),
3730
3676
  this.axis === 'y' ? 'width' : 'height',
3731
3677
  element) * (
3732
3678
  includes(['left', 'top'], this.align) ? 1 : -1);
3733
3679
  },
3734
3680
 
3735
3681
  getViewportOffset(element) {
3736
- return toPx(getCssVar('position-viewport-offset', element));
3682
+ return toPx(css(element, '--uk-position-viewport-offset'));
3737
3683
  } } };
3738
3684
 
3685
+ var Style = {
3686
+ beforeConnect() {
3687
+ this._style = attr(this.$el, 'style');
3688
+ },
3689
+
3690
+ disconnected() {
3691
+ attr(this.$el, 'style', this._style);
3692
+ } };
3693
+
3739
3694
  const active$1 = [];
3740
3695
 
3741
3696
  var Modal = {
@@ -3845,8 +3800,8 @@
3845
3800
 
3846
3801
 
3847
3802
  if (this.overlay) {
3848
- once(this.$el, 'hide', preventOverscroll(this.$el));
3849
- once(this.$el, 'hide', preventBackgroundScroll());
3803
+ once(this.$el, 'hidden', preventOverscroll(this.$el));
3804
+ once(this.$el, 'hidden', preventBackgroundScroll());
3850
3805
  }
3851
3806
 
3852
3807
  if (this.stack) {
@@ -3928,10 +3883,6 @@
3928
3883
  active$1.splice(active$1.indexOf(this), 1);
3929
3884
  }
3930
3885
 
3931
- if (!active$1.length) {
3932
- css(document.body, 'overflowY', '');
3933
- }
3934
-
3935
3886
  css(this.$el, 'zIndex', '');
3936
3887
 
3937
3888
  if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
@@ -4048,7 +3999,12 @@
4048
3999
  return () => events.forEach((fn) => fn());
4049
4000
  }
4050
4001
 
4002
+ let prevented;
4051
4003
  function preventBackgroundScroll() {
4004
+ if (prevented) {
4005
+ return noop;
4006
+ }
4007
+ prevented = true;
4052
4008
  const { body, documentElement } = document;
4053
4009
  css(body, {
4054
4010
  overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
@@ -4056,6 +4012,7 @@
4056
4012
 
4057
4013
  css(documentElement, 'overflowY', 'hidden');
4058
4014
  return () => {
4015
+ prevented = false;
4059
4016
  css(documentElement, 'overflowY', '');
4060
4017
  css(body, { overflowY: '', touchAction: '' });
4061
4018
  };
@@ -4074,7 +4031,7 @@
4074
4031
  let active;
4075
4032
 
4076
4033
  var drop = {
4077
- mixins: [Container, Lazyload, Position, Togglable],
4034
+ mixins: [Container, Lazyload, Position, Style, Togglable],
4078
4035
 
4079
4036
  args: 'pos',
4080
4037
 
@@ -4082,7 +4039,10 @@
4082
4039
  mode: 'list',
4083
4040
  toggle: Boolean,
4084
4041
  boundary: Boolean,
4085
- boundaryAlign: Boolean,
4042
+ target: Boolean,
4043
+ targetX: Boolean,
4044
+ targetY: Boolean,
4045
+ stretch: Boolean,
4086
4046
  delayShow: Number,
4087
4047
  delayHide: Number,
4088
4048
  display: String,
@@ -4094,17 +4054,32 @@
4094
4054
  data: {
4095
4055
  mode: ['click', 'hover'],
4096
4056
  toggle: '- *',
4097
- boundary: true,
4098
- boundaryAlign: false,
4057
+ boundary: false,
4058
+ target: false,
4059
+ targetX: false,
4060
+ targetY: false,
4061
+ stretch: false,
4099
4062
  delayShow: 0,
4100
4063
  delayHide: 800,
4101
4064
  display: null,
4102
4065
  clsDrop: false,
4066
+ animateOut: false,
4067
+ bgScroll: true,
4103
4068
  animation: ['uk-animation-fade'],
4104
4069
  cls: 'uk-open',
4105
- container: false,
4106
- animateOut: false,
4107
- bgScroll: true },
4070
+ container: false },
4071
+
4072
+
4073
+ computed: {
4074
+ target(_ref, $el) {let { target, targetX, targetY } = _ref;
4075
+ targetX = targetX || target || this.targetEl;
4076
+ targetY = targetY || target || this.targetEl;
4077
+
4078
+ return [
4079
+ targetX === true ? window : query(targetX, $el),
4080
+ targetY === true ? window : query(targetY, $el)];
4081
+
4082
+ } },
4108
4083
 
4109
4084
 
4110
4085
  created() {
@@ -4118,13 +4093,13 @@
4118
4093
  connected() {
4119
4094
  addClass(this.$el, this.clsDrop);
4120
4095
 
4121
- if (this.toggle && !this.target) {
4122
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
4096
+ if (this.toggle && !this.targetEl) {
4097
+ this.targetEl = this.$create('toggle', query(this.toggle, this.$el), {
4123
4098
  target: this.$el,
4124
4099
  mode: this.mode }).
4125
4100
  $el;
4126
- attr(this.target, 'aria-haspopup', true);
4127
- this.lazyload(this.target);
4101
+ attr(this.targetEl, 'aria-haspopup', true);
4102
+ this.lazyload(this.targetEl);
4128
4103
  }
4129
4104
  },
4130
4105
 
@@ -4155,7 +4130,7 @@
4155
4130
  return 'a[href^="#"]';
4156
4131
  },
4157
4132
 
4158
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4133
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4159
4134
  if (!defaultPrevented && hash && !within(hash, this.$el)) {
4160
4135
  this.hide(false);
4161
4136
  }
@@ -4267,17 +4242,17 @@
4267
4242
  on(
4268
4243
  document,
4269
4244
  pointerDown$1,
4270
- (_ref2) => {let { target } = _ref2;return (
4245
+ (_ref3) => {let { target } = _ref3;return (
4271
4246
  !within(target, this.$el) &&
4272
4247
  once(
4273
4248
  document,
4274
4249
  pointerUp$1 + " " + pointerCancel + " scroll",
4275
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4250
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
4276
4251
  if (
4277
4252
  !defaultPrevented &&
4278
4253
  type === pointerUp$1 &&
4279
4254
  target === newTarget &&
4280
- !(this.target && within(target, this.target)))
4255
+ !(this.targetEl && within(target, this.targetEl)))
4281
4256
  {
4282
4257
  this.hide(false);
4283
4258
  }
@@ -4296,13 +4271,13 @@
4296
4271
  [] :
4297
4272
  [preventOverscroll(this.$el), preventBackgroundScroll()]),
4298
4273
 
4299
- ...(this.display === 'static' && this.align !== 'stretch' ?
4274
+ ...(this.display === 'static' ?
4300
4275
  [] :
4301
4276
  (() => {
4302
4277
  const handler = () => this.$emit();
4303
4278
  return [
4304
4279
  on(window, 'resize', handler),
4305
- on(document, 'scroll', handler, true),
4280
+ on([document, scrollParents(this.$el)], 'scroll', handler),
4306
4281
  (() => {
4307
4282
  const observer = observeResize(
4308
4283
  scrollParents(this.$el),
@@ -4331,7 +4306,7 @@
4331
4306
  {
4332
4307
  name: 'hide',
4333
4308
 
4334
- handler(_ref4) {let { target } = _ref4;
4309
+ handler(_ref5) {let { target } = _ref5;
4335
4310
  if (this.$el !== target) {
4336
4311
  active =
4337
4312
  active === null && within(target, this.$el) && this.isToggled() ?
@@ -4355,12 +4330,12 @@
4355
4330
 
4356
4331
 
4357
4332
  methods: {
4358
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4359
- if (this.isToggled() && target && this.target && target !== this.target) {
4333
+ show(target, delay) {if (target === void 0) {target = this.targetEl;}if (delay === void 0) {delay = true;}
4334
+ if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {
4360
4335
  this.hide(false, false);
4361
4336
  }
4362
4337
 
4363
- this.target = target;
4338
+ this.targetEl = target;
4364
4339
 
4365
4340
  this.clearTimers();
4366
4341
 
@@ -4423,60 +4398,69 @@
4423
4398
 
4424
4399
  position() {
4425
4400
  removeClass(this.$el, this.clsDrop + "-stack");
4426
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4427
- toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4401
+ attr(this.$el, 'style', this._style);
4428
4402
 
4429
- const boundary = query(this.boundary, this.$el);
4430
- const target = boundary && this.boundaryAlign ? boundary : this.target;
4431
- const [scrollParent] = scrollParents(
4432
- boundary && this.boundaryAlign ? boundary : this.$el);
4403
+ // Ensure none positioned element does not generate scrollbars
4404
+ this.$el.hidden = true;
4433
4405
 
4434
- const scrollParentOffset = offset(scrollParent);
4435
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4406
+ const boundary = query(this.boundary, this.$el);
4407
+ const boundaryOffset = offsetViewport(boundary || window);
4408
+ const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4436
4409
  const viewportOffset = this.getViewportOffset(this.$el);
4437
4410
 
4438
- css(this.$el, 'maxWidth', '');
4439
- const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4411
+ const dirs = [
4412
+ [0, ['x', 'width', 'left', 'right']],
4413
+ [1, ['y', 'height', 'top', 'bottom']]];
4440
4414
 
4441
- if (this.align === 'justify') {
4442
- const prop = this.axis === 'y' ? 'width' : 'height';
4443
- css(
4444
- this.$el,
4445
- prop,
4446
- Math.min(
4447
- (boundary ? boundaryOffset : offset(this.target))[prop],
4448
- scrollParentOffset[prop] - 2 * viewportOffset));
4449
-
4450
-
4451
- } else if (this.align === 'stretch') {
4452
- this.flip = this.axis === 'y' ? 'x' : 'y';
4453
- this.display = 'static';
4454
-
4455
- const viewport = offsetViewport(scrollParent);
4456
- const targetDim = offset(target);
4457
- const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4458
-
4459
- css(this.$el, {
4460
- width:
4461
- this.axis === 'y' ?
4462
- viewport.width :
4463
- (this.dir === 'left' ?
4464
- targetDim.left - viewport.left :
4465
- viewport.right - targetDim.right) - elOffset,
4466
- height:
4467
- this.axis === 'x' ?
4468
- viewport.height :
4469
- (this.dir === 'top' ?
4470
- targetDim.top - viewport.top :
4471
- viewport.bottom - targetDim.bottom) - elOffset });
4472
-
4473
- } else if (this.$el.offsetWidth > maxWidth) {
4415
+
4416
+ for (const [i, [axis, prop]] of dirs) {
4417
+ if (this.axis !== axis && includes([axis, true], this.stretch)) {
4418
+ css(this.$el, {
4419
+ [prop]: Math.min(
4420
+ boundaryOffset[prop],
4421
+ viewports[i][prop] - 2 * viewportOffset),
4422
+
4423
+ ["overflow-" + axis]: 'auto' });
4424
+
4425
+ }
4426
+ }
4427
+
4428
+ const maxWidth = viewports[0].width - 2 * viewportOffset;
4429
+
4430
+ if (this.$el.offsetWidth > maxWidth) {
4474
4431
  addClass(this.$el, this.clsDrop + "-stack");
4475
4432
  }
4476
4433
 
4477
4434
  css(this.$el, 'maxWidth', maxWidth);
4478
4435
 
4479
- this.positionAt(this.$el, target, boundary);
4436
+ this.$el.hidden = false;
4437
+
4438
+ this.positionAt(this.$el, this.target, boundary);
4439
+
4440
+ for (const [i, [axis, prop, start, end]] of dirs) {
4441
+ if (this.axis === axis && includes([axis, true], this.stretch)) {
4442
+ const positionOffset = Math.abs(this.getPositionOffset(this.$el));
4443
+ const targetOffset = offset(this.target[i]);
4444
+ const elOffset = offset(this.$el);
4445
+
4446
+ css(this.$el, {
4447
+ [prop]:
4448
+ (targetOffset[start] > elOffset[start] ?
4449
+ targetOffset[start] -
4450
+ Math.max(
4451
+ boundaryOffset[start],
4452
+ viewports[i][start] + viewportOffset) :
4453
+
4454
+ Math.min(
4455
+ boundaryOffset[end],
4456
+ viewports[i][end] - viewportOffset) -
4457
+ targetOffset[end]) - positionOffset,
4458
+ ["overflow-" + axis]: 'auto' });
4459
+
4460
+
4461
+ this.positionAt(this.$el, this.target, boundary);
4462
+ }
4463
+ }
4480
4464
  } } };
4481
4465
 
4482
4466
 
@@ -4973,8 +4957,11 @@
4973
4957
  let minHeight = '';
4974
4958
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4975
4959
 
4960
+ const { body, scrollingElement } = document;
4976
4961
  const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4977
- const { height: viewportHeight } = offsetViewport(scrollElement);
4962
+ const { height: viewportHeight } = offsetViewport(
4963
+ scrollElement === body ? scrollingElement : scrollElement);
4964
+
4978
4965
 
4979
4966
  if (this.expand) {
4980
4967
  minHeight = Math.max(
@@ -4984,7 +4971,6 @@
4984
4971
  0);
4985
4972
 
4986
4973
  } else {
4987
- const { body, scrollingElement } = document;
4988
4974
  const isScrollingElement =
4989
4975
  scrollingElement === scrollElement || body === scrollElement;
4990
4976
 
@@ -5240,7 +5226,13 @@
5240
5226
 
5241
5227
  var marker = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"9\" y=\"4\" width=\"1\" height=\"11\"/><rect x=\"4\" y=\"9\" width=\"11\" height=\"1\"/></svg>";
5242
5228
 
5243
- var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect y=\"9\" width=\"20\" height=\"2\"/><rect y=\"3\" width=\"20\" height=\"2\"/><rect y=\"15\" width=\"20\" height=\"2\"/></svg>";
5229
+ var navParentIcon = "<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>";
5230
+
5231
+ var navParentIconLarge = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" points=\"1 4 7 10 13 4\"/></svg>";
5232
+
5233
+ 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>";
5234
+
5235
+ 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>";
5244
5236
 
5245
5237
  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>";
5246
5238
 
@@ -5272,6 +5264,9 @@
5272
5264
  marker,
5273
5265
  'close-icon': closeIcon,
5274
5266
  'close-large': closeLarge,
5267
+ 'nav-parent-icon': navParentIcon,
5268
+ 'nav-parent-icon-large': navParentIconLarge,
5269
+ 'navbar-parent-icon': navbarParentIcon,
5275
5270
  'navbar-toggle-icon': navbarToggleIcon,
5276
5271
  'overlay-icon': overlayIcon,
5277
5272
  'pagination-next': paginationNext,
@@ -5329,6 +5324,15 @@
5329
5324
  } };
5330
5325
 
5331
5326
 
5327
+ const NavParentIcon = {
5328
+ extends: IconComponent,
5329
+
5330
+ beforeConnect() {
5331
+ const icon = this.$props.icon;
5332
+ this.icon = closest(this.$el, '.uk-nav-primary') ? icon + "-large" : icon;
5333
+ } };
5334
+
5335
+
5332
5336
  const Slidenav = {
5333
5337
  extends: IconComponent,
5334
5338
 
@@ -5589,7 +5593,7 @@
5589
5593
 
5590
5594
 
5591
5595
  connected() {
5592
- const media = toMedia(this.media);
5596
+ const media = toMedia(this.media, this.$el);
5593
5597
  this.matchMedia = true;
5594
5598
  if (media) {
5595
5599
  this.mediaObj = window.matchMedia(media);
@@ -5610,11 +5614,10 @@
5610
5614
  } };
5611
5615
 
5612
5616
 
5613
- function toMedia(value) {
5617
+ function toMedia(value, element) {
5614
5618
  if (isString(value)) {
5615
5619
  if (startsWith(value, '@')) {
5616
- const name = "breakpoint-" + value.substr(1);
5617
- value = toFloat(getCssVar(name));
5620
+ value = toFloat(css(element, "--uk-breakpoint-" + value.substr(1)));
5618
5621
  } else if (isNaN(value)) {
5619
5622
  return value;
5620
5623
  }
@@ -5639,7 +5642,7 @@
5639
5642
 
5640
5643
  computed: {
5641
5644
  fill(_ref) {let { fill } = _ref;
5642
- return fill || getCssVar('leader-fill-content');
5645
+ return fill || css(this.$el, '--uk-leader-fill-content');
5643
5646
  } },
5644
5647
 
5645
5648
 
@@ -5831,7 +5834,9 @@
5831
5834
  align: String,
5832
5835
  offset: Number,
5833
5836
  boundary: Boolean,
5834
- boundaryAlign: Boolean,
5837
+ target: Boolean,
5838
+ targetX: Boolean,
5839
+ targetY: Boolean,
5835
5840
  clsDrop: String,
5836
5841
  delayShow: Number,
5837
5842
  delayHide: Number,
@@ -5848,9 +5853,12 @@
5848
5853
  offset: undefined,
5849
5854
  delayShow: undefined,
5850
5855
  delayHide: undefined,
5851
- boundaryAlign: undefined,
5852
- flip: 'x',
5856
+ flip: false,
5857
+ shift: true,
5853
5858
  boundary: true,
5859
+ target: false,
5860
+ targetX: false,
5861
+ targetY: false,
5854
5862
  dropbar: false,
5855
5863
  dropbarAnchor: false,
5856
5864
  duration: 200,
@@ -5885,7 +5893,7 @@
5885
5893
  },
5886
5894
 
5887
5895
  watch(dropbar) {
5888
- addClass(dropbar, 'uk-navbar-dropbar');
5896
+ addClass(dropbar, 'uk-dropbar', 'uk-dropbar-top', 'uk-navbar-dropbar');
5889
5897
  },
5890
5898
 
5891
5899
  immediate: true },
@@ -5901,7 +5909,7 @@
5901
5909
 
5902
5910
  if (this.dropContainer !== $el) {
5903
5911
  for (const el of $$("." + clsDrop, this.dropContainer)) {var _this$getDropdown;
5904
- const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.target;
5912
+ const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.targetEl;
5905
5913
  if (!includes(dropdowns, el) && target && within(target, this.$el)) {
5906
5914
  dropdowns.push(el);
5907
5915
  }
@@ -5963,8 +5971,8 @@
5963
5971
  if (
5964
5972
  active &&
5965
5973
  includes(active.mode, 'hover') &&
5966
- active.target &&
5967
- !within(active.target, current) &&
5974
+ active.targetEl &&
5975
+ !within(active.targetEl, current) &&
5968
5976
  !active.isDelaying)
5969
5977
  {
5970
5978
  active.hide(false);
@@ -5986,7 +5994,7 @@
5986
5994
  if (keyCode === keyMap.DOWN && hasAttr(current, 'aria-expanded')) {
5987
5995
  e.preventDefault();
5988
5996
 
5989
- if (!active || active.target !== current) {
5997
+ if (!active || active.targetEl !== current) {
5990
5998
  current.click();
5991
5999
  once(this.dropContainer, 'show', (_ref8) => {let { target } = _ref8;return (
5992
6000
  focusFirstFocusableElement(target));});
@@ -6036,8 +6044,8 @@
6036
6044
  }
6037
6045
  }
6038
6046
 
6039
- if (keyCode === keyMap.ESC) {var _active$target;
6040
- active == null ? void 0 : (_active$target = active.target) == null ? void 0 : _active$target.focus();
6047
+ if (keyCode === keyMap.ESC) {var _active$targetEl;
6048
+ active == null ? void 0 : (_active$targetEl = active.targetEl) == null ? void 0 : _active$targetEl.focus();
6041
6049
  }
6042
6050
 
6043
6051
  handleNavItemNavigation(e, this.toggles, active);
@@ -6108,39 +6116,19 @@
6108
6116
  return;
6109
6117
  }
6110
6118
 
6111
- this._observer = observeResize(target, () =>
6112
- this.transitionTo(
6113
- offset(target).bottom -
6114
- offset(this.dropbar).top +
6115
- toFloat(css(target, 'marginBottom')),
6116
- target));
6117
-
6118
-
6119
- } },
6120
-
6121
-
6122
- {
6123
- name: 'beforeposition',
6124
-
6125
- el() {
6126
- return this.dropContainer;
6127
- },
6128
-
6129
- filter() {
6130
- return this.dropbar;
6131
- },
6132
-
6133
- handler(e, element, target, options) {
6134
- if (!this.isDropbarDrop(element)) {
6135
- return;
6136
- }
6137
-
6138
- const dropbarOffset = offset(this.dropbar);
6119
+ this._observer = observeResize(target, () => {
6120
+ const targetOffsets = parents(target, "." + this.clsDrop).
6121
+ concat(target).
6122
+ map((el) => offset(el));
6123
+ const minTop = Math.min(...targetOffsets.map((_ref11) => {let { top } = _ref11;return top;}));
6124
+ const maxBottom = Math.max(...targetOffsets.map((_ref12) => {let { bottom } = _ref12;return bottom;}));
6125
+ const dropbarOffset = offset(this.dropbar);
6126
+ css(this.dropbar, 'top', this.dropbar.offsetTop - (dropbarOffset.top - minTop));
6127
+ this.transitionTo(
6128
+ maxBottom - minTop + toFloat(css(target, 'marginBottom')),
6129
+ target);
6139
6130
 
6140
- css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
6141
-
6142
- options.offset[1] = dropbarOffset.top - offset(target).bottom;
6143
- options.viewportOffset += dropbarOffset.left;
6131
+ });
6144
6132
  } },
6145
6133
 
6146
6134
 
@@ -6161,7 +6149,7 @@
6161
6149
  if (
6162
6150
  matches(this.dropbar, ':hover') &&
6163
6151
  (active == null ? void 0 : active.$el) === e.target &&
6164
- !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6152
+ !this.toggles.some((el) => active.targetEl !== el && matches(el, ':focus')))
6165
6153
  {
6166
6154
  e.preventDefault();
6167
6155
  }
@@ -6179,7 +6167,7 @@
6179
6167
  return this.dropbar;
6180
6168
  },
6181
6169
 
6182
- handler(_ref11) {let { target } = _ref11;
6170
+ handler(_ref13) {let { target } = _ref13;
6183
6171
  if (!this.isDropbarDrop(target)) {
6184
6172
  return;
6185
6173
  }
@@ -6197,7 +6185,7 @@
6197
6185
 
6198
6186
  methods: {
6199
6187
  getActive() {
6200
- return active && within(active.target, this.$el) && active;
6188
+ return active && within(active.targetEl, this.$el) && active;
6201
6189
  },
6202
6190
 
6203
6191
  transitionTo(newHeight, el) {
@@ -6230,15 +6218,14 @@
6230
6218
  },
6231
6219
 
6232
6220
  isDropbarDrop(el) {
6233
- const drop = this.getDropdown(el);
6234
- return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
6221
+ return this.getDropdown(el) && hasClass(el, this.clsDrop);
6235
6222
  } } };
6236
6223
 
6237
6224
 
6238
6225
 
6239
6226
  function handleNavItemNavigation(e, toggles, active) {
6240
6227
  const { current, keyCode } = e;
6241
- const target = (active == null ? void 0 : active.target) || current;
6228
+ const target = (active == null ? void 0 : active.targetEl) || current;
6242
6229
  const i = toggles.indexOf(target);
6243
6230
 
6244
6231
  // Left
@@ -6606,6 +6593,14 @@
6606
6593
  offset: 0 },
6607
6594
 
6608
6595
 
6596
+ connected() {
6597
+ registerClick(this);
6598
+ },
6599
+
6600
+ disconnected() {
6601
+ unregisterClick(this);
6602
+ },
6603
+
6609
6604
  methods: {
6610
6605
  async scrollTo(el) {
6611
6606
  el = el && $(el) || document.body;
@@ -6614,20 +6609,39 @@
6614
6609
  await scrollIntoView(el, { offset: this.offset });
6615
6610
  trigger(this.$el, 'scrolled', [this, el]);
6616
6611
  }
6617
- } },
6612
+ } } };
6618
6613
 
6619
6614
 
6620
- events: {
6621
- click(e) {
6622
- if (e.defaultPrevented) {
6623
- return;
6624
- }
6625
6615
 
6626
- e.preventDefault();
6627
- this.scrollTo(getTargetElement(this.$el));
6628
- } } };
6616
+ const components$2 = new Set();
6617
+ function registerClick(cmp) {
6618
+ if (!components$2.size) {
6619
+ on(document, 'click', clickHandler);
6620
+ }
6629
6621
 
6622
+ components$2.add(cmp);
6623
+ }
6624
+
6625
+ function unregisterClick(cmp) {
6626
+ components$2.delete(cmp);
6627
+
6628
+ if (!components$2.length) {
6629
+ off(document, 'click', clickHandler);
6630
+ }
6631
+ }
6632
+
6633
+ function clickHandler(e) {
6634
+ if (e.defaultPrevented) {
6635
+ return;
6636
+ }
6630
6637
 
6638
+ for (const component of components$2) {
6639
+ if (within(e.target, component.$el)) {
6640
+ e.preventDefault();
6641
+ component.scrollTo(getTargetElement(component.$el));
6642
+ }
6643
+ }
6644
+ }
6631
6645
 
6632
6646
  function getTargetElement(el) {
6633
6647
  return document.getElementById(decodeURIComponent(el.hash).substring(1));
@@ -7590,7 +7604,7 @@
7590
7604
 
7591
7605
 
7592
7606
  {
7593
- name: 'toggled',
7607
+ name: 'hide show',
7594
7608
 
7595
7609
  self: true,
7596
7610
 
@@ -7598,10 +7612,8 @@
7598
7612
  return this.target;
7599
7613
  },
7600
7614
 
7601
- handler(e, toggled) {
7602
- if (e.target === this.target[0]) {
7603
- this.updateAria(toggled);
7604
- }
7615
+ handler(_ref2) {let { type } = _ref2;
7616
+ this.updateAria(type === 'show');
7605
7617
  } },
7606
7618
 
7607
7619
 
@@ -7696,10 +7708,12 @@
7696
7708
  Video: Video,
7697
7709
  Close: Close,
7698
7710
  Spinner: Spinner,
7711
+ NavParentIcon: NavParentIcon,
7699
7712
  SlidenavNext: Slidenav,
7700
7713
  SlidenavPrevious: Slidenav,
7701
7714
  SearchIcon: Search,
7702
7715
  Marker: IconComponent,
7716
+ NavbarParentIcon: IconComponent,
7703
7717
  NavbarToggleIcon: IconComponent,
7704
7718
  OverlayIcon: IconComponent,
7705
7719
  PaginationNext: IconComponent,