uikit 3.14.4-dev.fea9fd466 → 3.14.4-dev.fef7412a0

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 (121) hide show
  1. package/CHANGELOG.md +31 -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 +304 -91
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +304 -91
  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 +1 -1
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +1 -1
  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 +1 -1
  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 +484 -452
  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 +487 -453
  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/navbar.js +30 -45
  52. package/src/js/core/offcanvas.js +8 -4
  53. package/src/js/core/scroll.js +37 -10
  54. package/src/js/core/toggle.js +3 -5
  55. package/src/js/mixin/modal.js +15 -12
  56. package/src/js/mixin/position.js +21 -22
  57. package/src/js/mixin/style.js +11 -0
  58. package/src/js/mixin/togglable.js +88 -124
  59. package/src/js/util/animation.js +9 -7
  60. package/src/js/util/class.js +3 -1
  61. package/src/js/util/filter.js +3 -7
  62. package/src/js/util/position.js +107 -107
  63. package/src/js/util/viewport.js +1 -1
  64. package/src/less/components/_import.less +1 -0
  65. package/src/less/components/drop.less +1 -18
  66. package/src/less/components/dropbar.less +126 -0
  67. package/src/less/components/dropdown.less +6 -20
  68. package/src/less/components/nav.less +211 -22
  69. package/src/less/components/navbar.less +17 -51
  70. package/src/less/theme/_import.less +1 -0
  71. package/src/less/theme/dropbar.less +44 -0
  72. package/src/less/theme/dropdown.less +0 -11
  73. package/src/less/theme/nav.less +46 -0
  74. package/src/less/theme/navbar.less +2 -37
  75. package/src/scss/components/_import.scss +1 -0
  76. package/src/scss/components/drop.scss +1 -18
  77. package/src/scss/components/dropbar.scss +126 -0
  78. package/src/scss/components/dropdown.scss +6 -20
  79. package/src/scss/components/nav.scss +160 -21
  80. package/src/scss/components/navbar.scss +17 -51
  81. package/src/scss/mixins-theme.scss +79 -35
  82. package/src/scss/mixins.scss +75 -3
  83. package/src/scss/theme/_import.scss +1 -0
  84. package/src/scss/theme/dropbar.scss +44 -0
  85. package/src/scss/theme/dropdown.scss +0 -8
  86. package/src/scss/theme/nav.scss +44 -0
  87. package/src/scss/theme/navbar.scss +2 -10
  88. package/src/scss/variables-theme.scss +55 -12
  89. package/src/scss/variables.scss +43 -7
  90. package/tests/accordion.html +2 -2
  91. package/tests/alert.html +2 -2
  92. package/tests/countdown.html +1 -1
  93. package/tests/drop.html +446 -416
  94. package/tests/dropbar.html +458 -0
  95. package/tests/dropdown.html +8 -470
  96. package/tests/filter.html +9 -12
  97. package/tests/form.html +1 -1
  98. package/tests/index.html +124 -105
  99. package/tests/js/index.js +1 -4
  100. package/tests/lightbox.html +5 -5
  101. package/tests/list.html +8 -8
  102. package/tests/modal.html +13 -13
  103. package/tests/nav.html +121 -12
  104. package/tests/navbar.html +111 -220
  105. package/tests/offcanvas.html +10 -14
  106. package/tests/parallax.html +1 -1
  107. package/tests/position.html +18 -16
  108. package/tests/progress.html +9 -9
  109. package/tests/scroll.html +7 -10
  110. package/tests/search.html +6 -6
  111. package/tests/slider.html +6 -5
  112. package/tests/slideshow.html +8 -8
  113. package/tests/sortable.html +6 -8
  114. package/tests/sticky-navbar.html +15 -15
  115. package/tests/sticky.html +8 -8
  116. package/tests/switcher.html +1 -1
  117. package/tests/tab.html +1 -1
  118. package/tests/table.html +7 -7
  119. package/tests/toggle.html +2 -2
  120. package/tests/tooltip.html +1 -1
  121. package/tests/upload.html +11 -11
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.fea9fd466 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.fef7412a0 | 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) {
@@ -1911,7 +1911,7 @@
1911
1911
  // iOS 12 returns <body> as scrollingElement
1912
1912
  viewportElement = documentElement;
1913
1913
  } else {
1914
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1914
+ rect[start] += toFloat(css(viewportElement, "border-" + start + "-width"));
1915
1915
  }
1916
1916
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1917
1917
  rect[end] = rect[prop] + rect[start];
@@ -1936,126 +1936,65 @@
1936
1936
  ...options.attach },
1937
1937
 
1938
1938
  offset: [0, 0],
1939
+ placement: [],
1939
1940
  ...options };
1940
1941
 
1941
1942
 
1942
- const dim = options.flip ?
1943
- attachToWithFlip(element, target, options) :
1944
- attachTo(element, target, options);
1945
-
1946
- offset(element, dim);
1947
- }
1948
-
1949
- function attachTo(element, target, options) {
1950
- let { attach, offset: offsetBy } = {
1951
- attach: {
1952
- element: ['left', 'top'],
1953
- target: ['left', 'top'],
1954
- ...options.attach },
1955
-
1956
- offset: [0, 0],
1957
- ...options };
1958
-
1959
-
1960
- const position = offset(element);
1961
- const targetOffset = offset(target);
1962
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1963
- position[start] = position[dir] =
1964
- targetOffset[start] +
1965
- moveBy(attach.target[i], end, targetOffset[prop]) -
1966
- moveBy(attach.element[i], end, position[prop]) +
1967
- +offsetBy[i];
1968
- position[end] = position[start] + position[prop];
1943
+ if (!isArray(target)) {
1944
+ target = [target, target];
1969
1945
  }
1970
- return position;
1971
- }
1972
1946
 
1973
- function moveBy(start, end, dim) {
1974
- return start === 'center' ? dim / 2 : start === end ? dim : 0;
1947
+ offset(element, getPosition(element, target, options));
1975
1948
  }
1976
1949
 
1977
- function attachToWithFlip(element, target, options) {
1950
+ function getPosition(element, target, options) {
1978
1951
  const position = attachTo(element, target, options);
1979
- const targetDim = offset(target);
1980
1952
 
1981
1953
  let {
1982
- flip,
1983
1954
  attach: { element: elAttach, target: targetAttach },
1984
1955
  offset: elOffset,
1985
1956
  boundary,
1986
- viewport,
1987
- viewportOffset } =
1957
+ viewportOffset,
1958
+ placement } =
1988
1959
  options;
1989
1960
 
1990
- let viewports = scrollParents(element);
1991
- if (boundary === target) {
1992
- viewports = viewports.filter((viewport) => viewport !== boundary);
1993
- }
1994
- const [scrollElement] = viewports;
1995
- viewports.push(viewport);
1996
-
1997
- const offsetPosition = { ...position };
1998
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1999
- if (flip !== true && !includes(flip, dir)) {
2000
- continue;
2001
- }
2002
-
2003
- const willFlip =
2004
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
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;
2005
1965
 
2006
- viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1966
+ let viewport = getIntersectionArea(...viewports.map(offsetViewport));
2007
1967
 
2008
1968
  if (viewportOffset) {
2009
1969
  viewport[start] += viewportOffset;
2010
1970
  viewport[end] -= viewportOffset;
2011
1971
  }
2012
1972
 
2013
- if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2014
- viewport = getIntersectionArea(viewport, offset(boundary));
1973
+ if (boundary) {
1974
+ viewport = getIntersectionArea(viewport, offsetViewport(boundary));
2015
1975
  }
2016
1976
 
2017
- const isInStartBoundary = position[start] >= viewport[start];
2018
- const isInEndBoundary = position[end] <= viewport[end];
1977
+ const isInStartViewport = position[start] >= viewport[start];
1978
+ const isInEndViewport = position[end] <= viewport[end];
2019
1979
 
2020
- if (isInStartBoundary && isInEndBoundary) {
1980
+ if (isInStartViewport && isInEndViewport) {
2021
1981
  continue;
2022
1982
  }
2023
1983
 
2024
- let offsetBy;
1984
+ let offsetBy = 0;
2025
1985
 
2026
1986
  // Flip
2027
- if (willFlip) {
1987
+ if (placement[i] === 'flip') {
2028
1988
  if (
2029
- elAttach[i] === end && isInStartBoundary ||
2030
- elAttach[i] === start && isInEndBoundary)
1989
+ targetAttach[i] === end && isInEndViewport ||
1990
+ targetAttach[i] === start && isInStartViewport)
2031
1991
  {
2032
1992
  continue;
2033
1993
  }
2034
1994
 
2035
- offsetBy =
2036
- (elAttach[i] === start ?
2037
- -position[prop] :
2038
- elAttach[i] === end ?
2039
- position[prop] :
2040
- 0) + (
2041
- targetAttach[i] === start ?
2042
- targetDim[prop] :
2043
- targetAttach[i] === end ?
2044
- -targetDim[prop] :
2045
- 0) -
2046
- elOffset[i] * 2;
2047
-
2048
- if (
2049
- !isInScrollArea(
2050
- {
2051
- ...position,
2052
- [start]: position[start] + offsetBy,
2053
- [end]: position[end] + offsetBy },
1995
+ offsetBy = flip(element, target, options, i)[start] - position[start];
2054
1996
 
2055
- scrollElement,
2056
- i))
2057
-
2058
- {
1997
+ if (!isInScrollArea(applyOffset(position, offsetBy, i), scrollElement, i)) {
2059
1998
  if (isInScrollArea(position, scrollElement, i)) {
2060
1999
  continue;
2061
2000
  }
@@ -2064,27 +2003,27 @@
2064
2003
  return false;
2065
2004
  }
2066
2005
 
2067
- if (flip === true || includes(flip, dirs[1 - i][1])) {
2068
- const newPos = attachToWithFlip(element, target, {
2069
- ...options,
2070
- attach: {
2071
- element: elAttach.map(flipDir).reverse(),
2072
- 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() },
2073
2011
 
2074
- offset: elOffset.reverse(),
2075
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2076
- recursion: true });
2012
+ offset: elOffset.reverse(),
2013
+ placement: placement.reverse(),
2014
+ recursion: true });
2077
2015
 
2078
2016
 
2079
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2080
- return newPos;
2081
- }
2017
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2018
+ return newPos;
2082
2019
  }
2020
+
2083
2021
  continue;
2084
2022
  }
2085
2023
 
2086
- // Move
2087
- } else {
2024
+ // Shift
2025
+ } else if (placement[i] === 'shift') {
2026
+ const targetDim = offset(target[i]);
2088
2027
  offsetBy =
2089
2028
  clamp(
2090
2029
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2093,13 +2032,54 @@
2093
2032
  position[start];
2094
2033
  }
2095
2034
 
2096
- offsetPosition[start] = position[dir] = position[start] + offsetBy;
2097
- offsetPosition[end] += offsetBy;
2035
+ offsetPosition = applyOffset(offsetPosition, offsetBy, i);
2098
2036
  }
2099
2037
 
2100
2038
  return offsetPosition;
2101
2039
  }
2102
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
+
2103
2083
  function getIntersectionArea() {
2104
2084
  let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2105
2085
  for (const rect of rects) {
@@ -2120,12 +2100,32 @@
2120
2100
  return position[start] >= viewport[start] && position[end] <= viewport[end];
2121
2101
  }
2122
2102
 
2123
- function intersectLine(dimA, dimB, dir) {
2124
- const [,, start, end] = dirs[dir];
2125
- 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;
2126
2126
  }
2127
2127
 
2128
- function flipDir(prop) {
2128
+ function flipAxis(prop) {
2129
2129
  for (let i = 0; i < dirs.length; i++) {
2130
2130
  const index = dirs[i].indexOf(prop);
2131
2131
  if (~index) {
@@ -2138,9 +2138,7 @@
2138
2138
  __proto__: null,
2139
2139
  ajax: ajax,
2140
2140
  getImage: getImage,
2141
- transition: transition,
2142
2141
  Transition: Transition,
2143
- animate: animate$1,
2144
2142
  Animation: Animation,
2145
2143
  attr: attr,
2146
2144
  hasAttr: hasAttr,
@@ -2445,7 +2443,11 @@
2445
2443
  }
2446
2444
 
2447
2445
  if (write && result !== false) {
2448
- fastdom.write(() => write.call(this, this._data, types));
2446
+ fastdom.write(() => {
2447
+ if (this._connected) {
2448
+ write.call(this, this._data, types);
2449
+ }
2450
+ });
2449
2451
  }
2450
2452
  }
2451
2453
  }
@@ -2594,7 +2596,7 @@
2594
2596
 
2595
2597
  value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2596
2598
 
2597
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2599
+ if (prop === 'target' && startsWith(value, '_')) {
2598
2600
  continue;
2599
2601
  }
2600
2602
 
@@ -2605,7 +2607,7 @@
2605
2607
 
2606
2608
  for (const key in options) {
2607
2609
  const prop = camelize(key);
2608
- if (props[prop] !== undefined) {
2610
+ if (!isUndefined(props[prop])) {
2609
2611
  data$1[prop] = coerce$1(props[prop], options[key]);
2610
2612
  }
2611
2613
  }
@@ -2934,7 +2936,7 @@
2934
2936
  UIkit.data = '__uikit__';
2935
2937
  UIkit.prefix = 'uk-';
2936
2938
  UIkit.options = {};
2937
- UIkit.version = '3.14.4-dev.fea9fd466';
2939
+ UIkit.version = '3.14.4-dev.fef7412a0';
2938
2940
 
2939
2941
  globalAPI(UIkit);
2940
2942
  hooksAPI(UIkit);
@@ -3039,27 +3041,7 @@
3039
3041
  origin: false,
3040
3042
  transition: 'ease',
3041
3043
  clsEnter: 'uk-togglabe-enter',
3042
- clsLeave: 'uk-togglabe-leave',
3043
-
3044
- initProps: {
3045
- overflow: '',
3046
- maxHeight: '',
3047
- paddingTop: '',
3048
- paddingBottom: '',
3049
- marginTop: '',
3050
- marginBottom: '',
3051
- boxShadow: '' },
3052
-
3053
-
3054
- hideProps: {
3055
- overflow: 'hidden',
3056
- maxHeight: 0,
3057
- paddingTop: 0,
3058
- paddingBottom: 0,
3059
- marginTop: 0,
3060
- marginBottom: 0,
3061
- boxShadow: 'none' } },
3062
-
3044
+ clsLeave: 'uk-togglabe-leave' },
3063
3045
 
3064
3046
 
3065
3047
  computed: {
@@ -3068,7 +3050,7 @@
3068
3050
  },
3069
3051
 
3070
3052
  hasTransition(_ref2) {let { animation } = _ref2;
3071
- return startsWith(animation[0], 'slide');
3053
+ return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
3072
3054
  } },
3073
3055
 
3074
3056
 
@@ -3161,122 +3143,105 @@
3161
3143
  };
3162
3144
  }
3163
3145
 
3164
- function toggleTransition(cmp) {
3165
- switch (cmp.animation[0]) {
3166
- case 'slide-left':
3167
- return slideHorizontal(cmp);
3168
- case 'slide-right':
3169
- return slideHorizontal(cmp, true);}
3170
-
3171
- return slide(cmp);
3172
- }
3173
-
3174
- function slide(_ref4)
3146
+ function toggleTransition(cmp) {var _cmp$animation$;
3147
+ const [mode = 'reveal', startProp = 'top'] = ((_cmp$animation$ = cmp.animation[0]) == null ? void 0 : _cmp$animation$.split('-')) || [];
3175
3148
 
3149
+ const dirs = [
3150
+ ['left', 'right'],
3151
+ ['top', 'bottom']];
3176
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;
3177
3159
 
3160
+ return async (el, show) => {
3161
+ let { duration, velocity, transition, _toggle } = cmp;
3178
3162
 
3163
+ let currentDim = dimensions(el)[dimProp];
3179
3164
 
3180
-
3181
-
3182
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3183
- return (el, show) => {
3184
3165
  const inProgress = Transition.inProgress(el);
3185
- const inner =
3186
- !inProgress && el.hasChildNodes() ?
3187
- toFloat(css(el.firstElementChild, 'marginTop')) +
3188
- toFloat(css(el.lastElementChild, 'marginBottom')) :
3189
- 0;
3190
- const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3191
-
3192
- const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3166
+ await Transition.cancel(el);
3193
3167
 
3194
- Transition.cancel(el);
3195
-
3196
- if (!isToggled(el)) {
3168
+ if (show) {
3197
3169
  _toggle(el, true);
3198
3170
  }
3199
3171
 
3200
- css(el, 'maxHeight', '');
3201
-
3202
- // Update child components first
3203
- fastdom.flush();
3204
-
3205
- const endHeight = toFloat(css(el, 'height')) + inner;
3206
- duration = velocity * endHeight + duration;
3207
-
3208
- css(el, { ...props, maxHeight: currentHeight });
3209
-
3210
- return (
3211
- show ?
3212
- Transition.start(
3213
- el,
3214
- { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3215
- duration * (1 - currentHeight / endHeight),
3216
- transition) :
3217
-
3218
- Transition.start(
3219
- el,
3220
- hideProps,
3221
- duration * (currentHeight / endHeight),
3222
- transition).
3223
- then(() => _toggle(el, false))).
3224
- then(() => css(el, initProps));
3225
- };
3226
- }
3227
-
3228
- function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3229
- return (el, show) => {
3230
- const visible = isVisible(el);
3231
- const marginLeft = toFloat(css(el, 'marginLeft'));
3232
-
3233
- Transition.cancel(el);
3234
-
3235
- const [scrollElement] = scrollParents(el.offsetParent);
3236
- css(scrollElement, 'overflowX', 'hidden');
3237
-
3238
- if (!isToggled(el)) {
3239
- _toggle(el, true);
3240
- }
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(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]) });
3241
3208
 
3242
- const width = toFloat(css(el, 'width'));
3243
- duration = velocity * width + duration;
3244
3209
 
3245
- const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3246
3210
 
3247
3211
  css(el, {
3248
- clipPath: right ? "polygon(0 0," +
3249
- percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3250
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)",
3251
- marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3252
-
3212
+ padding: 0,
3213
+ border: 0,
3214
+ [marginStartProp]: 0,
3215
+ width: dim.width,
3216
+ height: dim.height,
3217
+ overflow: 'hidden',
3218
+ [dimProp]: currentDim });
3253
3219
 
3254
- return (
3255
- show ?
3256
- Transition.start(
3257
- el,
3258
- {
3259
- clipPath: "polygon(0 0,100% 0,100% 100%,0 100%)",
3260
- marginLeft: 0 },
3261
3220
 
3262
- duration * (1 - percent / 100),
3263
- transition) :
3221
+ const percent = currentDim / endDim;
3222
+ duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
3223
+ const endProps = { [dimProp]: show ? endDim : 0 };
3264
3224
 
3265
- Transition.start(
3266
- el,
3267
- {
3268
- 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
+ }
3269
3229
 
3230
+ if (!end ^ mode === 'reveal') {
3231
+ css(wrapper, marginProp, -endDim + currentDim);
3232
+ Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
3233
+ }
3270
3234
 
3271
- 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);
3272
3240
 
3273
- duration * (percent / 100),
3274
- transition).
3275
- then(() => _toggle(el, false))).
3276
- then(() => {
3277
- css(scrollElement, 'overflowX', '');
3278
- css(el, { clipPath: '', marginLeft: '' });
3279
- });
3241
+ if (!show) {
3242
+ _toggle(el, false);
3243
+ }
3244
+ }
3280
3245
  };
3281
3246
  }
3282
3247
 
@@ -3301,6 +3266,7 @@
3301
3266
  mixins: [Class, Lazyload, Togglable],
3302
3267
 
3303
3268
  props: {
3269
+ animation: Boolean,
3304
3270
  targets: String,
3305
3271
  active: null,
3306
3272
  collapsible: Boolean,
@@ -3313,7 +3279,7 @@
3313
3279
  data: {
3314
3280
  targets: '> *',
3315
3281
  active: false,
3316
- animation: ['slide'],
3282
+ animation: true,
3317
3283
  collapsible: true,
3318
3284
  multiple: false,
3319
3285
  clsOpen: 'uk-open',
@@ -3359,7 +3325,7 @@
3359
3325
  hide(
3360
3326
  el,
3361
3327
  !hasClass(
3362
- this.items.find((item) => item.contains(el)),
3328
+ this.items.find((item) => within(el, item)),
3363
3329
  this.clsOpen));
3364
3330
 
3365
3331
 
@@ -3411,23 +3377,15 @@
3411
3377
  toggleClass(el, this.clsOpen, show);
3412
3378
  attr($(this.$props.toggle, el), 'aria-expanded', show);
3413
3379
 
3414
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3380
+ const content = $(this.content, el);
3415
3381
 
3416
- if (animate === false || !this.hasTransition) {
3382
+ if (animate === false || !this.animation) {
3383
+ content.hidden = !show;
3417
3384
  hide(content, !show);
3418
3385
  return;
3419
3386
  }
3420
3387
 
3421
- if (!el._wrapper) {
3422
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3423
- }
3424
-
3425
- hide(content, false);
3426
- await slide(this)(el._wrapper, show);
3427
- hide(content, !show);
3428
-
3429
- delete el._wrapper;
3430
- unwrap(content);
3388
+ await toggleTransition(this)(content, show);
3431
3389
 
3432
3390
  if (show) {
3433
3391
  const toggle = $(this.$props.toggle, el);
@@ -3453,18 +3411,17 @@
3453
3411
  args: 'animation',
3454
3412
 
3455
3413
  props: {
3414
+ animation: Boolean,
3456
3415
  close: String },
3457
3416
 
3458
3417
 
3459
3418
  data: {
3460
- animation: ['slide'],
3419
+ animation: true,
3461
3420
  selClose: '.uk-alert-close',
3462
- duration: 150,
3463
- hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3421
+ duration: 150 },
3464
3422
 
3465
3423
 
3466
- events: [
3467
- {
3424
+ events: {
3468
3425
  name: 'click',
3469
3426
 
3470
3427
  delegate() {
@@ -3474,16 +3431,39 @@
3474
3431
  handler(e) {
3475
3432
  e.preventDefault();
3476
3433
  this.close();
3477
- } }],
3478
-
3434
+ } },
3479
3435
 
3480
3436
 
3481
3437
  methods: {
3482
3438
  async close() {
3483
- await this.toggleElement(this.$el);
3439
+ await this.toggleElement(this.$el, false, animate$1(this));
3484
3440
  this.$destroy(true);
3485
3441
  } } };
3486
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
+
3487
3467
  var Video = {
3488
3468
  args: 'autoplay',
3489
3469
 
@@ -3632,13 +3612,17 @@
3632
3612
  props: {
3633
3613
  pos: String,
3634
3614
  offset: null,
3635
- flip: Boolean },
3615
+ flip: Boolean,
3616
+ shift: Boolean,
3617
+ inset: Boolean },
3636
3618
 
3637
3619
 
3638
3620
  data: {
3639
3621
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3622
+ offset: false,
3640
3623
  flip: true,
3641
- offset: false },
3624
+ shift: true,
3625
+ inset: false },
3642
3626
 
3643
3627
 
3644
3628
  connected() {
@@ -3650,17 +3634,19 @@
3650
3634
  methods: {
3651
3635
  positionAt(element, target, boundary) {
3652
3636
  let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3637
+ const placement = [this.flip && 'flip', this.shift && 'shift'];
3653
3638
 
3654
3639
  const attach = {
3655
- element: [flipPosition(this.dir), this.align],
3640
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3656
3641
  target: [this.dir, this.align] };
3657
3642
 
3658
3643
 
3659
3644
  if (this.axis === 'y') {
3660
3645
  for (const prop in attach) {
3661
- attach[prop] = attach[prop].reverse();
3646
+ attach[prop].reverse();
3662
3647
  }
3663
- offset = offset.reverse();
3648
+ offset.reverse();
3649
+ placement.reverse();
3664
3650
  }
3665
3651
 
3666
3652
  const [scrollElement] = scrollParents(element, /auto|scroll/);
@@ -3670,22 +3656,14 @@
3670
3656
  const elDim = dimensions(element);
3671
3657
  css(element, { top: -elDim.height, left: -elDim.width });
3672
3658
 
3673
- const args = [
3674
- element,
3675
- target,
3676
- {
3659
+ positionAt(element, target, {
3677
3660
  attach,
3678
3661
  offset,
3679
3662
  boundary,
3680
- flip: this.flip,
3681
- viewportOffset: this.getViewportOffset(element) }];
3663
+ placement,
3664
+ viewportOffset: this.getViewportOffset(element) });
3682
3665
 
3683
3666
 
3684
-
3685
- trigger(element, 'beforeposition', args);
3686
-
3687
- positionAt(...args);
3688
-
3689
3667
  // Restore scroll position
3690
3668
  scrollElement.scrollTop = scrollTop;
3691
3669
  scrollElement.scrollLeft = scrollLeft;
@@ -3697,12 +3675,14 @@
3697
3675
  this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3698
3676
  this.axis === 'x' ? 'width' : 'height',
3699
3677
  element) * (
3700
- includes(['left', 'top'], this.dir) ? -1 : 1));
3678
+
3679
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3680
+ this.inset ? -1 : 1));
3701
3681
 
3702
3682
  },
3703
3683
 
3704
3684
  getShiftOffset(element) {
3705
- return includes(['center', 'justify', 'stretch'], this.align) ?
3685
+ return this.align === 'center' ?
3706
3686
  0 :
3707
3687
  toPx(
3708
3688
  css(element, '--uk-position-shift-offset'),
@@ -3715,6 +3695,15 @@
3715
3695
  return toPx(css(element, '--uk-position-viewport-offset'));
3716
3696
  } } };
3717
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
+
3718
3707
  const active$1 = [];
3719
3708
 
3720
3709
  var Modal = {
@@ -3824,8 +3813,8 @@
3824
3813
 
3825
3814
 
3826
3815
  if (this.overlay) {
3827
- once(this.$el, 'hide', preventOverscroll(this.$el));
3828
- once(this.$el, 'hide', preventBackgroundScroll());
3816
+ once(this.$el, 'hidden', preventOverscroll(this.$el), { self: true });
3817
+ once(this.$el, 'hidden', preventBackgroundScroll(), { self: true });
3829
3818
  }
3830
3819
 
3831
3820
  if (this.stack) {
@@ -3907,10 +3896,6 @@
3907
3896
  active$1.splice(active$1.indexOf(this), 1);
3908
3897
  }
3909
3898
 
3910
- if (!active$1.length) {
3911
- css(document.body, 'overflowY', '');
3912
- }
3913
-
3914
3899
  css(this.$el, 'zIndex', '');
3915
3900
 
3916
3901
  if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
@@ -4027,16 +4012,22 @@
4027
4012
  return () => events.forEach((fn) => fn());
4028
4013
  }
4029
4014
 
4015
+ let prevented;
4030
4016
  function preventBackgroundScroll() {
4031
- const { body, documentElement } = document;
4032
- css(body, {
4033
- overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4034
- 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 });
4035
4027
 
4036
- css(documentElement, 'overflowY', 'hidden');
4037
4028
  return () => {
4038
- css(documentElement, 'overflowY', '');
4039
- css(body, { overflowY: '', touchAction: '' });
4029
+ prevented = false;
4030
+ css(scrollingElement, { overflowY: '', touchAction: '', paddingRight: '' });
4040
4031
  };
4041
4032
  }
4042
4033
 
@@ -4053,7 +4044,7 @@
4053
4044
  let active;
4054
4045
 
4055
4046
  var drop = {
4056
- mixins: [Container, Lazyload, Position, Togglable],
4047
+ mixins: [Container, Lazyload, Position, Style, Togglable],
4057
4048
 
4058
4049
  args: 'pos',
4059
4050
 
@@ -4061,10 +4052,13 @@
4061
4052
  mode: 'list',
4062
4053
  toggle: Boolean,
4063
4054
  boundary: Boolean,
4064
- boundaryAlign: Boolean,
4055
+ target: Boolean,
4056
+ targetX: Boolean,
4057
+ targetY: Boolean,
4058
+ stretch: Boolean,
4065
4059
  delayShow: Number,
4066
4060
  delayHide: Number,
4067
- display: String,
4061
+ autoUpdate: Boolean,
4068
4062
  clsDrop: String,
4069
4063
  animateOut: Boolean,
4070
4064
  bgScroll: Boolean },
@@ -4073,17 +4067,32 @@
4073
4067
  data: {
4074
4068
  mode: ['click', 'hover'],
4075
4069
  toggle: '- *',
4076
- boundary: true,
4077
- boundaryAlign: false,
4070
+ boundary: false,
4071
+ target: false,
4072
+ targetX: false,
4073
+ targetY: false,
4074
+ stretch: false,
4078
4075
  delayShow: 0,
4079
4076
  delayHide: 800,
4080
- display: null,
4077
+ autoUpdate: true,
4081
4078
  clsDrop: false,
4079
+ animateOut: false,
4080
+ bgScroll: true,
4082
4081
  animation: ['uk-animation-fade'],
4083
4082
  cls: 'uk-open',
4084
- container: false,
4085
- animateOut: false,
4086
- 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
+ } },
4087
4096
 
4088
4097
 
4089
4098
  created() {
@@ -4097,18 +4106,19 @@
4097
4106
  connected() {
4098
4107
  addClass(this.$el, this.clsDrop);
4099
4108
 
4100
- if (this.toggle && !this.target) {
4101
- 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), {
4102
4111
  target: this.$el,
4103
4112
  mode: this.mode }).
4104
4113
  $el;
4105
- attr(this.target, 'aria-haspopup', true);
4106
- this.lazyload(this.target);
4114
+ attr(this.targetEl, 'aria-haspopup', true);
4115
+ this.lazyload(this.targetEl);
4107
4116
  }
4108
4117
  },
4109
4118
 
4110
4119
  disconnected() {
4111
4120
  if (this.isActive()) {
4121
+ this.hide(false);
4112
4122
  active = null;
4113
4123
  }
4114
4124
  },
@@ -4134,7 +4144,7 @@
4134
4144
  return 'a[href^="#"]';
4135
4145
  },
4136
4146
 
4137
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4147
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4138
4148
  if (!defaultPrevented && hash && !within(hash, this.$el)) {
4139
4149
  this.hide(false);
4140
4150
  }
@@ -4242,21 +4252,22 @@
4242
4252
 
4243
4253
  this.tracker.init();
4244
4254
 
4245
- for (const handler of [
4255
+ const update = () => this.$emit();
4256
+ const handlers = [
4246
4257
  on(
4247
4258
  document,
4248
4259
  pointerDown,
4249
- (_ref2) => {let { target } = _ref2;return (
4260
+ (_ref3) => {let { target } = _ref3;return (
4250
4261
  !within(target, this.$el) &&
4251
4262
  once(
4252
4263
  document,
4253
4264
  pointerUp + " " + pointerCancel + " scroll",
4254
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4265
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
4255
4266
  if (
4256
4267
  !defaultPrevented &&
4257
4268
  type === pointerUp &&
4258
4269
  target === newTarget &&
4259
- !(this.target && within(target, this.target)))
4270
+ !(this.targetEl && within(target, this.targetEl)))
4260
4271
  {
4261
4272
  this.hide(false);
4262
4273
  }
@@ -4271,29 +4282,28 @@
4271
4282
  }
4272
4283
  }),
4273
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
+
4274
4299
  ...(this.bgScroll ?
4275
4300
  [] :
4276
- [preventOverscroll(this.$el), preventBackgroundScroll()]),
4301
+ [preventOverscroll(this.$el), preventBackgroundScroll()])];
4302
+
4303
+
4304
+ once(this.$el, 'hide', () => handlers.forEach((handler) => handler()), {
4305
+ self: true });
4277
4306
 
4278
- ...(this.display === 'static' && this.align !== 'stretch' ?
4279
- [] :
4280
- (() => {
4281
- const handler = () => this.$emit();
4282
- return [
4283
- on(window, 'resize', handler),
4284
- on(document, 'scroll', handler, true),
4285
- (() => {
4286
- const observer = observeResize(
4287
- scrollParents(this.$el),
4288
- handler);
4289
-
4290
- return () => observer.disconnect();
4291
- })()];
4292
-
4293
- })())])
4294
- {
4295
- once(this.$el, 'hide', handler, { self: true });
4296
- }
4297
4307
  } },
4298
4308
 
4299
4309
 
@@ -4310,7 +4320,7 @@
4310
4320
  {
4311
4321
  name: 'hide',
4312
4322
 
4313
- handler(_ref4) {let { target } = _ref4;
4323
+ handler(_ref5) {let { target } = _ref5;
4314
4324
  if (this.$el !== target) {
4315
4325
  active =
4316
4326
  active === null && within(target, this.$el) && this.isToggled() ?
@@ -4334,12 +4344,12 @@
4334
4344
 
4335
4345
 
4336
4346
  methods: {
4337
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4338
- 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) {
4339
4349
  this.hide(false, false);
4340
4350
  }
4341
4351
 
4342
- this.target = target;
4352
+ this.targetEl = target;
4343
4353
 
4344
4354
  this.clearTimers();
4345
4355
 
@@ -4402,60 +4412,69 @@
4402
4412
 
4403
4413
  position() {
4404
4414
  removeClass(this.$el, this.clsDrop + "-stack");
4405
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4406
- toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4415
+ attr(this.$el, 'style', this._style);
4407
4416
 
4408
- const boundary = query(this.boundary, this.$el);
4409
- const target = boundary && this.boundaryAlign ? boundary : this.target;
4410
- const [scrollParent] = scrollParents(
4411
- boundary && this.boundaryAlign ? boundary : this.$el);
4417
+ // Ensure none positioned element does not generate scrollbars
4418
+ this.$el.hidden = true;
4412
4419
 
4413
- const scrollParentOffset = offset(scrollParent);
4414
- 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]));
4415
4423
  const viewportOffset = this.getViewportOffset(this.$el);
4416
4424
 
4417
- css(this.$el, 'maxWidth', '');
4418
- const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4425
+ const dirs = [
4426
+ [0, ['x', 'width', 'left', 'right']],
4427
+ [1, ['y', 'height', 'top', 'bottom']]];
4419
4428
 
4420
- if (this.align === 'justify') {
4421
- const prop = this.axis === 'y' ? 'width' : 'height';
4422
- css(
4423
- this.$el,
4424
- prop,
4425
- Math.min(
4426
- (boundary ? boundaryOffset : offset(this.target))[prop],
4427
- scrollParentOffset[prop] - 2 * viewportOffset));
4428
-
4429
-
4430
- } else if (this.align === 'stretch') {
4431
- this.flip = this.axis === 'y' ? 'x' : 'y';
4432
- this.display = 'static';
4433
-
4434
- const viewport = offsetViewport(scrollParent);
4435
- const targetDim = offset(target);
4436
- const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4437
-
4438
- css(this.$el, {
4439
- width:
4440
- this.axis === 'y' ?
4441
- viewport.width :
4442
- (this.dir === 'left' ?
4443
- targetDim.left - viewport.left :
4444
- viewport.right - targetDim.right) - elOffset,
4445
- height:
4446
- this.axis === 'x' ?
4447
- viewport.height :
4448
- (this.dir === 'top' ?
4449
- targetDim.top - viewport.top :
4450
- viewport.bottom - targetDim.bottom) - elOffset });
4451
-
4452
- } 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) {
4453
4445
  addClass(this.$el, this.clsDrop + "-stack");
4454
4446
  }
4455
4447
 
4456
4448
  css(this.$el, 'maxWidth', maxWidth);
4457
4449
 
4458
- 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
+ }
4459
4478
  } } };
4460
4479
 
4461
4480
 
@@ -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
 
@@ -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
@@ -6436,9 +6439,12 @@
6436
6439
  addClass(parent(this.panel), this.clsMode);
6437
6440
  }
6438
6441
 
6439
- addClass(document.body, this.clsContainer, this.clsFlip);
6440
- css(document.body, 'touch-action', 'pan-y pinch-zoom');
6442
+ const { body, scrollingElement } = document;
6443
+
6444
+ addClass(body, this.clsContainer, this.clsFlip);
6445
+ css(body, 'touch-action', 'pan-y pinch-zoom');
6441
6446
  css(this.$el, 'display', 'block');
6447
+ css(this.panel, 'maxWidth', scrollingElement.clientWidth);
6442
6448
  addClass(this.$el, this.clsOverlay);
6443
6449
  addClass(
6444
6450
  this.panel,
@@ -6446,8 +6452,8 @@
6446
6452
  this.mode === 'reveal' ? '' : this.clsMode);
6447
6453
 
6448
6454
 
6449
- height(document.body); // force reflow
6450
- addClass(document.body, this.clsContainerAnimation);
6455
+ height(body); // force reflow
6456
+ addClass(body, this.clsContainerAnimation);
6451
6457
 
6452
6458
  this.clsContainerAnimation && suppressUserScale();
6453
6459
  } },
@@ -6479,6 +6485,7 @@
6479
6485
  removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);
6480
6486
  removeClass(this.$el, this.clsOverlay);
6481
6487
  css(this.$el, 'display', '');
6488
+ css(this.panel, 'maxWidth', '');
6482
6489
  removeClass(document.body, this.clsContainer, this.clsFlip);
6483
6490
  } },
6484
6491
 
@@ -6604,6 +6611,14 @@
6604
6611
  offset: 0 },
6605
6612
 
6606
6613
 
6614
+ connected() {
6615
+ registerClick(this);
6616
+ },
6617
+
6618
+ disconnected() {
6619
+ unregisterClick(this);
6620
+ },
6621
+
6607
6622
  methods: {
6608
6623
  async scrollTo(el) {
6609
6624
  el = el && $(el) || document.body;
@@ -6612,20 +6627,39 @@
6612
6627
  await scrollIntoView(el, { offset: this.offset });
6613
6628
  trigger(this.$el, 'scrolled', [this, el]);
6614
6629
  }
6615
- } },
6630
+ } } };
6616
6631
 
6617
6632
 
6618
- events: {
6619
- click(e) {
6620
- if (e.defaultPrevented) {
6621
- return;
6622
- }
6623
6633
 
6624
- e.preventDefault();
6625
- this.scrollTo(getTargetElement(this.$el));
6626
- } } };
6634
+ const components$1 = new Set();
6635
+ function registerClick(cmp) {
6636
+ if (!components$1.size) {
6637
+ on(document, 'click', clickHandler);
6638
+ }
6639
+
6640
+ components$1.add(cmp);
6641
+ }
6642
+
6643
+ function unregisterClick(cmp) {
6644
+ components$1.delete(cmp);
6627
6645
 
6646
+ if (!components$1.length) {
6647
+ off(document, 'click', clickHandler);
6648
+ }
6649
+ }
6650
+
6651
+ function clickHandler(e) {
6652
+ if (e.defaultPrevented) {
6653
+ return;
6654
+ }
6628
6655
 
6656
+ for (const component of components$1) {
6657
+ if (within(e.target, component.$el)) {
6658
+ e.preventDefault();
6659
+ component.scrollTo(getTargetElement(component.$el));
6660
+ }
6661
+ }
6662
+ }
6629
6663
 
6630
6664
  function getTargetElement(el) {
6631
6665
  return document.getElementById(decodeURIComponent(el.hash).substring(1));
@@ -7588,7 +7622,7 @@
7588
7622
 
7589
7623
 
7590
7624
  {
7591
- name: 'toggled',
7625
+ name: 'hide show',
7592
7626
 
7593
7627
  self: true,
7594
7628
 
@@ -7596,10 +7630,8 @@
7596
7630
  return this.target;
7597
7631
  },
7598
7632
 
7599
- handler(e, toggled) {
7600
- if (e.target === this.target[0]) {
7601
- this.updateAria(toggled);
7602
- }
7633
+ handler(_ref2) {let { type } = _ref2;
7634
+ this.updateAria(type === 'show');
7603
7635
  } },
7604
7636
 
7605
7637