uikit 3.14.4-dev.871ba3c05 → 3.14.4-dev.a02c81d72

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 (77) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/css/uikit-core-rtl.css +73 -28
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +73 -28
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +70 -29
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +70 -29
  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 +7 -5
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +110 -11
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +110 -11
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +22 -7
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +22 -7
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +3 -3
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +18 -3
  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 +717 -637
  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 +1511 -1414
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/images/backgrounds/nav-parent-close.svg +1 -1
  44. package/src/images/backgrounds/nav-parent-open.svg +1 -1
  45. package/src/images/backgrounds/navbar-parent-close.svg +3 -0
  46. package/src/images/backgrounds/navbar-parent-open.svg +3 -0
  47. package/src/js/components/filter.js +5 -3
  48. package/src/js/components/sortable.js +2 -3
  49. package/src/js/core/drop.js +7 -0
  50. package/src/js/core/height-viewport.js +11 -5
  51. package/src/js/core/navbar.js +44 -15
  52. package/src/js/core/offcanvas.js +1 -47
  53. package/src/js/core/sticky.js +8 -9
  54. package/src/js/mixin/modal.js +90 -4
  55. package/src/js/mixin/position.js +24 -7
  56. package/src/js/mixin/slider-drag.js +20 -8
  57. package/src/js/util/dimensions.js +6 -6
  58. package/src/js/util/position.js +1 -0
  59. package/src/js/util/viewport.js +2 -27
  60. package/src/less/components/dropdown.less +8 -0
  61. package/src/less/components/nav.less +22 -4
  62. package/src/less/components/navbar.less +60 -24
  63. package/src/less/components/utility.less +12 -3
  64. package/src/less/theme/nav.less +3 -7
  65. package/src/less/theme/navbar.less +7 -7
  66. package/src/scss/components/dropdown.scss +8 -0
  67. package/src/scss/components/nav.scss +24 -6
  68. package/src/scss/components/navbar.scss +60 -24
  69. package/src/scss/components/utility.scss +12 -3
  70. package/src/scss/mixins-theme.scss +2 -5
  71. package/src/scss/theme/nav.scss +3 -7
  72. package/src/scss/theme/navbar.scss +6 -3
  73. package/src/scss/variables-theme.scss +26 -10
  74. package/src/scss/variables.scss +26 -8
  75. package/tests/drop.html +72 -16
  76. package/tests/dropdown.html +103 -16
  77. package/tests/navbar.html +2132 -1126
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.871ba3c05 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.a02c81d72 | 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) {
@@ -2106,6 +2092,7 @@
2106
2092
  return newPos;
2107
2093
  }
2108
2094
  }
2095
+ continue;
2109
2096
  }
2110
2097
 
2111
2098
  // Move
@@ -2298,7 +2285,6 @@
2298
2285
  getCssVar: getCssVar,
2299
2286
  propName: propName,
2300
2287
  isInView: isInView,
2301
- scrollTop: scrollTop,
2302
2288
  scrollIntoView: scrollIntoView,
2303
2289
  scrolledOver: scrolledOver,
2304
2290
  scrollParents: scrollParents,
@@ -2961,7 +2947,7 @@
2961
2947
  UIkit.data = '__uikit__';
2962
2948
  UIkit.prefix = 'uk-';
2963
2949
  UIkit.options = {};
2964
- UIkit.version = '3.14.4-dev.871ba3c05';
2950
+ UIkit.version = '3.14.4-dev.a02c81d72';
2965
2951
 
2966
2952
  globalAPI(UIkit);
2967
2953
  hooksAPI(UIkit);
@@ -3698,17 +3684,32 @@
3698
3684
  offset = offset.reverse();
3699
3685
  }
3700
3686
 
3687
+ const [scrollElement] = scrollParents(element, /auto|scroll/);
3688
+ const { scrollTop, scrollLeft } = scrollElement;
3689
+
3701
3690
  // Ensure none positioned element does not generate scrollbars
3702
3691
  const elDim = dimensions(element);
3703
3692
  css(element, { top: -elDim.height, left: -elDim.width });
3704
3693
 
3705
- positionAt(element, target, {
3694
+ const args = [
3695
+ element,
3696
+ target,
3697
+ {
3706
3698
  attach,
3707
3699
  offset,
3708
3700
  boundary,
3709
3701
  flip: this.flip,
3710
- viewportOffset: this.getViewportOffset(element) });
3702
+ viewportOffset: this.getViewportOffset(element) }];
3703
+
3704
+
3711
3705
 
3706
+ trigger(element, 'beforeposition', args);
3707
+
3708
+ positionAt(...args);
3709
+
3710
+ // Restore scroll position
3711
+ scrollElement.scrollTop = scrollTop;
3712
+ scrollElement.scrollLeft = scrollLeft;
3712
3713
  },
3713
3714
 
3714
3715
  getPositionOffset(element) {
@@ -3735,64 +3736,44 @@
3735
3736
  return toPx(getCssVar('position-viewport-offset', element));
3736
3737
  } } };
3737
3738
 
3738
- let active$1;
3739
-
3740
- var drop = {
3741
- mixins: [Container, Lazyload, Position, Togglable],
3739
+ const active$1 = [];
3742
3740
 
3743
- args: 'pos',
3741
+ var Modal = {
3742
+ mixins: [Class, Container, Togglable],
3744
3743
 
3745
3744
  props: {
3746
- mode: 'list',
3747
- toggle: Boolean,
3748
- boundary: Boolean,
3749
- boundaryAlign: Boolean,
3750
- delayShow: Number,
3751
- delayHide: Number,
3752
- display: String,
3753
- clsDrop: String,
3754
- animateOut: Boolean },
3745
+ selPanel: String,
3746
+ selClose: String,
3747
+ escClose: Boolean,
3748
+ bgClose: Boolean,
3749
+ stack: Boolean },
3755
3750
 
3756
3751
 
3757
3752
  data: {
3758
- mode: ['click', 'hover'],
3759
- toggle: '- *',
3760
- boundary: true,
3761
- boundaryAlign: false,
3762
- delayShow: 0,
3763
- delayHide: 800,
3764
- display: null,
3765
- clsDrop: false,
3766
- animation: ['uk-animation-fade'],
3767
3753
  cls: 'uk-open',
3768
- container: false,
3769
- animateOut: false },
3754
+ escClose: true,
3755
+ bgClose: true,
3756
+ overlay: true,
3757
+ stack: false },
3770
3758
 
3771
3759
 
3772
- created() {
3773
- this.tracker = new MouseTracker();
3774
- },
3760
+ computed: {
3761
+ panel(_ref, $el) {let { selPanel } = _ref;
3762
+ return $(selPanel, $el);
3763
+ },
3775
3764
 
3776
- beforeConnect() {
3777
- this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
3778
- },
3765
+ transitionElement() {
3766
+ return this.panel;
3767
+ },
3779
3768
 
3780
- connected() {
3781
- addClass(this.$el, this.clsDrop);
3769
+ bgClose(_ref2) {let { bgClose } = _ref2;
3770
+ return bgClose && this.panel;
3771
+ } },
3782
3772
 
3783
- if (this.toggle && !this.target) {
3784
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
3785
- target: this.$el,
3786
- mode: this.mode }).
3787
- $el;
3788
- attr(this.target, 'aria-haspopup', true);
3789
- this.lazyload(this.target);
3790
- }
3791
- },
3792
3773
 
3793
- disconnected() {
3794
- if (this.isActive()) {
3795
- active$1 = null;
3774
+ beforeDisconnect() {
3775
+ if (includes(active$1, this)) {
3776
+ this.toggleElement(this.$el, false, false);
3796
3777
  }
3797
3778
  },
3798
3779
 
@@ -3801,34 +3782,12 @@
3801
3782
  name: 'click',
3802
3783
 
3803
3784
  delegate() {
3804
- return "." + this.clsDrop + "-close";
3785
+ return this.selClose;
3805
3786
  },
3806
3787
 
3807
3788
  handler(e) {
3808
3789
  e.preventDefault();
3809
- this.hide(false);
3810
- } },
3811
-
3812
-
3813
- {
3814
- name: 'click',
3815
-
3816
- delegate() {
3817
- return 'a[href^="#"]';
3818
- },
3819
-
3820
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
3821
- if (!defaultPrevented && hash && !within(hash, this.$el)) {
3822
- this.hide(false);
3823
- }
3824
- } },
3825
-
3826
-
3827
- {
3828
- name: 'beforescroll',
3829
-
3830
- handler() {
3831
- this.hide(false);
3790
+ this.hide();
3832
3791
  } },
3833
3792
 
3834
3793
 
@@ -3837,152 +3796,535 @@
3837
3796
 
3838
3797
  self: true,
3839
3798
 
3840
- handler(e, toggle) {
3841
- e.preventDefault();
3842
-
3843
- if (this.isToggled()) {
3844
- this.hide(false);
3845
- } else {
3846
- this.show(toggle == null ? void 0 : toggle.$el, false);
3799
+ handler(e) {
3800
+ if (e.defaultPrevented) {
3801
+ return;
3847
3802
  }
3848
- } },
3849
-
3850
3803
 
3851
- {
3852
- name: 'toggleshow',
3853
-
3854
- self: true,
3855
-
3856
- handler(e, toggle) {
3857
3804
  e.preventDefault();
3858
- this.show(toggle == null ? void 0 : toggle.$el);
3859
- } },
3860
3805
 
3861
-
3862
- {
3863
- name: 'togglehide',
3864
-
3865
- self: true,
3866
-
3867
- handler(e) {
3868
- e.preventDefault();
3869
- if (!matches(this.$el, ':focus,:hover')) {
3870
- this.hide();
3806
+ if (this.isToggled() === includes(active$1, this)) {
3807
+ this.toggle();
3871
3808
  }
3872
3809
  } },
3873
3810
 
3874
3811
 
3875
3812
  {
3876
- name: pointerEnter + " focusin",
3813
+ name: 'beforeshow',
3877
3814
 
3878
- filter() {
3879
- return includes(this.mode, 'hover');
3880
- },
3815
+ self: true,
3881
3816
 
3882
3817
  handler(e) {
3883
- if (!isTouch(e)) {
3884
- this.clearTimers();
3818
+ if (includes(active$1, this)) {
3819
+ return false;
3885
3820
  }
3886
- } },
3887
-
3888
-
3889
- {
3890
- name: pointerLeave + " focusout",
3891
-
3892
- filter() {
3893
- return includes(this.mode, 'hover');
3894
- },
3895
3821
 
3896
- handler(e) {
3897
- if (!isTouch(e) && e.relatedTarget) {
3898
- this.hide();
3822
+ if (!this.stack && active$1.length) {
3823
+ Promise.all(active$1.map((modal) => modal.hide())).then(this.show);
3824
+ e.preventDefault();
3825
+ } else {
3826
+ active$1.push(this);
3899
3827
  }
3900
3828
  } },
3901
3829
 
3902
3830
 
3903
3831
  {
3904
- name: 'toggled',
3832
+ name: 'show',
3905
3833
 
3906
3834
  self: true,
3907
3835
 
3908
- handler(e, toggled) {
3909
- if (!toggled) {
3910
- return;
3911
- }
3912
-
3913
- this.clearTimers();
3914
- this.position();
3915
- } },
3836
+ handler() {
3837
+ once(
3838
+ this.$el,
3839
+ 'hide',
3840
+ on(document, 'focusin', (e) => {
3841
+ if (last(active$1) === this && !within(e.target, this.$el)) {
3842
+ this.$el.focus();
3843
+ }
3844
+ }));
3916
3845
 
3917
3846
 
3918
- {
3919
- name: 'show',
3847
+ if (this.overlay) {
3848
+ once(this.$el, 'hide', preventOverscroll(this.$el));
3849
+ once(this.$el, 'hide', preventBackgroundScroll());
3850
+ }
3920
3851
 
3921
- self: true,
3852
+ if (this.stack) {
3853
+ css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
3854
+ }
3922
3855
 
3923
- handler() {
3924
- active$1 = this;
3856
+ addClass(document.documentElement, this.clsPage);
3925
3857
 
3926
- this.tracker.init();
3858
+ if (this.bgClose) {
3859
+ once(
3860
+ this.$el,
3861
+ 'hide',
3862
+ on(document, pointerDown, (_ref3) => {let { target } = _ref3;
3863
+ if (
3864
+ last(active$1) !== this ||
3865
+ this.overlay && !within(target, this.$el) ||
3866
+ within(target, this.panel))
3867
+ {
3868
+ return;
3869
+ }
3927
3870
 
3928
- for (const handler of [
3929
- on(
3930
- document,
3931
- pointerDown,
3932
- (_ref2) => {let { target } = _ref2;return (
3933
- !within(target, this.$el) &&
3934
3871
  once(
3935
3872
  document,
3936
3873
  pointerUp + " " + pointerCancel + " scroll",
3937
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
3874
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3938
3875
  if (
3939
3876
  !defaultPrevented &&
3940
3877
  type === pointerUp &&
3941
- target === newTarget &&
3942
- !(this.target && within(target, this.target)))
3878
+ target === newTarget)
3943
3879
  {
3944
- this.hide(false);
3880
+ this.hide();
3945
3881
  }
3946
3882
  },
3947
- true));}),
3948
-
3949
-
3883
+ true);
3950
3884
 
3951
- on(document, 'keydown', (e) => {
3952
- if (e.keyCode === 27) {
3953
- this.hide(false);
3954
- }
3955
- }),
3885
+ }),
3886
+ { self: true });
3956
3887
 
3957
- ...(this.display === 'static' && this.align !== 'stretch' ?
3958
- [] :
3959
- (() => {
3960
- const handler = () => this.$emit();
3961
- return [
3962
- on(window, 'resize', handler),
3963
- on(document, 'scroll', handler, true),
3964
- (() => {
3965
- const observer = observeResize(
3966
- scrollParents(this.$el),
3967
- handler);
3888
+ }
3968
3889
 
3969
- return () => observer.disconnect();
3970
- })()];
3890
+ if (this.escClose) {
3891
+ once(
3892
+ this.$el,
3893
+ 'hide',
3894
+ on(document, 'keydown', (e) => {
3895
+ if (e.keyCode === 27 && last(active$1) === this) {
3896
+ this.hide();
3897
+ }
3898
+ }),
3899
+ { self: true });
3971
3900
 
3972
- })())])
3973
- {
3974
- once(this.$el, 'hide', handler, { self: true });
3975
3901
  }
3976
3902
  } },
3977
3903
 
3978
3904
 
3979
3905
  {
3980
- name: 'beforehide',
3906
+ name: 'shown',
3981
3907
 
3982
3908
  self: true,
3983
3909
 
3984
3910
  handler() {
3985
- this.clearTimers();
3911
+ if (!isFocusable(this.$el)) {
3912
+ attr(this.$el, 'tabindex', '-1');
3913
+ }
3914
+
3915
+ if (!$(':focus', this.$el)) {
3916
+ this.$el.focus();
3917
+ }
3918
+ } },
3919
+
3920
+
3921
+ {
3922
+ name: 'hidden',
3923
+
3924
+ self: true,
3925
+
3926
+ handler() {
3927
+ if (includes(active$1, this)) {
3928
+ active$1.splice(active$1.indexOf(this), 1);
3929
+ }
3930
+
3931
+ if (!active$1.length) {
3932
+ css(document.body, 'overflowY', '');
3933
+ }
3934
+
3935
+ css(this.$el, 'zIndex', '');
3936
+
3937
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3938
+ removeClass(document.documentElement, this.clsPage);
3939
+ }
3940
+ } }],
3941
+
3942
+
3943
+
3944
+ methods: {
3945
+ toggle() {
3946
+ return this.isToggled() ? this.hide() : this.show();
3947
+ },
3948
+
3949
+ show() {
3950
+ if (this.container && parent(this.$el) !== this.container) {
3951
+ append(this.container, this.$el);
3952
+ return new Promise((resolve) =>
3953
+ requestAnimationFrame(() => this.show().then(resolve)));
3954
+
3955
+ }
3956
+
3957
+ return this.toggleElement(this.$el, true, animate(this));
3958
+ },
3959
+
3960
+ hide() {
3961
+ return this.toggleElement(this.$el, false, animate(this));
3962
+ } } };
3963
+
3964
+
3965
+
3966
+ function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
3967
+ return (el, show) =>
3968
+ new Promise((resolve, reject) =>
3969
+ once(el, 'show hide', () => {
3970
+ el._reject == null ? void 0 : el._reject();
3971
+ el._reject = reject;
3972
+
3973
+ _toggle(el, show);
3974
+
3975
+ const off = once(
3976
+ transitionElement,
3977
+ 'transitionstart',
3978
+ () => {
3979
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3980
+ self: true });
3981
+
3982
+ clearTimeout(timer);
3983
+ },
3984
+ { self: true });
3985
+
3986
+
3987
+ const timer = setTimeout(() => {
3988
+ off();
3989
+ resolve();
3990
+ }, toMs(css(transitionElement, 'transitionDuration')));
3991
+ })).
3992
+ then(() => delete el._reject);
3993
+ }
3994
+
3995
+ function toMs(time) {
3996
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3997
+ }
3998
+
3999
+ function preventOverscroll(el) {
4000
+ if (CSS.supports('overscroll-behavior', 'contain')) {
4001
+ const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
4002
+ css(elements, 'overscrollBehavior', 'contain');
4003
+ return () => css(elements, 'overscrollBehavior', '');
4004
+ }
4005
+
4006
+ let startClientY;
4007
+
4008
+ const events = [
4009
+ on(
4010
+ el,
4011
+ 'touchstart',
4012
+ (_ref6) => {let { targetTouches } = _ref6;
4013
+ if (targetTouches.length === 1) {
4014
+ startClientY = targetTouches[0].clientY;
4015
+ }
4016
+ },
4017
+ { passive: true }),
4018
+
4019
+
4020
+ on(
4021
+ el,
4022
+ 'touchmove',
4023
+ (e) => {
4024
+ if (e.targetTouches.length !== 1) {
4025
+ return;
4026
+ }
4027
+
4028
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
4029
+ if (!within(scrollParent, el)) {
4030
+ scrollParent = el;
4031
+ }
4032
+
4033
+ const clientY = e.targetTouches[0].clientY - startClientY;
4034
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
4035
+
4036
+ if (
4037
+ clientHeight >= scrollHeight ||
4038
+ scrollTop === 0 && clientY > 0 ||
4039
+ scrollHeight - scrollTop <= clientHeight && clientY < 0)
4040
+ {
4041
+ e.cancelable && e.preventDefault();
4042
+ }
4043
+ },
4044
+ { passive: false })];
4045
+
4046
+
4047
+
4048
+ return () => events.forEach((fn) => fn());
4049
+ }
4050
+
4051
+ function preventBackgroundScroll() {
4052
+ const { body, documentElement } = document;
4053
+ css(body, {
4054
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4055
+ touchAction: 'none' });
4056
+
4057
+ css(documentElement, 'overflowY', 'hidden');
4058
+ return () => {
4059
+ css(documentElement, 'overflowY', '');
4060
+ css(body, { overflowY: '', touchAction: '' });
4061
+ };
4062
+ }
4063
+
4064
+ function filterChildren(el, fn) {
4065
+ const children = [];
4066
+ apply(el, (node) => {
4067
+ if (fn(node)) {
4068
+ children.push(node);
4069
+ }
4070
+ });
4071
+ return children;
4072
+ }
4073
+
4074
+ let active;
4075
+
4076
+ var drop = {
4077
+ mixins: [Container, Lazyload, Position, Togglable],
4078
+
4079
+ args: 'pos',
4080
+
4081
+ props: {
4082
+ mode: 'list',
4083
+ toggle: Boolean,
4084
+ boundary: Boolean,
4085
+ boundaryAlign: Boolean,
4086
+ delayShow: Number,
4087
+ delayHide: Number,
4088
+ display: String,
4089
+ clsDrop: String,
4090
+ animateOut: Boolean,
4091
+ bgScroll: Boolean },
4092
+
4093
+
4094
+ data: {
4095
+ mode: ['click', 'hover'],
4096
+ toggle: '- *',
4097
+ boundary: true,
4098
+ boundaryAlign: false,
4099
+ delayShow: 0,
4100
+ delayHide: 800,
4101
+ display: null,
4102
+ clsDrop: false,
4103
+ animation: ['uk-animation-fade'],
4104
+ cls: 'uk-open',
4105
+ container: false,
4106
+ animateOut: false,
4107
+ bgScroll: true },
4108
+
4109
+
4110
+ created() {
4111
+ this.tracker = new MouseTracker();
4112
+ },
4113
+
4114
+ beforeConnect() {
4115
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4116
+ },
4117
+
4118
+ connected() {
4119
+ addClass(this.$el, this.clsDrop);
4120
+
4121
+ if (this.toggle && !this.target) {
4122
+ this.target = this.$create('toggle', query(this.toggle, this.$el), {
4123
+ target: this.$el,
4124
+ mode: this.mode }).
4125
+ $el;
4126
+ attr(this.target, 'aria-haspopup', true);
4127
+ this.lazyload(this.target);
4128
+ }
4129
+ },
4130
+
4131
+ disconnected() {
4132
+ if (this.isActive()) {
4133
+ active = null;
4134
+ }
4135
+ },
4136
+
4137
+ events: [
4138
+ {
4139
+ name: 'click',
4140
+
4141
+ delegate() {
4142
+ return "." + this.clsDrop + "-close";
4143
+ },
4144
+
4145
+ handler(e) {
4146
+ e.preventDefault();
4147
+ this.hide(false);
4148
+ } },
4149
+
4150
+
4151
+ {
4152
+ name: 'click',
4153
+
4154
+ delegate() {
4155
+ return 'a[href^="#"]';
4156
+ },
4157
+
4158
+ handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4159
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4160
+ this.hide(false);
4161
+ }
4162
+ } },
4163
+
4164
+
4165
+ {
4166
+ name: 'beforescroll',
4167
+
4168
+ handler() {
4169
+ this.hide(false);
4170
+ } },
4171
+
4172
+
4173
+ {
4174
+ name: 'toggle',
4175
+
4176
+ self: true,
4177
+
4178
+ handler(e, toggle) {
4179
+ e.preventDefault();
4180
+
4181
+ if (this.isToggled()) {
4182
+ this.hide(false);
4183
+ } else {
4184
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4185
+ }
4186
+ } },
4187
+
4188
+
4189
+ {
4190
+ name: 'toggleshow',
4191
+
4192
+ self: true,
4193
+
4194
+ handler(e, toggle) {
4195
+ e.preventDefault();
4196
+ this.show(toggle == null ? void 0 : toggle.$el);
4197
+ } },
4198
+
4199
+
4200
+ {
4201
+ name: 'togglehide',
4202
+
4203
+ self: true,
4204
+
4205
+ handler(e) {
4206
+ e.preventDefault();
4207
+ if (!matches(this.$el, ':focus,:hover')) {
4208
+ this.hide();
4209
+ }
4210
+ } },
4211
+
4212
+
4213
+ {
4214
+ name: pointerEnter + " focusin",
4215
+
4216
+ filter() {
4217
+ return includes(this.mode, 'hover');
4218
+ },
4219
+
4220
+ handler(e) {
4221
+ if (!isTouch(e)) {
4222
+ this.clearTimers();
4223
+ }
4224
+ } },
4225
+
4226
+
4227
+ {
4228
+ name: pointerLeave + " focusout",
4229
+
4230
+ filter() {
4231
+ return includes(this.mode, 'hover');
4232
+ },
4233
+
4234
+ handler(e) {
4235
+ if (!isTouch(e) && e.relatedTarget) {
4236
+ this.hide();
4237
+ }
4238
+ } },
4239
+
4240
+
4241
+ {
4242
+ name: 'toggled',
4243
+
4244
+ self: true,
4245
+
4246
+ handler(e, toggled) {
4247
+ if (!toggled) {
4248
+ return;
4249
+ }
4250
+
4251
+ this.clearTimers();
4252
+ this.position();
4253
+ } },
4254
+
4255
+
4256
+ {
4257
+ name: 'show',
4258
+
4259
+ self: true,
4260
+
4261
+ handler() {
4262
+ active = this;
4263
+
4264
+ this.tracker.init();
4265
+
4266
+ for (const handler of [
4267
+ on(
4268
+ document,
4269
+ pointerDown,
4270
+ (_ref2) => {let { target } = _ref2;return (
4271
+ !within(target, this.$el) &&
4272
+ once(
4273
+ document,
4274
+ pointerUp + " " + pointerCancel + " scroll",
4275
+ (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4276
+ if (
4277
+ !defaultPrevented &&
4278
+ type === pointerUp &&
4279
+ target === newTarget &&
4280
+ !(this.target && within(target, this.target)))
4281
+ {
4282
+ this.hide(false);
4283
+ }
4284
+ },
4285
+ true));}),
4286
+
4287
+
4288
+
4289
+ on(document, 'keydown', (e) => {
4290
+ if (e.keyCode === 27) {
4291
+ this.hide(false);
4292
+ }
4293
+ }),
4294
+
4295
+ ...(this.bgScroll ?
4296
+ [] :
4297
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4298
+
4299
+ ...(this.display === 'static' && this.align !== 'stretch' ?
4300
+ [] :
4301
+ (() => {
4302
+ const handler = () => this.$emit();
4303
+ return [
4304
+ on(window, 'resize', handler),
4305
+ on(document, 'scroll', handler, true),
4306
+ (() => {
4307
+ const observer = observeResize(
4308
+ scrollParents(this.$el),
4309
+ handler);
4310
+
4311
+ return () => observer.disconnect();
4312
+ })()];
4313
+
4314
+ })())])
4315
+ {
4316
+ once(this.$el, 'hide', handler, { self: true });
4317
+ }
4318
+ } },
4319
+
4320
+
4321
+ {
4322
+ name: 'beforehide',
4323
+
4324
+ self: true,
4325
+
4326
+ handler() {
4327
+ this.clearTimers();
3986
4328
  } },
3987
4329
 
3988
4330
 
@@ -3991,14 +4333,14 @@
3991
4333
 
3992
4334
  handler(_ref4) {let { target } = _ref4;
3993
4335
  if (this.$el !== target) {
3994
- active$1 =
3995
- active$1 === null && within(target, this.$el) && this.isToggled() ?
4336
+ active =
4337
+ active === null && within(target, this.$el) && this.isToggled() ?
3996
4338
  this :
3997
- active$1;
4339
+ active;
3998
4340
  return;
3999
4341
  }
4000
4342
 
4001
- active$1 = this.isActive() ? null : active$1;
4343
+ active = this.isActive() ? null : active;
4002
4344
  this.tracker.cancel();
4003
4345
  } }],
4004
4346
 
@@ -4026,16 +4368,16 @@
4026
4368
  return;
4027
4369
  }
4028
4370
 
4029
- if (active$1) {
4030
- if (delay && active$1.isDelaying) {
4371
+ if (active) {
4372
+ if (delay && active.isDelaying) {
4031
4373
  this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4032
4374
  return;
4033
4375
  }
4034
4376
 
4035
4377
  let prev;
4036
- while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
4037
- prev = active$1;
4038
- active$1.hide(false, false);
4378
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4379
+ prev = active;
4380
+ active.hide(false, false);
4039
4381
  }
4040
4382
  }
4041
4383
 
@@ -4076,7 +4418,7 @@
4076
4418
  },
4077
4419
 
4078
4420
  isActive() {
4079
- return active$1 === this;
4421
+ return active === this;
4080
4422
  },
4081
4423
 
4082
4424
  position() {
@@ -4642,14 +4984,20 @@
4642
4984
  0);
4643
4985
 
4644
4986
  } else {
4645
- // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4646
- minHeight = "calc(" + (
4647
- document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4987
+ const { body, scrollingElement } = document;
4988
+ const isScrollingElement =
4989
+ scrollingElement === scrollElement || body === scrollElement;
4648
4990
 
4991
+ // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4992
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
4649
4993
 
4650
4994
  if (this.offsetTop) {
4651
- const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4652
- minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4995
+ if (isScrollingElement) {
4996
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4997
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4998
+ } else {
4999
+ minHeight += " - " + css(scrollElement, 'paddingTop');
5000
+ }
4653
5001
  }
4654
5002
 
4655
5003
  if (this.offsetBottom === true) {
@@ -5177,400 +5525,149 @@
5177
5525
  img.onload = () => {
5178
5526
  setSrcAttrs(el, img.currentSrc);
5179
5527
  };
5180
- attr(img, 'src', src);
5181
- return img;
5182
- }
5183
-
5184
- function wrapInPicture(img, sources) {
5185
- sources = parseSources(sources);
5186
-
5187
- if (sources.length) {
5188
- const picture = fragment('<picture>');
5189
- for (const attrs of sources) {
5190
- const source = fragment('<source>');
5191
- attr(source, attrs);
5192
- append(picture, source);
5193
- }
5194
- append(picture, img);
5195
- }
5196
- }
5197
-
5198
- function parseSources(sources) {
5199
- if (!sources) {
5200
- return [];
5201
- }
5202
-
5203
- if (startsWith(sources, '[')) {
5204
- try {
5205
- sources = JSON.parse(sources);
5206
- } catch (e) {
5207
- sources = [];
5208
- }
5209
- } else {
5210
- sources = parseOptions(sources);
5211
- }
5212
-
5213
- if (!isArray(sources)) {
5214
- sources = [sources];
5215
- }
5216
-
5217
- return sources.filter((source) => !isEmpty(source));
5218
- }
5219
-
5220
- function ensureSrcAttribute(el) {
5221
- if (isImg(el) && !hasAttr(el, 'src')) {
5222
- attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5223
- }
5224
- }
5225
-
5226
- function isPicture(el) {
5227
- return isTag(el, 'picture');
5228
- }
5229
-
5230
- function isImg(el) {
5231
- return isTag(el, 'img');
5232
- }
5233
-
5234
- var Media = {
5235
- props: {
5236
- media: Boolean },
5237
-
5238
-
5239
- data: {
5240
- media: false },
5241
-
5242
-
5243
- connected() {
5244
- const media = toMedia(this.media);
5245
- this.matchMedia = true;
5246
- if (media) {
5247
- this.mediaObj = window.matchMedia(media);
5248
- const handler = () => {
5249
- this.matchMedia = this.mediaObj.matches;
5250
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5251
- };
5252
- this.offMediaObj = on(this.mediaObj, 'change', () => {
5253
- handler();
5254
- this.$emit('resize');
5255
- });
5256
- handler();
5257
- }
5258
- },
5259
-
5260
- disconnected() {var _this$offMediaObj;
5261
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5262
- } };
5263
-
5264
-
5265
- function toMedia(value) {
5266
- if (isString(value)) {
5267
- if (startsWith(value, '@')) {
5268
- const name = "breakpoint-" + value.substr(1);
5269
- value = toFloat(getCssVar(name));
5270
- } else if (isNaN(value)) {
5271
- return value;
5272
- }
5273
- }
5274
-
5275
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5276
- }
5277
-
5278
- var leader = {
5279
- mixins: [Class, Media, Resize],
5280
-
5281
- props: {
5282
- fill: String },
5283
-
5284
-
5285
- data: {
5286
- fill: '',
5287
- clsWrapper: 'uk-leader-fill',
5288
- clsHide: 'uk-leader-hide',
5289
- attrFill: 'data-fill' },
5290
-
5291
-
5292
- computed: {
5293
- fill(_ref) {let { fill } = _ref;
5294
- return fill || getCssVar('leader-fill-content');
5295
- } },
5296
-
5297
-
5298
- connected() {
5299
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5300
- },
5301
-
5302
- disconnected() {
5303
- unwrap(this.wrapper.childNodes);
5304
- },
5305
-
5306
- update: {
5307
- read() {
5308
- const width = Math.trunc(this.$el.offsetWidth / 2);
5309
-
5310
- return {
5311
- width,
5312
- fill: this.fill,
5313
- hide: !this.matchMedia };
5314
-
5315
- },
5316
-
5317
- write(_ref2) {let { width, fill, hide } = _ref2;
5318
- toggleClass(this.wrapper, this.clsHide, hide);
5319
- attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5320
- },
5321
-
5322
- events: ['resize'] } };
5323
-
5324
- const active = [];
5325
-
5326
- var Modal = {
5327
- mixins: [Class, Container, Togglable],
5328
-
5329
- props: {
5330
- selPanel: String,
5331
- selClose: String,
5332
- escClose: Boolean,
5333
- bgClose: Boolean,
5334
- stack: Boolean },
5335
-
5336
-
5337
- data: {
5338
- cls: 'uk-open',
5339
- escClose: true,
5340
- bgClose: true,
5341
- overlay: true,
5342
- stack: false },
5343
-
5344
-
5345
- computed: {
5346
- panel(_ref, $el) {let { selPanel } = _ref;
5347
- return $(selPanel, $el);
5348
- },
5349
-
5350
- transitionElement() {
5351
- return this.panel;
5352
- },
5353
-
5354
- bgClose(_ref2) {let { bgClose } = _ref2;
5355
- return bgClose && this.panel;
5356
- } },
5357
-
5358
-
5359
- beforeDisconnect() {
5360
- if (includes(active, this)) {
5361
- this.toggleElement(this.$el, false, false);
5362
- }
5363
- },
5364
-
5365
- events: [
5366
- {
5367
- name: 'click',
5368
-
5369
- delegate() {
5370
- return this.selClose;
5371
- },
5372
-
5373
- handler(e) {
5374
- e.preventDefault();
5375
- this.hide();
5376
- } },
5377
-
5378
-
5379
- {
5380
- name: 'toggle',
5381
-
5382
- self: true,
5383
-
5384
- handler(e) {
5385
- if (e.defaultPrevented) {
5386
- return;
5387
- }
5388
-
5389
- e.preventDefault();
5390
-
5391
- if (this.isToggled() === includes(active, this)) {
5392
- this.toggle();
5393
- }
5394
- } },
5395
-
5396
-
5397
- {
5398
- name: 'beforeshow',
5399
-
5400
- self: true,
5401
-
5402
- handler(e) {
5403
- if (includes(active, this)) {
5404
- return false;
5405
- }
5406
-
5407
- if (!this.stack && active.length) {
5408
- Promise.all(active.map((modal) => modal.hide())).then(this.show);
5409
- e.preventDefault();
5410
- } else {
5411
- active.push(this);
5412
- }
5413
- } },
5414
-
5415
-
5416
- {
5417
- name: 'show',
5418
-
5419
- self: true,
5420
-
5421
- handler() {
5422
- const docEl = document.documentElement;
5423
-
5424
- if (width(window) > docEl.clientWidth && this.overlay) {
5425
- css(document.body, 'overflowY', 'scroll');
5426
- }
5427
-
5428
- if (this.stack) {
5429
- css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
5430
- }
5431
-
5432
- addClass(docEl, this.clsPage);
5433
-
5434
- if (this.bgClose) {
5435
- once(
5436
- this.$el,
5437
- 'hide',
5438
- on(document, pointerDown, (_ref3) => {let { target } = _ref3;
5439
- if (
5440
- last(active) !== this ||
5441
- this.overlay && !within(target, this.$el) ||
5442
- within(target, this.panel))
5443
- {
5444
- return;
5445
- }
5528
+ attr(img, 'src', src);
5529
+ return img;
5530
+ }
5446
5531
 
5447
- once(
5448
- document,
5449
- pointerUp + " " + pointerCancel + " scroll",
5450
- (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
5451
- if (
5452
- !defaultPrevented &&
5453
- type === pointerUp &&
5454
- target === newTarget)
5455
- {
5456
- this.hide();
5457
- }
5458
- },
5459
- true);
5532
+ function wrapInPicture(img, sources) {
5533
+ sources = parseSources(sources);
5460
5534
 
5461
- }),
5462
- { self: true });
5535
+ if (sources.length) {
5536
+ const picture = fragment('<picture>');
5537
+ for (const attrs of sources) {
5538
+ const source = fragment('<source>');
5539
+ attr(source, attrs);
5540
+ append(picture, source);
5541
+ }
5542
+ append(picture, img);
5543
+ }
5544
+ }
5463
5545
 
5464
- }
5546
+ function parseSources(sources) {
5547
+ if (!sources) {
5548
+ return [];
5549
+ }
5465
5550
 
5466
- if (this.escClose) {
5467
- once(
5468
- this.$el,
5469
- 'hide',
5470
- on(document, 'keydown', (e) => {
5471
- if (e.keyCode === 27 && last(active) === this) {
5472
- this.hide();
5473
- }
5474
- }),
5475
- { self: true });
5551
+ if (startsWith(sources, '[')) {
5552
+ try {
5553
+ sources = JSON.parse(sources);
5554
+ } catch (e) {
5555
+ sources = [];
5556
+ }
5557
+ } else {
5558
+ sources = parseOptions(sources);
5559
+ }
5476
5560
 
5477
- }
5478
- } },
5561
+ if (!isArray(sources)) {
5562
+ sources = [sources];
5563
+ }
5479
5564
 
5565
+ return sources.filter((source) => !isEmpty(source));
5566
+ }
5480
5567
 
5481
- {
5482
- name: 'shown',
5568
+ function ensureSrcAttribute(el) {
5569
+ if (isImg(el) && !hasAttr(el, 'src')) {
5570
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5571
+ }
5572
+ }
5483
5573
 
5484
- self: true,
5574
+ function isPicture(el) {
5575
+ return isTag(el, 'picture');
5576
+ }
5485
5577
 
5486
- handler() {
5487
- if (!isFocusable(this.$el)) {
5488
- attr(this.$el, 'tabindex', '-1');
5489
- }
5578
+ function isImg(el) {
5579
+ return isTag(el, 'img');
5580
+ }
5490
5581
 
5491
- if (!$(':focus', this.$el)) {
5492
- this.$el.focus();
5493
- }
5494
- } },
5582
+ var Media = {
5583
+ props: {
5584
+ media: Boolean },
5495
5585
 
5496
5586
 
5497
- {
5498
- name: 'hidden',
5587
+ data: {
5588
+ media: false },
5499
5589
 
5500
- self: true,
5501
5590
 
5502
- handler() {
5503
- if (includes(active, this)) {
5504
- active.splice(active.indexOf(this), 1);
5505
- }
5591
+ connected() {
5592
+ const media = toMedia(this.media);
5593
+ this.matchMedia = true;
5594
+ if (media) {
5595
+ this.mediaObj = window.matchMedia(media);
5596
+ const handler = () => {
5597
+ this.matchMedia = this.mediaObj.matches;
5598
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5599
+ };
5600
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5601
+ handler();
5602
+ this.$emit('resize');
5603
+ });
5604
+ handler();
5605
+ }
5606
+ },
5506
5607
 
5507
- if (!active.length) {
5508
- css(document.body, 'overflowY', '');
5509
- }
5608
+ disconnected() {var _this$offMediaObj;
5609
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5610
+ } };
5510
5611
 
5511
- css(this.$el, 'zIndex', '');
5512
5612
 
5513
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5514
- removeClass(document.documentElement, this.clsPage);
5515
- }
5516
- } }],
5613
+ function toMedia(value) {
5614
+ if (isString(value)) {
5615
+ if (startsWith(value, '@')) {
5616
+ const name = "breakpoint-" + value.substr(1);
5617
+ value = toFloat(getCssVar(name));
5618
+ } else if (isNaN(value)) {
5619
+ return value;
5620
+ }
5621
+ }
5517
5622
 
5623
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5624
+ }
5518
5625
 
5626
+ var leader = {
5627
+ mixins: [Class, Media, Resize],
5519
5628
 
5520
- methods: {
5521
- toggle() {
5522
- return this.isToggled() ? this.hide() : this.show();
5523
- },
5629
+ props: {
5630
+ fill: String },
5524
5631
 
5525
- show() {
5526
- if (this.container && parent(this.$el) !== this.container) {
5527
- append(this.container, this.$el);
5528
- return new Promise((resolve) =>
5529
- requestAnimationFrame(() => this.show().then(resolve)));
5530
5632
 
5531
- }
5633
+ data: {
5634
+ fill: '',
5635
+ clsWrapper: 'uk-leader-fill',
5636
+ clsHide: 'uk-leader-hide',
5637
+ attrFill: 'data-fill' },
5532
5638
 
5533
- return this.toggleElement(this.$el, true, animate(this));
5534
- },
5535
5639
 
5536
- hide() {
5537
- return this.toggleElement(this.$el, false, animate(this));
5538
- } } };
5640
+ computed: {
5641
+ fill(_ref) {let { fill } = _ref;
5642
+ return fill || getCssVar('leader-fill-content');
5643
+ } },
5539
5644
 
5540
5645
 
5646
+ connected() {
5647
+ [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5648
+ },
5541
5649
 
5542
- function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
5543
- return (el, show) =>
5544
- new Promise((resolve, reject) =>
5545
- once(el, 'show hide', () => {
5546
- el._reject == null ? void 0 : el._reject();
5547
- el._reject = reject;
5650
+ disconnected() {
5651
+ unwrap(this.wrapper.childNodes);
5652
+ },
5548
5653
 
5549
- _toggle(el, show);
5654
+ update: {
5655
+ read() {
5656
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5550
5657
 
5551
- const off = once(
5552
- transitionElement,
5553
- 'transitionstart',
5554
- () => {
5555
- once(transitionElement, 'transitionend transitioncancel', resolve, {
5556
- self: true });
5658
+ return {
5659
+ width,
5660
+ fill: this.fill,
5661
+ hide: !this.matchMedia };
5557
5662
 
5558
- clearTimeout(timer);
5559
5663
  },
5560
- { self: true });
5561
5664
 
5665
+ write(_ref2) {let { width, fill, hide } = _ref2;
5666
+ toggleClass(this.wrapper, this.clsHide, hide);
5667
+ attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5668
+ },
5562
5669
 
5563
- const timer = setTimeout(() => {
5564
- off();
5565
- resolve();
5566
- }, toMs(css(transitionElement, 'transitionDuration')));
5567
- })).
5568
- then(() => delete el._reject);
5569
- }
5570
-
5571
- function toMs(time) {
5572
- return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5573
- }
5670
+ events: ['resize'] } };
5574
5671
 
5575
5672
  var modal = {
5576
5673
  install,
@@ -5821,8 +5918,7 @@
5821
5918
  {
5822
5919
  ...this.$props,
5823
5920
  boundary: this.boundary,
5824
- pos: this.pos,
5825
- offset: this.dropbar || this.offset });
5921
+ pos: this.pos });
5826
5922
 
5827
5923
 
5828
5924
  },
@@ -5983,8 +6079,8 @@
5983
6079
  return this.dropbar;
5984
6080
  },
5985
6081
 
5986
- handler(_, _ref9) {let { $el, align } = _ref9;
5987
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6082
+ handler(_ref9) {let { target } = _ref9;
6083
+ if (!this.isDropbarDrop(target)) {
5988
6084
  return;
5989
6085
  }
5990
6086
 
@@ -5992,7 +6088,7 @@
5992
6088
  after(this.dropbarAnchor || this.$el, this.dropbar);
5993
6089
  }
5994
6090
 
5995
- addClass($el, this.clsDrop + "-dropbar");
6091
+ addClass(target, this.clsDrop + "-dropbar");
5996
6092
  } },
5997
6093
 
5998
6094
 
@@ -6007,19 +6103,44 @@
6007
6103
  return this.dropbar;
6008
6104
  },
6009
6105
 
6010
- handler(_, _ref10) {let { $el, align } = _ref10;
6011
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6106
+ handler(_ref10) {let { target } = _ref10;
6107
+ if (!this.isDropbarDrop(target)) {
6012
6108
  return;
6013
6109
  }
6014
6110
 
6015
- this._observer = observeResize($el, () =>
6111
+ this._observer = observeResize(target, () =>
6016
6112
  this.transitionTo(
6017
- offset($el).bottom -
6113
+ offset(target).bottom -
6018
6114
  offset(this.dropbar).top +
6019
- toFloat(css($el, 'marginBottom')),
6020
- $el));
6115
+ toFloat(css(target, 'marginBottom')),
6116
+ target));
6117
+
6118
+
6119
+ } },
6120
+
6121
+
6122
+ {
6123
+ name: 'beforeposition',
6124
+
6125
+ el() {
6126
+ return this.dropContainer;
6127
+ },
6128
+
6129
+ filter() {
6130
+ return this.dropbar;
6131
+ },
6132
+
6133
+ handler(e, element, target, options) {
6134
+ if (!this.isDropbarDrop(element)) {
6135
+ return;
6136
+ }
6137
+
6138
+ const dropbarOffset = offset(this.dropbar);
6021
6139
 
6140
+ css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
6022
6141
 
6142
+ options.offset[1] = dropbarOffset.top - offset(target).bottom;
6143
+ options.viewportOffset += dropbarOffset.left;
6023
6144
  } },
6024
6145
 
6025
6146
 
@@ -6034,12 +6155,12 @@
6034
6155
  return this.dropbar;
6035
6156
  },
6036
6157
 
6037
- handler(e, _ref11) {let { $el } = _ref11;
6158
+ handler(e) {
6038
6159
  const active = this.getActive();
6039
6160
 
6040
6161
  if (
6041
6162
  matches(this.dropbar, ':hover') &&
6042
- (active == null ? void 0 : active.$el) === $el &&
6163
+ (active == null ? void 0 : active.$el) === e.target &&
6043
6164
  !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6044
6165
  {
6045
6166
  e.preventDefault();
@@ -6058,8 +6179,8 @@
6058
6179
  return this.dropbar;
6059
6180
  },
6060
6181
 
6061
- handler(_, _ref12) {let { $el, align } = _ref12;
6062
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6182
+ handler(_ref11) {let { target } = _ref11;
6183
+ if (!this.isDropbarDrop(target)) {
6063
6184
  return;
6064
6185
  }
6065
6186
 
@@ -6067,7 +6188,7 @@
6067
6188
 
6068
6189
  const active = this.getActive();
6069
6190
 
6070
- if (!active || (active == null ? void 0 : active.$el) === $el) {
6191
+ if (!active || (active == null ? void 0 : active.$el) === target) {
6071
6192
  this.transitionTo(0);
6072
6193
  }
6073
6194
  } }],
@@ -6076,7 +6197,7 @@
6076
6197
 
6077
6198
  methods: {
6078
6199
  getActive() {
6079
- return active$1 && within(active$1.target, this.$el) && active$1;
6200
+ return active && within(active.target, this.$el) && active;
6080
6201
  },
6081
6202
 
6082
6203
  transitionTo(newHeight, el) {
@@ -6106,6 +6227,11 @@
6106
6227
 
6107
6228
  getDropdown(el) {
6108
6229
  return this.$getComponent(el, 'drop') || this.$getComponent(el, 'dropdown');
6230
+ },
6231
+
6232
+ isDropbarDrop(el) {
6233
+ const drop = this.getDropdown(el);
6234
+ return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
6109
6235
  } } };
6110
6236
 
6111
6237
 
@@ -6286,22 +6412,6 @@
6286
6412
  } },
6287
6413
 
6288
6414
 
6289
- {
6290
- name: 'touchstart',
6291
-
6292
- passive: true,
6293
-
6294
- el() {
6295
- return this.panel;
6296
- },
6297
-
6298
- handler(_ref8) {let { targetTouches } = _ref8;
6299
- if (targetTouches.length === 1) {
6300
- this.clientY = targetTouches[0].clientY;
6301
- }
6302
- } },
6303
-
6304
-
6305
6415
  {
6306
6416
  name: 'touchmove',
6307
6417
 
@@ -6317,33 +6427,6 @@
6317
6427
  } },
6318
6428
 
6319
6429
 
6320
- {
6321
- name: 'touchmove',
6322
-
6323
- passive: false,
6324
-
6325
- el() {
6326
- return this.panel;
6327
- },
6328
-
6329
- handler(e) {
6330
- if (e.targetTouches.length !== 1) {
6331
- return;
6332
- }
6333
-
6334
- const clientY = e.targetTouches[0].clientY - this.clientY;
6335
- const { scrollTop, scrollHeight, clientHeight } = this.panel;
6336
-
6337
- if (
6338
- clientHeight >= scrollHeight ||
6339
- scrollTop === 0 && clientY > 0 ||
6340
- scrollHeight - scrollTop <= clientHeight && clientY < 0)
6341
- {
6342
- e.cancelable && e.preventDefault();
6343
- }
6344
- } },
6345
-
6346
-
6347
6430
  {
6348
6431
  name: 'show',
6349
6432
 
@@ -6355,7 +6438,6 @@
6355
6438
  addClass(parent(this.panel), this.clsMode);
6356
6439
  }
6357
6440
 
6358
- css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
6359
6441
  addClass(document.body, this.clsContainer, this.clsFlip);
6360
6442
  css(document.body, 'touch-action', 'pan-y pinch-zoom');
6361
6443
  css(this.$el, 'display', 'block');
@@ -6363,7 +6445,7 @@
6363
6445
  addClass(
6364
6446
  this.panel,
6365
6447
  this.clsSidebarAnimation,
6366
- this.mode !== 'reveal' ? this.clsMode : '');
6448
+ this.mode === 'reveal' ? '' : this.clsMode);
6367
6449
 
6368
6450
 
6369
6451
  height(document.body); // force reflow
@@ -6400,8 +6482,6 @@
6400
6482
  removeClass(this.$el, this.clsOverlay);
6401
6483
  css(this.$el, 'display', '');
6402
6484
  removeClass(document.body, this.clsContainer, this.clsFlip);
6403
-
6404
- css(document.documentElement, 'overflowY', '');
6405
6485
  } },
6406
6486
 
6407
6487
 
@@ -6877,7 +6957,9 @@
6877
6957
  },
6878
6958
 
6879
6959
  handler() {
6880
- if (!location.hash || scrollTop(window) === 0) {
6960
+ const { scrollingElement } = document;
6961
+
6962
+ if (!location.hash || scrollingElement.scrollTop === 0) {
6881
6963
  return;
6882
6964
  }
6883
6965
 
@@ -6886,13 +6968,11 @@
6886
6968
  const elOffset = offset(this.$el);
6887
6969
 
6888
6970
  if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6889
- scrollTop(
6890
- window,
6971
+ scrollingElement.scrollTop =
6891
6972
  targetOffset.top -
6892
6973
  elOffset.height -
6893
6974
  toPx(this.targetOffset, 'height', this.placeholder) -
6894
- toPx(this.offset, 'height', this.placeholder));
6895
-
6975
+ toPx(this.offset, 'height', this.placeholder);
6896
6976
  }
6897
6977
  });
6898
6978
  } }],
@@ -6990,7 +7070,7 @@
6990
7070
 
6991
7071
 
6992
7072
  {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref4;
6993
- const scroll = scrollTop(window);
7073
+ const scroll = document.scrollingElement.scrollTop;
6994
7074
  const dir = prevScroll <= scroll ? 'down' : 'up';
6995
7075
 
6996
7076
  return {