uikit 3.14.3-dev.5325d42a0 → 3.14.4-dev.0097ef093
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.
- package/CHANGELOG.md +11 -0
- package/dist/css/uikit-core-rtl.css +23 -14
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +23 -14
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +20 -14
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +20 -14
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +89 -10
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +89 -10
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +2 -2
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +2 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +2 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +1 -6
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +669 -619
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +670 -620
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/core/drop.js +7 -0
- package/src/js/core/offcanvas.js +1 -47
- package/src/js/core/switcher.js +1 -1
- package/src/js/mixin/modal.js +90 -4
- package/src/js/mixin/parallax.js +1 -1
- package/src/js/mixin/togglable.js +0 -5
- package/src/js/util/viewport.js +20 -9
- package/src/less/components/nav.less +22 -4
- package/src/less/components/navbar.less +9 -17
- package/src/less/theme/nav.less +3 -7
- package/src/less/theme/navbar.less +3 -1
- package/src/scss/components/nav.scss +22 -4
- package/src/scss/components/navbar.scss +9 -17
- package/src/scss/mixins-theme.scss +1 -1
- package/src/scss/theme/nav.scss +3 -7
- package/src/scss/theme/navbar.scss +3 -1
- package/src/scss/variables-theme.scss +10 -4
- package/src/scss/variables.scss +10 -3
- package/tests/drop.html +6 -0
- package/tests/navbar.html +4 -4
package/dist/js/uikit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.4-dev.0097ef093 | 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() :
|
|
@@ -1911,18 +1911,33 @@
|
|
|
1911
1911
|
}
|
|
1912
1912
|
|
|
1913
1913
|
function offsetViewport(scrollElement) {
|
|
1914
|
-
|
|
1914
|
+
const window = toWindow(scrollElement);
|
|
1915
|
+
const {
|
|
1916
|
+
document: { body, documentElement } } =
|
|
1917
|
+
window;
|
|
1918
|
+
let viewportElement =
|
|
1919
|
+
scrollElement === scrollingElement(scrollElement) || scrollElement === body ?
|
|
1920
|
+
window :
|
|
1921
|
+
scrollElement;
|
|
1922
|
+
|
|
1923
|
+
const { visualViewport } = window;
|
|
1924
|
+
if (isWindow(viewportElement) && visualViewport) {
|
|
1925
|
+
let { height, width, scale, pageTop: top, pageLeft: left } = visualViewport;
|
|
1926
|
+
height = Math.round(height * scale);
|
|
1927
|
+
width = Math.round(width * scale);
|
|
1928
|
+
return { height, width, top, left, bottom: top + height, right: left + width };
|
|
1929
|
+
}
|
|
1915
1930
|
|
|
1916
1931
|
let rect = offset(viewportElement);
|
|
1917
1932
|
for (let [prop, dir, start, end] of [
|
|
1918
1933
|
['width', 'x', 'left', 'right'],
|
|
1919
1934
|
['height', 'y', 'top', 'bottom']])
|
|
1920
1935
|
{
|
|
1921
|
-
if (
|
|
1922
|
-
rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
|
|
1923
|
-
} else {
|
|
1936
|
+
if (isWindow(viewportElement)) {
|
|
1924
1937
|
// iOS 12 returns <body> as scrollingElement
|
|
1925
|
-
viewportElement =
|
|
1938
|
+
viewportElement = documentElement;
|
|
1939
|
+
} else {
|
|
1940
|
+
rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
|
|
1926
1941
|
}
|
|
1927
1942
|
rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
|
|
1928
1943
|
rect[end] = rect[prop] + rect[start];
|
|
@@ -1934,10 +1949,6 @@
|
|
|
1934
1949
|
return toWindow(element).document.scrollingElement;
|
|
1935
1950
|
}
|
|
1936
1951
|
|
|
1937
|
-
function getViewport$1(scrollElement) {
|
|
1938
|
-
return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
1952
|
const dirs = [
|
|
1942
1953
|
['width', 'x', 'left', 'right'],
|
|
1943
1954
|
['height', 'y', 'top', 'bottom']];
|
|
@@ -2950,7 +2961,7 @@
|
|
|
2950
2961
|
UIkit.data = '__uikit__';
|
|
2951
2962
|
UIkit.prefix = 'uk-';
|
|
2952
2963
|
UIkit.options = {};
|
|
2953
|
-
UIkit.version = '3.14.
|
|
2964
|
+
UIkit.version = '3.14.4-dev.0097ef093';
|
|
2954
2965
|
|
|
2955
2966
|
globalAPI(UIkit);
|
|
2956
2967
|
hooksAPI(UIkit);
|
|
@@ -3099,11 +3110,6 @@
|
|
|
3099
3110
|
return Promise.reject();
|
|
3100
3111
|
}
|
|
3101
3112
|
|
|
3102
|
-
if (!animate) {
|
|
3103
|
-
Animation.cancel(el);
|
|
3104
|
-
Transition.cancel(el);
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
3113
|
const promise = (
|
|
3108
3114
|
isFunction(animate) ?
|
|
3109
3115
|
animate :
|
|
@@ -3729,64 +3735,44 @@
|
|
|
3729
3735
|
return toPx(getCssVar('position-viewport-offset', element));
|
|
3730
3736
|
} } };
|
|
3731
3737
|
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
var drop = {
|
|
3735
|
-
mixins: [Container, Lazyload, Position, Togglable],
|
|
3738
|
+
const active$1 = [];
|
|
3736
3739
|
|
|
3737
|
-
|
|
3740
|
+
var Modal = {
|
|
3741
|
+
mixins: [Class, Container, Togglable],
|
|
3738
3742
|
|
|
3739
3743
|
props: {
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
delayHide: Number,
|
|
3746
|
-
display: String,
|
|
3747
|
-
clsDrop: String,
|
|
3748
|
-
animateOut: Boolean },
|
|
3744
|
+
selPanel: String,
|
|
3745
|
+
selClose: String,
|
|
3746
|
+
escClose: Boolean,
|
|
3747
|
+
bgClose: Boolean,
|
|
3748
|
+
stack: Boolean },
|
|
3749
3749
|
|
|
3750
3750
|
|
|
3751
3751
|
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
3752
|
cls: 'uk-open',
|
|
3762
|
-
|
|
3763
|
-
|
|
3753
|
+
escClose: true,
|
|
3754
|
+
bgClose: true,
|
|
3755
|
+
overlay: true,
|
|
3756
|
+
stack: false },
|
|
3764
3757
|
|
|
3765
3758
|
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3759
|
+
computed: {
|
|
3760
|
+
panel(_ref, $el) {let { selPanel } = _ref;
|
|
3761
|
+
return $(selPanel, $el);
|
|
3762
|
+
},
|
|
3769
3763
|
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3764
|
+
transitionElement() {
|
|
3765
|
+
return this.panel;
|
|
3766
|
+
},
|
|
3773
3767
|
|
|
3774
|
-
|
|
3775
|
-
|
|
3768
|
+
bgClose(_ref2) {let { bgClose } = _ref2;
|
|
3769
|
+
return bgClose && this.panel;
|
|
3770
|
+
} },
|
|
3776
3771
|
|
|
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
3772
|
|
|
3787
|
-
|
|
3788
|
-
if (this
|
|
3789
|
-
|
|
3773
|
+
beforeDisconnect() {
|
|
3774
|
+
if (includes(active$1, this)) {
|
|
3775
|
+
this.toggleElement(this.$el, false, false);
|
|
3790
3776
|
}
|
|
3791
3777
|
},
|
|
3792
3778
|
|
|
@@ -3795,34 +3781,12 @@
|
|
|
3795
3781
|
name: 'click',
|
|
3796
3782
|
|
|
3797
3783
|
delegate() {
|
|
3798
|
-
return
|
|
3784
|
+
return this.selClose;
|
|
3799
3785
|
},
|
|
3800
3786
|
|
|
3801
3787
|
handler(e) {
|
|
3802
3788
|
e.preventDefault();
|
|
3803
|
-
this.hide(
|
|
3804
|
-
} },
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
{
|
|
3808
|
-
name: 'click',
|
|
3809
|
-
|
|
3810
|
-
delegate() {
|
|
3811
|
-
return 'a[href^="#"]';
|
|
3812
|
-
},
|
|
3813
|
-
|
|
3814
|
-
handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
|
|
3815
|
-
if (!defaultPrevented && hash && !within(hash, this.$el)) {
|
|
3816
|
-
this.hide(false);
|
|
3817
|
-
}
|
|
3818
|
-
} },
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
{
|
|
3822
|
-
name: 'beforescroll',
|
|
3823
|
-
|
|
3824
|
-
handler() {
|
|
3825
|
-
this.hide(false);
|
|
3789
|
+
this.hide();
|
|
3826
3790
|
} },
|
|
3827
3791
|
|
|
3828
3792
|
|
|
@@ -3831,168 +3795,551 @@
|
|
|
3831
3795
|
|
|
3832
3796
|
self: true,
|
|
3833
3797
|
|
|
3834
|
-
handler(e
|
|
3835
|
-
e.
|
|
3836
|
-
|
|
3837
|
-
if (this.isToggled()) {
|
|
3838
|
-
this.hide(false);
|
|
3839
|
-
} else {
|
|
3840
|
-
this.show(toggle == null ? void 0 : toggle.$el, false);
|
|
3798
|
+
handler(e) {
|
|
3799
|
+
if (e.defaultPrevented) {
|
|
3800
|
+
return;
|
|
3841
3801
|
}
|
|
3842
|
-
} },
|
|
3843
3802
|
|
|
3844
|
-
|
|
3845
|
-
{
|
|
3846
|
-
name: 'toggleshow',
|
|
3847
|
-
|
|
3848
|
-
self: true,
|
|
3849
|
-
|
|
3850
|
-
handler(e, toggle) {
|
|
3851
3803
|
e.preventDefault();
|
|
3852
|
-
this.show(toggle == null ? void 0 : toggle.$el);
|
|
3853
|
-
} },
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
{
|
|
3857
|
-
name: 'togglehide',
|
|
3858
|
-
|
|
3859
|
-
self: true,
|
|
3860
3804
|
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
if (!matches(this.$el, ':focus,:hover')) {
|
|
3864
|
-
this.hide();
|
|
3805
|
+
if (this.isToggled() === includes(active$1, this)) {
|
|
3806
|
+
this.toggle();
|
|
3865
3807
|
}
|
|
3866
3808
|
} },
|
|
3867
3809
|
|
|
3868
3810
|
|
|
3869
3811
|
{
|
|
3870
|
-
name:
|
|
3812
|
+
name: 'beforeshow',
|
|
3871
3813
|
|
|
3872
|
-
|
|
3873
|
-
return includes(this.mode, 'hover');
|
|
3874
|
-
},
|
|
3814
|
+
self: true,
|
|
3875
3815
|
|
|
3876
3816
|
handler(e) {
|
|
3877
|
-
if (
|
|
3878
|
-
|
|
3817
|
+
if (includes(active$1, this)) {
|
|
3818
|
+
return false;
|
|
3879
3819
|
}
|
|
3880
|
-
} },
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
{
|
|
3884
|
-
name: pointerLeave + " focusout",
|
|
3885
|
-
|
|
3886
|
-
filter() {
|
|
3887
|
-
return includes(this.mode, 'hover');
|
|
3888
|
-
},
|
|
3889
3820
|
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3821
|
+
if (!this.stack && active$1.length) {
|
|
3822
|
+
Promise.all(active$1.map((modal) => modal.hide())).then(this.show);
|
|
3823
|
+
e.preventDefault();
|
|
3824
|
+
} else {
|
|
3825
|
+
active$1.push(this);
|
|
3893
3826
|
}
|
|
3894
3827
|
} },
|
|
3895
3828
|
|
|
3896
3829
|
|
|
3897
3830
|
{
|
|
3898
|
-
name: '
|
|
3831
|
+
name: 'show',
|
|
3899
3832
|
|
|
3900
3833
|
self: true,
|
|
3901
3834
|
|
|
3902
|
-
handler(
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3835
|
+
handler() {
|
|
3836
|
+
once(
|
|
3837
|
+
this.$el,
|
|
3838
|
+
'hide',
|
|
3839
|
+
on(document, 'focusin', (e) => {
|
|
3840
|
+
if (last(active$1) === this && !within(e.target, this.$el)) {
|
|
3841
|
+
this.$el.focus();
|
|
3842
|
+
}
|
|
3843
|
+
}));
|
|
3910
3844
|
|
|
3911
3845
|
|
|
3912
|
-
|
|
3913
|
-
|
|
3846
|
+
if (this.overlay) {
|
|
3847
|
+
once(this.$el, 'hide', preventOverscroll(this.$el));
|
|
3848
|
+
once(this.$el, 'hide', preventBackgroundScroll());
|
|
3849
|
+
}
|
|
3914
3850
|
|
|
3915
|
-
|
|
3851
|
+
if (this.stack) {
|
|
3852
|
+
css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
|
|
3853
|
+
}
|
|
3916
3854
|
|
|
3917
|
-
|
|
3918
|
-
active$1 = this;
|
|
3855
|
+
addClass(document.documentElement, this.clsPage);
|
|
3919
3856
|
|
|
3920
|
-
this.
|
|
3857
|
+
if (this.bgClose) {
|
|
3858
|
+
once(
|
|
3859
|
+
this.$el,
|
|
3860
|
+
'hide',
|
|
3861
|
+
on(document, pointerDown, (_ref3) => {let { target } = _ref3;
|
|
3862
|
+
if (
|
|
3863
|
+
last(active$1) !== this ||
|
|
3864
|
+
this.overlay && !within(target, this.$el) ||
|
|
3865
|
+
within(target, this.panel))
|
|
3866
|
+
{
|
|
3867
|
+
return;
|
|
3868
|
+
}
|
|
3921
3869
|
|
|
3922
|
-
for (const handler of [
|
|
3923
|
-
on(
|
|
3924
|
-
document,
|
|
3925
|
-
pointerDown,
|
|
3926
|
-
(_ref2) => {let { target } = _ref2;return (
|
|
3927
|
-
!within(target, this.$el) &&
|
|
3928
3870
|
once(
|
|
3929
3871
|
document,
|
|
3930
3872
|
pointerUp + " " + pointerCancel + " scroll",
|
|
3931
|
-
(
|
|
3873
|
+
(_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
|
|
3932
3874
|
if (
|
|
3933
3875
|
!defaultPrevented &&
|
|
3934
3876
|
type === pointerUp &&
|
|
3935
|
-
target === newTarget
|
|
3936
|
-
!(this.target && within(target, this.target)))
|
|
3877
|
+
target === newTarget)
|
|
3937
3878
|
{
|
|
3938
|
-
this.hide(
|
|
3879
|
+
this.hide();
|
|
3939
3880
|
}
|
|
3940
3881
|
},
|
|
3941
|
-
true)
|
|
3942
|
-
|
|
3943
|
-
|
|
3882
|
+
true);
|
|
3944
3883
|
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
this.hide(false);
|
|
3948
|
-
}
|
|
3949
|
-
}),
|
|
3884
|
+
}),
|
|
3885
|
+
{ self: true });
|
|
3950
3886
|
|
|
3951
|
-
|
|
3952
|
-
[] :
|
|
3953
|
-
(() => {
|
|
3954
|
-
const handler = () => this.$emit();
|
|
3955
|
-
return [
|
|
3956
|
-
on(window, 'resize', handler),
|
|
3957
|
-
on(document, 'scroll', handler, true),
|
|
3958
|
-
(() => {
|
|
3959
|
-
const observer = observeResize(
|
|
3960
|
-
scrollParents(this.$el),
|
|
3961
|
-
handler);
|
|
3887
|
+
}
|
|
3962
3888
|
|
|
3963
|
-
|
|
3964
|
-
|
|
3889
|
+
if (this.escClose) {
|
|
3890
|
+
once(
|
|
3891
|
+
this.$el,
|
|
3892
|
+
'hide',
|
|
3893
|
+
on(document, 'keydown', (e) => {
|
|
3894
|
+
if (e.keyCode === 27 && last(active$1) === this) {
|
|
3895
|
+
this.hide();
|
|
3896
|
+
}
|
|
3897
|
+
}),
|
|
3898
|
+
{ self: true });
|
|
3965
3899
|
|
|
3966
|
-
})())])
|
|
3967
|
-
{
|
|
3968
|
-
once(this.$el, 'hide', handler, { self: true });
|
|
3969
3900
|
}
|
|
3970
3901
|
} },
|
|
3971
3902
|
|
|
3972
3903
|
|
|
3973
3904
|
{
|
|
3974
|
-
name: '
|
|
3905
|
+
name: 'shown',
|
|
3975
3906
|
|
|
3976
3907
|
self: true,
|
|
3977
3908
|
|
|
3978
3909
|
handler() {
|
|
3979
|
-
this
|
|
3910
|
+
if (!isFocusable(this.$el)) {
|
|
3911
|
+
attr(this.$el, 'tabindex', '-1');
|
|
3912
|
+
}
|
|
3913
|
+
|
|
3914
|
+
if (!$(':focus', this.$el)) {
|
|
3915
|
+
this.$el.focus();
|
|
3916
|
+
}
|
|
3980
3917
|
} },
|
|
3981
3918
|
|
|
3982
3919
|
|
|
3983
3920
|
{
|
|
3984
|
-
name: '
|
|
3921
|
+
name: 'hidden',
|
|
3985
3922
|
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
this
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3923
|
+
self: true,
|
|
3924
|
+
|
|
3925
|
+
handler() {
|
|
3926
|
+
if (includes(active$1, this)) {
|
|
3927
|
+
active$1.splice(active$1.indexOf(this), 1);
|
|
3928
|
+
}
|
|
3929
|
+
|
|
3930
|
+
if (!active$1.length) {
|
|
3931
|
+
css(document.body, 'overflowY', '');
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3934
|
+
css(this.$el, 'zIndex', '');
|
|
3935
|
+
|
|
3936
|
+
if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
|
|
3937
|
+
removeClass(document.documentElement, this.clsPage);
|
|
3938
|
+
}
|
|
3939
|
+
} }],
|
|
3940
|
+
|
|
3941
|
+
|
|
3942
|
+
|
|
3943
|
+
methods: {
|
|
3944
|
+
toggle() {
|
|
3945
|
+
return this.isToggled() ? this.hide() : this.show();
|
|
3946
|
+
},
|
|
3947
|
+
|
|
3948
|
+
show() {
|
|
3949
|
+
if (this.container && parent(this.$el) !== this.container) {
|
|
3950
|
+
append(this.container, this.$el);
|
|
3951
|
+
return new Promise((resolve) =>
|
|
3952
|
+
requestAnimationFrame(() => this.show().then(resolve)));
|
|
3953
|
+
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
return this.toggleElement(this.$el, true, animate(this));
|
|
3957
|
+
},
|
|
3958
|
+
|
|
3959
|
+
hide() {
|
|
3960
|
+
return this.toggleElement(this.$el, false, animate(this));
|
|
3961
|
+
} } };
|
|
3962
|
+
|
|
3963
|
+
|
|
3964
|
+
|
|
3965
|
+
function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
|
|
3966
|
+
return (el, show) =>
|
|
3967
|
+
new Promise((resolve, reject) =>
|
|
3968
|
+
once(el, 'show hide', () => {
|
|
3969
|
+
el._reject == null ? void 0 : el._reject();
|
|
3970
|
+
el._reject = reject;
|
|
3971
|
+
|
|
3972
|
+
_toggle(el, show);
|
|
3973
|
+
|
|
3974
|
+
const off = once(
|
|
3975
|
+
transitionElement,
|
|
3976
|
+
'transitionstart',
|
|
3977
|
+
() => {
|
|
3978
|
+
once(transitionElement, 'transitionend transitioncancel', resolve, {
|
|
3979
|
+
self: true });
|
|
3980
|
+
|
|
3981
|
+
clearTimeout(timer);
|
|
3982
|
+
},
|
|
3983
|
+
{ self: true });
|
|
3984
|
+
|
|
3985
|
+
|
|
3986
|
+
const timer = setTimeout(() => {
|
|
3987
|
+
off();
|
|
3988
|
+
resolve();
|
|
3989
|
+
}, toMs(css(transitionElement, 'transitionDuration')));
|
|
3990
|
+
})).
|
|
3991
|
+
then(() => delete el._reject);
|
|
3992
|
+
}
|
|
3993
|
+
|
|
3994
|
+
function toMs(time) {
|
|
3995
|
+
return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
|
|
3996
|
+
}
|
|
3997
|
+
|
|
3998
|
+
function preventOverscroll(el) {
|
|
3999
|
+
if (CSS.supports('overscroll-behavior', 'contain')) {
|
|
4000
|
+
const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
|
|
4001
|
+
css(elements, 'overscrollBehavior', 'contain');
|
|
4002
|
+
return () => css(elements, 'overscrollBehavior', '');
|
|
4003
|
+
}
|
|
4004
|
+
|
|
4005
|
+
let startClientY;
|
|
4006
|
+
|
|
4007
|
+
const events = [
|
|
4008
|
+
on(
|
|
4009
|
+
el,
|
|
4010
|
+
'touchstart',
|
|
4011
|
+
(_ref6) => {let { targetTouches } = _ref6;
|
|
4012
|
+
if (targetTouches.length === 1) {
|
|
4013
|
+
startClientY = targetTouches[0].clientY;
|
|
4014
|
+
}
|
|
4015
|
+
},
|
|
4016
|
+
{ passive: true }),
|
|
4017
|
+
|
|
4018
|
+
|
|
4019
|
+
on(
|
|
4020
|
+
el,
|
|
4021
|
+
'touchmove',
|
|
4022
|
+
(e) => {
|
|
4023
|
+
if (e.targetTouches.length !== 1) {
|
|
4024
|
+
return;
|
|
4025
|
+
}
|
|
4026
|
+
|
|
4027
|
+
let [scrollParent] = scrollParents(e.target, /auto|scroll/);
|
|
4028
|
+
if (!within(scrollParent, el)) {
|
|
4029
|
+
scrollParent = el;
|
|
4030
|
+
}
|
|
4031
|
+
|
|
4032
|
+
const clientY = e.targetTouches[0].clientY - startClientY;
|
|
4033
|
+
const { scrollTop, scrollHeight, clientHeight } = scrollParent;
|
|
4034
|
+
|
|
4035
|
+
if (
|
|
4036
|
+
clientHeight >= scrollHeight ||
|
|
4037
|
+
scrollTop === 0 && clientY > 0 ||
|
|
4038
|
+
scrollHeight - scrollTop <= clientHeight && clientY < 0)
|
|
4039
|
+
{
|
|
4040
|
+
e.cancelable && e.preventDefault();
|
|
4041
|
+
}
|
|
4042
|
+
},
|
|
4043
|
+
{ passive: false })];
|
|
4044
|
+
|
|
4045
|
+
|
|
4046
|
+
|
|
4047
|
+
return () => events.forEach((fn) => fn());
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
function preventBackgroundScroll() {
|
|
4051
|
+
const { body, documentElement } = document;
|
|
4052
|
+
css(body, {
|
|
4053
|
+
overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
|
|
4054
|
+
touchAction: 'none' });
|
|
4055
|
+
|
|
4056
|
+
css(documentElement, 'overflowY', 'hidden');
|
|
4057
|
+
return () => {
|
|
4058
|
+
css(documentElement, 'overflowY', '');
|
|
4059
|
+
css(body, { overflowY: '', touchAction: '' });
|
|
4060
|
+
};
|
|
4061
|
+
}
|
|
4062
|
+
|
|
4063
|
+
function filterChildren(el, fn) {
|
|
4064
|
+
const children = [];
|
|
4065
|
+
apply(el, (node) => {
|
|
4066
|
+
if (fn(node)) {
|
|
4067
|
+
children.push(node);
|
|
4068
|
+
}
|
|
4069
|
+
});
|
|
4070
|
+
return children;
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
let active;
|
|
4074
|
+
|
|
4075
|
+
var drop = {
|
|
4076
|
+
mixins: [Container, Lazyload, Position, Togglable],
|
|
4077
|
+
|
|
4078
|
+
args: 'pos',
|
|
4079
|
+
|
|
4080
|
+
props: {
|
|
4081
|
+
mode: 'list',
|
|
4082
|
+
toggle: Boolean,
|
|
4083
|
+
boundary: Boolean,
|
|
4084
|
+
boundaryAlign: Boolean,
|
|
4085
|
+
delayShow: Number,
|
|
4086
|
+
delayHide: Number,
|
|
4087
|
+
display: String,
|
|
4088
|
+
clsDrop: String,
|
|
4089
|
+
animateOut: Boolean,
|
|
4090
|
+
bgScroll: Boolean },
|
|
4091
|
+
|
|
4092
|
+
|
|
4093
|
+
data: {
|
|
4094
|
+
mode: ['click', 'hover'],
|
|
4095
|
+
toggle: '- *',
|
|
4096
|
+
boundary: true,
|
|
4097
|
+
boundaryAlign: false,
|
|
4098
|
+
delayShow: 0,
|
|
4099
|
+
delayHide: 800,
|
|
4100
|
+
display: null,
|
|
4101
|
+
clsDrop: false,
|
|
4102
|
+
animation: ['uk-animation-fade'],
|
|
4103
|
+
cls: 'uk-open',
|
|
4104
|
+
container: false,
|
|
4105
|
+
animateOut: false,
|
|
4106
|
+
bgScroll: true },
|
|
4107
|
+
|
|
4108
|
+
|
|
4109
|
+
created() {
|
|
4110
|
+
this.tracker = new MouseTracker();
|
|
4111
|
+
},
|
|
4112
|
+
|
|
4113
|
+
beforeConnect() {
|
|
4114
|
+
this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
|
|
4115
|
+
},
|
|
4116
|
+
|
|
4117
|
+
connected() {
|
|
4118
|
+
addClass(this.$el, this.clsDrop);
|
|
4119
|
+
|
|
4120
|
+
if (this.toggle && !this.target) {
|
|
4121
|
+
this.target = this.$create('toggle', query(this.toggle, this.$el), {
|
|
4122
|
+
target: this.$el,
|
|
4123
|
+
mode: this.mode }).
|
|
4124
|
+
$el;
|
|
4125
|
+
attr(this.target, 'aria-haspopup', true);
|
|
4126
|
+
this.lazyload(this.target);
|
|
4127
|
+
}
|
|
4128
|
+
},
|
|
4129
|
+
|
|
4130
|
+
disconnected() {
|
|
4131
|
+
if (this.isActive()) {
|
|
4132
|
+
active = null;
|
|
4133
|
+
}
|
|
4134
|
+
},
|
|
4135
|
+
|
|
4136
|
+
events: [
|
|
4137
|
+
{
|
|
4138
|
+
name: 'click',
|
|
4139
|
+
|
|
4140
|
+
delegate() {
|
|
4141
|
+
return "." + this.clsDrop + "-close";
|
|
4142
|
+
},
|
|
4143
|
+
|
|
4144
|
+
handler(e) {
|
|
4145
|
+
e.preventDefault();
|
|
4146
|
+
this.hide(false);
|
|
4147
|
+
} },
|
|
4148
|
+
|
|
4149
|
+
|
|
4150
|
+
{
|
|
4151
|
+
name: 'click',
|
|
4152
|
+
|
|
4153
|
+
delegate() {
|
|
4154
|
+
return 'a[href^="#"]';
|
|
4155
|
+
},
|
|
4156
|
+
|
|
4157
|
+
handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
|
|
4158
|
+
if (!defaultPrevented && hash && !within(hash, this.$el)) {
|
|
4159
|
+
this.hide(false);
|
|
4160
|
+
}
|
|
4161
|
+
} },
|
|
4162
|
+
|
|
4163
|
+
|
|
4164
|
+
{
|
|
4165
|
+
name: 'beforescroll',
|
|
4166
|
+
|
|
4167
|
+
handler() {
|
|
4168
|
+
this.hide(false);
|
|
4169
|
+
} },
|
|
4170
|
+
|
|
4171
|
+
|
|
4172
|
+
{
|
|
4173
|
+
name: 'toggle',
|
|
4174
|
+
|
|
4175
|
+
self: true,
|
|
4176
|
+
|
|
4177
|
+
handler(e, toggle) {
|
|
4178
|
+
e.preventDefault();
|
|
4179
|
+
|
|
4180
|
+
if (this.isToggled()) {
|
|
4181
|
+
this.hide(false);
|
|
4182
|
+
} else {
|
|
4183
|
+
this.show(toggle == null ? void 0 : toggle.$el, false);
|
|
4184
|
+
}
|
|
4185
|
+
} },
|
|
4186
|
+
|
|
4187
|
+
|
|
4188
|
+
{
|
|
4189
|
+
name: 'toggleshow',
|
|
4190
|
+
|
|
4191
|
+
self: true,
|
|
4192
|
+
|
|
4193
|
+
handler(e, toggle) {
|
|
4194
|
+
e.preventDefault();
|
|
4195
|
+
this.show(toggle == null ? void 0 : toggle.$el);
|
|
4196
|
+
} },
|
|
4197
|
+
|
|
4198
|
+
|
|
4199
|
+
{
|
|
4200
|
+
name: 'togglehide',
|
|
4201
|
+
|
|
4202
|
+
self: true,
|
|
4203
|
+
|
|
4204
|
+
handler(e) {
|
|
4205
|
+
e.preventDefault();
|
|
4206
|
+
if (!matches(this.$el, ':focus,:hover')) {
|
|
4207
|
+
this.hide();
|
|
4208
|
+
}
|
|
4209
|
+
} },
|
|
4210
|
+
|
|
4211
|
+
|
|
4212
|
+
{
|
|
4213
|
+
name: pointerEnter + " focusin",
|
|
4214
|
+
|
|
4215
|
+
filter() {
|
|
4216
|
+
return includes(this.mode, 'hover');
|
|
4217
|
+
},
|
|
4218
|
+
|
|
4219
|
+
handler(e) {
|
|
4220
|
+
if (!isTouch(e)) {
|
|
4221
|
+
this.clearTimers();
|
|
4222
|
+
}
|
|
4223
|
+
} },
|
|
4224
|
+
|
|
4225
|
+
|
|
4226
|
+
{
|
|
4227
|
+
name: pointerLeave + " focusout",
|
|
4228
|
+
|
|
4229
|
+
filter() {
|
|
4230
|
+
return includes(this.mode, 'hover');
|
|
4231
|
+
},
|
|
4232
|
+
|
|
4233
|
+
handler(e) {
|
|
4234
|
+
if (!isTouch(e) && e.relatedTarget) {
|
|
4235
|
+
this.hide();
|
|
4236
|
+
}
|
|
4237
|
+
} },
|
|
4238
|
+
|
|
4239
|
+
|
|
4240
|
+
{
|
|
4241
|
+
name: 'toggled',
|
|
4242
|
+
|
|
4243
|
+
self: true,
|
|
4244
|
+
|
|
4245
|
+
handler(e, toggled) {
|
|
4246
|
+
if (!toggled) {
|
|
4247
|
+
return;
|
|
4248
|
+
}
|
|
4249
|
+
|
|
4250
|
+
this.clearTimers();
|
|
4251
|
+
this.position();
|
|
4252
|
+
} },
|
|
4253
|
+
|
|
4254
|
+
|
|
4255
|
+
{
|
|
4256
|
+
name: 'show',
|
|
4257
|
+
|
|
4258
|
+
self: true,
|
|
4259
|
+
|
|
4260
|
+
handler() {
|
|
4261
|
+
active = this;
|
|
4262
|
+
|
|
4263
|
+
this.tracker.init();
|
|
4264
|
+
|
|
4265
|
+
for (const handler of [
|
|
4266
|
+
on(
|
|
4267
|
+
document,
|
|
4268
|
+
pointerDown,
|
|
4269
|
+
(_ref2) => {let { target } = _ref2;return (
|
|
4270
|
+
!within(target, this.$el) &&
|
|
4271
|
+
once(
|
|
4272
|
+
document,
|
|
4273
|
+
pointerUp + " " + pointerCancel + " scroll",
|
|
4274
|
+
(_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
|
|
4275
|
+
if (
|
|
4276
|
+
!defaultPrevented &&
|
|
4277
|
+
type === pointerUp &&
|
|
4278
|
+
target === newTarget &&
|
|
4279
|
+
!(this.target && within(target, this.target)))
|
|
4280
|
+
{
|
|
4281
|
+
this.hide(false);
|
|
4282
|
+
}
|
|
4283
|
+
},
|
|
4284
|
+
true));}),
|
|
4285
|
+
|
|
4286
|
+
|
|
4287
|
+
|
|
4288
|
+
on(document, 'keydown', (e) => {
|
|
4289
|
+
if (e.keyCode === 27) {
|
|
4290
|
+
this.hide(false);
|
|
4291
|
+
}
|
|
4292
|
+
}),
|
|
4293
|
+
|
|
4294
|
+
...(this.bgScroll ?
|
|
4295
|
+
[] :
|
|
4296
|
+
[preventOverscroll(this.$el), preventBackgroundScroll()]),
|
|
4297
|
+
|
|
4298
|
+
...(this.display === 'static' && this.align !== 'stretch' ?
|
|
4299
|
+
[] :
|
|
4300
|
+
(() => {
|
|
4301
|
+
const handler = () => this.$emit();
|
|
4302
|
+
return [
|
|
4303
|
+
on(window, 'resize', handler),
|
|
4304
|
+
on(document, 'scroll', handler, true),
|
|
4305
|
+
(() => {
|
|
4306
|
+
const observer = observeResize(
|
|
4307
|
+
scrollParents(this.$el),
|
|
4308
|
+
handler);
|
|
4309
|
+
|
|
4310
|
+
return () => observer.disconnect();
|
|
4311
|
+
})()];
|
|
4312
|
+
|
|
4313
|
+
})())])
|
|
4314
|
+
{
|
|
4315
|
+
once(this.$el, 'hide', handler, { self: true });
|
|
4316
|
+
}
|
|
4317
|
+
} },
|
|
4318
|
+
|
|
4319
|
+
|
|
4320
|
+
{
|
|
4321
|
+
name: 'beforehide',
|
|
4322
|
+
|
|
4323
|
+
self: true,
|
|
4324
|
+
|
|
4325
|
+
handler() {
|
|
4326
|
+
this.clearTimers();
|
|
4327
|
+
} },
|
|
4328
|
+
|
|
4329
|
+
|
|
4330
|
+
{
|
|
4331
|
+
name: 'hide',
|
|
4332
|
+
|
|
4333
|
+
handler(_ref4) {let { target } = _ref4;
|
|
4334
|
+
if (this.$el !== target) {
|
|
4335
|
+
active =
|
|
4336
|
+
active === null && within(target, this.$el) && this.isToggled() ?
|
|
4337
|
+
this :
|
|
4338
|
+
active;
|
|
4339
|
+
return;
|
|
4340
|
+
}
|
|
3994
4341
|
|
|
3995
|
-
active
|
|
4342
|
+
active = this.isActive() ? null : active;
|
|
3996
4343
|
this.tracker.cancel();
|
|
3997
4344
|
} }],
|
|
3998
4345
|
|
|
@@ -4020,16 +4367,16 @@
|
|
|
4020
4367
|
return;
|
|
4021
4368
|
}
|
|
4022
4369
|
|
|
4023
|
-
if (active
|
|
4024
|
-
if (delay && active
|
|
4370
|
+
if (active) {
|
|
4371
|
+
if (delay && active.isDelaying) {
|
|
4025
4372
|
this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
|
|
4026
4373
|
return;
|
|
4027
4374
|
}
|
|
4028
4375
|
|
|
4029
4376
|
let prev;
|
|
4030
|
-
while (active
|
|
4031
|
-
prev = active
|
|
4032
|
-
active
|
|
4377
|
+
while (active && prev !== active && !within(this.$el, active.$el)) {
|
|
4378
|
+
prev = active;
|
|
4379
|
+
active.hide(false, false);
|
|
4033
4380
|
}
|
|
4034
4381
|
}
|
|
4035
4382
|
|
|
@@ -4070,7 +4417,7 @@
|
|
|
4070
4417
|
},
|
|
4071
4418
|
|
|
4072
4419
|
isActive() {
|
|
4073
|
-
return active
|
|
4420
|
+
return active === this;
|
|
4074
4421
|
},
|
|
4075
4422
|
|
|
4076
4423
|
position() {
|
|
@@ -5157,414 +5504,163 @@
|
|
|
5157
5504
|
function setSourceProps(sourceEl, targetEl) {
|
|
5158
5505
|
srcProps.forEach((prop) => {
|
|
5159
5506
|
const value = data(sourceEl, prop);
|
|
5160
|
-
if (value) {
|
|
5161
|
-
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
|
+
if (value) {
|
|
5508
|
+
attr(targetEl, prop.replace(/^(data-)+/, ''), value);
|
|
5509
|
+
}
|
|
5510
|
+
});
|
|
5511
|
+
}
|
|
5425
5512
|
|
|
5426
|
-
|
|
5513
|
+
function getImageFromElement(el, src, sources) {
|
|
5514
|
+
const img = new Image();
|
|
5427
5515
|
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
within(target, this.panel))
|
|
5437
|
-
{
|
|
5438
|
-
return;
|
|
5439
|
-
}
|
|
5516
|
+
wrapInPicture(img, sources);
|
|
5517
|
+
setSourceProps(el, img);
|
|
5518
|
+
img.onload = () => {
|
|
5519
|
+
setSrcAttrs(el, img.currentSrc);
|
|
5520
|
+
};
|
|
5521
|
+
attr(img, 'src', src);
|
|
5522
|
+
return img;
|
|
5523
|
+
}
|
|
5440
5524
|
|
|
5441
|
-
|
|
5442
|
-
|
|
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);
|
|
5525
|
+
function wrapInPicture(img, sources) {
|
|
5526
|
+
sources = parseSources(sources);
|
|
5454
5527
|
|
|
5455
|
-
|
|
5456
|
-
|
|
5528
|
+
if (sources.length) {
|
|
5529
|
+
const picture = fragment('<picture>');
|
|
5530
|
+
for (const attrs of sources) {
|
|
5531
|
+
const source = fragment('<source>');
|
|
5532
|
+
attr(source, attrs);
|
|
5533
|
+
append(picture, source);
|
|
5534
|
+
}
|
|
5535
|
+
append(picture, img);
|
|
5536
|
+
}
|
|
5537
|
+
}
|
|
5457
5538
|
|
|
5458
|
-
|
|
5539
|
+
function parseSources(sources) {
|
|
5540
|
+
if (!sources) {
|
|
5541
|
+
return [];
|
|
5542
|
+
}
|
|
5459
5543
|
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
{ self: true });
|
|
5544
|
+
if (startsWith(sources, '[')) {
|
|
5545
|
+
try {
|
|
5546
|
+
sources = JSON.parse(sources);
|
|
5547
|
+
} catch (e) {
|
|
5548
|
+
sources = [];
|
|
5549
|
+
}
|
|
5550
|
+
} else {
|
|
5551
|
+
sources = parseOptions(sources);
|
|
5552
|
+
}
|
|
5470
5553
|
|
|
5471
|
-
|
|
5472
|
-
|
|
5554
|
+
if (!isArray(sources)) {
|
|
5555
|
+
sources = [sources];
|
|
5556
|
+
}
|
|
5473
5557
|
|
|
5558
|
+
return sources.filter((source) => !isEmpty(source));
|
|
5559
|
+
}
|
|
5474
5560
|
|
|
5475
|
-
|
|
5476
|
-
|
|
5561
|
+
function ensureSrcAttribute(el) {
|
|
5562
|
+
if (isImg(el) && !hasAttr(el, 'src')) {
|
|
5563
|
+
attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
|
|
5564
|
+
}
|
|
5565
|
+
}
|
|
5477
5566
|
|
|
5478
|
-
|
|
5567
|
+
function isPicture(el) {
|
|
5568
|
+
return isTag(el, 'picture');
|
|
5569
|
+
}
|
|
5479
5570
|
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
}
|
|
5571
|
+
function isImg(el) {
|
|
5572
|
+
return isTag(el, 'img');
|
|
5573
|
+
}
|
|
5484
5574
|
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
} },
|
|
5575
|
+
var Media = {
|
|
5576
|
+
props: {
|
|
5577
|
+
media: Boolean },
|
|
5489
5578
|
|
|
5490
5579
|
|
|
5491
|
-
{
|
|
5492
|
-
|
|
5580
|
+
data: {
|
|
5581
|
+
media: false },
|
|
5493
5582
|
|
|
5494
|
-
self: true,
|
|
5495
5583
|
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5584
|
+
connected() {
|
|
5585
|
+
const media = toMedia(this.media);
|
|
5586
|
+
this.matchMedia = true;
|
|
5587
|
+
if (media) {
|
|
5588
|
+
this.mediaObj = window.matchMedia(media);
|
|
5589
|
+
const handler = () => {
|
|
5590
|
+
this.matchMedia = this.mediaObj.matches;
|
|
5591
|
+
trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
|
|
5592
|
+
};
|
|
5593
|
+
this.offMediaObj = on(this.mediaObj, 'change', () => {
|
|
5594
|
+
handler();
|
|
5595
|
+
this.$emit('resize');
|
|
5596
|
+
});
|
|
5597
|
+
handler();
|
|
5598
|
+
}
|
|
5599
|
+
},
|
|
5500
5600
|
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5601
|
+
disconnected() {var _this$offMediaObj;
|
|
5602
|
+
(_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
|
|
5603
|
+
} };
|
|
5504
5604
|
|
|
5505
|
-
css(this.$el, 'zIndex', '');
|
|
5506
5605
|
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5606
|
+
function toMedia(value) {
|
|
5607
|
+
if (isString(value)) {
|
|
5608
|
+
if (startsWith(value, '@')) {
|
|
5609
|
+
const name = "breakpoint-" + value.substr(1);
|
|
5610
|
+
value = toFloat(getCssVar(name));
|
|
5611
|
+
} else if (isNaN(value)) {
|
|
5612
|
+
return value;
|
|
5613
|
+
}
|
|
5614
|
+
}
|
|
5511
5615
|
|
|
5616
|
+
return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
|
|
5617
|
+
}
|
|
5512
5618
|
|
|
5619
|
+
var leader = {
|
|
5620
|
+
mixins: [Class, Media, Resize],
|
|
5513
5621
|
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
return this.isToggled() ? this.hide() : this.show();
|
|
5517
|
-
},
|
|
5622
|
+
props: {
|
|
5623
|
+
fill: String },
|
|
5518
5624
|
|
|
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
5625
|
|
|
5525
|
-
|
|
5626
|
+
data: {
|
|
5627
|
+
fill: '',
|
|
5628
|
+
clsWrapper: 'uk-leader-fill',
|
|
5629
|
+
clsHide: 'uk-leader-hide',
|
|
5630
|
+
attrFill: 'data-fill' },
|
|
5526
5631
|
|
|
5527
|
-
return this.toggleElement(this.$el, true, animate(this));
|
|
5528
|
-
},
|
|
5529
5632
|
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5633
|
+
computed: {
|
|
5634
|
+
fill(_ref) {let { fill } = _ref;
|
|
5635
|
+
return fill || getCssVar('leader-fill-content');
|
|
5636
|
+
} },
|
|
5533
5637
|
|
|
5534
5638
|
|
|
5639
|
+
connected() {
|
|
5640
|
+
[this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
|
|
5641
|
+
},
|
|
5535
5642
|
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
once(el, 'show hide', () => {
|
|
5540
|
-
el._reject == null ? void 0 : el._reject();
|
|
5541
|
-
el._reject = reject;
|
|
5643
|
+
disconnected() {
|
|
5644
|
+
unwrap(this.wrapper.childNodes);
|
|
5645
|
+
},
|
|
5542
5646
|
|
|
5543
|
-
|
|
5647
|
+
update: {
|
|
5648
|
+
read() {
|
|
5649
|
+
const width = Math.trunc(this.$el.offsetWidth / 2);
|
|
5544
5650
|
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
once(transitionElement, 'transitionend transitioncancel', resolve, {
|
|
5550
|
-
self: true });
|
|
5651
|
+
return {
|
|
5652
|
+
width,
|
|
5653
|
+
fill: this.fill,
|
|
5654
|
+
hide: !this.matchMedia };
|
|
5551
5655
|
|
|
5552
|
-
clearTimeout(timer);
|
|
5553
5656
|
},
|
|
5554
|
-
{ self: true });
|
|
5555
|
-
|
|
5556
5657
|
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
},
|
|
5561
|
-
})).
|
|
5562
|
-
then(() => delete el._reject);
|
|
5563
|
-
}
|
|
5658
|
+
write(_ref2) {let { width, fill, hide } = _ref2;
|
|
5659
|
+
toggleClass(this.wrapper, this.clsHide, hide);
|
|
5660
|
+
attr(this.wrapper, this.attrFill, new Array(width).join(fill));
|
|
5661
|
+
},
|
|
5564
5662
|
|
|
5565
|
-
|
|
5566
|
-
return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
|
|
5567
|
-
}
|
|
5663
|
+
events: ['resize'] } };
|
|
5568
5664
|
|
|
5569
5665
|
var modal = {
|
|
5570
5666
|
install: install$2,
|
|
@@ -6070,7 +6166,7 @@
|
|
|
6070
6166
|
|
|
6071
6167
|
methods: {
|
|
6072
6168
|
getActive() {
|
|
6073
|
-
return active
|
|
6169
|
+
return active && within(active.target, this.$el) && active;
|
|
6074
6170
|
},
|
|
6075
6171
|
|
|
6076
6172
|
transitionTo(newHeight, el) {
|
|
@@ -6280,22 +6376,6 @@
|
|
|
6280
6376
|
} },
|
|
6281
6377
|
|
|
6282
6378
|
|
|
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
6379
|
{
|
|
6300
6380
|
name: 'touchmove',
|
|
6301
6381
|
|
|
@@ -6311,33 +6391,6 @@
|
|
|
6311
6391
|
} },
|
|
6312
6392
|
|
|
6313
6393
|
|
|
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
6394
|
{
|
|
6342
6395
|
name: 'show',
|
|
6343
6396
|
|
|
@@ -6349,7 +6402,6 @@
|
|
|
6349
6402
|
addClass(parent(this.panel), this.clsMode);
|
|
6350
6403
|
}
|
|
6351
6404
|
|
|
6352
|
-
css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
|
|
6353
6405
|
addClass(document.body, this.clsContainer, this.clsFlip);
|
|
6354
6406
|
css(document.body, 'touch-action', 'pan-y pinch-zoom');
|
|
6355
6407
|
css(this.$el, 'display', 'block');
|
|
@@ -6357,7 +6409,7 @@
|
|
|
6357
6409
|
addClass(
|
|
6358
6410
|
this.panel,
|
|
6359
6411
|
this.clsSidebarAnimation,
|
|
6360
|
-
this.mode
|
|
6412
|
+
this.mode === 'reveal' ? '' : this.clsMode);
|
|
6361
6413
|
|
|
6362
6414
|
|
|
6363
6415
|
height(document.body); // force reflow
|
|
@@ -6394,8 +6446,6 @@
|
|
|
6394
6446
|
removeClass(this.$el, this.clsOverlay);
|
|
6395
6447
|
css(this.$el, 'display', '');
|
|
6396
6448
|
removeClass(document.body, this.clsContainer, this.clsFlip);
|
|
6397
|
-
|
|
6398
|
-
css(document.documentElement, 'overflowY', '');
|
|
6399
6449
|
} },
|
|
6400
6450
|
|
|
6401
6451
|
|
|
@@ -7200,7 +7250,7 @@
|
|
|
7200
7250
|
|
|
7201
7251
|
watch(connects) {
|
|
7202
7252
|
if (this.swiping) {
|
|
7203
|
-
css(connects, '
|
|
7253
|
+
css(connects, 'touchAction', 'pan-y pinch-zoom');
|
|
7204
7254
|
}
|
|
7205
7255
|
|
|
7206
7256
|
const index = this.index();
|
|
@@ -9648,7 +9698,7 @@
|
|
|
9648
9698
|
positions[prop] = getBackgroundPos(el, prop);
|
|
9649
9699
|
}
|
|
9650
9700
|
|
|
9651
|
-
return setBackgroundPosFn(bgProps,
|
|
9701
|
+
return setBackgroundPosFn(bgProps, positions, props);
|
|
9652
9702
|
}
|
|
9653
9703
|
|
|
9654
9704
|
function backgroundCoverFn(prop, el, stops, props) {
|