uikit 3.14.3 → 3.14.4-dev.008162cc3

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 (93) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/css/uikit-core-rtl.css +111 -35
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +111 -35
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +114 -50
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +114 -50
  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 +210 -32
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +210 -32
  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 +1 -1
  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 +22 -7
  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 +22 -7
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +3 -3
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +142 -34
  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 +818 -636
  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 +1632 -1435
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/sortable.js +2 -3
  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 +47 -20
  47. package/src/js/core/height-viewport.js +18 -9
  48. package/src/js/core/navbar.js +11 -9
  49. package/src/js/core/offcanvas.js +1 -47
  50. package/src/js/core/sticky.js +8 -9
  51. package/src/js/core/switcher.js +1 -1
  52. package/src/js/mixin/modal.js +90 -4
  53. package/src/js/mixin/position.js +52 -13
  54. package/src/js/mixin/slider-drag.js +20 -8
  55. package/src/js/mixin/togglable.js +105 -24
  56. package/src/js/util/animation.js +1 -0
  57. package/src/js/util/dimensions.js +6 -6
  58. package/src/js/util/position.js +2 -0
  59. package/src/js/util/viewport.js +23 -37
  60. package/src/less/components/drop.less +19 -5
  61. package/src/less/components/dropdown.less +21 -5
  62. package/src/less/components/margin.less +13 -14
  63. package/src/less/components/modal.less +19 -4
  64. package/src/less/components/nav.less +23 -5
  65. package/src/less/components/navbar.less +56 -26
  66. package/src/less/components/offcanvas.less +21 -21
  67. package/src/less/components/position.less +1 -1
  68. package/src/less/components/utility.less +12 -4
  69. package/src/less/theme/dropdown.less +11 -0
  70. package/src/less/theme/nav.less +3 -7
  71. package/src/less/theme/navbar.less +12 -12
  72. package/src/scss/components/drop.scss +19 -5
  73. package/src/scss/components/dropdown.scss +21 -5
  74. package/src/scss/components/margin.scss +13 -14
  75. package/src/scss/components/modal.scss +19 -4
  76. package/src/scss/components/nav.scss +23 -5
  77. package/src/scss/components/navbar.scss +45 -15
  78. package/src/scss/components/offcanvas.scss +21 -21
  79. package/src/scss/components/position.scss +1 -1
  80. package/src/scss/components/utility.scss +12 -4
  81. package/src/scss/mixins-theme.scss +9 -13
  82. package/src/scss/mixins.scss +2 -0
  83. package/src/scss/theme/dropdown.scss +8 -0
  84. package/src/scss/theme/nav.scss +3 -7
  85. package/src/scss/theme/navbar.scss +9 -0
  86. package/src/scss/variables-theme.scss +35 -14
  87. package/src/scss/variables.scss +33 -13
  88. package/tests/drop.html +151 -2
  89. package/tests/dropdown.html +228 -13
  90. package/tests/height-viewport.html +62 -0
  91. package/tests/navbar.html +2166 -1085
  92. package/tests/offcanvas.html +8 -8
  93. package/tests/sticky-navbar.html +132 -0
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.3 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.008162cc3 | 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) =>
@@ -1059,13 +1060,13 @@
1059
1060
  }
1060
1061
 
1061
1062
  function offsetPosition(element) {
1062
- const offset = [0, 0];
1063
-
1064
1063
  element = toNode(element);
1065
1064
 
1066
- do {
1067
- offset[0] += element.offsetTop;
1068
- offset[1] += element.offsetLeft;
1065
+ const offset = [element.offsetTop, element.offsetLeft];
1066
+
1067
+ while (element = element.offsetParent) {
1068
+ offset[0] += element.offsetTop + toFloat(css(element, "borderTopWidth"));
1069
+ offset[1] += element.offsetLeft + toFloat(css(element, "borderLeftWidth"));
1069
1070
 
1070
1071
  if (css(element, 'position') === 'fixed') {
1071
1072
  const win = toWindow(element);
@@ -1073,7 +1074,7 @@
1073
1074
  offset[1] += win.scrollX;
1074
1075
  return offset;
1075
1076
  }
1076
- } while (element = element.offsetParent);
1077
+ }
1077
1078
 
1078
1079
  return offset;
1079
1080
  }
@@ -1794,20 +1795,6 @@
1794
1795
 
1795
1796
  }
1796
1797
 
1797
- function scrollTop(element, top) {
1798
- if (isWindow(element) || isDocument(element)) {
1799
- element = scrollingElement(element);
1800
- } else {
1801
- element = toNode(element);
1802
- }
1803
-
1804
- if (isUndefined(top)) {
1805
- return element.scrollTop;
1806
- } else {
1807
- element.scrollTop = top;
1808
- }
1809
- }
1810
-
1811
1798
  function scrollIntoView(element, _temp) {let { offset: offsetBy = 0 } = _temp === void 0 ? {} : _temp;
1812
1799
  const parents = isVisible(element) ? scrollParents(element) : [];
1813
1800
  return parents.reduce(
@@ -1849,7 +1836,7 @@
1849
1836
  (function step() {
1850
1837
  const percent = ease(clamp((Date.now() - start) / duration));
1851
1838
 
1852
- scrollTop(element, scroll + top * percent);
1839
+ element.scrollTop = scroll + top * percent;
1853
1840
 
1854
1841
  // scroll more if we have not reached our destination
1855
1842
  if (percent === 1) {
@@ -1887,7 +1874,7 @@
1887
1874
  return clamp((scrollTop - start) / (end - start));
1888
1875
  }
1889
1876
 
1890
- function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden/;}if (scrollable === void 0) {scrollable = false;}
1877
+ function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden|clip/;}if (scrollable === void 0) {scrollable = false;}
1891
1878
  const scrollEl = scrollingElement(element);
1892
1879
 
1893
1880
  let ancestors = parents(element).reverse();
@@ -1910,18 +1897,33 @@
1910
1897
  }
1911
1898
 
1912
1899
  function offsetViewport(scrollElement) {
1913
- let viewportElement = getViewport$1(scrollElement);
1900
+ const window = toWindow(scrollElement);
1901
+ const {
1902
+ document: { body, documentElement } } =
1903
+ window;
1904
+ let viewportElement =
1905
+ scrollElement === scrollingElement(scrollElement) || scrollElement === body ?
1906
+ window :
1907
+ scrollElement;
1908
+
1909
+ const { visualViewport } = window;
1910
+ if (isWindow(viewportElement) && visualViewport) {
1911
+ let { height, width, scale, pageTop: top, pageLeft: left } = visualViewport;
1912
+ height = Math.round(height * scale);
1913
+ width = Math.round(width * scale);
1914
+ return { height, width, top, left, bottom: top + height, right: left + width };
1915
+ }
1914
1916
 
1915
1917
  let rect = offset(viewportElement);
1916
1918
  for (let [prop, dir, start, end] of [
1917
1919
  ['width', 'x', 'left', 'right'],
1918
1920
  ['height', 'y', 'top', 'bottom']])
1919
1921
  {
1920
- if (!isWindow(viewportElement)) {
1921
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1922
- } else {
1922
+ if (isWindow(viewportElement)) {
1923
1923
  // iOS 12 returns <body> as scrollingElement
1924
- viewportElement = viewportElement.document.documentElement;
1924
+ viewportElement = documentElement;
1925
+ } else {
1926
+ rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1925
1927
  }
1926
1928
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1927
1929
  rect[end] = rect[prop] + rect[start];
@@ -1933,10 +1935,6 @@
1933
1935
  return toWindow(element).document.scrollingElement;
1934
1936
  }
1935
1937
 
1936
- function getViewport$1(scrollElement) {
1937
- return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1938
- }
1939
-
1940
1938
  const dirs = [
1941
1939
  ['width', 'x', 'left', 'right'],
1942
1940
  ['height', 'y', 'top', 'bottom']];
@@ -2093,6 +2091,8 @@
2093
2091
  if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2094
2092
  return newPos;
2095
2093
  }
2094
+
2095
+ continue;
2096
2096
  }
2097
2097
  }
2098
2098
 
@@ -2286,7 +2286,6 @@
2286
2286
  getCssVar: getCssVar,
2287
2287
  propName: propName,
2288
2288
  isInView: isInView,
2289
- scrollTop: scrollTop,
2290
2289
  scrollIntoView: scrollIntoView,
2291
2290
  scrolledOver: scrolledOver,
2292
2291
  scrollParents: scrollParents,
@@ -2949,7 +2948,7 @@
2949
2948
  UIkit.data = '__uikit__';
2950
2949
  UIkit.prefix = 'uk-';
2951
2950
  UIkit.options = {};
2952
- UIkit.version = '3.14.3';
2951
+ UIkit.version = '3.14.4-dev.008162cc3';
2953
2952
 
2954
2953
  globalAPI(UIkit);
2955
2954
  hooksAPI(UIkit);
@@ -3058,7 +3057,7 @@
3058
3057
 
3059
3058
  initProps: {
3060
3059
  overflow: '',
3061
- height: '',
3060
+ maxHeight: '',
3062
3061
  paddingTop: '',
3063
3062
  paddingBottom: '',
3064
3063
  marginTop: '',
@@ -3068,7 +3067,7 @@
3068
3067
 
3069
3068
  hideProps: {
3070
3069
  overflow: 'hidden',
3071
- height: 0,
3070
+ maxHeight: 0,
3072
3071
  paddingTop: 0,
3073
3072
  paddingBottom: 0,
3074
3073
  marginTop: 0,
@@ -3083,7 +3082,7 @@
3083
3082
  },
3084
3083
 
3085
3084
  hasTransition(_ref2) {let { animation } = _ref2;
3086
- return this.hasAnimation && animation[0] === true;
3085
+ return startsWith(animation[0], 'slide');
3087
3086
  } },
3088
3087
 
3089
3088
 
@@ -3098,18 +3097,13 @@
3098
3097
  return Promise.reject();
3099
3098
  }
3100
3099
 
3101
- if (!animate) {
3102
- Animation.cancel(el);
3103
- Transition.cancel(el);
3104
- }
3105
-
3106
3100
  const promise = (
3107
3101
  isFunction(animate) ?
3108
3102
  animate :
3109
3103
  animate === false || !this.hasAnimation ?
3110
- this._toggle :
3104
+ toggleInstant(this) :
3111
3105
  this.hasTransition ?
3112
- toggleHeight(this) :
3106
+ toggleTransition(this) :
3113
3107
  toggleAnimation(this))(
3114
3108
  el, show);
3115
3109
 
@@ -3173,7 +3167,25 @@
3173
3167
 
3174
3168
 
3175
3169
 
3176
- function toggleHeight(_ref3)
3170
+ function toggleInstant(_ref3) {let { _toggle } = _ref3;
3171
+ return (el, show) => {
3172
+ Animation.cancel(el);
3173
+ Transition.cancel(el);
3174
+ return _toggle(el, show);
3175
+ };
3176
+ }
3177
+
3178
+ function toggleTransition(cmp) {
3179
+ switch (cmp.animation[0]) {
3180
+ case 'slide-left':
3181
+ return slideHorizontal(cmp);
3182
+ case 'slide-right':
3183
+ return slideHorizontal(cmp, true);}
3184
+
3185
+ return slide(cmp);
3186
+ }
3187
+
3188
+ function slide(_ref4)
3177
3189
 
3178
3190
 
3179
3191
 
@@ -3181,14 +3193,17 @@
3181
3193
 
3182
3194
 
3183
3195
 
3184
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref3;
3196
+ {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3185
3197
  return (el, show) => {
3186
3198
  const inProgress = Transition.inProgress(el);
3187
- const inner = el.hasChildNodes() ?
3199
+ const inner =
3200
+ !inProgress && el.hasChildNodes() ?
3188
3201
  toFloat(css(el.firstElementChild, 'marginTop')) +
3189
3202
  toFloat(css(el.lastElementChild, 'marginBottom')) :
3190
3203
  0;
3191
- const currentHeight = isVisible(el) ? height(el) + (inProgress ? 0 : inner) : 0;
3204
+ const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3205
+
3206
+ const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3192
3207
 
3193
3208
  Transition.cancel(el);
3194
3209
 
@@ -3196,34 +3211,97 @@
3196
3211
  _toggle(el, true);
3197
3212
  }
3198
3213
 
3199
- height(el, '');
3214
+ css(el, 'maxHeight', '');
3200
3215
 
3201
3216
  // Update child components first
3202
3217
  fastdom.flush();
3203
3218
 
3204
- const endHeight = height(el) + (inProgress ? 0 : inner);
3205
- duration = velocity * el.offsetHeight + duration;
3219
+ const endHeight = toFloat(css(el, 'height')) + inner;
3220
+ duration = velocity * endHeight + duration;
3206
3221
 
3207
- height(el, currentHeight);
3222
+ css(el, { ...props, maxHeight: currentHeight });
3208
3223
 
3209
3224
  return (
3210
3225
  show ?
3211
3226
  Transition.start(
3212
3227
  el,
3213
- { ...initProps, overflow: 'hidden', height: endHeight },
3214
- Math.round(duration * (1 - currentHeight / endHeight)),
3228
+ { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3229
+ duration * (1 - currentHeight / endHeight),
3215
3230
  transition) :
3216
3231
 
3217
3232
  Transition.start(
3218
3233
  el,
3219
3234
  hideProps,
3220
- Math.round(duration * (currentHeight / endHeight)),
3235
+ duration * (currentHeight / endHeight),
3221
3236
  transition).
3222
3237
  then(() => _toggle(el, false))).
3223
3238
  then(() => css(el, initProps));
3224
3239
  };
3225
3240
  }
3226
3241
 
3242
+ function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3243
+ return (el, show) => {
3244
+ const visible = isVisible(el);
3245
+ const marginLeft = toFloat(css(el, 'marginLeft'));
3246
+
3247
+ Transition.cancel(el);
3248
+
3249
+ const [scrollElement] = scrollParents(el);
3250
+ css(scrollElement, 'overflowX', 'hidden');
3251
+
3252
+ if (!isToggled(el)) {
3253
+ _toggle(el, true);
3254
+ }
3255
+
3256
+ const width = toFloat(css(el, 'width'));
3257
+ duration = velocity * width + duration;
3258
+
3259
+ const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3260
+ const offsetEl = offset(el);
3261
+ const useClipPath = right ?
3262
+ offsetEl.right < scrollElement.clientWidth :
3263
+ Math.round(offsetEl.left) > 0;
3264
+
3265
+ css(el, {
3266
+ clipPath: useClipPath ?
3267
+ right ? "polygon(0 0," +
3268
+ percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3269
+ 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
3270
+ '',
3271
+ marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3272
+
3273
+
3274
+ return (
3275
+ show ?
3276
+ Transition.start(
3277
+ el,
3278
+ {
3279
+ clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
3280
+ marginLeft: 0 },
3281
+
3282
+ duration * (1 - percent / 100),
3283
+ transition) :
3284
+
3285
+ Transition.start(
3286
+ el,
3287
+ {
3288
+ clipPath: useClipPath ?
3289
+ right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
3290
+
3291
+
3292
+ '',
3293
+ marginLeft: (right ? 1 : -1) * width },
3294
+
3295
+ duration * (percent / 100),
3296
+ transition).
3297
+ then(() => _toggle(el, false))).
3298
+ then(() => {
3299
+ css(scrollElement, 'overflowX', '');
3300
+ css(el, { clipPath: '', marginLeft: '' });
3301
+ });
3302
+ };
3303
+ }
3304
+
3227
3305
  function toggleAnimation(cmp) {
3228
3306
  return (el, show) => {
3229
3307
  Animation.cancel(el);
@@ -3257,7 +3335,7 @@
3257
3335
  data: {
3258
3336
  targets: '> *',
3259
3337
  active: false,
3260
- animation: [true],
3338
+ animation: ['slide'],
3261
3339
  collapsible: true,
3262
3340
  multiple: false,
3263
3341
  clsOpen: 'uk-open',
@@ -3367,7 +3445,7 @@
3367
3445
  }
3368
3446
 
3369
3447
  hide(content, false);
3370
- await toggleHeight(this)(el._wrapper, show);
3448
+ await slide(this)(el._wrapper, show);
3371
3449
  hide(content, !show);
3372
3450
 
3373
3451
  delete el._wrapper;
@@ -3401,7 +3479,7 @@
3401
3479
 
3402
3480
 
3403
3481
  data: {
3404
- animation: [true],
3482
+ animation: ['slide'],
3405
3483
  selClose: '.uk-alert-close',
3406
3484
  duration: 150,
3407
3485
  hideProps: { opacity: 0, ...Togglable.data.hideProps } },
@@ -3587,23 +3665,17 @@
3587
3665
 
3588
3666
  connected() {
3589
3667
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3590
- this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3668
+ [this.dir, this.align] = this.pos;
3669
+ this.axis = includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
3591
3670
  },
3592
3671
 
3593
3672
  methods: {
3594
3673
  positionAt(element, target, boundary) {
3595
- const [dir, align] = this.pos;
3596
-
3597
- let offset = toPx(
3598
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3599
- this.axis === 'x' ? 'width' : 'height',
3600
- element);
3601
-
3602
- offset = [includes(['left', 'top'], dir) ? -offset : +offset, 0];
3674
+ let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3603
3675
 
3604
3676
  const attach = {
3605
- element: [flipPosition(dir), align],
3606
- target: [dir, align] };
3677
+ element: [flipPosition(this.dir), this.align],
3678
+ target: [this.dir, this.align] };
3607
3679
 
3608
3680
 
3609
3681
  if (this.axis === 'y') {
@@ -3613,71 +3685,88 @@
3613
3685
  offset = offset.reverse();
3614
3686
  }
3615
3687
 
3688
+ const [scrollElement] = scrollParents(element, /auto|scroll/);
3689
+ const { scrollTop, scrollLeft } = scrollElement;
3690
+
3691
+ // Ensure none positioned element does not generate scrollbars
3692
+ const elDim = dimensions(element);
3693
+ css(element, { top: -elDim.height, left: -elDim.width });
3694
+
3616
3695
  positionAt(element, target, {
3617
3696
  attach,
3618
3697
  offset,
3619
3698
  boundary,
3620
3699
  flip: this.flip,
3621
- viewportOffset: toPx(getCssVar('position-viewport-offset', element)) });
3700
+ viewportOffset: this.getViewportOffset(element) });
3622
3701
 
3623
- } } };
3624
3702
 
3625
- let active$1;
3703
+ // Restore scroll position
3704
+ scrollElement.scrollTop = scrollTop;
3705
+ scrollElement.scrollLeft = scrollLeft;
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));
3626
3715
 
3627
- var drop = {
3628
- mixins: [Container, Lazyload, Position, Togglable],
3716
+ },
3629
3717
 
3630
- args: 'pos',
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));
3730
+ } } };
3731
+
3732
+ const active$1 = [];
3733
+
3734
+ var Modal = {
3735
+ mixins: [Class, Container, Togglable],
3631
3736
 
3632
3737
  props: {
3633
- mode: 'list',
3634
- toggle: Boolean,
3635
- boundary: Boolean,
3636
- boundaryAlign: Boolean,
3637
- delayShow: Number,
3638
- delayHide: Number,
3639
- display: String,
3640
- clsDrop: String },
3738
+ selPanel: String,
3739
+ selClose: String,
3740
+ escClose: Boolean,
3741
+ bgClose: Boolean,
3742
+ stack: Boolean },
3641
3743
 
3642
3744
 
3643
3745
  data: {
3644
- mode: ['click', 'hover'],
3645
- toggle: '- *',
3646
- boundary: true,
3647
- boundaryAlign: false,
3648
- delayShow: 0,
3649
- delayHide: 800,
3650
- display: null,
3651
- clsDrop: false,
3652
- animation: ['uk-animation-fade'],
3653
3746
  cls: 'uk-open',
3654
- container: false },
3747
+ escClose: true,
3748
+ bgClose: true,
3749
+ overlay: true,
3750
+ stack: false },
3655
3751
 
3656
3752
 
3657
- created() {
3658
- this.tracker = new MouseTracker();
3659
- },
3753
+ computed: {
3754
+ panel(_ref, $el) {let { selPanel } = _ref;
3755
+ return $(selPanel, $el);
3756
+ },
3660
3757
 
3661
- beforeConnect() {
3662
- this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
3663
- },
3758
+ transitionElement() {
3759
+ return this.panel;
3760
+ },
3664
3761
 
3665
- connected() {
3666
- addClass(this.$el, this.clsDrop);
3762
+ bgClose(_ref2) {let { bgClose } = _ref2;
3763
+ return bgClose && this.panel;
3764
+ } },
3667
3765
 
3668
- if (this.toggle && !this.target) {
3669
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
3670
- target: this.$el,
3671
- mode: this.mode }).
3672
- $el;
3673
- attr(this.target, 'aria-haspopup', true);
3674
- this.lazyload(this.target);
3675
- }
3676
- },
3677
3766
 
3678
- disconnected() {
3679
- if (this.isActive()) {
3680
- active$1 = null;
3767
+ beforeDisconnect() {
3768
+ if (includes(active$1, this)) {
3769
+ this.toggleElement(this.$el, false, false);
3681
3770
  }
3682
3771
  },
3683
3772
 
@@ -3686,101 +3775,458 @@
3686
3775
  name: 'click',
3687
3776
 
3688
3777
  delegate() {
3689
- return "." + this.clsDrop + "-close";
3778
+ return this.selClose;
3690
3779
  },
3691
3780
 
3692
3781
  handler(e) {
3693
3782
  e.preventDefault();
3694
- this.hide(false);
3783
+ this.hide();
3695
3784
  } },
3696
3785
 
3697
3786
 
3698
3787
  {
3699
- name: 'click',
3788
+ name: 'toggle',
3700
3789
 
3701
- delegate() {
3702
- return 'a[href^="#"]';
3703
- },
3790
+ self: true,
3704
3791
 
3705
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
3706
- if (!defaultPrevented && hash && !within(hash, this.$el)) {
3707
- this.hide(false);
3792
+ handler(e) {
3793
+ if (e.defaultPrevented) {
3794
+ return;
3708
3795
  }
3709
- } },
3710
3796
 
3797
+ e.preventDefault();
3711
3798
 
3712
- {
3713
- name: 'beforescroll',
3714
-
3715
- handler() {
3716
- this.hide(false);
3799
+ if (this.isToggled() === includes(active$1, this)) {
3800
+ this.toggle();
3801
+ }
3717
3802
  } },
3718
3803
 
3719
3804
 
3720
3805
  {
3721
- name: 'toggle',
3806
+ name: 'beforeshow',
3722
3807
 
3723
3808
  self: true,
3724
3809
 
3725
- handler(e, toggle) {
3726
- e.preventDefault();
3810
+ handler(e) {
3811
+ if (includes(active$1, this)) {
3812
+ return false;
3813
+ }
3727
3814
 
3728
- if (this.isToggled()) {
3729
- this.hide(false);
3815
+ if (!this.stack && active$1.length) {
3816
+ Promise.all(active$1.map((modal) => modal.hide())).then(this.show);
3817
+ e.preventDefault();
3730
3818
  } else {
3731
- this.show(toggle == null ? void 0 : toggle.$el, false);
3819
+ active$1.push(this);
3732
3820
  }
3733
3821
  } },
3734
3822
 
3735
3823
 
3736
3824
  {
3737
- name: 'toggleshow',
3825
+ name: 'show',
3738
3826
 
3739
3827
  self: true,
3740
3828
 
3741
- handler(e, toggle) {
3742
- e.preventDefault();
3743
- this.show(toggle == null ? void 0 : toggle.$el);
3744
- } },
3745
-
3746
-
3747
- {
3748
- name: 'togglehide',
3829
+ handler() {
3830
+ once(
3831
+ this.$el,
3832
+ 'hide',
3833
+ on(document, 'focusin', (e) => {
3834
+ if (last(active$1) === this && !within(e.target, this.$el)) {
3835
+ this.$el.focus();
3836
+ }
3837
+ }));
3749
3838
 
3750
- self: true,
3751
3839
 
3752
- handler(e) {
3753
- e.preventDefault();
3754
- if (!matches(this.$el, ':focus,:hover')) {
3755
- this.hide();
3840
+ if (this.overlay) {
3841
+ once(this.$el, 'hide', preventOverscroll(this.$el));
3842
+ once(this.$el, 'hide', preventBackgroundScroll());
3756
3843
  }
3757
- } },
3758
3844
 
3845
+ if (this.stack) {
3846
+ css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
3847
+ }
3759
3848
 
3760
- {
3761
- name: pointerEnter + " focusin",
3849
+ addClass(document.documentElement, this.clsPage);
3762
3850
 
3763
- filter() {
3764
- return includes(this.mode, 'hover');
3765
- },
3851
+ if (this.bgClose) {
3852
+ once(
3853
+ this.$el,
3854
+ 'hide',
3855
+ on(document, pointerDown, (_ref3) => {let { target } = _ref3;
3856
+ if (
3857
+ last(active$1) !== this ||
3858
+ this.overlay && !within(target, this.$el) ||
3859
+ within(target, this.panel))
3860
+ {
3861
+ return;
3862
+ }
3766
3863
 
3767
- handler(e) {
3768
- if (!isTouch(e)) {
3769
- this.clearTimers();
3770
- }
3771
- } },
3864
+ once(
3865
+ document,
3866
+ pointerUp + " " + pointerCancel + " scroll",
3867
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3868
+ if (
3869
+ !defaultPrevented &&
3870
+ type === pointerUp &&
3871
+ target === newTarget)
3872
+ {
3873
+ this.hide();
3874
+ }
3875
+ },
3876
+ true);
3772
3877
 
3878
+ }),
3879
+ { self: true });
3773
3880
 
3774
- {
3775
- name: pointerLeave + " focusout",
3881
+ }
3776
3882
 
3777
- filter() {
3778
- return includes(this.mode, 'hover');
3779
- },
3883
+ if (this.escClose) {
3884
+ once(
3885
+ this.$el,
3886
+ 'hide',
3887
+ on(document, 'keydown', (e) => {
3888
+ if (e.keyCode === 27 && last(active$1) === this) {
3889
+ this.hide();
3890
+ }
3891
+ }),
3892
+ { self: true });
3780
3893
 
3781
- handler(e) {
3782
- if (!isTouch(e) && e.relatedTarget) {
3783
- this.hide();
3894
+ }
3895
+ } },
3896
+
3897
+
3898
+ {
3899
+ name: 'shown',
3900
+
3901
+ self: true,
3902
+
3903
+ handler() {
3904
+ if (!isFocusable(this.$el)) {
3905
+ attr(this.$el, 'tabindex', '-1');
3906
+ }
3907
+
3908
+ if (!$(':focus', this.$el)) {
3909
+ this.$el.focus();
3910
+ }
3911
+ } },
3912
+
3913
+
3914
+ {
3915
+ name: 'hidden',
3916
+
3917
+ self: true,
3918
+
3919
+ handler() {
3920
+ if (includes(active$1, this)) {
3921
+ active$1.splice(active$1.indexOf(this), 1);
3922
+ }
3923
+
3924
+ if (!active$1.length) {
3925
+ css(document.body, 'overflowY', '');
3926
+ }
3927
+
3928
+ css(this.$el, 'zIndex', '');
3929
+
3930
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3931
+ removeClass(document.documentElement, this.clsPage);
3932
+ }
3933
+ } }],
3934
+
3935
+
3936
+
3937
+ methods: {
3938
+ toggle() {
3939
+ return this.isToggled() ? this.hide() : this.show();
3940
+ },
3941
+
3942
+ show() {
3943
+ if (this.container && parent(this.$el) !== this.container) {
3944
+ append(this.container, this.$el);
3945
+ return new Promise((resolve) =>
3946
+ requestAnimationFrame(() => this.show().then(resolve)));
3947
+
3948
+ }
3949
+
3950
+ return this.toggleElement(this.$el, true, animate(this));
3951
+ },
3952
+
3953
+ hide() {
3954
+ return this.toggleElement(this.$el, false, animate(this));
3955
+ } } };
3956
+
3957
+
3958
+
3959
+ function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
3960
+ return (el, show) =>
3961
+ new Promise((resolve, reject) =>
3962
+ once(el, 'show hide', () => {
3963
+ el._reject == null ? void 0 : el._reject();
3964
+ el._reject = reject;
3965
+
3966
+ _toggle(el, show);
3967
+
3968
+ const off = once(
3969
+ transitionElement,
3970
+ 'transitionstart',
3971
+ () => {
3972
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3973
+ self: true });
3974
+
3975
+ clearTimeout(timer);
3976
+ },
3977
+ { self: true });
3978
+
3979
+
3980
+ const timer = setTimeout(() => {
3981
+ off();
3982
+ resolve();
3983
+ }, toMs(css(transitionElement, 'transitionDuration')));
3984
+ })).
3985
+ then(() => delete el._reject);
3986
+ }
3987
+
3988
+ function toMs(time) {
3989
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3990
+ }
3991
+
3992
+ function preventOverscroll(el) {
3993
+ if (CSS.supports('overscroll-behavior', 'contain')) {
3994
+ const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
3995
+ css(elements, 'overscrollBehavior', 'contain');
3996
+ return () => css(elements, 'overscrollBehavior', '');
3997
+ }
3998
+
3999
+ let startClientY;
4000
+
4001
+ const events = [
4002
+ on(
4003
+ el,
4004
+ 'touchstart',
4005
+ (_ref6) => {let { targetTouches } = _ref6;
4006
+ if (targetTouches.length === 1) {
4007
+ startClientY = targetTouches[0].clientY;
4008
+ }
4009
+ },
4010
+ { passive: true }),
4011
+
4012
+
4013
+ on(
4014
+ el,
4015
+ 'touchmove',
4016
+ (e) => {
4017
+ if (e.targetTouches.length !== 1) {
4018
+ return;
4019
+ }
4020
+
4021
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
4022
+ if (!within(scrollParent, el)) {
4023
+ scrollParent = el;
4024
+ }
4025
+
4026
+ const clientY = e.targetTouches[0].clientY - startClientY;
4027
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
4028
+
4029
+ if (
4030
+ clientHeight >= scrollHeight ||
4031
+ scrollTop === 0 && clientY > 0 ||
4032
+ scrollHeight - scrollTop <= clientHeight && clientY < 0)
4033
+ {
4034
+ e.cancelable && e.preventDefault();
4035
+ }
4036
+ },
4037
+ { passive: false })];
4038
+
4039
+
4040
+
4041
+ return () => events.forEach((fn) => fn());
4042
+ }
4043
+
4044
+ function preventBackgroundScroll() {
4045
+ const { body, documentElement } = document;
4046
+ css(body, {
4047
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4048
+ touchAction: 'none' });
4049
+
4050
+ css(documentElement, 'overflowY', 'hidden');
4051
+ return () => {
4052
+ css(documentElement, 'overflowY', '');
4053
+ css(body, { overflowY: '', touchAction: '' });
4054
+ };
4055
+ }
4056
+
4057
+ function filterChildren(el, fn) {
4058
+ const children = [];
4059
+ apply(el, (node) => {
4060
+ if (fn(node)) {
4061
+ children.push(node);
4062
+ }
4063
+ });
4064
+ return children;
4065
+ }
4066
+
4067
+ let active;
4068
+
4069
+ var drop = {
4070
+ mixins: [Container, Lazyload, Position, Togglable],
4071
+
4072
+ args: 'pos',
4073
+
4074
+ props: {
4075
+ mode: 'list',
4076
+ toggle: Boolean,
4077
+ boundary: Boolean,
4078
+ boundaryAlign: Boolean,
4079
+ delayShow: Number,
4080
+ delayHide: Number,
4081
+ display: String,
4082
+ clsDrop: String,
4083
+ animateOut: Boolean,
4084
+ bgScroll: Boolean },
4085
+
4086
+
4087
+ data: {
4088
+ mode: ['click', 'hover'],
4089
+ toggle: '- *',
4090
+ boundary: true,
4091
+ boundaryAlign: false,
4092
+ delayShow: 0,
4093
+ delayHide: 800,
4094
+ display: null,
4095
+ clsDrop: false,
4096
+ animation: ['uk-animation-fade'],
4097
+ cls: 'uk-open',
4098
+ container: false,
4099
+ animateOut: false,
4100
+ bgScroll: true },
4101
+
4102
+
4103
+ created() {
4104
+ this.tracker = new MouseTracker();
4105
+ },
4106
+
4107
+ beforeConnect() {
4108
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4109
+ },
4110
+
4111
+ connected() {
4112
+ addClass(this.$el, this.clsDrop);
4113
+
4114
+ if (this.toggle && !this.target) {
4115
+ this.target = this.$create('toggle', query(this.toggle, this.$el), {
4116
+ target: this.$el,
4117
+ mode: this.mode }).
4118
+ $el;
4119
+ attr(this.target, 'aria-haspopup', true);
4120
+ this.lazyload(this.target);
4121
+ }
4122
+ },
4123
+
4124
+ disconnected() {
4125
+ if (this.isActive()) {
4126
+ active = null;
4127
+ }
4128
+ },
4129
+
4130
+ events: [
4131
+ {
4132
+ name: 'click',
4133
+
4134
+ delegate() {
4135
+ return "." + this.clsDrop + "-close";
4136
+ },
4137
+
4138
+ handler(e) {
4139
+ e.preventDefault();
4140
+ this.hide(false);
4141
+ } },
4142
+
4143
+
4144
+ {
4145
+ name: 'click',
4146
+
4147
+ delegate() {
4148
+ return 'a[href^="#"]';
4149
+ },
4150
+
4151
+ handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4152
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4153
+ this.hide(false);
4154
+ }
4155
+ } },
4156
+
4157
+
4158
+ {
4159
+ name: 'beforescroll',
4160
+
4161
+ handler() {
4162
+ this.hide(false);
4163
+ } },
4164
+
4165
+
4166
+ {
4167
+ name: 'toggle',
4168
+
4169
+ self: true,
4170
+
4171
+ handler(e, toggle) {
4172
+ e.preventDefault();
4173
+
4174
+ if (this.isToggled()) {
4175
+ this.hide(false);
4176
+ } else {
4177
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4178
+ }
4179
+ } },
4180
+
4181
+
4182
+ {
4183
+ name: 'toggleshow',
4184
+
4185
+ self: true,
4186
+
4187
+ handler(e, toggle) {
4188
+ e.preventDefault();
4189
+ this.show(toggle == null ? void 0 : toggle.$el);
4190
+ } },
4191
+
4192
+
4193
+ {
4194
+ name: 'togglehide',
4195
+
4196
+ self: true,
4197
+
4198
+ handler(e) {
4199
+ e.preventDefault();
4200
+ if (!matches(this.$el, ':focus,:hover')) {
4201
+ this.hide();
4202
+ }
4203
+ } },
4204
+
4205
+
4206
+ {
4207
+ name: pointerEnter + " focusin",
4208
+
4209
+ filter() {
4210
+ return includes(this.mode, 'hover');
4211
+ },
4212
+
4213
+ handler(e) {
4214
+ if (!isTouch(e)) {
4215
+ this.clearTimers();
4216
+ }
4217
+ } },
4218
+
4219
+
4220
+ {
4221
+ name: pointerLeave + " focusout",
4222
+
4223
+ filter() {
4224
+ return includes(this.mode, 'hover');
4225
+ },
4226
+
4227
+ handler(e) {
4228
+ if (!isTouch(e) && e.relatedTarget) {
4229
+ this.hide();
3784
4230
  }
3785
4231
  } },
3786
4232
 
@@ -3806,7 +4252,7 @@
3806
4252
  self: true,
3807
4253
 
3808
4254
  handler() {
3809
- active$1 = this;
4255
+ active = this;
3810
4256
 
3811
4257
  this.tracker.init();
3812
4258
 
@@ -3839,7 +4285,11 @@
3839
4285
  }
3840
4286
  }),
3841
4287
 
3842
- ...(this.display === 'static' ?
4288
+ ...(this.bgScroll ?
4289
+ [] :
4290
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4291
+
4292
+ ...(this.display === 'static' && this.align !== 'stretch' ?
3843
4293
  [] :
3844
4294
  (() => {
3845
4295
  const handler = () => this.$emit();
@@ -3876,14 +4326,14 @@
3876
4326
 
3877
4327
  handler(_ref4) {let { target } = _ref4;
3878
4328
  if (this.$el !== target) {
3879
- active$1 =
3880
- active$1 === null && within(target, this.$el) && this.isToggled() ?
4329
+ active =
4330
+ active === null && within(target, this.$el) && this.isToggled() ?
3881
4331
  this :
3882
- active$1;
4332
+ active;
3883
4333
  return;
3884
4334
  }
3885
4335
 
3886
- active$1 = this.isActive() ? null : active$1;
4336
+ active = this.isActive() ? null : active;
3887
4337
  this.tracker.cancel();
3888
4338
  } }],
3889
4339
 
@@ -3900,7 +4350,7 @@
3900
4350
  methods: {
3901
4351
  show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
3902
4352
  if (this.isToggled() && target && this.target && target !== this.target) {
3903
- this.hide(false);
4353
+ this.hide(false, false);
3904
4354
  }
3905
4355
 
3906
4356
  this.target = target;
@@ -3911,16 +4361,16 @@
3911
4361
  return;
3912
4362
  }
3913
4363
 
3914
- if (active$1) {
3915
- if (delay && active$1.isDelaying) {
4364
+ if (active) {
4365
+ if (delay && active.isDelaying) {
3916
4366
  this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
3917
4367
  return;
3918
4368
  }
3919
4369
 
3920
4370
  let prev;
3921
- while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
3922
- prev = active$1;
3923
- active$1.hide(false);
4371
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4372
+ prev = active;
4373
+ active.hide(false, false);
3924
4374
  }
3925
4375
  }
3926
4376
 
@@ -3934,8 +4384,8 @@
3934
4384
 
3935
4385
  },
3936
4386
 
3937
- hide(delay) {if (delay === void 0) {delay = true;}
3938
- const hide = () => this.toggleElement(this.$el, false, false);
4387
+ hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
4388
+ const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
3939
4389
 
3940
4390
  this.clearTimers();
3941
4391
 
@@ -3961,34 +4411,57 @@
3961
4411
  },
3962
4412
 
3963
4413
  isActive() {
3964
- return active$1 === this;
4414
+ return active === this;
3965
4415
  },
3966
4416
 
3967
4417
  position() {
3968
4418
  removeClass(this.$el, this.clsDrop + "-stack");
3969
4419
  toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4420
+ toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
3970
4421
 
3971
4422
  const boundary = query(this.boundary, this.$el);
3972
- const scrollParentOffset = offset(
3973
- scrollParents(boundary && this.boundaryAlign ? boundary : this.$el)[0]);
4423
+ const target = boundary && this.boundaryAlign ? boundary : this.target;
4424
+ const [scrollParent] = scrollParents(
4425
+ boundary && this.boundaryAlign ? boundary : this.$el);
3974
4426
 
4427
+ const scrollParentOffset = offset(scrollParent);
3975
4428
  const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4429
+ const viewportOffset = this.getViewportOffset(this.$el);
3976
4430
 
3977
4431
  css(this.$el, 'maxWidth', '');
3978
- const maxWidth =
3979
- scrollParentOffset.width -
3980
- 2 * toPx(getCssVar('position-viewport-offset', this.$el));
4432
+ const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
3981
4433
 
3982
- if (this.pos[1] === 'justify') {
4434
+ if (this.align === 'justify') {
3983
4435
  const prop = this.axis === 'y' ? 'width' : 'height';
3984
4436
  css(
3985
4437
  this.$el,
3986
4438
  prop,
3987
4439
  Math.min(
3988
4440
  (boundary ? boundaryOffset : offset(this.target))[prop],
3989
- scrollParentOffset[prop] -
3990
- 2 * toPx(getCssVar('position-viewport-offset', this.$el))));
3991
-
4441
+ scrollParentOffset[prop] - 2 * viewportOffset));
4442
+
4443
+
4444
+ } else if (this.align === 'stretch') {
4445
+ this.flip = this.axis === 'y' ? 'x' : 'y';
4446
+ this.display = 'static';
4447
+
4448
+ const viewport = offsetViewport(scrollParent);
4449
+ const targetDim = offset(target);
4450
+ const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4451
+
4452
+ css(this.$el, {
4453
+ width:
4454
+ this.axis === 'y' ?
4455
+ viewport.width :
4456
+ (this.dir === 'left' ?
4457
+ targetDim.left - viewport.left :
4458
+ viewport.right - targetDim.right) - elOffset,
4459
+ height:
4460
+ this.axis === 'x' ?
4461
+ viewport.height :
4462
+ (this.dir === 'top' ?
4463
+ targetDim.top - viewport.top :
4464
+ viewport.bottom - targetDim.bottom) - elOffset });
3992
4465
 
3993
4466
  } else if (this.$el.offsetWidth > maxWidth) {
3994
4467
  addClass(this.$el, this.clsDrop + "-stack");
@@ -3996,11 +4469,7 @@
3996
4469
 
3997
4470
  css(this.$el, 'maxWidth', maxWidth);
3998
4471
 
3999
- this.positionAt(
4000
- this.$el,
4001
- boundary && this.boundaryAlign ? boundary : this.target,
4002
- boundary);
4003
-
4472
+ this.positionAt(this.$el, target, boundary);
4004
4473
  } } };
4005
4474
 
4006
4475
 
@@ -4485,7 +4954,7 @@
4485
4954
 
4486
4955
  resizeTargets() {
4487
4956
  // check for offsetTop change
4488
- return [this.$el, document.documentElement];
4957
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4489
4958
  },
4490
4959
 
4491
4960
  update: {
@@ -4497,21 +4966,29 @@
4497
4966
  let minHeight = '';
4498
4967
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4499
4968
 
4969
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4970
+ const { height: viewportHeight } = offsetViewport(scrollElement);
4971
+
4500
4972
  if (this.expand) {
4501
4973
  minHeight = Math.max(
4502
- height(window) - (
4503
- dimensions(document.documentElement).height -
4504
- dimensions(this.$el).height) -
4974
+ viewportHeight - (
4975
+ dimensions(scrollElement).height - dimensions(this.$el).height) -
4505
4976
  box,
4506
4977
  0);
4507
4978
 
4508
4979
  } else {
4980
+ const isScrollingElement = document.scrollingElement === scrollElement;
4981
+
4509
4982
  // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4510
- minHeight = 'calc(100vh';
4983
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
4511
4984
 
4512
4985
  if (this.offsetTop) {
4513
- const { top } = offset(this.$el);
4514
- minHeight += top > 0 && top < height(window) / 2 ? " - " + top + "px" : '';
4986
+ if (isScrollingElement) {
4987
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4988
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4989
+ } else {
4990
+ minHeight += " - " + css(scrollElement, 'paddingTop');
4991
+ }
4515
4992
  }
4516
4993
 
4517
4994
  if (this.offsetBottom === true) {
@@ -5029,410 +5506,159 @@
5029
5506
  attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5030
5507
  }
5031
5508
  });
5032
- }
5033
-
5034
- function getImageFromElement(el, src, sources) {
5035
- const img = new Image();
5036
-
5037
- wrapInPicture(img, sources);
5038
- setSourceProps(el, img);
5039
- img.onload = () => {
5040
- setSrcAttrs(el, img.currentSrc);
5041
- };
5042
- attr(img, 'src', src);
5043
- return img;
5044
- }
5045
-
5046
- function wrapInPicture(img, sources) {
5047
- sources = parseSources(sources);
5048
-
5049
- if (sources.length) {
5050
- const picture = fragment('<picture>');
5051
- for (const attrs of sources) {
5052
- const source = fragment('<source>');
5053
- attr(source, attrs);
5054
- append(picture, source);
5055
- }
5056
- append(picture, img);
5057
- }
5058
- }
5059
-
5060
- function parseSources(sources) {
5061
- if (!sources) {
5062
- return [];
5063
- }
5064
-
5065
- if (startsWith(sources, '[')) {
5066
- try {
5067
- sources = JSON.parse(sources);
5068
- } catch (e) {
5069
- sources = [];
5070
- }
5071
- } else {
5072
- sources = parseOptions(sources);
5073
- }
5074
-
5075
- if (!isArray(sources)) {
5076
- sources = [sources];
5077
- }
5078
-
5079
- return sources.filter((source) => !isEmpty(source));
5080
- }
5081
-
5082
- function ensureSrcAttribute(el) {
5083
- if (isImg(el) && !hasAttr(el, 'src')) {
5084
- attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5085
- }
5086
- }
5087
-
5088
- function isPicture(el) {
5089
- return isTag(el, 'picture');
5090
- }
5091
-
5092
- function isImg(el) {
5093
- return isTag(el, 'img');
5094
- }
5095
-
5096
- var Media = {
5097
- props: {
5098
- media: Boolean },
5099
-
5100
-
5101
- data: {
5102
- media: false },
5103
-
5104
-
5105
- connected() {
5106
- const media = toMedia(this.media);
5107
- this.matchMedia = true;
5108
- if (media) {
5109
- this.mediaObj = window.matchMedia(media);
5110
- const handler = () => {
5111
- this.matchMedia = this.mediaObj.matches;
5112
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5113
- };
5114
- this.offMediaObj = on(this.mediaObj, 'change', () => {
5115
- handler();
5116
- this.$emit('resize');
5117
- });
5118
- handler();
5119
- }
5120
- },
5121
-
5122
- disconnected() {var _this$offMediaObj;
5123
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5124
- } };
5125
-
5126
-
5127
- function toMedia(value) {
5128
- if (isString(value)) {
5129
- if (startsWith(value, '@')) {
5130
- const name = "breakpoint-" + value.substr(1);
5131
- value = toFloat(getCssVar(name));
5132
- } else if (isNaN(value)) {
5133
- return value;
5134
- }
5135
- }
5136
-
5137
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5138
- }
5139
-
5140
- var leader = {
5141
- mixins: [Class, Media, Resize],
5142
-
5143
- props: {
5144
- fill: String },
5145
-
5146
-
5147
- data: {
5148
- fill: '',
5149
- clsWrapper: 'uk-leader-fill',
5150
- clsHide: 'uk-leader-hide',
5151
- attrFill: 'data-fill' },
5152
-
5153
-
5154
- computed: {
5155
- fill(_ref) {let { fill } = _ref;
5156
- return fill || getCssVar('leader-fill-content');
5157
- } },
5158
-
5159
-
5160
- connected() {
5161
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5162
- },
5163
-
5164
- disconnected() {
5165
- unwrap(this.wrapper.childNodes);
5166
- },
5167
-
5168
- update: {
5169
- read() {
5170
- const width = Math.trunc(this.$el.offsetWidth / 2);
5171
-
5172
- return {
5173
- width,
5174
- fill: this.fill,
5175
- hide: !this.matchMedia };
5176
-
5177
- },
5178
-
5179
- write(_ref2) {let { width, fill, hide } = _ref2;
5180
- toggleClass(this.wrapper, this.clsHide, hide);
5181
- attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5182
- },
5183
-
5184
- events: ['resize'] } };
5185
-
5186
- const active = [];
5187
-
5188
- var Modal = {
5189
- mixins: [Class, Container, Togglable],
5190
-
5191
- props: {
5192
- selPanel: String,
5193
- selClose: String,
5194
- escClose: Boolean,
5195
- bgClose: Boolean,
5196
- stack: Boolean },
5197
-
5198
-
5199
- data: {
5200
- cls: 'uk-open',
5201
- escClose: true,
5202
- bgClose: true,
5203
- overlay: true,
5204
- stack: false },
5205
-
5206
-
5207
- computed: {
5208
- panel(_ref, $el) {let { selPanel } = _ref;
5209
- return $(selPanel, $el);
5210
- },
5211
-
5212
- transitionElement() {
5213
- return this.panel;
5214
- },
5215
-
5216
- bgClose(_ref2) {let { bgClose } = _ref2;
5217
- return bgClose && this.panel;
5218
- } },
5219
-
5220
-
5221
- beforeDisconnect() {
5222
- if (includes(active, this)) {
5223
- this.toggleElement(this.$el, false, false);
5224
- }
5225
- },
5226
-
5227
- events: [
5228
- {
5229
- name: 'click',
5230
-
5231
- delegate() {
5232
- return this.selClose;
5233
- },
5234
-
5235
- handler(e) {
5236
- e.preventDefault();
5237
- this.hide();
5238
- } },
5239
-
5240
-
5241
- {
5242
- name: 'toggle',
5243
-
5244
- self: true,
5245
-
5246
- handler(e) {
5247
- if (e.defaultPrevented) {
5248
- return;
5249
- }
5250
-
5251
- e.preventDefault();
5252
-
5253
- if (this.isToggled() === includes(active, this)) {
5254
- this.toggle();
5255
- }
5256
- } },
5257
-
5258
-
5259
- {
5260
- name: 'beforeshow',
5261
-
5262
- self: true,
5263
-
5264
- handler(e) {
5265
- if (includes(active, this)) {
5266
- return false;
5267
- }
5268
-
5269
- if (!this.stack && active.length) {
5270
- Promise.all(active.map((modal) => modal.hide())).then(this.show);
5271
- e.preventDefault();
5272
- } else {
5273
- active.push(this);
5274
- }
5275
- } },
5276
-
5277
-
5278
- {
5279
- name: 'show',
5280
-
5281
- self: true,
5282
-
5283
- handler() {
5284
- const docEl = document.documentElement;
5285
-
5286
- if (width(window) > docEl.clientWidth && this.overlay) {
5287
- css(document.body, 'overflowY', 'scroll');
5288
- }
5289
-
5290
- if (this.stack) {
5291
- css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
5292
- }
5509
+ }
5293
5510
 
5294
- addClass(docEl, this.clsPage);
5511
+ function getImageFromElement(el, src, sources) {
5512
+ const img = new Image();
5295
5513
 
5296
- if (this.bgClose) {
5297
- once(
5298
- this.$el,
5299
- 'hide',
5300
- on(document, pointerDown, (_ref3) => {let { target } = _ref3;
5301
- if (
5302
- last(active) !== this ||
5303
- this.overlay && !within(target, this.$el) ||
5304
- within(target, this.panel))
5305
- {
5306
- return;
5307
- }
5514
+ wrapInPicture(img, sources);
5515
+ setSourceProps(el, img);
5516
+ img.onload = () => {
5517
+ setSrcAttrs(el, img.currentSrc);
5518
+ };
5519
+ attr(img, 'src', src);
5520
+ return img;
5521
+ }
5308
5522
 
5309
- once(
5310
- document,
5311
- pointerUp + " " + pointerCancel + " scroll",
5312
- (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
5313
- if (
5314
- !defaultPrevented &&
5315
- type === pointerUp &&
5316
- target === newTarget)
5317
- {
5318
- this.hide();
5319
- }
5320
- },
5321
- true);
5523
+ function wrapInPicture(img, sources) {
5524
+ sources = parseSources(sources);
5322
5525
 
5323
- }),
5324
- { self: true });
5526
+ if (sources.length) {
5527
+ const picture = fragment('<picture>');
5528
+ for (const attrs of sources) {
5529
+ const source = fragment('<source>');
5530
+ attr(source, attrs);
5531
+ append(picture, source);
5532
+ }
5533
+ append(picture, img);
5534
+ }
5535
+ }
5325
5536
 
5326
- }
5537
+ function parseSources(sources) {
5538
+ if (!sources) {
5539
+ return [];
5540
+ }
5327
5541
 
5328
- if (this.escClose) {
5329
- once(
5330
- this.$el,
5331
- 'hide',
5332
- on(document, 'keydown', (e) => {
5333
- if (e.keyCode === 27 && last(active) === this) {
5334
- this.hide();
5335
- }
5336
- }),
5337
- { self: true });
5542
+ if (startsWith(sources, '[')) {
5543
+ try {
5544
+ sources = JSON.parse(sources);
5545
+ } catch (e) {
5546
+ sources = [];
5547
+ }
5548
+ } else {
5549
+ sources = parseOptions(sources);
5550
+ }
5338
5551
 
5339
- }
5340
- } },
5552
+ if (!isArray(sources)) {
5553
+ sources = [sources];
5554
+ }
5341
5555
 
5556
+ return sources.filter((source) => !isEmpty(source));
5557
+ }
5342
5558
 
5343
- {
5344
- name: 'shown',
5559
+ function ensureSrcAttribute(el) {
5560
+ if (isImg(el) && !hasAttr(el, 'src')) {
5561
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5562
+ }
5563
+ }
5345
5564
 
5346
- self: true,
5565
+ function isPicture(el) {
5566
+ return isTag(el, 'picture');
5567
+ }
5347
5568
 
5348
- handler() {
5349
- if (!isFocusable(this.$el)) {
5350
- attr(this.$el, 'tabindex', '-1');
5351
- }
5569
+ function isImg(el) {
5570
+ return isTag(el, 'img');
5571
+ }
5352
5572
 
5353
- if (!$(':focus', this.$el)) {
5354
- this.$el.focus();
5355
- }
5356
- } },
5573
+ var Media = {
5574
+ props: {
5575
+ media: Boolean },
5357
5576
 
5358
5577
 
5359
- {
5360
- name: 'hidden',
5578
+ data: {
5579
+ media: false },
5361
5580
 
5362
- self: true,
5363
5581
 
5364
- handler() {
5365
- if (includes(active, this)) {
5366
- active.splice(active.indexOf(this), 1);
5367
- }
5582
+ connected() {
5583
+ const media = toMedia(this.media);
5584
+ this.matchMedia = true;
5585
+ if (media) {
5586
+ this.mediaObj = window.matchMedia(media);
5587
+ const handler = () => {
5588
+ this.matchMedia = this.mediaObj.matches;
5589
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5590
+ };
5591
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5592
+ handler();
5593
+ this.$emit('resize');
5594
+ });
5595
+ handler();
5596
+ }
5597
+ },
5368
5598
 
5369
- if (!active.length) {
5370
- css(document.body, 'overflowY', '');
5371
- }
5599
+ disconnected() {var _this$offMediaObj;
5600
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5601
+ } };
5372
5602
 
5373
- css(this.$el, 'zIndex', '');
5374
5603
 
5375
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5376
- removeClass(document.documentElement, this.clsPage);
5377
- }
5378
- } }],
5604
+ function toMedia(value) {
5605
+ if (isString(value)) {
5606
+ if (startsWith(value, '@')) {
5607
+ const name = "breakpoint-" + value.substr(1);
5608
+ value = toFloat(getCssVar(name));
5609
+ } else if (isNaN(value)) {
5610
+ return value;
5611
+ }
5612
+ }
5379
5613
 
5614
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5615
+ }
5380
5616
 
5617
+ var leader = {
5618
+ mixins: [Class, Media, Resize],
5381
5619
 
5382
- methods: {
5383
- toggle() {
5384
- return this.isToggled() ? this.hide() : this.show();
5385
- },
5620
+ props: {
5621
+ fill: String },
5386
5622
 
5387
- show() {
5388
- if (this.container && parent(this.$el) !== this.container) {
5389
- append(this.container, this.$el);
5390
- return new Promise((resolve) =>
5391
- requestAnimationFrame(() => this.show().then(resolve)));
5392
5623
 
5393
- }
5624
+ data: {
5625
+ fill: '',
5626
+ clsWrapper: 'uk-leader-fill',
5627
+ clsHide: 'uk-leader-hide',
5628
+ attrFill: 'data-fill' },
5394
5629
 
5395
- return this.toggleElement(this.$el, true, animate(this));
5396
- },
5397
5630
 
5398
- hide() {
5399
- return this.toggleElement(this.$el, false, animate(this));
5400
- } } };
5631
+ computed: {
5632
+ fill(_ref) {let { fill } = _ref;
5633
+ return fill || getCssVar('leader-fill-content');
5634
+ } },
5401
5635
 
5402
5636
 
5637
+ connected() {
5638
+ [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5639
+ },
5403
5640
 
5404
- function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
5405
- return (el, show) =>
5406
- new Promise((resolve, reject) =>
5407
- once(el, 'show hide', () => {
5408
- el._reject == null ? void 0 : el._reject();
5409
- el._reject = reject;
5641
+ disconnected() {
5642
+ unwrap(this.wrapper.childNodes);
5643
+ },
5410
5644
 
5411
- _toggle(el, show);
5645
+ update: {
5646
+ read() {
5647
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5412
5648
 
5413
- const off = once(
5414
- transitionElement,
5415
- 'transitionstart',
5416
- () => {
5417
- once(transitionElement, 'transitionend transitioncancel', resolve, {
5418
- self: true });
5649
+ return {
5650
+ width,
5651
+ fill: this.fill,
5652
+ hide: !this.matchMedia };
5419
5653
 
5420
- clearTimeout(timer);
5421
5654
  },
5422
- { self: true });
5423
-
5424
5655
 
5425
- const timer = setTimeout(() => {
5426
- off();
5427
- resolve();
5428
- }, toMs(css(transitionElement, 'transitionDuration')));
5429
- })).
5430
- then(() => delete el._reject);
5431
- }
5656
+ write(_ref2) {let { width, fill, hide } = _ref2;
5657
+ toggleClass(this.wrapper, this.clsHide, hide);
5658
+ attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5659
+ },
5432
5660
 
5433
- function toMs(time) {
5434
- return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5435
- }
5661
+ events: ['resize'] } };
5436
5662
 
5437
5663
  var modal = {
5438
5664
  install,
@@ -5845,8 +6071,8 @@
5845
6071
  return this.dropbar;
5846
6072
  },
5847
6073
 
5848
- handler(_, _ref9) {let { $el } = _ref9;
5849
- if (!hasClass($el, this.clsDrop)) {
6074
+ handler(_, _ref9) {let { $el, align } = _ref9;
6075
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5850
6076
  return;
5851
6077
  }
5852
6078
 
@@ -5869,8 +6095,8 @@
5869
6095
  return this.dropbar;
5870
6096
  },
5871
6097
 
5872
- handler(_, _ref10) {let { $el } = _ref10;
5873
- if (!hasClass($el, this.clsDrop)) {
6098
+ handler(_, _ref10) {let { $el, align } = _ref10;
6099
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5874
6100
  return;
5875
6101
  }
5876
6102
 
@@ -5920,8 +6146,8 @@
5920
6146
  return this.dropbar;
5921
6147
  },
5922
6148
 
5923
- handler(_, _ref12) {let { $el } = _ref12;
5924
- if (!hasClass($el, this.clsDrop)) {
6149
+ handler(_, _ref12) {let { $el, align } = _ref12;
6150
+ if (!hasClass($el, this.clsDrop) || align === 'stretch') {
5925
6151
  return;
5926
6152
  }
5927
6153
 
@@ -5938,7 +6164,7 @@
5938
6164
 
5939
6165
  methods: {
5940
6166
  getActive() {
5941
- return active$1 && within(active$1.target, this.$el) && active$1;
6167
+ return active && within(active.target, this.$el) && active;
5942
6168
  },
5943
6169
 
5944
6170
  transitionTo(newHeight, el) {
@@ -5947,7 +6173,7 @@
5947
6173
 
5948
6174
  el = oldHeight < newHeight && el;
5949
6175
 
5950
- css(el, 'clip', "rect(0," + el.offsetWidth + "px," + oldHeight + "px,0)");
6176
+ css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
5951
6177
 
5952
6178
  height(dropbar, oldHeight);
5953
6179
 
@@ -5956,12 +6182,14 @@
5956
6182
  Transition.start(dropbar, { height: newHeight }, this.duration),
5957
6183
  Transition.start(
5958
6184
  el,
5959
- { clip: "rect(0," + el.offsetWidth + "px," + newHeight + "px,0)" },
6185
+ {
6186
+ clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
6187
+
5960
6188
  this.duration)]).
5961
6189
 
5962
6190
 
5963
6191
  catch(noop).
5964
- then(() => css(el, { clip: '' }));
6192
+ then(() => css(el, { clipPath: '' }));
5965
6193
  },
5966
6194
 
5967
6195
  getDropdown(el) {
@@ -6146,22 +6374,6 @@
6146
6374
  } },
6147
6375
 
6148
6376
 
6149
- {
6150
- name: 'touchstart',
6151
-
6152
- passive: true,
6153
-
6154
- el() {
6155
- return this.panel;
6156
- },
6157
-
6158
- handler(_ref8) {let { targetTouches } = _ref8;
6159
- if (targetTouches.length === 1) {
6160
- this.clientY = targetTouches[0].clientY;
6161
- }
6162
- } },
6163
-
6164
-
6165
6377
  {
6166
6378
  name: 'touchmove',
6167
6379
 
@@ -6177,33 +6389,6 @@
6177
6389
  } },
6178
6390
 
6179
6391
 
6180
- {
6181
- name: 'touchmove',
6182
-
6183
- passive: false,
6184
-
6185
- el() {
6186
- return this.panel;
6187
- },
6188
-
6189
- handler(e) {
6190
- if (e.targetTouches.length !== 1) {
6191
- return;
6192
- }
6193
-
6194
- const clientY = e.targetTouches[0].clientY - this.clientY;
6195
- const { scrollTop, scrollHeight, clientHeight } = this.panel;
6196
-
6197
- if (
6198
- clientHeight >= scrollHeight ||
6199
- scrollTop === 0 && clientY > 0 ||
6200
- scrollHeight - scrollTop <= clientHeight && clientY < 0)
6201
- {
6202
- e.cancelable && e.preventDefault();
6203
- }
6204
- } },
6205
-
6206
-
6207
6392
  {
6208
6393
  name: 'show',
6209
6394
 
@@ -6215,7 +6400,6 @@
6215
6400
  addClass(parent(this.panel), this.clsMode);
6216
6401
  }
6217
6402
 
6218
- css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
6219
6403
  addClass(document.body, this.clsContainer, this.clsFlip);
6220
6404
  css(document.body, 'touch-action', 'pan-y pinch-zoom');
6221
6405
  css(this.$el, 'display', 'block');
@@ -6223,7 +6407,7 @@
6223
6407
  addClass(
6224
6408
  this.panel,
6225
6409
  this.clsSidebarAnimation,
6226
- this.mode !== 'reveal' ? this.clsMode : '');
6410
+ this.mode === 'reveal' ? '' : this.clsMode);
6227
6411
 
6228
6412
 
6229
6413
  height(document.body); // force reflow
@@ -6260,8 +6444,6 @@
6260
6444
  removeClass(this.$el, this.clsOverlay);
6261
6445
  css(this.$el, 'display', '');
6262
6446
  removeClass(document.body, this.clsContainer, this.clsFlip);
6263
-
6264
- css(document.documentElement, 'overflowY', '');
6265
6447
  } },
6266
6448
 
6267
6449
 
@@ -6737,7 +6919,9 @@
6737
6919
  },
6738
6920
 
6739
6921
  handler() {
6740
- if (!location.hash || scrollTop(window) === 0) {
6922
+ const { scrollingElement } = document;
6923
+
6924
+ if (!location.hash || scrollingElement.scrollTop === 0) {
6741
6925
  return;
6742
6926
  }
6743
6927
 
@@ -6746,13 +6930,11 @@
6746
6930
  const elOffset = offset(this.$el);
6747
6931
 
6748
6932
  if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6749
- scrollTop(
6750
- window,
6933
+ scrollingElement.scrollTop =
6751
6934
  targetOffset.top -
6752
6935
  elOffset.height -
6753
6936
  toPx(this.targetOffset, 'height', this.placeholder) -
6754
- toPx(this.offset, 'height', this.placeholder));
6755
-
6937
+ toPx(this.offset, 'height', this.placeholder);
6756
6938
  }
6757
6939
  });
6758
6940
  } }],
@@ -6850,7 +7032,7 @@
6850
7032
 
6851
7033
 
6852
7034
  {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref4;
6853
- const scroll = scrollTop(window);
7035
+ const scroll = document.scrollingElement.scrollTop;
6854
7036
  const dir = prevScroll <= scroll ? 'down' : 'up';
6855
7037
 
6856
7038
  return {
@@ -7066,7 +7248,7 @@
7066
7248
 
7067
7249
  watch(connects) {
7068
7250
  if (this.swiping) {
7069
- css(connects, 'touch-action', 'pan-y pinch-zoom');
7251
+ css(connects, 'touchAction', 'pan-y pinch-zoom');
7070
7252
  }
7071
7253
 
7072
7254
  const index = this.index();