uikit 3.14.2-dev.854a8e6b0 → 3.14.2-dev.c7c85455d

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 (91) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/css/uikit-core-rtl.css +72 -15
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +72 -15
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +76 -15
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +76 -15
  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 +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 -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 +225 -106
  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 +294 -140
  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 -24
  54. package/src/js/util/animation.js +1 -0
  55. package/src/js/util/viewport.js +1 -1
  56. package/src/less/components/drop.less +17 -4
  57. package/src/less/components/dropdown.less +19 -4
  58. package/src/less/components/margin.less +13 -14
  59. package/src/less/components/modal.less +19 -4
  60. package/src/less/components/nav.less +1 -1
  61. package/src/less/components/navbar.less +32 -11
  62. package/src/less/components/offcanvas.less +21 -21
  63. package/src/less/components/position.less +1 -1
  64. package/src/less/components/sticky.less +7 -0
  65. package/src/less/components/utility.less +1 -2
  66. package/src/less/theme/dropdown.less +11 -0
  67. package/src/less/theme/navbar.less +7 -0
  68. package/src/scss/components/drop.scss +17 -4
  69. package/src/scss/components/dropdown.scss +19 -4
  70. package/src/scss/components/margin.scss +13 -14
  71. package/src/scss/components/modal.scss +19 -4
  72. package/src/scss/components/nav.scss +1 -1
  73. package/src/scss/components/navbar.scss +21 -0
  74. package/src/scss/components/offcanvas.scss +21 -21
  75. package/src/scss/components/position.scss +1 -1
  76. package/src/scss/components/sticky.scss +7 -0
  77. package/src/scss/components/utility.scss +1 -2
  78. package/src/scss/mixins-theme.scss +8 -0
  79. package/src/scss/mixins.scss +2 -0
  80. package/src/scss/theme/dropdown.scss +8 -0
  81. package/src/scss/theme/navbar.scss +4 -0
  82. package/src/scss/variables-theme.scss +19 -10
  83. package/src/scss/variables.scss +17 -10
  84. package/tests/drop.html +145 -2
  85. package/tests/dropdown.html +228 -13
  86. package/tests/height-viewport.html +62 -0
  87. package/tests/navbar.html +321 -14
  88. package/tests/offcanvas.html +8 -8
  89. package/tests/sticky-navbar.html +132 -0
  90. package/tests/sticky-parallax.html +2 -1
  91. package/tests/sticky.html +5 -4
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.2-dev.854a8e6b0 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.2-dev.c7c85455d | 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();
@@ -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.854a8e6b0';
2953
+ UIkit.version = '3.14.2-dev.c7c85455d';
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
 
@@ -3098,18 +3099,13 @@
3098
3099
  return Promise.reject();
3099
3100
  }
3100
3101
 
3101
- if (!animate) {
3102
- Animation.cancel(el);
3103
- Transition.cancel(el);
3104
- }
3105
-
3106
3102
  const promise = (
3107
3103
  isFunction(animate) ?
3108
3104
  animate :
3109
3105
  animate === false || !this.hasAnimation ?
3110
- this._toggle :
3106
+ toggleInstant(this) :
3111
3107
  this.hasTransition ?
3112
- toggleHeight(this) :
3108
+ toggleTransition(this) :
3113
3109
  toggleAnimation(this))(
3114
3110
  el, show);
3115
3111
 
@@ -3173,7 +3169,25 @@
3173
3169
 
3174
3170
 
3175
3171
 
3176
- 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$1(cmp);
3188
+ }
3189
+
3190
+ function slide$1(_ref4)
3177
3191
 
3178
3192
 
3179
3193
 
@@ -3181,14 +3195,17 @@
3181
3195
 
3182
3196
 
3183
3197
 
3184
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref3;
3198
+ {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3185
3199
  return (el, show) => {
3186
3200
  const inProgress = Transition.inProgress(el);
3187
- const inner = el.hasChildNodes() ?
3201
+ const inner =
3202
+ !inProgress && el.hasChildNodes() ?
3188
3203
  toFloat(css(el.firstElementChild, 'marginTop')) +
3189
3204
  toFloat(css(el.lastElementChild, 'marginBottom')) :
3190
3205
  0;
3191
- 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;
3192
3209
 
3193
3210
  Transition.cancel(el);
3194
3211
 
@@ -3196,34 +3213,97 @@
3196
3213
  _toggle(el, true);
3197
3214
  }
3198
3215
 
3199
- height(el, '');
3216
+ css(el, 'maxHeight', '');
3200
3217
 
3201
3218
  // Update child components first
3202
3219
  fastdom.flush();
3203
3220
 
3204
- const endHeight = height(el) + (inProgress ? 0 : inner);
3205
- duration = velocity * el.offsetHeight + duration;
3221
+ const endHeight = toFloat(css(el, 'height')) + inner;
3222
+ duration = velocity * endHeight + duration;
3206
3223
 
3207
- height(el, currentHeight);
3224
+ css(el, { ...props, maxHeight: currentHeight });
3208
3225
 
3209
3226
  return (
3210
3227
  show ?
3211
3228
  Transition.start(
3212
3229
  el,
3213
- { ...initProps, overflow: 'hidden', height: endHeight },
3214
- Math.round(duration * (1 - currentHeight / endHeight)),
3230
+ { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3231
+ duration * (1 - currentHeight / endHeight),
3215
3232
  transition) :
3216
3233
 
3217
3234
  Transition.start(
3218
3235
  el,
3219
3236
  hideProps,
3220
- Math.round(duration * (currentHeight / endHeight)),
3237
+ duration * (currentHeight / endHeight),
3221
3238
  transition).
3222
3239
  then(() => _toggle(el, false))).
3223
3240
  then(() => css(el, initProps));
3224
3241
  };
3225
3242
  }
3226
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
+
3227
3307
  function toggleAnimation(cmp) {
3228
3308
  return (el, show) => {
3229
3309
  Animation.cancel(el);
@@ -3257,7 +3337,7 @@
3257
3337
  data: {
3258
3338
  targets: '> *',
3259
3339
  active: false,
3260
- animation: [true],
3340
+ animation: ['slide'],
3261
3341
  collapsible: true,
3262
3342
  multiple: false,
3263
3343
  clsOpen: 'uk-open',
@@ -3367,7 +3447,7 @@
3367
3447
  }
3368
3448
 
3369
3449
  hide(content, false);
3370
- await toggleHeight(this)(el._wrapper, show);
3450
+ await slide$1(this)(el._wrapper, show);
3371
3451
  hide(content, !show);
3372
3452
 
3373
3453
  delete el._wrapper;
@@ -3401,7 +3481,7 @@
3401
3481
 
3402
3482
 
3403
3483
  data: {
3404
- animation: [true],
3484
+ animation: ['slide'],
3405
3485
  selClose: '.uk-alert-close',
3406
3486
  duration: 150,
3407
3487
  hideProps: { opacity: 0, ...Togglable.data.hideProps } },
@@ -3587,33 +3667,17 @@
3587
3667
 
3588
3668
  connected() {
3589
3669
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3590
- 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';
3591
3672
  },
3592
3673
 
3593
3674
  methods: {
3594
3675
  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];
3676
+ let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3613
3677
 
3614
3678
  const attach = {
3615
- element: [flipPosition(dir), align],
3616
- target: [dir, align] };
3679
+ element: [flipPosition(this.dir), this.align],
3680
+ target: [this.dir, this.align] };
3617
3681
 
3618
3682
 
3619
3683
  if (this.axis === 'y') {
@@ -3623,13 +3687,41 @@
3623
3687
  offset = offset.reverse();
3624
3688
  }
3625
3689
 
3690
+ // Ensure none positioned element does not generate scrollbars
3691
+ const elDim = dimensions$1(element);
3692
+ css(element, { top: -elDim.height, left: -elDim.width });
3693
+
3626
3694
  positionAt(element, target, {
3627
3695
  attach,
3628
3696
  offset,
3629
3697
  boundary,
3630
3698
  flip: this.flip,
3631
- viewportOffset: toPx(getCssVar('position-viewport-offset', element)) });
3699
+ viewportOffset: this.getViewportOffset(element) });
3632
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));
3633
3725
  } } };
3634
3726
 
3635
3727
  let active$1;
@@ -3647,7 +3739,8 @@
3647
3739
  delayShow: Number,
3648
3740
  delayHide: Number,
3649
3741
  display: String,
3650
- clsDrop: String },
3742
+ clsDrop: String,
3743
+ animateOut: Boolean },
3651
3744
 
3652
3745
 
3653
3746
  data: {
@@ -3661,7 +3754,8 @@
3661
3754
  clsDrop: false,
3662
3755
  animation: ['uk-animation-fade'],
3663
3756
  cls: 'uk-open',
3664
- container: false },
3757
+ container: false,
3758
+ animateOut: false },
3665
3759
 
3666
3760
 
3667
3761
  created() {
@@ -3849,7 +3943,7 @@
3849
3943
  }
3850
3944
  }),
3851
3945
 
3852
- ...(this.display === 'static' ?
3946
+ ...(this.display === 'static' && this.align !== 'stretch' ?
3853
3947
  [] :
3854
3948
  (() => {
3855
3949
  const handler = () => this.$emit();
@@ -3910,7 +4004,7 @@
3910
4004
  methods: {
3911
4005
  show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
3912
4006
  if (this.isToggled() && target && this.target && target !== this.target) {
3913
- this.hide(false);
4007
+ this.hide(false, false);
3914
4008
  }
3915
4009
 
3916
4010
  this.target = target;
@@ -3930,7 +4024,7 @@
3930
4024
  let prev;
3931
4025
  while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
3932
4026
  prev = active$1;
3933
- active$1.hide(false);
4027
+ active$1.hide(false, false);
3934
4028
  }
3935
4029
  }
3936
4030
 
@@ -3944,8 +4038,8 @@
3944
4038
 
3945
4039
  },
3946
4040
 
3947
- hide(delay) {if (delay === void 0) {delay = true;}
3948
- 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);
3949
4043
 
3950
4044
  this.clearTimers();
3951
4045
 
@@ -3977,28 +4071,51 @@
3977
4071
  position() {
3978
4072
  removeClass(this.$el, this.clsDrop + "-stack");
3979
4073
  toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4074
+ toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
3980
4075
 
3981
4076
  const boundary = query(this.boundary, this.$el);
3982
- const scrollParentOffset = offset(
3983
- 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);
3984
4080
 
4081
+ const scrollParentOffset = offset(scrollParent);
3985
4082
  const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4083
+ const viewportOffset = this.getViewportOffset(this.$el);
3986
4084
 
3987
4085
  css(this.$el, 'maxWidth', '');
3988
- const maxWidth =
3989
- scrollParentOffset.width -
3990
- 2 * toPx(getCssVar('position-viewport-offset', this.$el));
4086
+ const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
3991
4087
 
3992
- if (this.pos[1] === 'justify') {
4088
+ if (this.align === 'justify') {
3993
4089
  const prop = this.axis === 'y' ? 'width' : 'height';
3994
4090
  css(
3995
4091
  this.$el,
3996
4092
  prop,
3997
4093
  Math.min(
3998
4094
  (boundary ? boundaryOffset : offset(this.target))[prop],
3999
- scrollParentOffset[prop] -
4000
- 2 * toPx(getCssVar('position-viewport-offset', this.$el))));
4001
-
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 });
4002
4119
 
4003
4120
  } else if (this.$el.offsetWidth > maxWidth) {
4004
4121
  addClass(this.$el, this.clsDrop + "-stack");
@@ -4006,11 +4123,7 @@
4006
4123
 
4007
4124
  css(this.$el, 'maxWidth', maxWidth);
4008
4125
 
4009
- this.positionAt(
4010
- this.$el,
4011
- boundary && this.boundaryAlign ? boundary : this.target,
4012
- boundary);
4013
-
4126
+ this.positionAt(this.$el, target, boundary);
4014
4127
  } } };
4015
4128
 
4016
4129
 
@@ -4495,7 +4608,7 @@
4495
4608
 
4496
4609
  resizeTargets() {
4497
4610
  // check for offsetTop change
4498
- return [this.$el, document.documentElement];
4611
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4499
4612
  },
4500
4613
 
4501
4614
  update: {
@@ -4507,21 +4620,25 @@
4507
4620
  let minHeight = '';
4508
4621
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4509
4622
 
4623
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4624
+ const { height: viewportHeight } = offsetViewport(scrollElement);
4625
+
4510
4626
  if (this.expand) {
4511
4627
  minHeight = Math.max(
4512
- height(window) - (
4513
- dimensions$1(document.documentElement).height -
4514
- dimensions$1(this.$el).height) -
4628
+ viewportHeight - (
4629
+ dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
4515
4630
  box,
4516
4631
  0);
4517
4632
 
4518
4633
  } else {
4519
4634
  // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4520
- minHeight = 'calc(100vh';
4635
+ minHeight = "calc(" + (
4636
+ document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4637
+
4521
4638
 
4522
4639
  if (this.offsetTop) {
4523
- const { top } = offset(this.$el);
4524
- 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" : '';
4525
4642
  }
4526
4643
 
4527
4644
  if (this.offsetBottom === true) {
@@ -5855,8 +5972,8 @@
5855
5972
  return this.dropbar;
5856
5973
  },
5857
5974
 
5858
- handler(_, _ref9) {let { $el } = _ref9;
5859
- if (!hasClass($el, this.clsDrop)) {
5975
+ handler(_, _ref9) {let { $el, align } = _ref9;
5976
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5860
5977
  return;
5861
5978
  }
5862
5979
 
@@ -5879,19 +5996,19 @@
5879
5996
  return this.dropbar;
5880
5997
  },
5881
5998
 
5882
- handler(_, _ref10) {let { $el, pos: [dir] = [] } = _ref10;
5883
- if (!hasClass($el, this.clsDrop)) {
5999
+ handler(_, _ref10) {let { $el, align } = _ref10;
6000
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5884
6001
  return;
5885
6002
  }
5886
6003
 
5887
- if (dir === 'bottom') {
5888
- this.transitionTo(
5889
- offset($el).bottom -
5890
- offset(this.dropbar).top +
5891
- toFloat(css($el, 'marginBottom')),
5892
- $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
+
5893
6011
 
5894
- }
5895
6012
  } },
5896
6013
 
5897
6014
 
@@ -5930,11 +6047,13 @@
5930
6047
  return this.dropbar;
5931
6048
  },
5932
6049
 
5933
- handler(_, _ref12) {let { $el } = _ref12;
5934
- if (!hasClass($el, this.clsDrop)) {
6050
+ handler(_, _ref12) {let { $el, align } = _ref12;
6051
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5935
6052
  return;
5936
6053
  }
5937
6054
 
6055
+ this._observer.disconnect();
6056
+
5938
6057
  const active = this.getActive();
5939
6058
 
5940
6059
  if (!active || (active == null ? void 0 : active.$el) === $el) {
@@ -5951,28 +6070,27 @@
5951
6070
 
5952
6071
  transitionTo(newHeight, el) {
5953
6072
  const { dropbar } = this;
5954
- const oldHeight = isVisible(dropbar) ? height(dropbar) : 0;
6073
+ const oldHeight = height(dropbar);
5955
6074
 
5956
6075
  el = oldHeight < newHeight && el;
5957
6076
 
5958
- 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)");
5959
6078
 
5960
6079
  height(dropbar, oldHeight);
5961
6080
 
5962
6081
  Transition.cancel([el, dropbar]);
5963
- return Promise.all([
6082
+ Promise.all([
5964
6083
  Transition.start(dropbar, { height: newHeight }, this.duration),
5965
6084
  Transition.start(
5966
6085
  el,
5967
- { clip: "rect(0," + el.offsetWidth + "px," + newHeight + "px,0)" },
6086
+ {
6087
+ clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
6088
+
5968
6089
  this.duration)]).
5969
6090
 
5970
6091
 
5971
6092
  catch(noop).
5972
- then(() => {
5973
- css(el, { clip: '' });
5974
- this.$update(dropbar);
5975
- });
6093
+ then(() => css(el, { clipPath: '' }));
5976
6094
  },
5977
6095
 
5978
6096
  getDropdown(el) {
@@ -6538,6 +6656,10 @@
6538
6656
  toggle(el, inview) {
6539
6657
  const state = this._data.elements.get(el);
6540
6658
 
6659
+ if (!state) {
6660
+ return;
6661
+ }
6662
+
6541
6663
  state.off == null ? void 0 : state.off();
6542
6664
 
6543
6665
  css(el, 'visibility', !inview && this.hidden ? 'hidden' : '');
@@ -7273,6 +7395,8 @@
7273
7395
  },
7274
7396
 
7275
7397
  handler(e) {
7398
+ this._preventClick = null;
7399
+
7276
7400
  if (!isTouch(e) || this._showState) {
7277
7401
  return;
7278
7402
  }
@@ -7359,6 +7483,7 @@
7359
7483
  handler(e) {
7360
7484
  let link;
7361
7485
  if (
7486
+ this._preventClick ||
7362
7487
  closest(e.target, 'a[href="#"], a[href=""]') ||
7363
7488
  (link = closest(e.target, 'a[href]')) && (
7364
7489
  attr(this.$el, 'aria-expanded') !== 'true' ||
@@ -7367,15 +7492,9 @@
7367
7492
  e.preventDefault();
7368
7493
  }
7369
7494
 
7370
- if (this._preventClick) {
7371
- return this._preventClick = null;
7372
- }
7373
-
7374
- if (!includes(this.mode, 'click')) {
7375
- return;
7495
+ if (!this._preventClick && includes(this.mode, 'click')) {
7496
+ this.toggle();
7376
7497
  }
7377
-
7378
- this.toggle();
7379
7498
  } },
7380
7499
 
7381
7500
 
@@ -9363,12 +9482,17 @@
9363
9482
 
9364
9483
  computed: {
9365
9484
  props(properties, $el) {
9366
- return keys(props).reduce((result, prop) => {
9367
- if (!isUndefined(properties[prop])) {
9368
- result[prop] = props[prop](prop, $el, properties[prop].slice());
9485
+ const stops = {};
9486
+ for (const prop in properties) {
9487
+ if (prop in props && !isUndefined(properties[prop])) {
9488
+ stops[prop] = properties[prop].slice();
9369
9489
  }
9370
- return result;
9371
- }, {});
9490
+ }
9491
+ const result = {};
9492
+ for (const prop in stops) {
9493
+ result[prop] = props[prop](prop, $el, stops[prop], stops);
9494
+ }
9495
+ return result;
9372
9496
  } },
9373
9497
 
9374
9498
 
@@ -9497,58 +9621,66 @@
9497
9621
  };
9498
9622
  }
9499
9623
 
9500
- function backgroundFn(prop, el, stops) {
9624
+ function backgroundFn(prop, el, stops, props) {
9501
9625
  if (stops.length === 1) {
9502
9626
  stops.unshift(0);
9503
9627
  }
9504
9628
 
9505
- prop = prop.substr(-1);
9506
- const attr = prop === 'y' ? 'height' : 'width';
9507
- stops = parseStops(stops, (stop) => toPx(stop, attr, el));
9629
+ const attr = prop === 'bgy' ? 'height' : 'width';
9630
+ props[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));
9508
9631
 
9509
- const bgPos = getCssValue(el, "background-position-" + prop, '');
9632
+ const bgProps = ['bgx', 'bgy'].filter((prop) => prop in props);
9633
+ if (bgProps.length === 2 && prop === 'bgx') {
9634
+ return noop;
9635
+ }
9510
9636
 
9511
- return getCssValue(el, 'backgroundSize', '') === 'cover' ?
9512
- backgroundCoverFn(prop, el, stops, bgPos, attr) :
9513
- setBackgroundPosFn(prop, stops, bgPos);
9637
+ if (getCssValue(el, 'backgroundSize', '') === 'cover') {
9638
+ return backgroundCoverFn(prop, el, stops, props);
9639
+ }
9640
+
9641
+ const positions = {};
9642
+ for (const prop of bgProps) {
9643
+ positions[prop] = getBackgroundPos(el, prop);
9644
+ }
9645
+
9646
+ return setBackgroundPosFn(bgProps, props, positions);
9514
9647
  }
9515
9648
 
9516
- function backgroundCoverFn(prop, el, stops, bgPos, attr) {
9649
+ function backgroundCoverFn(prop, el, stops, props) {
9517
9650
  const dimImage = getBackgroundImageDimensions(el);
9518
9651
 
9519
9652
  if (!dimImage.width) {
9520
9653
  return noop;
9521
9654
  }
9522
9655
 
9523
- const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
9524
- const min = Math.min(...values);
9525
- const max = Math.max(...values);
9526
- const down = values.indexOf(min) < values.indexOf(max);
9527
-
9528
- const diff = max - min;
9529
- let pos = (down ? -diff : 0) - (down ? min : max);
9530
-
9531
9656
  const dimEl = {
9532
9657
  width: el.offsetWidth,
9533
9658
  height: el.offsetHeight };
9534
9659
 
9535
9660
 
9536
- const baseDim = Dimensions.cover(dimImage, dimEl);
9537
- const span = baseDim[attr] - dimEl[attr];
9661
+ const bgProps = ['bgx', 'bgy'].filter((prop) => prop in props);
9538
9662
 
9539
- if (span < diff) {
9540
- dimEl[attr] = baseDim[attr] + diff - span;
9541
- } else if (span > diff) {
9542
- const posPercentage = dimEl[attr] / toPx(bgPos, attr, el, true);
9663
+ const positions = {};
9664
+ for (const prop of bgProps) {
9665
+ const values = props[prop].map((_ref2) => {let [value] = _ref2;return value;});
9666
+ const min = Math.min(...values);
9667
+ const max = Math.max(...values);
9668
+ const down = values.indexOf(min) < values.indexOf(max);
9669
+ const diff = max - min;
9543
9670
 
9544
- if (posPercentage) {
9545
- pos -= (span - diff) / posPercentage;
9546
- }
9671
+ positions[prop] = (down ? -diff : 0) - (down ? min : max) + "px";
9672
+ dimEl[prop === 'bgy' ? 'height' : 'width'] += diff;
9547
9673
  }
9548
9674
 
9549
9675
  const dim = Dimensions.cover(dimImage, dimEl);
9550
9676
 
9551
- const fn = setBackgroundPosFn(prop, stops, pos + "px");
9677
+ for (const prop of bgProps) {
9678
+ const attr = prop === 'bgy' ? 'height' : 'width';
9679
+ const overflow = dim[attr] - dimEl[attr];
9680
+ positions[prop] = "max(" + getBackgroundPos(el, prop) + ",-" + overflow + "px) + " + positions[prop];
9681
+ }
9682
+
9683
+ const fn = setBackgroundPosFn(bgProps, positions, props);
9552
9684
  return (css, percent) => {
9553
9685
  fn(css, percent);
9554
9686
  css.backgroundSize = dim.width + "px " + dim.height + "px";
@@ -9556,9 +9688,16 @@
9556
9688
  };
9557
9689
  }
9558
9690
 
9559
- function setBackgroundPosFn(prop, stops, pos) {
9691
+ function getBackgroundPos(el, prop) {
9692
+ return getCssValue(el, "background-position-" + prop.substr(-1), '');
9693
+ }
9694
+
9695
+ function setBackgroundPosFn(bgProps, positions, props) {
9560
9696
  return function (css, percent) {
9561
- css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
9697
+ for (const prop of bgProps) {
9698
+ const value = getValue(props[prop], percent);
9699
+ css["background-position-" + prop.substr(-1)] = "calc(" + positions[prop] + " + " + value + "px)";
9700
+ }
9562
9701
  };
9563
9702
  }
9564
9703
 
@@ -9744,6 +9883,21 @@
9744
9883
 
9745
9884
 
9746
9885
 
9886
+ /*
9887
+ * Inspired by https://gist.github.com/gre/1650294?permalink_comment_id=3477425#gistcomment-3477425
9888
+ *
9889
+ * linear: 0
9890
+ * easeInSine: 0.5
9891
+ * easeOutSine: -0.5
9892
+ * easeInQuad: 1
9893
+ * easeOutQuad: -1
9894
+ * easeInCubic: 2
9895
+ * easeOutCubic: -2
9896
+ * easeInQuart: 3
9897
+ * easeOutQuart: -3
9898
+ * easeInQuint: 4
9899
+ * easeOutQuint: -4
9900
+ */
9747
9901
  function ease(percent, easing) {
9748
9902
  return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);
9749
9903
  }