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
package/dist/js/uikit.js CHANGED
@@ -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
  }
@@ -1292,9 +1293,9 @@
1292
1293
  const hasTouch = inBrowser && 'ontouchstart' in window;
1293
1294
  const hasPointerEvents = inBrowser && window.PointerEvent;
1294
1295
 
1295
- const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1296
- const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1297
- const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
1296
+ const pointerDown$1 = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1297
+ const pointerMove$1 = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1298
+ const pointerUp$1 = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
1298
1299
  const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
1299
1300
  const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
1300
1301
  const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
@@ -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
 
@@ -2193,9 +2193,9 @@
2193
2193
  inBrowser: inBrowser,
2194
2194
  isRtl: isRtl,
2195
2195
  hasTouch: hasTouch,
2196
- pointerDown: pointerDown,
2197
- pointerMove: pointerMove,
2198
- pointerUp: pointerUp,
2196
+ pointerDown: pointerDown$1,
2197
+ pointerMove: pointerMove$1,
2198
+ pointerUp: pointerUp$1,
2199
2199
  pointerEnter: pointerEnter,
2200
2200
  pointerLeave: pointerLeave,
2201
2201
  pointerCancel: pointerCancel,
@@ -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$1(cmp);
3186
+ }
3187
+
3188
+ function slide$1(_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$1(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$1(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,1753 +3775,1890 @@
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$1, (_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$1 + " " + pointerCancel + " scroll",
3867
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3868
+ if (
3869
+ !defaultPrevented &&
3870
+ type === pointerUp$1 &&
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();
3784
3894
  }
3785
3895
  } },
3786
3896
 
3787
3897
 
3788
3898
  {
3789
- name: 'toggled',
3790
-
3791
- self: true,
3792
-
3793
- handler(e, toggled) {
3794
- if (!toggled) {
3795
- return;
3796
- }
3797
-
3798
- this.clearTimers();
3799
- this.position();
3800
- } },
3801
-
3802
-
3803
- {
3804
- name: 'show',
3899
+ name: 'shown',
3805
3900
 
3806
3901
  self: true,
3807
3902
 
3808
3903
  handler() {
3809
- active$1 = this;
3810
-
3811
- this.tracker.init();
3812
-
3813
- for (const handler of [
3814
- on(
3815
- document,
3816
- pointerDown,
3817
- (_ref2) => {let { target } = _ref2;return (
3818
- !within(target, this.$el) &&
3819
- once(
3820
- document,
3821
- pointerUp + " " + pointerCancel + " scroll",
3822
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
3823
- if (
3824
- !defaultPrevented &&
3825
- type === pointerUp &&
3826
- target === newTarget &&
3827
- !(this.target && within(target, this.target)))
3828
- {
3829
- this.hide(false);
3830
- }
3831
- },
3832
- true));}),
3833
-
3834
-
3835
-
3836
- on(document, 'keydown', (e) => {
3837
- if (e.keyCode === 27) {
3838
- this.hide(false);
3839
- }
3840
- }),
3841
-
3842
- ...(this.display === 'static' ?
3843
- [] :
3844
- (() => {
3845
- const handler = () => this.$emit();
3846
- return [
3847
- on(window, 'resize', handler),
3848
- on(document, 'scroll', handler, true),
3849
- (() => {
3850
- const observer = observeResize(
3851
- scrollParents(this.$el),
3852
- handler);
3853
-
3854
- return () => observer.disconnect();
3855
- })()];
3904
+ if (!isFocusable(this.$el)) {
3905
+ attr(this.$el, 'tabindex', '-1');
3906
+ }
3856
3907
 
3857
- })())])
3858
- {
3859
- once(this.$el, 'hide', handler, { self: true });
3908
+ if (!$(':focus', this.$el)) {
3909
+ this.$el.focus();
3860
3910
  }
3861
3911
  } },
3862
3912
 
3863
3913
 
3864
3914
  {
3865
- name: 'beforehide',
3915
+ name: 'hidden',
3866
3916
 
3867
3917
  self: true,
3868
3918
 
3869
3919
  handler() {
3870
- this.clearTimers();
3871
- } },
3920
+ if (includes(active$1, this)) {
3921
+ active$1.splice(active$1.indexOf(this), 1);
3922
+ }
3872
3923
 
3924
+ if (!active$1.length) {
3925
+ css(document.body, 'overflowY', '');
3926
+ }
3873
3927
 
3874
- {
3875
- name: 'hide',
3928
+ css(this.$el, 'zIndex', '');
3876
3929
 
3877
- handler(_ref4) {let { target } = _ref4;
3878
- if (this.$el !== target) {
3879
- active$1 =
3880
- active$1 === null && within(target, this.$el) && this.isToggled() ?
3881
- this :
3882
- active$1;
3883
- return;
3930
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3931
+ removeClass(document.documentElement, this.clsPage);
3884
3932
  }
3885
-
3886
- active$1 = this.isActive() ? null : active$1;
3887
- this.tracker.cancel();
3888
3933
  } }],
3889
3934
 
3890
3935
 
3891
3936
 
3892
- update: {
3893
- write() {
3894
- if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
3895
- this.position();
3896
- }
3897
- } },
3898
-
3899
-
3900
3937
  methods: {
3901
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
3902
- if (this.isToggled() && target && this.target && target !== this.target) {
3903
- this.hide(false);
3904
- }
3905
-
3906
- this.target = target;
3938
+ toggle() {
3939
+ return this.isToggled() ? this.hide() : this.show();
3940
+ },
3907
3941
 
3908
- this.clearTimers();
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)));
3909
3947
 
3910
- if (this.isActive()) {
3911
- return;
3912
3948
  }
3913
3949
 
3914
- if (active$1) {
3915
- if (delay && active$1.isDelaying) {
3916
- this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
3917
- return;
3918
- }
3950
+ return this.toggleElement(this.$el, true, animate(this));
3951
+ },
3919
3952
 
3920
- let prev;
3921
- while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
3922
- prev = active$1;
3923
- active$1.hide(false);
3924
- }
3925
- }
3953
+ hide() {
3954
+ return this.toggleElement(this.$el, false, animate(this));
3955
+ } } };
3926
3956
 
3927
- if (this.container && parent(this.$el) !== this.container) {
3928
- append(this.container, this.$el);
3929
- }
3930
3957
 
3931
- this.showTimer = setTimeout(
3932
- () => this.toggleElement(this.$el, true),
3933
- delay && this.delayShow || 0);
3934
3958
 
3935
- },
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;
3936
3965
 
3937
- hide(delay) {if (delay === void 0) {delay = true;}
3938
- const hide = () => this.toggleElement(this.$el, false, false);
3966
+ _toggle(el, show);
3939
3967
 
3940
- this.clearTimers();
3968
+ const off = once(
3969
+ transitionElement,
3970
+ 'transitionstart',
3971
+ () => {
3972
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3973
+ self: true });
3941
3974
 
3942
- this.isDelaying = getPositionedElements(this.$el).some((el) =>
3943
- this.tracker.movesTo(el));
3975
+ clearTimeout(timer);
3976
+ },
3977
+ { self: true });
3944
3978
 
3945
3979
 
3946
- if (delay && this.isDelaying) {
3947
- this.hideTimer = setTimeout(this.hide, 50);
3948
- } else if (delay && this.delayHide) {
3949
- this.hideTimer = setTimeout(hide, this.delayHide);
3950
- } else {
3951
- hide();
3952
- }
3953
- },
3980
+ const timer = setTimeout(() => {
3981
+ off();
3982
+ resolve();
3983
+ }, toMs(css(transitionElement, 'transitionDuration')));
3984
+ })).
3985
+ then(() => delete el._reject);
3986
+ }
3954
3987
 
3955
- clearTimers() {
3956
- clearTimeout(this.showTimer);
3957
- clearTimeout(this.hideTimer);
3958
- this.showTimer = null;
3959
- this.hideTimer = null;
3960
- this.isDelaying = false;
3961
- },
3988
+ function toMs(time) {
3989
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3990
+ }
3962
3991
 
3963
- isActive() {
3964
- return active$1 === this;
3965
- },
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
+ }
3966
3998
 
3967
- position() {
3968
- removeClass(this.$el, this.clsDrop + "-stack");
3969
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
3999
+ let startClientY;
3970
4000
 
3971
- const boundary = query(this.boundary, this.$el);
3972
- const scrollParentOffset = offset(
3973
- scrollParents(boundary && this.boundaryAlign ? boundary : this.$el)[0]);
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 }),
3974
4011
 
3975
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
3976
4012
 
3977
- css(this.$el, 'maxWidth', '');
3978
- const maxWidth =
3979
- scrollParentOffset.width -
3980
- 2 * toPx(getCssVar('position-viewport-offset', this.$el));
4013
+ on(
4014
+ el,
4015
+ 'touchmove',
4016
+ (e) => {
4017
+ if (e.targetTouches.length !== 1) {
4018
+ return;
4019
+ }
3981
4020
 
3982
- if (this.pos[1] === 'justify') {
3983
- const prop = this.axis === 'y' ? 'width' : 'height';
3984
- css(
3985
- this.$el,
3986
- prop,
3987
- Math.min(
3988
- (boundary ? boundaryOffset : offset(this.target))[prop],
3989
- scrollParentOffset[prop] -
3990
- 2 * toPx(getCssVar('position-viewport-offset', this.$el))));
4021
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
4022
+ if (!within(scrollParent, el)) {
4023
+ scrollParent = el;
4024
+ }
3991
4025
 
4026
+ const clientY = e.targetTouches[0].clientY - startClientY;
4027
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
3992
4028
 
3993
- } else if (this.$el.offsetWidth > maxWidth) {
3994
- addClass(this.$el, this.clsDrop + "-stack");
3995
- }
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 })];
3996
4038
 
3997
- css(this.$el, 'maxWidth', maxWidth);
3998
4039
 
3999
- this.positionAt(
4000
- this.$el,
4001
- boundary && this.boundaryAlign ? boundary : this.target,
4002
- boundary);
4003
4040
 
4004
- } } };
4041
+ return () => events.forEach((fn) => fn());
4042
+ }
4005
4043
 
4044
+ function preventBackgroundScroll() {
4045
+ const { body, documentElement } = document;
4046
+ css(body, {
4047
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4048
+ touchAction: 'none' });
4006
4049
 
4050
+ css(documentElement, 'overflowY', 'hidden');
4051
+ return () => {
4052
+ css(documentElement, 'overflowY', '');
4053
+ css(body, { overflowY: '', touchAction: '' });
4054
+ };
4055
+ }
4007
4056
 
4008
- function getPositionedElements(el) {
4009
- const result = [];
4010
- apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
4011
- return result;
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;
4012
4065
  }
4013
4066
 
4014
- var formCustom = {
4015
- mixins: [Class],
4067
+ let active;
4016
4068
 
4017
- args: 'target',
4069
+ var drop = {
4070
+ mixins: [Container, Lazyload, Position, Togglable],
4071
+
4072
+ args: 'pos',
4018
4073
 
4019
4074
  props: {
4020
- target: Boolean },
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 },
4021
4085
 
4022
4086
 
4023
4087
  data: {
4024
- target: false },
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 },
4025
4101
 
4026
4102
 
4027
- computed: {
4028
- input(_, $el) {
4029
- return $(selInput, $el);
4030
- },
4103
+ created() {
4104
+ this.tracker = new MouseTracker();
4105
+ },
4031
4106
 
4032
- state() {
4033
- return this.input.nextElementSibling;
4034
- },
4107
+ beforeConnect() {
4108
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4109
+ },
4035
4110
 
4036
- target(_ref, $el) {let { target } = _ref;
4037
- return (
4038
- target && (
4039
- target === true && parent(this.input) === $el && this.input.nextElementSibling ||
4040
- $(target, $el)));
4041
-
4042
- } },
4043
-
4044
-
4045
- update() {var _input$files;
4046
- const { target, input } = this;
4111
+ connected() {
4112
+ addClass(this.$el, this.clsDrop);
4047
4113
 
4048
- if (!target) {
4049
- return;
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);
4050
4121
  }
4122
+ },
4051
4123
 
4052
- let option;
4053
- const prop = isInput(target) ? 'value' : 'textContent';
4054
- const prev = target[prop];
4055
- const value = (_input$files = input.files) != null && _input$files[0] ?
4056
- input.files[0].name :
4057
- matches(input, 'select') && (
4058
- option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
4059
- ? option.textContent :
4060
- input.value;
4061
-
4062
- if (prev !== value) {
4063
- target[prop] = value;
4124
+ disconnected() {
4125
+ if (this.isActive()) {
4126
+ active = null;
4064
4127
  }
4065
4128
  },
4066
4129
 
4067
4130
  events: [
4068
4131
  {
4069
- name: 'change',
4132
+ name: 'click',
4070
4133
 
4071
- handler() {
4072
- this.$emit();
4134
+ delegate() {
4135
+ return "." + this.clsDrop + "-close";
4136
+ },
4137
+
4138
+ handler(e) {
4139
+ e.preventDefault();
4140
+ this.hide(false);
4073
4141
  } },
4074
4142
 
4075
4143
 
4076
4144
  {
4077
- name: 'reset',
4145
+ name: 'click',
4078
4146
 
4079
- el() {
4080
- return closest(this.$el, 'form');
4147
+ delegate() {
4148
+ return 'a[href^="#"]';
4081
4149
  },
4082
4150
 
4083
- handler() {
4084
- this.$emit();
4085
- } }] };
4086
-
4087
- var Margin = {
4088
- mixins: [Resize],
4151
+ handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4152
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4153
+ this.hide(false);
4154
+ }
4155
+ } },
4089
4156
 
4090
- props: {
4091
- margin: String,
4092
- firstColumn: Boolean },
4093
4157
 
4158
+ {
4159
+ name: 'beforescroll',
4094
4160
 
4095
- data: {
4096
- margin: 'uk-margin-small-top',
4097
- firstColumn: 'uk-first-column' },
4161
+ handler() {
4162
+ this.hide(false);
4163
+ } },
4098
4164
 
4099
4165
 
4100
- resizeTargets() {
4101
- return [this.$el, ...toArray(this.$el.children)];
4102
- },
4166
+ {
4167
+ name: 'toggle',
4103
4168
 
4104
- connected() {
4105
- this.registerObserver(
4106
- observeMutation(this.$el, () => this.$reset(), {
4107
- childList: true }));
4169
+ self: true,
4108
4170
 
4171
+ handler(e, toggle) {
4172
+ e.preventDefault();
4109
4173
 
4110
- },
4174
+ if (this.isToggled()) {
4175
+ this.hide(false);
4176
+ } else {
4177
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4178
+ }
4179
+ } },
4111
4180
 
4112
- update: {
4113
- read() {
4114
- const rows = getRows(this.$el.children);
4115
4181
 
4116
- return {
4117
- rows,
4118
- columns: getColumns(rows) };
4182
+ {
4183
+ name: 'toggleshow',
4119
4184
 
4120
- },
4185
+ self: true,
4121
4186
 
4122
- write(_ref) {let { columns, rows } = _ref;
4123
- for (const row of rows) {
4124
- for (const column of row) {
4125
- toggleClass(column, this.margin, rows[0] !== row);
4126
- toggleClass(column, this.firstColumn, columns[0].includes(column));
4127
- }
4128
- }
4129
- },
4187
+ handler(e, toggle) {
4188
+ e.preventDefault();
4189
+ this.show(toggle == null ? void 0 : toggle.$el);
4190
+ } },
4130
4191
 
4131
- events: ['resize'] } };
4132
4192
 
4193
+ {
4194
+ name: 'togglehide',
4133
4195
 
4196
+ self: true,
4134
4197
 
4135
- function getRows(items) {
4136
- return sortBy(items, 'top', 'bottom');
4137
- }
4198
+ handler(e) {
4199
+ e.preventDefault();
4200
+ if (!matches(this.$el, ':focus,:hover')) {
4201
+ this.hide();
4202
+ }
4203
+ } },
4138
4204
 
4139
- function getColumns(rows) {
4140
- const columns = [];
4141
4205
 
4142
- for (const row of rows) {
4143
- const sorted = sortBy(row, 'left', 'right');
4144
- for (let j = 0; j < sorted.length; j++) {
4145
- columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4146
- }
4147
- }
4206
+ {
4207
+ name: pointerEnter + " focusin",
4148
4208
 
4149
- return isRtl ? columns.reverse() : columns;
4150
- }
4209
+ filter() {
4210
+ return includes(this.mode, 'hover');
4211
+ },
4151
4212
 
4152
- function sortBy(items, startProp, endProp) {
4153
- const sorted = [[]];
4213
+ handler(e) {
4214
+ if (!isTouch(e)) {
4215
+ this.clearTimers();
4216
+ }
4217
+ } },
4154
4218
 
4155
- for (const el of items) {
4156
- if (!isVisible(el)) {
4157
- continue;
4158
- }
4159
4219
 
4160
- let dim = getOffset(el);
4220
+ {
4221
+ name: pointerLeave + " focusout",
4161
4222
 
4162
- for (let i = sorted.length - 1; i >= 0; i--) {
4163
- const current = sorted[i];
4223
+ filter() {
4224
+ return includes(this.mode, 'hover');
4225
+ },
4164
4226
 
4165
- if (!current[0]) {
4166
- current.push(el);
4167
- break;
4227
+ handler(e) {
4228
+ if (!isTouch(e) && e.relatedTarget) {
4229
+ this.hide();
4168
4230
  }
4231
+ } },
4169
4232
 
4170
- let startDim;
4171
- if (current[0].offsetParent === el.offsetParent) {
4172
- startDim = getOffset(current[0]);
4173
- } else {
4174
- dim = getOffset(el, true);
4175
- startDim = getOffset(current[0], true);
4176
- }
4177
4233
 
4178
- if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4179
- sorted.push([el]);
4180
- break;
4181
- }
4234
+ {
4235
+ name: 'toggled',
4182
4236
 
4183
- if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4184
- current.push(el);
4185
- break;
4186
- }
4237
+ self: true,
4187
4238
 
4188
- if (i === 0) {
4189
- sorted.unshift([el]);
4190
- break;
4239
+ handler(e, toggled) {
4240
+ if (!toggled) {
4241
+ return;
4191
4242
  }
4192
- }
4193
- }
4194
4243
 
4195
- return sorted;
4196
- }
4244
+ this.clearTimers();
4245
+ this.position();
4246
+ } },
4197
4247
 
4198
- function getOffset(element, offset) {if (offset === void 0) {offset = false;}
4199
- let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;
4200
4248
 
4201
- if (offset) {
4202
- [offsetTop, offsetLeft] = offsetPosition(element);
4203
- }
4249
+ {
4250
+ name: 'show',
4204
4251
 
4205
- return {
4206
- top: offsetTop,
4207
- left: offsetLeft,
4208
- bottom: offsetTop + offsetHeight,
4209
- right: offsetLeft + offsetWidth };
4252
+ self: true,
4210
4253
 
4211
- }
4254
+ handler() {
4255
+ active = this;
4212
4256
 
4213
- var Scroll = {
4214
- connected() {
4215
- registerScrollListener(this._uid, () => this.$emit('scroll'));
4216
- },
4257
+ this.tracker.init();
4217
4258
 
4218
- disconnected() {
4219
- unregisterScrollListener(this._uid);
4220
- } };
4259
+ for (const handler of [
4260
+ on(
4261
+ document,
4262
+ pointerDown$1,
4263
+ (_ref2) => {let { target } = _ref2;return (
4264
+ !within(target, this.$el) &&
4265
+ once(
4266
+ document,
4267
+ pointerUp$1 + " " + pointerCancel + " scroll",
4268
+ (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4269
+ if (
4270
+ !defaultPrevented &&
4271
+ type === pointerUp$1 &&
4272
+ target === newTarget &&
4273
+ !(this.target && within(target, this.target)))
4274
+ {
4275
+ this.hide(false);
4276
+ }
4277
+ },
4278
+ true));}),
4221
4279
 
4222
4280
 
4223
- const scrollListeners = new Map();
4224
- let unbindScrollListener;
4225
- function registerScrollListener(id, listener) {
4226
- unbindScrollListener =
4227
- unbindScrollListener ||
4228
- on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
4229
- passive: true,
4230
- capture: true });
4231
4281
 
4282
+ on(document, 'keydown', (e) => {
4283
+ if (e.keyCode === 27) {
4284
+ this.hide(false);
4285
+ }
4286
+ }),
4232
4287
 
4233
- scrollListeners.set(id, listener);
4234
- }
4288
+ ...(this.bgScroll ?
4289
+ [] :
4290
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4235
4291
 
4236
- function unregisterScrollListener(id) {
4237
- scrollListeners.delete(id);
4238
- if (unbindScrollListener && !scrollListeners.size) {
4239
- unbindScrollListener();
4240
- unbindScrollListener = null;
4241
- }
4242
- }
4243
-
4244
- var grid = {
4245
- extends: Margin,
4292
+ ...(this.display === 'static' && this.align !== 'stretch' ?
4293
+ [] :
4294
+ (() => {
4295
+ const handler = () => this.$emit();
4296
+ return [
4297
+ on(window, 'resize', handler),
4298
+ on(document, 'scroll', handler, true),
4299
+ (() => {
4300
+ const observer = observeResize(
4301
+ scrollParents(this.$el),
4302
+ handler);
4246
4303
 
4247
- mixins: [Class, Scroll],
4304
+ return () => observer.disconnect();
4305
+ })()];
4248
4306
 
4249
- name: 'grid',
4307
+ })())])
4308
+ {
4309
+ once(this.$el, 'hide', handler, { self: true });
4310
+ }
4311
+ } },
4250
4312
 
4251
- props: {
4252
- masonry: Boolean,
4253
- parallax: Number },
4254
4313
 
4314
+ {
4315
+ name: 'beforehide',
4255
4316
 
4256
- data: {
4257
- margin: 'uk-grid-margin',
4258
- clsStack: 'uk-grid-stack',
4259
- masonry: false,
4260
- parallax: 0 },
4317
+ self: true,
4261
4318
 
4319
+ handler() {
4320
+ this.clearTimers();
4321
+ } },
4262
4322
 
4263
- connected() {
4264
- this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4265
- },
4266
4323
 
4267
- update: [
4268
4324
  {
4269
- write(_ref) {let { columns } = _ref;
4270
- toggleClass(this.$el, this.clsStack, columns.length < 2);
4271
- },
4325
+ name: 'hide',
4272
4326
 
4273
- events: ['resize'] },
4327
+ handler(_ref4) {let { target } = _ref4;
4328
+ if (this.$el !== target) {
4329
+ active =
4330
+ active === null && within(target, this.$el) && this.isToggled() ?
4331
+ this :
4332
+ active;
4333
+ return;
4334
+ }
4274
4335
 
4336
+ active = this.isActive() ? null : active;
4337
+ this.tracker.cancel();
4338
+ } }],
4275
4339
 
4276
- {
4277
- read(data) {
4278
- let { columns, rows } = data;
4279
4340
 
4280
- // Filter component makes elements positioned absolute
4281
- if (
4282
- !columns.length ||
4283
- !this.masonry && !this.parallax ||
4284
- positionedAbsolute(this.$el))
4285
- {
4286
- data.translates = false;
4287
- return false;
4288
- }
4289
4341
 
4290
- let translates = false;
4342
+ update: {
4343
+ write() {
4344
+ if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
4345
+ this.position();
4346
+ }
4347
+ } },
4291
4348
 
4292
- const nodes = children(this.$el);
4293
- const columnHeights = getColumnHeights(columns);
4294
- const margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
4295
- const elHeight = Math.max(...columnHeights) + margin;
4296
4349
 
4297
- if (this.masonry) {
4298
- columns = columns.map((column) => sortBy$1(column, 'offsetTop'));
4299
- translates = getTranslates(rows, columns);
4350
+ methods: {
4351
+ show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4352
+ if (this.isToggled() && target && this.target && target !== this.target) {
4353
+ this.hide(false, false);
4300
4354
  }
4301
4355
 
4302
- let padding = Math.abs(this.parallax);
4303
- if (padding) {
4304
- padding = columnHeights.reduce(
4305
- (newPadding, hgt, i) =>
4306
- Math.max(
4307
- newPadding,
4308
- hgt + margin + (i % 2 ? padding : padding / 8) - elHeight),
4356
+ this.target = target;
4309
4357
 
4310
- 0);
4358
+ this.clearTimers();
4311
4359
 
4360
+ if (this.isActive()) {
4361
+ return;
4312
4362
  }
4313
4363
 
4314
- return { padding, columns, translates, height: translates ? elHeight : '' };
4315
- },
4316
-
4317
- write(_ref2) {let { height, padding } = _ref2;
4318
- css(this.$el, 'paddingBottom', padding || '');
4319
- height !== false && css(this.$el, 'height', height);
4320
- },
4321
-
4322
- events: ['resize'] },
4364
+ if (active) {
4365
+ if (delay && active.isDelaying) {
4366
+ this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4367
+ return;
4368
+ }
4323
4369
 
4370
+ let prev;
4371
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4372
+ prev = active;
4373
+ active.hide(false, false);
4374
+ }
4375
+ }
4324
4376
 
4325
- {
4326
- read() {
4327
- if (this.parallax && positionedAbsolute(this.$el)) {
4328
- return false;
4377
+ if (this.container && parent(this.$el) !== this.container) {
4378
+ append(this.container, this.$el);
4329
4379
  }
4330
4380
 
4331
- return {
4332
- scrolled: this.parallax ?
4333
- scrolledOver(this.$el) * Math.abs(this.parallax) :
4334
- false };
4381
+ this.showTimer = setTimeout(
4382
+ () => this.toggleElement(this.$el, true),
4383
+ delay && this.delayShow || 0);
4335
4384
 
4336
4385
  },
4337
4386
 
4338
- write(_ref3) {let { columns, scrolled, translates } = _ref3;
4339
- if (scrolled === false && !translates) {
4340
- return;
4341
- }
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);
4342
4389
 
4343
- columns.forEach((column, i) =>
4344
- column.forEach((el, j) =>
4345
- css(
4346
- el,
4347
- 'transform',
4348
- !scrolled && !translates ?
4349
- '' : "translateY(" + (
4390
+ this.clearTimers();
4350
4391
 
4351
- (translates && -translates[i][j]) + (
4352
- scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")));
4392
+ this.isDelaying = getPositionedElements(this.$el).some((el) =>
4393
+ this.tracker.movesTo(el));
4353
4394
 
4354
4395
 
4396
+ if (delay && this.isDelaying) {
4397
+ this.hideTimer = setTimeout(this.hide, 50);
4398
+ } else if (delay && this.delayHide) {
4399
+ this.hideTimer = setTimeout(hide, this.delayHide);
4400
+ } else {
4401
+ hide();
4402
+ }
4403
+ },
4355
4404
 
4405
+ clearTimers() {
4406
+ clearTimeout(this.showTimer);
4407
+ clearTimeout(this.hideTimer);
4408
+ this.showTimer = null;
4409
+ this.hideTimer = null;
4410
+ this.isDelaying = false;
4411
+ },
4356
4412
 
4413
+ isActive() {
4414
+ return active === this;
4357
4415
  },
4358
4416
 
4359
- events: ['scroll', 'resize'] }] };
4417
+ position() {
4418
+ removeClass(this.$el, this.clsDrop + "-stack");
4419
+ toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4420
+ toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4360
4421
 
4422
+ const boundary = query(this.boundary, this.$el);
4423
+ const target = boundary && this.boundaryAlign ? boundary : this.target;
4424
+ const [scrollParent] = scrollParents(
4425
+ boundary && this.boundaryAlign ? boundary : this.$el);
4361
4426
 
4427
+ const scrollParentOffset = offset(scrollParent);
4428
+ const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4429
+ const viewportOffset = this.getViewportOffset(this.$el);
4362
4430
 
4431
+ css(this.$el, 'maxWidth', '');
4432
+ const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4363
4433
 
4364
- function positionedAbsolute(el) {
4365
- return children(el).some((el) => css(el, 'position') === 'absolute');
4366
- }
4434
+ if (this.align === 'justify') {
4435
+ const prop = this.axis === 'y' ? 'width' : 'height';
4436
+ css(
4437
+ this.$el,
4438
+ prop,
4439
+ Math.min(
4440
+ (boundary ? boundaryOffset : offset(this.target))[prop],
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 });
4367
4465
 
4368
- function getTranslates(rows, columns) {
4369
- const rowHeights = rows.map((row) => Math.max(...row.map((el) => el.offsetHeight)));
4466
+ } else if (this.$el.offsetWidth > maxWidth) {
4467
+ addClass(this.$el, this.clsDrop + "-stack");
4468
+ }
4370
4469
 
4371
- return columns.map((elements) => {
4372
- let prev = 0;
4373
- return elements.map(
4374
- (element, row) =>
4375
- prev += row ? rowHeights[row - 1] - elements[row - 1].offsetHeight : 0);
4470
+ css(this.$el, 'maxWidth', maxWidth);
4376
4471
 
4377
- });
4378
- }
4472
+ this.positionAt(this.$el, target, boundary);
4473
+ } } };
4379
4474
 
4380
- function getMarginTop(nodes, cls) {
4381
- const [node] = nodes.filter((el) => hasClass(el, cls));
4382
4475
 
4383
- return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
4384
- }
4385
4476
 
4386
- function getColumnHeights(columns) {
4387
- return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
4477
+ function getPositionedElements(el) {
4478
+ const result = [];
4479
+ apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
4480
+ return result;
4388
4481
  }
4389
4482
 
4390
- var heightMatch = {
4391
- mixins: [Resize],
4483
+ var formCustom = {
4484
+ mixins: [Class],
4392
4485
 
4393
4486
  args: 'target',
4394
4487
 
4395
4488
  props: {
4396
- target: String,
4397
- row: Boolean },
4489
+ target: Boolean },
4398
4490
 
4399
4491
 
4400
4492
  data: {
4401
- target: '> *',
4402
- row: true },
4493
+ target: false },
4403
4494
 
4404
4495
 
4405
4496
  computed: {
4406
- elements: {
4407
- get(_ref, $el) {let { target } = _ref;
4408
- return $$(target, $el);
4409
- },
4410
-
4411
- watch() {
4412
- this.$reset();
4413
- } } },
4414
-
4415
-
4416
-
4417
- resizeTargets() {
4418
- return [this.$el, ...this.elements];
4419
- },
4420
-
4421
- update: {
4422
- read() {
4423
- return {
4424
- rows: (this.row ? getRows(this.elements) : [this.elements]).map(match$1) };
4425
-
4497
+ input(_, $el) {
4498
+ return $(selInput, $el);
4426
4499
  },
4427
4500
 
4428
- write(_ref2) {let { rows } = _ref2;
4429
- for (const { heights, elements } of rows) {
4430
- elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
4431
- }
4501
+ state() {
4502
+ return this.input.nextElementSibling;
4432
4503
  },
4433
4504
 
4434
- events: ['resize'] } };
4435
-
4505
+ target(_ref, $el) {let { target } = _ref;
4506
+ return (
4507
+ target && (
4508
+ target === true && parent(this.input) === $el && this.input.nextElementSibling ||
4509
+ $(target, $el)));
4436
4510
 
4511
+ } },
4437
4512
 
4438
- function match$1(elements) {
4439
- if (elements.length < 2) {
4440
- return { heights: [''], elements };
4441
- }
4442
4513
 
4443
- css(elements, 'minHeight', '');
4444
- let heights = elements.map(getHeight);
4445
- const max = Math.max(...heights);
4514
+ update() {var _input$files;
4515
+ const { target, input } = this;
4446
4516
 
4447
- return {
4448
- heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4449
- elements };
4517
+ if (!target) {
4518
+ return;
4519
+ }
4450
4520
 
4451
- }
4521
+ let option;
4522
+ const prop = isInput(target) ? 'value' : 'textContent';
4523
+ const prev = target[prop];
4524
+ const value = (_input$files = input.files) != null && _input$files[0] ?
4525
+ input.files[0].name :
4526
+ matches(input, 'select') && (
4527
+ option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
4528
+ ? option.textContent :
4529
+ input.value;
4452
4530
 
4453
- function getHeight(element) {
4454
- let style = false;
4455
- if (!isVisible(element)) {
4456
- style = element.style.display;
4457
- css(element, 'display', 'block', 'important');
4458
- }
4531
+ if (prev !== value) {
4532
+ target[prop] = value;
4533
+ }
4534
+ },
4459
4535
 
4460
- const height = dimensions$1(element).height - boxModelAdjust(element, 'height', 'content-box');
4536
+ events: [
4537
+ {
4538
+ name: 'change',
4461
4539
 
4462
- if (style !== false) {
4463
- css(element, 'display', style);
4464
- }
4540
+ handler() {
4541
+ this.$emit();
4542
+ } },
4465
4543
 
4466
- return height;
4467
- }
4468
4544
 
4469
- var heightViewport = {
4545
+ {
4546
+ name: 'reset',
4547
+
4548
+ el() {
4549
+ return closest(this.$el, 'form');
4550
+ },
4551
+
4552
+ handler() {
4553
+ this.$emit();
4554
+ } }] };
4555
+
4556
+ var Margin = {
4470
4557
  mixins: [Resize],
4471
4558
 
4472
4559
  props: {
4473
- expand: Boolean,
4474
- offsetTop: Boolean,
4475
- offsetBottom: Boolean,
4476
- minHeight: Number },
4560
+ margin: String,
4561
+ firstColumn: Boolean },
4477
4562
 
4478
4563
 
4479
4564
  data: {
4480
- expand: false,
4481
- offsetTop: false,
4482
- offsetBottom: false,
4483
- minHeight: 0 },
4565
+ margin: 'uk-margin-small-top',
4566
+ firstColumn: 'uk-first-column' },
4484
4567
 
4485
4568
 
4486
4569
  resizeTargets() {
4487
- // check for offsetTop change
4488
- return [this.$el, document.documentElement];
4570
+ return [this.$el, ...toArray(this.$el.children)];
4489
4571
  },
4490
4572
 
4491
- update: {
4492
- read(_ref) {let { minHeight: prev } = _ref;
4493
- if (!isVisible(this.$el)) {
4494
- return false;
4495
- }
4496
-
4497
- let minHeight = '';
4498
- const box = boxModelAdjust(this.$el, 'height', 'content-box');
4499
-
4500
- if (this.expand) {
4501
- minHeight = Math.max(
4502
- height(window) - (
4503
- dimensions$1(document.documentElement).height -
4504
- dimensions$1(this.$el).height) -
4505
- box,
4506
- 0);
4573
+ connected() {
4574
+ this.registerObserver(
4575
+ observeMutation(this.$el, () => this.$reset(), {
4576
+ childList: true }));
4507
4577
 
4508
- } else {
4509
- // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4510
- minHeight = 'calc(100vh';
4511
4578
 
4512
- if (this.offsetTop) {
4513
- const { top } = offset(this.$el);
4514
- minHeight += top > 0 && top < height(window) / 2 ? " - " + top + "px" : '';
4515
- }
4579
+ },
4516
4580
 
4517
- if (this.offsetBottom === true) {
4518
- minHeight += " - " + dimensions$1(this.$el.nextElementSibling).height + "px";
4519
- } else if (isNumeric(this.offsetBottom)) {
4520
- minHeight += " - " + this.offsetBottom + "vh";
4521
- } else if (this.offsetBottom && endsWith(this.offsetBottom, 'px')) {
4522
- minHeight += " - " + toFloat(this.offsetBottom) + "px";
4523
- } else if (isString(this.offsetBottom)) {
4524
- minHeight += " - " + dimensions$1(query(this.offsetBottom, this.$el)).height + "px";
4525
- }
4581
+ update: {
4582
+ read() {
4583
+ const rows = getRows(this.$el.children);
4526
4584
 
4527
- minHeight += (box ? " - " + box + "px" : '') + ")";
4528
- }
4585
+ return {
4586
+ rows,
4587
+ columns: getColumns(rows) };
4529
4588
 
4530
- return { minHeight, prev };
4531
4589
  },
4532
4590
 
4533
- write(_ref2) {let { minHeight } = _ref2;
4534
- css(this.$el, { minHeight });
4535
-
4536
- if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
4537
- css(this.$el, 'minHeight', this.minHeight);
4591
+ write(_ref) {let { columns, rows } = _ref;
4592
+ for (const row of rows) {
4593
+ for (const column of row) {
4594
+ toggleClass(column, this.margin, rows[0] !== row);
4595
+ toggleClass(column, this.firstColumn, columns[0].includes(column));
4596
+ }
4538
4597
  }
4539
4598
  },
4540
4599
 
4541
4600
  events: ['resize'] } };
4542
4601
 
4543
- var SVG = {
4544
- args: 'src',
4545
4602
 
4546
- props: {
4547
- id: Boolean,
4548
- icon: String,
4549
- src: String,
4550
- style: String,
4551
- width: Number,
4552
- height: Number,
4553
- ratio: Number,
4554
- class: String,
4555
- strokeAnimation: Boolean,
4556
- focusable: Boolean, // IE 11
4557
- attributes: 'list' },
4558
4603
 
4604
+ function getRows(items) {
4605
+ return sortBy(items, 'top', 'bottom');
4606
+ }
4559
4607
 
4560
- data: {
4561
- ratio: 1,
4562
- include: ['style', 'class', 'focusable'],
4563
- class: '',
4564
- strokeAnimation: false },
4608
+ function getColumns(rows) {
4609
+ const columns = [];
4565
4610
 
4611
+ for (const row of rows) {
4612
+ const sorted = sortBy(row, 'left', 'right');
4613
+ for (let j = 0; j < sorted.length; j++) {
4614
+ columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4615
+ }
4616
+ }
4566
4617
 
4567
- beforeConnect() {
4568
- this.class += ' uk-svg';
4569
- },
4618
+ return isRtl ? columns.reverse() : columns;
4619
+ }
4570
4620
 
4571
- connected() {
4572
- if (!this.icon && includes(this.src, '#')) {
4573
- [this.src, this.icon] = this.src.split('#');
4574
- }
4621
+ function sortBy(items, startProp, endProp) {
4622
+ const sorted = [[]];
4575
4623
 
4576
- this.svg = this.getSvg().then((el) => {
4577
- if (this._connected) {
4578
- const svg = insertSVG(el, this.$el);
4624
+ for (const el of items) {
4625
+ if (!isVisible(el)) {
4626
+ continue;
4627
+ }
4579
4628
 
4580
- if (this.svgEl && svg !== this.svgEl) {
4581
- remove$1(this.svgEl);
4582
- }
4629
+ let dim = getOffset(el);
4583
4630
 
4584
- this.applyAttributes(svg, el);
4631
+ for (let i = sorted.length - 1; i >= 0; i--) {
4632
+ const current = sorted[i];
4585
4633
 
4586
- return this.svgEl = svg;
4634
+ if (!current[0]) {
4635
+ current.push(el);
4636
+ break;
4587
4637
  }
4588
- }, noop);
4589
4638
 
4590
- if (this.strokeAnimation) {
4591
- this.svg.then((el) => {
4592
- if (this._connected) {
4593
- applyAnimation(el);
4594
- this.registerObserver(
4595
- observeIntersection(el, (records, observer) => {
4596
- applyAnimation(el);
4597
- observer.disconnect();
4598
- }));
4639
+ let startDim;
4640
+ if (current[0].offsetParent === el.offsetParent) {
4641
+ startDim = getOffset(current[0]);
4642
+ } else {
4643
+ dim = getOffset(el, true);
4644
+ startDim = getOffset(current[0], true);
4645
+ }
4599
4646
 
4600
- }
4601
- });
4602
- }
4603
- },
4647
+ if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4648
+ sorted.push([el]);
4649
+ break;
4650
+ }
4604
4651
 
4605
- disconnected() {
4606
- this.svg.then((svg) => {
4607
- if (this._connected) {
4608
- return;
4652
+ if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4653
+ current.push(el);
4654
+ break;
4609
4655
  }
4610
4656
 
4611
- if (isVoidElement(this.$el)) {
4612
- this.$el.hidden = false;
4657
+ if (i === 0) {
4658
+ sorted.unshift([el]);
4659
+ break;
4613
4660
  }
4661
+ }
4662
+ }
4614
4663
 
4615
- remove$1(svg);
4616
- this.svgEl = null;
4617
- });
4664
+ return sorted;
4665
+ }
4618
4666
 
4619
- this.svg = null;
4620
- },
4667
+ function getOffset(element, offset) {if (offset === void 0) {offset = false;}
4668
+ let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;
4621
4669
 
4622
- methods: {
4623
- async getSvg() {
4624
- if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4625
- return new Promise((resolve) =>
4626
- once(this.$el, 'load', () => resolve(this.getSvg())));
4670
+ if (offset) {
4671
+ [offsetTop, offsetLeft] = offsetPosition(element);
4672
+ }
4627
4673
 
4628
- }
4674
+ return {
4675
+ top: offsetTop,
4676
+ left: offsetLeft,
4677
+ bottom: offsetTop + offsetHeight,
4678
+ right: offsetLeft + offsetWidth };
4629
4679
 
4630
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4631
- },
4680
+ }
4632
4681
 
4633
- applyAttributes(el, ref) {
4634
- for (const prop in this.$options.props) {
4635
- if (includes(this.include, prop) && prop in this) {
4636
- attr(el, prop, this[prop]);
4637
- }
4638
- }
4682
+ var Scroll = {
4683
+ connected() {
4684
+ registerScrollListener(this._uid, () => this.$emit('scroll'));
4685
+ },
4639
4686
 
4640
- for (const attribute in this.attributes) {
4641
- const [prop, value] = this.attributes[attribute].split(':', 2);
4642
- attr(el, prop, value);
4643
- }
4687
+ disconnected() {
4688
+ unregisterScrollListener(this._uid);
4689
+ } };
4644
4690
 
4645
- if (!this.id) {
4646
- removeAttr(el, 'id');
4647
- }
4648
4691
 
4649
- const props = ['width', 'height'];
4650
- let dimensions = props.map((prop) => this[prop]);
4692
+ const scrollListeners = new Map();
4693
+ let unbindScrollListener;
4694
+ function registerScrollListener(id, listener) {
4695
+ unbindScrollListener =
4696
+ unbindScrollListener ||
4697
+ on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
4698
+ passive: true,
4699
+ capture: true });
4651
4700
 
4652
- if (!dimensions.some((val) => val)) {
4653
- dimensions = props.map((prop) => attr(ref, prop));
4654
- }
4655
4701
 
4656
- const viewBox = attr(ref, 'viewBox');
4657
- if (viewBox && !dimensions.some((val) => val)) {
4658
- dimensions = viewBox.split(' ').slice(2);
4659
- }
4702
+ scrollListeners.set(id, listener);
4703
+ }
4660
4704
 
4661
- dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
4662
- } } };
4705
+ function unregisterScrollListener(id) {
4706
+ scrollListeners.delete(id);
4707
+ if (unbindScrollListener && !scrollListeners.size) {
4708
+ unbindScrollListener();
4709
+ unbindScrollListener = null;
4710
+ }
4711
+ }
4663
4712
 
4713
+ var grid = {
4714
+ extends: Margin,
4664
4715
 
4716
+ mixins: [Class, Scroll],
4665
4717
 
4666
- const loadSVG = memoize(async (src) => {
4667
- if (src) {
4668
- if (startsWith(src, 'data:')) {
4669
- return decodeURIComponent(src.split(',')[1]);
4670
- } else {
4671
- return (await fetch(src)).text();
4672
- }
4673
- } else {
4674
- return Promise.reject();
4675
- }
4676
- });
4718
+ name: 'grid',
4677
4719
 
4678
- function parseSVG(svg, icon) {var _svg;
4679
- if (icon && includes(svg, '<symbol')) {
4680
- svg = parseSymbols(svg, icon) || svg;
4681
- }
4720
+ props: {
4721
+ masonry: Boolean,
4722
+ parallax: Number },
4682
4723
 
4683
- svg = $(svg.substr(svg.indexOf('<svg')));
4684
- return ((_svg = svg) == null ? void 0 : _svg.hasChildNodes()) && svg;
4685
- }
4686
4724
 
4687
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
4688
- const symbols = {};
4725
+ data: {
4726
+ margin: 'uk-grid-margin',
4727
+ clsStack: 'uk-grid-stack',
4728
+ masonry: false,
4729
+ parallax: 0 },
4689
4730
 
4690
- function parseSymbols(svg, icon) {
4691
- if (!symbols[svg]) {
4692
- symbols[svg] = {};
4693
4731
 
4694
- symbolRe.lastIndex = 0;
4732
+ connected() {
4733
+ this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4734
+ },
4695
4735
 
4696
- let match;
4697
- while (match = symbolRe.exec(svg)) {
4698
- symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + match[1] + "svg>";
4699
- }
4700
- }
4736
+ update: [
4737
+ {
4738
+ write(_ref) {let { columns } = _ref;
4739
+ toggleClass(this.$el, this.clsStack, columns.length < 2);
4740
+ },
4701
4741
 
4702
- return symbols[svg][icon];
4703
- }
4742
+ events: ['resize'] },
4704
4743
 
4705
- function applyAnimation(el) {
4706
- const length = getMaxPathLength(el);
4707
4744
 
4708
- if (length) {
4709
- el.style.setProperty('--uk-animation-stroke', length);
4710
- }
4711
- }
4745
+ {
4746
+ read(data) {
4747
+ let { columns, rows } = data;
4712
4748
 
4713
- function getMaxPathLength(el) {
4714
- return Math.ceil(
4715
- Math.max(
4716
- 0,
4717
- ...$$('[stroke]', el).map((stroke) => {
4718
- try {
4719
- return stroke.getTotalLength();
4720
- } catch (e) {
4721
- return 0;
4722
- }
4723
- })));
4749
+ // Filter component makes elements positioned absolute
4750
+ if (
4751
+ !columns.length ||
4752
+ !this.masonry && !this.parallax ||
4753
+ positionedAbsolute(this.$el))
4754
+ {
4755
+ data.translates = false;
4756
+ return false;
4757
+ }
4724
4758
 
4759
+ let translates = false;
4725
4760
 
4726
- }
4761
+ const nodes = children(this.$el);
4762
+ const columnHeights = getColumnHeights(columns);
4763
+ const margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
4764
+ const elHeight = Math.max(...columnHeights) + margin;
4727
4765
 
4728
- function insertSVG(el, root) {
4729
- if (isVoidElement(root) || isTag(root, 'canvas')) {
4730
- root.hidden = true;
4766
+ if (this.masonry) {
4767
+ columns = columns.map((column) => sortBy$1(column, 'offsetTop'));
4768
+ translates = getTranslates(rows, columns);
4769
+ }
4731
4770
 
4732
- const next = root.nextElementSibling;
4733
- return equals(el, next) ? next : after(root, el);
4734
- }
4771
+ let padding = Math.abs(this.parallax);
4772
+ if (padding) {
4773
+ padding = columnHeights.reduce(
4774
+ (newPadding, hgt, i) =>
4775
+ Math.max(
4776
+ newPadding,
4777
+ hgt + margin + (i % 2 ? padding : padding / 8) - elHeight),
4735
4778
 
4736
- const last = root.lastElementChild;
4737
- return equals(el, last) ? last : append(root, el);
4738
- }
4779
+ 0);
4739
4780
 
4740
- function equals(el, other) {
4741
- return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4742
- }
4781
+ }
4743
4782
 
4744
- function innerHTML(el) {
4745
- return (
4746
- el.innerHTML ||
4747
- new XMLSerializer().serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).
4748
- replace(/\s/g, '');
4749
- }
4783
+ return { padding, columns, translates, height: translates ? elHeight : '' };
4784
+ },
4750
4785
 
4751
- var closeIcon = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"1\" y1=\"1\" x2=\"13\" y2=\"13\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"13\" y1=\"1\" x2=\"1\" y2=\"13\"/></svg>";
4786
+ write(_ref2) {let { height, padding } = _ref2;
4787
+ css(this.$el, 'paddingBottom', padding || '');
4788
+ height !== false && css(this.$el, 'height', height);
4789
+ },
4752
4790
 
4753
- var closeLarge = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"1\" y1=\"1\" x2=\"19\" y2=\"19\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"19\" y1=\"1\" x2=\"1\" y2=\"19\"/></svg>";
4791
+ events: ['resize'] },
4754
4792
 
4755
- var marker = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"9\" y=\"4\" width=\"1\" height=\"11\"/><rect x=\"4\" y=\"9\" width=\"11\" height=\"1\"/></svg>";
4756
4793
 
4757
- var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect y=\"9\" width=\"20\" height=\"2\"/><rect y=\"3\" width=\"20\" height=\"2\"/><rect y=\"15\" width=\"20\" height=\"2\"/></svg>";
4794
+ {
4795
+ read() {
4796
+ if (this.parallax && positionedAbsolute(this.$el)) {
4797
+ return false;
4798
+ }
4758
4799
 
4759
- var overlayIcon = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"19\" y=\"0\" width=\"1\" height=\"40\"/><rect x=\"0\" y=\"19\" width=\"40\" height=\"1\"/></svg>";
4800
+ return {
4801
+ scrolled: this.parallax ?
4802
+ scrolledOver(this.$el) * Math.abs(this.parallax) :
4803
+ false };
4760
4804
 
4761
- var paginationNext = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 1 6 6 1 11\"/></svg>";
4805
+ },
4762
4806
 
4763
- var paginationPrevious = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"6 1 1 6 6 11\"/></svg>";
4807
+ write(_ref3) {let { columns, scrolled, translates } = _ref3;
4808
+ if (scrolled === false && !translates) {
4809
+ return;
4810
+ }
4764
4811
 
4765
- var searchIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"9\" cy=\"9\" r=\"7\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M14,14 L18,18 L14,14 Z\"/></svg>";
4812
+ columns.forEach((column, i) =>
4813
+ column.forEach((el, j) =>
4814
+ css(
4815
+ el,
4816
+ 'transform',
4817
+ !scrolled && !translates ?
4818
+ '' : "translateY(" + (
4766
4819
 
4767
- var searchLarge = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" cx=\"17.5\" cy=\"17.5\" r=\"16.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" x1=\"38\" y1=\"39\" x2=\"29\" y2=\"30\"/></svg>";
4820
+ (translates && -translates[i][j]) + (
4821
+ scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")));
4768
4822
 
4769
- var searchNavbar = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"10.5\" cy=\"10.5\" r=\"9.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"23\" y1=\"23\" x2=\"17\" y2=\"17\"/></svg>";
4770
4823
 
4771
- var slidenavNext = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"1.225,23 12.775,12 1.225,1 \"/></svg>";
4772
4824
 
4773
- var slidenavNextLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"4.002,38.547 22.527,20.024 4,1.5 \"/></svg>";
4774
4825
 
4775
- var slidenavPrevious = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"12.775,1 1.225,12 12.775,23 \"/></svg>";
4826
+ },
4776
4827
 
4777
- var slidenavPreviousLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"20.527,1.5 2,20.024 20.525,38.547 \"/></svg>";
4828
+ events: ['scroll', 'resize'] }] };
4778
4829
 
4779
- var spinner = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" cx=\"15\" cy=\"15\" r=\"14\"/></svg>";
4780
4830
 
4781
- var totop = "<svg width=\"18\" height=\"10\" viewBox=\"0 0 18 10\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 9 9 1 17 9 \"/></svg>";
4782
4831
 
4783
- const icons = {
4784
- spinner,
4785
- totop,
4786
- marker,
4787
- 'close-icon': closeIcon,
4788
- 'close-large': closeLarge,
4789
- 'navbar-toggle-icon': navbarToggleIcon,
4790
- 'overlay-icon': overlayIcon,
4791
- 'pagination-next': paginationNext,
4792
- 'pagination-previous': paginationPrevious,
4793
- 'search-icon': searchIcon,
4794
- 'search-large': searchLarge,
4795
- 'search-navbar': searchNavbar,
4796
- 'slidenav-next': slidenavNext,
4797
- 'slidenav-next-large': slidenavNextLarge,
4798
- 'slidenav-previous': slidenavPrevious,
4799
- 'slidenav-previous-large': slidenavPreviousLarge };
4800
4832
 
4833
+ function positionedAbsolute(el) {
4834
+ return children(el).some((el) => css(el, 'position') === 'absolute');
4835
+ }
4801
4836
 
4802
- const Icon = {
4803
- install: install$3,
4837
+ function getTranslates(rows, columns) {
4838
+ const rowHeights = rows.map((row) => Math.max(...row.map((el) => el.offsetHeight)));
4804
4839
 
4805
- extends: SVG,
4840
+ return columns.map((elements) => {
4841
+ let prev = 0;
4842
+ return elements.map(
4843
+ (element, row) =>
4844
+ prev += row ? rowHeights[row - 1] - elements[row - 1].offsetHeight : 0);
4806
4845
 
4807
- args: 'icon',
4846
+ });
4847
+ }
4808
4848
 
4809
- props: ['icon'],
4849
+ function getMarginTop(nodes, cls) {
4850
+ const [node] = nodes.filter((el) => hasClass(el, cls));
4810
4851
 
4811
- data: {
4812
- include: ['focusable'] },
4852
+ return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
4853
+ }
4813
4854
 
4855
+ function getColumnHeights(columns) {
4856
+ return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
4857
+ }
4814
4858
 
4815
- isIcon: true,
4859
+ var heightMatch = {
4860
+ mixins: [Resize],
4816
4861
 
4817
- beforeConnect() {
4818
- addClass(this.$el, 'uk-icon');
4819
- },
4862
+ args: 'target',
4820
4863
 
4821
- methods: {
4822
- async getSvg() {
4823
- const icon = getIcon(this.icon);
4864
+ props: {
4865
+ target: String,
4866
+ row: Boolean },
4824
4867
 
4825
- if (!icon) {
4826
- throw 'Icon not found.';
4827
- }
4828
4868
 
4829
- return icon;
4830
- } } };
4869
+ data: {
4870
+ target: '> *',
4871
+ row: true },
4831
4872
 
4832
- const IconComponent = {
4833
- args: false,
4834
4873
 
4835
- extends: Icon,
4874
+ computed: {
4875
+ elements: {
4876
+ get(_ref, $el) {let { target } = _ref;
4877
+ return $$(target, $el);
4878
+ },
4836
4879
 
4837
- data: (vm) => ({
4838
- icon: hyphenate(vm.constructor.options.name) }),
4880
+ watch() {
4881
+ this.$reset();
4882
+ } } },
4839
4883
 
4840
4884
 
4841
- beforeConnect() {
4842
- addClass(this.$el, this.$name);
4843
- } };
4844
4885
 
4886
+ resizeTargets() {
4887
+ return [this.$el, ...this.elements];
4888
+ },
4845
4889
 
4846
- const Slidenav = {
4847
- extends: IconComponent,
4890
+ update: {
4891
+ read() {
4892
+ return {
4893
+ rows: (this.row ? getRows(this.elements) : [this.elements]).map(match$1) };
4848
4894
 
4849
- beforeConnect() {
4850
- addClass(this.$el, 'uk-slidenav');
4851
- const icon = this.$props.icon;
4852
- this.icon = hasClass(this.$el, 'uk-slidenav-large') ? icon + "-large" : icon;
4853
- } };
4895
+ },
4854
4896
 
4897
+ write(_ref2) {let { rows } = _ref2;
4898
+ for (const { heights, elements } of rows) {
4899
+ elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
4900
+ }
4901
+ },
4855
4902
 
4856
- const Search = {
4857
- extends: IconComponent,
4903
+ events: ['resize'] } };
4858
4904
 
4859
- beforeConnect() {
4860
- this.icon =
4861
- hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length ?
4862
- 'search-large' :
4863
- parents(this.$el, '.uk-search-navbar').length ?
4864
- 'search-navbar' :
4865
- this.$props.icon;
4866
- } };
4867
4905
 
4868
4906
 
4869
- const Close = {
4870
- extends: IconComponent,
4907
+ function match$1(elements) {
4908
+ if (elements.length < 2) {
4909
+ return { heights: [''], elements };
4910
+ }
4871
4911
 
4872
- beforeConnect() {
4873
- this.icon = "close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon');
4874
- } };
4912
+ css(elements, 'minHeight', '');
4913
+ let heights = elements.map(getHeight);
4914
+ const max = Math.max(...heights);
4875
4915
 
4916
+ return {
4917
+ heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4918
+ elements };
4876
4919
 
4877
- const Spinner = {
4878
- extends: IconComponent,
4920
+ }
4879
4921
 
4880
- methods: {
4881
- async getSvg() {
4882
- const icon = await Icon.methods.getSvg.call(this);
4922
+ function getHeight(element) {
4923
+ let style = false;
4924
+ if (!isVisible(element)) {
4925
+ style = element.style.display;
4926
+ css(element, 'display', 'block', 'important');
4927
+ }
4883
4928
 
4884
- if (this.ratio !== 1) {
4885
- css($('circle', icon), 'strokeWidth', 1 / this.ratio);
4886
- }
4929
+ const height = dimensions$1(element).height - boxModelAdjust(element, 'height', 'content-box');
4887
4930
 
4888
- return icon;
4889
- } } };
4931
+ if (style !== false) {
4932
+ css(element, 'display', style);
4933
+ }
4890
4934
 
4935
+ return height;
4936
+ }
4891
4937
 
4938
+ var heightViewport = {
4939
+ mixins: [Resize],
4892
4940
 
4893
- const parsed = {};
4894
- function install$3(UIkit) {
4895
- UIkit.icon.add = (name, svg) => {
4896
- const added = isString(name) ? { [name]: svg } : name;
4897
- each(added, (svg, name) => {
4898
- icons[name] = svg;
4899
- delete parsed[name];
4900
- });
4941
+ props: {
4942
+ expand: Boolean,
4943
+ offsetTop: Boolean,
4944
+ offsetBottom: Boolean,
4945
+ minHeight: Number },
4901
4946
 
4902
- if (UIkit._initialized) {
4903
- apply(document.body, (el) =>
4904
- each(UIkit.getComponents(el), (cmp) => {
4905
- cmp.$options.isIcon && cmp.icon in added && cmp.$reset();
4906
- }));
4907
4947
 
4908
- }
4909
- };
4910
- }
4948
+ data: {
4949
+ expand: false,
4950
+ offsetTop: false,
4951
+ offsetBottom: false,
4952
+ minHeight: 0 },
4911
4953
 
4912
- function getIcon(icon) {
4913
- if (!icons[icon]) {
4914
- return null;
4915
- }
4916
4954
 
4917
- if (!parsed[icon]) {
4918
- parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
4919
- }
4955
+ resizeTargets() {
4956
+ // check for offsetTop change
4957
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4958
+ },
4920
4959
 
4921
- return parsed[icon].cloneNode(true);
4922
- }
4960
+ update: {
4961
+ read(_ref) {let { minHeight: prev } = _ref;
4962
+ if (!isVisible(this.$el)) {
4963
+ return false;
4964
+ }
4923
4965
 
4924
- function applyRtl(icon) {
4925
- return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4926
- }
4966
+ let minHeight = '';
4967
+ const box = boxModelAdjust(this.$el, 'height', 'content-box');
4927
4968
 
4928
- const nativeLazyLoad = inBrowser && 'loading' in HTMLImageElement.prototype;
4969
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4970
+ const { height: viewportHeight } = offsetViewport(scrollElement);
4929
4971
 
4930
- var img = {
4931
- args: 'dataSrc',
4972
+ if (this.expand) {
4973
+ minHeight = Math.max(
4974
+ viewportHeight - (
4975
+ dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
4976
+ box,
4977
+ 0);
4932
4978
 
4933
- props: {
4934
- dataSrc: String,
4935
- sources: String,
4936
- offsetTop: String,
4937
- offsetLeft: String,
4938
- target: String,
4939
- loading: String },
4979
+ } else {
4980
+ const isScrollingElement = document.scrollingElement === scrollElement;
4940
4981
 
4982
+ // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4983
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
4941
4984
 
4942
- data: {
4943
- dataSrc: '',
4944
- sources: false,
4945
- offsetTop: '50vh',
4946
- offsetLeft: '50vw',
4947
- target: false,
4948
- loading: 'lazy' },
4985
+ if (this.offsetTop) {
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
+ }
4992
+ }
4949
4993
 
4994
+ if (this.offsetBottom === true) {
4995
+ minHeight += " - " + dimensions$1(this.$el.nextElementSibling).height + "px";
4996
+ } else if (isNumeric(this.offsetBottom)) {
4997
+ minHeight += " - " + this.offsetBottom + "vh";
4998
+ } else if (this.offsetBottom && endsWith(this.offsetBottom, 'px')) {
4999
+ minHeight += " - " + toFloat(this.offsetBottom) + "px";
5000
+ } else if (isString(this.offsetBottom)) {
5001
+ minHeight += " - " + dimensions$1(query(this.offsetBottom, this.$el)).height + "px";
5002
+ }
4950
5003
 
4951
- connected() {
4952
- if (this.loading !== 'lazy') {
4953
- this.load();
4954
- return;
4955
- }
5004
+ minHeight += (box ? " - " + box + "px" : '') + ")";
5005
+ }
4956
5006
 
4957
- const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
5007
+ return { minHeight, prev };
5008
+ },
4958
5009
 
4959
- if (nativeLazyLoad && isImg(this.$el)) {
4960
- this.$el.loading = 'lazy';
4961
- setSrcAttrs(this.$el);
5010
+ write(_ref2) {let { minHeight } = _ref2;
5011
+ css(this.$el, { minHeight });
4962
5012
 
4963
- if (target.length === 1) {
4964
- return;
5013
+ if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
5014
+ css(this.$el, 'minHeight', this.minHeight);
4965
5015
  }
4966
- }
5016
+ },
4967
5017
 
4968
- ensureSrcAttribute(this.$el);
5018
+ events: ['resize'] } };
4969
5019
 
4970
- this.registerObserver(
4971
- observeIntersection(
4972
- target,
4973
- (entries, observer) => {
4974
- this.load();
4975
- observer.disconnect();
4976
- },
4977
- {
4978
- rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
4979
- this.offsetLeft,
4980
- 'width') + "px" }));
5020
+ var SVG = {
5021
+ args: 'src',
5022
+
5023
+ props: {
5024
+ id: Boolean,
5025
+ icon: String,
5026
+ src: String,
5027
+ style: String,
5028
+ width: Number,
5029
+ height: Number,
5030
+ ratio: Number,
5031
+ class: String,
5032
+ strokeAnimation: Boolean,
5033
+ focusable: Boolean, // IE 11
5034
+ attributes: 'list' },
4981
5035
 
4982
5036
 
5037
+ data: {
5038
+ ratio: 1,
5039
+ include: ['style', 'class', 'focusable'],
5040
+ class: '',
5041
+ strokeAnimation: false },
4983
5042
 
4984
5043
 
5044
+ beforeConnect() {
5045
+ this.class += ' uk-svg';
4985
5046
  },
4986
5047
 
4987
- disconnected() {
4988
- if (this._data.image) {
4989
- this._data.image.onload = '';
5048
+ connected() {
5049
+ if (!this.icon && includes(this.src, '#')) {
5050
+ [this.src, this.icon] = this.src.split('#');
4990
5051
  }
4991
- },
4992
5052
 
4993
- methods: {
4994
- load() {
4995
- if (this._data.image) {
4996
- return this._data.image;
4997
- }
5053
+ this.svg = this.getSvg().then((el) => {
5054
+ if (this._connected) {
5055
+ const svg = insertSVG(el, this.$el);
4998
5056
 
4999
- const image = isImg(this.$el) ?
5000
- this.$el :
5001
- getImageFromElement(this.$el, this.dataSrc, this.sources);
5057
+ if (this.svgEl && svg !== this.svgEl) {
5058
+ remove$1(this.svgEl);
5059
+ }
5002
5060
 
5003
- removeAttr(image, 'loading');
5004
- setSrcAttrs(this.$el, image.currentSrc);
5005
- return this._data.image = image;
5061
+ this.applyAttributes(svg, el);
5062
+
5063
+ return this.svgEl = svg;
5064
+ }
5065
+ }, noop);
5066
+
5067
+ if (this.strokeAnimation) {
5068
+ this.svg.then((el) => {
5069
+ if (this._connected) {
5070
+ applyAnimation(el);
5071
+ this.registerObserver(
5072
+ observeIntersection(el, (records, observer) => {
5073
+ applyAnimation(el);
5074
+ observer.disconnect();
5075
+ }));
5076
+
5077
+ }
5078
+ });
5079
+ }
5080
+ },
5081
+
5082
+ disconnected() {
5083
+ this.svg.then((svg) => {
5084
+ if (this._connected) {
5085
+ return;
5086
+ }
5087
+
5088
+ if (isVoidElement(this.$el)) {
5089
+ this.$el.hidden = false;
5090
+ }
5091
+
5092
+ remove$1(svg);
5093
+ this.svgEl = null;
5094
+ });
5095
+
5096
+ this.svg = null;
5097
+ },
5098
+
5099
+ methods: {
5100
+ async getSvg() {
5101
+ if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
5102
+ return new Promise((resolve) =>
5103
+ once(this.$el, 'load', () => resolve(this.getSvg())));
5104
+
5105
+ }
5106
+
5107
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
5108
+ },
5109
+
5110
+ applyAttributes(el, ref) {
5111
+ for (const prop in this.$options.props) {
5112
+ if (includes(this.include, prop) && prop in this) {
5113
+ attr(el, prop, this[prop]);
5114
+ }
5115
+ }
5116
+
5117
+ for (const attribute in this.attributes) {
5118
+ const [prop, value] = this.attributes[attribute].split(':', 2);
5119
+ attr(el, prop, value);
5120
+ }
5121
+
5122
+ if (!this.id) {
5123
+ removeAttr(el, 'id');
5124
+ }
5125
+
5126
+ const props = ['width', 'height'];
5127
+ let dimensions = props.map((prop) => this[prop]);
5128
+
5129
+ if (!dimensions.some((val) => val)) {
5130
+ dimensions = props.map((prop) => attr(ref, prop));
5131
+ }
5132
+
5133
+ const viewBox = attr(ref, 'viewBox');
5134
+ if (viewBox && !dimensions.some((val) => val)) {
5135
+ dimensions = viewBox.split(' ').slice(2);
5136
+ }
5137
+
5138
+ dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
5006
5139
  } } };
5007
5140
 
5008
5141
 
5009
5142
 
5010
- function setSrcAttrs(el, src) {
5011
- if (isImg(el)) {
5012
- const parentNode = parent(el);
5013
- const elements = isPicture(parentNode) ? children(parentNode) : [el];
5014
- elements.forEach((el) => setSourceProps(el, el));
5015
- } else if (src) {
5016
- const change = !includes(el.style.backgroundImage, src);
5017
- if (change) {
5018
- css(el, 'backgroundImage', "url(" + escape(src) + ")");
5019
- trigger(el, createEvent('load', false));
5143
+ const loadSVG = memoize(async (src) => {
5144
+ if (src) {
5145
+ if (startsWith(src, 'data:')) {
5146
+ return decodeURIComponent(src.split(',')[1]);
5147
+ } else {
5148
+ return (await fetch(src)).text();
5020
5149
  }
5150
+ } else {
5151
+ return Promise.reject();
5021
5152
  }
5022
- }
5153
+ });
5023
5154
 
5024
- const srcProps = ['data-src', 'data-srcset', 'sizes'];
5025
- function setSourceProps(sourceEl, targetEl) {
5026
- srcProps.forEach((prop) => {
5027
- const value = data(sourceEl, prop);
5028
- if (value) {
5029
- attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5030
- }
5031
- });
5155
+ function parseSVG(svg, icon) {var _svg;
5156
+ if (icon && includes(svg, '<symbol')) {
5157
+ svg = parseSymbols(svg, icon) || svg;
5158
+ }
5159
+
5160
+ svg = $(svg.substr(svg.indexOf('<svg')));
5161
+ return ((_svg = svg) == null ? void 0 : _svg.hasChildNodes()) && svg;
5032
5162
  }
5033
5163
 
5034
- function getImageFromElement(el, src, sources) {
5035
- const img = new Image();
5164
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
5165
+ const symbols = {};
5036
5166
 
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
- }
5167
+ function parseSymbols(svg, icon) {
5168
+ if (!symbols[svg]) {
5169
+ symbols[svg] = {};
5045
5170
 
5046
- function wrapInPicture(img, sources) {
5047
- sources = parseSources(sources);
5171
+ symbolRe.lastIndex = 0;
5048
5172
 
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);
5173
+ let match;
5174
+ while (match = symbolRe.exec(svg)) {
5175
+ symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + match[1] + "svg>";
5055
5176
  }
5056
- append(picture, img);
5057
5177
  }
5178
+
5179
+ return symbols[svg][icon];
5058
5180
  }
5059
5181
 
5060
- function parseSources(sources) {
5061
- if (!sources) {
5062
- return [];
5182
+ function applyAnimation(el) {
5183
+ const length = getMaxPathLength(el);
5184
+
5185
+ if (length) {
5186
+ el.style.setProperty('--uk-animation-stroke', length);
5063
5187
  }
5188
+ }
5064
5189
 
5065
- if (startsWith(sources, '[')) {
5190
+ function getMaxPathLength(el) {
5191
+ return Math.ceil(
5192
+ Math.max(
5193
+ 0,
5194
+ ...$$('[stroke]', el).map((stroke) => {
5066
5195
  try {
5067
- sources = JSON.parse(sources);
5196
+ return stroke.getTotalLength();
5068
5197
  } catch (e) {
5069
- sources = [];
5198
+ return 0;
5070
5199
  }
5071
- } else {
5072
- sources = parseOptions(sources);
5073
- }
5200
+ })));
5074
5201
 
5075
- if (!isArray(sources)) {
5076
- sources = [sources];
5077
- }
5078
5202
 
5079
- return sources.filter((source) => !isEmpty(source));
5080
5203
  }
5081
5204
 
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>');
5205
+ function insertSVG(el, root) {
5206
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
5207
+ root.hidden = true;
5208
+
5209
+ const next = root.nextElementSibling;
5210
+ return equals(el, next) ? next : after(root, el);
5085
5211
  }
5212
+
5213
+ const last = root.lastElementChild;
5214
+ return equals(el, last) ? last : append(root, el);
5086
5215
  }
5087
5216
 
5088
- function isPicture(el) {
5089
- return isTag(el, 'picture');
5217
+ function equals(el, other) {
5218
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
5090
5219
  }
5091
5220
 
5092
- function isImg(el) {
5093
- return isTag(el, 'img');
5221
+ function innerHTML(el) {
5222
+ return (
5223
+ el.innerHTML ||
5224
+ new XMLSerializer().serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).
5225
+ replace(/\s/g, '');
5094
5226
  }
5095
5227
 
5096
- var Media = {
5097
- props: {
5098
- media: Boolean },
5228
+ var closeIcon = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"1\" y1=\"1\" x2=\"13\" y2=\"13\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"13\" y1=\"1\" x2=\"1\" y2=\"13\"/></svg>";
5099
5229
 
5230
+ var closeLarge = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"1\" y1=\"1\" x2=\"19\" y2=\"19\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"19\" y1=\"1\" x2=\"1\" y2=\"19\"/></svg>";
5100
5231
 
5101
- data: {
5102
- media: false },
5232
+ var marker = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"9\" y=\"4\" width=\"1\" height=\"11\"/><rect x=\"4\" y=\"9\" width=\"11\" height=\"1\"/></svg>";
5103
5233
 
5234
+ var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect y=\"9\" width=\"20\" height=\"2\"/><rect y=\"3\" width=\"20\" height=\"2\"/><rect y=\"15\" width=\"20\" height=\"2\"/></svg>";
5104
5235
 
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
- },
5236
+ var overlayIcon = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"19\" y=\"0\" width=\"1\" height=\"40\"/><rect x=\"0\" y=\"19\" width=\"40\" height=\"1\"/></svg>";
5121
5237
 
5122
- disconnected() {var _this$offMediaObj;
5123
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5124
- } };
5238
+ var paginationNext = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 1 6 6 1 11\"/></svg>";
5125
5239
 
5240
+ var paginationPrevious = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"6 1 1 6 6 11\"/></svg>";
5126
5241
 
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
- }
5242
+ var searchIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"9\" cy=\"9\" r=\"7\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M14,14 L18,18 L14,14 Z\"/></svg>";
5136
5243
 
5137
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5138
- }
5244
+ var searchLarge = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" cx=\"17.5\" cy=\"17.5\" r=\"16.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" x1=\"38\" y1=\"39\" x2=\"29\" y2=\"30\"/></svg>";
5139
5245
 
5140
- var leader = {
5141
- mixins: [Class, Media, Resize],
5246
+ var searchNavbar = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"10.5\" cy=\"10.5\" r=\"9.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"23\" y1=\"23\" x2=\"17\" y2=\"17\"/></svg>";
5247
+
5248
+ var slidenavNext = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"1.225,23 12.775,12 1.225,1 \"/></svg>";
5249
+
5250
+ var slidenavNextLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"4.002,38.547 22.527,20.024 4,1.5 \"/></svg>";
5251
+
5252
+ var slidenavPrevious = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"12.775,1 1.225,12 12.775,23 \"/></svg>";
5253
+
5254
+ var slidenavPreviousLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"20.527,1.5 2,20.024 20.525,38.547 \"/></svg>";
5255
+
5256
+ var spinner = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" cx=\"15\" cy=\"15\" r=\"14\"/></svg>";
5257
+
5258
+ var totop = "<svg width=\"18\" height=\"10\" viewBox=\"0 0 18 10\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 9 9 1 17 9 \"/></svg>";
5259
+
5260
+ const icons = {
5261
+ spinner,
5262
+ totop,
5263
+ marker,
5264
+ 'close-icon': closeIcon,
5265
+ 'close-large': closeLarge,
5266
+ 'navbar-toggle-icon': navbarToggleIcon,
5267
+ 'overlay-icon': overlayIcon,
5268
+ 'pagination-next': paginationNext,
5269
+ 'pagination-previous': paginationPrevious,
5270
+ 'search-icon': searchIcon,
5271
+ 'search-large': searchLarge,
5272
+ 'search-navbar': searchNavbar,
5273
+ 'slidenav-next': slidenavNext,
5274
+ 'slidenav-next-large': slidenavNextLarge,
5275
+ 'slidenav-previous': slidenavPrevious,
5276
+ 'slidenav-previous-large': slidenavPreviousLarge };
5277
+
5278
+
5279
+ const Icon = {
5280
+ install: install$3,
5281
+
5282
+ extends: SVG,
5283
+
5284
+ args: 'icon',
5285
+
5286
+ props: ['icon'],
5287
+
5288
+ data: {
5289
+ include: ['focusable'] },
5290
+
5291
+
5292
+ isIcon: true,
5293
+
5294
+ beforeConnect() {
5295
+ addClass(this.$el, 'uk-icon');
5296
+ },
5297
+
5298
+ methods: {
5299
+ async getSvg() {
5300
+ const icon = getIcon(this.icon);
5301
+
5302
+ if (!icon) {
5303
+ throw 'Icon not found.';
5304
+ }
5305
+
5306
+ return icon;
5307
+ } } };
5142
5308
 
5143
- props: {
5144
- fill: String },
5309
+ const IconComponent = {
5310
+ args: false,
5145
5311
 
5312
+ extends: Icon,
5146
5313
 
5147
- data: {
5148
- fill: '',
5149
- clsWrapper: 'uk-leader-fill',
5150
- clsHide: 'uk-leader-hide',
5151
- attrFill: 'data-fill' },
5314
+ data: (vm) => ({
5315
+ icon: hyphenate(vm.constructor.options.name) }),
5152
5316
 
5153
5317
 
5154
- computed: {
5155
- fill(_ref) {let { fill } = _ref;
5156
- return fill || getCssVar('leader-fill-content');
5157
- } },
5318
+ beforeConnect() {
5319
+ addClass(this.$el, this.$name);
5320
+ } };
5158
5321
 
5159
5322
 
5160
- connected() {
5161
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5162
- },
5323
+ const Slidenav = {
5324
+ extends: IconComponent,
5163
5325
 
5164
- disconnected() {
5165
- unwrap(this.wrapper.childNodes);
5166
- },
5326
+ beforeConnect() {
5327
+ addClass(this.$el, 'uk-slidenav');
5328
+ const icon = this.$props.icon;
5329
+ this.icon = hasClass(this.$el, 'uk-slidenav-large') ? icon + "-large" : icon;
5330
+ } };
5167
5331
 
5168
- update: {
5169
- read() {
5170
- const width = Math.trunc(this.$el.offsetWidth / 2);
5171
5332
 
5172
- return {
5173
- width,
5174
- fill: this.fill,
5175
- hide: !this.matchMedia };
5333
+ const Search = {
5334
+ extends: IconComponent,
5176
5335
 
5177
- },
5336
+ beforeConnect() {
5337
+ this.icon =
5338
+ hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length ?
5339
+ 'search-large' :
5340
+ parents(this.$el, '.uk-search-navbar').length ?
5341
+ 'search-navbar' :
5342
+ this.$props.icon;
5343
+ } };
5178
5344
 
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
5345
 
5184
- events: ['resize'] } };
5346
+ const Close = {
5347
+ extends: IconComponent,
5185
5348
 
5186
- const active = [];
5349
+ beforeConnect() {
5350
+ this.icon = "close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon');
5351
+ } };
5187
5352
 
5188
- var Modal = {
5189
- mixins: [Class, Container, Togglable],
5190
5353
 
5191
- props: {
5192
- selPanel: String,
5193
- selClose: String,
5194
- escClose: Boolean,
5195
- bgClose: Boolean,
5196
- stack: Boolean },
5354
+ const Spinner = {
5355
+ extends: IconComponent,
5197
5356
 
5357
+ methods: {
5358
+ async getSvg() {
5359
+ const icon = await Icon.methods.getSvg.call(this);
5198
5360
 
5199
- data: {
5200
- cls: 'uk-open',
5201
- escClose: true,
5202
- bgClose: true,
5203
- overlay: true,
5204
- stack: false },
5361
+ if (this.ratio !== 1) {
5362
+ css($('circle', icon), 'strokeWidth', 1 / this.ratio);
5363
+ }
5205
5364
 
5365
+ return icon;
5366
+ } } };
5206
5367
 
5207
- computed: {
5208
- panel(_ref, $el) {let { selPanel } = _ref;
5209
- return $(selPanel, $el);
5210
- },
5211
5368
 
5212
- transitionElement() {
5213
- return this.panel;
5214
- },
5215
5369
 
5216
- bgClose(_ref2) {let { bgClose } = _ref2;
5217
- return bgClose && this.panel;
5218
- } },
5370
+ const parsed = {};
5371
+ function install$3(UIkit) {
5372
+ UIkit.icon.add = (name, svg) => {
5373
+ const added = isString(name) ? { [name]: svg } : name;
5374
+ each(added, (svg, name) => {
5375
+ icons[name] = svg;
5376
+ delete parsed[name];
5377
+ });
5219
5378
 
5379
+ if (UIkit._initialized) {
5380
+ apply(document.body, (el) =>
5381
+ each(UIkit.getComponents(el), (cmp) => {
5382
+ cmp.$options.isIcon && cmp.icon in added && cmp.$reset();
5383
+ }));
5220
5384
 
5221
- beforeDisconnect() {
5222
- if (includes(active, this)) {
5223
- this.toggleElement(this.$el, false, false);
5224
5385
  }
5225
- },
5386
+ };
5387
+ }
5226
5388
 
5227
- events: [
5228
- {
5229
- name: 'click',
5389
+ function getIcon(icon) {
5390
+ if (!icons[icon]) {
5391
+ return null;
5392
+ }
5230
5393
 
5231
- delegate() {
5232
- return this.selClose;
5233
- },
5394
+ if (!parsed[icon]) {
5395
+ parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
5396
+ }
5234
5397
 
5235
- handler(e) {
5236
- e.preventDefault();
5237
- this.hide();
5238
- } },
5398
+ return parsed[icon].cloneNode(true);
5399
+ }
5239
5400
 
5401
+ function applyRtl(icon) {
5402
+ return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
5403
+ }
5240
5404
 
5241
- {
5242
- name: 'toggle',
5405
+ const nativeLazyLoad = inBrowser && 'loading' in HTMLImageElement.prototype;
5243
5406
 
5244
- self: true,
5407
+ var img = {
5408
+ args: 'dataSrc',
5245
5409
 
5246
- handler(e) {
5247
- if (e.defaultPrevented) {
5248
- return;
5249
- }
5410
+ props: {
5411
+ dataSrc: String,
5412
+ sources: String,
5413
+ offsetTop: String,
5414
+ offsetLeft: String,
5415
+ target: String,
5416
+ loading: String },
5250
5417
 
5251
- e.preventDefault();
5252
5418
 
5253
- if (this.isToggled() === includes(active, this)) {
5254
- this.toggle();
5255
- }
5256
- } },
5419
+ data: {
5420
+ dataSrc: '',
5421
+ sources: false,
5422
+ offsetTop: '50vh',
5423
+ offsetLeft: '50vw',
5424
+ target: false,
5425
+ loading: 'lazy' },
5257
5426
 
5258
5427
 
5259
- {
5260
- name: 'beforeshow',
5428
+ connected() {
5429
+ if (this.loading !== 'lazy') {
5430
+ this.load();
5431
+ return;
5432
+ }
5261
5433
 
5262
- self: true,
5434
+ const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
5263
5435
 
5264
- handler(e) {
5265
- if (includes(active, this)) {
5266
- return false;
5267
- }
5436
+ if (nativeLazyLoad && isImg(this.$el)) {
5437
+ this.$el.loading = 'lazy';
5438
+ setSrcAttrs(this.$el);
5268
5439
 
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);
5440
+ if (target.length === 1) {
5441
+ return;
5274
5442
  }
5275
- } },
5443
+ }
5276
5444
 
5445
+ ensureSrcAttribute(this.$el);
5277
5446
 
5278
- {
5279
- name: 'show',
5447
+ this.registerObserver(
5448
+ observeIntersection(
5449
+ target,
5450
+ (entries, observer) => {
5451
+ this.load();
5452
+ observer.disconnect();
5453
+ },
5454
+ {
5455
+ rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
5456
+ this.offsetLeft,
5457
+ 'width') + "px" }));
5280
5458
 
5281
- self: true,
5282
5459
 
5283
- handler() {
5284
- const docEl = document.documentElement;
5285
5460
 
5286
- if (width(window) > docEl.clientWidth && this.overlay) {
5287
- css(document.body, 'overflowY', 'scroll');
5288
- }
5289
5461
 
5290
- if (this.stack) {
5291
- css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
5462
+ },
5463
+
5464
+ disconnected() {
5465
+ if (this._data.image) {
5466
+ this._data.image.onload = '';
5467
+ }
5468
+ },
5469
+
5470
+ methods: {
5471
+ load() {
5472
+ if (this._data.image) {
5473
+ return this._data.image;
5292
5474
  }
5293
5475
 
5294
- addClass(docEl, this.clsPage);
5476
+ const image = isImg(this.$el) ?
5477
+ this.$el :
5478
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
5295
5479
 
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
- }
5480
+ removeAttr(image, 'loading');
5481
+ setSrcAttrs(this.$el, image.currentSrc);
5482
+ return this._data.image = image;
5483
+ } } };
5484
+
5485
+
5486
+
5487
+ function setSrcAttrs(el, src) {
5488
+ if (isImg(el)) {
5489
+ const parentNode = parent(el);
5490
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
5491
+ elements.forEach((el) => setSourceProps(el, el));
5492
+ } else if (src) {
5493
+ const change = !includes(el.style.backgroundImage, src);
5494
+ if (change) {
5495
+ css(el, 'backgroundImage', "url(" + escape(src) + ")");
5496
+ trigger(el, createEvent('load', false));
5497
+ }
5498
+ }
5499
+ }
5500
+
5501
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
5502
+ function setSourceProps(sourceEl, targetEl) {
5503
+ srcProps.forEach((prop) => {
5504
+ const value = data(sourceEl, prop);
5505
+ if (value) {
5506
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5507
+ }
5508
+ });
5509
+ }
5308
5510
 
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);
5511
+ function getImageFromElement(el, src, sources) {
5512
+ const img = new Image();
5322
5513
 
5323
- }),
5324
- { self: true });
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
+ }
5325
5522
 
5326
- }
5523
+ function wrapInPicture(img, sources) {
5524
+ sources = parseSources(sources);
5327
5525
 
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 });
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
+ }
5338
5536
 
5339
- }
5340
- } },
5537
+ function parseSources(sources) {
5538
+ if (!sources) {
5539
+ return [];
5540
+ }
5341
5541
 
5542
+ if (startsWith(sources, '[')) {
5543
+ try {
5544
+ sources = JSON.parse(sources);
5545
+ } catch (e) {
5546
+ sources = [];
5547
+ }
5548
+ } else {
5549
+ sources = parseOptions(sources);
5550
+ }
5342
5551
 
5343
- {
5344
- name: 'shown',
5552
+ if (!isArray(sources)) {
5553
+ sources = [sources];
5554
+ }
5345
5555
 
5346
- self: true,
5556
+ return sources.filter((source) => !isEmpty(source));
5557
+ }
5347
5558
 
5348
- handler() {
5349
- if (!isFocusable(this.$el)) {
5350
- attr(this.$el, 'tabindex', '-1');
5351
- }
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
+ }
5352
5564
 
5353
- if (!$(':focus', this.$el)) {
5354
- this.$el.focus();
5355
- }
5356
- } },
5565
+ function isPicture(el) {
5566
+ return isTag(el, 'picture');
5567
+ }
5357
5568
 
5569
+ function isImg(el) {
5570
+ return isTag(el, 'img');
5571
+ }
5358
5572
 
5359
- {
5360
- name: 'hidden',
5573
+ var Media = {
5574
+ props: {
5575
+ media: Boolean },
5361
5576
 
5362
- self: true,
5363
5577
 
5364
- handler() {
5365
- if (includes(active, this)) {
5366
- active.splice(active.indexOf(this), 1);
5367
- }
5578
+ data: {
5579
+ media: false },
5368
5580
 
5369
- if (!active.length) {
5370
- css(document.body, 'overflowY', '');
5371
- }
5372
5581
 
5373
- css(this.$el, 'zIndex', '');
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
+ },
5374
5598
 
5375
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5376
- removeClass(document.documentElement, this.clsPage);
5377
- }
5378
- } }],
5599
+ disconnected() {var _this$offMediaObj;
5600
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5601
+ } };
5602
+
5603
+
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: install$2,
@@ -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) {
@@ -6029,7 +6257,7 @@
6029
6257
 
6030
6258
  registerEvent(this, {
6031
6259
  el: this.swipeTarget,
6032
- name: pointerDown,
6260
+ name: pointerDown$1,
6033
6261
  passive: true,
6034
6262
  handler(e) {
6035
6263
  if (!isTouch(e)) {
@@ -6039,7 +6267,7 @@
6039
6267
  // Handle Swipe Gesture
6040
6268
  const pos = getEventPos(e);
6041
6269
  const target = 'tagName' in e.target ? e.target : parent(e.target);
6042
- once(document, pointerUp + " " + pointerCancel + " scroll", (e) => {
6270
+ once(document, pointerUp$1 + " " + pointerCancel + " scroll", (e) => {
6043
6271
  const { x, y } = getEventPos(e);
6044
6272
 
6045
6273
  // swipe
@@ -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();
@@ -7259,7 +7441,7 @@
7259
7441
 
7260
7442
  events: [
7261
7443
  {
7262
- name: pointerDown,
7444
+ name: pointerDown$1,
7263
7445
 
7264
7446
  filter() {
7265
7447
  return includes(this.mode, 'hover');
@@ -7277,7 +7459,7 @@
7277
7459
  trigger(this.$el, 'focus');
7278
7460
  once(
7279
7461
  document,
7280
- pointerDown,
7462
+ pointerDown$1,
7281
7463
  () => trigger(this.$el, 'blur'),
7282
7464
  true,
7283
7465
  (e) => !within(e.target, this.$el));
@@ -8276,6 +8458,11 @@
8276
8458
  this.interval && clearInterval(this.interval);
8277
8459
  } } };
8278
8460
 
8461
+ const pointerOptions = { passive: false, capture: true };
8462
+ const pointerDown = 'touchstart mousedown';
8463
+ const pointerMove = 'touchmove mousemove';
8464
+ const pointerUp = 'touchend touchcancel mouseup click input';
8465
+
8279
8466
  var SliderDrag = {
8280
8467
  props: {
8281
8468
  draggable: Boolean },
@@ -8328,7 +8515,17 @@
8328
8515
 
8329
8516
  handler(e) {
8330
8517
  e.preventDefault();
8331
- } }],
8518
+ } },
8519
+
8520
+
8521
+ {
8522
+ // iOS workaround for slider stopping if swiping fast
8523
+ name: pointerMove + " " + pointerUp,
8524
+ el() {
8525
+ return this.list;
8526
+ },
8527
+ handler: noop,
8528
+ ...pointerOptions }],
8332
8529
 
8333
8530
 
8334
8531
 
@@ -8350,10 +8547,10 @@
8350
8547
  this.prevIndex = this.index;
8351
8548
  }
8352
8549
 
8353
- on(document, pointerMove, this.move, { passive: false });
8550
+ on(document, pointerMove, this.move, pointerOptions);
8354
8551
 
8355
8552
  // 'input' event is triggered by video controls
8356
- on(document, pointerUp + " " + pointerCancel + " input", this.end, true);
8553
+ on(document, pointerUp, this.end, pointerOptions);
8357
8554
 
8358
8555
  css(this.list, 'userSelect', 'none');
8359
8556
  },
@@ -8433,8 +8630,8 @@
8433
8630
  },
8434
8631
 
8435
8632
  end() {
8436
- off(document, pointerMove, this.move, { passive: false });
8437
- off(document, pointerUp + " " + pointerCancel + " input", this.end, true);
8633
+ off(document, pointerMove, this.move, pointerOptions);
8634
+ off(document, pointerUp, this.end, pointerOptions);
8438
8635
 
8439
8636
  if (this.dragging) {
8440
8637
  this.dragging = null;
@@ -8842,7 +9039,7 @@
8842
9039
 
8843
9040
  events: [
8844
9041
  {
8845
- name: pointerMove + " " + pointerDown + " keydown",
9042
+ name: pointerMove$1 + " " + pointerDown$1 + " keydown",
8846
9043
 
8847
9044
  handler: 'showControls' },
8848
9045
 
@@ -10497,7 +10694,7 @@
10497
10694
  },
10498
10695
 
10499
10696
  events: {
10500
- name: pointerDown,
10697
+ name: pointerDown$1,
10501
10698
  passive: false,
10502
10699
  handler: 'init' },
10503
10700
 
@@ -10627,8 +10824,8 @@
10627
10824
  this.placeholder = placeholder;
10628
10825
  this.origin = { target, index: index(placeholder), ...this.pos };
10629
10826
 
10630
- on(document, pointerMove, this.move);
10631
- on(document, pointerUp, this.end);
10827
+ on(document, pointerMove$1, this.move);
10828
+ on(document, pointerUp$1, this.end);
10632
10829
 
10633
10830
  if (!this.threshold) {
10634
10831
  this.start(e);
@@ -10664,8 +10861,8 @@
10664
10861
  },
10665
10862
 
10666
10863
  end() {
10667
- off(document, pointerMove, this.move);
10668
- off(document, pointerUp, this.end);
10864
+ off(document, pointerMove$1, this.move);
10865
+ off(document, pointerUp$1, this.end);
10669
10866
 
10670
10867
  if (!this.drag) {
10671
10868
  return;
@@ -10734,7 +10931,7 @@
10734
10931
  let last = Date.now();
10735
10932
  trackTimer = setInterval(() => {
10736
10933
  let { x, y } = pos;
10737
- y += scrollTop(window);
10934
+ y += document.scrollingElement.scrollTop;
10738
10935
 
10739
10936
  const dist = (Date.now() - last) * 0.3;
10740
10937
  last = Date.now();
@@ -10755,7 +10952,7 @@
10755
10952
  }
10756
10953
 
10757
10954
  if (scroll > 0 && scroll < scrollHeight - height) {
10758
- scrollTop(scrollEl, scroll);
10955
+ scrollEl.scrollTop = scroll;
10759
10956
  return true;
10760
10957
  }
10761
10958
  });
@@ -10900,11 +11097,11 @@
10900
11097
 
10901
11098
  this._unbind = once(
10902
11099
  document, "show keydown " +
10903
- pointerDown,
11100
+ pointerDown$1,
10904
11101
  this.hide,
10905
11102
  false,
10906
11103
  (e) =>
10907
- e.type === pointerDown && !within(e.target, this.$el) ||
11104
+ e.type === pointerDown$1 && !within(e.target, this.$el) ||
10908
11105
  e.type === 'keydown' && e.keyCode === 27 ||
10909
11106
  e.type === 'show' && e.detail[0] !== this && e.detail[0].$name === this.$name);
10910
11107
 
@@ -10975,7 +11172,7 @@
10975
11172
 
10976
11173
  // Clicking a button does not give it focus on all browsers and platforms
10977
11174
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
10978
- [pointerDown](e) {
11175
+ [pointerDown$1](e) {
10979
11176
  if (isTouch(e)) {
10980
11177
  this.show();
10981
11178
  }