uikit 3.14.4-dev.3a6c538ab → 3.14.4-dev.5e7e87ba7

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 (114) hide show
  1. package/CHANGELOG.md +27 -17
  2. package/build/util.js +1 -0
  3. package/dist/css/uikit-core-rtl.css +271 -61
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +271 -61
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +291 -65
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +291 -65
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +1 -1
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +1 -1
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +69 -114
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +69 -114
  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 +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 +85 -131
  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 +339 -339
  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 +339 -339
  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/navbar.js +28 -45
  51. package/src/js/core/scroll.js +37 -10
  52. package/src/js/mixin/position.js +18 -20
  53. package/src/js/mixin/togglable.js +80 -124
  54. package/src/js/util/animation.js +4 -3
  55. package/src/js/util/filter.js +3 -7
  56. package/src/js/util/position.js +42 -47
  57. package/src/js/util/viewport.js +3 -5
  58. package/src/less/components/_import.less +1 -0
  59. package/src/less/components/drop.less +1 -18
  60. package/src/less/components/dropbar.less +115 -0
  61. package/src/less/components/dropdown.less +6 -20
  62. package/src/less/components/nav.less +211 -22
  63. package/src/less/components/navbar.less +10 -52
  64. package/src/less/theme/_import.less +1 -0
  65. package/src/less/theme/dropbar.less +44 -0
  66. package/src/less/theme/dropdown.less +0 -11
  67. package/src/less/theme/nav.less +46 -0
  68. package/src/less/theme/navbar.less +1 -5
  69. package/src/scss/components/_import.scss +1 -0
  70. package/src/scss/components/drop.scss +1 -18
  71. package/src/scss/components/dropbar.scss +115 -0
  72. package/src/scss/components/dropdown.scss +6 -20
  73. package/src/scss/components/nav.scss +160 -21
  74. package/src/scss/components/navbar.scss +10 -52
  75. package/src/scss/mixins-theme.scss +78 -7
  76. package/src/scss/mixins.scss +75 -3
  77. package/src/scss/theme/_import.scss +1 -0
  78. package/src/scss/theme/dropbar.scss +44 -0
  79. package/src/scss/theme/dropdown.scss +0 -8
  80. package/src/scss/theme/nav.scss +44 -0
  81. package/src/scss/theme/navbar.scss +1 -5
  82. package/src/scss/variables-theme.scss +50 -9
  83. package/src/scss/variables.scss +39 -7
  84. package/tests/accordion.html +2 -2
  85. package/tests/alert.html +2 -2
  86. package/tests/countdown.html +1 -1
  87. package/tests/drop.html +444 -412
  88. package/tests/dropbar.html +456 -0
  89. package/tests/dropdown.html +8 -470
  90. package/tests/filter.html +9 -12
  91. package/tests/form.html +1 -1
  92. package/tests/index.html +124 -105
  93. package/tests/lightbox.html +5 -5
  94. package/tests/list.html +8 -8
  95. package/tests/modal.html +13 -13
  96. package/tests/nav.html +121 -12
  97. package/tests/navbar.html +76 -212
  98. package/tests/offcanvas.html +10 -14
  99. package/tests/parallax.html +1 -1
  100. package/tests/position.html +13 -24
  101. package/tests/progress.html +9 -9
  102. package/tests/scroll.html +7 -10
  103. package/tests/search.html +5 -5
  104. package/tests/slider.html +6 -5
  105. package/tests/slideshow.html +8 -8
  106. package/tests/sortable.html +6 -8
  107. package/tests/sticky-navbar.html +6 -6
  108. package/tests/sticky.html +8 -8
  109. package/tests/switcher.html +1 -1
  110. package/tests/tab.html +1 -1
  111. package/tests/table.html +7 -7
  112. package/tests/toggle.html +2 -2
  113. package/tests/tooltip.html +1 -1
  114. package/tests/upload.html +11 -11
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.3a6c538ab | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.5e7e87ba7 | 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) {
@@ -903,13 +899,14 @@
903
899
  const Transition = {
904
900
  start: transition,
905
901
 
906
- stop(element) {
902
+ async stop(element) {
907
903
  trigger(element, 'transitionend');
908
- return Promise.resolve();
904
+ await Promise.resolve();
909
905
  },
910
906
 
911
- cancel(element) {
907
+ async cancel(element) {
912
908
  trigger(element, 'transitioncanceled');
909
+ await Promise.resolve();
913
910
  },
914
911
 
915
912
  inProgress(element) {
@@ -919,7 +916,7 @@
919
916
 
920
917
  const animationPrefix = 'uk-animation-';
921
918
 
922
- 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;}
923
920
  return Promise.all(
924
921
  toNodes(element).map(
925
922
  (element) =>
@@ -955,10 +952,10 @@
955
952
 
956
953
  const inProgress = new RegExp(animationPrefix + "(enter|leave)");
957
954
  const Animation = {
958
- in: animate$1,
955
+ in: animate$2,
959
956
 
960
957
  out(element, animation, duration, origin) {
961
- return animate$1(element, animation, duration, origin, true);
958
+ return animate$2(element, animation, duration, origin, true);
962
959
  },
963
960
 
964
961
  inProgress(element) {
@@ -1889,12 +1886,10 @@
1889
1886
  function offsetViewport(scrollElement) {
1890
1887
  const window = toWindow(scrollElement);
1891
1888
  const {
1892
- document: { body, documentElement } } =
1889
+ document: { documentElement } } =
1893
1890
  window;
1894
1891
  let viewportElement =
1895
- scrollElement === scrollingElement(scrollElement) || scrollElement === body ?
1896
- window :
1897
- scrollElement;
1892
+ scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1898
1893
 
1899
1894
  const { visualViewport } = window;
1900
1895
  if (isWindow(viewportElement) && visualViewport) {
@@ -1913,7 +1908,7 @@
1913
1908
  // iOS 12 returns <body> as scrollingElement
1914
1909
  viewportElement = documentElement;
1915
1910
  } else {
1916
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1911
+ rect[start] += toFloat(css(viewportElement, "border-" + start + "-width"));
1917
1912
  }
1918
1913
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1919
1914
  rect[end] = rect[prop] + rect[start];
@@ -1941,11 +1936,11 @@
1941
1936
  ...options };
1942
1937
 
1943
1938
 
1944
- const dim = options.flip ?
1945
- attachToWithFlip(element, target, options) :
1946
- attachTo(element, target, options);
1939
+ if (!isArray(target)) {
1940
+ target = [target, target];
1941
+ }
1947
1942
 
1948
- offset(element, dim);
1943
+ offset(element, getPosition(element, target, options));
1949
1944
  }
1950
1945
 
1951
1946
  function attachTo(element, target, options) {
@@ -1960,8 +1955,11 @@
1960
1955
 
1961
1956
 
1962
1957
  const position = offset(element);
1963
- const targetOffset = offset(target);
1958
+
1964
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
+
1965
1963
  position[start] = position[dir] =
1966
1964
  targetOffset[start] +
1967
1965
  moveBy(attach.target[i], end, targetOffset[prop]) -
@@ -1976,60 +1974,54 @@
1976
1974
  return start === 'center' ? dim / 2 : start === end ? dim : 0;
1977
1975
  }
1978
1976
 
1979
- function attachToWithFlip(element, target, options) {
1977
+ function getPosition(element, target, options) {
1980
1978
  const position = attachTo(element, target, options);
1981
- const targetDim = offset(target);
1982
1979
 
1983
1980
  let {
1984
1981
  flip,
1982
+ shift,
1985
1983
  attach: { element: elAttach, target: targetAttach },
1986
1984
  offset: elOffset,
1987
1985
  boundary,
1988
- viewport,
1989
1986
  viewportOffset } =
1990
1987
  options;
1991
1988
 
1992
- let viewports = scrollParents(element);
1993
- if (boundary === target) {
1994
- viewports = viewports.filter((viewport) => viewport !== boundary);
1989
+ if (!flip && !shift) {
1990
+ return position;
1995
1991
  }
1996
- const [scrollElement] = viewports;
1997
- viewports.push(viewport);
1998
1992
 
1999
1993
  const offsetPosition = { ...position };
2000
1994
  for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2001
- if (flip !== true && !includes(flip, dir)) {
2002
- continue;
2003
- }
2004
-
2005
- const willFlip =
2006
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
1995
+ let viewports = scrollParents(target[i]);
1996
+ const [scrollElement] = viewports;
2007
1997
 
2008
- viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1998
+ let viewport = getIntersectionArea(...viewports.map(offsetViewport));
2009
1999
 
2010
2000
  if (viewportOffset) {
2011
2001
  viewport[start] += viewportOffset;
2012
2002
  viewport[end] -= viewportOffset;
2013
2003
  }
2014
2004
 
2015
- if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2016
- viewport = getIntersectionArea(viewport, offset(boundary));
2005
+ if (boundary) {
2006
+ viewport = getIntersectionArea(viewport, offsetViewport(boundary));
2017
2007
  }
2018
2008
 
2019
- const isInStartBoundary = position[start] >= viewport[start];
2020
- const isInEndBoundary = position[end] <= viewport[end];
2009
+ const isInStartViewport = position[start] >= viewport[start];
2010
+ const isInEndViewport = position[end] <= viewport[end];
2021
2011
 
2022
- if (isInStartBoundary && isInEndBoundary) {
2012
+ if (isInStartViewport && isInEndViewport) {
2023
2013
  continue;
2024
2014
  }
2025
2015
 
2026
- let offsetBy;
2016
+ let offsetBy = 0;
2017
+ const targetDim = offset(target[i]);
2027
2018
 
2028
2019
  // Flip
2029
- if (willFlip) {
2020
+ if (!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i)) {
2030
2021
  if (
2031
- elAttach[i] === end && isInStartBoundary ||
2032
- elAttach[i] === start && isInEndBoundary)
2022
+ !flip ||
2023
+ elAttach[i] === end && isInStartViewport ||
2024
+ elAttach[i] === start && isInEndViewport)
2033
2025
  {
2034
2026
  continue;
2035
2027
  }
@@ -2066,27 +2058,25 @@
2066
2058
  return false;
2067
2059
  }
2068
2060
 
2069
- if (flip === true || includes(flip, dirs[1 - i][1])) {
2070
- const newPos = attachToWithFlip(element, target, {
2071
- ...options,
2072
- attach: {
2073
- element: elAttach.map(flipDir).reverse(),
2074
- target: targetAttach.map(flipDir).reverse() },
2061
+ const newPos = getPosition(element, target, {
2062
+ ...options,
2063
+ attach: {
2064
+ element: elAttach.map(flipDir).reverse(),
2065
+ target: targetAttach.map(flipDir).reverse() },
2075
2066
 
2076
- offset: elOffset.reverse(),
2077
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2078
- recursion: true });
2067
+ offset: elOffset.reverse(),
2068
+ recursion: true });
2079
2069
 
2080
2070
 
2081
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2082
- return newPos;
2083
- }
2071
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2072
+ return newPos;
2084
2073
  }
2074
+
2085
2075
  continue;
2086
2076
  }
2087
2077
 
2088
- // Move
2089
- } else {
2078
+ // Shift
2079
+ } else if (shift) {
2090
2080
  offsetBy =
2091
2081
  clamp(
2092
2082
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2142,7 +2132,7 @@
2142
2132
  getImage: getImage,
2143
2133
  transition: transition,
2144
2134
  Transition: Transition,
2145
- animate: animate$1,
2135
+ animate: animate$2,
2146
2136
  Animation: Animation,
2147
2137
  attr: attr,
2148
2138
  hasAttr: hasAttr,
@@ -2596,7 +2586,7 @@
2596
2586
 
2597
2587
  value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2598
2588
 
2599
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2589
+ if (prop === 'target' && startsWith(value, '_')) {
2600
2590
  continue;
2601
2591
  }
2602
2592
 
@@ -2936,7 +2926,7 @@
2936
2926
  UIkit.data = '__uikit__';
2937
2927
  UIkit.prefix = 'uk-';
2938
2928
  UIkit.options = {};
2939
- UIkit.version = '3.14.4-dev.3a6c538ab';
2929
+ UIkit.version = '3.14.4-dev.5e7e87ba7';
2940
2930
 
2941
2931
  globalAPI(UIkit);
2942
2932
  hooksAPI(UIkit);
@@ -3041,27 +3031,7 @@
3041
3031
  origin: false,
3042
3032
  transition: 'ease',
3043
3033
  clsEnter: 'uk-togglabe-enter',
3044
- clsLeave: 'uk-togglabe-leave',
3045
-
3046
- initProps: {
3047
- overflow: '',
3048
- maxHeight: '',
3049
- paddingTop: '',
3050
- paddingBottom: '',
3051
- marginTop: '',
3052
- marginBottom: '',
3053
- boxShadow: '' },
3054
-
3055
-
3056
- hideProps: {
3057
- overflow: 'hidden',
3058
- maxHeight: 0,
3059
- paddingTop: 0,
3060
- paddingBottom: 0,
3061
- marginTop: 0,
3062
- marginBottom: 0,
3063
- boxShadow: 'none' } },
3064
-
3034
+ clsLeave: 'uk-togglabe-leave' },
3065
3035
 
3066
3036
 
3067
3037
  computed: {
@@ -3070,7 +3040,7 @@
3070
3040
  },
3071
3041
 
3072
3042
  hasTransition(_ref2) {let { animation } = _ref2;
3073
- return startsWith(animation[0], 'slide');
3043
+ return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
3074
3044
  } },
3075
3045
 
3076
3046
 
@@ -3163,122 +3133,97 @@
3163
3133
  };
3164
3134
  }
3165
3135
 
3166
- function toggleTransition(cmp) {
3167
- switch (cmp.animation[0]) {
3168
- case 'slide-left':
3169
- return slideHorizontal(cmp);
3170
- case 'slide-right':
3171
- return slideHorizontal(cmp, true);}
3172
-
3173
- return slide(cmp);
3174
- }
3175
-
3176
- function slide(_ref4)
3136
+ function toggleTransition(cmp) {var _cmp$animation$;
3137
+ const [mode = 'reveal', startProp = 'top'] = ((_cmp$animation$ = cmp.animation[0]) == null ? void 0 : _cmp$animation$.split('-')) || [];
3177
3138
 
3139
+ const dirs = [
3140
+ ['left', 'right'],
3141
+ ['top', 'bottom']];
3178
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;
3179
3149
 
3150
+ return async (el, show) => {
3151
+ let { duration, velocity, transition, _toggle } = cmp;
3180
3152
 
3153
+ let currentDim = dimensions(el)[dimProp];
3181
3154
 
3182
-
3183
-
3184
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3185
- return (el, show) => {
3186
3155
  const inProgress = Transition.inProgress(el);
3187
- const inner =
3188
- !inProgress && el.hasChildNodes() ?
3189
- toFloat(css(el.firstElementChild, 'marginTop')) +
3190
- toFloat(css(el.lastElementChild, 'marginBottom')) :
3191
- 0;
3192
- const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3156
+ await Transition.cancel(el);
3193
3157
 
3194
- const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3195
-
3196
- Transition.cancel(el);
3197
-
3198
- if (!isToggled(el)) {
3158
+ if (show) {
3199
3159
  _toggle(el, true);
3200
3160
  }
3201
3161
 
3202
- css(el, 'maxHeight', '');
3203
-
3204
- // Update child components first
3205
- fastdom.flush();
3162
+ const prevProps = Object.fromEntries(
3163
+ ['padding', 'border', 'width', 'height', 'overflow', marginProp, marginStartProp].map(
3164
+ (key) => [key, el.style[key]]));
3206
3165
 
3207
- const endHeight = toFloat(css(el, 'height')) + inner;
3208
- duration = velocity * endHeight + duration;
3209
-
3210
- css(el, { ...props, maxHeight: currentHeight });
3211
-
3212
- return (
3213
- show ?
3214
- Transition.start(
3215
- el,
3216
- { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3217
- duration * (1 - currentHeight / endHeight),
3218
- transition) :
3219
-
3220
- Transition.start(
3221
- el,
3222
- hideProps,
3223
- duration * (currentHeight / endHeight),
3224
- transition).
3225
- then(() => _toggle(el, false))).
3226
- then(() => css(el, initProps));
3227
- };
3228
- }
3229
-
3230
- function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3231
- return (el, show) => {
3232
- const visible = isVisible(el);
3233
- const marginLeft = toFloat(css(el, 'marginLeft'));
3234
3166
 
3235
- Transition.cancel(el);
3236
3167
 
3237
- const [scrollElement] = scrollParents(el.offsetParent);
3238
- css(scrollElement, 'overflowX', 'hidden');
3168
+ const dim = dimensions(el);
3169
+ const currentMargin = toFloat(css(el, marginProp));
3170
+ const marginStart = toFloat(css(el, marginStartProp));
3171
+ const endDim = dim[dimProp] + marginStart;
3239
3172
 
3240
- if (!isToggled(el)) {
3241
- _toggle(el, true);
3173
+ if (!inProgress && !show) {
3174
+ currentDim += marginStart;
3242
3175
  }
3243
3176
 
3244
- const width = toFloat(css(el, 'width'));
3245
- 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]) });
3190
+
3246
3191
 
3247
- const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3248
3192
 
3249
3193
  css(el, {
3250
- clipPath: right ? "polygon(0 0," +
3251
- percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3252
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)",
3253
- marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3194
+ padding: 0,
3195
+ border: 0,
3196
+ [marginStartProp]: 0,
3197
+ width: dim.width,
3198
+ height: dim.height,
3199
+ overflow: 'hidden',
3200
+ [dimProp]: currentDim });
3254
3201
 
3255
3202
 
3256
- return (
3257
- show ?
3258
- Transition.start(
3259
- el,
3260
- {
3261
- clipPath: "polygon(0 0,100% 0,100% 100%,0 100%)",
3262
- marginLeft: 0 },
3263
-
3264
- duration * (1 - percent / 100),
3265
- transition) :
3203
+ const percent = currentDim / endDim;
3204
+ duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
3205
+ const endProps = { [dimProp]: show ? endDim : 0 };
3266
3206
 
3267
- Transition.start(
3268
- el,
3269
- {
3270
- clipPath: right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)",
3207
+ if (end) {
3208
+ css(el, marginProp, endDim - currentDim + currentMargin);
3209
+ endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
3210
+ }
3271
3211
 
3212
+ if (!end ^ mode === 'reveal') {
3213
+ css(wrapper, marginProp, -endDim + currentDim);
3214
+ Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
3215
+ }
3272
3216
 
3273
- 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);
3274
3222
 
3275
- duration * (percent / 100),
3276
- transition).
3277
- then(() => _toggle(el, false))).
3278
- then(() => {
3279
- css(scrollElement, 'overflowX', '');
3280
- css(el, { clipPath: '', marginLeft: '' });
3281
- });
3223
+ if (!show) {
3224
+ _toggle(el, false);
3225
+ }
3226
+ }
3282
3227
  };
3283
3228
  }
3284
3229
 
@@ -3303,6 +3248,7 @@
3303
3248
  mixins: [Class, Lazyload, Togglable],
3304
3249
 
3305
3250
  props: {
3251
+ animation: Boolean,
3306
3252
  targets: String,
3307
3253
  active: null,
3308
3254
  collapsible: Boolean,
@@ -3315,7 +3261,7 @@
3315
3261
  data: {
3316
3262
  targets: '> *',
3317
3263
  active: false,
3318
- animation: ['slide'],
3264
+ animation: true,
3319
3265
  collapsible: true,
3320
3266
  multiple: false,
3321
3267
  clsOpen: 'uk-open',
@@ -3361,7 +3307,7 @@
3361
3307
  hide(
3362
3308
  el,
3363
3309
  !hasClass(
3364
- this.items.find((item) => item.contains(el)),
3310
+ this.items.find((item) => within(el, item)),
3365
3311
  this.clsOpen));
3366
3312
 
3367
3313
 
@@ -3413,23 +3359,15 @@
3413
3359
  toggleClass(el, this.clsOpen, show);
3414
3360
  attr($(this.$props.toggle, el), 'aria-expanded', show);
3415
3361
 
3416
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3362
+ const content = $(this.content, el);
3417
3363
 
3418
- if (animate === false || !this.hasTransition) {
3364
+ if (animate === false || !this.animation) {
3365
+ content.hidden = !show;
3419
3366
  hide(content, !show);
3420
3367
  return;
3421
3368
  }
3422
3369
 
3423
- if (!el._wrapper) {
3424
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3425
- }
3426
-
3427
- hide(content, false);
3428
- await slide(this)(el._wrapper, show);
3429
- hide(content, !show);
3430
-
3431
- delete el._wrapper;
3432
- unwrap(content);
3370
+ await toggleTransition(this)(content, show);
3433
3371
 
3434
3372
  if (show) {
3435
3373
  const toggle = $(this.$props.toggle, el);
@@ -3455,18 +3393,17 @@
3455
3393
  args: 'animation',
3456
3394
 
3457
3395
  props: {
3396
+ animation: Boolean,
3458
3397
  close: String },
3459
3398
 
3460
3399
 
3461
3400
  data: {
3462
- animation: ['slide'],
3401
+ animation: true,
3463
3402
  selClose: '.uk-alert-close',
3464
- duration: 150,
3465
- hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3403
+ duration: 150 },
3466
3404
 
3467
3405
 
3468
- events: [
3469
- {
3406
+ events: {
3470
3407
  name: 'click',
3471
3408
 
3472
3409
  delegate() {
@@ -3476,16 +3413,39 @@
3476
3413
  handler(e) {
3477
3414
  e.preventDefault();
3478
3415
  this.close();
3479
- } }],
3480
-
3416
+ } },
3481
3417
 
3482
3418
 
3483
3419
  methods: {
3484
3420
  async close() {
3485
- await this.toggleElement(this.$el);
3421
+ await this.toggleElement(this.$el, false, animate$1(this));
3486
3422
  this.$destroy(true);
3487
3423
  } } };
3488
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
+
3489
3449
  var Video = {
3490
3450
  args: 'autoplay',
3491
3451
 
@@ -3634,13 +3594,17 @@
3634
3594
  props: {
3635
3595
  pos: String,
3636
3596
  offset: null,
3637
- flip: Boolean },
3597
+ flip: Boolean,
3598
+ shift: Boolean,
3599
+ inset: Boolean },
3638
3600
 
3639
3601
 
3640
3602
  data: {
3641
3603
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3604
+ offset: false,
3642
3605
  flip: true,
3643
- offset: false },
3606
+ shift: true,
3607
+ inset: false },
3644
3608
 
3645
3609
 
3646
3610
  connected() {
@@ -3654,7 +3618,7 @@
3654
3618
  let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3655
3619
 
3656
3620
  const attach = {
3657
- element: [flipPosition(this.dir), this.align],
3621
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3658
3622
  target: [this.dir, this.align] };
3659
3623
 
3660
3624
 
@@ -3672,22 +3636,15 @@
3672
3636
  const elDim = dimensions(element);
3673
3637
  css(element, { top: -elDim.height, left: -elDim.width });
3674
3638
 
3675
- const args = [
3676
- element,
3677
- target,
3678
- {
3639
+ positionAt(element, target, {
3679
3640
  attach,
3680
3641
  offset,
3681
3642
  boundary,
3682
3643
  flip: this.flip,
3683
- viewportOffset: this.getViewportOffset(element) }];
3684
-
3644
+ shift: this.shift,
3645
+ viewportOffset: this.getViewportOffset(element) });
3685
3646
 
3686
3647
 
3687
- trigger(element, 'beforeposition', args);
3688
-
3689
- positionAt(...args);
3690
-
3691
3648
  // Restore scroll position
3692
3649
  scrollElement.scrollTop = scrollTop;
3693
3650
  scrollElement.scrollLeft = scrollLeft;
@@ -3699,12 +3656,14 @@
3699
3656
  this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3700
3657
  this.axis === 'x' ? 'width' : 'height',
3701
3658
  element) * (
3702
- includes(['left', 'top'], this.dir) ? -1 : 1));
3659
+
3660
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3661
+ this.inset ? -1 : 1));
3703
3662
 
3704
3663
  },
3705
3664
 
3706
3665
  getShiftOffset(element) {
3707
- return includes(['center', 'justify', 'stretch'], this.align) ?
3666
+ return this.align === 'center' ?
3708
3667
  0 :
3709
3668
  toPx(
3710
3669
  css(element, '--uk-position-shift-offset'),
@@ -4063,7 +4022,10 @@
4063
4022
  mode: 'list',
4064
4023
  toggle: Boolean,
4065
4024
  boundary: Boolean,
4066
- boundaryAlign: Boolean,
4025
+ target: Boolean,
4026
+ targetX: Boolean,
4027
+ targetY: Boolean,
4028
+ stretch: Boolean,
4067
4029
  delayShow: Number,
4068
4030
  delayHide: Number,
4069
4031
  display: String,
@@ -4075,17 +4037,32 @@
4075
4037
  data: {
4076
4038
  mode: ['click', 'hover'],
4077
4039
  toggle: '- *',
4078
- boundary: true,
4079
- boundaryAlign: false,
4040
+ boundary: false,
4041
+ target: false,
4042
+ targetX: false,
4043
+ targetY: false,
4044
+ stretch: false,
4080
4045
  delayShow: 0,
4081
4046
  delayHide: 800,
4082
4047
  display: null,
4083
4048
  clsDrop: false,
4049
+ animateOut: false,
4050
+ bgScroll: true,
4084
4051
  animation: ['uk-animation-fade'],
4085
4052
  cls: 'uk-open',
4086
- container: false,
4087
- animateOut: false,
4088
- bgScroll: true },
4053
+ container: false },
4054
+
4055
+
4056
+ computed: {
4057
+ target(_ref, $el) {let { target, targetX, targetY } = _ref;
4058
+ targetX = targetX || target || this.targetEl;
4059
+ targetY = targetY || target || this.targetEl;
4060
+
4061
+ return [
4062
+ targetX === true ? window : query(targetX, $el),
4063
+ targetY === true ? window : query(targetY, $el)];
4064
+
4065
+ } },
4089
4066
 
4090
4067
 
4091
4068
  created() {
@@ -4099,13 +4076,13 @@
4099
4076
  connected() {
4100
4077
  addClass(this.$el, this.clsDrop);
4101
4078
 
4102
- if (this.toggle && !this.target) {
4103
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
4079
+ if (this.toggle && !this.targetEl) {
4080
+ this.targetEl = this.$create('toggle', query(this.toggle, this.$el), {
4104
4081
  target: this.$el,
4105
4082
  mode: this.mode }).
4106
4083
  $el;
4107
- attr(this.target, 'aria-haspopup', true);
4108
- this.lazyload(this.target);
4084
+ attr(this.targetEl, 'aria-haspopup', true);
4085
+ this.lazyload(this.targetEl);
4109
4086
  }
4110
4087
  },
4111
4088
 
@@ -4136,7 +4113,7 @@
4136
4113
  return 'a[href^="#"]';
4137
4114
  },
4138
4115
 
4139
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4116
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4140
4117
  if (!defaultPrevented && hash && !within(hash, this.$el)) {
4141
4118
  this.hide(false);
4142
4119
  }
@@ -4248,17 +4225,17 @@
4248
4225
  on(
4249
4226
  document,
4250
4227
  pointerDown,
4251
- (_ref2) => {let { target } = _ref2;return (
4228
+ (_ref3) => {let { target } = _ref3;return (
4252
4229
  !within(target, this.$el) &&
4253
4230
  once(
4254
4231
  document,
4255
4232
  pointerUp + " " + pointerCancel + " scroll",
4256
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4233
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
4257
4234
  if (
4258
4235
  !defaultPrevented &&
4259
4236
  type === pointerUp &&
4260
4237
  target === newTarget &&
4261
- !(this.target && within(target, this.target)))
4238
+ !(this.targetEl && within(target, this.targetEl)))
4262
4239
  {
4263
4240
  this.hide(false);
4264
4241
  }
@@ -4277,13 +4254,13 @@
4277
4254
  [] :
4278
4255
  [preventOverscroll(this.$el), preventBackgroundScroll()]),
4279
4256
 
4280
- ...(this.display === 'static' && this.align !== 'stretch' ?
4257
+ ...(this.display === 'static' ?
4281
4258
  [] :
4282
4259
  (() => {
4283
4260
  const handler = () => this.$emit();
4284
4261
  return [
4285
4262
  on(window, 'resize', handler),
4286
- on(document, 'scroll', handler, true),
4263
+ on([document, scrollParents(this.$el)], 'scroll', handler),
4287
4264
  (() => {
4288
4265
  const observer = observeResize(
4289
4266
  scrollParents(this.$el),
@@ -4312,7 +4289,7 @@
4312
4289
  {
4313
4290
  name: 'hide',
4314
4291
 
4315
- handler(_ref4) {let { target } = _ref4;
4292
+ handler(_ref5) {let { target } = _ref5;
4316
4293
  if (this.$el !== target) {
4317
4294
  active =
4318
4295
  active === null && within(target, this.$el) && this.isToggled() ?
@@ -4336,12 +4313,12 @@
4336
4313
 
4337
4314
 
4338
4315
  methods: {
4339
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4340
- if (this.isToggled() && target && this.target && target !== this.target) {
4316
+ show(target, delay) {if (target === void 0) {target = this.targetEl;}if (delay === void 0) {delay = true;}
4317
+ if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {
4341
4318
  this.hide(false, false);
4342
4319
  }
4343
4320
 
4344
- this.target = target;
4321
+ this.targetEl = target;
4345
4322
 
4346
4323
  this.clearTimers();
4347
4324
 
@@ -4404,60 +4381,72 @@
4404
4381
 
4405
4382
  position() {
4406
4383
  removeClass(this.$el, this.clsDrop + "-stack");
4407
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4408
- toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4384
+ css(this.$el, { maxWidth: '', top: '', left: '' });
4409
4385
 
4410
- const boundary = query(this.boundary, this.$el);
4411
- const target = boundary && this.boundaryAlign ? boundary : this.target;
4412
- const [scrollParent] = scrollParents(
4413
- boundary && this.boundaryAlign ? boundary : this.$el);
4386
+ // Ensure none positioned element does not generate scrollbars
4387
+ this.$el.hidden = true;
4414
4388
 
4415
- const scrollParentOffset = offset(scrollParent);
4416
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4389
+ const boundary = query(this.boundary, this.$el);
4390
+ const boundaryOffset = offsetViewport(boundary || window);
4391
+ const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4417
4392
  const viewportOffset = this.getViewportOffset(this.$el);
4418
4393
 
4419
- css(this.$el, 'maxWidth', '');
4420
- const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4394
+ const dirs = [
4395
+ [0, ['x', 'width', 'left', 'right']],
4396
+ [1, ['y', 'height', 'top', 'bottom']]];
4421
4397
 
4422
- if (this.align === 'justify') {
4423
- const prop = this.axis === 'y' ? 'width' : 'height';
4424
- css(
4425
- this.$el,
4426
- prop,
4427
- Math.min(
4428
- (boundary ? boundaryOffset : offset(this.target))[prop],
4429
- scrollParentOffset[prop] - 2 * viewportOffset));
4430
-
4431
-
4432
- } else if (this.align === 'stretch') {
4433
- this.flip = this.axis === 'y' ? 'x' : 'y';
4434
- this.display = 'static';
4435
-
4436
- const viewport = offsetViewport(scrollParent);
4437
- const targetDim = offset(target);
4438
- const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4439
-
4440
- css(this.$el, {
4441
- width:
4442
- this.axis === 'y' ?
4443
- viewport.width :
4444
- (this.dir === 'left' ?
4445
- targetDim.left - viewport.left :
4446
- viewport.right - targetDim.right) - elOffset,
4447
- height:
4448
- this.axis === 'x' ?
4449
- viewport.height :
4450
- (this.dir === 'top' ?
4451
- targetDim.top - viewport.top :
4452
- viewport.bottom - targetDim.bottom) - elOffset });
4453
-
4454
- } else if (this.$el.offsetWidth > maxWidth) {
4398
+
4399
+ for (const [i, [axis, prop]] of dirs) {
4400
+ if (includes([axis, true], this.stretch)) {
4401
+ css(this.$el, {
4402
+ [prop]:
4403
+ this.axis === axis ?
4404
+ '' // Reset prop in main axis before positioning to not cause the drop to flip prematurely
4405
+ : Math.min(
4406
+ boundaryOffset[prop],
4407
+ viewports[i][prop] - 2 * viewportOffset),
4408
+
4409
+ ["overflow-" + axis]: 'auto' });
4410
+
4411
+ }
4412
+ }
4413
+
4414
+ const maxWidth = viewports[0].width - 2 * viewportOffset;
4415
+
4416
+ if (this.$el.offsetWidth > maxWidth) {
4455
4417
  addClass(this.$el, this.clsDrop + "-stack");
4456
4418
  }
4457
4419
 
4458
4420
  css(this.$el, 'maxWidth', maxWidth);
4459
4421
 
4460
- this.positionAt(this.$el, target, boundary);
4422
+ this.$el.hidden = false;
4423
+
4424
+ this.positionAt(this.$el, this.target, boundary);
4425
+
4426
+ for (const [i, [axis, prop, start, end]] of dirs) {
4427
+ if (this.axis === axis && includes([axis, true], this.stretch)) {
4428
+ const positionOffset = Math.abs(this.getPositionOffset(this.$el));
4429
+ const targetOffset = offset(this.target[i]);
4430
+ const elOffset = offset(this.$el);
4431
+
4432
+ css(this.$el, {
4433
+ [prop]:
4434
+ (targetOffset[start] > elOffset[start] ?
4435
+ targetOffset[start] -
4436
+ Math.max(
4437
+ boundaryOffset[start],
4438
+ viewports[i][start] + viewportOffset) :
4439
+
4440
+ Math.min(
4441
+ boundaryOffset[end],
4442
+ viewports[i][end] - viewportOffset) -
4443
+ targetOffset[end]) - positionOffset,
4444
+ ["overflow-" + axis]: 'auto' });
4445
+
4446
+
4447
+ this.positionAt(this.$el, this.target, boundary);
4448
+ }
4449
+ }
4461
4450
  } } };
4462
4451
 
4463
4452
 
@@ -4954,8 +4943,11 @@
4954
4943
  let minHeight = '';
4955
4944
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4956
4945
 
4946
+ const { body, scrollingElement } = document;
4957
4947
  const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4958
- const { height: viewportHeight } = offsetViewport(scrollElement);
4948
+ const { height: viewportHeight } = offsetViewport(
4949
+ scrollElement === body ? scrollingElement : scrollElement);
4950
+
4959
4951
 
4960
4952
  if (this.expand) {
4961
4953
  minHeight = Math.max(
@@ -4965,7 +4957,6 @@
4965
4957
  0);
4966
4958
 
4967
4959
  } else {
4968
- const { body, scrollingElement } = document;
4969
4960
  const isScrollingElement =
4970
4961
  scrollingElement === scrollElement || body === scrollElement;
4971
4962
 
@@ -5227,7 +5218,7 @@
5227
5218
 
5228
5219
  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
5220
 
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>";
5221
+ var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><style>.uk-navbar-toggle svg > [class*='line-'] {\n transition: 0.2s ease-in-out;\n transition-property: transform, opacity,;\n transform-origin: center;\n opacity: 1;\n }\n\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-2 { transform: rotate(45deg); }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-3 { transform: rotate(-45deg); }\n\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-1,\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-4 { opacity: 0; }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-1 { transform: translateY(6px) scaleX(0); }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-4 { transform: translateY(-6px) scaleX(0); }</style><rect class=\"line-1\" y=\"3\" width=\"20\" height=\"2\"/><rect class=\"line-2\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-3\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-4\" y=\"15\" width=\"20\" height=\"2\"/></svg>";
5231
5222
 
5232
5223
  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
5224
 
@@ -5829,7 +5820,7 @@
5829
5820
  align: String,
5830
5821
  offset: Number,
5831
5822
  boundary: Boolean,
5832
- boundaryAlign: Boolean,
5823
+ target: Boolean,
5833
5824
  clsDrop: String,
5834
5825
  delayShow: Number,
5835
5826
  delayHide: Number,
@@ -5846,9 +5837,12 @@
5846
5837
  offset: undefined,
5847
5838
  delayShow: undefined,
5848
5839
  delayHide: undefined,
5849
- boundaryAlign: undefined,
5850
- flip: 'x',
5840
+ flip: false,
5841
+ shift: true,
5851
5842
  boundary: true,
5843
+ target: false,
5844
+ targetX: false,
5845
+ targetY: false,
5852
5846
  dropbar: false,
5853
5847
  dropbarAnchor: false,
5854
5848
  duration: 200,
@@ -5883,7 +5877,7 @@
5883
5877
  },
5884
5878
 
5885
5879
  watch(dropbar) {
5886
- addClass(dropbar, 'uk-navbar-dropbar');
5880
+ addClass(dropbar, 'uk-dropbar', 'uk-dropbar-top', 'uk-navbar-dropbar');
5887
5881
  },
5888
5882
 
5889
5883
  immediate: true },
@@ -5899,7 +5893,7 @@
5899
5893
 
5900
5894
  if (this.dropContainer !== $el) {
5901
5895
  for (const el of $$("." + clsDrop, this.dropContainer)) {var _this$getDropdown;
5902
- const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.target;
5896
+ const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.targetEl;
5903
5897
  if (!includes(dropdowns, el) && target && within(target, this.$el)) {
5904
5898
  dropdowns.push(el);
5905
5899
  }
@@ -5961,8 +5955,8 @@
5961
5955
  if (
5962
5956
  active &&
5963
5957
  includes(active.mode, 'hover') &&
5964
- active.target &&
5965
- !within(active.target, current) &&
5958
+ active.targetEl &&
5959
+ !within(active.targetEl, current) &&
5966
5960
  !active.isDelaying)
5967
5961
  {
5968
5962
  active.hide(false);
@@ -5984,7 +5978,7 @@
5984
5978
  if (keyCode === keyMap.DOWN && hasAttr(current, 'aria-expanded')) {
5985
5979
  e.preventDefault();
5986
5980
 
5987
- if (!active || active.target !== current) {
5981
+ if (!active || active.targetEl !== current) {
5988
5982
  current.click();
5989
5983
  once(this.dropContainer, 'show', (_ref8) => {let { target } = _ref8;return (
5990
5984
  focusFirstFocusableElement(target));});
@@ -6034,8 +6028,8 @@
6034
6028
  }
6035
6029
  }
6036
6030
 
6037
- if (keyCode === keyMap.ESC) {var _active$target;
6038
- active == null ? void 0 : (_active$target = active.target) == null ? void 0 : _active$target.focus();
6031
+ if (keyCode === keyMap.ESC) {var _active$targetEl;
6032
+ active == null ? void 0 : (_active$targetEl = active.targetEl) == null ? void 0 : _active$targetEl.focus();
6039
6033
  }
6040
6034
 
6041
6035
  handleNavItemNavigation(e, this.toggles, active);
@@ -6106,39 +6100,19 @@
6106
6100
  return;
6107
6101
  }
6108
6102
 
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);
6137
-
6138
- css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
6103
+ this._observer = observeResize(target, () => {
6104
+ const targetOffsets = parents(target, "." + this.clsDrop).
6105
+ concat(target).
6106
+ map((el) => offset(el));
6107
+ const minTop = Math.min(...targetOffsets.map((_ref11) => {let { top } = _ref11;return top;}));
6108
+ const maxBottom = Math.max(...targetOffsets.map((_ref12) => {let { bottom } = _ref12;return bottom;}));
6109
+ const dropbarOffset = offset(this.dropbar);
6110
+ css(this.dropbar, 'top', this.dropbar.offsetTop - (dropbarOffset.top - minTop));
6111
+ this.transitionTo(
6112
+ maxBottom - minTop + toFloat(css(target, 'marginBottom')),
6113
+ target);
6139
6114
 
6140
- options.offset[1] = dropbarOffset.top - offset(target).bottom;
6141
- options.viewportOffset += dropbarOffset.left;
6115
+ });
6142
6116
  } },
6143
6117
 
6144
6118
 
@@ -6159,7 +6133,7 @@
6159
6133
  if (
6160
6134
  matches(this.dropbar, ':hover') &&
6161
6135
  (active == null ? void 0 : active.$el) === e.target &&
6162
- !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6136
+ !this.toggles.some((el) => active.targetEl !== el && matches(el, ':focus')))
6163
6137
  {
6164
6138
  e.preventDefault();
6165
6139
  }
@@ -6177,7 +6151,7 @@
6177
6151
  return this.dropbar;
6178
6152
  },
6179
6153
 
6180
- handler(_ref11) {let { target } = _ref11;
6154
+ handler(_ref13) {let { target } = _ref13;
6181
6155
  if (!this.isDropbarDrop(target)) {
6182
6156
  return;
6183
6157
  }
@@ -6195,7 +6169,7 @@
6195
6169
 
6196
6170
  methods: {
6197
6171
  getActive() {
6198
- return active && within(active.target, this.$el) && active;
6172
+ return active && within(active.targetEl, this.$el) && active;
6199
6173
  },
6200
6174
 
6201
6175
  transitionTo(newHeight, el) {
@@ -6228,15 +6202,14 @@
6228
6202
  },
6229
6203
 
6230
6204
  isDropbarDrop(el) {
6231
- const drop = this.getDropdown(el);
6232
- return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
6205
+ return this.getDropdown(el) && hasClass(el, this.clsDrop);
6233
6206
  } } };
6234
6207
 
6235
6208
 
6236
6209
 
6237
6210
  function handleNavItemNavigation(e, toggles, active) {
6238
6211
  const { current, keyCode } = e;
6239
- const target = (active == null ? void 0 : active.target) || current;
6212
+ const target = (active == null ? void 0 : active.targetEl) || current;
6240
6213
  const i = toggles.indexOf(target);
6241
6214
 
6242
6215
  // Left
@@ -6604,6 +6577,14 @@
6604
6577
  offset: 0 },
6605
6578
 
6606
6579
 
6580
+ connected() {
6581
+ registerClick(this);
6582
+ },
6583
+
6584
+ disconnected() {
6585
+ unregisterClick(this);
6586
+ },
6587
+
6607
6588
  methods: {
6608
6589
  async scrollTo(el) {
6609
6590
  el = el && $(el) || document.body;
@@ -6612,20 +6593,39 @@
6612
6593
  await scrollIntoView(el, { offset: this.offset });
6613
6594
  trigger(this.$el, 'scrolled', [this, el]);
6614
6595
  }
6615
- } },
6596
+ } } };
6616
6597
 
6617
6598
 
6618
- events: {
6619
- click(e) {
6620
- if (e.defaultPrevented) {
6621
- return;
6622
- }
6623
6599
 
6624
- e.preventDefault();
6625
- this.scrollTo(getTargetElement(this.$el));
6626
- } } };
6600
+ const components$1 = new Set();
6601
+ function registerClick(cmp) {
6602
+ if (!components$1.size) {
6603
+ on(document, 'click', clickHandler);
6604
+ }
6605
+
6606
+ components$1.add(cmp);
6607
+ }
6627
6608
 
6609
+ function unregisterClick(cmp) {
6610
+ components$1.delete(cmp);
6628
6611
 
6612
+ if (!components$1.length) {
6613
+ off(document, 'click', clickHandler);
6614
+ }
6615
+ }
6616
+
6617
+ function clickHandler(e) {
6618
+ if (e.defaultPrevented) {
6619
+ return;
6620
+ }
6621
+
6622
+ for (const component of components$1) {
6623
+ if (within(e.target, component.$el)) {
6624
+ e.preventDefault();
6625
+ component.scrollTo(getTargetElement(component.$el));
6626
+ }
6627
+ }
6628
+ }
6629
6629
 
6630
6630
  function getTargetElement(el) {
6631
6631
  return document.getElementById(decodeURIComponent(el.hash).substring(1));