uikit 3.14.4-dev.e2919bbf7 → 3.14.4-dev.eb440d70c

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 (122) hide show
  1. package/CHANGELOG.md +30 -17
  2. package/build/util.js +1 -0
  3. package/dist/css/uikit-core-rtl.css +281 -61
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +281 -61
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +301 -65
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +301 -65
  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 +96 -131
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +96 -131
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +4 -2
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +2 -2
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +2 -2
  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 +2 -2
  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 +99 -136
  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 +483 -455
  38. package/dist/js/uikit-core.min.js +17 -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 +486 -456
  42. package/dist/js/uikit.min.js +17 -1
  43. package/package.json +11 -11
  44. package/src/images/components/navbar-toggle-icon.svg +25 -3
  45. package/src/js/api/hooks.js +5 -1
  46. package/src/js/api/state.js +2 -2
  47. package/src/js/components/notification.js +3 -1
  48. package/src/js/core/accordion.js +9 -17
  49. package/src/js/core/alert.js +35 -14
  50. package/src/js/core/drop.js +110 -82
  51. package/src/js/core/height-viewport.js +4 -2
  52. package/src/js/core/navbar.js +30 -45
  53. package/src/js/core/scroll.js +37 -10
  54. package/src/js/core/toggle.js +3 -5
  55. package/src/js/mixin/media.js +1 -1
  56. package/src/js/mixin/modal.js +15 -12
  57. package/src/js/mixin/position.js +21 -22
  58. package/src/js/mixin/style.js +11 -0
  59. package/src/js/mixin/togglable.js +88 -124
  60. package/src/js/util/animation.js +9 -7
  61. package/src/js/util/class.js +3 -1
  62. package/src/js/util/filter.js +3 -7
  63. package/src/js/util/position.js +107 -107
  64. package/src/js/util/viewport.js +3 -5
  65. package/src/less/components/_import.less +1 -0
  66. package/src/less/components/drop.less +1 -18
  67. package/src/less/components/dropbar.less +126 -0
  68. package/src/less/components/dropdown.less +6 -20
  69. package/src/less/components/nav.less +211 -22
  70. package/src/less/components/navbar.less +17 -51
  71. package/src/less/theme/_import.less +1 -0
  72. package/src/less/theme/dropbar.less +44 -0
  73. package/src/less/theme/dropdown.less +0 -11
  74. package/src/less/theme/nav.less +46 -0
  75. package/src/less/theme/navbar.less +1 -5
  76. package/src/scss/components/_import.scss +1 -0
  77. package/src/scss/components/drop.scss +1 -18
  78. package/src/scss/components/dropbar.scss +126 -0
  79. package/src/scss/components/dropdown.scss +6 -20
  80. package/src/scss/components/nav.scss +160 -21
  81. package/src/scss/components/navbar.scss +17 -51
  82. package/src/scss/mixins-theme.scss +78 -7
  83. package/src/scss/mixins.scss +75 -3
  84. package/src/scss/theme/_import.scss +1 -0
  85. package/src/scss/theme/dropbar.scss +44 -0
  86. package/src/scss/theme/dropdown.scss +0 -8
  87. package/src/scss/theme/nav.scss +44 -0
  88. package/src/scss/theme/navbar.scss +1 -5
  89. package/src/scss/variables-theme.scss +54 -9
  90. package/src/scss/variables.scss +43 -7
  91. package/tests/accordion.html +2 -2
  92. package/tests/alert.html +2 -2
  93. package/tests/countdown.html +1 -1
  94. package/tests/drop.html +446 -416
  95. package/tests/dropbar.html +458 -0
  96. package/tests/dropdown.html +8 -470
  97. package/tests/filter.html +9 -12
  98. package/tests/form.html +1 -1
  99. package/tests/index.html +124 -105
  100. package/tests/js/index.js +1 -4
  101. package/tests/lightbox.html +5 -5
  102. package/tests/list.html +8 -8
  103. package/tests/modal.html +13 -13
  104. package/tests/nav.html +121 -12
  105. package/tests/navbar.html +112 -227
  106. package/tests/offcanvas.html +10 -14
  107. package/tests/parallax.html +1 -1
  108. package/tests/position.html +18 -16
  109. package/tests/progress.html +9 -9
  110. package/tests/scroll.html +7 -10
  111. package/tests/search.html +6 -6
  112. package/tests/slider.html +6 -5
  113. package/tests/slideshow.html +8 -8
  114. package/tests/sortable.html +6 -8
  115. package/tests/sticky-navbar.html +15 -15
  116. package/tests/sticky.html +8 -8
  117. package/tests/switcher.html +1 -1
  118. package/tests/tab.html +1 -1
  119. package/tests/table.html +7 -7
  120. package/tests/toggle.html +2 -2
  121. package/tests/tooltip.html +1 -1
  122. package/tests/upload.html +11 -11
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.e2919bbf7 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.eb440d70c | 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) {
@@ -818,7 +814,9 @@
818
814
  }
819
815
 
820
816
  function removeClasses(element, cls) {
821
- 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
+
822
820
  }
823
821
 
824
822
  function replaceClass(element) {
@@ -903,13 +901,14 @@
903
901
  const Transition = {
904
902
  start: transition,
905
903
 
906
- stop(element) {
904
+ async stop(element) {
907
905
  trigger(element, 'transitionend');
908
- return Promise.resolve();
906
+ await Promise.resolve();
909
907
  },
910
908
 
911
- cancel(element) {
909
+ async cancel(element) {
912
910
  trigger(element, 'transitioncanceled');
911
+ await Promise.resolve();
913
912
  },
914
913
 
915
914
  inProgress(element) {
@@ -919,7 +918,7 @@
919
918
 
920
919
  const animationPrefix = 'uk-animation-';
921
920
 
922
- function animate$1(element, animation, duration, origin, out) {if (duration === void 0) {duration = 200;}
921
+ function animate$2(element, animation, duration, origin, out) {if (duration === void 0) {duration = 200;}
923
922
  return Promise.all(
924
923
  toNodes(element).map(
925
924
  (element) =>
@@ -953,16 +952,17 @@
953
952
 
954
953
  }
955
954
 
956
- const inProgress = new RegExp(animationPrefix + "(enter|leave)");
955
+ const inProgressRe = new RegExp(animationPrefix + "(enter|leave)");
956
+
957
957
  const Animation = {
958
- in: animate$1,
958
+ in: animate$2,
959
959
 
960
960
  out(element, animation, duration, origin) {
961
- return animate$1(element, animation, duration, origin, true);
961
+ return animate$2(element, animation, duration, origin, true);
962
962
  },
963
963
 
964
964
  inProgress(element) {
965
- return inProgress.test(attr(element, 'class'));
965
+ return inProgressRe.test(attr(element, 'class'));
966
966
  },
967
967
 
968
968
  cancel(element) {
@@ -1889,12 +1889,10 @@
1889
1889
  function offsetViewport(scrollElement) {
1890
1890
  const window = toWindow(scrollElement);
1891
1891
  const {
1892
- document: { body, documentElement } } =
1892
+ document: { documentElement } } =
1893
1893
  window;
1894
1894
  let viewportElement =
1895
- scrollElement === scrollingElement(scrollElement) || scrollElement === body ?
1896
- window :
1897
- scrollElement;
1895
+ scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1898
1896
 
1899
1897
  const { visualViewport } = window;
1900
1898
  if (isWindow(viewportElement) && visualViewport) {
@@ -1913,7 +1911,7 @@
1913
1911
  // iOS 12 returns <body> as scrollingElement
1914
1912
  viewportElement = documentElement;
1915
1913
  } else {
1916
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1914
+ rect[start] += toFloat(css(viewportElement, "border-" + start + "-width"));
1917
1915
  }
1918
1916
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1919
1917
  rect[end] = rect[prop] + rect[start];
@@ -1938,126 +1936,65 @@
1938
1936
  ...options.attach },
1939
1937
 
1940
1938
  offset: [0, 0],
1939
+ placement: [],
1941
1940
  ...options };
1942
1941
 
1943
1942
 
1944
- const dim = options.flip ?
1945
- attachToWithFlip(element, target, options) :
1946
- attachTo(element, target, options);
1947
-
1948
- offset(element, dim);
1949
- }
1950
-
1951
- function attachTo(element, target, options) {
1952
- let { attach, offset: offsetBy } = {
1953
- attach: {
1954
- element: ['left', 'top'],
1955
- target: ['left', 'top'],
1956
- ...options.attach },
1957
-
1958
- offset: [0, 0],
1959
- ...options };
1960
-
1961
-
1962
- const position = offset(element);
1963
- const targetOffset = offset(target);
1964
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1965
- position[start] = position[dir] =
1966
- targetOffset[start] +
1967
- moveBy(attach.target[i], end, targetOffset[prop]) -
1968
- moveBy(attach.element[i], end, position[prop]) +
1969
- +offsetBy[i];
1970
- position[end] = position[start] + position[prop];
1943
+ if (!isArray(target)) {
1944
+ target = [target, target];
1971
1945
  }
1972
- return position;
1973
- }
1974
1946
 
1975
- function moveBy(start, end, dim) {
1976
- return start === 'center' ? dim / 2 : start === end ? dim : 0;
1947
+ offset(element, getPosition(element, target, options));
1977
1948
  }
1978
1949
 
1979
- function attachToWithFlip(element, target, options) {
1950
+ function getPosition(element, target, options) {
1980
1951
  const position = attachTo(element, target, options);
1981
- const targetDim = offset(target);
1982
1952
 
1983
1953
  let {
1984
- flip,
1985
1954
  attach: { element: elAttach, target: targetAttach },
1986
1955
  offset: elOffset,
1987
1956
  boundary,
1988
- viewport,
1989
- viewportOffset } =
1957
+ viewportOffset,
1958
+ placement } =
1990
1959
  options;
1991
1960
 
1992
- let viewports = scrollParents(element);
1993
- if (boundary === target) {
1994
- viewports = viewports.filter((viewport) => viewport !== boundary);
1995
- }
1996
- const [scrollElement] = viewports;
1997
- viewports.push(viewport);
1998
-
1999
- const offsetPosition = { ...position };
2000
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2001
- if (flip !== true && !includes(flip, dir)) {
2002
- continue;
2003
- }
1961
+ let offsetPosition = position;
1962
+ for (const [i, [prop,, start, end]] of Object.entries(dirs)) {
1963
+ let viewports = scrollParents(target[i]);
1964
+ const [scrollElement] = viewports;
2004
1965
 
2005
- const willFlip =
2006
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
2007
-
2008
- viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1966
+ let viewport = getIntersectionArea(...viewports.map(offsetViewport));
2009
1967
 
2010
1968
  if (viewportOffset) {
2011
1969
  viewport[start] += viewportOffset;
2012
1970
  viewport[end] -= viewportOffset;
2013
1971
  }
2014
1972
 
2015
- if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2016
- viewport = getIntersectionArea(viewport, offset(boundary));
1973
+ if (boundary) {
1974
+ viewport = getIntersectionArea(viewport, offsetViewport(boundary));
2017
1975
  }
2018
1976
 
2019
- const isInStartBoundary = position[start] >= viewport[start];
2020
- const isInEndBoundary = position[end] <= viewport[end];
1977
+ const isInStartViewport = position[start] >= viewport[start];
1978
+ const isInEndViewport = position[end] <= viewport[end];
2021
1979
 
2022
- if (isInStartBoundary && isInEndBoundary) {
1980
+ if (isInStartViewport && isInEndViewport) {
2023
1981
  continue;
2024
1982
  }
2025
1983
 
2026
- let offsetBy;
1984
+ let offsetBy = 0;
2027
1985
 
2028
1986
  // Flip
2029
- if (willFlip) {
1987
+ if (placement[i] === 'flip') {
2030
1988
  if (
2031
- elAttach[i] === end && isInStartBoundary ||
2032
- elAttach[i] === start && isInEndBoundary)
1989
+ targetAttach[i] === end && isInEndViewport ||
1990
+ targetAttach[i] === start && isInStartViewport)
2033
1991
  {
2034
1992
  continue;
2035
1993
  }
2036
1994
 
2037
- offsetBy =
2038
- (elAttach[i] === start ?
2039
- -position[prop] :
2040
- elAttach[i] === end ?
2041
- position[prop] :
2042
- 0) + (
2043
- targetAttach[i] === start ?
2044
- targetDim[prop] :
2045
- targetAttach[i] === end ?
2046
- -targetDim[prop] :
2047
- 0) -
2048
- elOffset[i] * 2;
2049
-
2050
- if (
2051
- !isInScrollArea(
2052
- {
2053
- ...position,
2054
- [start]: position[start] + offsetBy,
2055
- [end]: position[end] + offsetBy },
2056
-
2057
- scrollElement,
2058
- i))
1995
+ offsetBy = flip(element, target, options, i)[start] - position[start];
2059
1996
 
2060
- {
1997
+ if (!isInScrollArea(applyOffset(position, offsetBy, i), scrollElement, i)) {
2061
1998
  if (isInScrollArea(position, scrollElement, i)) {
2062
1999
  continue;
2063
2000
  }
@@ -2066,27 +2003,27 @@
2066
2003
  return false;
2067
2004
  }
2068
2005
 
2069
- if (flip === true || includes(flip, dirs[1 - i][1])) {
2070
- const newPos = attachToWithFlip(element, target, {
2071
- ...options,
2072
- attach: {
2073
- element: elAttach.map(flipDir).reverse(),
2074
- target: targetAttach.map(flipDir).reverse() },
2006
+ const newPos = getPosition(element, target, {
2007
+ ...options,
2008
+ attach: {
2009
+ element: elAttach.map(flipAxis).reverse(),
2010
+ target: targetAttach.map(flipAxis).reverse() },
2075
2011
 
2076
- offset: elOffset.reverse(),
2077
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2078
- recursion: true });
2012
+ offset: elOffset.reverse(),
2013
+ placement: placement.reverse(),
2014
+ recursion: true });
2079
2015
 
2080
2016
 
2081
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2082
- return newPos;
2083
- }
2017
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2018
+ return newPos;
2084
2019
  }
2020
+
2085
2021
  continue;
2086
2022
  }
2087
2023
 
2088
- // Move
2089
- } else {
2024
+ // Shift
2025
+ } else if (placement[i] === 'shift') {
2026
+ const targetDim = offset(target[i]);
2090
2027
  offsetBy =
2091
2028
  clamp(
2092
2029
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2095,13 +2032,54 @@
2095
2032
  position[start];
2096
2033
  }
2097
2034
 
2098
- offsetPosition[start] = position[dir] = position[start] + offsetBy;
2099
- offsetPosition[end] += offsetBy;
2035
+ offsetPosition = applyOffset(offsetPosition, offsetBy, i);
2100
2036
  }
2101
2037
 
2102
2038
  return offsetPosition;
2103
2039
  }
2104
2040
 
2041
+ function attachTo(element, target, options) {
2042
+ let { attach, offset: offsetBy } = {
2043
+ attach: {
2044
+ element: ['left', 'top'],
2045
+ target: ['left', 'top'],
2046
+ ...options.attach },
2047
+
2048
+ offset: [0, 0],
2049
+ ...options };
2050
+
2051
+
2052
+ let elOffset = offset(element);
2053
+
2054
+ for (const [i, [prop,, start, end]] of Object.entries(dirs)) {
2055
+ const targetOffset =
2056
+ attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);
2057
+
2058
+ elOffset = applyOffset(
2059
+ elOffset,
2060
+ targetOffset[start] -
2061
+ elOffset[start] +
2062
+ moveBy(attach.target[i], end, targetOffset[prop]) -
2063
+ moveBy(attach.element[i], end, elOffset[prop]) +
2064
+ +offsetBy[i],
2065
+ i);
2066
+
2067
+ }
2068
+ return elOffset;
2069
+ }
2070
+
2071
+ function applyOffset(position, offset, i) {
2072
+ const [, dir, start, end] = dirs[i];
2073
+ const newPos = { ...position };
2074
+ newPos[start] = position[dir] = position[start] + offset;
2075
+ newPos[end] += offset;
2076
+ return newPos;
2077
+ }
2078
+
2079
+ function moveBy(attach, end, dim) {
2080
+ return attach === 'center' ? dim / 2 : attach === end ? dim : 0;
2081
+ }
2082
+
2105
2083
  function getIntersectionArea() {
2106
2084
  let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2107
2085
  for (const rect of rects) {
@@ -2122,12 +2100,32 @@
2122
2100
  return position[start] >= viewport[start] && position[end] <= viewport[end];
2123
2101
  }
2124
2102
 
2125
- function intersectLine(dimA, dimB, dir) {
2126
- const [,, start, end] = dirs[dir];
2127
- return dimA[end] > dimB[start] && dimB[end] > dimA[start];
2103
+ function flip(element, target, _ref, i) {let { offset, attach } = _ref;
2104
+ return attachTo(element, target, {
2105
+ attach: {
2106
+ element: flipAttach(attach.element, i),
2107
+ target: flipAttach(attach.target, i) },
2108
+
2109
+ offset: flipOffset(offset, i) });
2110
+
2111
+ }
2112
+
2113
+ function flipAttach(attach, i) {
2114
+ const newAttach = [...attach];
2115
+ const index = dirs[i].indexOf(attach[i]);
2116
+ if (~index) {
2117
+ newAttach[i] = dirs[i][1 - index % 2 + 2];
2118
+ }
2119
+ return newAttach;
2120
+ }
2121
+
2122
+ function flipOffset(offset, i) {
2123
+ offset = [...offset];
2124
+ offset[i] *= -1;
2125
+ return offset;
2128
2126
  }
2129
2127
 
2130
- function flipDir(prop) {
2128
+ function flipAxis(prop) {
2131
2129
  for (let i = 0; i < dirs.length; i++) {
2132
2130
  const index = dirs[i].indexOf(prop);
2133
2131
  if (~index) {
@@ -2140,9 +2138,7 @@
2140
2138
  __proto__: null,
2141
2139
  ajax: ajax,
2142
2140
  getImage: getImage,
2143
- transition: transition,
2144
2141
  Transition: Transition,
2145
- animate: animate$1,
2146
2142
  Animation: Animation,
2147
2143
  attr: attr,
2148
2144
  hasAttr: hasAttr,
@@ -2447,7 +2443,11 @@
2447
2443
  }
2448
2444
 
2449
2445
  if (write && result !== false) {
2450
- fastdom.write(() => write.call(this, this._data, types));
2446
+ fastdom.write(() => {
2447
+ if (this._connected) {
2448
+ write.call(this, this._data, types);
2449
+ }
2450
+ });
2451
2451
  }
2452
2452
  }
2453
2453
  }
@@ -2596,7 +2596,7 @@
2596
2596
 
2597
2597
  value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2598
2598
 
2599
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2599
+ if (prop === 'target' && startsWith(value, '_')) {
2600
2600
  continue;
2601
2601
  }
2602
2602
 
@@ -2607,7 +2607,7 @@
2607
2607
 
2608
2608
  for (const key in options) {
2609
2609
  const prop = camelize(key);
2610
- if (props[prop] !== undefined) {
2610
+ if (!isUndefined(props[prop])) {
2611
2611
  data$1[prop] = coerce$1(props[prop], options[key]);
2612
2612
  }
2613
2613
  }
@@ -2936,7 +2936,7 @@
2936
2936
  UIkit.data = '__uikit__';
2937
2937
  UIkit.prefix = 'uk-';
2938
2938
  UIkit.options = {};
2939
- UIkit.version = '3.14.4-dev.e2919bbf7';
2939
+ UIkit.version = '3.14.4-dev.eb440d70c';
2940
2940
 
2941
2941
  globalAPI(UIkit);
2942
2942
  hooksAPI(UIkit);
@@ -3041,27 +3041,7 @@
3041
3041
  origin: false,
3042
3042
  transition: 'ease',
3043
3043
  clsEnter: 'uk-togglabe-enter',
3044
- clsLeave: 'uk-togglabe-leave',
3045
-
3046
- initProps: {
3047
- overflow: '',
3048
- maxHeight: '',
3049
- paddingTop: '',
3050
- paddingBottom: '',
3051
- marginTop: '',
3052
- marginBottom: '',
3053
- boxShadow: '' },
3054
-
3055
-
3056
- hideProps: {
3057
- overflow: 'hidden',
3058
- maxHeight: 0,
3059
- paddingTop: 0,
3060
- paddingBottom: 0,
3061
- marginTop: 0,
3062
- marginBottom: 0,
3063
- boxShadow: 'none' } },
3064
-
3044
+ clsLeave: 'uk-togglabe-leave' },
3065
3045
 
3066
3046
 
3067
3047
  computed: {
@@ -3070,7 +3050,7 @@
3070
3050
  },
3071
3051
 
3072
3052
  hasTransition(_ref2) {let { animation } = _ref2;
3073
- return startsWith(animation[0], 'slide');
3053
+ return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
3074
3054
  } },
3075
3055
 
3076
3056
 
@@ -3163,122 +3143,105 @@
3163
3143
  };
3164
3144
  }
3165
3145
 
3166
- function toggleTransition(cmp) {
3167
- switch (cmp.animation[0]) {
3168
- case 'slide-left':
3169
- return slideHorizontal(cmp);
3170
- case 'slide-right':
3171
- return slideHorizontal(cmp, true);}
3172
-
3173
- return slide$1(cmp);
3174
- }
3175
-
3176
- function slide$1(_ref4)
3177
-
3178
-
3146
+ function toggleTransition(cmp) {var _cmp$animation$;
3147
+ const [mode = 'reveal', startProp = 'top'] = ((_cmp$animation$ = cmp.animation[0]) == null ? void 0 : _cmp$animation$.split('-')) || [];
3179
3148
 
3149
+ const dirs = [
3150
+ ['left', 'right'],
3151
+ ['top', 'bottom']];
3180
3152
 
3153
+ const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];
3154
+ const end = dir[1] === startProp;
3155
+ const props = ['width', 'height'];
3156
+ const dimProp = props[dirs.indexOf(dir)];
3157
+ const marginProp = "margin-" + dir[0];
3158
+ const marginStartProp = "margin-" + startProp;
3181
3159
 
3160
+ return async (el, show) => {
3161
+ let { duration, velocity, transition, _toggle } = cmp;
3182
3162
 
3163
+ let currentDim = dimensions$1(el)[dimProp];
3183
3164
 
3184
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3185
- return (el, show) => {
3186
3165
  const inProgress = Transition.inProgress(el);
3187
- const inner =
3188
- !inProgress && el.hasChildNodes() ?
3189
- toFloat(css(el.firstElementChild, 'marginTop')) +
3190
- toFloat(css(el.lastElementChild, 'marginBottom')) :
3191
- 0;
3192
- const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3166
+ await Transition.cancel(el);
3193
3167
 
3194
- const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3195
-
3196
- Transition.cancel(el);
3197
-
3198
- if (!isToggled(el)) {
3168
+ if (show) {
3199
3169
  _toggle(el, true);
3200
3170
  }
3201
3171
 
3202
- css(el, 'maxHeight', '');
3203
-
3204
- // Update child components first
3205
- fastdom.flush();
3206
-
3207
- const endHeight = toFloat(css(el, 'height')) + inner;
3208
- duration = velocity * endHeight + duration;
3209
-
3210
- css(el, { ...props, maxHeight: currentHeight });
3211
-
3212
- return (
3213
- show ?
3214
- Transition.start(
3215
- el,
3216
- { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3217
- duration * (1 - currentHeight / endHeight),
3218
- transition) :
3219
-
3220
- Transition.start(
3221
- el,
3222
- hideProps,
3223
- duration * (currentHeight / endHeight),
3224
- transition).
3225
- then(() => _toggle(el, false))).
3226
- then(() => css(el, initProps));
3227
- };
3228
- }
3229
-
3230
- function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3231
- return (el, show) => {
3232
- const visible = isVisible(el);
3233
- const marginLeft = toFloat(css(el, 'marginLeft'));
3234
-
3235
- Transition.cancel(el);
3236
-
3237
- const [scrollElement] = scrollParents(el.offsetParent);
3238
- css(scrollElement, 'overflowX', 'hidden');
3239
-
3240
- if (!isToggled(el)) {
3241
- _toggle(el, true);
3242
- }
3172
+ const prevProps = Object.fromEntries(
3173
+ [
3174
+ 'padding',
3175
+ 'border',
3176
+ 'width',
3177
+ 'height',
3178
+ 'overflowY',
3179
+ 'overflowX',
3180
+ marginProp,
3181
+ marginStartProp].
3182
+ map((key) => [key, el.style[key]]));
3183
+
3184
+
3185
+ const dim = dimensions$1(el);
3186
+ const currentMargin = toFloat(css(el, marginProp));
3187
+ const marginStart = toFloat(css(el, marginStartProp));
3188
+ const endDim = dim[dimProp] + marginStart;
3189
+
3190
+ if (!inProgress && !show) {
3191
+ currentDim += marginStart;
3192
+ }
3193
+
3194
+ const [wrapper] = wrapInner(el, '<div>');
3195
+ css(wrapper, {
3196
+ boxSizing: 'border-box',
3197
+ height: dim.height,
3198
+ width: dim.width,
3199
+ ...css(el, [
3200
+ 'overflow',
3201
+ 'padding',
3202
+ 'borderTop',
3203
+ 'borderRight',
3204
+ 'borderBottom',
3205
+ 'borderLeft',
3206
+ 'borderImage',
3207
+ marginStartProp]) });
3243
3208
 
3244
- const width = toFloat(css(el, 'width'));
3245
- duration = velocity * width + duration;
3246
3209
 
3247
- const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3248
3210
 
3249
3211
  css(el, {
3250
- clipPath: right ? "polygon(0 0," +
3251
- percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3252
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)",
3253
- marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3254
-
3212
+ padding: 0,
3213
+ border: 0,
3214
+ [marginStartProp]: 0,
3215
+ width: dim.width,
3216
+ height: dim.height,
3217
+ overflow: 'hidden',
3218
+ [dimProp]: currentDim });
3255
3219
 
3256
- return (
3257
- show ?
3258
- Transition.start(
3259
- el,
3260
- {
3261
- clipPath: "polygon(0 0,100% 0,100% 100%,0 100%)",
3262
- marginLeft: 0 },
3263
3220
 
3264
- duration * (1 - percent / 100),
3265
- transition) :
3221
+ const percent = currentDim / endDim;
3222
+ duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
3223
+ const endProps = { [dimProp]: show ? endDim : 0 };
3266
3224
 
3267
- Transition.start(
3268
- el,
3269
- {
3270
- clipPath: right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)",
3225
+ if (end) {
3226
+ css(el, marginProp, endDim - currentDim + currentMargin);
3227
+ endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
3228
+ }
3271
3229
 
3230
+ if (!end ^ mode === 'reveal') {
3231
+ css(wrapper, marginProp, -endDim + currentDim);
3232
+ Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
3233
+ }
3272
3234
 
3273
- marginLeft: (right ? 1 : -1) * width },
3235
+ try {
3236
+ await Transition.start(el, endProps, duration, transition);
3237
+ } finally {
3238
+ css(el, prevProps);
3239
+ unwrap(wrapper.firstChild);
3274
3240
 
3275
- duration * (percent / 100),
3276
- transition).
3277
- then(() => _toggle(el, false))).
3278
- then(() => {
3279
- css(scrollElement, 'overflowX', '');
3280
- css(el, { clipPath: '', marginLeft: '' });
3281
- });
3241
+ if (!show) {
3242
+ _toggle(el, false);
3243
+ }
3244
+ }
3282
3245
  };
3283
3246
  }
3284
3247
 
@@ -3303,6 +3266,7 @@
3303
3266
  mixins: [Class, Lazyload, Togglable],
3304
3267
 
3305
3268
  props: {
3269
+ animation: Boolean,
3306
3270
  targets: String,
3307
3271
  active: null,
3308
3272
  collapsible: Boolean,
@@ -3315,7 +3279,7 @@
3315
3279
  data: {
3316
3280
  targets: '> *',
3317
3281
  active: false,
3318
- animation: ['slide'],
3282
+ animation: true,
3319
3283
  collapsible: true,
3320
3284
  multiple: false,
3321
3285
  clsOpen: 'uk-open',
@@ -3361,7 +3325,7 @@
3361
3325
  hide(
3362
3326
  el,
3363
3327
  !hasClass(
3364
- this.items.find((item) => item.contains(el)),
3328
+ this.items.find((item) => within(el, item)),
3365
3329
  this.clsOpen));
3366
3330
 
3367
3331
 
@@ -3413,23 +3377,15 @@
3413
3377
  toggleClass(el, this.clsOpen, show);
3414
3378
  attr($(this.$props.toggle, el), 'aria-expanded', show);
3415
3379
 
3416
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3380
+ const content = $(this.content, el);
3417
3381
 
3418
- if (animate === false || !this.hasTransition) {
3382
+ if (animate === false || !this.animation) {
3383
+ content.hidden = !show;
3419
3384
  hide(content, !show);
3420
3385
  return;
3421
3386
  }
3422
3387
 
3423
- if (!el._wrapper) {
3424
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3425
- }
3426
-
3427
- hide(content, false);
3428
- await slide$1(this)(el._wrapper, show);
3429
- hide(content, !show);
3430
-
3431
- delete el._wrapper;
3432
- unwrap(content);
3388
+ await toggleTransition(this)(content, show);
3433
3389
 
3434
3390
  if (show) {
3435
3391
  const toggle = $(this.$props.toggle, el);
@@ -3455,18 +3411,17 @@
3455
3411
  args: 'animation',
3456
3412
 
3457
3413
  props: {
3414
+ animation: Boolean,
3458
3415
  close: String },
3459
3416
 
3460
3417
 
3461
3418
  data: {
3462
- animation: ['slide'],
3419
+ animation: true,
3463
3420
  selClose: '.uk-alert-close',
3464
- duration: 150,
3465
- hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3421
+ duration: 150 },
3466
3422
 
3467
3423
 
3468
- events: [
3469
- {
3424
+ events: {
3470
3425
  name: 'click',
3471
3426
 
3472
3427
  delegate() {
@@ -3476,16 +3431,39 @@
3476
3431
  handler(e) {
3477
3432
  e.preventDefault();
3478
3433
  this.close();
3479
- } }],
3480
-
3434
+ } },
3481
3435
 
3482
3436
 
3483
3437
  methods: {
3484
3438
  async close() {
3485
- await this.toggleElement(this.$el);
3439
+ await this.toggleElement(this.$el, false, animate$1(this));
3486
3440
  this.$destroy(true);
3487
3441
  } } };
3488
3442
 
3443
+
3444
+
3445
+ function animate$1(_ref) {let { duration, transition, velocity } = _ref;
3446
+ return (el) => {
3447
+ const height = toFloat(css(el, 'height'));
3448
+ css(el, 'height', height);
3449
+ return Transition.start(
3450
+ el,
3451
+ {
3452
+ height: 0,
3453
+ marginTop: 0,
3454
+ marginBottom: 0,
3455
+ paddingTop: 0,
3456
+ paddingBottom: 0,
3457
+ borderTop: 0,
3458
+ borderBottom: 0,
3459
+ opacity: 0 },
3460
+
3461
+ velocity * height + duration,
3462
+ transition);
3463
+
3464
+ };
3465
+ }
3466
+
3489
3467
  var Video = {
3490
3468
  args: 'autoplay',
3491
3469
 
@@ -3634,13 +3612,17 @@
3634
3612
  props: {
3635
3613
  pos: String,
3636
3614
  offset: null,
3637
- flip: Boolean },
3615
+ flip: Boolean,
3616
+ shift: Boolean,
3617
+ inset: Boolean },
3638
3618
 
3639
3619
 
3640
3620
  data: {
3641
3621
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3622
+ offset: false,
3642
3623
  flip: true,
3643
- offset: false },
3624
+ shift: true,
3625
+ inset: false },
3644
3626
 
3645
3627
 
3646
3628
  connected() {
@@ -3652,17 +3634,19 @@
3652
3634
  methods: {
3653
3635
  positionAt(element, target, boundary) {
3654
3636
  let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3637
+ const placement = [this.flip && 'flip', this.shift && 'shift'];
3655
3638
 
3656
3639
  const attach = {
3657
- element: [flipPosition(this.dir), this.align],
3640
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3658
3641
  target: [this.dir, this.align] };
3659
3642
 
3660
3643
 
3661
3644
  if (this.axis === 'y') {
3662
3645
  for (const prop in attach) {
3663
- attach[prop] = attach[prop].reverse();
3646
+ attach[prop].reverse();
3664
3647
  }
3665
- offset = offset.reverse();
3648
+ offset.reverse();
3649
+ placement.reverse();
3666
3650
  }
3667
3651
 
3668
3652
  const [scrollElement] = scrollParents(element, /auto|scroll/);
@@ -3672,22 +3656,14 @@
3672
3656
  const elDim = dimensions$1(element);
3673
3657
  css(element, { top: -elDim.height, left: -elDim.width });
3674
3658
 
3675
- const args = [
3676
- element,
3677
- target,
3678
- {
3659
+ positionAt(element, target, {
3679
3660
  attach,
3680
3661
  offset,
3681
3662
  boundary,
3682
- flip: this.flip,
3683
- viewportOffset: this.getViewportOffset(element) }];
3684
-
3663
+ placement,
3664
+ viewportOffset: this.getViewportOffset(element) });
3685
3665
 
3686
3666
 
3687
- trigger(element, 'beforeposition', args);
3688
-
3689
- positionAt(...args);
3690
-
3691
3667
  // Restore scroll position
3692
3668
  scrollElement.scrollTop = scrollTop;
3693
3669
  scrollElement.scrollLeft = scrollLeft;
@@ -3699,12 +3675,14 @@
3699
3675
  this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3700
3676
  this.axis === 'x' ? 'width' : 'height',
3701
3677
  element) * (
3702
- includes(['left', 'top'], this.dir) ? -1 : 1));
3678
+
3679
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3680
+ this.inset ? -1 : 1));
3703
3681
 
3704
3682
  },
3705
3683
 
3706
3684
  getShiftOffset(element) {
3707
- return includes(['center', 'justify', 'stretch'], this.align) ?
3685
+ return this.align === 'center' ?
3708
3686
  0 :
3709
3687
  toPx(
3710
3688
  css(element, '--uk-position-shift-offset'),
@@ -3717,6 +3695,15 @@
3717
3695
  return toPx(css(element, '--uk-position-viewport-offset'));
3718
3696
  } } };
3719
3697
 
3698
+ var Style = {
3699
+ beforeConnect() {
3700
+ this._style = attr(this.$el, 'style');
3701
+ },
3702
+
3703
+ disconnected() {
3704
+ attr(this.$el, 'style', this._style);
3705
+ } };
3706
+
3720
3707
  const active$1 = [];
3721
3708
 
3722
3709
  var Modal = {
@@ -3826,8 +3813,8 @@
3826
3813
 
3827
3814
 
3828
3815
  if (this.overlay) {
3829
- once(this.$el, 'hide', preventOverscroll(this.$el));
3830
- once(this.$el, 'hide', preventBackgroundScroll());
3816
+ once(this.$el, 'hidden', preventOverscroll(this.$el), { self: true });
3817
+ once(this.$el, 'hidden', preventBackgroundScroll(), { self: true });
3831
3818
  }
3832
3819
 
3833
3820
  if (this.stack) {
@@ -3909,10 +3896,6 @@
3909
3896
  active$1.splice(active$1.indexOf(this), 1);
3910
3897
  }
3911
3898
 
3912
- if (!active$1.length) {
3913
- css(document.body, 'overflowY', '');
3914
- }
3915
-
3916
3899
  css(this.$el, 'zIndex', '');
3917
3900
 
3918
3901
  if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
@@ -4029,16 +4012,22 @@
4029
4012
  return () => events.forEach((fn) => fn());
4030
4013
  }
4031
4014
 
4015
+ let prevented;
4032
4016
  function preventBackgroundScroll() {
4033
- const { body, documentElement } = document;
4034
- css(body, {
4035
- overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4036
- touchAction: 'none' });
4017
+ if (prevented) {
4018
+ return noop;
4019
+ }
4020
+ prevented = true;
4021
+
4022
+ const { scrollingElement } = document;
4023
+ css(scrollingElement, {
4024
+ overflowY: 'hidden',
4025
+ touchAction: 'none',
4026
+ paddingRight: width(window) - scrollingElement.clientWidth });
4037
4027
 
4038
- css(documentElement, 'overflowY', 'hidden');
4039
4028
  return () => {
4040
- css(documentElement, 'overflowY', '');
4041
- css(body, { overflowY: '', touchAction: '' });
4029
+ prevented = false;
4030
+ css(scrollingElement, { overflowY: '', touchAction: '', paddingRight: '' });
4042
4031
  };
4043
4032
  }
4044
4033
 
@@ -4055,7 +4044,7 @@
4055
4044
  let active;
4056
4045
 
4057
4046
  var drop = {
4058
- mixins: [Container, Lazyload, Position, Togglable],
4047
+ mixins: [Container, Lazyload, Position, Style, Togglable],
4059
4048
 
4060
4049
  args: 'pos',
4061
4050
 
@@ -4063,10 +4052,13 @@
4063
4052
  mode: 'list',
4064
4053
  toggle: Boolean,
4065
4054
  boundary: Boolean,
4066
- boundaryAlign: Boolean,
4055
+ target: Boolean,
4056
+ targetX: Boolean,
4057
+ targetY: Boolean,
4058
+ stretch: Boolean,
4067
4059
  delayShow: Number,
4068
4060
  delayHide: Number,
4069
- display: String,
4061
+ autoUpdate: Boolean,
4070
4062
  clsDrop: String,
4071
4063
  animateOut: Boolean,
4072
4064
  bgScroll: Boolean },
@@ -4075,17 +4067,32 @@
4075
4067
  data: {
4076
4068
  mode: ['click', 'hover'],
4077
4069
  toggle: '- *',
4078
- boundary: true,
4079
- boundaryAlign: false,
4070
+ boundary: false,
4071
+ target: false,
4072
+ targetX: false,
4073
+ targetY: false,
4074
+ stretch: false,
4080
4075
  delayShow: 0,
4081
4076
  delayHide: 800,
4082
- display: null,
4077
+ autoUpdate: true,
4083
4078
  clsDrop: false,
4079
+ animateOut: false,
4080
+ bgScroll: true,
4084
4081
  animation: ['uk-animation-fade'],
4085
4082
  cls: 'uk-open',
4086
- container: false,
4087
- animateOut: false,
4088
- bgScroll: true },
4083
+ container: false },
4084
+
4085
+
4086
+ computed: {
4087
+ target(_ref, $el) {let { target, targetX, targetY } = _ref;
4088
+ targetX = targetX || target || this.targetEl;
4089
+ targetY = targetY || target || this.targetEl;
4090
+
4091
+ return [
4092
+ targetX === true ? window : query(targetX, $el),
4093
+ targetY === true ? window : query(targetY, $el)];
4094
+
4095
+ } },
4089
4096
 
4090
4097
 
4091
4098
  created() {
@@ -4099,18 +4106,19 @@
4099
4106
  connected() {
4100
4107
  addClass(this.$el, this.clsDrop);
4101
4108
 
4102
- if (this.toggle && !this.target) {
4103
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
4109
+ if (this.toggle && !this.targetEl) {
4110
+ this.targetEl = this.$create('toggle', query(this.toggle, this.$el), {
4104
4111
  target: this.$el,
4105
4112
  mode: this.mode }).
4106
4113
  $el;
4107
- attr(this.target, 'aria-haspopup', true);
4108
- this.lazyload(this.target);
4114
+ attr(this.targetEl, 'aria-haspopup', true);
4115
+ this.lazyload(this.targetEl);
4109
4116
  }
4110
4117
  },
4111
4118
 
4112
4119
  disconnected() {
4113
4120
  if (this.isActive()) {
4121
+ this.hide(false);
4114
4122
  active = null;
4115
4123
  }
4116
4124
  },
@@ -4136,7 +4144,7 @@
4136
4144
  return 'a[href^="#"]';
4137
4145
  },
4138
4146
 
4139
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4147
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4140
4148
  if (!defaultPrevented && hash && !within(hash, this.$el)) {
4141
4149
  this.hide(false);
4142
4150
  }
@@ -4244,21 +4252,22 @@
4244
4252
 
4245
4253
  this.tracker.init();
4246
4254
 
4247
- for (const handler of [
4255
+ const update = () => this.$emit();
4256
+ const handlers = [
4248
4257
  on(
4249
4258
  document,
4250
4259
  pointerDown$1,
4251
- (_ref2) => {let { target } = _ref2;return (
4260
+ (_ref3) => {let { target } = _ref3;return (
4252
4261
  !within(target, this.$el) &&
4253
4262
  once(
4254
4263
  document,
4255
4264
  pointerUp$1 + " " + pointerCancel + " scroll",
4256
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4265
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
4257
4266
  if (
4258
4267
  !defaultPrevented &&
4259
4268
  type === pointerUp$1 &&
4260
4269
  target === newTarget &&
4261
- !(this.target && within(target, this.target)))
4270
+ !(this.targetEl && within(target, this.targetEl)))
4262
4271
  {
4263
4272
  this.hide(false);
4264
4273
  }
@@ -4273,29 +4282,28 @@
4273
4282
  }
4274
4283
  }),
4275
4284
 
4285
+ on(window, 'resize', update),
4286
+
4287
+ (() => {
4288
+ const observer = observeResize(
4289
+ scrollParents(this.$el).concat(this.targetEl),
4290
+ update);
4291
+
4292
+ return () => observer.disconnect();
4293
+ })(),
4294
+
4295
+ ...(this.autoUpdate ?
4296
+ [on([document, scrollParents(this.$el)], 'scroll', update)] :
4297
+ []),
4298
+
4276
4299
  ...(this.bgScroll ?
4277
4300
  [] :
4278
- [preventOverscroll(this.$el), preventBackgroundScroll()]),
4301
+ [preventOverscroll(this.$el), preventBackgroundScroll()])];
4302
+
4303
+
4304
+ once(this.$el, 'hide', () => handlers.forEach((handler) => handler()), {
4305
+ self: true });
4279
4306
 
4280
- ...(this.display === 'static' && this.align !== 'stretch' ?
4281
- [] :
4282
- (() => {
4283
- const handler = () => this.$emit();
4284
- return [
4285
- on(window, 'resize', handler),
4286
- on(document, 'scroll', handler, true),
4287
- (() => {
4288
- const observer = observeResize(
4289
- scrollParents(this.$el),
4290
- handler);
4291
-
4292
- return () => observer.disconnect();
4293
- })()];
4294
-
4295
- })())])
4296
- {
4297
- once(this.$el, 'hide', handler, { self: true });
4298
- }
4299
4307
  } },
4300
4308
 
4301
4309
 
@@ -4312,7 +4320,7 @@
4312
4320
  {
4313
4321
  name: 'hide',
4314
4322
 
4315
- handler(_ref4) {let { target } = _ref4;
4323
+ handler(_ref5) {let { target } = _ref5;
4316
4324
  if (this.$el !== target) {
4317
4325
  active =
4318
4326
  active === null && within(target, this.$el) && this.isToggled() ?
@@ -4336,12 +4344,12 @@
4336
4344
 
4337
4345
 
4338
4346
  methods: {
4339
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4340
- if (this.isToggled() && target && this.target && target !== this.target) {
4347
+ show(target, delay) {if (target === void 0) {target = this.targetEl;}if (delay === void 0) {delay = true;}
4348
+ if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {
4341
4349
  this.hide(false, false);
4342
4350
  }
4343
4351
 
4344
- this.target = target;
4352
+ this.targetEl = target;
4345
4353
 
4346
4354
  this.clearTimers();
4347
4355
 
@@ -4404,60 +4412,69 @@
4404
4412
 
4405
4413
  position() {
4406
4414
  removeClass(this.$el, this.clsDrop + "-stack");
4407
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4408
- toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4415
+ attr(this.$el, 'style', this._style);
4409
4416
 
4410
- const boundary = query(this.boundary, this.$el);
4411
- const target = boundary && this.boundaryAlign ? boundary : this.target;
4412
- const [scrollParent] = scrollParents(
4413
- boundary && this.boundaryAlign ? boundary : this.$el);
4417
+ // Ensure none positioned element does not generate scrollbars
4418
+ this.$el.hidden = true;
4414
4419
 
4415
- const scrollParentOffset = offset(scrollParent);
4416
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4420
+ const boundary = query(this.boundary, this.$el);
4421
+ const boundaryOffset = offsetViewport(boundary || window);
4422
+ const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4417
4423
  const viewportOffset = this.getViewportOffset(this.$el);
4418
4424
 
4419
- css(this.$el, 'maxWidth', '');
4420
- const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4425
+ const dirs = [
4426
+ [0, ['x', 'width', 'left', 'right']],
4427
+ [1, ['y', 'height', 'top', 'bottom']]];
4421
4428
 
4422
- if (this.align === 'justify') {
4423
- const prop = this.axis === 'y' ? 'width' : 'height';
4424
- css(
4425
- this.$el,
4426
- prop,
4427
- Math.min(
4428
- (boundary ? boundaryOffset : offset(this.target))[prop],
4429
- scrollParentOffset[prop] - 2 * viewportOffset));
4430
-
4431
-
4432
- } else if (this.align === 'stretch') {
4433
- this.flip = this.axis === 'y' ? 'x' : 'y';
4434
- this.display = 'static';
4435
-
4436
- const viewport = offsetViewport(scrollParent);
4437
- const targetDim = offset(target);
4438
- const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4439
-
4440
- css(this.$el, {
4441
- width:
4442
- this.axis === 'y' ?
4443
- viewport.width :
4444
- (this.dir === 'left' ?
4445
- targetDim.left - viewport.left :
4446
- viewport.right - targetDim.right) - elOffset,
4447
- height:
4448
- this.axis === 'x' ?
4449
- viewport.height :
4450
- (this.dir === 'top' ?
4451
- targetDim.top - viewport.top :
4452
- viewport.bottom - targetDim.bottom) - elOffset });
4453
-
4454
- } else if (this.$el.offsetWidth > maxWidth) {
4429
+
4430
+ for (const [i, [axis, prop]] of dirs) {
4431
+ if (this.axis !== axis && includes([axis, true], this.stretch)) {
4432
+ css(this.$el, {
4433
+ [prop]: Math.min(
4434
+ boundaryOffset[prop],
4435
+ viewports[i][prop] - 2 * viewportOffset),
4436
+
4437
+ ["overflow-" + axis]: 'auto' });
4438
+
4439
+ }
4440
+ }
4441
+
4442
+ const maxWidth = viewports[0].width - 2 * viewportOffset;
4443
+
4444
+ if (this.$el.offsetWidth > maxWidth) {
4455
4445
  addClass(this.$el, this.clsDrop + "-stack");
4456
4446
  }
4457
4447
 
4458
4448
  css(this.$el, 'maxWidth', maxWidth);
4459
4449
 
4460
- this.positionAt(this.$el, target, boundary);
4450
+ this.$el.hidden = false;
4451
+
4452
+ this.positionAt(this.$el, this.target, boundary);
4453
+
4454
+ for (const [i, [axis, prop, start, end]] of dirs) {
4455
+ if (this.axis === axis && includes([axis, true], this.stretch)) {
4456
+ const positionOffset = Math.abs(this.getPositionOffset(this.$el));
4457
+ const targetOffset = offset(this.target[i]);
4458
+ const elOffset = offset(this.$el);
4459
+
4460
+ css(this.$el, {
4461
+ [prop]:
4462
+ (targetOffset[start] > elOffset[start] ?
4463
+ targetOffset[start] -
4464
+ Math.max(
4465
+ boundaryOffset[start],
4466
+ viewports[i][start] + viewportOffset) :
4467
+
4468
+ Math.min(
4469
+ boundaryOffset[end],
4470
+ viewports[i][end] - viewportOffset) -
4471
+ targetOffset[end]) - positionOffset,
4472
+ ["overflow-" + axis]: 'auto' });
4473
+
4474
+
4475
+ this.positionAt(this.$el, this.target, boundary);
4476
+ }
4477
+ }
4461
4478
  } } };
4462
4479
 
4463
4480
 
@@ -4954,8 +4971,11 @@
4954
4971
  let minHeight = '';
4955
4972
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4956
4973
 
4974
+ const { body, scrollingElement } = document;
4957
4975
  const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4958
- const { height: viewportHeight } = offsetViewport(scrollElement);
4976
+ const { height: viewportHeight } = offsetViewport(
4977
+ scrollElement === body ? scrollingElement : scrollElement);
4978
+
4959
4979
 
4960
4980
  if (this.expand) {
4961
4981
  minHeight = Math.max(
@@ -4965,7 +4985,6 @@
4965
4985
  0);
4966
4986
 
4967
4987
  } else {
4968
- const { body, scrollingElement } = document;
4969
4988
  const isScrollingElement =
4970
4989
  scrollingElement === scrollElement || body === scrollElement;
4971
4990
 
@@ -5227,7 +5246,7 @@
5227
5246
 
5228
5247
  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>";
5229
5248
 
5230
- 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>";
5249
+ 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>";
5231
5250
 
5232
5251
  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>";
5233
5252
 
@@ -5612,7 +5631,7 @@
5612
5631
  function toMedia(value, element) {
5613
5632
  if (isString(value)) {
5614
5633
  if (startsWith(value, '@')) {
5615
- value = toFloat(css(element, "uk-breakpoint-" + value.substr(1)));
5634
+ value = toFloat(css(element, "--uk-breakpoint-" + value.substr(1)));
5616
5635
  } else if (isNaN(value)) {
5617
5636
  return value;
5618
5637
  }
@@ -5829,7 +5848,9 @@
5829
5848
  align: String,
5830
5849
  offset: Number,
5831
5850
  boundary: Boolean,
5832
- boundaryAlign: Boolean,
5851
+ target: Boolean,
5852
+ targetX: Boolean,
5853
+ targetY: Boolean,
5833
5854
  clsDrop: String,
5834
5855
  delayShow: Number,
5835
5856
  delayHide: Number,
@@ -5846,9 +5867,12 @@
5846
5867
  offset: undefined,
5847
5868
  delayShow: undefined,
5848
5869
  delayHide: undefined,
5849
- boundaryAlign: undefined,
5850
- flip: 'x',
5870
+ flip: false,
5871
+ shift: true,
5851
5872
  boundary: true,
5873
+ target: false,
5874
+ targetX: false,
5875
+ targetY: false,
5852
5876
  dropbar: false,
5853
5877
  dropbarAnchor: false,
5854
5878
  duration: 200,
@@ -5883,7 +5907,7 @@
5883
5907
  },
5884
5908
 
5885
5909
  watch(dropbar) {
5886
- addClass(dropbar, 'uk-navbar-dropbar');
5910
+ addClass(dropbar, 'uk-dropbar', 'uk-dropbar-top', 'uk-navbar-dropbar');
5887
5911
  },
5888
5912
 
5889
5913
  immediate: true },
@@ -5899,7 +5923,7 @@
5899
5923
 
5900
5924
  if (this.dropContainer !== $el) {
5901
5925
  for (const el of $$("." + clsDrop, this.dropContainer)) {var _this$getDropdown;
5902
- const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.target;
5926
+ const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.targetEl;
5903
5927
  if (!includes(dropdowns, el) && target && within(target, this.$el)) {
5904
5928
  dropdowns.push(el);
5905
5929
  }
@@ -5961,8 +5985,8 @@
5961
5985
  if (
5962
5986
  active &&
5963
5987
  includes(active.mode, 'hover') &&
5964
- active.target &&
5965
- !within(active.target, current) &&
5988
+ active.targetEl &&
5989
+ !within(active.targetEl, current) &&
5966
5990
  !active.isDelaying)
5967
5991
  {
5968
5992
  active.hide(false);
@@ -5984,7 +6008,7 @@
5984
6008
  if (keyCode === keyMap.DOWN && hasAttr(current, 'aria-expanded')) {
5985
6009
  e.preventDefault();
5986
6010
 
5987
- if (!active || active.target !== current) {
6011
+ if (!active || active.targetEl !== current) {
5988
6012
  current.click();
5989
6013
  once(this.dropContainer, 'show', (_ref8) => {let { target } = _ref8;return (
5990
6014
  focusFirstFocusableElement(target));});
@@ -6034,8 +6058,8 @@
6034
6058
  }
6035
6059
  }
6036
6060
 
6037
- if (keyCode === keyMap.ESC) {var _active$target;
6038
- active == null ? void 0 : (_active$target = active.target) == null ? void 0 : _active$target.focus();
6061
+ if (keyCode === keyMap.ESC) {var _active$targetEl;
6062
+ active == null ? void 0 : (_active$targetEl = active.targetEl) == null ? void 0 : _active$targetEl.focus();
6039
6063
  }
6040
6064
 
6041
6065
  handleNavItemNavigation(e, this.toggles, active);
@@ -6106,39 +6130,19 @@
6106
6130
  return;
6107
6131
  }
6108
6132
 
6109
- this._observer = observeResize(target, () =>
6110
- this.transitionTo(
6111
- offset(target).bottom -
6112
- offset(this.dropbar).top +
6113
- toFloat(css(target, 'marginBottom')),
6114
- target));
6115
-
6116
-
6117
- } },
6118
-
6119
-
6120
- {
6121
- name: 'beforeposition',
6122
-
6123
- el() {
6124
- return this.dropContainer;
6125
- },
6126
-
6127
- filter() {
6128
- return this.dropbar;
6129
- },
6130
-
6131
- handler(e, element, target, options) {
6132
- if (!this.isDropbarDrop(element)) {
6133
- return;
6134
- }
6135
-
6136
- const dropbarOffset = offset(this.dropbar);
6133
+ this._observer = observeResize(target, () => {
6134
+ const targetOffsets = parents(target, "." + this.clsDrop).
6135
+ concat(target).
6136
+ map((el) => offset(el));
6137
+ const minTop = Math.min(...targetOffsets.map((_ref11) => {let { top } = _ref11;return top;}));
6138
+ const maxBottom = Math.max(...targetOffsets.map((_ref12) => {let { bottom } = _ref12;return bottom;}));
6139
+ const dropbarOffset = offset(this.dropbar);
6140
+ css(this.dropbar, 'top', this.dropbar.offsetTop - (dropbarOffset.top - minTop));
6141
+ this.transitionTo(
6142
+ maxBottom - minTop + toFloat(css(target, 'marginBottom')),
6143
+ target);
6137
6144
 
6138
- css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
6139
-
6140
- options.offset[1] = dropbarOffset.top - offset(target).bottom;
6141
- options.viewportOffset += dropbarOffset.left;
6145
+ });
6142
6146
  } },
6143
6147
 
6144
6148
 
@@ -6159,7 +6163,7 @@
6159
6163
  if (
6160
6164
  matches(this.dropbar, ':hover') &&
6161
6165
  (active == null ? void 0 : active.$el) === e.target &&
6162
- !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6166
+ !this.toggles.some((el) => active.targetEl !== el && matches(el, ':focus')))
6163
6167
  {
6164
6168
  e.preventDefault();
6165
6169
  }
@@ -6177,7 +6181,7 @@
6177
6181
  return this.dropbar;
6178
6182
  },
6179
6183
 
6180
- handler(_ref11) {let { target } = _ref11;
6184
+ handler(_ref13) {let { target } = _ref13;
6181
6185
  if (!this.isDropbarDrop(target)) {
6182
6186
  return;
6183
6187
  }
@@ -6195,7 +6199,7 @@
6195
6199
 
6196
6200
  methods: {
6197
6201
  getActive() {
6198
- return active && within(active.target, this.$el) && active;
6202
+ return includes(this.dropdowns, active == null ? void 0 : active.$el) && active;
6199
6203
  },
6200
6204
 
6201
6205
  transitionTo(newHeight, el) {
@@ -6228,15 +6232,14 @@
6228
6232
  },
6229
6233
 
6230
6234
  isDropbarDrop(el) {
6231
- const drop = this.getDropdown(el);
6232
- return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
6235
+ return this.getDropdown(el) && hasClass(el, this.clsDrop);
6233
6236
  } } };
6234
6237
 
6235
6238
 
6236
6239
 
6237
6240
  function handleNavItemNavigation(e, toggles, active) {
6238
6241
  const { current, keyCode } = e;
6239
- const target = (active == null ? void 0 : active.target) || current;
6242
+ const target = (active == null ? void 0 : active.targetEl) || current;
6240
6243
  const i = toggles.indexOf(target);
6241
6244
 
6242
6245
  // Left
@@ -6604,6 +6607,14 @@
6604
6607
  offset: 0 },
6605
6608
 
6606
6609
 
6610
+ connected() {
6611
+ registerClick(this);
6612
+ },
6613
+
6614
+ disconnected() {
6615
+ unregisterClick(this);
6616
+ },
6617
+
6607
6618
  methods: {
6608
6619
  async scrollTo(el) {
6609
6620
  el = el && $(el) || document.body;
@@ -6612,20 +6623,39 @@
6612
6623
  await scrollIntoView(el, { offset: this.offset });
6613
6624
  trigger(this.$el, 'scrolled', [this, el]);
6614
6625
  }
6615
- } },
6626
+ } } };
6616
6627
 
6617
6628
 
6618
- events: {
6619
- click(e) {
6620
- if (e.defaultPrevented) {
6621
- return;
6622
- }
6623
6629
 
6624
- e.preventDefault();
6625
- this.scrollTo(getTargetElement(this.$el));
6626
- } } };
6630
+ const components$2 = new Set();
6631
+ function registerClick(cmp) {
6632
+ if (!components$2.size) {
6633
+ on(document, 'click', clickHandler);
6634
+ }
6627
6635
 
6636
+ components$2.add(cmp);
6637
+ }
6628
6638
 
6639
+ function unregisterClick(cmp) {
6640
+ components$2.delete(cmp);
6641
+
6642
+ if (!components$2.length) {
6643
+ off(document, 'click', clickHandler);
6644
+ }
6645
+ }
6646
+
6647
+ function clickHandler(e) {
6648
+ if (e.defaultPrevented) {
6649
+ return;
6650
+ }
6651
+
6652
+ for (const component of components$2) {
6653
+ if (within(e.target, component.$el)) {
6654
+ e.preventDefault();
6655
+ component.scrollTo(getTargetElement(component.$el));
6656
+ }
6657
+ }
6658
+ }
6629
6659
 
6630
6660
  function getTargetElement(el) {
6631
6661
  return document.getElementById(decodeURIComponent(el.hash).substring(1));
@@ -7588,7 +7618,7 @@
7588
7618
 
7589
7619
 
7590
7620
  {
7591
- name: 'toggled',
7621
+ name: 'hide show',
7592
7622
 
7593
7623
  self: true,
7594
7624
 
@@ -7596,10 +7626,8 @@
7596
7626
  return this.target;
7597
7627
  },
7598
7628
 
7599
- handler(e, toggled) {
7600
- if (e.target === this.target[0]) {
7601
- this.updateAria(toggled);
7602
- }
7629
+ handler(_ref2) {let { type } = _ref2;
7630
+ this.updateAria(type === 'show');
7603
7631
  } },
7604
7632
 
7605
7633
 
@@ -9480,7 +9508,9 @@
9480
9508
  this.$mount(
9481
9509
  append(
9482
9510
  container, "<div class=\"" +
9483
- this.clsMsg + (this.status ? " " + this.clsMsg + "-" + this.status : '') + "\"> <a href class=\"" +
9511
+ this.clsMsg + (
9512
+ this.status ? " " + this.clsMsg + "-" + this.status : '') + "\" role=\"alert\"> <a href class=\"" +
9513
+
9484
9514
  this.clsClose + "\" data-uk-close></a> <div>" +
9485
9515
  this.message + "</div> </div>"));
9486
9516