uikit 3.14.3-dev.5325d42a0 → 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 (71) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/css/uikit-core-rtl.css +33 -17
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +33 -17
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +30 -17
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +30 -17
  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 +110 -16
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +110 -16
  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 +2 -2
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +2 -2
  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 +2 -2
  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 +8 -6
  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 +666 -618
  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 +1472 -1409
  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/drop.js +7 -0
  45. package/src/js/core/height-viewport.js +9 -5
  46. package/src/js/core/offcanvas.js +1 -47
  47. package/src/js/core/sticky.js +8 -9
  48. package/src/js/core/switcher.js +1 -1
  49. package/src/js/mixin/modal.js +90 -4
  50. package/src/js/mixin/parallax.js +1 -1
  51. package/src/js/mixin/position.js +8 -0
  52. package/src/js/mixin/slider-drag.js +20 -8
  53. package/src/js/mixin/togglable.js +0 -5
  54. package/src/js/util/dimensions.js +6 -6
  55. package/src/js/util/position.js +2 -0
  56. package/src/js/util/viewport.js +22 -36
  57. package/src/less/components/nav.less +22 -4
  58. package/src/less/components/navbar.less +8 -17
  59. package/src/less/components/utility.less +12 -3
  60. package/src/less/theme/nav.less +3 -7
  61. package/src/less/theme/navbar.less +3 -1
  62. package/src/scss/components/nav.scss +22 -4
  63. package/src/scss/components/navbar.scss +8 -17
  64. package/src/scss/components/utility.scss +12 -3
  65. package/src/scss/mixins-theme.scss +1 -1
  66. package/src/scss/theme/nav.scss +3 -7
  67. package/src/scss/theme/navbar.scss +3 -1
  68. package/src/scss/variables-theme.scss +10 -4
  69. package/src/scss/variables.scss +10 -3
  70. package/tests/drop.html +6 -0
  71. package/tests/navbar.html +2041 -1267
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.3-dev.5325d42a0 | 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() :
@@ -1060,13 +1060,13 @@
1060
1060
  }
1061
1061
 
1062
1062
  function offsetPosition(element) {
1063
- const offset = [0, 0];
1064
-
1065
1063
  element = toNode(element);
1066
1064
 
1067
- do {
1068
- offset[0] += element.offsetTop;
1069
- 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"));
1070
1070
 
1071
1071
  if (css(element, 'position') === 'fixed') {
1072
1072
  const win = toWindow(element);
@@ -1074,7 +1074,7 @@
1074
1074
  offset[1] += win.scrollX;
1075
1075
  return offset;
1076
1076
  }
1077
- } while (element = element.offsetParent);
1077
+ }
1078
1078
 
1079
1079
  return offset;
1080
1080
  }
@@ -1293,9 +1293,9 @@
1293
1293
  const hasTouch = inBrowser && 'ontouchstart' in window;
1294
1294
  const hasPointerEvents = inBrowser && window.PointerEvent;
1295
1295
 
1296
- const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1297
- const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1298
- 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';
1299
1299
  const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
1300
1300
  const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
1301
1301
  const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
@@ -1795,20 +1795,6 @@
1795
1795
 
1796
1796
  }
1797
1797
 
1798
- function scrollTop(element, top) {
1799
- if (isWindow(element) || isDocument(element)) {
1800
- element = scrollingElement(element);
1801
- } else {
1802
- element = toNode(element);
1803
- }
1804
-
1805
- if (isUndefined(top)) {
1806
- return element.scrollTop;
1807
- } else {
1808
- element.scrollTop = top;
1809
- }
1810
- }
1811
-
1812
1798
  function scrollIntoView(element, _temp) {let { offset: offsetBy = 0 } = _temp === void 0 ? {} : _temp;
1813
1799
  const parents = isVisible(element) ? scrollParents(element) : [];
1814
1800
  return parents.reduce(
@@ -1850,7 +1836,7 @@
1850
1836
  (function step() {
1851
1837
  const percent = ease(clamp((Date.now() - start) / duration));
1852
1838
 
1853
- scrollTop(element, scroll + top * percent);
1839
+ element.scrollTop = scroll + top * percent;
1854
1840
 
1855
1841
  // scroll more if we have not reached our destination
1856
1842
  if (percent === 1) {
@@ -1911,18 +1897,33 @@
1911
1897
  }
1912
1898
 
1913
1899
  function offsetViewport(scrollElement) {
1914
- 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
+ }
1915
1916
 
1916
1917
  let rect = offset(viewportElement);
1917
1918
  for (let [prop, dir, start, end] of [
1918
1919
  ['width', 'x', 'left', 'right'],
1919
1920
  ['height', 'y', 'top', 'bottom']])
1920
1921
  {
1921
- if (!isWindow(viewportElement)) {
1922
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1923
- } else {
1922
+ if (isWindow(viewportElement)) {
1924
1923
  // iOS 12 returns <body> as scrollingElement
1925
- viewportElement = viewportElement.document.documentElement;
1924
+ viewportElement = documentElement;
1925
+ } else {
1926
+ rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1926
1927
  }
1927
1928
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1928
1929
  rect[end] = rect[prop] + rect[start];
@@ -1934,10 +1935,6 @@
1934
1935
  return toWindow(element).document.scrollingElement;
1935
1936
  }
1936
1937
 
1937
- function getViewport$1(scrollElement) {
1938
- return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1939
- }
1940
-
1941
1938
  const dirs = [
1942
1939
  ['width', 'x', 'left', 'right'],
1943
1940
  ['height', 'y', 'top', 'bottom']];
@@ -2094,6 +2091,8 @@
2094
2091
  if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2095
2092
  return newPos;
2096
2093
  }
2094
+
2095
+ continue;
2097
2096
  }
2098
2097
  }
2099
2098
 
@@ -2194,9 +2193,9 @@
2194
2193
  inBrowser: inBrowser,
2195
2194
  isRtl: isRtl,
2196
2195
  hasTouch: hasTouch,
2197
- pointerDown: pointerDown,
2198
- pointerMove: pointerMove,
2199
- pointerUp: pointerUp,
2196
+ pointerDown: pointerDown$1,
2197
+ pointerMove: pointerMove$1,
2198
+ pointerUp: pointerUp$1,
2200
2199
  pointerEnter: pointerEnter,
2201
2200
  pointerLeave: pointerLeave,
2202
2201
  pointerCancel: pointerCancel,
@@ -2287,7 +2286,6 @@
2287
2286
  getCssVar: getCssVar,
2288
2287
  propName: propName,
2289
2288
  isInView: isInView,
2290
- scrollTop: scrollTop,
2291
2289
  scrollIntoView: scrollIntoView,
2292
2290
  scrolledOver: scrolledOver,
2293
2291
  scrollParents: scrollParents,
@@ -2950,7 +2948,7 @@
2950
2948
  UIkit.data = '__uikit__';
2951
2949
  UIkit.prefix = 'uk-';
2952
2950
  UIkit.options = {};
2953
- UIkit.version = '3.14.3-dev.5325d42a0';
2951
+ UIkit.version = '3.14.4-dev.008162cc3';
2954
2952
 
2955
2953
  globalAPI(UIkit);
2956
2954
  hooksAPI(UIkit);
@@ -3099,11 +3097,6 @@
3099
3097
  return Promise.reject();
3100
3098
  }
3101
3099
 
3102
- if (!animate) {
3103
- Animation.cancel(el);
3104
- Transition.cancel(el);
3105
- }
3106
-
3107
3100
  const promise = (
3108
3101
  isFunction(animate) ?
3109
3102
  animate :
@@ -3692,6 +3685,9 @@
3692
3685
  offset = offset.reverse();
3693
3686
  }
3694
3687
 
3688
+ const [scrollElement] = scrollParents(element, /auto|scroll/);
3689
+ const { scrollTop, scrollLeft } = scrollElement;
3690
+
3695
3691
  // Ensure none positioned element does not generate scrollbars
3696
3692
  const elDim = dimensions$1(element);
3697
3693
  css(element, { top: -elDim.height, left: -elDim.width });
@@ -3703,6 +3699,10 @@
3703
3699
  flip: this.flip,
3704
3700
  viewportOffset: this.getViewportOffset(element) });
3705
3701
 
3702
+
3703
+ // Restore scroll position
3704
+ scrollElement.scrollTop = scrollTop;
3705
+ scrollElement.scrollLeft = scrollLeft;
3706
3706
  },
3707
3707
 
3708
3708
  getPositionOffset(element) {
@@ -3729,64 +3729,44 @@
3729
3729
  return toPx(getCssVar('position-viewport-offset', element));
3730
3730
  } } };
3731
3731
 
3732
- let active$1;
3733
-
3734
- var drop = {
3735
- mixins: [Container, Lazyload, Position, Togglable],
3732
+ const active$1 = [];
3736
3733
 
3737
- args: 'pos',
3734
+ var Modal = {
3735
+ mixins: [Class, Container, Togglable],
3738
3736
 
3739
3737
  props: {
3740
- mode: 'list',
3741
- toggle: Boolean,
3742
- boundary: Boolean,
3743
- boundaryAlign: Boolean,
3744
- delayShow: Number,
3745
- delayHide: Number,
3746
- display: String,
3747
- clsDrop: String,
3748
- animateOut: Boolean },
3738
+ selPanel: String,
3739
+ selClose: String,
3740
+ escClose: Boolean,
3741
+ bgClose: Boolean,
3742
+ stack: Boolean },
3749
3743
 
3750
3744
 
3751
3745
  data: {
3752
- mode: ['click', 'hover'],
3753
- toggle: '- *',
3754
- boundary: true,
3755
- boundaryAlign: false,
3756
- delayShow: 0,
3757
- delayHide: 800,
3758
- display: null,
3759
- clsDrop: false,
3760
- animation: ['uk-animation-fade'],
3761
3746
  cls: 'uk-open',
3762
- container: false,
3763
- animateOut: false },
3747
+ escClose: true,
3748
+ bgClose: true,
3749
+ overlay: true,
3750
+ stack: false },
3764
3751
 
3765
3752
 
3766
- created() {
3767
- this.tracker = new MouseTracker();
3768
- },
3753
+ computed: {
3754
+ panel(_ref, $el) {let { selPanel } = _ref;
3755
+ return $(selPanel, $el);
3756
+ },
3769
3757
 
3770
- beforeConnect() {
3771
- this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
3772
- },
3758
+ transitionElement() {
3759
+ return this.panel;
3760
+ },
3773
3761
 
3774
- connected() {
3775
- addClass(this.$el, this.clsDrop);
3762
+ bgClose(_ref2) {let { bgClose } = _ref2;
3763
+ return bgClose && this.panel;
3764
+ } },
3776
3765
 
3777
- if (this.toggle && !this.target) {
3778
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
3779
- target: this.$el,
3780
- mode: this.mode }).
3781
- $el;
3782
- attr(this.target, 'aria-haspopup', true);
3783
- this.lazyload(this.target);
3784
- }
3785
- },
3786
3766
 
3787
- disconnected() {
3788
- if (this.isActive()) {
3789
- active$1 = null;
3767
+ beforeDisconnect() {
3768
+ if (includes(active$1, this)) {
3769
+ this.toggleElement(this.$el, false, false);
3790
3770
  }
3791
3771
  },
3792
3772
 
@@ -3795,767 +3775,825 @@
3795
3775
  name: 'click',
3796
3776
 
3797
3777
  delegate() {
3798
- return "." + this.clsDrop + "-close";
3778
+ return this.selClose;
3799
3779
  },
3800
3780
 
3801
3781
  handler(e) {
3802
3782
  e.preventDefault();
3803
- this.hide(false);
3783
+ this.hide();
3804
3784
  } },
3805
3785
 
3806
3786
 
3807
3787
  {
3808
- name: 'click',
3788
+ name: 'toggle',
3809
3789
 
3810
- delegate() {
3811
- return 'a[href^="#"]';
3812
- },
3790
+ self: true,
3813
3791
 
3814
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
3815
- if (!defaultPrevented && hash && !within(hash, this.$el)) {
3816
- this.hide(false);
3792
+ handler(e) {
3793
+ if (e.defaultPrevented) {
3794
+ return;
3817
3795
  }
3818
- } },
3819
3796
 
3797
+ e.preventDefault();
3820
3798
 
3821
- {
3822
- name: 'beforescroll',
3823
-
3824
- handler() {
3825
- this.hide(false);
3799
+ if (this.isToggled() === includes(active$1, this)) {
3800
+ this.toggle();
3801
+ }
3826
3802
  } },
3827
3803
 
3828
3804
 
3829
3805
  {
3830
- name: 'toggle',
3806
+ name: 'beforeshow',
3831
3807
 
3832
3808
  self: true,
3833
3809
 
3834
- handler(e, toggle) {
3835
- e.preventDefault();
3810
+ handler(e) {
3811
+ if (includes(active$1, this)) {
3812
+ return false;
3813
+ }
3836
3814
 
3837
- if (this.isToggled()) {
3838
- 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();
3839
3818
  } else {
3840
- this.show(toggle == null ? void 0 : toggle.$el, false);
3819
+ active$1.push(this);
3841
3820
  }
3842
3821
  } },
3843
3822
 
3844
3823
 
3845
3824
  {
3846
- name: 'toggleshow',
3825
+ name: 'show',
3847
3826
 
3848
3827
  self: true,
3849
3828
 
3850
- handler(e, toggle) {
3851
- e.preventDefault();
3852
- this.show(toggle == null ? void 0 : toggle.$el);
3853
- } },
3854
-
3855
-
3856
- {
3857
- 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
+ }));
3858
3838
 
3859
- self: true,
3860
3839
 
3861
- handler(e) {
3862
- e.preventDefault();
3863
- if (!matches(this.$el, ':focus,:hover')) {
3864
- this.hide();
3840
+ if (this.overlay) {
3841
+ once(this.$el, 'hide', preventOverscroll(this.$el));
3842
+ once(this.$el, 'hide', preventBackgroundScroll());
3865
3843
  }
3866
- } },
3867
3844
 
3845
+ if (this.stack) {
3846
+ css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
3847
+ }
3868
3848
 
3869
- {
3870
- name: pointerEnter + " focusin",
3849
+ addClass(document.documentElement, this.clsPage);
3871
3850
 
3872
- filter() {
3873
- return includes(this.mode, 'hover');
3874
- },
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
+ }
3875
3863
 
3876
- handler(e) {
3877
- if (!isTouch(e)) {
3878
- this.clearTimers();
3879
- }
3880
- } },
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);
3881
3877
 
3878
+ }),
3879
+ { self: true });
3882
3880
 
3883
- {
3884
- name: pointerLeave + " focusout",
3881
+ }
3885
3882
 
3886
- filter() {
3887
- return includes(this.mode, 'hover');
3888
- },
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 });
3889
3893
 
3890
- handler(e) {
3891
- if (!isTouch(e) && e.relatedTarget) {
3892
- this.hide();
3893
3894
  }
3894
3895
  } },
3895
3896
 
3896
3897
 
3897
3898
  {
3898
- name: 'toggled',
3899
+ name: 'shown',
3899
3900
 
3900
3901
  self: true,
3901
3902
 
3902
- handler(e, toggled) {
3903
- if (!toggled) {
3904
- return;
3903
+ handler() {
3904
+ if (!isFocusable(this.$el)) {
3905
+ attr(this.$el, 'tabindex', '-1');
3905
3906
  }
3906
3907
 
3907
- this.clearTimers();
3908
- this.position();
3908
+ if (!$(':focus', this.$el)) {
3909
+ this.$el.focus();
3910
+ }
3909
3911
  } },
3910
3912
 
3911
3913
 
3912
3914
  {
3913
- name: 'show',
3915
+ name: 'hidden',
3914
3916
 
3915
3917
  self: true,
3916
3918
 
3917
3919
  handler() {
3918
- active$1 = this;
3919
-
3920
- this.tracker.init();
3920
+ if (includes(active$1, this)) {
3921
+ active$1.splice(active$1.indexOf(this), 1);
3922
+ }
3921
3923
 
3922
- for (const handler of [
3923
- on(
3924
- document,
3925
- pointerDown,
3926
- (_ref2) => {let { target } = _ref2;return (
3927
- !within(target, this.$el) &&
3928
- once(
3929
- document,
3930
- pointerUp + " " + pointerCancel + " scroll",
3931
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
3932
- if (
3933
- !defaultPrevented &&
3934
- type === pointerUp &&
3935
- target === newTarget &&
3936
- !(this.target && within(target, this.target)))
3937
- {
3938
- this.hide(false);
3939
- }
3940
- },
3941
- true));}),
3924
+ if (!active$1.length) {
3925
+ css(document.body, 'overflowY', '');
3926
+ }
3942
3927
 
3928
+ css(this.$el, 'zIndex', '');
3943
3929
 
3930
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3931
+ removeClass(document.documentElement, this.clsPage);
3932
+ }
3933
+ } }],
3944
3934
 
3945
- on(document, 'keydown', (e) => {
3946
- if (e.keyCode === 27) {
3947
- this.hide(false);
3948
- }
3949
- }),
3950
3935
 
3951
- ...(this.display === 'static' && this.align !== 'stretch' ?
3952
- [] :
3953
- (() => {
3954
- const handler = () => this.$emit();
3955
- return [
3956
- on(window, 'resize', handler),
3957
- on(document, 'scroll', handler, true),
3958
- (() => {
3959
- const observer = observeResize(
3960
- scrollParents(this.$el),
3961
- handler);
3962
3936
 
3963
- return () => observer.disconnect();
3964
- })()];
3937
+ methods: {
3938
+ toggle() {
3939
+ return this.isToggled() ? this.hide() : this.show();
3940
+ },
3941
+
3942
+ show() {
3943
+ if (this.container && parent(this.$el) !== this.container) {
3944
+ append(this.container, this.$el);
3945
+ return new Promise((resolve) =>
3946
+ requestAnimationFrame(() => this.show().then(resolve)));
3965
3947
 
3966
- })())])
3967
- {
3968
- once(this.$el, 'hide', handler, { self: true });
3969
3948
  }
3970
- } },
3971
3949
 
3950
+ return this.toggleElement(this.$el, true, animate(this));
3951
+ },
3972
3952
 
3973
- {
3974
- name: 'beforehide',
3953
+ hide() {
3954
+ return this.toggleElement(this.$el, false, animate(this));
3955
+ } } };
3975
3956
 
3976
- self: true,
3977
3957
 
3978
- handler() {
3979
- this.clearTimers();
3980
- } },
3981
3958
 
3959
+ function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
3960
+ return (el, show) =>
3961
+ new Promise((resolve, reject) =>
3962
+ once(el, 'show hide', () => {
3963
+ el._reject == null ? void 0 : el._reject();
3964
+ el._reject = reject;
3982
3965
 
3983
- {
3984
- name: 'hide',
3966
+ _toggle(el, show);
3985
3967
 
3986
- handler(_ref4) {let { target } = _ref4;
3987
- if (this.$el !== target) {
3988
- active$1 =
3989
- active$1 === null && within(target, this.$el) && this.isToggled() ?
3990
- this :
3991
- active$1;
3992
- return;
3993
- }
3968
+ const off = once(
3969
+ transitionElement,
3970
+ 'transitionstart',
3971
+ () => {
3972
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3973
+ self: true });
3994
3974
 
3995
- active$1 = this.isActive() ? null : active$1;
3996
- this.tracker.cancel();
3997
- } }],
3975
+ clearTimeout(timer);
3976
+ },
3977
+ { self: true });
3998
3978
 
3999
3979
 
3980
+ const timer = setTimeout(() => {
3981
+ off();
3982
+ resolve();
3983
+ }, toMs(css(transitionElement, 'transitionDuration')));
3984
+ })).
3985
+ then(() => delete el._reject);
3986
+ }
4000
3987
 
4001
- update: {
4002
- write() {
4003
- if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
4004
- this.position();
4005
- }
4006
- } },
3988
+ function toMs(time) {
3989
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3990
+ }
4007
3991
 
3992
+ function preventOverscroll(el) {
3993
+ if (CSS.supports('overscroll-behavior', 'contain')) {
3994
+ const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
3995
+ css(elements, 'overscrollBehavior', 'contain');
3996
+ return () => css(elements, 'overscrollBehavior', '');
3997
+ }
4008
3998
 
4009
- methods: {
4010
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4011
- if (this.isToggled() && target && this.target && target !== this.target) {
4012
- this.hide(false, false);
4013
- }
3999
+ let startClientY;
4014
4000
 
4015
- this.target = target;
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 }),
4016
4011
 
4017
- this.clearTimers();
4018
4012
 
4019
- if (this.isActive()) {
4020
- return;
4021
- }
4013
+ on(
4014
+ el,
4015
+ 'touchmove',
4016
+ (e) => {
4017
+ if (e.targetTouches.length !== 1) {
4018
+ return;
4019
+ }
4022
4020
 
4023
- if (active$1) {
4024
- if (delay && active$1.isDelaying) {
4025
- this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4026
- return;
4027
- }
4021
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
4022
+ if (!within(scrollParent, el)) {
4023
+ scrollParent = el;
4024
+ }
4028
4025
 
4029
- let prev;
4030
- while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
4031
- prev = active$1;
4032
- active$1.hide(false, false);
4033
- }
4034
- }
4026
+ const clientY = e.targetTouches[0].clientY - startClientY;
4027
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
4035
4028
 
4036
- if (this.container && parent(this.$el) !== this.container) {
4037
- append(this.container, this.$el);
4038
- }
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 })];
4039
4038
 
4040
- this.showTimer = setTimeout(
4041
- () => this.toggleElement(this.$el, true),
4042
- delay && this.delayShow || 0);
4043
4039
 
4044
- },
4045
4040
 
4046
- hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
4047
- const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
4041
+ return () => events.forEach((fn) => fn());
4042
+ }
4048
4043
 
4049
- this.clearTimers();
4044
+ function preventBackgroundScroll() {
4045
+ const { body, documentElement } = document;
4046
+ css(body, {
4047
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4048
+ touchAction: 'none' });
4050
4049
 
4051
- this.isDelaying = getPositionedElements(this.$el).some((el) =>
4052
- this.tracker.movesTo(el));
4050
+ css(documentElement, 'overflowY', 'hidden');
4051
+ return () => {
4052
+ css(documentElement, 'overflowY', '');
4053
+ css(body, { overflowY: '', touchAction: '' });
4054
+ };
4055
+ }
4053
4056
 
4057
+ function filterChildren(el, fn) {
4058
+ const children = [];
4059
+ apply(el, (node) => {
4060
+ if (fn(node)) {
4061
+ children.push(node);
4062
+ }
4063
+ });
4064
+ return children;
4065
+ }
4054
4066
 
4055
- if (delay && this.isDelaying) {
4056
- this.hideTimer = setTimeout(this.hide, 50);
4057
- } else if (delay && this.delayHide) {
4058
- this.hideTimer = setTimeout(hide, this.delayHide);
4059
- } else {
4060
- hide();
4061
- }
4062
- },
4067
+ let active;
4063
4068
 
4064
- clearTimers() {
4065
- clearTimeout(this.showTimer);
4066
- clearTimeout(this.hideTimer);
4067
- this.showTimer = null;
4068
- this.hideTimer = null;
4069
- this.isDelaying = false;
4070
- },
4069
+ var drop = {
4070
+ mixins: [Container, Lazyload, Position, Togglable],
4071
4071
 
4072
- isActive() {
4073
- return active$1 === this;
4074
- },
4072
+ args: 'pos',
4075
4073
 
4076
- position() {
4077
- removeClass(this.$el, this.clsDrop + "-stack");
4078
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4079
- toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4074
+ props: {
4075
+ mode: 'list',
4076
+ toggle: Boolean,
4077
+ boundary: Boolean,
4078
+ boundaryAlign: Boolean,
4079
+ delayShow: Number,
4080
+ delayHide: Number,
4081
+ display: String,
4082
+ clsDrop: String,
4083
+ animateOut: Boolean,
4084
+ bgScroll: Boolean },
4080
4085
 
4081
- const boundary = query(this.boundary, this.$el);
4082
- const target = boundary && this.boundaryAlign ? boundary : this.target;
4083
- const [scrollParent] = scrollParents(
4084
- boundary && this.boundaryAlign ? boundary : this.$el);
4085
4086
 
4086
- const scrollParentOffset = offset(scrollParent);
4087
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4088
- const viewportOffset = this.getViewportOffset(this.$el);
4087
+ data: {
4088
+ mode: ['click', 'hover'],
4089
+ toggle: '- *',
4090
+ boundary: true,
4091
+ boundaryAlign: false,
4092
+ delayShow: 0,
4093
+ delayHide: 800,
4094
+ display: null,
4095
+ clsDrop: false,
4096
+ animation: ['uk-animation-fade'],
4097
+ cls: 'uk-open',
4098
+ container: false,
4099
+ animateOut: false,
4100
+ bgScroll: true },
4089
4101
 
4090
- css(this.$el, 'maxWidth', '');
4091
- const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4092
4102
 
4093
- if (this.align === 'justify') {
4094
- const prop = this.axis === 'y' ? 'width' : 'height';
4095
- css(
4096
- this.$el,
4097
- prop,
4098
- Math.min(
4099
- (boundary ? boundaryOffset : offset(this.target))[prop],
4100
- scrollParentOffset[prop] - 2 * viewportOffset));
4103
+ created() {
4104
+ this.tracker = new MouseTracker();
4105
+ },
4101
4106
 
4107
+ beforeConnect() {
4108
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4109
+ },
4102
4110
 
4103
- } else if (this.align === 'stretch') {
4104
- this.flip = this.axis === 'y' ? 'x' : 'y';
4105
- this.display = 'static';
4111
+ connected() {
4112
+ addClass(this.$el, this.clsDrop);
4106
4113
 
4107
- const viewport = offsetViewport(scrollParent);
4108
- const targetDim = offset(target);
4109
- const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4114
+ if (this.toggle && !this.target) {
4115
+ this.target = this.$create('toggle', query(this.toggle, this.$el), {
4116
+ target: this.$el,
4117
+ mode: this.mode }).
4118
+ $el;
4119
+ attr(this.target, 'aria-haspopup', true);
4120
+ this.lazyload(this.target);
4121
+ }
4122
+ },
4110
4123
 
4111
- css(this.$el, {
4112
- width:
4113
- this.axis === 'y' ?
4114
- viewport.width :
4115
- (this.dir === 'left' ?
4116
- targetDim.left - viewport.left :
4117
- viewport.right - targetDim.right) - elOffset,
4118
- height:
4119
- this.axis === 'x' ?
4120
- viewport.height :
4121
- (this.dir === 'top' ?
4122
- targetDim.top - viewport.top :
4123
- viewport.bottom - targetDim.bottom) - elOffset });
4124
+ disconnected() {
4125
+ if (this.isActive()) {
4126
+ active = null;
4127
+ }
4128
+ },
4124
4129
 
4125
- } else if (this.$el.offsetWidth > maxWidth) {
4126
- addClass(this.$el, this.clsDrop + "-stack");
4127
- }
4130
+ events: [
4131
+ {
4132
+ name: 'click',
4128
4133
 
4129
- css(this.$el, 'maxWidth', maxWidth);
4134
+ delegate() {
4135
+ return "." + this.clsDrop + "-close";
4136
+ },
4130
4137
 
4131
- this.positionAt(this.$el, target, boundary);
4132
- } } };
4138
+ handler(e) {
4139
+ e.preventDefault();
4140
+ this.hide(false);
4141
+ } },
4133
4142
 
4134
4143
 
4144
+ {
4145
+ name: 'click',
4135
4146
 
4136
- function getPositionedElements(el) {
4137
- const result = [];
4138
- apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
4139
- return result;
4140
- }
4147
+ delegate() {
4148
+ return 'a[href^="#"]';
4149
+ },
4141
4150
 
4142
- var formCustom = {
4143
- mixins: [Class],
4151
+ handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4152
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4153
+ this.hide(false);
4154
+ }
4155
+ } },
4144
4156
 
4145
- args: 'target',
4146
4157
 
4147
- props: {
4148
- target: Boolean },
4158
+ {
4159
+ name: 'beforescroll',
4149
4160
 
4161
+ handler() {
4162
+ this.hide(false);
4163
+ } },
4150
4164
 
4151
- data: {
4152
- target: false },
4153
4165
 
4166
+ {
4167
+ name: 'toggle',
4154
4168
 
4155
- computed: {
4156
- input(_, $el) {
4157
- return $(selInput, $el);
4158
- },
4169
+ self: true,
4159
4170
 
4160
- state() {
4161
- return this.input.nextElementSibling;
4162
- },
4171
+ handler(e, toggle) {
4172
+ e.preventDefault();
4163
4173
 
4164
- target(_ref, $el) {let { target } = _ref;
4165
- return (
4166
- target && (
4167
- target === true && parent(this.input) === $el && this.input.nextElementSibling ||
4168
- $(target, $el)));
4174
+ if (this.isToggled()) {
4175
+ this.hide(false);
4176
+ } else {
4177
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4178
+ }
4179
+ } },
4180
+
4181
+
4182
+ {
4183
+ name: 'toggleshow',
4184
+
4185
+ self: true,
4169
4186
 
4187
+ handler(e, toggle) {
4188
+ e.preventDefault();
4189
+ this.show(toggle == null ? void 0 : toggle.$el);
4170
4190
  } },
4171
4191
 
4172
4192
 
4173
- update() {var _input$files;
4174
- const { target, input } = this;
4193
+ {
4194
+ name: 'togglehide',
4175
4195
 
4176
- if (!target) {
4177
- return;
4178
- }
4196
+ self: true,
4179
4197
 
4180
- let option;
4181
- const prop = isInput(target) ? 'value' : 'textContent';
4182
- const prev = target[prop];
4183
- const value = (_input$files = input.files) != null && _input$files[0] ?
4184
- input.files[0].name :
4185
- matches(input, 'select') && (
4186
- option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
4187
- ? option.textContent :
4188
- input.value;
4198
+ handler(e) {
4199
+ e.preventDefault();
4200
+ if (!matches(this.$el, ':focus,:hover')) {
4201
+ this.hide();
4202
+ }
4203
+ } },
4189
4204
 
4190
- if (prev !== value) {
4191
- target[prop] = value;
4192
- }
4193
- },
4194
4205
 
4195
- events: [
4196
4206
  {
4197
- name: 'change',
4207
+ name: pointerEnter + " focusin",
4198
4208
 
4199
- handler() {
4200
- this.$emit();
4209
+ filter() {
4210
+ return includes(this.mode, 'hover');
4211
+ },
4212
+
4213
+ handler(e) {
4214
+ if (!isTouch(e)) {
4215
+ this.clearTimers();
4216
+ }
4201
4217
  } },
4202
4218
 
4203
4219
 
4204
4220
  {
4205
- name: 'reset',
4221
+ name: pointerLeave + " focusout",
4206
4222
 
4207
- el() {
4208
- return closest(this.$el, 'form');
4223
+ filter() {
4224
+ return includes(this.mode, 'hover');
4209
4225
  },
4210
4226
 
4211
- handler() {
4212
- this.$emit();
4213
- } }] };
4227
+ handler(e) {
4228
+ if (!isTouch(e) && e.relatedTarget) {
4229
+ this.hide();
4230
+ }
4231
+ } },
4214
4232
 
4215
- var Margin = {
4216
- mixins: [Resize],
4217
4233
 
4218
- props: {
4219
- margin: String,
4220
- firstColumn: Boolean },
4234
+ {
4235
+ name: 'toggled',
4221
4236
 
4237
+ self: true,
4222
4238
 
4223
- data: {
4224
- margin: 'uk-margin-small-top',
4225
- firstColumn: 'uk-first-column' },
4239
+ handler(e, toggled) {
4240
+ if (!toggled) {
4241
+ return;
4242
+ }
4226
4243
 
4244
+ this.clearTimers();
4245
+ this.position();
4246
+ } },
4227
4247
 
4228
- resizeTargets() {
4229
- return [this.$el, ...toArray(this.$el.children)];
4230
- },
4231
4248
 
4232
- connected() {
4233
- this.registerObserver(
4234
- observeMutation(this.$el, () => this.$reset(), {
4235
- childList: true }));
4249
+ {
4250
+ name: 'show',
4236
4251
 
4252
+ self: true,
4237
4253
 
4238
- },
4254
+ handler() {
4255
+ active = this;
4239
4256
 
4240
- update: {
4241
- read() {
4242
- const rows = getRows(this.$el.children);
4257
+ this.tracker.init();
4243
4258
 
4244
- return {
4245
- rows,
4246
- columns: getColumns(rows) };
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));}),
4247
4279
 
4248
- },
4249
4280
 
4250
- write(_ref) {let { columns, rows } = _ref;
4251
- for (const row of rows) {
4252
- for (const column of row) {
4253
- toggleClass(column, this.margin, rows[0] !== row);
4254
- toggleClass(column, this.firstColumn, columns[0].includes(column));
4255
- }
4256
- }
4257
- },
4258
4281
 
4259
- events: ['resize'] } };
4282
+ on(document, 'keydown', (e) => {
4283
+ if (e.keyCode === 27) {
4284
+ this.hide(false);
4285
+ }
4286
+ }),
4260
4287
 
4288
+ ...(this.bgScroll ?
4289
+ [] :
4290
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4261
4291
 
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);
4262
4303
 
4263
- function getRows(items) {
4264
- return sortBy(items, 'top', 'bottom');
4265
- }
4304
+ return () => observer.disconnect();
4305
+ })()];
4266
4306
 
4267
- function getColumns(rows) {
4268
- const columns = [];
4307
+ })())])
4308
+ {
4309
+ once(this.$el, 'hide', handler, { self: true });
4310
+ }
4311
+ } },
4269
4312
 
4270
- for (const row of rows) {
4271
- const sorted = sortBy(row, 'left', 'right');
4272
- for (let j = 0; j < sorted.length; j++) {
4273
- columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4274
- }
4275
- }
4276
4313
 
4277
- return isRtl ? columns.reverse() : columns;
4278
- }
4314
+ {
4315
+ name: 'beforehide',
4279
4316
 
4280
- function sortBy(items, startProp, endProp) {
4281
- const sorted = [[]];
4317
+ self: true,
4282
4318
 
4283
- for (const el of items) {
4284
- if (!isVisible(el)) {
4285
- continue;
4286
- }
4319
+ handler() {
4320
+ this.clearTimers();
4321
+ } },
4287
4322
 
4288
- let dim = getOffset(el);
4289
4323
 
4290
- for (let i = sorted.length - 1; i >= 0; i--) {
4291
- const current = sorted[i];
4324
+ {
4325
+ name: 'hide',
4292
4326
 
4293
- if (!current[0]) {
4294
- current.push(el);
4295
- break;
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;
4296
4334
  }
4297
4335
 
4298
- let startDim;
4299
- if (current[0].offsetParent === el.offsetParent) {
4300
- startDim = getOffset(current[0]);
4301
- } else {
4302
- dim = getOffset(el, true);
4303
- startDim = getOffset(current[0], true);
4304
- }
4336
+ active = this.isActive() ? null : active;
4337
+ this.tracker.cancel();
4338
+ } }],
4305
4339
 
4306
- if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4307
- sorted.push([el]);
4308
- break;
4309
- }
4310
4340
 
4311
- if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4312
- current.push(el);
4313
- break;
4341
+
4342
+ update: {
4343
+ write() {
4344
+ if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
4345
+ this.position();
4314
4346
  }
4347
+ } },
4315
4348
 
4316
- if (i === 0) {
4317
- sorted.unshift([el]);
4318
- break;
4349
+
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);
4319
4354
  }
4320
- }
4321
- }
4322
4355
 
4323
- return sorted;
4324
- }
4356
+ this.target = target;
4325
4357
 
4326
- function getOffset(element, offset) {if (offset === void 0) {offset = false;}
4327
- let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;
4358
+ this.clearTimers();
4328
4359
 
4329
- if (offset) {
4330
- [offsetTop, offsetLeft] = offsetPosition(element);
4331
- }
4360
+ if (this.isActive()) {
4361
+ return;
4362
+ }
4332
4363
 
4333
- return {
4334
- top: offsetTop,
4335
- left: offsetLeft,
4336
- bottom: offsetTop + offsetHeight,
4337
- right: offsetLeft + offsetWidth };
4364
+ if (active) {
4365
+ if (delay && active.isDelaying) {
4366
+ this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4367
+ return;
4368
+ }
4338
4369
 
4339
- }
4370
+ let prev;
4371
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4372
+ prev = active;
4373
+ active.hide(false, false);
4374
+ }
4375
+ }
4340
4376
 
4341
- var Scroll = {
4342
- connected() {
4343
- registerScrollListener(this._uid, () => this.$emit('scroll'));
4344
- },
4377
+ if (this.container && parent(this.$el) !== this.container) {
4378
+ append(this.container, this.$el);
4379
+ }
4345
4380
 
4346
- disconnected() {
4347
- unregisterScrollListener(this._uid);
4348
- } };
4381
+ this.showTimer = setTimeout(
4382
+ () => this.toggleElement(this.$el, true),
4383
+ delay && this.delayShow || 0);
4349
4384
 
4385
+ },
4350
4386
 
4351
- const scrollListeners = new Map();
4352
- let unbindScrollListener;
4353
- function registerScrollListener(id, listener) {
4354
- unbindScrollListener =
4355
- unbindScrollListener ||
4356
- on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
4357
- passive: true,
4358
- capture: true });
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);
4359
4389
 
4390
+ this.clearTimers();
4360
4391
 
4361
- scrollListeners.set(id, listener);
4362
- }
4392
+ this.isDelaying = getPositionedElements(this.$el).some((el) =>
4393
+ this.tracker.movesTo(el));
4363
4394
 
4364
- function unregisterScrollListener(id) {
4365
- scrollListeners.delete(id);
4366
- if (unbindScrollListener && !scrollListeners.size) {
4367
- unbindScrollListener();
4368
- unbindScrollListener = null;
4369
- }
4370
- }
4371
4395
 
4372
- var grid = {
4373
- extends: Margin,
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
+ },
4374
4404
 
4375
- mixins: [Class, Scroll],
4405
+ clearTimers() {
4406
+ clearTimeout(this.showTimer);
4407
+ clearTimeout(this.hideTimer);
4408
+ this.showTimer = null;
4409
+ this.hideTimer = null;
4410
+ this.isDelaying = false;
4411
+ },
4376
4412
 
4377
- name: 'grid',
4413
+ isActive() {
4414
+ return active === this;
4415
+ },
4378
4416
 
4379
- props: {
4380
- masonry: Boolean,
4381
- parallax: Number },
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');
4382
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);
4383
4426
 
4384
- data: {
4385
- margin: 'uk-grid-margin',
4386
- clsStack: 'uk-grid-stack',
4387
- masonry: false,
4388
- parallax: 0 },
4427
+ const scrollParentOffset = offset(scrollParent);
4428
+ const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4429
+ const viewportOffset = this.getViewportOffset(this.$el);
4389
4430
 
4431
+ css(this.$el, 'maxWidth', '');
4432
+ const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
4390
4433
 
4391
- connected() {
4392
- this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4393
- },
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));
4394
4442
 
4395
- update: [
4396
- {
4397
- write(_ref) {let { columns } = _ref;
4398
- toggleClass(this.$el, this.clsStack, columns.length < 2);
4399
- },
4400
4443
 
4401
- events: ['resize'] },
4444
+ } else if (this.align === 'stretch') {
4445
+ this.flip = this.axis === 'y' ? 'x' : 'y';
4446
+ this.display = 'static';
4402
4447
 
4448
+ const viewport = offsetViewport(scrollParent);
4449
+ const targetDim = offset(target);
4450
+ const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4403
4451
 
4404
- {
4405
- read(data) {
4406
- let { columns, rows } = data;
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 });
4407
4465
 
4408
- // Filter component makes elements positioned absolute
4409
- if (
4410
- !columns.length ||
4411
- !this.masonry && !this.parallax ||
4412
- positionedAbsolute(this.$el))
4413
- {
4414
- data.translates = false;
4415
- return false;
4466
+ } else if (this.$el.offsetWidth > maxWidth) {
4467
+ addClass(this.$el, this.clsDrop + "-stack");
4416
4468
  }
4417
4469
 
4418
- let translates = false;
4470
+ css(this.$el, 'maxWidth', maxWidth);
4419
4471
 
4420
- const nodes = children(this.$el);
4421
- const columnHeights = getColumnHeights(columns);
4422
- const margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
4423
- const elHeight = Math.max(...columnHeights) + margin;
4472
+ this.positionAt(this.$el, target, boundary);
4473
+ } } };
4424
4474
 
4425
- if (this.masonry) {
4426
- columns = columns.map((column) => sortBy$1(column, 'offsetTop'));
4427
- translates = getTranslates(rows, columns);
4428
- }
4429
4475
 
4430
- let padding = Math.abs(this.parallax);
4431
- if (padding) {
4432
- padding = columnHeights.reduce(
4433
- (newPadding, hgt, i) =>
4434
- Math.max(
4435
- newPadding,
4436
- hgt + margin + (i % 2 ? padding : padding / 8) - elHeight),
4437
4476
 
4438
- 0);
4477
+ function getPositionedElements(el) {
4478
+ const result = [];
4479
+ apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
4480
+ return result;
4481
+ }
4439
4482
 
4440
- }
4483
+ var formCustom = {
4484
+ mixins: [Class],
4441
4485
 
4442
- return { padding, columns, translates, height: translates ? elHeight : '' };
4443
- },
4486
+ args: 'target',
4444
4487
 
4445
- write(_ref2) {let { height, padding } = _ref2;
4446
- css(this.$el, 'paddingBottom', padding || '');
4447
- height !== false && css(this.$el, 'height', height);
4448
- },
4488
+ props: {
4489
+ target: Boolean },
4449
4490
 
4450
- events: ['resize'] },
4451
4491
 
4492
+ data: {
4493
+ target: false },
4452
4494
 
4453
- {
4454
- read() {
4455
- if (this.parallax && positionedAbsolute(this.$el)) {
4456
- return false;
4457
- }
4458
4495
 
4459
- return {
4460
- scrolled: this.parallax ?
4461
- scrolledOver(this.$el) * Math.abs(this.parallax) :
4462
- false };
4496
+ computed: {
4497
+ input(_, $el) {
4498
+ return $(selInput, $el);
4499
+ },
4463
4500
 
4501
+ state() {
4502
+ return this.input.nextElementSibling;
4464
4503
  },
4465
4504
 
4466
- write(_ref3) {let { columns, scrolled, translates } = _ref3;
4467
- if (scrolled === false && !translates) {
4468
- return;
4469
- }
4505
+ target(_ref, $el) {let { target } = _ref;
4506
+ return (
4507
+ target && (
4508
+ target === true && parent(this.input) === $el && this.input.nextElementSibling ||
4509
+ $(target, $el)));
4470
4510
 
4471
- columns.forEach((column, i) =>
4472
- column.forEach((el, j) =>
4473
- css(
4474
- el,
4475
- 'transform',
4476
- !scrolled && !translates ?
4477
- '' : "translateY(" + (
4511
+ } },
4478
4512
 
4479
- (translates && -translates[i][j]) + (
4480
- scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")));
4481
4513
 
4514
+ update() {var _input$files;
4515
+ const { target, input } = this;
4482
4516
 
4517
+ if (!target) {
4518
+ return;
4519
+ }
4483
4520
 
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;
4484
4530
 
4485
- },
4531
+ if (prev !== value) {
4532
+ target[prop] = value;
4533
+ }
4534
+ },
4486
4535
 
4487
- events: ['scroll', 'resize'] }] };
4536
+ events: [
4537
+ {
4538
+ name: 'change',
4488
4539
 
4540
+ handler() {
4541
+ this.$emit();
4542
+ } },
4489
4543
 
4490
4544
 
4545
+ {
4546
+ name: 'reset',
4491
4547
 
4492
- function positionedAbsolute(el) {
4493
- return children(el).some((el) => css(el, 'position') === 'absolute');
4494
- }
4548
+ el() {
4549
+ return closest(this.$el, 'form');
4550
+ },
4495
4551
 
4496
- function getTranslates(rows, columns) {
4497
- const rowHeights = rows.map((row) => Math.max(...row.map((el) => el.offsetHeight)));
4498
-
4499
- return columns.map((elements) => {
4500
- let prev = 0;
4501
- return elements.map(
4502
- (element, row) =>
4503
- prev += row ? rowHeights[row - 1] - elements[row - 1].offsetHeight : 0);
4504
-
4505
- });
4506
- }
4507
-
4508
- function getMarginTop(nodes, cls) {
4509
- const [node] = nodes.filter((el) => hasClass(el, cls));
4510
-
4511
- return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
4512
- }
4513
-
4514
- function getColumnHeights(columns) {
4515
- return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
4516
- }
4552
+ handler() {
4553
+ this.$emit();
4554
+ } }] };
4517
4555
 
4518
- var heightMatch = {
4556
+ var Margin = {
4519
4557
  mixins: [Resize],
4520
4558
 
4521
- args: 'target',
4522
-
4523
4559
  props: {
4524
- target: String,
4525
- row: Boolean },
4560
+ margin: String,
4561
+ firstColumn: Boolean },
4526
4562
 
4527
4563
 
4528
4564
  data: {
4529
- target: '> *',
4530
- row: true },
4531
-
4565
+ margin: 'uk-margin-small-top',
4566
+ firstColumn: 'uk-first-column' },
4532
4567
 
4533
- computed: {
4534
- elements: {
4535
- get(_ref, $el) {let { target } = _ref;
4536
- return $$(target, $el);
4537
- },
4538
4568
 
4539
- watch() {
4540
- this.$reset();
4541
- } } },
4569
+ resizeTargets() {
4570
+ return [this.$el, ...toArray(this.$el.children)];
4571
+ },
4542
4572
 
4573
+ connected() {
4574
+ this.registerObserver(
4575
+ observeMutation(this.$el, () => this.$reset(), {
4576
+ childList: true }));
4543
4577
 
4544
4578
 
4545
- resizeTargets() {
4546
- return [this.$el, ...this.elements];
4547
4579
  },
4548
4580
 
4549
4581
  update: {
4550
4582
  read() {
4583
+ const rows = getRows(this.$el.children);
4584
+
4551
4585
  return {
4552
- rows: (this.row ? getRows(this.elements) : [this.elements]).map(match$1) };
4586
+ rows,
4587
+ columns: getColumns(rows) };
4553
4588
 
4554
4589
  },
4555
4590
 
4556
- write(_ref2) {let { rows } = _ref2;
4557
- for (const { heights, elements } of rows) {
4558
- elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
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
+ }
4559
4597
  }
4560
4598
  },
4561
4599
 
@@ -4563,1008 +4601,1064 @@
4563
4601
 
4564
4602
 
4565
4603
 
4566
- function match$1(elements) {
4567
- if (elements.length < 2) {
4568
- return { heights: [''], elements };
4569
- }
4604
+ function getRows(items) {
4605
+ return sortBy(items, 'top', 'bottom');
4606
+ }
4570
4607
 
4571
- css(elements, 'minHeight', '');
4572
- let heights = elements.map(getHeight);
4573
- const max = Math.max(...heights);
4608
+ function getColumns(rows) {
4609
+ const columns = [];
4574
4610
 
4575
- return {
4576
- heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4577
- elements };
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
+ }
4578
4617
 
4618
+ return isRtl ? columns.reverse() : columns;
4579
4619
  }
4580
4620
 
4581
- function getHeight(element) {
4582
- let style = false;
4583
- if (!isVisible(element)) {
4584
- style = element.style.display;
4585
- css(element, 'display', 'block', 'important');
4586
- }
4621
+ function sortBy(items, startProp, endProp) {
4622
+ const sorted = [[]];
4587
4623
 
4588
- const height = dimensions$1(element).height - boxModelAdjust(element, 'height', 'content-box');
4624
+ for (const el of items) {
4625
+ if (!isVisible(el)) {
4626
+ continue;
4627
+ }
4589
4628
 
4590
- if (style !== false) {
4591
- css(element, 'display', style);
4592
- }
4629
+ let dim = getOffset(el);
4593
4630
 
4594
- return height;
4595
- }
4631
+ for (let i = sorted.length - 1; i >= 0; i--) {
4632
+ const current = sorted[i];
4596
4633
 
4597
- var heightViewport = {
4598
- mixins: [Resize],
4634
+ if (!current[0]) {
4635
+ current.push(el);
4636
+ break;
4637
+ }
4599
4638
 
4600
- props: {
4601
- expand: Boolean,
4602
- offsetTop: Boolean,
4603
- offsetBottom: Boolean,
4604
- minHeight: Number },
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
+ }
4605
4646
 
4647
+ if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4648
+ sorted.push([el]);
4649
+ break;
4650
+ }
4606
4651
 
4607
- data: {
4608
- expand: false,
4609
- offsetTop: false,
4610
- offsetBottom: false,
4611
- minHeight: 0 },
4652
+ if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4653
+ current.push(el);
4654
+ break;
4655
+ }
4612
4656
 
4657
+ if (i === 0) {
4658
+ sorted.unshift([el]);
4659
+ break;
4660
+ }
4661
+ }
4662
+ }
4613
4663
 
4614
- resizeTargets() {
4615
- // check for offsetTop change
4616
- return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4617
- },
4664
+ return sorted;
4665
+ }
4618
4666
 
4619
- update: {
4620
- read(_ref) {let { minHeight: prev } = _ref;
4621
- if (!isVisible(this.$el)) {
4622
- return false;
4623
- }
4667
+ function getOffset(element, offset) {if (offset === void 0) {offset = false;}
4668
+ let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;
4624
4669
 
4625
- let minHeight = '';
4626
- const box = boxModelAdjust(this.$el, 'height', 'content-box');
4670
+ if (offset) {
4671
+ [offsetTop, offsetLeft] = offsetPosition(element);
4672
+ }
4627
4673
 
4628
- const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4629
- const { height: viewportHeight } = offsetViewport(scrollElement);
4674
+ return {
4675
+ top: offsetTop,
4676
+ left: offsetLeft,
4677
+ bottom: offsetTop + offsetHeight,
4678
+ right: offsetLeft + offsetWidth };
4630
4679
 
4631
- if (this.expand) {
4632
- minHeight = Math.max(
4633
- viewportHeight - (
4634
- dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
4635
- box,
4636
- 0);
4680
+ }
4637
4681
 
4638
- } else {
4639
- // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4640
- minHeight = "calc(" + (
4641
- document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4682
+ var Scroll = {
4683
+ connected() {
4684
+ registerScrollListener(this._uid, () => this.$emit('scroll'));
4685
+ },
4642
4686
 
4687
+ disconnected() {
4688
+ unregisterScrollListener(this._uid);
4689
+ } };
4643
4690
 
4644
- if (this.offsetTop) {
4645
- const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4646
- minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4647
- }
4648
4691
 
4649
- if (this.offsetBottom === true) {
4650
- minHeight += " - " + dimensions$1(this.$el.nextElementSibling).height + "px";
4651
- } else if (isNumeric(this.offsetBottom)) {
4652
- minHeight += " - " + this.offsetBottom + "vh";
4653
- } else if (this.offsetBottom && endsWith(this.offsetBottom, 'px')) {
4654
- minHeight += " - " + toFloat(this.offsetBottom) + "px";
4655
- } else if (isString(this.offsetBottom)) {
4656
- minHeight += " - " + dimensions$1(query(this.offsetBottom, this.$el)).height + "px";
4657
- }
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 });
4658
4700
 
4659
- minHeight += (box ? " - " + box + "px" : '') + ")";
4660
- }
4661
4701
 
4662
- return { minHeight, prev };
4663
- },
4702
+ scrollListeners.set(id, listener);
4703
+ }
4664
4704
 
4665
- write(_ref2) {let { minHeight } = _ref2;
4666
- css(this.$el, { minHeight });
4705
+ function unregisterScrollListener(id) {
4706
+ scrollListeners.delete(id);
4707
+ if (unbindScrollListener && !scrollListeners.size) {
4708
+ unbindScrollListener();
4709
+ unbindScrollListener = null;
4710
+ }
4711
+ }
4667
4712
 
4668
- if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
4669
- css(this.$el, 'minHeight', this.minHeight);
4670
- }
4671
- },
4713
+ var grid = {
4714
+ extends: Margin,
4672
4715
 
4673
- events: ['resize'] } };
4716
+ mixins: [Class, Scroll],
4674
4717
 
4675
- var SVG = {
4676
- args: 'src',
4718
+ name: 'grid',
4677
4719
 
4678
4720
  props: {
4679
- id: Boolean,
4680
- icon: String,
4681
- src: String,
4682
- style: String,
4683
- width: Number,
4684
- height: Number,
4685
- ratio: Number,
4686
- class: String,
4687
- strokeAnimation: Boolean,
4688
- focusable: Boolean, // IE 11
4689
- attributes: 'list' },
4721
+ masonry: Boolean,
4722
+ parallax: Number },
4690
4723
 
4691
4724
 
4692
4725
  data: {
4693
- ratio: 1,
4694
- include: ['style', 'class', 'focusable'],
4695
- class: '',
4696
- strokeAnimation: false },
4726
+ margin: 'uk-grid-margin',
4727
+ clsStack: 'uk-grid-stack',
4728
+ masonry: false,
4729
+ parallax: 0 },
4697
4730
 
4698
4731
 
4699
- beforeConnect() {
4700
- this.class += ' uk-svg';
4701
- },
4702
-
4703
4732
  connected() {
4704
- if (!this.icon && includes(this.src, '#')) {
4705
- [this.src, this.icon] = this.src.split('#');
4706
- }
4733
+ this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4734
+ },
4707
4735
 
4708
- this.svg = this.getSvg().then((el) => {
4709
- if (this._connected) {
4710
- const svg = insertSVG(el, this.$el);
4736
+ update: [
4737
+ {
4738
+ write(_ref) {let { columns } = _ref;
4739
+ toggleClass(this.$el, this.clsStack, columns.length < 2);
4740
+ },
4711
4741
 
4712
- if (this.svgEl && svg !== this.svgEl) {
4713
- remove$1(this.svgEl);
4714
- }
4742
+ events: ['resize'] },
4715
4743
 
4716
- this.applyAttributes(svg, el);
4717
4744
 
4718
- return this.svgEl = svg;
4719
- }
4720
- }, noop);
4745
+ {
4746
+ read(data) {
4747
+ let { columns, rows } = data;
4721
4748
 
4722
- if (this.strokeAnimation) {
4723
- this.svg.then((el) => {
4724
- if (this._connected) {
4725
- applyAnimation(el);
4726
- this.registerObserver(
4727
- observeIntersection(el, (records, observer) => {
4728
- applyAnimation(el);
4729
- observer.disconnect();
4730
- }));
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
+ }
4731
4758
 
4732
- }
4733
- });
4734
- }
4735
- },
4759
+ let translates = false;
4736
4760
 
4737
- disconnected() {
4738
- this.svg.then((svg) => {
4739
- if (this._connected) {
4740
- return;
4741
- }
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;
4742
4765
 
4743
- if (isVoidElement(this.$el)) {
4744
- this.$el.hidden = false;
4766
+ if (this.masonry) {
4767
+ columns = columns.map((column) => sortBy$1(column, 'offsetTop'));
4768
+ translates = getTranslates(rows, columns);
4745
4769
  }
4746
4770
 
4747
- remove$1(svg);
4748
- this.svgEl = null;
4749
- });
4750
-
4751
- this.svg = null;
4752
- },
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),
4753
4778
 
4754
- methods: {
4755
- async getSvg() {
4756
- if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4757
- return new Promise((resolve) =>
4758
- once(this.$el, 'load', () => resolve(this.getSvg())));
4779
+ 0);
4759
4780
 
4760
4781
  }
4761
4782
 
4762
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4783
+ return { padding, columns, translates, height: translates ? elHeight : '' };
4763
4784
  },
4764
4785
 
4765
- applyAttributes(el, ref) {
4766
- for (const prop in this.$options.props) {
4767
- if (includes(this.include, prop) && prop in this) {
4768
- attr(el, prop, this[prop]);
4769
- }
4770
- }
4771
-
4772
- for (const attribute in this.attributes) {
4773
- const [prop, value] = this.attributes[attribute].split(':', 2);
4774
- attr(el, prop, value);
4775
- }
4786
+ write(_ref2) {let { height, padding } = _ref2;
4787
+ css(this.$el, 'paddingBottom', padding || '');
4788
+ height !== false && css(this.$el, 'height', height);
4789
+ },
4776
4790
 
4777
- if (!this.id) {
4778
- removeAttr(el, 'id');
4779
- }
4791
+ events: ['resize'] },
4780
4792
 
4781
- const props = ['width', 'height'];
4782
- let dimensions = props.map((prop) => this[prop]);
4783
4793
 
4784
- if (!dimensions.some((val) => val)) {
4785
- dimensions = props.map((prop) => attr(ref, prop));
4794
+ {
4795
+ read() {
4796
+ if (this.parallax && positionedAbsolute(this.$el)) {
4797
+ return false;
4786
4798
  }
4787
4799
 
4788
- const viewBox = attr(ref, 'viewBox');
4789
- if (viewBox && !dimensions.some((val) => val)) {
4790
- dimensions = viewBox.split(' ').slice(2);
4791
- }
4800
+ return {
4801
+ scrolled: this.parallax ?
4802
+ scrolledOver(this.$el) * Math.abs(this.parallax) :
4803
+ false };
4792
4804
 
4793
- dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
4794
- } } };
4805
+ },
4795
4806
 
4807
+ write(_ref3) {let { columns, scrolled, translates } = _ref3;
4808
+ if (scrolled === false && !translates) {
4809
+ return;
4810
+ }
4796
4811
 
4812
+ columns.forEach((column, i) =>
4813
+ column.forEach((el, j) =>
4814
+ css(
4815
+ el,
4816
+ 'transform',
4817
+ !scrolled && !translates ?
4818
+ '' : "translateY(" + (
4797
4819
 
4798
- const loadSVG = memoize(async (src) => {
4799
- if (src) {
4800
- if (startsWith(src, 'data:')) {
4801
- return decodeURIComponent(src.split(',')[1]);
4802
- } else {
4803
- return (await fetch(src)).text();
4804
- }
4805
- } else {
4806
- return Promise.reject();
4807
- }
4808
- });
4820
+ (translates && -translates[i][j]) + (
4821
+ scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")));
4809
4822
 
4810
- function parseSVG(svg, icon) {var _svg;
4811
- if (icon && includes(svg, '<symbol')) {
4812
- svg = parseSymbols(svg, icon) || svg;
4813
- }
4814
4823
 
4815
- svg = $(svg.substr(svg.indexOf('<svg')));
4816
- return ((_svg = svg) == null ? void 0 : _svg.hasChildNodes()) && svg;
4817
- }
4818
4824
 
4819
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
4820
- const symbols = {};
4821
4825
 
4822
- function parseSymbols(svg, icon) {
4823
- if (!symbols[svg]) {
4824
- symbols[svg] = {};
4826
+ },
4825
4827
 
4826
- symbolRe.lastIndex = 0;
4828
+ events: ['scroll', 'resize'] }] };
4827
4829
 
4828
- let match;
4829
- while (match = symbolRe.exec(svg)) {
4830
- symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + match[1] + "svg>";
4831
- }
4832
- }
4833
4830
 
4834
- return symbols[svg][icon];
4835
- }
4836
4831
 
4837
- function applyAnimation(el) {
4838
- const length = getMaxPathLength(el);
4839
4832
 
4840
- if (length) {
4841
- el.style.setProperty('--uk-animation-stroke', length);
4842
- }
4833
+ function positionedAbsolute(el) {
4834
+ return children(el).some((el) => css(el, 'position') === 'absolute');
4843
4835
  }
4844
4836
 
4845
- function getMaxPathLength(el) {
4846
- return Math.ceil(
4847
- Math.max(
4848
- 0,
4849
- ...$$('[stroke]', el).map((stroke) => {
4850
- try {
4851
- return stroke.getTotalLength();
4852
- } catch (e) {
4853
- return 0;
4854
- }
4855
- })));
4837
+ function getTranslates(rows, columns) {
4838
+ const rowHeights = rows.map((row) => Math.max(...row.map((el) => el.offsetHeight)));
4856
4839
 
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);
4857
4845
 
4846
+ });
4858
4847
  }
4859
4848
 
4860
- function insertSVG(el, root) {
4861
- if (isVoidElement(root) || isTag(root, 'canvas')) {
4862
- root.hidden = true;
4863
-
4864
- const next = root.nextElementSibling;
4865
- return equals(el, next) ? next : after(root, el);
4866
- }
4867
-
4868
- const last = root.lastElementChild;
4869
- return equals(el, last) ? last : append(root, el);
4870
- }
4849
+ function getMarginTop(nodes, cls) {
4850
+ const [node] = nodes.filter((el) => hasClass(el, cls));
4871
4851
 
4872
- function equals(el, other) {
4873
- return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4852
+ return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
4874
4853
  }
4875
4854
 
4876
- function innerHTML(el) {
4877
- return (
4878
- el.innerHTML ||
4879
- new XMLSerializer().serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).
4880
- replace(/\s/g, '');
4855
+ function getColumnHeights(columns) {
4856
+ return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
4881
4857
  }
4882
4858
 
4883
- 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>";
4884
-
4885
- 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>";
4859
+ var heightMatch = {
4860
+ mixins: [Resize],
4886
4861
 
4887
- 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>";
4862
+ args: 'target',
4888
4863
 
4889
- 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>";
4864
+ props: {
4865
+ target: String,
4866
+ row: Boolean },
4890
4867
 
4891
- 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>";
4892
4868
 
4893
- 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>";
4869
+ data: {
4870
+ target: '> *',
4871
+ row: true },
4894
4872
 
4895
- 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>";
4896
4873
 
4897
- 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>";
4874
+ computed: {
4875
+ elements: {
4876
+ get(_ref, $el) {let { target } = _ref;
4877
+ return $$(target, $el);
4878
+ },
4898
4879
 
4899
- 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>";
4880
+ watch() {
4881
+ this.$reset();
4882
+ } } },
4900
4883
 
4901
- 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>";
4902
4884
 
4903
- 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>";
4904
4885
 
4905
- 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>";
4886
+ resizeTargets() {
4887
+ return [this.$el, ...this.elements];
4888
+ },
4906
4889
 
4907
- 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>";
4890
+ update: {
4891
+ read() {
4892
+ return {
4893
+ rows: (this.row ? getRows(this.elements) : [this.elements]).map(match$1) };
4908
4894
 
4909
- 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>";
4910
-
4911
- 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>";
4912
-
4913
- 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>";
4914
-
4915
- const icons = {
4916
- spinner,
4917
- totop,
4918
- marker,
4919
- 'close-icon': closeIcon,
4920
- 'close-large': closeLarge,
4921
- 'navbar-toggle-icon': navbarToggleIcon,
4922
- 'overlay-icon': overlayIcon,
4923
- 'pagination-next': paginationNext,
4924
- 'pagination-previous': paginationPrevious,
4925
- 'search-icon': searchIcon,
4926
- 'search-large': searchLarge,
4927
- 'search-navbar': searchNavbar,
4928
- 'slidenav-next': slidenavNext,
4929
- 'slidenav-next-large': slidenavNextLarge,
4930
- 'slidenav-previous': slidenavPrevious,
4931
- 'slidenav-previous-large': slidenavPreviousLarge };
4895
+ },
4932
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
+ },
4933
4902
 
4934
- const Icon = {
4935
- install: install$3,
4903
+ events: ['resize'] } };
4936
4904
 
4937
- extends: SVG,
4938
4905
 
4939
- args: 'icon',
4940
4906
 
4941
- props: ['icon'],
4907
+ function match$1(elements) {
4908
+ if (elements.length < 2) {
4909
+ return { heights: [''], elements };
4910
+ }
4942
4911
 
4943
- data: {
4944
- include: ['focusable'] },
4912
+ css(elements, 'minHeight', '');
4913
+ let heights = elements.map(getHeight);
4914
+ const max = Math.max(...heights);
4945
4915
 
4916
+ return {
4917
+ heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4918
+ elements };
4946
4919
 
4947
- isIcon: true,
4920
+ }
4948
4921
 
4949
- beforeConnect() {
4950
- addClass(this.$el, 'uk-icon');
4951
- },
4922
+ function getHeight(element) {
4923
+ let style = false;
4924
+ if (!isVisible(element)) {
4925
+ style = element.style.display;
4926
+ css(element, 'display', 'block', 'important');
4927
+ }
4952
4928
 
4953
- methods: {
4954
- async getSvg() {
4955
- const icon = getIcon(this.icon);
4929
+ const height = dimensions$1(element).height - boxModelAdjust(element, 'height', 'content-box');
4956
4930
 
4957
- if (!icon) {
4958
- throw 'Icon not found.';
4959
- }
4931
+ if (style !== false) {
4932
+ css(element, 'display', style);
4933
+ }
4960
4934
 
4961
- return icon;
4962
- } } };
4935
+ return height;
4936
+ }
4963
4937
 
4964
- const IconComponent = {
4965
- args: false,
4938
+ var heightViewport = {
4939
+ mixins: [Resize],
4966
4940
 
4967
- extends: Icon,
4941
+ props: {
4942
+ expand: Boolean,
4943
+ offsetTop: Boolean,
4944
+ offsetBottom: Boolean,
4945
+ minHeight: Number },
4968
4946
 
4969
- data: (vm) => ({
4970
- icon: hyphenate(vm.constructor.options.name) }),
4971
4947
 
4948
+ data: {
4949
+ expand: false,
4950
+ offsetTop: false,
4951
+ offsetBottom: false,
4952
+ minHeight: 0 },
4972
4953
 
4973
- beforeConnect() {
4974
- addClass(this.$el, this.$name);
4975
- } };
4976
4954
 
4955
+ resizeTargets() {
4956
+ // check for offsetTop change
4957
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4958
+ },
4977
4959
 
4978
- const Slidenav = {
4979
- extends: IconComponent,
4960
+ update: {
4961
+ read(_ref) {let { minHeight: prev } = _ref;
4962
+ if (!isVisible(this.$el)) {
4963
+ return false;
4964
+ }
4980
4965
 
4981
- beforeConnect() {
4982
- addClass(this.$el, 'uk-slidenav');
4983
- const icon = this.$props.icon;
4984
- this.icon = hasClass(this.$el, 'uk-slidenav-large') ? icon + "-large" : icon;
4985
- } };
4966
+ let minHeight = '';
4967
+ const box = boxModelAdjust(this.$el, 'height', 'content-box');
4986
4968
 
4969
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4970
+ const { height: viewportHeight } = offsetViewport(scrollElement);
4987
4971
 
4988
- const Search = {
4989
- extends: IconComponent,
4972
+ if (this.expand) {
4973
+ minHeight = Math.max(
4974
+ viewportHeight - (
4975
+ dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
4976
+ box,
4977
+ 0);
4990
4978
 
4991
- beforeConnect() {
4992
- this.icon =
4993
- hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length ?
4994
- 'search-large' :
4995
- parents(this.$el, '.uk-search-navbar').length ?
4996
- 'search-navbar' :
4997
- this.$props.icon;
4998
- } };
4979
+ } else {
4980
+ const isScrollingElement = document.scrollingElement === scrollElement;
4999
4981
 
4982
+ // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4983
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
5000
4984
 
5001
- const Close = {
5002
- extends: IconComponent,
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
+ }
5003
4993
 
5004
- beforeConnect() {
5005
- this.icon = "close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon');
5006
- } };
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
+ }
5007
5003
 
5004
+ minHeight += (box ? " - " + box + "px" : '') + ")";
5005
+ }
5008
5006
 
5009
- const Spinner = {
5010
- extends: IconComponent,
5007
+ return { minHeight, prev };
5008
+ },
5011
5009
 
5012
- methods: {
5013
- async getSvg() {
5014
- const icon = await Icon.methods.getSvg.call(this);
5010
+ write(_ref2) {let { minHeight } = _ref2;
5011
+ css(this.$el, { minHeight });
5015
5012
 
5016
- if (this.ratio !== 1) {
5017
- css($('circle', icon), 'strokeWidth', 1 / this.ratio);
5013
+ if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
5014
+ css(this.$el, 'minHeight', this.minHeight);
5018
5015
  }
5016
+ },
5019
5017
 
5020
- return icon;
5021
- } } };
5018
+ events: ['resize'] } };
5022
5019
 
5020
+ var SVG = {
5021
+ args: 'src',
5023
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' },
5024
5035
 
5025
- const parsed = {};
5026
- function install$3(UIkit) {
5027
- UIkit.icon.add = (name, svg) => {
5028
- const added = isString(name) ? { [name]: svg } : name;
5029
- each(added, (svg, name) => {
5030
- icons[name] = svg;
5031
- delete parsed[name];
5032
- });
5033
5036
 
5034
- if (UIkit._initialized) {
5035
- apply(document.body, (el) =>
5036
- each(UIkit.getComponents(el), (cmp) => {
5037
- cmp.$options.isIcon && cmp.icon in added && cmp.$reset();
5038
- }));
5037
+ data: {
5038
+ ratio: 1,
5039
+ include: ['style', 'class', 'focusable'],
5040
+ class: '',
5041
+ strokeAnimation: false },
5039
5042
 
5040
- }
5041
- };
5042
- }
5043
5043
 
5044
- function getIcon(icon) {
5045
- if (!icons[icon]) {
5046
- return null;
5047
- }
5044
+ beforeConnect() {
5045
+ this.class += ' uk-svg';
5046
+ },
5048
5047
 
5049
- if (!parsed[icon]) {
5050
- parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
5051
- }
5048
+ connected() {
5049
+ if (!this.icon && includes(this.src, '#')) {
5050
+ [this.src, this.icon] = this.src.split('#');
5051
+ }
5052
5052
 
5053
- return parsed[icon].cloneNode(true);
5054
- }
5053
+ this.svg = this.getSvg().then((el) => {
5054
+ if (this._connected) {
5055
+ const svg = insertSVG(el, this.$el);
5055
5056
 
5056
- function applyRtl(icon) {
5057
- return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
5058
- }
5057
+ if (this.svgEl && svg !== this.svgEl) {
5058
+ remove$1(this.svgEl);
5059
+ }
5059
5060
 
5060
- const nativeLazyLoad = inBrowser && 'loading' in HTMLImageElement.prototype;
5061
+ this.applyAttributes(svg, el);
5061
5062
 
5062
- var img = {
5063
- args: 'dataSrc',
5063
+ return this.svgEl = svg;
5064
+ }
5065
+ }, noop);
5064
5066
 
5065
- props: {
5066
- dataSrc: String,
5067
- sources: String,
5068
- offsetTop: String,
5069
- offsetLeft: String,
5070
- target: String,
5071
- loading: String },
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
+ }));
5072
5076
 
5077
+ }
5078
+ });
5079
+ }
5080
+ },
5073
5081
 
5074
- data: {
5075
- dataSrc: '',
5076
- sources: false,
5077
- offsetTop: '50vh',
5078
- offsetLeft: '50vw',
5079
- target: false,
5080
- loading: 'lazy' },
5082
+ disconnected() {
5083
+ this.svg.then((svg) => {
5084
+ if (this._connected) {
5085
+ return;
5086
+ }
5081
5087
 
5088
+ if (isVoidElement(this.$el)) {
5089
+ this.$el.hidden = false;
5090
+ }
5082
5091
 
5083
- connected() {
5084
- if (this.loading !== 'lazy') {
5085
- this.load();
5086
- return;
5087
- }
5092
+ remove$1(svg);
5093
+ this.svgEl = null;
5094
+ });
5088
5095
 
5089
- const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
5096
+ this.svg = null;
5097
+ },
5090
5098
 
5091
- if (nativeLazyLoad && isImg(this.$el)) {
5092
- this.$el.loading = 'lazy';
5093
- setSrcAttrs(this.$el);
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())));
5094
5104
 
5095
- if (target.length === 1) {
5096
- return;
5097
5105
  }
5098
- }
5099
-
5100
- ensureSrcAttribute(this.$el);
5101
5106
 
5102
- this.registerObserver(
5103
- observeIntersection(
5104
- target,
5105
- (entries, observer) => {
5106
- this.load();
5107
- observer.disconnect();
5107
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
5108
5108
  },
5109
- {
5110
- rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
5111
- this.offsetLeft,
5112
- 'width') + "px" }));
5113
-
5114
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
+ }
5115
5116
 
5117
+ for (const attribute in this.attributes) {
5118
+ const [prop, value] = this.attributes[attribute].split(':', 2);
5119
+ attr(el, prop, value);
5120
+ }
5116
5121
 
5117
- },
5122
+ if (!this.id) {
5123
+ removeAttr(el, 'id');
5124
+ }
5118
5125
 
5119
- disconnected() {
5120
- if (this._data.image) {
5121
- this._data.image.onload = '';
5122
- }
5123
- },
5126
+ const props = ['width', 'height'];
5127
+ let dimensions = props.map((prop) => this[prop]);
5124
5128
 
5125
- methods: {
5126
- load() {
5127
- if (this._data.image) {
5128
- return this._data.image;
5129
+ if (!dimensions.some((val) => val)) {
5130
+ dimensions = props.map((prop) => attr(ref, prop));
5129
5131
  }
5130
5132
 
5131
- const image = isImg(this.$el) ?
5132
- this.$el :
5133
- getImageFromElement(this.$el, this.dataSrc, this.sources);
5133
+ const viewBox = attr(ref, 'viewBox');
5134
+ if (viewBox && !dimensions.some((val) => val)) {
5135
+ dimensions = viewBox.split(' ').slice(2);
5136
+ }
5134
5137
 
5135
- removeAttr(image, 'loading');
5136
- setSrcAttrs(this.$el, image.currentSrc);
5137
- return this._data.image = image;
5138
+ dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
5138
5139
  } } };
5139
5140
 
5140
5141
 
5141
5142
 
5142
- function setSrcAttrs(el, src) {
5143
- if (isImg(el)) {
5144
- const parentNode = parent(el);
5145
- const elements = isPicture(parentNode) ? children(parentNode) : [el];
5146
- elements.forEach((el) => setSourceProps(el, el));
5147
- } else if (src) {
5148
- const change = !includes(el.style.backgroundImage, src);
5149
- if (change) {
5150
- css(el, 'backgroundImage', "url(" + escape(src) + ")");
5151
- 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();
5152
5149
  }
5150
+ } else {
5151
+ return Promise.reject();
5153
5152
  }
5154
- }
5153
+ });
5155
5154
 
5156
- const srcProps = ['data-src', 'data-srcset', 'sizes'];
5157
- function setSourceProps(sourceEl, targetEl) {
5158
- srcProps.forEach((prop) => {
5159
- const value = data(sourceEl, prop);
5160
- if (value) {
5161
- attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5162
- }
5163
- });
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;
5164
5162
  }
5165
5163
 
5166
- function getImageFromElement(el, src, sources) {
5167
- const img = new Image();
5164
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
5165
+ const symbols = {};
5168
5166
 
5169
- wrapInPicture(img, sources);
5170
- setSourceProps(el, img);
5171
- img.onload = () => {
5172
- setSrcAttrs(el, img.currentSrc);
5173
- };
5174
- attr(img, 'src', src);
5175
- return img;
5176
- }
5167
+ function parseSymbols(svg, icon) {
5168
+ if (!symbols[svg]) {
5169
+ symbols[svg] = {};
5177
5170
 
5178
- function wrapInPicture(img, sources) {
5179
- sources = parseSources(sources);
5171
+ symbolRe.lastIndex = 0;
5180
5172
 
5181
- if (sources.length) {
5182
- const picture = fragment('<picture>');
5183
- for (const attrs of sources) {
5184
- const source = fragment('<source>');
5185
- attr(source, attrs);
5186
- 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>";
5187
5176
  }
5188
- append(picture, img);
5189
5177
  }
5178
+
5179
+ return symbols[svg][icon];
5190
5180
  }
5191
5181
 
5192
- function parseSources(sources) {
5193
- if (!sources) {
5194
- return [];
5182
+ function applyAnimation(el) {
5183
+ const length = getMaxPathLength(el);
5184
+
5185
+ if (length) {
5186
+ el.style.setProperty('--uk-animation-stroke', length);
5195
5187
  }
5188
+ }
5196
5189
 
5197
- if (startsWith(sources, '[')) {
5190
+ function getMaxPathLength(el) {
5191
+ return Math.ceil(
5192
+ Math.max(
5193
+ 0,
5194
+ ...$$('[stroke]', el).map((stroke) => {
5198
5195
  try {
5199
- sources = JSON.parse(sources);
5196
+ return stroke.getTotalLength();
5200
5197
  } catch (e) {
5201
- sources = [];
5198
+ return 0;
5202
5199
  }
5203
- } else {
5204
- sources = parseOptions(sources);
5205
- }
5200
+ })));
5206
5201
 
5207
- if (!isArray(sources)) {
5208
- sources = [sources];
5209
- }
5210
5202
 
5211
- return sources.filter((source) => !isEmpty(source));
5212
5203
  }
5213
5204
 
5214
- function ensureSrcAttribute(el) {
5215
- if (isImg(el) && !hasAttr(el, 'src')) {
5216
- 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);
5217
5211
  }
5212
+
5213
+ const last = root.lastElementChild;
5214
+ return equals(el, last) ? last : append(root, el);
5218
5215
  }
5219
5216
 
5220
- function isPicture(el) {
5221
- return isTag(el, 'picture');
5217
+ function equals(el, other) {
5218
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
5222
5219
  }
5223
5220
 
5224
- function isImg(el) {
5225
- 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, '');
5226
5226
  }
5227
5227
 
5228
- var Media = {
5229
- props: {
5230
- 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>";
5231
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>";
5232
5231
 
5233
- data: {
5234
- 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>";
5235
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>";
5236
5235
 
5237
- connected() {
5238
- const media = toMedia(this.media);
5239
- this.matchMedia = true;
5240
- if (media) {
5241
- this.mediaObj = window.matchMedia(media);
5242
- const handler = () => {
5243
- this.matchMedia = this.mediaObj.matches;
5244
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5245
- };
5246
- this.offMediaObj = on(this.mediaObj, 'change', () => {
5247
- handler();
5248
- this.$emit('resize');
5249
- });
5250
- handler();
5251
- }
5252
- },
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>";
5253
5237
 
5254
- disconnected() {var _this$offMediaObj;
5255
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5256
- } };
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>";
5257
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>";
5258
5241
 
5259
- function toMedia(value) {
5260
- if (isString(value)) {
5261
- if (startsWith(value, '@')) {
5262
- const name = "breakpoint-" + value.substr(1);
5263
- value = toFloat(getCssVar(name));
5264
- } else if (isNaN(value)) {
5265
- return value;
5266
- }
5267
- }
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>";
5268
5243
 
5269
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5270
- }
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>";
5245
+
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
+ }
5271
5305
 
5272
- var leader = {
5273
- mixins: [Class, Media, Resize],
5306
+ return icon;
5307
+ } } };
5274
5308
 
5275
- props: {
5276
- fill: String },
5309
+ const IconComponent = {
5310
+ args: false,
5277
5311
 
5312
+ extends: Icon,
5278
5313
 
5279
- data: {
5280
- fill: '',
5281
- clsWrapper: 'uk-leader-fill',
5282
- clsHide: 'uk-leader-hide',
5283
- attrFill: 'data-fill' },
5314
+ data: (vm) => ({
5315
+ icon: hyphenate(vm.constructor.options.name) }),
5284
5316
 
5285
5317
 
5286
- computed: {
5287
- fill(_ref) {let { fill } = _ref;
5288
- return fill || getCssVar('leader-fill-content');
5289
- } },
5318
+ beforeConnect() {
5319
+ addClass(this.$el, this.$name);
5320
+ } };
5290
5321
 
5291
5322
 
5292
- connected() {
5293
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5294
- },
5323
+ const Slidenav = {
5324
+ extends: IconComponent,
5295
5325
 
5296
- disconnected() {
5297
- unwrap(this.wrapper.childNodes);
5298
- },
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
+ } };
5299
5331
 
5300
- update: {
5301
- read() {
5302
- const width = Math.trunc(this.$el.offsetWidth / 2);
5303
5332
 
5304
- return {
5305
- width,
5306
- fill: this.fill,
5307
- hide: !this.matchMedia };
5333
+ const Search = {
5334
+ extends: IconComponent,
5308
5335
 
5309
- },
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
+ } };
5310
5344
 
5311
- write(_ref2) {let { width, fill, hide } = _ref2;
5312
- toggleClass(this.wrapper, this.clsHide, hide);
5313
- attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5314
- },
5315
5345
 
5316
- events: ['resize'] } };
5346
+ const Close = {
5347
+ extends: IconComponent,
5317
5348
 
5318
- const active = [];
5349
+ beforeConnect() {
5350
+ this.icon = "close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon');
5351
+ } };
5319
5352
 
5320
- var Modal = {
5321
- mixins: [Class, Container, Togglable],
5322
5353
 
5323
- props: {
5324
- selPanel: String,
5325
- selClose: String,
5326
- escClose: Boolean,
5327
- bgClose: Boolean,
5328
- stack: Boolean },
5354
+ const Spinner = {
5355
+ extends: IconComponent,
5329
5356
 
5357
+ methods: {
5358
+ async getSvg() {
5359
+ const icon = await Icon.methods.getSvg.call(this);
5330
5360
 
5331
- data: {
5332
- cls: 'uk-open',
5333
- escClose: true,
5334
- bgClose: true,
5335
- overlay: true,
5336
- stack: false },
5361
+ if (this.ratio !== 1) {
5362
+ css($('circle', icon), 'strokeWidth', 1 / this.ratio);
5363
+ }
5337
5364
 
5365
+ return icon;
5366
+ } } };
5338
5367
 
5339
- computed: {
5340
- panel(_ref, $el) {let { selPanel } = _ref;
5341
- return $(selPanel, $el);
5342
- },
5343
5368
 
5344
- transitionElement() {
5345
- return this.panel;
5346
- },
5347
5369
 
5348
- bgClose(_ref2) {let { bgClose } = _ref2;
5349
- return bgClose && this.panel;
5350
- } },
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
+ });
5351
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
+ }));
5352
5384
 
5353
- beforeDisconnect() {
5354
- if (includes(active, this)) {
5355
- this.toggleElement(this.$el, false, false);
5356
5385
  }
5357
- },
5386
+ };
5387
+ }
5358
5388
 
5359
- events: [
5360
- {
5361
- name: 'click',
5389
+ function getIcon(icon) {
5390
+ if (!icons[icon]) {
5391
+ return null;
5392
+ }
5362
5393
 
5363
- delegate() {
5364
- return this.selClose;
5365
- },
5394
+ if (!parsed[icon]) {
5395
+ parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
5396
+ }
5366
5397
 
5367
- handler(e) {
5368
- e.preventDefault();
5369
- this.hide();
5370
- } },
5398
+ return parsed[icon].cloneNode(true);
5399
+ }
5371
5400
 
5401
+ function applyRtl(icon) {
5402
+ return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
5403
+ }
5372
5404
 
5373
- {
5374
- name: 'toggle',
5405
+ const nativeLazyLoad = inBrowser && 'loading' in HTMLImageElement.prototype;
5375
5406
 
5376
- self: true,
5407
+ var img = {
5408
+ args: 'dataSrc',
5377
5409
 
5378
- handler(e) {
5379
- if (e.defaultPrevented) {
5380
- return;
5381
- }
5410
+ props: {
5411
+ dataSrc: String,
5412
+ sources: String,
5413
+ offsetTop: String,
5414
+ offsetLeft: String,
5415
+ target: String,
5416
+ loading: String },
5382
5417
 
5383
- e.preventDefault();
5384
5418
 
5385
- if (this.isToggled() === includes(active, this)) {
5386
- this.toggle();
5387
- }
5388
- } },
5419
+ data: {
5420
+ dataSrc: '',
5421
+ sources: false,
5422
+ offsetTop: '50vh',
5423
+ offsetLeft: '50vw',
5424
+ target: false,
5425
+ loading: 'lazy' },
5389
5426
 
5390
5427
 
5391
- {
5392
- name: 'beforeshow',
5428
+ connected() {
5429
+ if (this.loading !== 'lazy') {
5430
+ this.load();
5431
+ return;
5432
+ }
5393
5433
 
5394
- self: true,
5434
+ const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
5395
5435
 
5396
- handler(e) {
5397
- if (includes(active, this)) {
5398
- return false;
5399
- }
5436
+ if (nativeLazyLoad && isImg(this.$el)) {
5437
+ this.$el.loading = 'lazy';
5438
+ setSrcAttrs(this.$el);
5400
5439
 
5401
- if (!this.stack && active.length) {
5402
- Promise.all(active.map((modal) => modal.hide())).then(this.show);
5403
- e.preventDefault();
5404
- } else {
5405
- active.push(this);
5440
+ if (target.length === 1) {
5441
+ return;
5406
5442
  }
5407
- } },
5443
+ }
5408
5444
 
5445
+ ensureSrcAttribute(this.$el);
5409
5446
 
5410
- {
5411
- 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" }));
5412
5458
 
5413
- self: true,
5414
5459
 
5415
- handler() {
5416
- const docEl = document.documentElement;
5417
5460
 
5418
- if (width(window) > docEl.clientWidth && this.overlay) {
5419
- css(document.body, 'overflowY', 'scroll');
5420
- }
5421
5461
 
5422
- if (this.stack) {
5423
- 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;
5424
5474
  }
5425
5475
 
5426
- addClass(docEl, this.clsPage);
5476
+ const image = isImg(this.$el) ?
5477
+ this.$el :
5478
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
5427
5479
 
5428
- if (this.bgClose) {
5429
- once(
5430
- this.$el,
5431
- 'hide',
5432
- on(document, pointerDown, (_ref3) => {let { target } = _ref3;
5433
- if (
5434
- last(active) !== this ||
5435
- this.overlay && !within(target, this.$el) ||
5436
- within(target, this.panel))
5437
- {
5438
- return;
5439
- }
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
+ }
5440
5510
 
5441
- once(
5442
- document,
5443
- pointerUp + " " + pointerCancel + " scroll",
5444
- (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
5445
- if (
5446
- !defaultPrevented &&
5447
- type === pointerUp &&
5448
- target === newTarget)
5449
- {
5450
- this.hide();
5451
- }
5452
- },
5453
- true);
5511
+ function getImageFromElement(el, src, sources) {
5512
+ const img = new Image();
5454
5513
 
5455
- }),
5456
- { 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
+ }
5457
5522
 
5458
- }
5523
+ function wrapInPicture(img, sources) {
5524
+ sources = parseSources(sources);
5459
5525
 
5460
- if (this.escClose) {
5461
- once(
5462
- this.$el,
5463
- 'hide',
5464
- on(document, 'keydown', (e) => {
5465
- if (e.keyCode === 27 && last(active) === this) {
5466
- this.hide();
5467
- }
5468
- }),
5469
- { 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
+ }
5470
5536
 
5471
- }
5472
- } },
5537
+ function parseSources(sources) {
5538
+ if (!sources) {
5539
+ return [];
5540
+ }
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
+ }
5473
5551
 
5552
+ if (!isArray(sources)) {
5553
+ sources = [sources];
5554
+ }
5474
5555
 
5475
- {
5476
- name: 'shown',
5556
+ return sources.filter((source) => !isEmpty(source));
5557
+ }
5477
5558
 
5478
- self: true,
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
+ }
5479
5564
 
5480
- handler() {
5481
- if (!isFocusable(this.$el)) {
5482
- attr(this.$el, 'tabindex', '-1');
5483
- }
5565
+ function isPicture(el) {
5566
+ return isTag(el, 'picture');
5567
+ }
5484
5568
 
5485
- if (!$(':focus', this.$el)) {
5486
- this.$el.focus();
5487
- }
5488
- } },
5569
+ function isImg(el) {
5570
+ return isTag(el, 'img');
5571
+ }
5489
5572
 
5573
+ var Media = {
5574
+ props: {
5575
+ media: Boolean },
5490
5576
 
5491
- {
5492
- name: 'hidden',
5493
5577
 
5494
- self: true,
5578
+ data: {
5579
+ media: false },
5495
5580
 
5496
- handler() {
5497
- if (includes(active, this)) {
5498
- active.splice(active.indexOf(this), 1);
5499
- }
5500
5581
 
5501
- if (!active.length) {
5502
- css(document.body, 'overflowY', '');
5503
- }
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
+ },
5504
5598
 
5505
- css(this.$el, 'zIndex', '');
5599
+ disconnected() {var _this$offMediaObj;
5600
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5601
+ } };
5506
5602
 
5507
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5508
- removeClass(document.documentElement, this.clsPage);
5509
- }
5510
- } }],
5511
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
+ }
5613
+
5614
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5615
+ }
5512
5616
 
5617
+ var leader = {
5618
+ mixins: [Class, Media, Resize],
5513
5619
 
5514
- methods: {
5515
- toggle() {
5516
- return this.isToggled() ? this.hide() : this.show();
5517
- },
5620
+ props: {
5621
+ fill: String },
5518
5622
 
5519
- show() {
5520
- if (this.container && parent(this.$el) !== this.container) {
5521
- append(this.container, this.$el);
5522
- return new Promise((resolve) =>
5523
- requestAnimationFrame(() => this.show().then(resolve)));
5524
5623
 
5525
- }
5624
+ data: {
5625
+ fill: '',
5626
+ clsWrapper: 'uk-leader-fill',
5627
+ clsHide: 'uk-leader-hide',
5628
+ attrFill: 'data-fill' },
5526
5629
 
5527
- return this.toggleElement(this.$el, true, animate(this));
5528
- },
5529
5630
 
5530
- hide() {
5531
- return this.toggleElement(this.$el, false, animate(this));
5532
- } } };
5631
+ computed: {
5632
+ fill(_ref) {let { fill } = _ref;
5633
+ return fill || getCssVar('leader-fill-content');
5634
+ } },
5533
5635
 
5534
5636
 
5637
+ connected() {
5638
+ [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5639
+ },
5535
5640
 
5536
- function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
5537
- return (el, show) =>
5538
- new Promise((resolve, reject) =>
5539
- once(el, 'show hide', () => {
5540
- el._reject == null ? void 0 : el._reject();
5541
- el._reject = reject;
5641
+ disconnected() {
5642
+ unwrap(this.wrapper.childNodes);
5643
+ },
5542
5644
 
5543
- _toggle(el, show);
5645
+ update: {
5646
+ read() {
5647
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5544
5648
 
5545
- const off = once(
5546
- transitionElement,
5547
- 'transitionstart',
5548
- () => {
5549
- once(transitionElement, 'transitionend transitioncancel', resolve, {
5550
- self: true });
5649
+ return {
5650
+ width,
5651
+ fill: this.fill,
5652
+ hide: !this.matchMedia };
5551
5653
 
5552
- clearTimeout(timer);
5553
5654
  },
5554
- { self: true });
5555
-
5556
5655
 
5557
- const timer = setTimeout(() => {
5558
- off();
5559
- resolve();
5560
- }, toMs(css(transitionElement, 'transitionDuration')));
5561
- })).
5562
- then(() => delete el._reject);
5563
- }
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
+ },
5564
5660
 
5565
- function toMs(time) {
5566
- return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5567
- }
5661
+ events: ['resize'] } };
5568
5662
 
5569
5663
  var modal = {
5570
5664
  install: install$2,
@@ -6070,7 +6164,7 @@
6070
6164
 
6071
6165
  methods: {
6072
6166
  getActive() {
6073
- return active$1 && within(active$1.target, this.$el) && active$1;
6167
+ return active && within(active.target, this.$el) && active;
6074
6168
  },
6075
6169
 
6076
6170
  transitionTo(newHeight, el) {
@@ -6163,7 +6257,7 @@
6163
6257
 
6164
6258
  registerEvent(this, {
6165
6259
  el: this.swipeTarget,
6166
- name: pointerDown,
6260
+ name: pointerDown$1,
6167
6261
  passive: true,
6168
6262
  handler(e) {
6169
6263
  if (!isTouch(e)) {
@@ -6173,7 +6267,7 @@
6173
6267
  // Handle Swipe Gesture
6174
6268
  const pos = getEventPos(e);
6175
6269
  const target = 'tagName' in e.target ? e.target : parent(e.target);
6176
- once(document, pointerUp + " " + pointerCancel + " scroll", (e) => {
6270
+ once(document, pointerUp$1 + " " + pointerCancel + " scroll", (e) => {
6177
6271
  const { x, y } = getEventPos(e);
6178
6272
 
6179
6273
  // swipe
@@ -6280,22 +6374,6 @@
6280
6374
  } },
6281
6375
 
6282
6376
 
6283
- {
6284
- name: 'touchstart',
6285
-
6286
- passive: true,
6287
-
6288
- el() {
6289
- return this.panel;
6290
- },
6291
-
6292
- handler(_ref8) {let { targetTouches } = _ref8;
6293
- if (targetTouches.length === 1) {
6294
- this.clientY = targetTouches[0].clientY;
6295
- }
6296
- } },
6297
-
6298
-
6299
6377
  {
6300
6378
  name: 'touchmove',
6301
6379
 
@@ -6311,33 +6389,6 @@
6311
6389
  } },
6312
6390
 
6313
6391
 
6314
- {
6315
- name: 'touchmove',
6316
-
6317
- passive: false,
6318
-
6319
- el() {
6320
- return this.panel;
6321
- },
6322
-
6323
- handler(e) {
6324
- if (e.targetTouches.length !== 1) {
6325
- return;
6326
- }
6327
-
6328
- const clientY = e.targetTouches[0].clientY - this.clientY;
6329
- const { scrollTop, scrollHeight, clientHeight } = this.panel;
6330
-
6331
- if (
6332
- clientHeight >= scrollHeight ||
6333
- scrollTop === 0 && clientY > 0 ||
6334
- scrollHeight - scrollTop <= clientHeight && clientY < 0)
6335
- {
6336
- e.cancelable && e.preventDefault();
6337
- }
6338
- } },
6339
-
6340
-
6341
6392
  {
6342
6393
  name: 'show',
6343
6394
 
@@ -6349,7 +6400,6 @@
6349
6400
  addClass(parent(this.panel), this.clsMode);
6350
6401
  }
6351
6402
 
6352
- css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
6353
6403
  addClass(document.body, this.clsContainer, this.clsFlip);
6354
6404
  css(document.body, 'touch-action', 'pan-y pinch-zoom');
6355
6405
  css(this.$el, 'display', 'block');
@@ -6357,7 +6407,7 @@
6357
6407
  addClass(
6358
6408
  this.panel,
6359
6409
  this.clsSidebarAnimation,
6360
- this.mode !== 'reveal' ? this.clsMode : '');
6410
+ this.mode === 'reveal' ? '' : this.clsMode);
6361
6411
 
6362
6412
 
6363
6413
  height(document.body); // force reflow
@@ -6394,8 +6444,6 @@
6394
6444
  removeClass(this.$el, this.clsOverlay);
6395
6445
  css(this.$el, 'display', '');
6396
6446
  removeClass(document.body, this.clsContainer, this.clsFlip);
6397
-
6398
- css(document.documentElement, 'overflowY', '');
6399
6447
  } },
6400
6448
 
6401
6449
 
@@ -6871,7 +6919,9 @@
6871
6919
  },
6872
6920
 
6873
6921
  handler() {
6874
- if (!location.hash || scrollTop(window) === 0) {
6922
+ const { scrollingElement } = document;
6923
+
6924
+ if (!location.hash || scrollingElement.scrollTop === 0) {
6875
6925
  return;
6876
6926
  }
6877
6927
 
@@ -6880,13 +6930,11 @@
6880
6930
  const elOffset = offset(this.$el);
6881
6931
 
6882
6932
  if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6883
- scrollTop(
6884
- window,
6933
+ scrollingElement.scrollTop =
6885
6934
  targetOffset.top -
6886
6935
  elOffset.height -
6887
6936
  toPx(this.targetOffset, 'height', this.placeholder) -
6888
- toPx(this.offset, 'height', this.placeholder));
6889
-
6937
+ toPx(this.offset, 'height', this.placeholder);
6890
6938
  }
6891
6939
  });
6892
6940
  } }],
@@ -6984,7 +7032,7 @@
6984
7032
 
6985
7033
 
6986
7034
  {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref4;
6987
- const scroll = scrollTop(window);
7035
+ const scroll = document.scrollingElement.scrollTop;
6988
7036
  const dir = prevScroll <= scroll ? 'down' : 'up';
6989
7037
 
6990
7038
  return {
@@ -7200,7 +7248,7 @@
7200
7248
 
7201
7249
  watch(connects) {
7202
7250
  if (this.swiping) {
7203
- css(connects, 'touch-action', 'pan-y pinch-zoom');
7251
+ css(connects, 'touchAction', 'pan-y pinch-zoom');
7204
7252
  }
7205
7253
 
7206
7254
  const index = this.index();
@@ -7393,7 +7441,7 @@
7393
7441
 
7394
7442
  events: [
7395
7443
  {
7396
- name: pointerDown,
7444
+ name: pointerDown$1,
7397
7445
 
7398
7446
  filter() {
7399
7447
  return includes(this.mode, 'hover');
@@ -7411,7 +7459,7 @@
7411
7459
  trigger(this.$el, 'focus');
7412
7460
  once(
7413
7461
  document,
7414
- pointerDown,
7462
+ pointerDown$1,
7415
7463
  () => trigger(this.$el, 'blur'),
7416
7464
  true,
7417
7465
  (e) => !within(e.target, this.$el));
@@ -8410,6 +8458,11 @@
8410
8458
  this.interval && clearInterval(this.interval);
8411
8459
  } } };
8412
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
+
8413
8466
  var SliderDrag = {
8414
8467
  props: {
8415
8468
  draggable: Boolean },
@@ -8462,7 +8515,17 @@
8462
8515
 
8463
8516
  handler(e) {
8464
8517
  e.preventDefault();
8465
- } }],
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 }],
8466
8529
 
8467
8530
 
8468
8531
 
@@ -8484,10 +8547,10 @@
8484
8547
  this.prevIndex = this.index;
8485
8548
  }
8486
8549
 
8487
- on(document, pointerMove, this.move, { passive: false });
8550
+ on(document, pointerMove, this.move, pointerOptions);
8488
8551
 
8489
8552
  // 'input' event is triggered by video controls
8490
- on(document, pointerUp + " " + pointerCancel + " input", this.end, true);
8553
+ on(document, pointerUp, this.end, pointerOptions);
8491
8554
 
8492
8555
  css(this.list, 'userSelect', 'none');
8493
8556
  },
@@ -8567,8 +8630,8 @@
8567
8630
  },
8568
8631
 
8569
8632
  end() {
8570
- off(document, pointerMove, this.move, { passive: false });
8571
- off(document, pointerUp + " " + pointerCancel + " input", this.end, true);
8633
+ off(document, pointerMove, this.move, pointerOptions);
8634
+ off(document, pointerUp, this.end, pointerOptions);
8572
8635
 
8573
8636
  if (this.dragging) {
8574
8637
  this.dragging = null;
@@ -8976,7 +9039,7 @@
8976
9039
 
8977
9040
  events: [
8978
9041
  {
8979
- name: pointerMove + " " + pointerDown + " keydown",
9042
+ name: pointerMove$1 + " " + pointerDown$1 + " keydown",
8980
9043
 
8981
9044
  handler: 'showControls' },
8982
9045
 
@@ -9648,7 +9711,7 @@
9648
9711
  positions[prop] = getBackgroundPos(el, prop);
9649
9712
  }
9650
9713
 
9651
- return setBackgroundPosFn(bgProps, props, positions);
9714
+ return setBackgroundPosFn(bgProps, positions, props);
9652
9715
  }
9653
9716
 
9654
9717
  function backgroundCoverFn(prop, el, stops, props) {
@@ -10631,7 +10694,7 @@
10631
10694
  },
10632
10695
 
10633
10696
  events: {
10634
- name: pointerDown,
10697
+ name: pointerDown$1,
10635
10698
  passive: false,
10636
10699
  handler: 'init' },
10637
10700
 
@@ -10761,8 +10824,8 @@
10761
10824
  this.placeholder = placeholder;
10762
10825
  this.origin = { target, index: index(placeholder), ...this.pos };
10763
10826
 
10764
- on(document, pointerMove, this.move);
10765
- on(document, pointerUp, this.end);
10827
+ on(document, pointerMove$1, this.move);
10828
+ on(document, pointerUp$1, this.end);
10766
10829
 
10767
10830
  if (!this.threshold) {
10768
10831
  this.start(e);
@@ -10798,8 +10861,8 @@
10798
10861
  },
10799
10862
 
10800
10863
  end() {
10801
- off(document, pointerMove, this.move);
10802
- off(document, pointerUp, this.end);
10864
+ off(document, pointerMove$1, this.move);
10865
+ off(document, pointerUp$1, this.end);
10803
10866
 
10804
10867
  if (!this.drag) {
10805
10868
  return;
@@ -10868,7 +10931,7 @@
10868
10931
  let last = Date.now();
10869
10932
  trackTimer = setInterval(() => {
10870
10933
  let { x, y } = pos;
10871
- y += scrollTop(window);
10934
+ y += document.scrollingElement.scrollTop;
10872
10935
 
10873
10936
  const dist = (Date.now() - last) * 0.3;
10874
10937
  last = Date.now();
@@ -10889,7 +10952,7 @@
10889
10952
  }
10890
10953
 
10891
10954
  if (scroll > 0 && scroll < scrollHeight - height) {
10892
- scrollTop(scrollEl, scroll);
10955
+ scrollEl.scrollTop = scroll;
10893
10956
  return true;
10894
10957
  }
10895
10958
  });
@@ -11034,11 +11097,11 @@
11034
11097
 
11035
11098
  this._unbind = once(
11036
11099
  document, "show keydown " +
11037
- pointerDown,
11100
+ pointerDown$1,
11038
11101
  this.hide,
11039
11102
  false,
11040
11103
  (e) =>
11041
- e.type === pointerDown && !within(e.target, this.$el) ||
11104
+ e.type === pointerDown$1 && !within(e.target, this.$el) ||
11042
11105
  e.type === 'keydown' && e.keyCode === 27 ||
11043
11106
  e.type === 'show' && e.detail[0] !== this && e.detail[0].$name === this.$name);
11044
11107
 
@@ -11109,7 +11172,7 @@
11109
11172
 
11110
11173
  // Clicking a button does not give it focus on all browsers and platforms
11111
11174
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
11112
- [pointerDown](e) {
11175
+ [pointerDown$1](e) {
11113
11176
  if (isTouch(e)) {
11114
11177
  this.show();
11115
11178
  }