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