uikit 3.14.4-dev.51a1b06ef → 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 (112) hide show
  1. package/CHANGELOG.md +27 -17
  2. package/build/util.js +1 -0
  3. package/dist/css/uikit-core-rtl.css +265 -59
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +265 -59
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +285 -63
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +285 -63
  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 +297 -324
  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 +297 -324
  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/navbar.js +28 -45
  50. package/src/js/mixin/position.js +18 -20
  51. package/src/js/mixin/togglable.js +80 -124
  52. package/src/js/util/animation.js +4 -3
  53. package/src/js/util/filter.js +3 -7
  54. package/src/js/util/position.js +42 -47
  55. package/src/js/util/viewport.js +1 -1
  56. package/src/less/components/_import.less +1 -0
  57. package/src/less/components/drop.less +1 -18
  58. package/src/less/components/dropbar.less +115 -0
  59. package/src/less/components/dropdown.less +6 -20
  60. package/src/less/components/nav.less +203 -19
  61. package/src/less/components/navbar.less +10 -51
  62. package/src/less/theme/_import.less +1 -0
  63. package/src/less/theme/dropbar.less +44 -0
  64. package/src/less/theme/dropdown.less +0 -11
  65. package/src/less/theme/nav.less +46 -0
  66. package/src/less/theme/navbar.less +1 -5
  67. package/src/scss/components/_import.scss +1 -0
  68. package/src/scss/components/drop.scss +1 -18
  69. package/src/scss/components/dropbar.scss +115 -0
  70. package/src/scss/components/dropdown.scss +6 -20
  71. package/src/scss/components/nav.scss +153 -19
  72. package/src/scss/components/navbar.scss +10 -51
  73. package/src/scss/mixins-theme.scss +76 -6
  74. package/src/scss/mixins.scss +73 -2
  75. package/src/scss/theme/_import.scss +1 -0
  76. package/src/scss/theme/dropbar.scss +44 -0
  77. package/src/scss/theme/dropdown.scss +0 -8
  78. package/src/scss/theme/nav.scss +44 -0
  79. package/src/scss/theme/navbar.scss +1 -5
  80. package/src/scss/variables-theme.scss +50 -9
  81. package/src/scss/variables.scss +39 -7
  82. package/tests/accordion.html +2 -2
  83. package/tests/alert.html +2 -2
  84. package/tests/countdown.html +1 -1
  85. package/tests/drop.html +444 -412
  86. package/tests/dropbar.html +456 -0
  87. package/tests/dropdown.html +8 -470
  88. package/tests/filter.html +9 -12
  89. package/tests/form.html +1 -1
  90. package/tests/index.html +123 -104
  91. package/tests/lightbox.html +5 -5
  92. package/tests/list.html +8 -8
  93. package/tests/modal.html +13 -13
  94. package/tests/nav.html +117 -8
  95. package/tests/navbar.html +75 -211
  96. package/tests/offcanvas.html +2 -6
  97. package/tests/parallax.html +1 -1
  98. package/tests/position.html +13 -24
  99. package/tests/progress.html +9 -9
  100. package/tests/scroll.html +7 -10
  101. package/tests/search.html +5 -5
  102. package/tests/slider.html +6 -5
  103. package/tests/slideshow.html +8 -8
  104. package/tests/sortable.html +6 -8
  105. package/tests/sticky-navbar.html +6 -6
  106. package/tests/sticky.html +8 -8
  107. package/tests/switcher.html +1 -1
  108. package/tests/tab.html +1 -1
  109. package/tests/table.html +7 -7
  110. package/tests/toggle.html +2 -2
  111. package/tests/tooltip.html +1 -1
  112. package/tests/upload.html +11 -11
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.51a1b06ef | 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) {
@@ -1911,7 +1908,7 @@
1911
1908
  // iOS 12 returns <body> as scrollingElement
1912
1909
  viewportElement = documentElement;
1913
1910
  } else {
1914
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1911
+ rect[start] += toFloat(css(viewportElement, "border-" + start + "-width"));
1915
1912
  }
1916
1913
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1917
1914
  rect[end] = rect[prop] + rect[start];
@@ -1939,11 +1936,11 @@
1939
1936
  ...options };
1940
1937
 
1941
1938
 
1942
- const dim = options.flip ?
1943
- attachToWithFlip(element, target, options) :
1944
- attachTo(element, target, options);
1939
+ if (!isArray(target)) {
1940
+ target = [target, target];
1941
+ }
1945
1942
 
1946
- offset(element, dim);
1943
+ offset(element, getPosition(element, target, options));
1947
1944
  }
1948
1945
 
1949
1946
  function attachTo(element, target, options) {
@@ -1958,8 +1955,11 @@
1958
1955
 
1959
1956
 
1960
1957
  const position = offset(element);
1961
- const targetOffset = offset(target);
1958
+
1962
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
+
1963
1963
  position[start] = position[dir] =
1964
1964
  targetOffset[start] +
1965
1965
  moveBy(attach.target[i], end, targetOffset[prop]) -
@@ -1974,60 +1974,54 @@
1974
1974
  return start === 'center' ? dim / 2 : start === end ? dim : 0;
1975
1975
  }
1976
1976
 
1977
- function attachToWithFlip(element, target, options) {
1977
+ function getPosition(element, target, options) {
1978
1978
  const position = attachTo(element, target, options);
1979
- const targetDim = offset(target);
1980
1979
 
1981
1980
  let {
1982
1981
  flip,
1982
+ shift,
1983
1983
  attach: { element: elAttach, target: targetAttach },
1984
1984
  offset: elOffset,
1985
1985
  boundary,
1986
- viewport,
1987
1986
  viewportOffset } =
1988
1987
  options;
1989
1988
 
1990
- let viewports = scrollParents(element);
1991
- if (boundary === target) {
1992
- viewports = viewports.filter((viewport) => viewport !== boundary);
1989
+ if (!flip && !shift) {
1990
+ return position;
1993
1991
  }
1994
- const [scrollElement] = viewports;
1995
- viewports.push(viewport);
1996
1992
 
1997
1993
  const offsetPosition = { ...position };
1998
1994
  for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1999
- if (flip !== true && !includes(flip, dir)) {
2000
- continue;
2001
- }
2002
-
2003
- const willFlip =
2004
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
1995
+ let viewports = scrollParents(target[i]);
1996
+ const [scrollElement] = viewports;
2005
1997
 
2006
- viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1998
+ let viewport = getIntersectionArea(...viewports.map(offsetViewport));
2007
1999
 
2008
2000
  if (viewportOffset) {
2009
2001
  viewport[start] += viewportOffset;
2010
2002
  viewport[end] -= viewportOffset;
2011
2003
  }
2012
2004
 
2013
- if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2014
- viewport = getIntersectionArea(viewport, offset(boundary));
2005
+ if (boundary) {
2006
+ viewport = getIntersectionArea(viewport, offsetViewport(boundary));
2015
2007
  }
2016
2008
 
2017
- const isInStartBoundary = position[start] >= viewport[start];
2018
- const isInEndBoundary = position[end] <= viewport[end];
2009
+ const isInStartViewport = position[start] >= viewport[start];
2010
+ const isInEndViewport = position[end] <= viewport[end];
2019
2011
 
2020
- if (isInStartBoundary && isInEndBoundary) {
2012
+ if (isInStartViewport && isInEndViewport) {
2021
2013
  continue;
2022
2014
  }
2023
2015
 
2024
- let offsetBy;
2016
+ let offsetBy = 0;
2017
+ const targetDim = offset(target[i]);
2025
2018
 
2026
2019
  // Flip
2027
- if (willFlip) {
2020
+ if (!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i)) {
2028
2021
  if (
2029
- elAttach[i] === end && isInStartBoundary ||
2030
- elAttach[i] === start && isInEndBoundary)
2022
+ !flip ||
2023
+ elAttach[i] === end && isInStartViewport ||
2024
+ elAttach[i] === start && isInEndViewport)
2031
2025
  {
2032
2026
  continue;
2033
2027
  }
@@ -2064,27 +2058,25 @@
2064
2058
  return false;
2065
2059
  }
2066
2060
 
2067
- if (flip === true || includes(flip, dirs[1 - i][1])) {
2068
- const newPos = attachToWithFlip(element, target, {
2069
- ...options,
2070
- attach: {
2071
- element: elAttach.map(flipDir).reverse(),
2072
- target: targetAttach.map(flipDir).reverse() },
2061
+ const newPos = getPosition(element, target, {
2062
+ ...options,
2063
+ attach: {
2064
+ element: elAttach.map(flipDir).reverse(),
2065
+ target: targetAttach.map(flipDir).reverse() },
2073
2066
 
2074
- offset: elOffset.reverse(),
2075
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2076
- recursion: true });
2067
+ offset: elOffset.reverse(),
2068
+ recursion: true });
2077
2069
 
2078
2070
 
2079
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2080
- return newPos;
2081
- }
2071
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2072
+ return newPos;
2082
2073
  }
2074
+
2083
2075
  continue;
2084
2076
  }
2085
2077
 
2086
- // Move
2087
- } else {
2078
+ // Shift
2079
+ } else if (shift) {
2088
2080
  offsetBy =
2089
2081
  clamp(
2090
2082
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2140,7 +2132,7 @@
2140
2132
  getImage: getImage,
2141
2133
  transition: transition,
2142
2134
  Transition: Transition,
2143
- animate: animate$1,
2135
+ animate: animate$2,
2144
2136
  Animation: Animation,
2145
2137
  attr: attr,
2146
2138
  hasAttr: hasAttr,
@@ -2594,7 +2586,7 @@
2594
2586
 
2595
2587
  value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2596
2588
 
2597
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2589
+ if (prop === 'target' && startsWith(value, '_')) {
2598
2590
  continue;
2599
2591
  }
2600
2592
 
@@ -2934,7 +2926,7 @@
2934
2926
  UIkit.data = '__uikit__';
2935
2927
  UIkit.prefix = 'uk-';
2936
2928
  UIkit.options = {};
2937
- UIkit.version = '3.14.4-dev.51a1b06ef';
2929
+ UIkit.version = '3.14.4-dev.5e7e87ba7';
2938
2930
 
2939
2931
  globalAPI(UIkit);
2940
2932
  hooksAPI(UIkit);
@@ -3039,27 +3031,7 @@
3039
3031
  origin: false,
3040
3032
  transition: 'ease',
3041
3033
  clsEnter: 'uk-togglabe-enter',
3042
- clsLeave: 'uk-togglabe-leave',
3043
-
3044
- initProps: {
3045
- overflow: '',
3046
- maxHeight: '',
3047
- paddingTop: '',
3048
- paddingBottom: '',
3049
- marginTop: '',
3050
- marginBottom: '',
3051
- boxShadow: '' },
3052
-
3053
-
3054
- hideProps: {
3055
- overflow: 'hidden',
3056
- maxHeight: 0,
3057
- paddingTop: 0,
3058
- paddingBottom: 0,
3059
- marginTop: 0,
3060
- marginBottom: 0,
3061
- boxShadow: 'none' } },
3062
-
3034
+ clsLeave: 'uk-togglabe-leave' },
3063
3035
 
3064
3036
 
3065
3037
  computed: {
@@ -3068,7 +3040,7 @@
3068
3040
  },
3069
3041
 
3070
3042
  hasTransition(_ref2) {let { animation } = _ref2;
3071
- return startsWith(animation[0], 'slide');
3043
+ return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
3072
3044
  } },
3073
3045
 
3074
3046
 
@@ -3161,122 +3133,97 @@
3161
3133
  };
3162
3134
  }
3163
3135
 
3164
- function toggleTransition(cmp) {
3165
- switch (cmp.animation[0]) {
3166
- case 'slide-left':
3167
- return slideHorizontal(cmp);
3168
- case 'slide-right':
3169
- return slideHorizontal(cmp, true);}
3170
-
3171
- return slide$1(cmp);
3172
- }
3173
-
3174
- function slide$1(_ref4)
3175
-
3176
-
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$1(el)[dimProp];
3181
3154
 
3182
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3183
- return (el, show) => {
3184
3155
  const inProgress = Transition.inProgress(el);
3185
- const inner =
3186
- !inProgress && el.hasChildNodes() ?
3187
- toFloat(css(el.firstElementChild, 'marginTop')) +
3188
- toFloat(css(el.lastElementChild, 'marginBottom')) :
3189
- 0;
3190
- const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3191
-
3192
- const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3193
-
3194
- Transition.cancel(el);
3156
+ await Transition.cancel(el);
3195
3157
 
3196
- if (!isToggled(el)) {
3158
+ if (show) {
3197
3159
  _toggle(el, true);
3198
3160
  }
3199
3161
 
3200
- css(el, 'maxHeight', '');
3201
-
3202
- // Update child components first
3203
- fastdom.flush();
3204
-
3205
- const endHeight = toFloat(css(el, 'height')) + inner;
3206
- duration = velocity * endHeight + duration;
3207
-
3208
- css(el, { ...props, maxHeight: currentHeight });
3162
+ const prevProps = Object.fromEntries(
3163
+ ['padding', 'border', 'width', 'height', 'overflow', marginProp, marginStartProp].map(
3164
+ (key) => [key, el.style[key]]));
3209
3165
 
3210
- return (
3211
- show ?
3212
- Transition.start(
3213
- el,
3214
- { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3215
- duration * (1 - currentHeight / endHeight),
3216
- transition) :
3217
-
3218
- Transition.start(
3219
- el,
3220
- hideProps,
3221
- duration * (currentHeight / endHeight),
3222
- transition).
3223
- then(() => _toggle(el, false))).
3224
- then(() => css(el, initProps));
3225
- };
3226
- }
3227
3166
 
3228
- function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3229
- return (el, show) => {
3230
- const visible = isVisible(el);
3231
- const marginLeft = toFloat(css(el, 'marginLeft'));
3232
3167
 
3233
- Transition.cancel(el);
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;
3234
3172
 
3235
- const [scrollElement] = scrollParents(el.offsetParent);
3236
- css(scrollElement, 'overflowX', 'hidden');
3237
-
3238
- if (!isToggled(el)) {
3239
- _toggle(el, true);
3173
+ if (!inProgress && !show) {
3174
+ currentDim += marginStart;
3240
3175
  }
3241
3176
 
3242
- const width = toFloat(css(el, 'width'));
3243
- 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
+
3244
3191
 
3245
- const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3246
3192
 
3247
3193
  css(el, {
3248
- clipPath: right ? "polygon(0 0," +
3249
- percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3250
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)",
3251
- marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3194
+ padding: 0,
3195
+ border: 0,
3196
+ [marginStartProp]: 0,
3197
+ width: dim.width,
3198
+ height: dim.height,
3199
+ overflow: 'hidden',
3200
+ [dimProp]: currentDim });
3252
3201
 
3253
3202
 
3254
- return (
3255
- show ?
3256
- Transition.start(
3257
- el,
3258
- {
3259
- clipPath: "polygon(0 0,100% 0,100% 100%,0 100%)",
3260
- marginLeft: 0 },
3203
+ const percent = currentDim / endDim;
3204
+ duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
3205
+ const endProps = { [dimProp]: show ? endDim : 0 };
3261
3206
 
3262
- duration * (1 - percent / 100),
3263
- transition) :
3264
-
3265
- Transition.start(
3266
- el,
3267
- {
3268
- clipPath: right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)",
3207
+ if (end) {
3208
+ css(el, marginProp, endDim - currentDim + currentMargin);
3209
+ endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
3210
+ }
3269
3211
 
3212
+ if (!end ^ mode === 'reveal') {
3213
+ css(wrapper, marginProp, -endDim + currentDim);
3214
+ Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
3215
+ }
3270
3216
 
3271
- 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);
3272
3222
 
3273
- duration * (percent / 100),
3274
- transition).
3275
- then(() => _toggle(el, false))).
3276
- then(() => {
3277
- css(scrollElement, 'overflowX', '');
3278
- css(el, { clipPath: '', marginLeft: '' });
3279
- });
3223
+ if (!show) {
3224
+ _toggle(el, false);
3225
+ }
3226
+ }
3280
3227
  };
3281
3228
  }
3282
3229
 
@@ -3301,6 +3248,7 @@
3301
3248
  mixins: [Class, Lazyload, Togglable],
3302
3249
 
3303
3250
  props: {
3251
+ animation: Boolean,
3304
3252
  targets: String,
3305
3253
  active: null,
3306
3254
  collapsible: Boolean,
@@ -3313,7 +3261,7 @@
3313
3261
  data: {
3314
3262
  targets: '> *',
3315
3263
  active: false,
3316
- animation: ['slide'],
3264
+ animation: true,
3317
3265
  collapsible: true,
3318
3266
  multiple: false,
3319
3267
  clsOpen: 'uk-open',
@@ -3359,7 +3307,7 @@
3359
3307
  hide(
3360
3308
  el,
3361
3309
  !hasClass(
3362
- this.items.find((item) => item.contains(el)),
3310
+ this.items.find((item) => within(el, item)),
3363
3311
  this.clsOpen));
3364
3312
 
3365
3313
 
@@ -3411,23 +3359,15 @@
3411
3359
  toggleClass(el, this.clsOpen, show);
3412
3360
  attr($(this.$props.toggle, el), 'aria-expanded', show);
3413
3361
 
3414
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3362
+ const content = $(this.content, el);
3415
3363
 
3416
- if (animate === false || !this.hasTransition) {
3364
+ if (animate === false || !this.animation) {
3365
+ content.hidden = !show;
3417
3366
  hide(content, !show);
3418
3367
  return;
3419
3368
  }
3420
3369
 
3421
- if (!el._wrapper) {
3422
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3423
- }
3424
-
3425
- hide(content, false);
3426
- await slide$1(this)(el._wrapper, show);
3427
- hide(content, !show);
3428
-
3429
- delete el._wrapper;
3430
- unwrap(content);
3370
+ await toggleTransition(this)(content, show);
3431
3371
 
3432
3372
  if (show) {
3433
3373
  const toggle = $(this.$props.toggle, el);
@@ -3453,18 +3393,17 @@
3453
3393
  args: 'animation',
3454
3394
 
3455
3395
  props: {
3396
+ animation: Boolean,
3456
3397
  close: String },
3457
3398
 
3458
3399
 
3459
3400
  data: {
3460
- animation: ['slide'],
3401
+ animation: true,
3461
3402
  selClose: '.uk-alert-close',
3462
- duration: 150,
3463
- hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3403
+ duration: 150 },
3464
3404
 
3465
3405
 
3466
- events: [
3467
- {
3406
+ events: {
3468
3407
  name: 'click',
3469
3408
 
3470
3409
  delegate() {
@@ -3474,16 +3413,39 @@
3474
3413
  handler(e) {
3475
3414
  e.preventDefault();
3476
3415
  this.close();
3477
- } }],
3478
-
3416
+ } },
3479
3417
 
3480
3418
 
3481
3419
  methods: {
3482
3420
  async close() {
3483
- await this.toggleElement(this.$el);
3421
+ await this.toggleElement(this.$el, false, animate$1(this));
3484
3422
  this.$destroy(true);
3485
3423
  } } };
3486
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
+
3487
3449
  var Video = {
3488
3450
  args: 'autoplay',
3489
3451
 
@@ -3632,13 +3594,17 @@
3632
3594
  props: {
3633
3595
  pos: String,
3634
3596
  offset: null,
3635
- flip: Boolean },
3597
+ flip: Boolean,
3598
+ shift: Boolean,
3599
+ inset: Boolean },
3636
3600
 
3637
3601
 
3638
3602
  data: {
3639
3603
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3604
+ offset: false,
3640
3605
  flip: true,
3641
- offset: false },
3606
+ shift: true,
3607
+ inset: false },
3642
3608
 
3643
3609
 
3644
3610
  connected() {
@@ -3652,7 +3618,7 @@
3652
3618
  let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3653
3619
 
3654
3620
  const attach = {
3655
- element: [flipPosition(this.dir), this.align],
3621
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3656
3622
  target: [this.dir, this.align] };
3657
3623
 
3658
3624
 
@@ -3670,22 +3636,15 @@
3670
3636
  const elDim = dimensions$1(element);
3671
3637
  css(element, { top: -elDim.height, left: -elDim.width });
3672
3638
 
3673
- const args = [
3674
- element,
3675
- target,
3676
- {
3639
+ positionAt(element, target, {
3677
3640
  attach,
3678
3641
  offset,
3679
3642
  boundary,
3680
3643
  flip: this.flip,
3681
- viewportOffset: this.getViewportOffset(element) }];
3682
-
3644
+ shift: this.shift,
3645
+ viewportOffset: this.getViewportOffset(element) });
3683
3646
 
3684
3647
 
3685
- trigger(element, 'beforeposition', args);
3686
-
3687
- positionAt(...args);
3688
-
3689
3648
  // Restore scroll position
3690
3649
  scrollElement.scrollTop = scrollTop;
3691
3650
  scrollElement.scrollLeft = scrollLeft;
@@ -3697,12 +3656,14 @@
3697
3656
  this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3698
3657
  this.axis === 'x' ? 'width' : 'height',
3699
3658
  element) * (
3700
- includes(['left', 'top'], this.dir) ? -1 : 1));
3659
+
3660
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3661
+ this.inset ? -1 : 1));
3701
3662
 
3702
3663
  },
3703
3664
 
3704
3665
  getShiftOffset(element) {
3705
- return includes(['center', 'justify', 'stretch'], this.align) ?
3666
+ return this.align === 'center' ?
3706
3667
  0 :
3707
3668
  toPx(
3708
3669
  css(element, '--uk-position-shift-offset'),
@@ -4061,7 +4022,10 @@
4061
4022
  mode: 'list',
4062
4023
  toggle: Boolean,
4063
4024
  boundary: Boolean,
4064
- boundaryAlign: Boolean,
4025
+ target: Boolean,
4026
+ targetX: Boolean,
4027
+ targetY: Boolean,
4028
+ stretch: Boolean,
4065
4029
  delayShow: Number,
4066
4030
  delayHide: Number,
4067
4031
  display: String,
@@ -4073,17 +4037,32 @@
4073
4037
  data: {
4074
4038
  mode: ['click', 'hover'],
4075
4039
  toggle: '- *',
4076
- boundary: true,
4077
- boundaryAlign: false,
4040
+ boundary: false,
4041
+ target: false,
4042
+ targetX: false,
4043
+ targetY: false,
4044
+ stretch: false,
4078
4045
  delayShow: 0,
4079
4046
  delayHide: 800,
4080
4047
  display: null,
4081
4048
  clsDrop: false,
4049
+ animateOut: false,
4050
+ bgScroll: true,
4082
4051
  animation: ['uk-animation-fade'],
4083
4052
  cls: 'uk-open',
4084
- container: false,
4085
- animateOut: false,
4086
- 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
+ } },
4087
4066
 
4088
4067
 
4089
4068
  created() {
@@ -4097,13 +4076,13 @@
4097
4076
  connected() {
4098
4077
  addClass(this.$el, this.clsDrop);
4099
4078
 
4100
- if (this.toggle && !this.target) {
4101
- 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), {
4102
4081
  target: this.$el,
4103
4082
  mode: this.mode }).
4104
4083
  $el;
4105
- attr(this.target, 'aria-haspopup', true);
4106
- this.lazyload(this.target);
4084
+ attr(this.targetEl, 'aria-haspopup', true);
4085
+ this.lazyload(this.targetEl);
4107
4086
  }
4108
4087
  },
4109
4088
 
@@ -4134,7 +4113,7 @@
4134
4113
  return 'a[href^="#"]';
4135
4114
  },
4136
4115
 
4137
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4116
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4138
4117
  if (!defaultPrevented && hash && !within(hash, this.$el)) {
4139
4118
  this.hide(false);
4140
4119
  }
@@ -4246,17 +4225,17 @@
4246
4225
  on(
4247
4226
  document,
4248
4227
  pointerDown$1,
4249
- (_ref2) => {let { target } = _ref2;return (
4228
+ (_ref3) => {let { target } = _ref3;return (
4250
4229
  !within(target, this.$el) &&
4251
4230
  once(
4252
4231
  document,
4253
4232
  pointerUp$1 + " " + pointerCancel + " scroll",
4254
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4233
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
4255
4234
  if (
4256
4235
  !defaultPrevented &&
4257
4236
  type === pointerUp$1 &&
4258
4237
  target === newTarget &&
4259
- !(this.target && within(target, this.target)))
4238
+ !(this.targetEl && within(target, this.targetEl)))
4260
4239
  {
4261
4240
  this.hide(false);
4262
4241
  }
@@ -4275,13 +4254,13 @@
4275
4254
  [] :
4276
4255
  [preventOverscroll(this.$el), preventBackgroundScroll()]),
4277
4256
 
4278
- ...(this.display === 'static' && this.align !== 'stretch' ?
4257
+ ...(this.display === 'static' ?
4279
4258
  [] :
4280
4259
  (() => {
4281
4260
  const handler = () => this.$emit();
4282
4261
  return [
4283
4262
  on(window, 'resize', handler),
4284
- on(document, 'scroll', handler, true),
4263
+ on([document, scrollParents(this.$el)], 'scroll', handler),
4285
4264
  (() => {
4286
4265
  const observer = observeResize(
4287
4266
  scrollParents(this.$el),
@@ -4310,7 +4289,7 @@
4310
4289
  {
4311
4290
  name: 'hide',
4312
4291
 
4313
- handler(_ref4) {let { target } = _ref4;
4292
+ handler(_ref5) {let { target } = _ref5;
4314
4293
  if (this.$el !== target) {
4315
4294
  active =
4316
4295
  active === null && within(target, this.$el) && this.isToggled() ?
@@ -4334,12 +4313,12 @@
4334
4313
 
4335
4314
 
4336
4315
  methods: {
4337
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4338
- if (this.isToggled() && target && this.target && target !== this.target) {
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) {
4339
4318
  this.hide(false, false);
4340
4319
  }
4341
4320
 
4342
- this.target = target;
4321
+ this.targetEl = target;
4343
4322
 
4344
4323
  this.clearTimers();
4345
4324
 
@@ -4402,60 +4381,72 @@
4402
4381
 
4403
4382
  position() {
4404
4383
  removeClass(this.$el, this.clsDrop + "-stack");
4405
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4406
- toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4384
+ css(this.$el, { maxWidth: '', top: '', left: '' });
4407
4385
 
4408
- const boundary = query(this.boundary, this.$el);
4409
- const target = boundary && this.boundaryAlign ? boundary : this.target;
4410
- const [scrollParent] = scrollParents(
4411
- boundary && this.boundaryAlign ? boundary : this.$el);
4386
+ // Ensure none positioned element does not generate scrollbars
4387
+ this.$el.hidden = true;
4412
4388
 
4413
- const scrollParentOffset = offset(scrollParent);
4414
- 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]));
4415
4392
  const viewportOffset = this.getViewportOffset(this.$el);
4416
4393
 
4417
- css(this.$el, 'maxWidth', '');
4418
- const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4394
+ const dirs = [
4395
+ [0, ['x', 'width', 'left', 'right']],
4396
+ [1, ['y', 'height', 'top', 'bottom']]];
4419
4397
 
4420
- if (this.align === 'justify') {
4421
- const prop = this.axis === 'y' ? 'width' : 'height';
4422
- css(
4423
- this.$el,
4424
- prop,
4425
- Math.min(
4426
- (boundary ? boundaryOffset : offset(this.target))[prop],
4427
- scrollParentOffset[prop] - 2 * viewportOffset));
4428
-
4429
-
4430
- } else if (this.align === 'stretch') {
4431
- this.flip = this.axis === 'y' ? 'x' : 'y';
4432
- this.display = 'static';
4433
-
4434
- const viewport = offsetViewport(scrollParent);
4435
- const targetDim = offset(target);
4436
- const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4437
-
4438
- css(this.$el, {
4439
- width:
4440
- this.axis === 'y' ?
4441
- viewport.width :
4442
- (this.dir === 'left' ?
4443
- targetDim.left - viewport.left :
4444
- viewport.right - targetDim.right) - elOffset,
4445
- height:
4446
- this.axis === 'x' ?
4447
- viewport.height :
4448
- (this.dir === 'top' ?
4449
- targetDim.top - viewport.top :
4450
- viewport.bottom - targetDim.bottom) - elOffset });
4451
-
4452
- } else if (this.$el.offsetWidth > maxWidth) {
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) {
4453
4417
  addClass(this.$el, this.clsDrop + "-stack");
4454
4418
  }
4455
4419
 
4456
4420
  css(this.$el, 'maxWidth', maxWidth);
4457
4421
 
4458
- 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
+ }
4459
4450
  } } };
4460
4451
 
4461
4452
 
@@ -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));
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);
6115
6114
 
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);
6139
-
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