uikit 3.14.4-dev.d014a9a57 → 3.14.4-dev.d2929b5b7

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 (124) hide show
  1. package/CHANGELOG.md +34 -17
  2. package/build/util.js +1 -0
  3. package/dist/css/uikit-core-rtl.css +317 -76
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +317 -76
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +337 -80
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +337 -80
  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 +77 -120
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +77 -120
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +1 -1
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +4 -5
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +4 -5
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +1 -1
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +4 -5
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +1 -1
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +1 -1
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +88 -134
  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 +357 -367
  38. package/dist/js/uikit-core.min.js +14 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +357 -367
  42. package/dist/js/uikit.min.js +14 -1
  43. package/package.json +1 -1
  44. package/src/images/components/navbar-toggle-icon.svg +22 -3
  45. package/src/js/api/state.js +1 -1
  46. package/src/js/core/accordion.js +9 -17
  47. package/src/js/core/alert.js +35 -14
  48. package/src/js/core/drop.js +90 -61
  49. package/src/js/core/height-viewport.js +4 -2
  50. package/src/js/core/index.js +1 -1
  51. package/src/js/core/leader.js +2 -2
  52. package/src/js/core/navbar.js +28 -45
  53. package/src/js/core/scroll.js +37 -10
  54. package/src/js/mixin/media.js +4 -5
  55. package/src/js/mixin/modal.js +9 -6
  56. package/src/js/mixin/position.js +21 -24
  57. package/src/js/mixin/togglable.js +80 -124
  58. package/src/js/util/animation.js +4 -3
  59. package/src/js/util/filter.js +3 -7
  60. package/src/js/util/position.js +42 -47
  61. package/src/js/util/style.js +4 -13
  62. package/src/js/util/viewport.js +3 -5
  63. package/src/less/components/_import.less +1 -0
  64. package/src/less/components/drop.less +1 -18
  65. package/src/less/components/dropbar.less +115 -0
  66. package/src/less/components/dropdown.less +11 -19
  67. package/src/less/components/leader.less +1 -1
  68. package/src/less/components/nav.less +212 -23
  69. package/src/less/components/navbar.less +16 -52
  70. package/src/less/components/utility.less +10 -2
  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 +115 -0
  79. package/src/scss/components/dropdown.scss +11 -19
  80. package/src/scss/components/leader.scss +1 -1
  81. package/src/scss/components/nav.scss +161 -22
  82. package/src/scss/components/navbar.scss +16 -52
  83. package/src/scss/components/utility.scss +8 -1
  84. package/src/scss/mixins-theme.scss +80 -8
  85. package/src/scss/mixins.scss +77 -4
  86. package/src/scss/theme/_import.scss +1 -0
  87. package/src/scss/theme/dropbar.scss +44 -0
  88. package/src/scss/theme/dropdown.scss +0 -8
  89. package/src/scss/theme/nav.scss +44 -0
  90. package/src/scss/theme/navbar.scss +1 -5
  91. package/src/scss/variables-theme.scss +51 -10
  92. package/src/scss/variables.scss +40 -8
  93. package/tests/accordion.html +2 -2
  94. package/tests/alert.html +2 -2
  95. package/tests/countdown.html +1 -1
  96. package/tests/drop.html +444 -412
  97. package/tests/dropbar.html +456 -0
  98. package/tests/dropdown.html +8 -470
  99. package/tests/filter.html +9 -12
  100. package/tests/form.html +1 -1
  101. package/tests/index.html +124 -105
  102. package/tests/lightbox.html +5 -5
  103. package/tests/list.html +8 -8
  104. package/tests/modal.html +13 -13
  105. package/tests/nav.html +121 -12
  106. package/tests/navbar.html +76 -218
  107. package/tests/offcanvas.html +10 -14
  108. package/tests/parallax.html +1 -1
  109. package/tests/position.html +13 -24
  110. package/tests/progress.html +9 -9
  111. package/tests/scroll.html +7 -10
  112. package/tests/search.html +5 -5
  113. package/tests/slider.html +6 -5
  114. package/tests/slideshow.html +8 -8
  115. package/tests/sortable.html +6 -8
  116. package/tests/sticky-navbar.html +6 -6
  117. package/tests/sticky.html +8 -8
  118. package/tests/switcher.html +1 -1
  119. package/tests/tab.html +1 -1
  120. package/tests/table.html +7 -7
  121. package/tests/toggle.html +2 -2
  122. package/tests/tooltip.html +1 -1
  123. package/tests/upload.html +11 -11
  124. package/tests/utility.html +19 -0
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.d014a9a57 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.d2929b5b7 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -383,12 +383,8 @@
383
383
  }
384
384
 
385
385
  function closest(element, selector) {
386
- if (startsWith(selector, '>')) {
387
- selector = selector.slice(1);
388
- }
389
-
390
386
  return isElement(element) ?
391
- element.closest(selector) :
387
+ element.closest(startsWith(selector, '>') ? selector.slice(1) : selector) :
392
388
  toNodes(element).
393
389
  map((element) => closest(element, selector)).
394
390
  filter(Boolean);
@@ -396,8 +392,8 @@
396
392
 
397
393
  function within(element, selector) {
398
394
  return isString(selector) ?
399
- matches(element, selector) || !!closest(element, selector) :
400
- element === selector || toNode(selector).contains(toNode(element));
395
+ !!closest(element, selector) :
396
+ toNode(selector).contains(toNode(element));
401
397
  }
402
398
 
403
399
  function parents(element, selector) {
@@ -785,18 +781,11 @@
785
781
  return elements[0];
786
782
  }
787
783
 
788
- const propertyRe = /^\s*(["'])?(.*?)\1\s*$/;
789
- function getCssVar(name, element) {if (element === void 0) {element = document.documentElement;}
790
- return css(element, "--uk-" + name).replace(propertyRe, '$2');
791
- }
792
-
793
784
  // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
794
785
  const propName = memoize((name) => vendorPropName(name));
795
786
 
796
- const cssPrefixes = ['webkit', 'moz'];
797
-
798
787
  function vendorPropName(name) {
799
- if (name[0] === '-') {
788
+ if (startsWith(name, '--')) {
800
789
  return name;
801
790
  }
802
791
 
@@ -808,11 +797,8 @@
808
797
  return name;
809
798
  }
810
799
 
811
- let i = cssPrefixes.length,
812
- prefixedName;
813
-
814
- while (i--) {
815
- prefixedName = "-" + cssPrefixes[i] + "-" + name;
800
+ for (const prefix of ['webkit', 'moz']) {
801
+ const prefixedName = "-" + prefix + "-" + name;
816
802
  if (prefixedName in style) {
817
803
  return prefixedName;
818
804
  }
@@ -913,13 +899,14 @@
913
899
  const Transition = {
914
900
  start: transition,
915
901
 
916
- stop(element) {
902
+ async stop(element) {
917
903
  trigger(element, 'transitionend');
918
- return Promise.resolve();
904
+ await Promise.resolve();
919
905
  },
920
906
 
921
- cancel(element) {
907
+ async cancel(element) {
922
908
  trigger(element, 'transitioncanceled');
909
+ await Promise.resolve();
923
910
  },
924
911
 
925
912
  inProgress(element) {
@@ -929,7 +916,7 @@
929
916
 
930
917
  const animationPrefix = 'uk-animation-';
931
918
 
932
- function animate$1(element, animation, duration, origin, out) {if (duration === void 0) {duration = 200;}
919
+ function animate$2(element, animation, duration, origin, out) {if (duration === void 0) {duration = 200;}
933
920
  return Promise.all(
934
921
  toNodes(element).map(
935
922
  (element) =>
@@ -965,10 +952,10 @@
965
952
 
966
953
  const inProgress = new RegExp(animationPrefix + "(enter|leave)");
967
954
  const Animation = {
968
- in: animate$1,
955
+ in: animate$2,
969
956
 
970
957
  out(element, animation, duration, origin) {
971
- return animate$1(element, animation, duration, origin, true);
958
+ return animate$2(element, animation, duration, origin, true);
972
959
  },
973
960
 
974
961
  inProgress(element) {
@@ -1899,12 +1886,10 @@
1899
1886
  function offsetViewport(scrollElement) {
1900
1887
  const window = toWindow(scrollElement);
1901
1888
  const {
1902
- document: { body, documentElement } } =
1889
+ document: { documentElement } } =
1903
1890
  window;
1904
1891
  let viewportElement =
1905
- scrollElement === scrollingElement(scrollElement) || scrollElement === body ?
1906
- window :
1907
- scrollElement;
1892
+ scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1908
1893
 
1909
1894
  const { visualViewport } = window;
1910
1895
  if (isWindow(viewportElement) && visualViewport) {
@@ -1923,7 +1908,7 @@
1923
1908
  // iOS 12 returns <body> as scrollingElement
1924
1909
  viewportElement = documentElement;
1925
1910
  } else {
1926
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1911
+ rect[start] += toFloat(css(viewportElement, "border-" + start + "-width"));
1927
1912
  }
1928
1913
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1929
1914
  rect[end] = rect[prop] + rect[start];
@@ -1951,11 +1936,11 @@
1951
1936
  ...options };
1952
1937
 
1953
1938
 
1954
- const dim = options.flip ?
1955
- attachToWithFlip(element, target, options) :
1956
- attachTo(element, target, options);
1939
+ if (!isArray(target)) {
1940
+ target = [target, target];
1941
+ }
1957
1942
 
1958
- offset(element, dim);
1943
+ offset(element, getPosition(element, target, options));
1959
1944
  }
1960
1945
 
1961
1946
  function attachTo(element, target, options) {
@@ -1970,8 +1955,11 @@
1970
1955
 
1971
1956
 
1972
1957
  const position = offset(element);
1973
- const targetOffset = offset(target);
1958
+
1974
1959
  for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1960
+ const targetOffset =
1961
+ attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);
1962
+
1975
1963
  position[start] = position[dir] =
1976
1964
  targetOffset[start] +
1977
1965
  moveBy(attach.target[i], end, targetOffset[prop]) -
@@ -1986,60 +1974,54 @@
1986
1974
  return start === 'center' ? dim / 2 : start === end ? dim : 0;
1987
1975
  }
1988
1976
 
1989
- function attachToWithFlip(element, target, options) {
1977
+ function getPosition(element, target, options) {
1990
1978
  const position = attachTo(element, target, options);
1991
- const targetDim = offset(target);
1992
1979
 
1993
1980
  let {
1994
1981
  flip,
1982
+ shift,
1995
1983
  attach: { element: elAttach, target: targetAttach },
1996
1984
  offset: elOffset,
1997
1985
  boundary,
1998
- viewport,
1999
1986
  viewportOffset } =
2000
1987
  options;
2001
1988
 
2002
- let viewports = scrollParents(element);
2003
- if (boundary === target) {
2004
- viewports = viewports.filter((viewport) => viewport !== boundary);
1989
+ if (!flip && !shift) {
1990
+ return position;
2005
1991
  }
2006
- const [scrollElement] = viewports;
2007
- viewports.push(viewport);
2008
1992
 
2009
1993
  const offsetPosition = { ...position };
2010
1994
  for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2011
- if (flip !== true && !includes(flip, dir)) {
2012
- continue;
2013
- }
2014
-
2015
- const willFlip =
2016
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
1995
+ let viewports = scrollParents(target[i]);
1996
+ const [scrollElement] = viewports;
2017
1997
 
2018
- viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1998
+ let viewport = getIntersectionArea(...viewports.map(offsetViewport));
2019
1999
 
2020
2000
  if (viewportOffset) {
2021
2001
  viewport[start] += viewportOffset;
2022
2002
  viewport[end] -= viewportOffset;
2023
2003
  }
2024
2004
 
2025
- if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2026
- viewport = getIntersectionArea(viewport, offset(boundary));
2005
+ if (boundary) {
2006
+ viewport = getIntersectionArea(viewport, offsetViewport(boundary));
2027
2007
  }
2028
2008
 
2029
- const isInStartBoundary = position[start] >= viewport[start];
2030
- const isInEndBoundary = position[end] <= viewport[end];
2009
+ const isInStartViewport = position[start] >= viewport[start];
2010
+ const isInEndViewport = position[end] <= viewport[end];
2031
2011
 
2032
- if (isInStartBoundary && isInEndBoundary) {
2012
+ if (isInStartViewport && isInEndViewport) {
2033
2013
  continue;
2034
2014
  }
2035
2015
 
2036
- let offsetBy;
2016
+ let offsetBy = 0;
2017
+ const targetDim = offset(target[i]);
2037
2018
 
2038
2019
  // Flip
2039
- if (willFlip) {
2020
+ if (!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i)) {
2040
2021
  if (
2041
- elAttach[i] === end && isInStartBoundary ||
2042
- elAttach[i] === start && isInEndBoundary)
2022
+ !flip ||
2023
+ elAttach[i] === end && isInStartViewport ||
2024
+ elAttach[i] === start && isInEndViewport)
2043
2025
  {
2044
2026
  continue;
2045
2027
  }
@@ -2076,27 +2058,25 @@
2076
2058
  return false;
2077
2059
  }
2078
2060
 
2079
- if (flip === true || includes(flip, dirs[1 - i][1])) {
2080
- const newPos = attachToWithFlip(element, target, {
2081
- ...options,
2082
- attach: {
2083
- element: elAttach.map(flipDir).reverse(),
2084
- target: targetAttach.map(flipDir).reverse() },
2061
+ const newPos = getPosition(element, target, {
2062
+ ...options,
2063
+ attach: {
2064
+ element: elAttach.map(flipDir).reverse(),
2065
+ target: targetAttach.map(flipDir).reverse() },
2085
2066
 
2086
- offset: elOffset.reverse(),
2087
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2088
- recursion: true });
2067
+ offset: elOffset.reverse(),
2068
+ recursion: true });
2089
2069
 
2090
2070
 
2091
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2092
- return newPos;
2093
- }
2071
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2072
+ return newPos;
2094
2073
  }
2074
+
2095
2075
  continue;
2096
2076
  }
2097
2077
 
2098
- // Move
2099
- } else {
2078
+ // Shift
2079
+ } else if (shift) {
2100
2080
  offsetBy =
2101
2081
  clamp(
2102
2082
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2152,7 +2132,7 @@
2152
2132
  getImage: getImage,
2153
2133
  transition: transition,
2154
2134
  Transition: Transition,
2155
- animate: animate$1,
2135
+ animate: animate$2,
2156
2136
  Animation: Animation,
2157
2137
  attr: attr,
2158
2138
  hasAttr: hasAttr,
@@ -2282,7 +2262,6 @@
2282
2262
  findAll: findAll,
2283
2263
  escape: escape,
2284
2264
  css: css,
2285
- getCssVar: getCssVar,
2286
2265
  propName: propName,
2287
2266
  isInView: isInView,
2288
2267
  scrollIntoView: scrollIntoView,
@@ -2607,7 +2586,7 @@
2607
2586
 
2608
2587
  value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2609
2588
 
2610
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2589
+ if (prop === 'target' && startsWith(value, '_')) {
2611
2590
  continue;
2612
2591
  }
2613
2592
 
@@ -2947,7 +2926,7 @@
2947
2926
  UIkit.data = '__uikit__';
2948
2927
  UIkit.prefix = 'uk-';
2949
2928
  UIkit.options = {};
2950
- UIkit.version = '3.14.4-dev.d014a9a57';
2929
+ UIkit.version = '3.14.4-dev.d2929b5b7';
2951
2930
 
2952
2931
  globalAPI(UIkit);
2953
2932
  hooksAPI(UIkit);
@@ -3052,27 +3031,7 @@
3052
3031
  origin: false,
3053
3032
  transition: 'ease',
3054
3033
  clsEnter: 'uk-togglabe-enter',
3055
- clsLeave: 'uk-togglabe-leave',
3056
-
3057
- initProps: {
3058
- overflow: '',
3059
- maxHeight: '',
3060
- paddingTop: '',
3061
- paddingBottom: '',
3062
- marginTop: '',
3063
- marginBottom: '',
3064
- boxShadow: '' },
3065
-
3066
-
3067
- hideProps: {
3068
- overflow: 'hidden',
3069
- maxHeight: 0,
3070
- paddingTop: 0,
3071
- paddingBottom: 0,
3072
- marginTop: 0,
3073
- marginBottom: 0,
3074
- boxShadow: 'none' } },
3075
-
3034
+ clsLeave: 'uk-togglabe-leave' },
3076
3035
 
3077
3036
 
3078
3037
  computed: {
@@ -3081,7 +3040,7 @@
3081
3040
  },
3082
3041
 
3083
3042
  hasTransition(_ref2) {let { animation } = _ref2;
3084
- return startsWith(animation[0], 'slide');
3043
+ return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
3085
3044
  } },
3086
3045
 
3087
3046
 
@@ -3174,122 +3133,97 @@
3174
3133
  };
3175
3134
  }
3176
3135
 
3177
- function toggleTransition(cmp) {
3178
- switch (cmp.animation[0]) {
3179
- case 'slide-left':
3180
- return slideHorizontal(cmp);
3181
- case 'slide-right':
3182
- return slideHorizontal(cmp, true);}
3183
-
3184
- return slide$1(cmp);
3185
- }
3186
-
3187
- function slide$1(_ref4)
3188
-
3189
-
3136
+ function toggleTransition(cmp) {var _cmp$animation$;
3137
+ const [mode = 'reveal', startProp = 'top'] = ((_cmp$animation$ = cmp.animation[0]) == null ? void 0 : _cmp$animation$.split('-')) || [];
3190
3138
 
3139
+ const dirs = [
3140
+ ['left', 'right'],
3141
+ ['top', 'bottom']];
3191
3142
 
3143
+ const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];
3144
+ const end = dir[1] === startProp;
3145
+ const props = ['width', 'height'];
3146
+ const dimProp = props[dirs.indexOf(dir)];
3147
+ const marginProp = "margin-" + dir[0];
3148
+ const marginStartProp = "margin-" + startProp;
3192
3149
 
3150
+ return async (el, show) => {
3151
+ let { duration, velocity, transition, _toggle } = cmp;
3193
3152
 
3153
+ let currentDim = dimensions$1(el)[dimProp];
3194
3154
 
3195
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3196
- return (el, show) => {
3197
3155
  const inProgress = Transition.inProgress(el);
3198
- const inner =
3199
- !inProgress && el.hasChildNodes() ?
3200
- toFloat(css(el.firstElementChild, 'marginTop')) +
3201
- toFloat(css(el.lastElementChild, 'marginBottom')) :
3202
- 0;
3203
- const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3204
-
3205
- const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3156
+ await Transition.cancel(el);
3206
3157
 
3207
- Transition.cancel(el);
3208
-
3209
- if (!isToggled(el)) {
3158
+ if (show) {
3210
3159
  _toggle(el, true);
3211
3160
  }
3212
3161
 
3213
- css(el, 'maxHeight', '');
3214
-
3215
- // Update child components first
3216
- fastdom.flush();
3162
+ const prevProps = Object.fromEntries(
3163
+ ['padding', 'border', 'width', 'height', 'overflow', marginProp, marginStartProp].map(
3164
+ (key) => [key, el.style[key]]));
3217
3165
 
3218
- const endHeight = toFloat(css(el, 'height')) + inner;
3219
- duration = velocity * endHeight + duration;
3220
3166
 
3221
- css(el, { ...props, maxHeight: currentHeight });
3222
-
3223
- return (
3224
- show ?
3225
- Transition.start(
3226
- el,
3227
- { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3228
- duration * (1 - currentHeight / endHeight),
3229
- transition) :
3230
3167
 
3231
- Transition.start(
3232
- el,
3233
- hideProps,
3234
- duration * (currentHeight / endHeight),
3235
- transition).
3236
- then(() => _toggle(el, false))).
3237
- then(() => css(el, initProps));
3238
- };
3239
- }
3240
-
3241
- function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3242
- return (el, show) => {
3243
- const visible = isVisible(el);
3244
- const marginLeft = toFloat(css(el, 'marginLeft'));
3168
+ const dim = dimensions$1(el);
3169
+ const currentMargin = toFloat(css(el, marginProp));
3170
+ const marginStart = toFloat(css(el, marginStartProp));
3171
+ const endDim = dim[dimProp] + marginStart;
3245
3172
 
3246
- Transition.cancel(el);
3247
-
3248
- const [scrollElement] = scrollParents(el.offsetParent);
3249
- css(scrollElement, 'overflowX', 'hidden');
3250
-
3251
- if (!isToggled(el)) {
3252
- _toggle(el, true);
3173
+ if (!inProgress && !show) {
3174
+ currentDim += marginStart;
3253
3175
  }
3254
3176
 
3255
- const width = toFloat(css(el, 'width'));
3256
- duration = velocity * width + duration;
3177
+ const [wrapper] = wrapInner(el, '<div>');
3178
+ css(wrapper, {
3179
+ boxSizing: 'border-box',
3180
+ height: dim.height,
3181
+ width: dim.width,
3182
+ ...css(el, [
3183
+ 'padding',
3184
+ 'borderTop',
3185
+ 'borderRight',
3186
+ 'borderBottom',
3187
+ 'borderLeft',
3188
+ 'borderImage',
3189
+ marginStartProp]) });
3257
3190
 
3258
- const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3259
3191
 
3260
- css(el, {
3261
- clipPath: right ? "polygon(0 0," +
3262
- percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3263
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)",
3264
- marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3265
3192
 
3193
+ css(el, {
3194
+ padding: 0,
3195
+ border: 0,
3196
+ [marginStartProp]: 0,
3197
+ width: dim.width,
3198
+ height: dim.height,
3199
+ overflow: 'hidden',
3200
+ [dimProp]: currentDim });
3266
3201
 
3267
- return (
3268
- show ?
3269
- Transition.start(
3270
- el,
3271
- {
3272
- clipPath: "polygon(0 0,100% 0,100% 100%,0 100%)",
3273
- marginLeft: 0 },
3274
3202
 
3275
- duration * (1 - percent / 100),
3276
- transition) :
3203
+ const percent = currentDim / endDim;
3204
+ duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
3205
+ const endProps = { [dimProp]: show ? endDim : 0 };
3277
3206
 
3278
- Transition.start(
3279
- el,
3280
- {
3281
- clipPath: right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)",
3207
+ if (end) {
3208
+ css(el, marginProp, endDim - currentDim + currentMargin);
3209
+ endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
3210
+ }
3282
3211
 
3212
+ if (!end ^ mode === 'reveal') {
3213
+ css(wrapper, marginProp, -endDim + currentDim);
3214
+ Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
3215
+ }
3283
3216
 
3284
- marginLeft: (right ? 1 : -1) * width },
3217
+ try {
3218
+ await Transition.start(el, endProps, duration, transition);
3219
+ } finally {
3220
+ css(el, prevProps);
3221
+ unwrap(wrapper.firstChild);
3285
3222
 
3286
- duration * (percent / 100),
3287
- transition).
3288
- then(() => _toggle(el, false))).
3289
- then(() => {
3290
- css(scrollElement, 'overflowX', '');
3291
- css(el, { clipPath: '', marginLeft: '' });
3292
- });
3223
+ if (!show) {
3224
+ _toggle(el, false);
3225
+ }
3226
+ }
3293
3227
  };
3294
3228
  }
3295
3229
 
@@ -3314,6 +3248,7 @@
3314
3248
  mixins: [Class, Lazyload, Togglable],
3315
3249
 
3316
3250
  props: {
3251
+ animation: Boolean,
3317
3252
  targets: String,
3318
3253
  active: null,
3319
3254
  collapsible: Boolean,
@@ -3326,7 +3261,7 @@
3326
3261
  data: {
3327
3262
  targets: '> *',
3328
3263
  active: false,
3329
- animation: ['slide'],
3264
+ animation: true,
3330
3265
  collapsible: true,
3331
3266
  multiple: false,
3332
3267
  clsOpen: 'uk-open',
@@ -3372,7 +3307,7 @@
3372
3307
  hide(
3373
3308
  el,
3374
3309
  !hasClass(
3375
- this.items.find((item) => item.contains(el)),
3310
+ this.items.find((item) => within(el, item)),
3376
3311
  this.clsOpen));
3377
3312
 
3378
3313
 
@@ -3424,23 +3359,15 @@
3424
3359
  toggleClass(el, this.clsOpen, show);
3425
3360
  attr($(this.$props.toggle, el), 'aria-expanded', show);
3426
3361
 
3427
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3362
+ const content = $(this.content, el);
3428
3363
 
3429
- if (animate === false || !this.hasTransition) {
3364
+ if (animate === false || !this.animation) {
3365
+ content.hidden = !show;
3430
3366
  hide(content, !show);
3431
3367
  return;
3432
3368
  }
3433
3369
 
3434
- if (!el._wrapper) {
3435
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3436
- }
3437
-
3438
- hide(content, false);
3439
- await slide$1(this)(el._wrapper, show);
3440
- hide(content, !show);
3441
-
3442
- delete el._wrapper;
3443
- unwrap(content);
3370
+ await toggleTransition(this)(content, show);
3444
3371
 
3445
3372
  if (show) {
3446
3373
  const toggle = $(this.$props.toggle, el);
@@ -3466,18 +3393,17 @@
3466
3393
  args: 'animation',
3467
3394
 
3468
3395
  props: {
3396
+ animation: Boolean,
3469
3397
  close: String },
3470
3398
 
3471
3399
 
3472
3400
  data: {
3473
- animation: ['slide'],
3401
+ animation: true,
3474
3402
  selClose: '.uk-alert-close',
3475
- duration: 150,
3476
- hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3403
+ duration: 150 },
3477
3404
 
3478
3405
 
3479
- events: [
3480
- {
3406
+ events: {
3481
3407
  name: 'click',
3482
3408
 
3483
3409
  delegate() {
@@ -3487,16 +3413,39 @@
3487
3413
  handler(e) {
3488
3414
  e.preventDefault();
3489
3415
  this.close();
3490
- } }],
3491
-
3416
+ } },
3492
3417
 
3493
3418
 
3494
3419
  methods: {
3495
3420
  async close() {
3496
- await this.toggleElement(this.$el);
3421
+ await this.toggleElement(this.$el, false, animate$1(this));
3497
3422
  this.$destroy(true);
3498
3423
  } } };
3499
3424
 
3425
+
3426
+
3427
+ function animate$1(_ref) {let { duration, transition, velocity } = _ref;
3428
+ return (el) => {
3429
+ const height = toFloat(css(el, 'height'));
3430
+ css(el, 'height', height);
3431
+ return Transition.start(
3432
+ el,
3433
+ {
3434
+ height: 0,
3435
+ marginTop: 0,
3436
+ marginBottom: 0,
3437
+ paddingTop: 0,
3438
+ paddingBottom: 0,
3439
+ borderTop: 0,
3440
+ borderBottom: 0,
3441
+ opacity: 0 },
3442
+
3443
+ velocity * height + duration,
3444
+ transition);
3445
+
3446
+ };
3447
+ }
3448
+
3500
3449
  var Video = {
3501
3450
  args: 'autoplay',
3502
3451
 
@@ -3645,13 +3594,17 @@
3645
3594
  props: {
3646
3595
  pos: String,
3647
3596
  offset: null,
3648
- flip: Boolean },
3597
+ flip: Boolean,
3598
+ shift: Boolean,
3599
+ inset: Boolean },
3649
3600
 
3650
3601
 
3651
3602
  data: {
3652
3603
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3604
+ offset: false,
3653
3605
  flip: true,
3654
- offset: false },
3606
+ shift: true,
3607
+ inset: false },
3655
3608
 
3656
3609
 
3657
3610
  connected() {
@@ -3665,7 +3618,7 @@
3665
3618
  let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3666
3619
 
3667
3620
  const attach = {
3668
- element: [flipPosition(this.dir), this.align],
3621
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3669
3622
  target: [this.dir, this.align] };
3670
3623
 
3671
3624
 
@@ -3683,22 +3636,15 @@
3683
3636
  const elDim = dimensions$1(element);
3684
3637
  css(element, { top: -elDim.height, left: -elDim.width });
3685
3638
 
3686
- const args = [
3687
- element,
3688
- target,
3689
- {
3639
+ positionAt(element, target, {
3690
3640
  attach,
3691
3641
  offset,
3692
3642
  boundary,
3693
3643
  flip: this.flip,
3694
- viewportOffset: this.getViewportOffset(element) }];
3695
-
3644
+ shift: this.shift,
3645
+ viewportOffset: this.getViewportOffset(element) });
3696
3646
 
3697
3647
 
3698
- trigger(element, 'beforeposition', args);
3699
-
3700
- positionAt(...args);
3701
-
3702
3648
  // Restore scroll position
3703
3649
  scrollElement.scrollTop = scrollTop;
3704
3650
  scrollElement.scrollLeft = scrollLeft;
@@ -3707,25 +3653,27 @@
3707
3653
  getPositionOffset(element) {
3708
3654
  return (
3709
3655
  toPx(
3710
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3656
+ this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3711
3657
  this.axis === 'x' ? 'width' : 'height',
3712
3658
  element) * (
3713
- includes(['left', 'top'], this.dir) ? -1 : 1));
3659
+
3660
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3661
+ this.inset ? -1 : 1));
3714
3662
 
3715
3663
  },
3716
3664
 
3717
3665
  getShiftOffset(element) {
3718
- return includes(['center', 'justify', 'stretch'], this.align) ?
3666
+ return this.align === 'center' ?
3719
3667
  0 :
3720
3668
  toPx(
3721
- getCssVar('position-shift-offset', element),
3669
+ css(element, '--uk-position-shift-offset'),
3722
3670
  this.axis === 'y' ? 'width' : 'height',
3723
3671
  element) * (
3724
3672
  includes(['left', 'top'], this.align) ? 1 : -1);
3725
3673
  },
3726
3674
 
3727
3675
  getViewportOffset(element) {
3728
- return toPx(getCssVar('position-viewport-offset', element));
3676
+ return toPx(css(element, '--uk-position-viewport-offset'));
3729
3677
  } } };
3730
3678
 
3731
3679
  const active$1 = [];
@@ -3837,8 +3785,8 @@
3837
3785
 
3838
3786
 
3839
3787
  if (this.overlay) {
3840
- once(this.$el, 'hide', preventOverscroll(this.$el));
3841
- once(this.$el, 'hide', preventBackgroundScroll());
3788
+ once(this.$el, 'hidden', preventOverscroll(this.$el));
3789
+ once(this.$el, 'hidden', preventBackgroundScroll());
3842
3790
  }
3843
3791
 
3844
3792
  if (this.stack) {
@@ -3920,10 +3868,6 @@
3920
3868
  active$1.splice(active$1.indexOf(this), 1);
3921
3869
  }
3922
3870
 
3923
- if (!active$1.length) {
3924
- css(document.body, 'overflowY', '');
3925
- }
3926
-
3927
3871
  css(this.$el, 'zIndex', '');
3928
3872
 
3929
3873
  if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
@@ -4040,7 +3984,12 @@
4040
3984
  return () => events.forEach((fn) => fn());
4041
3985
  }
4042
3986
 
3987
+ let prevented;
4043
3988
  function preventBackgroundScroll() {
3989
+ if (prevented) {
3990
+ return noop;
3991
+ }
3992
+ prevented = true;
4044
3993
  const { body, documentElement } = document;
4045
3994
  css(body, {
4046
3995
  overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
@@ -4048,6 +3997,7 @@
4048
3997
 
4049
3998
  css(documentElement, 'overflowY', 'hidden');
4050
3999
  return () => {
4000
+ prevented = false;
4051
4001
  css(documentElement, 'overflowY', '');
4052
4002
  css(body, { overflowY: '', touchAction: '' });
4053
4003
  };
@@ -4074,7 +4024,10 @@
4074
4024
  mode: 'list',
4075
4025
  toggle: Boolean,
4076
4026
  boundary: Boolean,
4077
- boundaryAlign: Boolean,
4027
+ target: Boolean,
4028
+ targetX: Boolean,
4029
+ targetY: Boolean,
4030
+ stretch: Boolean,
4078
4031
  delayShow: Number,
4079
4032
  delayHide: Number,
4080
4033
  display: String,
@@ -4086,17 +4039,32 @@
4086
4039
  data: {
4087
4040
  mode: ['click', 'hover'],
4088
4041
  toggle: '- *',
4089
- boundary: true,
4090
- boundaryAlign: false,
4042
+ boundary: false,
4043
+ target: false,
4044
+ targetX: false,
4045
+ targetY: false,
4046
+ stretch: false,
4091
4047
  delayShow: 0,
4092
4048
  delayHide: 800,
4093
4049
  display: null,
4094
4050
  clsDrop: false,
4051
+ animateOut: false,
4052
+ bgScroll: true,
4095
4053
  animation: ['uk-animation-fade'],
4096
4054
  cls: 'uk-open',
4097
- container: false,
4098
- animateOut: false,
4099
- bgScroll: true },
4055
+ container: false },
4056
+
4057
+
4058
+ computed: {
4059
+ target(_ref, $el) {let { target, targetX, targetY } = _ref;
4060
+ targetX = targetX || target || this.targetEl;
4061
+ targetY = targetY || target || this.targetEl;
4062
+
4063
+ return [
4064
+ targetX === true ? window : query(targetX, $el),
4065
+ targetY === true ? window : query(targetY, $el)];
4066
+
4067
+ } },
4100
4068
 
4101
4069
 
4102
4070
  created() {
@@ -4110,13 +4078,13 @@
4110
4078
  connected() {
4111
4079
  addClass(this.$el, this.clsDrop);
4112
4080
 
4113
- if (this.toggle && !this.target) {
4114
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
4081
+ if (this.toggle && !this.targetEl) {
4082
+ this.targetEl = this.$create('toggle', query(this.toggle, this.$el), {
4115
4083
  target: this.$el,
4116
4084
  mode: this.mode }).
4117
4085
  $el;
4118
- attr(this.target, 'aria-haspopup', true);
4119
- this.lazyload(this.target);
4086
+ attr(this.targetEl, 'aria-haspopup', true);
4087
+ this.lazyload(this.targetEl);
4120
4088
  }
4121
4089
  },
4122
4090
 
@@ -4147,7 +4115,7 @@
4147
4115
  return 'a[href^="#"]';
4148
4116
  },
4149
4117
 
4150
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4118
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4151
4119
  if (!defaultPrevented && hash && !within(hash, this.$el)) {
4152
4120
  this.hide(false);
4153
4121
  }
@@ -4259,17 +4227,17 @@
4259
4227
  on(
4260
4228
  document,
4261
4229
  pointerDown$1,
4262
- (_ref2) => {let { target } = _ref2;return (
4230
+ (_ref3) => {let { target } = _ref3;return (
4263
4231
  !within(target, this.$el) &&
4264
4232
  once(
4265
4233
  document,
4266
4234
  pointerUp$1 + " " + pointerCancel + " scroll",
4267
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4235
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
4268
4236
  if (
4269
4237
  !defaultPrevented &&
4270
4238
  type === pointerUp$1 &&
4271
4239
  target === newTarget &&
4272
- !(this.target && within(target, this.target)))
4240
+ !(this.targetEl && within(target, this.targetEl)))
4273
4241
  {
4274
4242
  this.hide(false);
4275
4243
  }
@@ -4288,13 +4256,13 @@
4288
4256
  [] :
4289
4257
  [preventOverscroll(this.$el), preventBackgroundScroll()]),
4290
4258
 
4291
- ...(this.display === 'static' && this.align !== 'stretch' ?
4259
+ ...(this.display === 'static' ?
4292
4260
  [] :
4293
4261
  (() => {
4294
4262
  const handler = () => this.$emit();
4295
4263
  return [
4296
4264
  on(window, 'resize', handler),
4297
- on(document, 'scroll', handler, true),
4265
+ on([document, scrollParents(this.$el)], 'scroll', handler),
4298
4266
  (() => {
4299
4267
  const observer = observeResize(
4300
4268
  scrollParents(this.$el),
@@ -4323,7 +4291,7 @@
4323
4291
  {
4324
4292
  name: 'hide',
4325
4293
 
4326
- handler(_ref4) {let { target } = _ref4;
4294
+ handler(_ref5) {let { target } = _ref5;
4327
4295
  if (this.$el !== target) {
4328
4296
  active =
4329
4297
  active === null && within(target, this.$el) && this.isToggled() ?
@@ -4347,12 +4315,12 @@
4347
4315
 
4348
4316
 
4349
4317
  methods: {
4350
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4351
- if (this.isToggled() && target && this.target && target !== this.target) {
4318
+ show(target, delay) {if (target === void 0) {target = this.targetEl;}if (delay === void 0) {delay = true;}
4319
+ if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {
4352
4320
  this.hide(false, false);
4353
4321
  }
4354
4322
 
4355
- this.target = target;
4323
+ this.targetEl = target;
4356
4324
 
4357
4325
  this.clearTimers();
4358
4326
 
@@ -4415,60 +4383,72 @@
4415
4383
 
4416
4384
  position() {
4417
4385
  removeClass(this.$el, this.clsDrop + "-stack");
4418
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4419
- toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4386
+ css(this.$el, { maxWidth: '', top: '', left: '' });
4420
4387
 
4421
- const boundary = query(this.boundary, this.$el);
4422
- const target = boundary && this.boundaryAlign ? boundary : this.target;
4423
- const [scrollParent] = scrollParents(
4424
- boundary && this.boundaryAlign ? boundary : this.$el);
4388
+ // Ensure none positioned element does not generate scrollbars
4389
+ this.$el.hidden = true;
4425
4390
 
4426
- const scrollParentOffset = offset(scrollParent);
4427
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4391
+ const boundary = query(this.boundary, this.$el);
4392
+ const boundaryOffset = offsetViewport(boundary || window);
4393
+ const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4428
4394
  const viewportOffset = this.getViewportOffset(this.$el);
4429
4395
 
4430
- css(this.$el, 'maxWidth', '');
4431
- const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4396
+ const dirs = [
4397
+ [0, ['x', 'width', 'left', 'right']],
4398
+ [1, ['y', 'height', 'top', 'bottom']]];
4432
4399
 
4433
- if (this.align === 'justify') {
4434
- const prop = this.axis === 'y' ? 'width' : 'height';
4435
- css(
4436
- this.$el,
4437
- prop,
4438
- Math.min(
4439
- (boundary ? boundaryOffset : offset(this.target))[prop],
4440
- scrollParentOffset[prop] - 2 * viewportOffset));
4441
-
4442
-
4443
- } else if (this.align === 'stretch') {
4444
- this.flip = this.axis === 'y' ? 'x' : 'y';
4445
- this.display = 'static';
4446
-
4447
- const viewport = offsetViewport(scrollParent);
4448
- const targetDim = offset(target);
4449
- const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4450
-
4451
- css(this.$el, {
4452
- width:
4453
- this.axis === 'y' ?
4454
- viewport.width :
4455
- (this.dir === 'left' ?
4456
- targetDim.left - viewport.left :
4457
- viewport.right - targetDim.right) - elOffset,
4458
- height:
4459
- this.axis === 'x' ?
4460
- viewport.height :
4461
- (this.dir === 'top' ?
4462
- targetDim.top - viewport.top :
4463
- viewport.bottom - targetDim.bottom) - elOffset });
4464
-
4465
- } else if (this.$el.offsetWidth > maxWidth) {
4400
+
4401
+ for (const [i, [axis, prop]] of dirs) {
4402
+ if (includes([axis, true], this.stretch)) {
4403
+ css(this.$el, {
4404
+ [prop]:
4405
+ this.axis === axis ?
4406
+ '' // Reset prop in main axis before positioning to not cause the drop to flip prematurely
4407
+ : Math.min(
4408
+ boundaryOffset[prop],
4409
+ viewports[i][prop] - 2 * viewportOffset),
4410
+
4411
+ ["overflow-" + axis]: 'auto' });
4412
+
4413
+ }
4414
+ }
4415
+
4416
+ const maxWidth = viewports[0].width - 2 * viewportOffset;
4417
+
4418
+ if (this.$el.offsetWidth > maxWidth) {
4466
4419
  addClass(this.$el, this.clsDrop + "-stack");
4467
4420
  }
4468
4421
 
4469
4422
  css(this.$el, 'maxWidth', maxWidth);
4470
4423
 
4471
- this.positionAt(this.$el, target, boundary);
4424
+ this.$el.hidden = false;
4425
+
4426
+ this.positionAt(this.$el, this.target, boundary);
4427
+
4428
+ for (const [i, [axis, prop, start, end]] of dirs) {
4429
+ if (this.axis === axis && includes([axis, true], this.stretch)) {
4430
+ const positionOffset = Math.abs(this.getPositionOffset(this.$el));
4431
+ const targetOffset = offset(this.target[i]);
4432
+ const elOffset = offset(this.$el);
4433
+
4434
+ css(this.$el, {
4435
+ [prop]:
4436
+ (targetOffset[start] > elOffset[start] ?
4437
+ targetOffset[start] -
4438
+ Math.max(
4439
+ boundaryOffset[start],
4440
+ viewports[i][start] + viewportOffset) :
4441
+
4442
+ Math.min(
4443
+ boundaryOffset[end],
4444
+ viewports[i][end] - viewportOffset) -
4445
+ targetOffset[end]) - positionOffset,
4446
+ ["overflow-" + axis]: 'auto' });
4447
+
4448
+
4449
+ this.positionAt(this.$el, this.target, boundary);
4450
+ }
4451
+ }
4472
4452
  } } };
4473
4453
 
4474
4454
 
@@ -4965,8 +4945,11 @@
4965
4945
  let minHeight = '';
4966
4946
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4967
4947
 
4948
+ const { body, scrollingElement } = document;
4968
4949
  const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4969
- const { height: viewportHeight } = offsetViewport(scrollElement);
4950
+ const { height: viewportHeight } = offsetViewport(
4951
+ scrollElement === body ? scrollingElement : scrollElement);
4952
+
4970
4953
 
4971
4954
  if (this.expand) {
4972
4955
  minHeight = Math.max(
@@ -4976,7 +4959,6 @@
4976
4959
  0);
4977
4960
 
4978
4961
  } else {
4979
- const { body, scrollingElement } = document;
4980
4962
  const isScrollingElement =
4981
4963
  scrollingElement === scrollElement || body === scrollElement;
4982
4964
 
@@ -5238,7 +5220,7 @@
5238
5220
 
5239
5221
  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>";
5240
5222
 
5241
- 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>";
5223
+ var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><style>.uk-navbar-toggle svg > [class*='line-'] {\n transition: 0.2s ease-in-out;\n transition-property: transform, opacity,;\n transform-origin: center;\n opacity: 1;\n }\n\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-2 { transform: rotate(45deg); }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-3 { transform: rotate(-45deg); }\n\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-1,\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-4 { opacity: 0; }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-1 { transform: translateY(6px) scaleX(0); }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-4 { transform: translateY(-6px) scaleX(0); }</style><rect class=\"line-1\" y=\"3\" width=\"20\" height=\"2\"/><rect class=\"line-2\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-3\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-4\" y=\"15\" width=\"20\" height=\"2\"/></svg>";
5242
5224
 
5243
5225
  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>";
5244
5226
 
@@ -5599,7 +5581,7 @@
5599
5581
 
5600
5582
 
5601
5583
  connected() {
5602
- const media = toMedia(this.media);
5584
+ const media = toMedia(this.media, this.$el);
5603
5585
  this.matchMedia = true;
5604
5586
  if (media) {
5605
5587
  this.mediaObj = window.matchMedia(media);
@@ -5620,11 +5602,10 @@
5620
5602
  } };
5621
5603
 
5622
5604
 
5623
- function toMedia(value) {
5605
+ function toMedia(value, element) {
5624
5606
  if (isString(value)) {
5625
5607
  if (startsWith(value, '@')) {
5626
- const name = "breakpoint-" + value.substr(1);
5627
- value = toFloat(getCssVar(name));
5608
+ value = toFloat(css(element, "--uk-breakpoint-" + value.substr(1)));
5628
5609
  } else if (isNaN(value)) {
5629
5610
  return value;
5630
5611
  }
@@ -5649,7 +5630,7 @@
5649
5630
 
5650
5631
  computed: {
5651
5632
  fill(_ref) {let { fill } = _ref;
5652
- return fill || getCssVar('leader-fill-content');
5633
+ return fill || css(this.$el, '--uk-leader-fill-content');
5653
5634
  } },
5654
5635
 
5655
5636
 
@@ -5841,7 +5822,7 @@
5841
5822
  align: String,
5842
5823
  offset: Number,
5843
5824
  boundary: Boolean,
5844
- boundaryAlign: Boolean,
5825
+ target: Boolean,
5845
5826
  clsDrop: String,
5846
5827
  delayShow: Number,
5847
5828
  delayHide: Number,
@@ -5858,9 +5839,12 @@
5858
5839
  offset: undefined,
5859
5840
  delayShow: undefined,
5860
5841
  delayHide: undefined,
5861
- boundaryAlign: undefined,
5862
- flip: 'x',
5842
+ flip: false,
5843
+ shift: true,
5863
5844
  boundary: true,
5845
+ target: false,
5846
+ targetX: false,
5847
+ targetY: false,
5864
5848
  dropbar: false,
5865
5849
  dropbarAnchor: false,
5866
5850
  duration: 200,
@@ -5895,7 +5879,7 @@
5895
5879
  },
5896
5880
 
5897
5881
  watch(dropbar) {
5898
- addClass(dropbar, 'uk-navbar-dropbar');
5882
+ addClass(dropbar, 'uk-dropbar', 'uk-dropbar-top', 'uk-navbar-dropbar');
5899
5883
  },
5900
5884
 
5901
5885
  immediate: true },
@@ -5911,7 +5895,7 @@
5911
5895
 
5912
5896
  if (this.dropContainer !== $el) {
5913
5897
  for (const el of $$("." + clsDrop, this.dropContainer)) {var _this$getDropdown;
5914
- const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.target;
5898
+ const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.targetEl;
5915
5899
  if (!includes(dropdowns, el) && target && within(target, this.$el)) {
5916
5900
  dropdowns.push(el);
5917
5901
  }
@@ -5973,8 +5957,8 @@
5973
5957
  if (
5974
5958
  active &&
5975
5959
  includes(active.mode, 'hover') &&
5976
- active.target &&
5977
- !within(active.target, current) &&
5960
+ active.targetEl &&
5961
+ !within(active.targetEl, current) &&
5978
5962
  !active.isDelaying)
5979
5963
  {
5980
5964
  active.hide(false);
@@ -5996,7 +5980,7 @@
5996
5980
  if (keyCode === keyMap.DOWN && hasAttr(current, 'aria-expanded')) {
5997
5981
  e.preventDefault();
5998
5982
 
5999
- if (!active || active.target !== current) {
5983
+ if (!active || active.targetEl !== current) {
6000
5984
  current.click();
6001
5985
  once(this.dropContainer, 'show', (_ref8) => {let { target } = _ref8;return (
6002
5986
  focusFirstFocusableElement(target));});
@@ -6046,8 +6030,8 @@
6046
6030
  }
6047
6031
  }
6048
6032
 
6049
- if (keyCode === keyMap.ESC) {var _active$target;
6050
- active == null ? void 0 : (_active$target = active.target) == null ? void 0 : _active$target.focus();
6033
+ if (keyCode === keyMap.ESC) {var _active$targetEl;
6034
+ active == null ? void 0 : (_active$targetEl = active.targetEl) == null ? void 0 : _active$targetEl.focus();
6051
6035
  }
6052
6036
 
6053
6037
  handleNavItemNavigation(e, this.toggles, active);
@@ -6118,39 +6102,19 @@
6118
6102
  return;
6119
6103
  }
6120
6104
 
6121
- this._observer = observeResize(target, () =>
6122
- this.transitionTo(
6123
- offset(target).bottom -
6124
- offset(this.dropbar).top +
6125
- toFloat(css(target, 'marginBottom')),
6126
- target));
6127
-
6128
-
6129
- } },
6130
-
6131
-
6132
- {
6133
- name: 'beforeposition',
6134
-
6135
- el() {
6136
- return this.dropContainer;
6137
- },
6138
-
6139
- filter() {
6140
- return this.dropbar;
6141
- },
6142
-
6143
- handler(e, element, target, options) {
6144
- if (!this.isDropbarDrop(element)) {
6145
- return;
6146
- }
6147
-
6148
- const dropbarOffset = offset(this.dropbar);
6149
-
6150
- css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
6105
+ this._observer = observeResize(target, () => {
6106
+ const targetOffsets = parents(target, "." + this.clsDrop).
6107
+ concat(target).
6108
+ map((el) => offset(el));
6109
+ const minTop = Math.min(...targetOffsets.map((_ref11) => {let { top } = _ref11;return top;}));
6110
+ const maxBottom = Math.max(...targetOffsets.map((_ref12) => {let { bottom } = _ref12;return bottom;}));
6111
+ const dropbarOffset = offset(this.dropbar);
6112
+ css(this.dropbar, 'top', this.dropbar.offsetTop - (dropbarOffset.top - minTop));
6113
+ this.transitionTo(
6114
+ maxBottom - minTop + toFloat(css(target, 'marginBottom')),
6115
+ target);
6151
6116
 
6152
- options.offset[1] = dropbarOffset.top - offset(target).bottom;
6153
- options.viewportOffset += dropbarOffset.left;
6117
+ });
6154
6118
  } },
6155
6119
 
6156
6120
 
@@ -6171,7 +6135,7 @@
6171
6135
  if (
6172
6136
  matches(this.dropbar, ':hover') &&
6173
6137
  (active == null ? void 0 : active.$el) === e.target &&
6174
- !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6138
+ !this.toggles.some((el) => active.targetEl !== el && matches(el, ':focus')))
6175
6139
  {
6176
6140
  e.preventDefault();
6177
6141
  }
@@ -6189,7 +6153,7 @@
6189
6153
  return this.dropbar;
6190
6154
  },
6191
6155
 
6192
- handler(_ref11) {let { target } = _ref11;
6156
+ handler(_ref13) {let { target } = _ref13;
6193
6157
  if (!this.isDropbarDrop(target)) {
6194
6158
  return;
6195
6159
  }
@@ -6207,7 +6171,7 @@
6207
6171
 
6208
6172
  methods: {
6209
6173
  getActive() {
6210
- return active && within(active.target, this.$el) && active;
6174
+ return active && within(active.targetEl, this.$el) && active;
6211
6175
  },
6212
6176
 
6213
6177
  transitionTo(newHeight, el) {
@@ -6240,15 +6204,14 @@
6240
6204
  },
6241
6205
 
6242
6206
  isDropbarDrop(el) {
6243
- const drop = this.getDropdown(el);
6244
- return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
6207
+ return this.getDropdown(el) && hasClass(el, this.clsDrop);
6245
6208
  } } };
6246
6209
 
6247
6210
 
6248
6211
 
6249
6212
  function handleNavItemNavigation(e, toggles, active) {
6250
6213
  const { current, keyCode } = e;
6251
- const target = (active == null ? void 0 : active.target) || current;
6214
+ const target = (active == null ? void 0 : active.targetEl) || current;
6252
6215
  const i = toggles.indexOf(target);
6253
6216
 
6254
6217
  // Left
@@ -6616,6 +6579,14 @@
6616
6579
  offset: 0 },
6617
6580
 
6618
6581
 
6582
+ connected() {
6583
+ registerClick(this);
6584
+ },
6585
+
6586
+ disconnected() {
6587
+ unregisterClick(this);
6588
+ },
6589
+
6619
6590
  methods: {
6620
6591
  async scrollTo(el) {
6621
6592
  el = el && $(el) || document.body;
@@ -6624,20 +6595,39 @@
6624
6595
  await scrollIntoView(el, { offset: this.offset });
6625
6596
  trigger(this.$el, 'scrolled', [this, el]);
6626
6597
  }
6627
- } },
6598
+ } } };
6628
6599
 
6629
6600
 
6630
- events: {
6631
- click(e) {
6632
- if (e.defaultPrevented) {
6633
- return;
6634
- }
6635
6601
 
6636
- e.preventDefault();
6637
- this.scrollTo(getTargetElement(this.$el));
6638
- } } };
6602
+ const components$2 = new Set();
6603
+ function registerClick(cmp) {
6604
+ if (!components$2.size) {
6605
+ on(document, 'click', clickHandler);
6606
+ }
6639
6607
 
6608
+ components$2.add(cmp);
6609
+ }
6640
6610
 
6611
+ function unregisterClick(cmp) {
6612
+ components$2.delete(cmp);
6613
+
6614
+ if (!components$2.length) {
6615
+ off(document, 'click', clickHandler);
6616
+ }
6617
+ }
6618
+
6619
+ function clickHandler(e) {
6620
+ if (e.defaultPrevented) {
6621
+ return;
6622
+ }
6623
+
6624
+ for (const component of components$2) {
6625
+ if (within(e.target, component.$el)) {
6626
+ e.preventDefault();
6627
+ component.scrollTo(getTargetElement(component.$el));
6628
+ }
6629
+ }
6630
+ }
6641
6631
 
6642
6632
  function getTargetElement(el) {
6643
6633
  return document.getElementById(decodeURIComponent(el.hash).substring(1));