uikit 3.14.2-dev.f917389f5 → 3.14.3-dev.68d38eb6d

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 (87) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/css/uikit-core-rtl.css +48 -3
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +48 -3
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +52 -3
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +52 -3
  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 -17
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +101 -17
  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 +70 -35
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +55 -35
  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 +55 -35
  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 -39
  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 +229 -105
  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 +298 -139
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/parallax.js +15 -0
  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/scrollspy.js +4 -0
  50. package/src/js/core/toggle.js +5 -8
  51. package/src/js/mixin/parallax.js +54 -34
  52. package/src/js/mixin/position.js +44 -23
  53. package/src/js/mixin/togglable.js +105 -19
  54. package/src/js/util/animation.js +1 -0
  55. package/src/js/util/dom.js +4 -3
  56. package/src/js/util/viewport.js +1 -1
  57. package/src/less/components/drop.less +17 -4
  58. package/src/less/components/dropdown.less +19 -4
  59. package/src/less/components/margin.less +13 -14
  60. package/src/less/components/nav.less +1 -1
  61. package/src/less/components/navbar.less +32 -11
  62. package/src/less/components/position.less +1 -1
  63. package/src/less/components/sticky.less +7 -0
  64. package/src/less/components/utility.less +1 -2
  65. package/src/less/theme/dropdown.less +11 -0
  66. package/src/less/theme/navbar.less +7 -0
  67. package/src/scss/components/drop.scss +17 -4
  68. package/src/scss/components/dropdown.scss +19 -4
  69. package/src/scss/components/margin.scss +13 -14
  70. package/src/scss/components/nav.scss +1 -1
  71. package/src/scss/components/navbar.scss +21 -0
  72. package/src/scss/components/position.scss +1 -1
  73. package/src/scss/components/sticky.scss +7 -0
  74. package/src/scss/components/utility.scss +1 -2
  75. package/src/scss/mixins-theme.scss +8 -0
  76. package/src/scss/mixins.scss +2 -0
  77. package/src/scss/theme/dropdown.scss +8 -0
  78. package/src/scss/theme/navbar.scss +4 -0
  79. package/src/scss/variables-theme.scss +3 -0
  80. package/src/scss/variables.scss +1 -0
  81. package/tests/drop.html +145 -2
  82. package/tests/dropdown.html +228 -13
  83. package/tests/height-viewport.html +62 -0
  84. package/tests/navbar.html +321 -14
  85. package/tests/sticky-navbar.html +132 -0
  86. package/tests/sticky-parallax.html +2 -1
  87. package/tests/sticky.html +5 -4
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.2-dev.f917389f5 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.3-dev.68d38eb6d | 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) =>
@@ -1182,14 +1183,15 @@
1182
1183
  }
1183
1184
 
1184
1185
  function empty(element) {
1185
- return replaceChildren(element, '');
1186
+ element = $(element);
1187
+ element.innerHTML = '';
1188
+ return element;
1186
1189
  }
1187
1190
 
1188
1191
  function html(parent, html) {
1189
- return isUndefined(html) ? $(parent).innerHTML : replaceChildren(parent, html);
1192
+ return isUndefined(html) ? $(parent).innerHTML : append(empty(parent), html);
1190
1193
  }
1191
1194
 
1192
- const replaceChildren = applyFn('replaceChildren');
1193
1195
  const prepend = applyFn('prepend');
1194
1196
  const append = applyFn('append');
1195
1197
  const before = applyFn('before');
@@ -1886,7 +1888,7 @@
1886
1888
  return clamp((scrollTop - start) / (end - start));
1887
1889
  }
1888
1890
 
1889
- function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden/;}if (scrollable === void 0) {scrollable = false;}
1891
+ function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden|clip/;}if (scrollable === void 0) {scrollable = false;}
1890
1892
  const scrollEl = scrollingElement(element);
1891
1893
 
1892
1894
  let ancestors = parents(element).reverse();
@@ -2177,7 +2179,6 @@
2177
2179
  isTag: isTag,
2178
2180
  empty: empty,
2179
2181
  html: html,
2180
- replaceChildren: replaceChildren,
2181
2182
  prepend: prepend,
2182
2183
  append: append,
2183
2184
  before: before,
@@ -2949,7 +2950,7 @@
2949
2950
  UIkit.data = '__uikit__';
2950
2951
  UIkit.prefix = 'uk-';
2951
2952
  UIkit.options = {};
2952
- UIkit.version = '3.14.2-dev.f917389f5';
2953
+ UIkit.version = '3.14.3-dev.68d38eb6d';
2953
2954
 
2954
2955
  globalAPI(UIkit);
2955
2956
  hooksAPI(UIkit);
@@ -3058,7 +3059,7 @@
3058
3059
 
3059
3060
  initProps: {
3060
3061
  overflow: '',
3061
- height: '',
3062
+ maxHeight: '',
3062
3063
  paddingTop: '',
3063
3064
  paddingBottom: '',
3064
3065
  marginTop: '',
@@ -3068,7 +3069,7 @@
3068
3069
 
3069
3070
  hideProps: {
3070
3071
  overflow: 'hidden',
3071
- height: 0,
3072
+ maxHeight: 0,
3072
3073
  paddingTop: 0,
3073
3074
  paddingBottom: 0,
3074
3075
  marginTop: 0,
@@ -3083,7 +3084,7 @@
3083
3084
  },
3084
3085
 
3085
3086
  hasTransition(_ref2) {let { animation } = _ref2;
3086
- return this.hasAnimation && animation[0] === true;
3087
+ return startsWith(animation[0], 'slide');
3087
3088
  } },
3088
3089
 
3089
3090
 
@@ -3107,9 +3108,9 @@
3107
3108
  isFunction(animate) ?
3108
3109
  animate :
3109
3110
  animate === false || !this.hasAnimation ?
3110
- this._toggle :
3111
+ toggleInstant(this) :
3111
3112
  this.hasTransition ?
3112
- toggleHeight(this) :
3113
+ toggleTransition(this) :
3113
3114
  toggleAnimation(this))(
3114
3115
  el, show);
3115
3116
 
@@ -3173,7 +3174,25 @@
3173
3174
 
3174
3175
 
3175
3176
 
3176
- function toggleHeight(_ref3)
3177
+ function toggleInstant(_ref3) {let { _toggle } = _ref3;
3178
+ return (el, show) => {
3179
+ Animation.cancel(el);
3180
+ Transition.cancel(el);
3181
+ return _toggle(el, show);
3182
+ };
3183
+ }
3184
+
3185
+ function toggleTransition(cmp) {
3186
+ switch (cmp.animation[0]) {
3187
+ case 'slide-left':
3188
+ return slideHorizontal(cmp);
3189
+ case 'slide-right':
3190
+ return slideHorizontal(cmp, true);}
3191
+
3192
+ return slide(cmp);
3193
+ }
3194
+
3195
+ function slide(_ref4)
3177
3196
 
3178
3197
 
3179
3198
 
@@ -3181,14 +3200,17 @@
3181
3200
 
3182
3201
 
3183
3202
 
3184
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref3;
3203
+ {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3185
3204
  return (el, show) => {
3186
3205
  const inProgress = Transition.inProgress(el);
3187
- const inner = el.hasChildNodes() ?
3206
+ const inner =
3207
+ !inProgress && el.hasChildNodes() ?
3188
3208
  toFloat(css(el.firstElementChild, 'marginTop')) +
3189
3209
  toFloat(css(el.lastElementChild, 'marginBottom')) :
3190
3210
  0;
3191
- const currentHeight = isVisible(el) ? height(el) + (inProgress ? 0 : inner) : 0;
3211
+ const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3212
+
3213
+ const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3192
3214
 
3193
3215
  Transition.cancel(el);
3194
3216
 
@@ -3196,34 +3218,97 @@
3196
3218
  _toggle(el, true);
3197
3219
  }
3198
3220
 
3199
- height(el, '');
3221
+ css(el, 'maxHeight', '');
3200
3222
 
3201
3223
  // Update child components first
3202
3224
  fastdom.flush();
3203
3225
 
3204
- const endHeight = height(el) + (inProgress ? 0 : inner);
3205
- duration = velocity * el.offsetHeight + duration;
3226
+ const endHeight = toFloat(css(el, 'height')) + inner;
3227
+ duration = velocity * endHeight + duration;
3206
3228
 
3207
- height(el, currentHeight);
3229
+ css(el, { ...props, maxHeight: currentHeight });
3208
3230
 
3209
3231
  return (
3210
3232
  show ?
3211
3233
  Transition.start(
3212
3234
  el,
3213
- { ...initProps, overflow: 'hidden', height: endHeight },
3214
- Math.round(duration * (1 - currentHeight / endHeight)),
3235
+ { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3236
+ duration * (1 - currentHeight / endHeight),
3215
3237
  transition) :
3216
3238
 
3217
3239
  Transition.start(
3218
3240
  el,
3219
3241
  hideProps,
3220
- Math.round(duration * (currentHeight / endHeight)),
3242
+ duration * (currentHeight / endHeight),
3221
3243
  transition).
3222
3244
  then(() => _toggle(el, false))).
3223
3245
  then(() => css(el, initProps));
3224
3246
  };
3225
3247
  }
3226
3248
 
3249
+ function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3250
+ return (el, show) => {
3251
+ const visible = isVisible(el);
3252
+ const marginLeft = toFloat(css(el, 'marginLeft'));
3253
+
3254
+ Transition.cancel(el);
3255
+
3256
+ const [scrollElement] = scrollParents(el);
3257
+ css(scrollElement, 'overflowX', 'hidden');
3258
+
3259
+ if (!isToggled(el)) {
3260
+ _toggle(el, true);
3261
+ }
3262
+
3263
+ const width = toFloat(css(el, 'width'));
3264
+ duration = velocity * width + duration;
3265
+
3266
+ const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3267
+ const offsetEl = offset(el);
3268
+ const useClipPath = right ?
3269
+ offsetEl.right < scrollElement.clientWidth :
3270
+ Math.round(offsetEl.left) > 0;
3271
+
3272
+ css(el, {
3273
+ clipPath: useClipPath ?
3274
+ right ? "polygon(0 0," +
3275
+ percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3276
+ 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
3277
+ '',
3278
+ marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3279
+
3280
+
3281
+ return (
3282
+ show ?
3283
+ Transition.start(
3284
+ el,
3285
+ {
3286
+ clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
3287
+ marginLeft: 0 },
3288
+
3289
+ duration * (1 - percent / 100),
3290
+ transition) :
3291
+
3292
+ Transition.start(
3293
+ el,
3294
+ {
3295
+ clipPath: useClipPath ?
3296
+ right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
3297
+
3298
+
3299
+ '',
3300
+ marginLeft: (right ? 1 : -1) * width },
3301
+
3302
+ duration * (percent / 100),
3303
+ transition).
3304
+ then(() => _toggle(el, false))).
3305
+ then(() => {
3306
+ css(scrollElement, 'overflowX', '');
3307
+ css(el, { clipPath: '', marginLeft: '' });
3308
+ });
3309
+ };
3310
+ }
3311
+
3227
3312
  function toggleAnimation(cmp) {
3228
3313
  return (el, show) => {
3229
3314
  Animation.cancel(el);
@@ -3257,7 +3342,7 @@
3257
3342
  data: {
3258
3343
  targets: '> *',
3259
3344
  active: false,
3260
- animation: [true],
3345
+ animation: ['slide'],
3261
3346
  collapsible: true,
3262
3347
  multiple: false,
3263
3348
  clsOpen: 'uk-open',
@@ -3367,7 +3452,7 @@
3367
3452
  }
3368
3453
 
3369
3454
  hide(content, false);
3370
- await toggleHeight(this)(el._wrapper, show);
3455
+ await slide(this)(el._wrapper, show);
3371
3456
  hide(content, !show);
3372
3457
 
3373
3458
  delete el._wrapper;
@@ -3401,7 +3486,7 @@
3401
3486
 
3402
3487
 
3403
3488
  data: {
3404
- animation: [true],
3489
+ animation: ['slide'],
3405
3490
  selClose: '.uk-alert-close',
3406
3491
  duration: 150,
3407
3492
  hideProps: { opacity: 0, ...Togglable.data.hideProps } },
@@ -3587,33 +3672,17 @@
3587
3672
 
3588
3673
  connected() {
3589
3674
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3590
- this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3675
+ [this.dir, this.align] = this.pos;
3676
+ this.axis = includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
3591
3677
  },
3592
3678
 
3593
3679
  methods: {
3594
3680
  positionAt(element, target, boundary) {
3595
- const [dir, align] = this.pos;
3596
-
3597
- const mainAxisOffset =
3598
- toPx(
3599
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3600
- this.axis === 'x' ? 'width' : 'height',
3601
- element) * (
3602
- includes(['left', 'top'], dir) ? -1 : 1);
3603
-
3604
- const crossAxisOffset = includes(['center', 'justify'], align) ?
3605
- 0 :
3606
- toPx(
3607
- getCssVar('position-shift-offset', element),
3608
- this.axis === 'y' ? 'width' : 'height',
3609
- element) * (
3610
- includes(['left', 'top'], align) ? 1 : -1);
3611
-
3612
- let offset = [mainAxisOffset, crossAxisOffset];
3681
+ let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3613
3682
 
3614
3683
  const attach = {
3615
- element: [flipPosition(dir), align],
3616
- target: [dir, align] };
3684
+ element: [flipPosition(this.dir), this.align],
3685
+ target: [this.dir, this.align] };
3617
3686
 
3618
3687
 
3619
3688
  if (this.axis === 'y') {
@@ -3623,13 +3692,41 @@
3623
3692
  offset = offset.reverse();
3624
3693
  }
3625
3694
 
3695
+ // Ensure none positioned element does not generate scrollbars
3696
+ const elDim = dimensions(element);
3697
+ css(element, { top: -elDim.height, left: -elDim.width });
3698
+
3626
3699
  positionAt(element, target, {
3627
3700
  attach,
3628
3701
  offset,
3629
3702
  boundary,
3630
3703
  flip: this.flip,
3631
- viewportOffset: toPx(getCssVar('position-viewport-offset', element)) });
3704
+ viewportOffset: this.getViewportOffset(element) });
3632
3705
 
3706
+ },
3707
+
3708
+ getPositionOffset(element) {
3709
+ return (
3710
+ toPx(
3711
+ this.offset === false ? getCssVar('position-offset', element) : this.offset,
3712
+ this.axis === 'x' ? 'width' : 'height',
3713
+ element) * (
3714
+ includes(['left', 'top'], this.dir) ? -1 : 1));
3715
+
3716
+ },
3717
+
3718
+ getShiftOffset(element) {
3719
+ return includes(['center', 'justify', 'stretch'], this.align) ?
3720
+ 0 :
3721
+ toPx(
3722
+ getCssVar('position-shift-offset', element),
3723
+ this.axis === 'y' ? 'width' : 'height',
3724
+ element) * (
3725
+ includes(['left', 'top'], this.align) ? 1 : -1);
3726
+ },
3727
+
3728
+ getViewportOffset(element) {
3729
+ return toPx(getCssVar('position-viewport-offset', element));
3633
3730
  } } };
3634
3731
 
3635
3732
  let active$1;
@@ -3647,7 +3744,8 @@
3647
3744
  delayShow: Number,
3648
3745
  delayHide: Number,
3649
3746
  display: String,
3650
- clsDrop: String },
3747
+ clsDrop: String,
3748
+ animateOut: Boolean },
3651
3749
 
3652
3750
 
3653
3751
  data: {
@@ -3661,7 +3759,8 @@
3661
3759
  clsDrop: false,
3662
3760
  animation: ['uk-animation-fade'],
3663
3761
  cls: 'uk-open',
3664
- container: false },
3762
+ container: false,
3763
+ animateOut: false },
3665
3764
 
3666
3765
 
3667
3766
  created() {
@@ -3849,7 +3948,7 @@
3849
3948
  }
3850
3949
  }),
3851
3950
 
3852
- ...(this.display === 'static' ?
3951
+ ...(this.display === 'static' && this.align !== 'stretch' ?
3853
3952
  [] :
3854
3953
  (() => {
3855
3954
  const handler = () => this.$emit();
@@ -3910,7 +4009,7 @@
3910
4009
  methods: {
3911
4010
  show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
3912
4011
  if (this.isToggled() && target && this.target && target !== this.target) {
3913
- this.hide(false);
4012
+ this.hide(false, false);
3914
4013
  }
3915
4014
 
3916
4015
  this.target = target;
@@ -3930,7 +4029,7 @@
3930
4029
  let prev;
3931
4030
  while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
3932
4031
  prev = active$1;
3933
- active$1.hide(false);
4032
+ active$1.hide(false, false);
3934
4033
  }
3935
4034
  }
3936
4035
 
@@ -3944,8 +4043,8 @@
3944
4043
 
3945
4044
  },
3946
4045
 
3947
- hide(delay) {if (delay === void 0) {delay = true;}
3948
- const hide = () => this.toggleElement(this.$el, false, false);
4046
+ hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
4047
+ const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
3949
4048
 
3950
4049
  this.clearTimers();
3951
4050
 
@@ -3977,28 +4076,51 @@
3977
4076
  position() {
3978
4077
  removeClass(this.$el, this.clsDrop + "-stack");
3979
4078
  toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4079
+ toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
3980
4080
 
3981
4081
  const boundary = query(this.boundary, this.$el);
3982
- const scrollParentOffset = offset(
3983
- scrollParents(boundary && this.boundaryAlign ? boundary : this.$el)[0]);
4082
+ const target = boundary && this.boundaryAlign ? boundary : this.target;
4083
+ const [scrollParent] = scrollParents(
4084
+ boundary && this.boundaryAlign ? boundary : this.$el);
3984
4085
 
4086
+ const scrollParentOffset = offset(scrollParent);
3985
4087
  const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4088
+ const viewportOffset = this.getViewportOffset(this.$el);
3986
4089
 
3987
4090
  css(this.$el, 'maxWidth', '');
3988
- const maxWidth =
3989
- scrollParentOffset.width -
3990
- 2 * toPx(getCssVar('position-viewport-offset', this.$el));
4091
+ const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
3991
4092
 
3992
- if (this.pos[1] === 'justify') {
4093
+ if (this.align === 'justify') {
3993
4094
  const prop = this.axis === 'y' ? 'width' : 'height';
3994
4095
  css(
3995
4096
  this.$el,
3996
4097
  prop,
3997
4098
  Math.min(
3998
4099
  (boundary ? boundaryOffset : offset(this.target))[prop],
3999
- scrollParentOffset[prop] -
4000
- 2 * toPx(getCssVar('position-viewport-offset', this.$el))));
4001
-
4100
+ scrollParentOffset[prop] - 2 * viewportOffset));
4101
+
4102
+
4103
+ } else if (this.align === 'stretch') {
4104
+ this.flip = this.axis === 'y' ? 'x' : 'y';
4105
+ this.display = 'static';
4106
+
4107
+ const viewport = offsetViewport(scrollParent);
4108
+ const targetDim = offset(target);
4109
+ const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4110
+
4111
+ css(this.$el, {
4112
+ width:
4113
+ this.axis === 'y' ?
4114
+ viewport.width :
4115
+ (this.dir === 'left' ?
4116
+ targetDim.left - viewport.left :
4117
+ viewport.right - targetDim.right) - elOffset,
4118
+ height:
4119
+ this.axis === 'x' ?
4120
+ viewport.height :
4121
+ (this.dir === 'top' ?
4122
+ targetDim.top - viewport.top :
4123
+ viewport.bottom - targetDim.bottom) - elOffset });
4002
4124
 
4003
4125
  } else if (this.$el.offsetWidth > maxWidth) {
4004
4126
  addClass(this.$el, this.clsDrop + "-stack");
@@ -4006,11 +4128,7 @@
4006
4128
 
4007
4129
  css(this.$el, 'maxWidth', maxWidth);
4008
4130
 
4009
- this.positionAt(
4010
- this.$el,
4011
- boundary && this.boundaryAlign ? boundary : this.target,
4012
- boundary);
4013
-
4131
+ this.positionAt(this.$el, target, boundary);
4014
4132
  } } };
4015
4133
 
4016
4134
 
@@ -4495,7 +4613,7 @@
4495
4613
 
4496
4614
  resizeTargets() {
4497
4615
  // check for offsetTop change
4498
- return [this.$el, document.documentElement];
4616
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4499
4617
  },
4500
4618
 
4501
4619
  update: {
@@ -4507,21 +4625,25 @@
4507
4625
  let minHeight = '';
4508
4626
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4509
4627
 
4628
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4629
+ const { height: viewportHeight } = offsetViewport(scrollElement);
4630
+
4510
4631
  if (this.expand) {
4511
4632
  minHeight = Math.max(
4512
- height(window) - (
4513
- dimensions(document.documentElement).height -
4514
- dimensions(this.$el).height) -
4633
+ viewportHeight - (
4634
+ dimensions(scrollElement).height - dimensions(this.$el).height) -
4515
4635
  box,
4516
4636
  0);
4517
4637
 
4518
4638
  } else {
4519
4639
  // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4520
- minHeight = 'calc(100vh';
4640
+ minHeight = "calc(" + (
4641
+ document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4642
+
4521
4643
 
4522
4644
  if (this.offsetTop) {
4523
- const { top } = offset(this.$el);
4524
- minHeight += top > 0 && top < height(window) / 2 ? " - " + top + "px" : '';
4645
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4646
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4525
4647
  }
4526
4648
 
4527
4649
  if (this.offsetBottom === true) {
@@ -5855,8 +5977,8 @@
5855
5977
  return this.dropbar;
5856
5978
  },
5857
5979
 
5858
- handler(_, _ref9) {let { $el } = _ref9;
5859
- if (!hasClass($el, this.clsDrop)) {
5980
+ handler(_, _ref9) {let { $el, align } = _ref9;
5981
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5860
5982
  return;
5861
5983
  }
5862
5984
 
@@ -5879,19 +6001,19 @@
5879
6001
  return this.dropbar;
5880
6002
  },
5881
6003
 
5882
- handler(_, _ref10) {let { $el, pos: [dir] = [] } = _ref10;
5883
- if (!hasClass($el, this.clsDrop)) {
6004
+ handler(_, _ref10) {let { $el, align } = _ref10;
6005
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5884
6006
  return;
5885
6007
  }
5886
6008
 
5887
- if (dir === 'bottom') {
5888
- this.transitionTo(
5889
- offset($el).bottom -
5890
- offset(this.dropbar).top +
5891
- toFloat(css($el, 'marginBottom')),
5892
- $el);
6009
+ this._observer = observeResize($el, () =>
6010
+ this.transitionTo(
6011
+ offset($el).bottom -
6012
+ offset(this.dropbar).top +
6013
+ toFloat(css($el, 'marginBottom')),
6014
+ $el));
6015
+
5893
6016
 
5894
- }
5895
6017
  } },
5896
6018
 
5897
6019
 
@@ -5930,11 +6052,13 @@
5930
6052
  return this.dropbar;
5931
6053
  },
5932
6054
 
5933
- handler(_, _ref12) {let { $el } = _ref12;
5934
- if (!hasClass($el, this.clsDrop)) {
6055
+ handler(_, _ref12) {let { $el, align } = _ref12;
6056
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5935
6057
  return;
5936
6058
  }
5937
6059
 
6060
+ this._observer.disconnect();
6061
+
5938
6062
  const active = this.getActive();
5939
6063
 
5940
6064
  if (!active || (active == null ? void 0 : active.$el) === $el) {
@@ -5951,28 +6075,27 @@
5951
6075
 
5952
6076
  transitionTo(newHeight, el) {
5953
6077
  const { dropbar } = this;
5954
- const oldHeight = isVisible(dropbar) ? height(dropbar) : 0;
6078
+ const oldHeight = height(dropbar);
5955
6079
 
5956
6080
  el = oldHeight < newHeight && el;
5957
6081
 
5958
- css(el, 'clip', "rect(0," + el.offsetWidth + "px," + oldHeight + "px,0)");
6082
+ css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
5959
6083
 
5960
6084
  height(dropbar, oldHeight);
5961
6085
 
5962
6086
  Transition.cancel([el, dropbar]);
5963
- return Promise.all([
6087
+ Promise.all([
5964
6088
  Transition.start(dropbar, { height: newHeight }, this.duration),
5965
6089
  Transition.start(
5966
6090
  el,
5967
- { clip: "rect(0," + el.offsetWidth + "px," + newHeight + "px,0)" },
6091
+ {
6092
+ clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
6093
+
5968
6094
  this.duration)]).
5969
6095
 
5970
6096
 
5971
6097
  catch(noop).
5972
- then(() => {
5973
- css(el, { clip: '' });
5974
- this.$update(dropbar);
5975
- });
6098
+ then(() => css(el, { clipPath: '' }));
5976
6099
  },
5977
6100
 
5978
6101
  getDropdown(el) {
@@ -6538,6 +6661,10 @@
6538
6661
  toggle(el, inview) {
6539
6662
  const state = this._data.elements.get(el);
6540
6663
 
6664
+ if (!state) {
6665
+ return;
6666
+ }
6667
+
6541
6668
  state.off == null ? void 0 : state.off();
6542
6669
 
6543
6670
  css(el, 'visibility', !inview && this.hidden ? 'hidden' : '');
@@ -7273,6 +7400,8 @@
7273
7400
  },
7274
7401
 
7275
7402
  handler(e) {
7403
+ this._preventClick = null;
7404
+
7276
7405
  if (!isTouch(e) || this._showState) {
7277
7406
  return;
7278
7407
  }
@@ -7359,6 +7488,7 @@
7359
7488
  handler(e) {
7360
7489
  let link;
7361
7490
  if (
7491
+ this._preventClick ||
7362
7492
  closest(e.target, 'a[href="#"], a[href=""]') ||
7363
7493
  (link = closest(e.target, 'a[href]')) && (
7364
7494
  attr(this.$el, 'aria-expanded') !== 'true' ||
@@ -7367,15 +7497,9 @@
7367
7497
  e.preventDefault();
7368
7498
  }
7369
7499
 
7370
- if (this._preventClick) {
7371
- return this._preventClick = null;
7372
- }
7373
-
7374
- if (!includes(this.mode, 'click')) {
7375
- return;
7500
+ if (!this._preventClick && includes(this.mode, 'click')) {
7501
+ this.toggle();
7376
7502
  }
7377
-
7378
- this.toggle();
7379
7503
  } },
7380
7504
 
7381
7505