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
@@ -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
  }
@@ -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
 
@@ -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(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,165 +3775,526 @@
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, (_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 + " " + pointerCancel + " scroll",
3867
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3868
+ if (
3869
+ !defaultPrevented &&
3870
+ type === pointerUp &&
3871
+ target === newTarget)
3872
+ {
3873
+ this.hide();
3874
+ }
3875
+ },
3876
+ true);
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;
3920
+ if (includes(active$1, this)) {
3921
+ active$1.splice(active$1.indexOf(this), 1);
3922
+ }
3919
3923
 
3920
- this.tracker.init();
3924
+ if (!active$1.length) {
3925
+ css(document.body, 'overflowY', '');
3926
+ }
3921
3927
 
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));}),
3928
+ css(this.$el, 'zIndex', '');
3942
3929
 
3930
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3931
+ removeClass(document.documentElement, this.clsPage);
3932
+ }
3933
+ } }],
3943
3934
 
3944
3935
 
3945
- on(document, 'keydown', (e) => {
3946
- if (e.keyCode === 27) {
3947
- this.hide(false);
3948
- }
3949
- }),
3950
3936
 
3951
- ...(this.display === 'static' && this.align !== 'stretch' ?
3952
- [] :
3953
- (() => {
3954
- const handler = () => this.$emit();
3955
- return [
3956
- on(window, 'resize', handler),
3937
+ methods: {
3938
+ toggle() {
3939
+ return this.isToggled() ? this.hide() : this.show();
3940
+ },
3941
+
3942
+ show() {
3943
+ if (this.container && parent(this.$el) !== this.container) {
3944
+ append(this.container, this.$el);
3945
+ return new Promise((resolve) =>
3946
+ requestAnimationFrame(() => this.show().then(resolve)));
3947
+
3948
+ }
3949
+
3950
+ return this.toggleElement(this.$el, true, animate(this));
3951
+ },
3952
+
3953
+ hide() {
3954
+ return this.toggleElement(this.$el, false, animate(this));
3955
+ } } };
3956
+
3957
+
3958
+
3959
+ function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
3960
+ return (el, show) =>
3961
+ new Promise((resolve, reject) =>
3962
+ once(el, 'show hide', () => {
3963
+ el._reject == null ? void 0 : el._reject();
3964
+ el._reject = reject;
3965
+
3966
+ _toggle(el, show);
3967
+
3968
+ const off = once(
3969
+ transitionElement,
3970
+ 'transitionstart',
3971
+ () => {
3972
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3973
+ self: true });
3974
+
3975
+ clearTimeout(timer);
3976
+ },
3977
+ { self: true });
3978
+
3979
+
3980
+ const timer = setTimeout(() => {
3981
+ off();
3982
+ resolve();
3983
+ }, toMs(css(transitionElement, 'transitionDuration')));
3984
+ })).
3985
+ then(() => delete el._reject);
3986
+ }
3987
+
3988
+ function toMs(time) {
3989
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3990
+ }
3991
+
3992
+ function preventOverscroll(el) {
3993
+ if (CSS.supports('overscroll-behavior', 'contain')) {
3994
+ const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
3995
+ css(elements, 'overscrollBehavior', 'contain');
3996
+ return () => css(elements, 'overscrollBehavior', '');
3997
+ }
3998
+
3999
+ let startClientY;
4000
+
4001
+ const events = [
4002
+ on(
4003
+ el,
4004
+ 'touchstart',
4005
+ (_ref6) => {let { targetTouches } = _ref6;
4006
+ if (targetTouches.length === 1) {
4007
+ startClientY = targetTouches[0].clientY;
4008
+ }
4009
+ },
4010
+ { passive: true }),
4011
+
4012
+
4013
+ on(
4014
+ el,
4015
+ 'touchmove',
4016
+ (e) => {
4017
+ if (e.targetTouches.length !== 1) {
4018
+ return;
4019
+ }
4020
+
4021
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
4022
+ if (!within(scrollParent, el)) {
4023
+ scrollParent = el;
4024
+ }
4025
+
4026
+ const clientY = e.targetTouches[0].clientY - startClientY;
4027
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
4028
+
4029
+ if (
4030
+ clientHeight >= scrollHeight ||
4031
+ scrollTop === 0 && clientY > 0 ||
4032
+ scrollHeight - scrollTop <= clientHeight && clientY < 0)
4033
+ {
4034
+ e.cancelable && e.preventDefault();
4035
+ }
4036
+ },
4037
+ { passive: false })];
4038
+
4039
+
4040
+
4041
+ return () => events.forEach((fn) => fn());
4042
+ }
4043
+
4044
+ function preventBackgroundScroll() {
4045
+ const { body, documentElement } = document;
4046
+ css(body, {
4047
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4048
+ touchAction: 'none' });
4049
+
4050
+ css(documentElement, 'overflowY', 'hidden');
4051
+ return () => {
4052
+ css(documentElement, 'overflowY', '');
4053
+ css(body, { overflowY: '', touchAction: '' });
4054
+ };
4055
+ }
4056
+
4057
+ function filterChildren(el, fn) {
4058
+ const children = [];
4059
+ apply(el, (node) => {
4060
+ if (fn(node)) {
4061
+ children.push(node);
4062
+ }
4063
+ });
4064
+ return children;
4065
+ }
4066
+
4067
+ let active;
4068
+
4069
+ var drop = {
4070
+ mixins: [Container, Lazyload, Position, Togglable],
4071
+
4072
+ args: 'pos',
4073
+
4074
+ props: {
4075
+ mode: 'list',
4076
+ toggle: Boolean,
4077
+ boundary: Boolean,
4078
+ boundaryAlign: Boolean,
4079
+ delayShow: Number,
4080
+ delayHide: Number,
4081
+ display: String,
4082
+ clsDrop: String,
4083
+ animateOut: Boolean,
4084
+ bgScroll: Boolean },
4085
+
4086
+
4087
+ data: {
4088
+ mode: ['click', 'hover'],
4089
+ toggle: '- *',
4090
+ boundary: true,
4091
+ boundaryAlign: false,
4092
+ delayShow: 0,
4093
+ delayHide: 800,
4094
+ display: null,
4095
+ clsDrop: false,
4096
+ animation: ['uk-animation-fade'],
4097
+ cls: 'uk-open',
4098
+ container: false,
4099
+ animateOut: false,
4100
+ bgScroll: true },
4101
+
4102
+
4103
+ created() {
4104
+ this.tracker = new MouseTracker();
4105
+ },
4106
+
4107
+ beforeConnect() {
4108
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4109
+ },
4110
+
4111
+ connected() {
4112
+ addClass(this.$el, this.clsDrop);
4113
+
4114
+ if (this.toggle && !this.target) {
4115
+ this.target = this.$create('toggle', query(this.toggle, this.$el), {
4116
+ target: this.$el,
4117
+ mode: this.mode }).
4118
+ $el;
4119
+ attr(this.target, 'aria-haspopup', true);
4120
+ this.lazyload(this.target);
4121
+ }
4122
+ },
4123
+
4124
+ disconnected() {
4125
+ if (this.isActive()) {
4126
+ active = null;
4127
+ }
4128
+ },
4129
+
4130
+ events: [
4131
+ {
4132
+ name: 'click',
4133
+
4134
+ delegate() {
4135
+ return "." + this.clsDrop + "-close";
4136
+ },
4137
+
4138
+ handler(e) {
4139
+ e.preventDefault();
4140
+ this.hide(false);
4141
+ } },
4142
+
4143
+
4144
+ {
4145
+ name: 'click',
4146
+
4147
+ delegate() {
4148
+ return 'a[href^="#"]';
4149
+ },
4150
+
4151
+ handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4152
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4153
+ this.hide(false);
4154
+ }
4155
+ } },
4156
+
4157
+
4158
+ {
4159
+ name: 'beforescroll',
4160
+
4161
+ handler() {
4162
+ this.hide(false);
4163
+ } },
4164
+
4165
+
4166
+ {
4167
+ name: 'toggle',
4168
+
4169
+ self: true,
4170
+
4171
+ handler(e, toggle) {
4172
+ e.preventDefault();
4173
+
4174
+ if (this.isToggled()) {
4175
+ this.hide(false);
4176
+ } else {
4177
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4178
+ }
4179
+ } },
4180
+
4181
+
4182
+ {
4183
+ name: 'toggleshow',
4184
+
4185
+ self: true,
4186
+
4187
+ handler(e, toggle) {
4188
+ e.preventDefault();
4189
+ this.show(toggle == null ? void 0 : toggle.$el);
4190
+ } },
4191
+
4192
+
4193
+ {
4194
+ name: 'togglehide',
4195
+
4196
+ self: true,
4197
+
4198
+ handler(e) {
4199
+ e.preventDefault();
4200
+ if (!matches(this.$el, ':focus,:hover')) {
4201
+ this.hide();
4202
+ }
4203
+ } },
4204
+
4205
+
4206
+ {
4207
+ name: pointerEnter + " focusin",
4208
+
4209
+ filter() {
4210
+ return includes(this.mode, 'hover');
4211
+ },
4212
+
4213
+ handler(e) {
4214
+ if (!isTouch(e)) {
4215
+ this.clearTimers();
4216
+ }
4217
+ } },
4218
+
4219
+
4220
+ {
4221
+ name: pointerLeave + " focusout",
4222
+
4223
+ filter() {
4224
+ return includes(this.mode, 'hover');
4225
+ },
4226
+
4227
+ handler(e) {
4228
+ if (!isTouch(e) && e.relatedTarget) {
4229
+ this.hide();
4230
+ }
4231
+ } },
4232
+
4233
+
4234
+ {
4235
+ name: 'toggled',
4236
+
4237
+ self: true,
4238
+
4239
+ handler(e, toggled) {
4240
+ if (!toggled) {
4241
+ return;
4242
+ }
4243
+
4244
+ this.clearTimers();
4245
+ this.position();
4246
+ } },
4247
+
4248
+
4249
+ {
4250
+ name: 'show',
4251
+
4252
+ self: true,
4253
+
4254
+ handler() {
4255
+ active = this;
4256
+
4257
+ this.tracker.init();
4258
+
4259
+ for (const handler of [
4260
+ on(
4261
+ document,
4262
+ pointerDown,
4263
+ (_ref2) => {let { target } = _ref2;return (
4264
+ !within(target, this.$el) &&
4265
+ once(
4266
+ document,
4267
+ pointerUp + " " + pointerCancel + " scroll",
4268
+ (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4269
+ if (
4270
+ !defaultPrevented &&
4271
+ type === pointerUp &&
4272
+ target === newTarget &&
4273
+ !(this.target && within(target, this.target)))
4274
+ {
4275
+ this.hide(false);
4276
+ }
4277
+ },
4278
+ true));}),
4279
+
4280
+
4281
+
4282
+ on(document, 'keydown', (e) => {
4283
+ if (e.keyCode === 27) {
4284
+ this.hide(false);
4285
+ }
4286
+ }),
4287
+
4288
+ ...(this.bgScroll ?
4289
+ [] :
4290
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4291
+
4292
+ ...(this.display === 'static' && this.align !== 'stretch' ?
4293
+ [] :
4294
+ (() => {
4295
+ const handler = () => this.$emit();
4296
+ return [
4297
+ on(window, 'resize', handler),
3957
4298
  on(document, 'scroll', handler, true),
3958
4299
  (() => {
3959
4300
  const observer = observeResize(
@@ -3985,14 +4326,14 @@
3985
4326
 
3986
4327
  handler(_ref4) {let { target } = _ref4;
3987
4328
  if (this.$el !== target) {
3988
- active$1 =
3989
- active$1 === null && within(target, this.$el) && this.isToggled() ?
4329
+ active =
4330
+ active === null && within(target, this.$el) && this.isToggled() ?
3990
4331
  this :
3991
- active$1;
4332
+ active;
3992
4333
  return;
3993
4334
  }
3994
4335
 
3995
- active$1 = this.isActive() ? null : active$1;
4336
+ active = this.isActive() ? null : active;
3996
4337
  this.tracker.cancel();
3997
4338
  } }],
3998
4339
 
@@ -4020,16 +4361,16 @@
4020
4361
  return;
4021
4362
  }
4022
4363
 
4023
- if (active$1) {
4024
- if (delay && active$1.isDelaying) {
4364
+ if (active) {
4365
+ if (delay && active.isDelaying) {
4025
4366
  this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4026
4367
  return;
4027
4368
  }
4028
4369
 
4029
4370
  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);
4371
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4372
+ prev = active;
4373
+ active.hide(false, false);
4033
4374
  }
4034
4375
  }
4035
4376
 
@@ -4070,7 +4411,7 @@
4070
4411
  },
4071
4412
 
4072
4413
  isActive() {
4073
- return active$1 === this;
4414
+ return active === this;
4074
4415
  },
4075
4416
 
4076
4417
  position() {
@@ -4636,14 +4977,18 @@
4636
4977
  0);
4637
4978
 
4638
4979
  } else {
4639
- // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4640
- minHeight = "calc(" + (
4641
- document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4980
+ const isScrollingElement = document.scrollingElement === scrollElement;
4642
4981
 
4982
+ // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4983
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
4643
4984
 
4644
4985
  if (this.offsetTop) {
4645
- const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4646
- minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4986
+ if (isScrollingElement) {
4987
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4988
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4989
+ } else {
4990
+ minHeight += " - " + css(scrollElement, 'paddingTop');
4991
+ }
4647
4992
  }
4648
4993
 
4649
4994
  if (this.offsetBottom === true) {
@@ -5159,412 +5504,161 @@
5159
5504
  const value = data(sourceEl, prop);
5160
5505
  if (value) {
5161
5506
  attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5162
- }
5163
- });
5164
- }
5165
-
5166
- function getImageFromElement(el, src, sources) {
5167
- const img = new Image();
5168
-
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
- }
5177
-
5178
- function wrapInPicture(img, sources) {
5179
- sources = parseSources(sources);
5180
-
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);
5187
- }
5188
- append(picture, img);
5189
- }
5190
- }
5191
-
5192
- function parseSources(sources) {
5193
- if (!sources) {
5194
- return [];
5195
- }
5196
-
5197
- if (startsWith(sources, '[')) {
5198
- try {
5199
- sources = JSON.parse(sources);
5200
- } catch (e) {
5201
- sources = [];
5202
- }
5203
- } else {
5204
- sources = parseOptions(sources);
5205
- }
5206
-
5207
- if (!isArray(sources)) {
5208
- sources = [sources];
5209
- }
5210
-
5211
- return sources.filter((source) => !isEmpty(source));
5212
- }
5213
-
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>');
5217
- }
5218
- }
5219
-
5220
- function isPicture(el) {
5221
- return isTag(el, 'picture');
5222
- }
5223
-
5224
- function isImg(el) {
5225
- return isTag(el, 'img');
5226
- }
5227
-
5228
- var Media = {
5229
- props: {
5230
- media: Boolean },
5231
-
5232
-
5233
- data: {
5234
- media: false },
5235
-
5236
-
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
- },
5253
-
5254
- disconnected() {var _this$offMediaObj;
5255
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5256
- } };
5257
-
5258
-
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
- }
5268
-
5269
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5270
- }
5271
-
5272
- var leader = {
5273
- mixins: [Class, Media, Resize],
5274
-
5275
- props: {
5276
- fill: String },
5277
-
5278
-
5279
- data: {
5280
- fill: '',
5281
- clsWrapper: 'uk-leader-fill',
5282
- clsHide: 'uk-leader-hide',
5283
- attrFill: 'data-fill' },
5284
-
5285
-
5286
- computed: {
5287
- fill(_ref) {let { fill } = _ref;
5288
- return fill || getCssVar('leader-fill-content');
5289
- } },
5290
-
5291
-
5292
- connected() {
5293
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5294
- },
5295
-
5296
- disconnected() {
5297
- unwrap(this.wrapper.childNodes);
5298
- },
5299
-
5300
- update: {
5301
- read() {
5302
- const width = Math.trunc(this.$el.offsetWidth / 2);
5303
-
5304
- return {
5305
- width,
5306
- fill: this.fill,
5307
- hide: !this.matchMedia };
5308
-
5309
- },
5310
-
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
-
5316
- events: ['resize'] } };
5317
-
5318
- const active = [];
5319
-
5320
- var Modal = {
5321
- mixins: [Class, Container, Togglable],
5322
-
5323
- props: {
5324
- selPanel: String,
5325
- selClose: String,
5326
- escClose: Boolean,
5327
- bgClose: Boolean,
5328
- stack: Boolean },
5329
-
5330
-
5331
- data: {
5332
- cls: 'uk-open',
5333
- escClose: true,
5334
- bgClose: true,
5335
- overlay: true,
5336
- stack: false },
5337
-
5338
-
5339
- computed: {
5340
- panel(_ref, $el) {let { selPanel } = _ref;
5341
- return $(selPanel, $el);
5342
- },
5343
-
5344
- transitionElement() {
5345
- return this.panel;
5346
- },
5347
-
5348
- bgClose(_ref2) {let { bgClose } = _ref2;
5349
- return bgClose && this.panel;
5350
- } },
5351
-
5352
-
5353
- beforeDisconnect() {
5354
- if (includes(active, this)) {
5355
- this.toggleElement(this.$el, false, false);
5356
- }
5357
- },
5358
-
5359
- events: [
5360
- {
5361
- name: 'click',
5362
-
5363
- delegate() {
5364
- return this.selClose;
5365
- },
5366
-
5367
- handler(e) {
5368
- e.preventDefault();
5369
- this.hide();
5370
- } },
5371
-
5372
-
5373
- {
5374
- name: 'toggle',
5375
-
5376
- self: true,
5377
-
5378
- handler(e) {
5379
- if (e.defaultPrevented) {
5380
- return;
5381
- }
5382
-
5383
- e.preventDefault();
5384
-
5385
- if (this.isToggled() === includes(active, this)) {
5386
- this.toggle();
5387
- }
5388
- } },
5389
-
5390
-
5391
- {
5392
- name: 'beforeshow',
5393
-
5394
- self: true,
5395
-
5396
- handler(e) {
5397
- if (includes(active, this)) {
5398
- return false;
5399
- }
5400
-
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);
5406
- }
5407
- } },
5408
-
5409
-
5410
- {
5411
- name: 'show',
5412
-
5413
- self: true,
5414
-
5415
- handler() {
5416
- const docEl = document.documentElement;
5417
-
5418
- if (width(window) > docEl.clientWidth && this.overlay) {
5419
- css(document.body, 'overflowY', 'scroll');
5420
- }
5421
-
5422
- if (this.stack) {
5423
- css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
5424
- }
5507
+ }
5508
+ });
5509
+ }
5425
5510
 
5426
- addClass(docEl, this.clsPage);
5511
+ function getImageFromElement(el, src, sources) {
5512
+ const img = new Image();
5427
5513
 
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
- }
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
+ }
5440
5522
 
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);
5523
+ function wrapInPicture(img, sources) {
5524
+ sources = parseSources(sources);
5454
5525
 
5455
- }),
5456
- { 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
+ }
5457
5536
 
5458
- }
5537
+ function parseSources(sources) {
5538
+ if (!sources) {
5539
+ return [];
5540
+ }
5459
5541
 
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 });
5542
+ if (startsWith(sources, '[')) {
5543
+ try {
5544
+ sources = JSON.parse(sources);
5545
+ } catch (e) {
5546
+ sources = [];
5547
+ }
5548
+ } else {
5549
+ sources = parseOptions(sources);
5550
+ }
5470
5551
 
5471
- }
5472
- } },
5552
+ if (!isArray(sources)) {
5553
+ sources = [sources];
5554
+ }
5473
5555
 
5556
+ return sources.filter((source) => !isEmpty(source));
5557
+ }
5474
5558
 
5475
- {
5476
- name: 'shown',
5559
+ function ensureSrcAttribute(el) {
5560
+ if (isImg(el) && !hasAttr(el, 'src')) {
5561
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5562
+ }
5563
+ }
5477
5564
 
5478
- self: true,
5565
+ function isPicture(el) {
5566
+ return isTag(el, 'picture');
5567
+ }
5479
5568
 
5480
- handler() {
5481
- if (!isFocusable(this.$el)) {
5482
- attr(this.$el, 'tabindex', '-1');
5483
- }
5569
+ function isImg(el) {
5570
+ return isTag(el, 'img');
5571
+ }
5484
5572
 
5485
- if (!$(':focus', this.$el)) {
5486
- this.$el.focus();
5487
- }
5488
- } },
5573
+ var Media = {
5574
+ props: {
5575
+ media: Boolean },
5489
5576
 
5490
5577
 
5491
- {
5492
- name: 'hidden',
5578
+ data: {
5579
+ media: false },
5493
5580
 
5494
- self: true,
5495
5581
 
5496
- handler() {
5497
- if (includes(active, this)) {
5498
- active.splice(active.indexOf(this), 1);
5499
- }
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
+ },
5500
5598
 
5501
- if (!active.length) {
5502
- css(document.body, 'overflowY', '');
5503
- }
5599
+ disconnected() {var _this$offMediaObj;
5600
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5601
+ } };
5504
5602
 
5505
- css(this.$el, 'zIndex', '');
5506
5603
 
5507
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5508
- removeClass(document.documentElement, this.clsPage);
5509
- }
5510
- } }],
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
+ }
5511
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,
@@ -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) {
@@ -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();