uikit 3.14.2-dev.404bdcedf → 3.14.2-dev.447aa311a

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 (89) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/css/uikit-core-rtl.css +85 -24
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +85 -24
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +88 -23
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +88 -23
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +101 -22
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +101 -22
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +17 -2
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +135 -44
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +222 -110
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +238 -111
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/parallax.js +16 -1
  44. package/src/js/core/accordion.js +3 -3
  45. package/src/js/core/alert.js +1 -1
  46. package/src/js/core/drop.js +40 -20
  47. package/src/js/core/height-viewport.js +14 -9
  48. package/src/js/core/navbar.js +19 -18
  49. package/src/js/core/toggle.js +5 -8
  50. package/src/js/mixin/position.js +44 -23
  51. package/src/js/mixin/togglable.js +105 -24
  52. package/src/js/util/animation.js +1 -0
  53. package/src/js/util/viewport.js +2 -5
  54. package/src/less/components/drop.less +19 -5
  55. package/src/less/components/dropdown.less +21 -5
  56. package/src/less/components/margin.less +13 -14
  57. package/src/less/components/modal.less +19 -4
  58. package/src/less/components/nav.less +1 -1
  59. package/src/less/components/navbar.less +46 -19
  60. package/src/less/components/offcanvas.less +21 -21
  61. package/src/less/components/position.less +1 -1
  62. package/src/less/components/sticky.less +7 -0
  63. package/src/less/components/utility.less +1 -2
  64. package/src/less/theme/dropdown.less +11 -0
  65. package/src/less/theme/navbar.less +7 -0
  66. package/src/scss/components/drop.scss +19 -5
  67. package/src/scss/components/dropdown.scss +21 -5
  68. package/src/scss/components/margin.scss +13 -14
  69. package/src/scss/components/modal.scss +19 -4
  70. package/src/scss/components/nav.scss +1 -1
  71. package/src/scss/components/navbar.scss +35 -8
  72. package/src/scss/components/offcanvas.scss +21 -21
  73. package/src/scss/components/position.scss +1 -1
  74. package/src/scss/components/sticky.scss +7 -0
  75. package/src/scss/components/utility.scss +1 -2
  76. package/src/scss/mixins-theme.scss +8 -0
  77. package/src/scss/mixins.scss +2 -0
  78. package/src/scss/theme/dropdown.scss +8 -0
  79. package/src/scss/theme/navbar.scss +4 -0
  80. package/src/scss/variables-theme.scss +23 -10
  81. package/src/scss/variables.scss +22 -11
  82. package/tests/drop.html +145 -2
  83. package/tests/dropdown.html +228 -13
  84. package/tests/height-viewport.html +62 -0
  85. package/tests/navbar.html +321 -14
  86. package/tests/offcanvas.html +8 -8
  87. package/tests/sticky-navbar.html +132 -0
  88. package/tests/sticky-parallax.html +2 -1
  89. package/tests/sticky.html +5 -4
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.2-dev.404bdcedf | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.2-dev.447aa311a | 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() :
@@ -868,6 +868,7 @@
868
868
  }
869
869
 
870
870
  function transition(element, props, duration, timing) {if (duration === void 0) {duration = 400;}if (timing === void 0) {timing = 'linear';}
871
+ duration = Math.round(duration);
871
872
  return Promise.all(
872
873
  toNodes(element).map(
873
874
  (element) =>
@@ -1886,7 +1887,7 @@
1886
1887
  return clamp((scrollTop - start) / (end - start));
1887
1888
  }
1888
1889
 
1889
- function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden/;}if (scrollable === void 0) {scrollable = false;}
1890
+ function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden|clip/;}if (scrollable === void 0) {scrollable = false;}
1890
1891
  const scrollEl = scrollingElement(element);
1891
1892
 
1892
1893
  let ancestors = parents(element).reverse();
@@ -1929,10 +1930,7 @@
1929
1930
  }
1930
1931
 
1931
1932
  function scrollingElement(element) {
1932
- const {
1933
- document: { scrollingElement } } =
1934
- toWindow(element);
1935
- return scrollingElement;
1933
+ return toWindow(element).document.scrollingElement;
1936
1934
  }
1937
1935
 
1938
1936
  function getViewport$1(scrollElement) {
@@ -2952,7 +2950,7 @@
2952
2950
  UIkit.data = '__uikit__';
2953
2951
  UIkit.prefix = 'uk-';
2954
2952
  UIkit.options = {};
2955
- UIkit.version = '3.14.2-dev.404bdcedf';
2953
+ UIkit.version = '3.14.2-dev.447aa311a';
2956
2954
 
2957
2955
  globalAPI(UIkit);
2958
2956
  hooksAPI(UIkit);
@@ -3061,7 +3059,7 @@
3061
3059
 
3062
3060
  initProps: {
3063
3061
  overflow: '',
3064
- height: '',
3062
+ maxHeight: '',
3065
3063
  paddingTop: '',
3066
3064
  paddingBottom: '',
3067
3065
  marginTop: '',
@@ -3071,7 +3069,7 @@
3071
3069
 
3072
3070
  hideProps: {
3073
3071
  overflow: 'hidden',
3074
- height: 0,
3072
+ maxHeight: 0,
3075
3073
  paddingTop: 0,
3076
3074
  paddingBottom: 0,
3077
3075
  marginTop: 0,
@@ -3086,7 +3084,7 @@
3086
3084
  },
3087
3085
 
3088
3086
  hasTransition(_ref2) {let { animation } = _ref2;
3089
- return this.hasAnimation && animation[0] === true;
3087
+ return startsWith(animation[0], 'slide');
3090
3088
  } },
3091
3089
 
3092
3090
 
@@ -3101,18 +3099,13 @@
3101
3099
  return Promise.reject();
3102
3100
  }
3103
3101
 
3104
- if (!animate) {
3105
- Animation.cancel(el);
3106
- Transition.cancel(el);
3107
- }
3108
-
3109
3102
  const promise = (
3110
3103
  isFunction(animate) ?
3111
3104
  animate :
3112
3105
  animate === false || !this.hasAnimation ?
3113
- this._toggle :
3106
+ toggleInstant(this) :
3114
3107
  this.hasTransition ?
3115
- toggleHeight(this) :
3108
+ toggleTransition(this) :
3116
3109
  toggleAnimation(this))(
3117
3110
  el, show);
3118
3111
 
@@ -3176,7 +3169,25 @@
3176
3169
 
3177
3170
 
3178
3171
 
3179
- function toggleHeight(_ref3)
3172
+ function toggleInstant(_ref3) {let { _toggle } = _ref3;
3173
+ return (el, show) => {
3174
+ Animation.cancel(el);
3175
+ Transition.cancel(el);
3176
+ return _toggle(el, show);
3177
+ };
3178
+ }
3179
+
3180
+ function toggleTransition(cmp) {
3181
+ switch (cmp.animation[0]) {
3182
+ case 'slide-left':
3183
+ return slideHorizontal(cmp);
3184
+ case 'slide-right':
3185
+ return slideHorizontal(cmp, true);}
3186
+
3187
+ return slide(cmp);
3188
+ }
3189
+
3190
+ function slide(_ref4)
3180
3191
 
3181
3192
 
3182
3193
 
@@ -3184,14 +3195,17 @@
3184
3195
 
3185
3196
 
3186
3197
 
3187
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref3;
3198
+ {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3188
3199
  return (el, show) => {
3189
3200
  const inProgress = Transition.inProgress(el);
3190
- const inner = el.hasChildNodes() ?
3201
+ const inner =
3202
+ !inProgress && el.hasChildNodes() ?
3191
3203
  toFloat(css(el.firstElementChild, 'marginTop')) +
3192
3204
  toFloat(css(el.lastElementChild, 'marginBottom')) :
3193
3205
  0;
3194
- const currentHeight = isVisible(el) ? height(el) + (inProgress ? 0 : inner) : 0;
3206
+ const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3207
+
3208
+ const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3195
3209
 
3196
3210
  Transition.cancel(el);
3197
3211
 
@@ -3199,34 +3213,97 @@
3199
3213
  _toggle(el, true);
3200
3214
  }
3201
3215
 
3202
- height(el, '');
3216
+ css(el, 'maxHeight', '');
3203
3217
 
3204
3218
  // Update child components first
3205
3219
  fastdom.flush();
3206
3220
 
3207
- const endHeight = height(el) + (inProgress ? 0 : inner);
3208
- duration = velocity * el.offsetHeight + duration;
3221
+ const endHeight = toFloat(css(el, 'height')) + inner;
3222
+ duration = velocity * endHeight + duration;
3209
3223
 
3210
- height(el, currentHeight);
3224
+ css(el, { ...props, maxHeight: currentHeight });
3211
3225
 
3212
3226
  return (
3213
3227
  show ?
3214
3228
  Transition.start(
3215
3229
  el,
3216
- { ...initProps, overflow: 'hidden', height: endHeight },
3217
- Math.round(duration * (1 - currentHeight / endHeight)),
3230
+ { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3231
+ duration * (1 - currentHeight / endHeight),
3218
3232
  transition) :
3219
3233
 
3220
3234
  Transition.start(
3221
3235
  el,
3222
3236
  hideProps,
3223
- Math.round(duration * (currentHeight / endHeight)),
3237
+ duration * (currentHeight / endHeight),
3224
3238
  transition).
3225
3239
  then(() => _toggle(el, false))).
3226
3240
  then(() => css(el, initProps));
3227
3241
  };
3228
3242
  }
3229
3243
 
3244
+ function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3245
+ return (el, show) => {
3246
+ const visible = isVisible(el);
3247
+ const marginLeft = toFloat(css(el, 'marginLeft'));
3248
+
3249
+ Transition.cancel(el);
3250
+
3251
+ const [scrollElement] = scrollParents(el);
3252
+ css(scrollElement, 'overflowX', 'hidden');
3253
+
3254
+ if (!isToggled(el)) {
3255
+ _toggle(el, true);
3256
+ }
3257
+
3258
+ const width = toFloat(css(el, 'width'));
3259
+ duration = velocity * width + duration;
3260
+
3261
+ const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3262
+ const offsetEl = offset(el);
3263
+ const useClipPath = right ?
3264
+ offsetEl.right < scrollElement.clientWidth :
3265
+ Math.round(offsetEl.left) > 0;
3266
+
3267
+ css(el, {
3268
+ clipPath: useClipPath ?
3269
+ right ? "polygon(0 0," +
3270
+ percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3271
+ 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
3272
+ '',
3273
+ marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3274
+
3275
+
3276
+ return (
3277
+ show ?
3278
+ Transition.start(
3279
+ el,
3280
+ {
3281
+ clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
3282
+ marginLeft: 0 },
3283
+
3284
+ duration * (1 - percent / 100),
3285
+ transition) :
3286
+
3287
+ Transition.start(
3288
+ el,
3289
+ {
3290
+ clipPath: useClipPath ?
3291
+ right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
3292
+
3293
+
3294
+ '',
3295
+ marginLeft: (right ? 1 : -1) * width },
3296
+
3297
+ duration * (percent / 100),
3298
+ transition).
3299
+ then(() => _toggle(el, false))).
3300
+ then(() => {
3301
+ css(scrollElement, 'overflowX', '');
3302
+ css(el, { clipPath: '', marginLeft: '' });
3303
+ });
3304
+ };
3305
+ }
3306
+
3230
3307
  function toggleAnimation(cmp) {
3231
3308
  return (el, show) => {
3232
3309
  Animation.cancel(el);
@@ -3260,7 +3337,7 @@
3260
3337
  data: {
3261
3338
  targets: '> *',
3262
3339
  active: false,
3263
- animation: [true],
3340
+ animation: ['slide'],
3264
3341
  collapsible: true,
3265
3342
  multiple: false,
3266
3343
  clsOpen: 'uk-open',
@@ -3370,7 +3447,7 @@
3370
3447
  }
3371
3448
 
3372
3449
  hide(content, false);
3373
- await toggleHeight(this)(el._wrapper, show);
3450
+ await slide(this)(el._wrapper, show);
3374
3451
  hide(content, !show);
3375
3452
 
3376
3453
  delete el._wrapper;
@@ -3404,7 +3481,7 @@
3404
3481
 
3405
3482
 
3406
3483
  data: {
3407
- animation: [true],
3484
+ animation: ['slide'],
3408
3485
  selClose: '.uk-alert-close',
3409
3486
  duration: 150,
3410
3487
  hideProps: { opacity: 0, ...Togglable.data.hideProps } },
@@ -3590,33 +3667,17 @@
3590
3667
 
3591
3668
  connected() {
3592
3669
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3593
- this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3670
+ [this.dir, this.align] = this.pos;
3671
+ this.axis = includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
3594
3672
  },
3595
3673
 
3596
3674
  methods: {
3597
3675
  positionAt(element, target, boundary) {
3598
- const [dir, align] = this.pos;
3599
-
3600
- const mainAxisOffset =
3601
- toPx(
3602
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3603
- this.axis === 'x' ? 'width' : 'height',
3604
- element) * (
3605
- includes(['left', 'top'], dir) ? -1 : 1);
3606
-
3607
- const crossAxisOffset = includes(['center', 'justify'], align) ?
3608
- 0 :
3609
- toPx(
3610
- getCssVar('position-shift-offset', element),
3611
- this.axis === 'y' ? 'width' : 'height',
3612
- element) * (
3613
- includes(['left', 'top'], align) ? 1 : -1);
3614
-
3615
- let offset = [mainAxisOffset, crossAxisOffset];
3676
+ let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3616
3677
 
3617
3678
  const attach = {
3618
- element: [flipPosition(dir), align],
3619
- target: [dir, align] };
3679
+ element: [flipPosition(this.dir), this.align],
3680
+ target: [this.dir, this.align] };
3620
3681
 
3621
3682
 
3622
3683
  if (this.axis === 'y') {
@@ -3626,13 +3687,41 @@
3626
3687
  offset = offset.reverse();
3627
3688
  }
3628
3689
 
3690
+ // Ensure none positioned element does not generate scrollbars
3691
+ const elDim = dimensions(element);
3692
+ css(element, { top: -elDim.height, left: -elDim.width });
3693
+
3629
3694
  positionAt(element, target, {
3630
3695
  attach,
3631
3696
  offset,
3632
3697
  boundary,
3633
3698
  flip: this.flip,
3634
- viewportOffset: toPx(getCssVar('position-viewport-offset', element)) });
3699
+ viewportOffset: this.getViewportOffset(element) });
3635
3700
 
3701
+ },
3702
+
3703
+ getPositionOffset(element) {
3704
+ return (
3705
+ toPx(
3706
+ this.offset === false ? getCssVar('position-offset', element) : this.offset,
3707
+ this.axis === 'x' ? 'width' : 'height',
3708
+ element) * (
3709
+ includes(['left', 'top'], this.dir) ? -1 : 1));
3710
+
3711
+ },
3712
+
3713
+ getShiftOffset(element) {
3714
+ return includes(['center', 'justify', 'stretch'], this.align) ?
3715
+ 0 :
3716
+ toPx(
3717
+ getCssVar('position-shift-offset', element),
3718
+ this.axis === 'y' ? 'width' : 'height',
3719
+ element) * (
3720
+ includes(['left', 'top'], this.align) ? 1 : -1);
3721
+ },
3722
+
3723
+ getViewportOffset(element) {
3724
+ return toPx(getCssVar('position-viewport-offset', element));
3636
3725
  } } };
3637
3726
 
3638
3727
  let active$1;
@@ -3650,7 +3739,8 @@
3650
3739
  delayShow: Number,
3651
3740
  delayHide: Number,
3652
3741
  display: String,
3653
- clsDrop: String },
3742
+ clsDrop: String,
3743
+ animateOut: Boolean },
3654
3744
 
3655
3745
 
3656
3746
  data: {
@@ -3664,7 +3754,8 @@
3664
3754
  clsDrop: false,
3665
3755
  animation: ['uk-animation-fade'],
3666
3756
  cls: 'uk-open',
3667
- container: false },
3757
+ container: false,
3758
+ animateOut: false },
3668
3759
 
3669
3760
 
3670
3761
  created() {
@@ -3852,7 +3943,7 @@
3852
3943
  }
3853
3944
  }),
3854
3945
 
3855
- ...(this.display === 'static' ?
3946
+ ...(this.display === 'static' && this.align !== 'stretch' ?
3856
3947
  [] :
3857
3948
  (() => {
3858
3949
  const handler = () => this.$emit();
@@ -3913,7 +4004,7 @@
3913
4004
  methods: {
3914
4005
  show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
3915
4006
  if (this.isToggled() && target && this.target && target !== this.target) {
3916
- this.hide(false);
4007
+ this.hide(false, false);
3917
4008
  }
3918
4009
 
3919
4010
  this.target = target;
@@ -3933,7 +4024,7 @@
3933
4024
  let prev;
3934
4025
  while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
3935
4026
  prev = active$1;
3936
- active$1.hide(false);
4027
+ active$1.hide(false, false);
3937
4028
  }
3938
4029
  }
3939
4030
 
@@ -3947,8 +4038,8 @@
3947
4038
 
3948
4039
  },
3949
4040
 
3950
- hide(delay) {if (delay === void 0) {delay = true;}
3951
- const hide = () => this.toggleElement(this.$el, false, false);
4041
+ hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
4042
+ const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
3952
4043
 
3953
4044
  this.clearTimers();
3954
4045
 
@@ -3980,28 +4071,51 @@
3980
4071
  position() {
3981
4072
  removeClass(this.$el, this.clsDrop + "-stack");
3982
4073
  toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4074
+ toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
3983
4075
 
3984
4076
  const boundary = query(this.boundary, this.$el);
3985
- const scrollParentOffset = offset(
3986
- scrollParents(boundary && this.boundaryAlign ? boundary : this.$el)[0]);
4077
+ const target = boundary && this.boundaryAlign ? boundary : this.target;
4078
+ const [scrollParent] = scrollParents(
4079
+ boundary && this.boundaryAlign ? boundary : this.$el);
3987
4080
 
4081
+ const scrollParentOffset = offset(scrollParent);
3988
4082
  const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4083
+ const viewportOffset = this.getViewportOffset(this.$el);
3989
4084
 
3990
4085
  css(this.$el, 'maxWidth', '');
3991
- const maxWidth =
3992
- scrollParentOffset.width -
3993
- 2 * toPx(getCssVar('position-viewport-offset', this.$el));
4086
+ const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
3994
4087
 
3995
- if (this.pos[1] === 'justify') {
4088
+ if (this.align === 'justify') {
3996
4089
  const prop = this.axis === 'y' ? 'width' : 'height';
3997
4090
  css(
3998
4091
  this.$el,
3999
4092
  prop,
4000
4093
  Math.min(
4001
4094
  (boundary ? boundaryOffset : offset(this.target))[prop],
4002
- scrollParentOffset[prop] -
4003
- 2 * toPx(getCssVar('position-viewport-offset', this.$el))));
4004
-
4095
+ scrollParentOffset[prop] - 2 * viewportOffset));
4096
+
4097
+
4098
+ } else if (this.align === 'stretch') {
4099
+ this.flip = this.axis === 'y' ? 'x' : 'y';
4100
+ this.display = 'static';
4101
+
4102
+ const viewport = offsetViewport(scrollParent);
4103
+ const targetDim = offset(target);
4104
+ const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4105
+
4106
+ css(this.$el, {
4107
+ width:
4108
+ this.axis === 'y' ?
4109
+ viewport.width :
4110
+ (this.dir === 'left' ?
4111
+ targetDim.left - viewport.left :
4112
+ viewport.right - targetDim.right) - elOffset,
4113
+ height:
4114
+ this.axis === 'x' ?
4115
+ viewport.height :
4116
+ (this.dir === 'top' ?
4117
+ targetDim.top - viewport.top :
4118
+ viewport.bottom - targetDim.bottom) - elOffset });
4005
4119
 
4006
4120
  } else if (this.$el.offsetWidth > maxWidth) {
4007
4121
  addClass(this.$el, this.clsDrop + "-stack");
@@ -4009,11 +4123,7 @@
4009
4123
 
4010
4124
  css(this.$el, 'maxWidth', maxWidth);
4011
4125
 
4012
- this.positionAt(
4013
- this.$el,
4014
- boundary && this.boundaryAlign ? boundary : this.target,
4015
- boundary);
4016
-
4126
+ this.positionAt(this.$el, target, boundary);
4017
4127
  } } };
4018
4128
 
4019
4129
 
@@ -4498,7 +4608,7 @@
4498
4608
 
4499
4609
  resizeTargets() {
4500
4610
  // check for offsetTop change
4501
- return [this.$el, document.documentElement];
4611
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4502
4612
  },
4503
4613
 
4504
4614
  update: {
@@ -4510,21 +4620,25 @@
4510
4620
  let minHeight = '';
4511
4621
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4512
4622
 
4623
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4624
+ const { height: viewportHeight } = offsetViewport(scrollElement);
4625
+
4513
4626
  if (this.expand) {
4514
4627
  minHeight = Math.max(
4515
- height(window) - (
4516
- dimensions(document.documentElement).height -
4517
- dimensions(this.$el).height) -
4628
+ viewportHeight - (
4629
+ dimensions(scrollElement).height - dimensions(this.$el).height) -
4518
4630
  box,
4519
4631
  0);
4520
4632
 
4521
4633
  } else {
4522
4634
  // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4523
- minHeight = 'calc(100vh';
4635
+ minHeight = "calc(" + (
4636
+ document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4637
+
4524
4638
 
4525
4639
  if (this.offsetTop) {
4526
- const { top } = offset(this.$el);
4527
- minHeight += top > 0 && top < height(window) / 2 ? " - " + top + "px" : '';
4640
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4641
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4528
4642
  }
4529
4643
 
4530
4644
  if (this.offsetBottom === true) {
@@ -5858,8 +5972,8 @@
5858
5972
  return this.dropbar;
5859
5973
  },
5860
5974
 
5861
- handler(_, _ref9) {let { $el } = _ref9;
5862
- if (!hasClass($el, this.clsDrop)) {
5975
+ handler(_, _ref9) {let { $el, align } = _ref9;
5976
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5863
5977
  return;
5864
5978
  }
5865
5979
 
@@ -5882,19 +5996,19 @@
5882
5996
  return this.dropbar;
5883
5997
  },
5884
5998
 
5885
- handler(_, _ref10) {let { $el, pos: [dir] = [] } = _ref10;
5886
- if (!hasClass($el, this.clsDrop)) {
5999
+ handler(_, _ref10) {let { $el, align } = _ref10;
6000
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5887
6001
  return;
5888
6002
  }
5889
6003
 
5890
- if (dir === 'bottom') {
5891
- this.transitionTo(
5892
- offset($el).bottom -
5893
- offset(this.dropbar).top +
5894
- toFloat(css($el, 'marginBottom')),
5895
- $el);
6004
+ this._observer = observeResize($el, () =>
6005
+ this.transitionTo(
6006
+ offset($el).bottom -
6007
+ offset(this.dropbar).top +
6008
+ toFloat(css($el, 'marginBottom')),
6009
+ $el));
6010
+
5896
6011
 
5897
- }
5898
6012
  } },
5899
6013
 
5900
6014
 
@@ -5933,11 +6047,13 @@
5933
6047
  return this.dropbar;
5934
6048
  },
5935
6049
 
5936
- handler(_, _ref12) {let { $el } = _ref12;
5937
- if (!hasClass($el, this.clsDrop)) {
6050
+ handler(_, _ref12) {let { $el, align } = _ref12;
6051
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5938
6052
  return;
5939
6053
  }
5940
6054
 
6055
+ this._observer.disconnect();
6056
+
5941
6057
  const active = this.getActive();
5942
6058
 
5943
6059
  if (!active || (active == null ? void 0 : active.$el) === $el) {
@@ -5954,28 +6070,27 @@
5954
6070
 
5955
6071
  transitionTo(newHeight, el) {
5956
6072
  const { dropbar } = this;
5957
- const oldHeight = isVisible(dropbar) ? height(dropbar) : 0;
6073
+ const oldHeight = height(dropbar);
5958
6074
 
5959
6075
  el = oldHeight < newHeight && el;
5960
6076
 
5961
- css(el, 'clip', "rect(0," + el.offsetWidth + "px," + oldHeight + "px,0)");
6077
+ css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
5962
6078
 
5963
6079
  height(dropbar, oldHeight);
5964
6080
 
5965
6081
  Transition.cancel([el, dropbar]);
5966
- return Promise.all([
6082
+ Promise.all([
5967
6083
  Transition.start(dropbar, { height: newHeight }, this.duration),
5968
6084
  Transition.start(
5969
6085
  el,
5970
- { clip: "rect(0," + el.offsetWidth + "px," + newHeight + "px,0)" },
6086
+ {
6087
+ clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
6088
+
5971
6089
  this.duration)]).
5972
6090
 
5973
6091
 
5974
6092
  catch(noop).
5975
- then(() => {
5976
- css(el, { clip: '' });
5977
- this.$update(dropbar);
5978
- });
6093
+ then(() => css(el, { clipPath: '' }));
5979
6094
  },
5980
6095
 
5981
6096
  getDropdown(el) {
@@ -7276,6 +7391,8 @@
7276
7391
  },
7277
7392
 
7278
7393
  handler(e) {
7394
+ this._preventClick = null;
7395
+
7279
7396
  if (!isTouch(e) || this._showState) {
7280
7397
  return;
7281
7398
  }
@@ -7362,6 +7479,7 @@
7362
7479
  handler(e) {
7363
7480
  let link;
7364
7481
  if (
7482
+ this._preventClick ||
7365
7483
  closest(e.target, 'a[href="#"], a[href=""]') ||
7366
7484
  (link = closest(e.target, 'a[href]')) && (
7367
7485
  attr(this.$el, 'aria-expanded') !== 'true' ||
@@ -7370,15 +7488,9 @@
7370
7488
  e.preventDefault();
7371
7489
  }
7372
7490
 
7373
- if (this._preventClick) {
7374
- return this._preventClick = null;
7375
- }
7376
-
7377
- if (!includes(this.mode, 'click')) {
7378
- return;
7491
+ if (!this._preventClick && includes(this.mode, 'click')) {
7492
+ this.toggle();
7379
7493
  }
7380
-
7381
- this.toggle();
7382
7494
  } },
7383
7495
 
7384
7496