uikit 3.25.27-dev.9e97c1f → 3.25.27
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 +2 -34
- package/build/prefix.js +1 -1
- package/build/publishDev.js +1 -1
- package/build/scope.js +1 -1
- package/build/scss.js +1 -1
- package/dist/css/uikit-core-rtl.css +1569 -1692
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1569 -1692
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1210 -1326
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1210 -1326
- 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 +135 -134
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +136 -135
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +6 -8
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +12 -8
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +12 -8
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +25 -51
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +12 -8
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +102 -81
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +17 -15
- 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 +313 -856
- 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 +377 -711
- package/dist/js/uikit.min.js +1 -1
- package/package.json +2 -2
- package/src/js/api/component.js +3 -2
- package/src/js/api/observables.js +4 -16
- package/src/js/api/options.js +3 -6
- package/src/js/api/props.js +3 -1
- package/src/js/api/state.js +8 -7
- package/src/js/components/index.js +0 -1
- package/src/js/components/internal/lightbox-animations.js +26 -7
- package/src/js/components/internal/slider-preload.js +0 -1
- package/src/js/components/internal/slideshow-animations.js +62 -15
- package/src/js/components/lightbox-panel.js +96 -121
- package/src/js/components/lightbox.js +8 -5
- package/src/js/components/notification.js +5 -7
- package/src/js/core/accordion.js +31 -62
- package/src/js/core/drop.js +3 -4
- package/src/js/core/dropnav.js +3 -3
- package/src/js/core/grid.js +19 -5
- package/src/js/core/margin.js +0 -3
- package/src/js/core/scroll.js +11 -0
- package/src/js/core/sticky.js +1 -1
- package/src/js/core/switcher.js +49 -12
- package/src/js/core/video.js +21 -236
- package/src/js/mixin/internal/slideshow-animations.js +13 -5
- package/src/js/mixin/internal/slideshow-transitioner.js +2 -2
- package/src/js/mixin/parallax.js +4 -1
- package/src/js/mixin/position.js +1 -1
- package/src/js/mixin/slider-parallax.js +38 -9
- package/src/js/mixin/togglable.js +14 -13
- package/src/js/util/attr.js +7 -7
- package/src/js/util/dom.js +4 -3
- package/src/js/util/lang.js +2 -2
- package/src/js/util/player.js +2 -4
- package/src/js/util/style.js +13 -12
- package/src/js/util/viewport.js +25 -22
- package/src/less/components/_import.less +3 -8
- package/src/less/components/animation.less +1 -1
- package/src/less/components/base.less +1 -1
- package/src/less/components/button.less +1 -1
- package/src/less/components/card.less +8 -8
- package/src/less/components/form.less +15 -15
- package/src/less/components/grid.less +65 -58
- package/src/less/components/lightbox.less +8 -2
- package/src/less/components/margin.less +124 -155
- package/src/less/components/modal.less +4 -1
- package/src/less/components/nav.less +1 -1
- package/src/less/components/navbar.less +1 -1
- package/src/less/components/padding.less +9 -9
- package/src/less/components/position.less +4 -9
- package/src/less/components/search.less +1 -1
- package/src/less/components/slideshow.less +4 -1
- package/src/less/components/switcher.less +2 -5
- package/src/less/components/table.less +4 -4
- package/src/less/components/text.less +4 -10
- package/src/less/components/utility.less +163 -0
- package/src/less/components/visibility.less +4 -4
- package/src/less/theme/_import.less +2 -6
- package/src/less/theme/alert.less +5 -0
- package/src/less/theme/thumbnav.less +4 -1
- package/src/less/theme/utility.less +32 -0
- package/src/scss/components/_import.scss +3 -8
- package/src/scss/components/animation.scss +1 -1
- package/src/scss/components/base.scss +1 -1
- package/src/scss/components/button.scss +1 -1
- package/src/scss/components/card.scss +8 -8
- package/src/scss/components/form.scss +14 -14
- package/src/scss/components/grid.scss +64 -57
- package/src/scss/components/lightbox.scss +8 -2
- package/src/scss/components/margin.scss +124 -155
- package/src/scss/components/modal.scss +4 -1
- package/src/scss/components/nav.scss +1 -1
- package/src/scss/components/navbar.scss +1 -1
- package/src/scss/components/padding.scss +9 -9
- package/src/scss/components/position.scss +4 -9
- package/src/scss/components/search.scss +1 -1
- package/src/scss/components/slideshow.scss +4 -1
- package/src/scss/components/switcher.scss +2 -5
- package/src/scss/components/table.scss +4 -4
- package/src/scss/components/text.scss +4 -10
- package/src/scss/components/utility.scss +129 -0
- package/src/scss/components/visibility.scss +4 -4
- package/src/scss/mixins-theme.scss +43 -44
- package/src/scss/mixins.scss +31 -40
- package/src/scss/variables-theme.scss +14 -14
- package/src/scss/variables.scss +14 -14
- package/tests/accordion.html +10 -77
- package/tests/alert.html +1 -1
- package/tests/align.html +5 -5
- package/tests/animation.html +4 -4
- package/tests/article.html +7 -7
- package/tests/background.html +2 -2
- package/tests/badge.html +1 -1
- package/tests/base.html +2 -2
- package/tests/button.html +1 -1
- package/tests/card.html +15 -15
- package/tests/close.html +2 -2
- package/tests/comment.html +9 -9
- package/tests/container.html +2 -2
- package/tests/countdown.html +21 -21
- package/tests/cover.html +3 -3
- package/tests/description-list.html +1 -1
- package/tests/divider.html +3 -3
- package/tests/dotnav.html +1 -1
- package/tests/drop.html +7 -7
- package/tests/dropbar.html +5 -5
- package/tests/dropdown.html +1 -1
- package/tests/dropnav.html +18 -18
- package/tests/filter.html +3 -3
- package/tests/form.html +14 -14
- package/tests/grid.html +47 -41
- package/tests/heading.html +2 -2
- package/tests/height-viewport.html +4 -4
- package/tests/height.html +5 -5
- package/tests/icon.html +8 -8
- package/tests/image.html +6 -6
- package/tests/index.html +13 -13
- package/tests/js/index.js +1 -1
- package/tests/leader.html +5 -5
- package/tests/lightbox.html +6 -6
- package/tests/link.html +1 -1
- package/tests/list.html +4 -4
- package/tests/margin.html +7 -59
- package/tests/marker.html +3 -3
- package/tests/modal.html +3 -3
- package/tests/nav.html +5 -5
- package/tests/navbar.html +27 -27
- package/tests/notification.html +2 -8
- package/tests/offcanvas.html +12 -12
- package/tests/overlay.html +3 -3
- package/tests/padding.html +1 -1
- package/tests/pagination.html +3 -3
- package/tests/parallax.html +1 -1
- package/tests/position.html +6 -6
- package/tests/scrollspy.html +13 -13
- package/tests/search.html +5 -5
- package/tests/section.html +17 -17
- package/tests/slidenav.html +3 -3
- package/tests/slider.html +5 -5
- package/tests/slideshow.html +3 -33
- package/tests/sortable.html +15 -15
- package/tests/sticky-navbar.html +4 -4
- package/tests/sticky-parallax.html +3 -3
- package/tests/sticky.html +3 -3
- package/tests/svg.html +2 -3
- package/tests/switcher.html +7 -7
- package/tests/tab.html +5 -5
- package/tests/text.html +3 -9
- package/tests/tile.html +4 -4
- package/tests/toggle.html +1 -1
- package/tests/tooltip.html +3 -3
- package/tests/totop.html +2 -2
- package/tests/transition.html +1 -1
- package/tests/upload.html +5 -5
- package/tests/utility.html +116 -16
- package/tests/video.html +24 -224
- package/tests/visibility.html +4 -4
- package/tests/width.html +12 -12
- package/dist/js/components/marquee.js +0 -215
- package/dist/js/components/marquee.min.js +0 -1
- package/src/js/components/marquee.js +0 -156
- package/src/js/mixin/connect.js +0 -90
- package/src/js/mixin/scroll-driven.js +0 -57
- package/src/less/components/dropcap.less +0 -71
- package/src/less/components/floating-shadow.less +0 -66
- package/src/less/components/logo.less +0 -94
- package/src/less/components/marquee.less +0 -133
- package/src/less/theme/dropcap.less +0 -29
- package/src/less/theme/floating-shadow.less +0 -20
- package/src/less/theme/logo.less +0 -29
- package/src/less/theme/marquee.less +0 -14
- package/src/scss/components/dropcap.scss +0 -63
- package/src/scss/components/floating-shadow.scss +0 -63
- package/src/scss/components/logo.scss +0 -75
- package/src/scss/components/marquee.scss +0 -136
- package/tests/dropcap.html +0 -26
- package/tests/floating-shadow.html +0 -44
- package/tests/logo.html +0 -84
- package/tests/marquee.html +0 -617
package/dist/js/uikit-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.25.27
|
|
1
|
+
/*! UIkit 3.25.27 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -135,8 +135,8 @@
|
|
|
135
135
|
}
|
|
136
136
|
function pick(obj, props) {
|
|
137
137
|
const result = {};
|
|
138
|
-
for (const
|
|
139
|
-
result[
|
|
138
|
+
for (const prop of props) {
|
|
139
|
+
result[prop] = obj[prop];
|
|
140
140
|
}
|
|
141
141
|
return result;
|
|
142
142
|
}
|
|
@@ -247,12 +247,13 @@
|
|
|
247
247
|
}
|
|
248
248
|
if (isUndefined(value)) {
|
|
249
249
|
return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
250
|
+
} else {
|
|
251
|
+
for (const el of toNodes(element)) {
|
|
252
|
+
if (value === null) {
|
|
253
|
+
removeAttr(el, name);
|
|
254
|
+
} else {
|
|
255
|
+
el.setAttribute(name, value);
|
|
256
|
+
}
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
259
|
}
|
|
@@ -589,18 +590,19 @@
|
|
|
589
590
|
property = propName(property);
|
|
590
591
|
if (isUndefined(value)) {
|
|
591
592
|
return getComputedStyle(element2).getPropertyValue(property);
|
|
593
|
+
} else {
|
|
594
|
+
element2.style.setProperty(
|
|
595
|
+
property,
|
|
596
|
+
isNumeric(value) && !cssNumber[property] && !isCustomProperty(property) ? `${value}px` : value || isNumber(value) ? value : "",
|
|
597
|
+
priority
|
|
598
|
+
);
|
|
592
599
|
}
|
|
593
|
-
element2.style.setProperty(
|
|
594
|
-
property,
|
|
595
|
-
isNumeric(value) && !cssNumber[property] && !isCustomProperty(property) ? `${value}px` : value || isNumber(value) ? value : "",
|
|
596
|
-
priority
|
|
597
|
-
);
|
|
598
600
|
} else if (isArray(property)) {
|
|
599
|
-
const
|
|
601
|
+
const props = {};
|
|
600
602
|
for (const prop of property) {
|
|
601
|
-
|
|
603
|
+
props[prop] = css(element2, prop);
|
|
602
604
|
}
|
|
603
|
-
return
|
|
605
|
+
return props;
|
|
604
606
|
} else if (isObject(property)) {
|
|
605
607
|
for (const prop in property) {
|
|
606
608
|
css(element2, prop, property[prop], value);
|
|
@@ -795,9 +797,7 @@
|
|
|
795
797
|
);
|
|
796
798
|
}
|
|
797
799
|
function unwrap(element) {
|
|
798
|
-
|
|
799
|
-
elementParent.replaceWith(...elementParent.childNodes);
|
|
800
|
-
}
|
|
800
|
+
toNodes(element).map(parent).filter((value, index, self) => self.indexOf(value) === index).forEach((parent2) => parent2.replaceWith(...parent2.childNodes));
|
|
801
801
|
}
|
|
802
802
|
const singleTagRe = /^<(\w+)\s*\/?>(?:<\/\1>)?$/;
|
|
803
803
|
function fragment(html2) {
|
|
@@ -837,7 +837,7 @@
|
|
|
837
837
|
width: ["left", "right"],
|
|
838
838
|
height: ["top", "bottom"]
|
|
839
839
|
};
|
|
840
|
-
function dimensions
|
|
840
|
+
function dimensions(element) {
|
|
841
841
|
const rect = isElement(element) ? toNode(element).getBoundingClientRect() : { height: height$1(element), width: width(element), top: 0, left: 0 };
|
|
842
842
|
return {
|
|
843
843
|
height: rect.height,
|
|
@@ -852,7 +852,7 @@
|
|
|
852
852
|
if (coordinates) {
|
|
853
853
|
css(element, { left: 0, top: 0 });
|
|
854
854
|
}
|
|
855
|
-
const currentOffset = dimensions
|
|
855
|
+
const currentOffset = dimensions(element);
|
|
856
856
|
if (element) {
|
|
857
857
|
const { scrollY, scrollX } = toWindow(element);
|
|
858
858
|
const offsetBy = { height: scrollY, width: scrollX };
|
|
@@ -953,15 +953,15 @@
|
|
|
953
953
|
return sumBy(parseCalc(value), (value2) => {
|
|
954
954
|
const unit = parseUnit(value2);
|
|
955
955
|
return unit ? percent(
|
|
956
|
-
unit === "vh" ? getViewportHeight() : unit === "vw" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions
|
|
956
|
+
unit === "vh" ? getViewportHeight() : unit === "vw" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions(element)[property],
|
|
957
957
|
value2
|
|
958
958
|
) : value2;
|
|
959
959
|
});
|
|
960
960
|
}
|
|
961
961
|
const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
|
|
962
962
|
const parseCalc = memoize((calc) => calc.toString().replace(/\s/g, "").match(calcRe) || []);
|
|
963
|
-
const unitRe
|
|
964
|
-
const parseUnit = memoize((str) => (str.match(unitRe
|
|
963
|
+
const unitRe = /(?:v[hw]|%)$/;
|
|
964
|
+
const parseUnit = memoize((str) => (str.match(unitRe) || [])[0]);
|
|
965
965
|
function percent(base, value) {
|
|
966
966
|
return base * toFloat(value) / 100;
|
|
967
967
|
}
|
|
@@ -1056,7 +1056,7 @@
|
|
|
1056
1056
|
if (!this.positions || this.positions.length < 2) {
|
|
1057
1057
|
return false;
|
|
1058
1058
|
}
|
|
1059
|
-
const p = dimensions
|
|
1059
|
+
const p = dimensions(target);
|
|
1060
1060
|
const { left, right, top, bottom } = p;
|
|
1061
1061
|
const [prevPosition] = this.positions;
|
|
1062
1062
|
const position = last(this.positions);
|
|
@@ -1159,9 +1159,7 @@
|
|
|
1159
1159
|
return isTag(el, "iframe") && (isYoutube(el) || isVimeo(el));
|
|
1160
1160
|
}
|
|
1161
1161
|
function isYoutube(el) {
|
|
1162
|
-
return /\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be
|
|
1163
|
-
el.src
|
|
1164
|
-
);
|
|
1162
|
+
return /\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\//.test(el.src);
|
|
1165
1163
|
}
|
|
1166
1164
|
function isVimeo(el) {
|
|
1167
1165
|
return /vimeo\.com\/video\/.*/.test(el.src);
|
|
@@ -1173,7 +1171,7 @@
|
|
|
1173
1171
|
function post(el, cmd) {
|
|
1174
1172
|
el.contentWindow.postMessage(JSON.stringify({ event: "command", ...cmd }), "*");
|
|
1175
1173
|
}
|
|
1176
|
-
const stateKey =
|
|
1174
|
+
const stateKey = "_ukPlayer";
|
|
1177
1175
|
let counter = 0;
|
|
1178
1176
|
function enableApi(el) {
|
|
1179
1177
|
if (el[stateKey]) {
|
|
@@ -1204,16 +1202,17 @@
|
|
|
1204
1202
|
if (!isVisible(element)) {
|
|
1205
1203
|
return false;
|
|
1206
1204
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1205
|
+
return intersectRect(
|
|
1206
|
+
...overflowParents(element).map((parent2) => {
|
|
1207
|
+
const { top, left, bottom, right } = offsetViewport(parent2);
|
|
1208
|
+
return {
|
|
1209
|
+
top: top - offsetTop,
|
|
1210
|
+
left: left - offsetLeft,
|
|
1211
|
+
bottom: bottom + offsetTop,
|
|
1212
|
+
right: right + offsetLeft
|
|
1213
|
+
};
|
|
1214
|
+
}).concat(offset(element))
|
|
1215
|
+
);
|
|
1217
1216
|
}
|
|
1218
1217
|
function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
|
|
1219
1218
|
const parents2 = isVisible(element) ? scrollParents(element, false, ["hidden"]) : [];
|
|
@@ -1253,7 +1252,7 @@
|
|
|
1253
1252
|
const percent = ease(clamp((Date.now() - start) / duration));
|
|
1254
1253
|
let diff = 0;
|
|
1255
1254
|
if (parents2[0] === element2 && scroll + top < maxScroll) {
|
|
1256
|
-
diff = offset(targetEl).top + (isScrollingElement ? 0 : element2.scrollTop) - targetTop - dimensions
|
|
1255
|
+
diff = offset(targetEl).top + (isScrollingElement ? 0 : element2.scrollTop) - targetTop - dimensions(getCoveringElement(targetEl)).height;
|
|
1257
1256
|
}
|
|
1258
1257
|
if (css(element2, "scrollBehavior") !== "auto") {
|
|
1259
1258
|
css(element2, "scrollBehavior", "auto");
|
|
@@ -1297,12 +1296,11 @@
|
|
|
1297
1296
|
if (~fixedIndex) {
|
|
1298
1297
|
ancestors = ancestors.slice(fixedIndex);
|
|
1299
1298
|
}
|
|
1300
|
-
return [
|
|
1301
|
-
|
|
1302
|
-
...ancestors.filter(
|
|
1299
|
+
return [scrollEl].concat(
|
|
1300
|
+
ancestors.filter(
|
|
1303
1301
|
(parent2) => css(parent2, "overflow").split(" ").some((prop) => includes(["auto", "scroll", ...props], prop)) && (!scrollable || parent2.scrollHeight > offsetViewport(parent2).height)
|
|
1304
1302
|
)
|
|
1305
|
-
|
|
1303
|
+
).reverse();
|
|
1306
1304
|
}
|
|
1307
1305
|
function scrollParent(...args) {
|
|
1308
1306
|
return scrollParents(...args)[0];
|
|
@@ -1341,7 +1339,7 @@
|
|
|
1341
1339
|
function getCoveringElement(target) {
|
|
1342
1340
|
const { document } = toWindow(target);
|
|
1343
1341
|
target = target || document.body;
|
|
1344
|
-
const { left, width, top } = dimensions
|
|
1342
|
+
const { left, width, top } = dimensions(target);
|
|
1345
1343
|
for (const position of top ? [0, top] : [0]) {
|
|
1346
1344
|
let coverEl;
|
|
1347
1345
|
for (const el of document.elementsFromPoint(left + width / 2, position)) {
|
|
@@ -1350,7 +1348,7 @@
|
|
|
1350
1348
|
parents(target).reverse().find(
|
|
1351
1349
|
(parent2) => !parent2.contains(el) && !hasPosition(parent2, "static")
|
|
1352
1350
|
)
|
|
1353
|
-
) < zIndex(el) || hasPosition(el, "sticky") && (!target || parent(el).contains(target))) && (!coverEl || dimensions
|
|
1351
|
+
) < zIndex(el) || hasPosition(el, "sticky") && (!target || parent(el).contains(target))) && (!coverEl || dimensions(coverEl).height < dimensions(el).height)) {
|
|
1354
1352
|
coverEl = el;
|
|
1355
1353
|
}
|
|
1356
1354
|
}
|
|
@@ -1571,7 +1569,7 @@
|
|
|
1571
1569
|
createEvent: createEvent,
|
|
1572
1570
|
css: css,
|
|
1573
1571
|
data: data,
|
|
1574
|
-
dimensions: dimensions
|
|
1572
|
+
dimensions: dimensions,
|
|
1575
1573
|
each: each,
|
|
1576
1574
|
empty: empty,
|
|
1577
1575
|
endsWith: endsWith,
|
|
@@ -1691,7 +1689,7 @@
|
|
|
1691
1689
|
wrapInner: wrapInner
|
|
1692
1690
|
});
|
|
1693
1691
|
|
|
1694
|
-
var VERSION = '3.25.27
|
|
1692
|
+
var VERSION = '3.25.27';
|
|
1695
1693
|
|
|
1696
1694
|
function initUpdates(instance) {
|
|
1697
1695
|
instance._data = {};
|
|
@@ -2004,14 +2002,11 @@
|
|
|
2004
2002
|
function coerce$1(type, value) {
|
|
2005
2003
|
if (type === Boolean) {
|
|
2006
2004
|
return toBoolean(value);
|
|
2007
|
-
}
|
|
2008
|
-
if (type === Number) {
|
|
2005
|
+
} else if (type === Number) {
|
|
2009
2006
|
return toNumber(value);
|
|
2010
|
-
}
|
|
2011
|
-
if (type === "list") {
|
|
2007
|
+
} else if (type === "list") {
|
|
2012
2008
|
return toList(value);
|
|
2013
|
-
}
|
|
2014
|
-
if (type === Object && isString(value)) {
|
|
2009
|
+
} else if (type === Object && isString(value)) {
|
|
2015
2010
|
return parseOptions(value);
|
|
2016
2011
|
}
|
|
2017
2012
|
return type ? type(value) : value;
|
|
@@ -2061,7 +2056,7 @@
|
|
|
2061
2056
|
}
|
|
2062
2057
|
const getAttributes = memoize((id, props) => {
|
|
2063
2058
|
const attributes = Object.keys(props);
|
|
2064
|
-
const filter =
|
|
2059
|
+
const filter = attributes.concat(id).flatMap((key) => [hyphenate(key), `data-${hyphenate(key)}`]);
|
|
2065
2060
|
return { attributes, filter };
|
|
2066
2061
|
});
|
|
2067
2062
|
function initPropsObserver(instance) {
|
|
@@ -2151,10 +2146,14 @@
|
|
|
2151
2146
|
}
|
|
2152
2147
|
function normalizeData({ data = {} }, { args = [], props = {} }) {
|
|
2153
2148
|
if (isArray(data)) {
|
|
2154
|
-
data = data.slice(0, args.length).reduce(
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2149
|
+
data = data.slice(0, args.length).reduce((data2, value, index) => {
|
|
2150
|
+
if (isPlainObject(value)) {
|
|
2151
|
+
assign(data2, value);
|
|
2152
|
+
} else {
|
|
2153
|
+
data2[args[index]] = value;
|
|
2154
|
+
}
|
|
2155
|
+
return data2;
|
|
2156
|
+
}, {});
|
|
2158
2157
|
}
|
|
2159
2158
|
for (const key in data) {
|
|
2160
2159
|
if (isUndefined(data[key])) {
|
|
@@ -2202,10 +2201,11 @@
|
|
|
2202
2201
|
function init(element2) {
|
|
2203
2202
|
const instance = getComponent(element2, name);
|
|
2204
2203
|
if (instance) {
|
|
2205
|
-
if (
|
|
2204
|
+
if (data) {
|
|
2205
|
+
instance.$destroy();
|
|
2206
|
+
} else {
|
|
2206
2207
|
return instance;
|
|
2207
2208
|
}
|
|
2208
|
-
instance.$destroy();
|
|
2209
2209
|
}
|
|
2210
2210
|
return new Component({ el: element2, data });
|
|
2211
2211
|
}
|
|
@@ -2419,9 +2419,9 @@
|
|
|
2419
2419
|
function lazyload(options = {}) {
|
|
2420
2420
|
return intersection({
|
|
2421
2421
|
handler: function(entries, observer) {
|
|
2422
|
-
const { targets = this.$el, preload = 5
|
|
2422
|
+
const { targets = this.$el, preload = 5 } = options;
|
|
2423
2423
|
for (const el of toNodes(isFunction(targets) ? targets(this) : targets)) {
|
|
2424
|
-
(
|
|
2424
|
+
$$('[loading="lazy"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, "loading"));
|
|
2425
2425
|
}
|
|
2426
2426
|
for (const { isIntersecting, target } of entries) {
|
|
2427
2427
|
isIntersecting && observer.unobserve(target);
|
|
@@ -2430,15 +2430,6 @@
|
|
|
2430
2430
|
...options
|
|
2431
2431
|
});
|
|
2432
2432
|
}
|
|
2433
|
-
function preloadMedia(el, preload = 5) {
|
|
2434
|
-
loadLazyElements(el, preload);
|
|
2435
|
-
for (const video of $$('video[preload="none"]', el)) {
|
|
2436
|
-
video.preload = "";
|
|
2437
|
-
}
|
|
2438
|
-
}
|
|
2439
|
-
function loadLazyElements(el, preload) {
|
|
2440
|
-
$$('[loading="lazy"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, "loading"));
|
|
2441
|
-
}
|
|
2442
2433
|
function viewport(options) {
|
|
2443
2434
|
return observe((target, handler) => observeViewportResize(handler), options, "resize");
|
|
2444
2435
|
}
|
|
@@ -2511,6 +2502,62 @@
|
|
|
2511
2502
|
}
|
|
2512
2503
|
};
|
|
2513
2504
|
|
|
2505
|
+
const keyMap = {
|
|
2506
|
+
TAB: 9,
|
|
2507
|
+
ENTER: 13,
|
|
2508
|
+
ESC: 27,
|
|
2509
|
+
SPACE: 32,
|
|
2510
|
+
END: 35,
|
|
2511
|
+
HOME: 36,
|
|
2512
|
+
LEFT: 37,
|
|
2513
|
+
UP: 38,
|
|
2514
|
+
RIGHT: 39,
|
|
2515
|
+
DOWN: 40
|
|
2516
|
+
};
|
|
2517
|
+
function getNavigationIndex(keyCode, previousKey = keyMap.LEFT, nextKey = keyMap.RIGHT) {
|
|
2518
|
+
switch (keyCode) {
|
|
2519
|
+
case keyMap.HOME:
|
|
2520
|
+
return 0;
|
|
2521
|
+
case keyMap.END:
|
|
2522
|
+
return "last";
|
|
2523
|
+
case previousKey:
|
|
2524
|
+
return "previous";
|
|
2525
|
+
case nextKey:
|
|
2526
|
+
return "next";
|
|
2527
|
+
}
|
|
2528
|
+
return -1;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
function maybeDefaultPreventClick(e) {
|
|
2532
|
+
if (e.target.closest('a[href="#"],a[href=""]')) {
|
|
2533
|
+
e.preventDefault();
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
function onEscape(handler, isEligible = () => true) {
|
|
2537
|
+
return on(document, "keydown", (e) => {
|
|
2538
|
+
if (e.keyCode === keyMap.ESC && isEligible()) {
|
|
2539
|
+
handler(e);
|
|
2540
|
+
}
|
|
2541
|
+
});
|
|
2542
|
+
}
|
|
2543
|
+
function onOutsidePointer(handler, isOutside, isEligible) {
|
|
2544
|
+
return on(document, pointerDown, ({ target }) => {
|
|
2545
|
+
if (!isOutside(target) || isEligible && !isEligible()) {
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
once(
|
|
2549
|
+
document,
|
|
2550
|
+
`${pointerUp} ${pointerCancel} scroll`,
|
|
2551
|
+
({ defaultPrevented, type, target: newTarget }) => {
|
|
2552
|
+
if (!defaultPrevented && type === pointerUp && target === newTarget) {
|
|
2553
|
+
handler(target);
|
|
2554
|
+
}
|
|
2555
|
+
},
|
|
2556
|
+
true
|
|
2557
|
+
);
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2514
2561
|
var Togglable = {
|
|
2515
2562
|
props: {
|
|
2516
2563
|
cls: Boolean,
|
|
@@ -2603,25 +2650,27 @@
|
|
|
2603
2650
|
const dimProp = props[dirs.indexOf(dir)];
|
|
2604
2651
|
const marginProp = `margin-${dir[0]}`;
|
|
2605
2652
|
const marginStartProp = `margin-${startProp}`;
|
|
2606
|
-
let currentDim = dimensions
|
|
2653
|
+
let currentDim = dimensions(el)[dimProp];
|
|
2607
2654
|
const inProgress = Transition.inProgress(el);
|
|
2608
2655
|
await Transition.cancel(el);
|
|
2609
2656
|
if (show) {
|
|
2610
2657
|
_toggle(el, true);
|
|
2611
2658
|
}
|
|
2612
|
-
const prevProps =
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2659
|
+
const prevProps = Object.fromEntries(
|
|
2660
|
+
[
|
|
2661
|
+
"padding",
|
|
2662
|
+
"border",
|
|
2663
|
+
"width",
|
|
2664
|
+
"height",
|
|
2665
|
+
"minWidth",
|
|
2666
|
+
"minHeight",
|
|
2667
|
+
"overflowY",
|
|
2668
|
+
"overflowX",
|
|
2669
|
+
marginProp,
|
|
2670
|
+
marginStartProp
|
|
2671
|
+
].map((key) => [key, el.style[key]])
|
|
2672
|
+
);
|
|
2673
|
+
const dim = dimensions(el);
|
|
2625
2674
|
const currentMargin = toFloat(css(el, marginProp));
|
|
2626
2675
|
const marginStart = toFloat(css(el, marginStartProp));
|
|
2627
2676
|
const endDim = dim[dimProp] + marginStart;
|
|
@@ -2686,156 +2735,29 @@
|
|
|
2686
2735
|
_toggle(el, false);
|
|
2687
2736
|
}
|
|
2688
2737
|
|
|
2689
|
-
const TogglableComponent = App.extend(Togglable);
|
|
2690
|
-
var Connect = {
|
|
2691
|
-
mixins: [Togglable],
|
|
2692
|
-
props: {
|
|
2693
|
-
connect: String
|
|
2694
|
-
},
|
|
2695
|
-
data: {
|
|
2696
|
-
connect: "",
|
|
2697
|
-
cls: "uk-active"
|
|
2698
|
-
},
|
|
2699
|
-
computed: {
|
|
2700
|
-
connects: {
|
|
2701
|
-
get: ({ connect }, $el) => connect ? queryAll(connect, $el) : [],
|
|
2702
|
-
observe: ({ connect }) => connect
|
|
2703
|
-
},
|
|
2704
|
-
connectChildren() {
|
|
2705
|
-
return this.connects.flatMap((el) => children(el));
|
|
2706
|
-
}
|
|
2707
|
-
},
|
|
2708
|
-
watch: {
|
|
2709
|
-
connects(connects) {
|
|
2710
|
-
for (const el of connects) {
|
|
2711
|
-
if (isTag(el, "ul")) {
|
|
2712
|
-
el.role = "presentation";
|
|
2713
|
-
}
|
|
2714
|
-
}
|
|
2715
|
-
}
|
|
2716
|
-
},
|
|
2717
|
-
observe: lazyload({ targets: ({ connectChildren }) => connectChildren }),
|
|
2718
|
-
update() {
|
|
2719
|
-
for (const index in this.toggles) {
|
|
2720
|
-
const toggle = this.toggles[index];
|
|
2721
|
-
if (!toggle) {
|
|
2722
|
-
continue;
|
|
2723
|
-
}
|
|
2724
|
-
toggle.id = generateId(this, toggle);
|
|
2725
|
-
for (const { children: children2 } of this.connects) {
|
|
2726
|
-
const item = children2[index];
|
|
2727
|
-
if (item) {
|
|
2728
|
-
attr(item, {
|
|
2729
|
-
id: generateId(this, item),
|
|
2730
|
-
role: "tabpanel",
|
|
2731
|
-
"aria-labelledby": toggle.id
|
|
2732
|
-
});
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
}
|
|
2736
|
-
},
|
|
2737
|
-
methods: {
|
|
2738
|
-
showConnects(index, animate) {
|
|
2739
|
-
const toggle = async (el) => {
|
|
2740
|
-
const { children: children2 } = el;
|
|
2741
|
-
const animation = data(el, "uk-switcher-animation");
|
|
2742
|
-
let togglable = animation ? new TogglableComponent({ data: { ...this.$props, animation } }) : this;
|
|
2743
|
-
const actives = toArray(children2).filter(
|
|
2744
|
-
(child, i) => i !== index && hasClass(child, this.cls)
|
|
2745
|
-
);
|
|
2746
|
-
if (await togglable.toggleElement(actives, false, animate)) {
|
|
2747
|
-
await togglable.toggleElement(children2[index], true, animate);
|
|
2748
|
-
}
|
|
2749
|
-
};
|
|
2750
|
-
return Promise.all(this.connects.map(toggle));
|
|
2751
|
-
}
|
|
2752
|
-
}
|
|
2753
|
-
};
|
|
2754
|
-
|
|
2755
|
-
const keyMap = {
|
|
2756
|
-
TAB: 9,
|
|
2757
|
-
ENTER: 13,
|
|
2758
|
-
ESC: 27,
|
|
2759
|
-
SPACE: 32,
|
|
2760
|
-
END: 35,
|
|
2761
|
-
HOME: 36,
|
|
2762
|
-
LEFT: 37,
|
|
2763
|
-
UP: 38,
|
|
2764
|
-
RIGHT: 39,
|
|
2765
|
-
DOWN: 40
|
|
2766
|
-
};
|
|
2767
|
-
function getNavigationIndex(keyCode, previousKey = keyMap.LEFT, nextKey = keyMap.RIGHT) {
|
|
2768
|
-
switch (keyCode) {
|
|
2769
|
-
case keyMap.HOME:
|
|
2770
|
-
return 0;
|
|
2771
|
-
case keyMap.END:
|
|
2772
|
-
return "last";
|
|
2773
|
-
case previousKey:
|
|
2774
|
-
return "previous";
|
|
2775
|
-
case nextKey:
|
|
2776
|
-
return "next";
|
|
2777
|
-
}
|
|
2778
|
-
return -1;
|
|
2779
|
-
}
|
|
2780
|
-
|
|
2781
|
-
function maybeDefaultPreventClick(e) {
|
|
2782
|
-
if (e.target.closest('a[href="#"],a[href=""]')) {
|
|
2783
|
-
e.preventDefault();
|
|
2784
|
-
}
|
|
2785
|
-
}
|
|
2786
|
-
function onEscape(handler, isEligible = () => true) {
|
|
2787
|
-
return on(document, "keydown", (e) => {
|
|
2788
|
-
if (e.keyCode === keyMap.ESC && isEligible()) {
|
|
2789
|
-
handler(e);
|
|
2790
|
-
}
|
|
2791
|
-
});
|
|
2792
|
-
}
|
|
2793
|
-
function onOutsidePointer(handler, isOutside, isEligible) {
|
|
2794
|
-
return on(document, pointerDown, ({ target }) => {
|
|
2795
|
-
if (!isOutside(target) || isEligible && !isEligible()) {
|
|
2796
|
-
return;
|
|
2797
|
-
}
|
|
2798
|
-
once(
|
|
2799
|
-
document,
|
|
2800
|
-
`${pointerUp} ${pointerCancel} scroll`,
|
|
2801
|
-
({ defaultPrevented, type, target: newTarget }) => {
|
|
2802
|
-
if (!defaultPrevented && type === pointerUp && target === newTarget) {
|
|
2803
|
-
handler(target);
|
|
2804
|
-
}
|
|
2805
|
-
},
|
|
2806
|
-
true
|
|
2807
|
-
);
|
|
2808
|
-
});
|
|
2809
|
-
}
|
|
2810
|
-
|
|
2811
2738
|
const wrappers = /* @__PURE__ */ new WeakMap();
|
|
2812
2739
|
var Accordion = {
|
|
2813
|
-
mixins: [Class,
|
|
2740
|
+
mixins: [Class, Togglable],
|
|
2814
2741
|
props: {
|
|
2742
|
+
animation: Boolean,
|
|
2815
2743
|
targets: String,
|
|
2816
2744
|
active: null,
|
|
2817
2745
|
collapsible: Boolean,
|
|
2818
2746
|
multiple: Boolean,
|
|
2819
2747
|
toggle: String,
|
|
2820
2748
|
content: String,
|
|
2821
|
-
offset: Number
|
|
2822
|
-
switcherConnect: String
|
|
2749
|
+
offset: Number
|
|
2823
2750
|
},
|
|
2824
2751
|
data: {
|
|
2825
2752
|
targets: "> *",
|
|
2826
2753
|
active: false,
|
|
2827
|
-
animation:
|
|
2754
|
+
animation: true,
|
|
2828
2755
|
collapsible: true,
|
|
2829
2756
|
multiple: false,
|
|
2830
2757
|
clsOpen: "uk-open",
|
|
2831
|
-
cls: "uk-active",
|
|
2832
2758
|
toggle: ".uk-accordion-title",
|
|
2833
2759
|
content: ".uk-accordion-content",
|
|
2834
|
-
offset: 0
|
|
2835
|
-
switcherConnect: ""
|
|
2836
|
-
},
|
|
2837
|
-
beforeConnect() {
|
|
2838
|
-
this.connect = this.$props.connect = this.switcherConnect;
|
|
2760
|
+
offset: 0
|
|
2839
2761
|
},
|
|
2840
2762
|
computed: {
|
|
2841
2763
|
items: ({ targets }, $el) => $$(targets, $el),
|
|
@@ -2861,12 +2783,6 @@
|
|
|
2861
2783
|
this.toggle(active, false);
|
|
2862
2784
|
}
|
|
2863
2785
|
},
|
|
2864
|
-
connectChildren() {
|
|
2865
|
-
this.showConnects(
|
|
2866
|
-
findIndex(this.items, (el) => hasClass(el, this.clsOpen)),
|
|
2867
|
-
false
|
|
2868
|
-
);
|
|
2869
|
-
},
|
|
2870
2786
|
toggles() {
|
|
2871
2787
|
this.$emit();
|
|
2872
2788
|
},
|
|
@@ -2916,57 +2832,44 @@
|
|
|
2916
2832
|
if (!toggle || !content) {
|
|
2917
2833
|
continue;
|
|
2918
2834
|
}
|
|
2835
|
+
toggle.id = generateId(this, toggle);
|
|
2836
|
+
content.id = generateId(this, content);
|
|
2919
2837
|
const active = includes(activeItems, this.items[index2]);
|
|
2920
|
-
attr(content, {
|
|
2921
|
-
id: generateId(this, content),
|
|
2922
|
-
role: "region",
|
|
2923
|
-
"aria-labelledby": toggle.id
|
|
2924
|
-
});
|
|
2925
|
-
if (isTag(content, "ul")) {
|
|
2926
|
-
attr(children(content), "role", "presentation");
|
|
2927
|
-
}
|
|
2928
|
-
const controls = [
|
|
2929
|
-
content.id,
|
|
2930
|
-
...this.connects.map(({ children: children2 }) => {
|
|
2931
|
-
var _a;
|
|
2932
|
-
return (_a = children2[index2]) == null ? void 0 : _a.id;
|
|
2933
|
-
}).filter(Boolean)
|
|
2934
|
-
];
|
|
2935
2838
|
attr(toggle, {
|
|
2936
2839
|
role: isTag(toggle, "a") ? "button" : null,
|
|
2937
|
-
"aria-controls":
|
|
2840
|
+
"aria-controls": content.id,
|
|
2938
2841
|
"aria-expanded": active,
|
|
2939
2842
|
"aria-disabled": !this.collapsible && activeItems.length < 2 && active
|
|
2940
2843
|
});
|
|
2844
|
+
attr(content, { role: "region", "aria-labelledby": toggle.id });
|
|
2845
|
+
if (isTag(content, "ul")) {
|
|
2846
|
+
attr(children(content), "role", "presentation");
|
|
2847
|
+
}
|
|
2941
2848
|
}
|
|
2942
2849
|
},
|
|
2943
2850
|
methods: {
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
const next = getIndex(item, this.items);
|
|
2947
|
-
item = this.items[next];
|
|
2851
|
+
toggle(item, animate) {
|
|
2852
|
+
item = this.items[getIndex(item, this.items)];
|
|
2948
2853
|
let items = [item];
|
|
2949
2854
|
const activeItems = filter(this.items, `.${this.clsOpen}`);
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
this.showConnects(isActive ? hideIndex() : next, animate)
|
|
2969
|
-
]);
|
|
2855
|
+
if (!this.multiple && !includes(activeItems, items[0])) {
|
|
2856
|
+
items = items.concat(activeItems);
|
|
2857
|
+
}
|
|
2858
|
+
if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {
|
|
2859
|
+
items = [];
|
|
2860
|
+
}
|
|
2861
|
+
return Promise.all(
|
|
2862
|
+
items.map(
|
|
2863
|
+
(el) => this.toggleElement(el, !includes(activeItems, el), (el2, show) => {
|
|
2864
|
+
toggleClass(el2, this.clsOpen, show);
|
|
2865
|
+
if (animate === false || !this.animation) {
|
|
2866
|
+
hide($(this.content, el2), !show);
|
|
2867
|
+
return;
|
|
2868
|
+
}
|
|
2869
|
+
return transition(el2, show, this);
|
|
2870
|
+
})
|
|
2871
|
+
)
|
|
2872
|
+
);
|
|
2970
2873
|
}
|
|
2971
2874
|
}
|
|
2972
2875
|
};
|
|
@@ -2984,7 +2887,7 @@
|
|
|
2984
2887
|
const currentHeight = toFloat(css(wrapper, "height"));
|
|
2985
2888
|
await Transition.cancel(wrapper);
|
|
2986
2889
|
hide(content, false);
|
|
2987
|
-
const endHeight = sumBy(["marginTop", "marginBottom"], (prop) => css(content, prop)) + dimensions
|
|
2890
|
+
const endHeight = sumBy(["marginTop", "marginBottom"], (prop) => css(content, prop)) + dimensions(content).height;
|
|
2988
2891
|
const percent = currentHeight / endHeight;
|
|
2989
2892
|
duration = endHeight ? (velocity * endHeight + duration) * (show ? 1 - percent : percent) : 0;
|
|
2990
2893
|
css(wrapper, "height", currentHeight);
|
|
@@ -3000,7 +2903,7 @@
|
|
|
3000
2903
|
let frame;
|
|
3001
2904
|
(function scroll() {
|
|
3002
2905
|
frame = requestAnimationFrame(() => {
|
|
3003
|
-
const { top } = dimensions
|
|
2906
|
+
const { top } = dimensions(el);
|
|
3004
2907
|
if (top < 0) {
|
|
3005
2908
|
scrollElement.scrollTop += top;
|
|
3006
2909
|
}
|
|
@@ -3057,473 +2960,60 @@
|
|
|
3057
2960
|
);
|
|
3058
2961
|
}
|
|
3059
2962
|
|
|
3060
|
-
var Media = {
|
|
3061
|
-
props: {
|
|
3062
|
-
media: Boolean
|
|
3063
|
-
},
|
|
3064
|
-
data: {
|
|
3065
|
-
media: false
|
|
3066
|
-
},
|
|
3067
|
-
connected() {
|
|
3068
|
-
const media = toMedia(this.media, this.$el);
|
|
3069
|
-
this.matchMedia = true;
|
|
3070
|
-
if (media) {
|
|
3071
|
-
this.mediaObj = window.matchMedia(media);
|
|
3072
|
-
const handler = () => {
|
|
3073
|
-
this.matchMedia = this.mediaObj.matches;
|
|
3074
|
-
trigger(this.$el, createEvent("mediachange", false, true, [this.mediaObj]));
|
|
3075
|
-
};
|
|
3076
|
-
this.offMediaObj = on(this.mediaObj, "change", () => {
|
|
3077
|
-
handler();
|
|
3078
|
-
this.$emit("resize");
|
|
3079
|
-
});
|
|
3080
|
-
handler();
|
|
3081
|
-
}
|
|
3082
|
-
},
|
|
3083
|
-
disconnected() {
|
|
3084
|
-
var _a;
|
|
3085
|
-
(_a = this.offMediaObj) == null ? void 0 : _a.call(this);
|
|
3086
|
-
}
|
|
3087
|
-
};
|
|
3088
|
-
function toMedia(value, element) {
|
|
3089
|
-
if (isString(value)) {
|
|
3090
|
-
if (startsWith(value, "@")) {
|
|
3091
|
-
value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));
|
|
3092
|
-
} else if (isNaN(value)) {
|
|
3093
|
-
return value;
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
return value && isNumeric(value) ? `(min-width: ${value}px)` : "";
|
|
3097
|
-
}
|
|
3098
|
-
|
|
3099
|
-
function getMaxPathLength(el) {
|
|
3100
|
-
return isVisible(el) ? Math.ceil(
|
|
3101
|
-
Math.max(0, ...$$("[stroke]", el).map((stroke) => {
|
|
3102
|
-
var _a;
|
|
3103
|
-
return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
|
|
3104
|
-
}))
|
|
3105
|
-
) : 0;
|
|
3106
|
-
}
|
|
3107
|
-
|
|
3108
|
-
const props = {
|
|
3109
|
-
x: transformFn,
|
|
3110
|
-
y: transformFn,
|
|
3111
|
-
rotate: transformFn,
|
|
3112
|
-
scale: transformFn,
|
|
3113
|
-
color: colorFn,
|
|
3114
|
-
backgroundColor: colorFn,
|
|
3115
|
-
borderColor: colorFn,
|
|
3116
|
-
blur: filterFn,
|
|
3117
|
-
hue: filterFn,
|
|
3118
|
-
fopacity: filterFn,
|
|
3119
|
-
grayscale: filterFn,
|
|
3120
|
-
invert: filterFn,
|
|
3121
|
-
saturate: filterFn,
|
|
3122
|
-
sepia: filterFn,
|
|
3123
|
-
opacity: cssPropFn,
|
|
3124
|
-
stroke: strokeFn,
|
|
3125
|
-
bgx: backgroundFn,
|
|
3126
|
-
bgy: backgroundFn
|
|
3127
|
-
};
|
|
3128
|
-
const { keys } = Object;
|
|
3129
|
-
({
|
|
3130
|
-
props: fillObject(keys(props), "list"),
|
|
3131
|
-
data: fillObject(keys(props), void 0)});
|
|
3132
|
-
function transformFn(prop, el, stops) {
|
|
3133
|
-
let unit = getUnit(stops) || { x: "px", y: "px", rotate: "deg" }[prop] || "";
|
|
3134
|
-
let transformFn2;
|
|
3135
|
-
if (prop === "x" || prop === "y") {
|
|
3136
|
-
prop = `translate${ucfirst(prop)}`;
|
|
3137
|
-
transformFn2 = (stop) => toFloat(toFloat(stop).toFixed(unit === "px" ? 0 : 6));
|
|
3138
|
-
} else if (prop === "scale") {
|
|
3139
|
-
unit = "";
|
|
3140
|
-
transformFn2 = (stop) => {
|
|
3141
|
-
var _a;
|
|
3142
|
-
return getUnit([stop]) ? toPx(stop, "width", el, true) / el[`offset${((_a = stop.endsWith) == null ? void 0 : _a.call(stop, "vh")) ? "Height" : "Width"}`] : toFloat(stop);
|
|
3143
|
-
};
|
|
3144
|
-
}
|
|
3145
|
-
if (stops.length === 1) {
|
|
3146
|
-
stops.unshift(prop === "scale" ? 1 : 0);
|
|
3147
|
-
}
|
|
3148
|
-
stops = parseStops(stops, transformFn2);
|
|
3149
|
-
return (css2, percent) => {
|
|
3150
|
-
css2.transform = `${css2.transform || ""} ${prop}(${getValue(stops, percent)}${unit})`;
|
|
3151
|
-
};
|
|
3152
|
-
}
|
|
3153
|
-
function colorFn(prop, el, stops) {
|
|
3154
|
-
if (stops.length === 1) {
|
|
3155
|
-
stops.unshift(getCssValue(el, prop, ""));
|
|
3156
|
-
}
|
|
3157
|
-
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
3158
|
-
return (css2, percent) => {
|
|
3159
|
-
const [start, end, p] = getStop(stops, percent);
|
|
3160
|
-
const value = start.map((value2, i) => {
|
|
3161
|
-
value2 += p * (end[i] - value2);
|
|
3162
|
-
return i === 3 ? toFloat(value2) : parseInt(value2, 10);
|
|
3163
|
-
}).join(",");
|
|
3164
|
-
css2[prop] = `rgba(${value})`;
|
|
3165
|
-
};
|
|
3166
|
-
}
|
|
3167
|
-
function parseColor(el, color) {
|
|
3168
|
-
return getCssValue(el, "color", color).split(/[(),]/g).slice(1, -1).concat(1).slice(0, 4).map(toFloat);
|
|
3169
|
-
}
|
|
3170
|
-
function filterFn(prop, el, stops) {
|
|
3171
|
-
if (stops.length === 1) {
|
|
3172
|
-
stops.unshift(0);
|
|
3173
|
-
}
|
|
3174
|
-
const unit = getUnit(stops) || { blur: "px", hue: "deg" }[prop] || "%";
|
|
3175
|
-
prop = { fopacity: "opacity", hue: "hue-rotate" }[prop] || prop;
|
|
3176
|
-
stops = parseStops(stops);
|
|
3177
|
-
return (css2, percent) => {
|
|
3178
|
-
const value = getValue(stops, percent);
|
|
3179
|
-
css2.filter = `${css2.filter || ""} ${prop}(${value + unit})`;
|
|
3180
|
-
};
|
|
3181
|
-
}
|
|
3182
|
-
function cssPropFn(prop, el, stops) {
|
|
3183
|
-
if (stops.length === 1) {
|
|
3184
|
-
stops.unshift(getCssValue(el, prop, ""));
|
|
3185
|
-
}
|
|
3186
|
-
stops = parseStops(stops);
|
|
3187
|
-
return (css2, percent) => {
|
|
3188
|
-
css2[prop] = getValue(stops, percent);
|
|
3189
|
-
};
|
|
3190
|
-
}
|
|
3191
|
-
function strokeFn(prop, el, stops) {
|
|
3192
|
-
if (stops.length === 1) {
|
|
3193
|
-
stops.unshift(0);
|
|
3194
|
-
}
|
|
3195
|
-
const unit = getUnit(stops);
|
|
3196
|
-
const length = getMaxPathLength(el);
|
|
3197
|
-
stops = parseStops(stops.reverse(), (stop) => {
|
|
3198
|
-
stop = toFloat(stop);
|
|
3199
|
-
return unit === "%" ? stop * length / 100 : stop;
|
|
3200
|
-
});
|
|
3201
|
-
if (!stops.some(([value]) => value)) {
|
|
3202
|
-
return noop;
|
|
3203
|
-
}
|
|
3204
|
-
css(el, "strokeDasharray", length);
|
|
3205
|
-
return (css2, percent) => {
|
|
3206
|
-
css2.strokeDashoffset = getValue(stops, percent);
|
|
3207
|
-
};
|
|
3208
|
-
}
|
|
3209
|
-
function backgroundFn(prop, el, stops, props2) {
|
|
3210
|
-
if (stops.length === 1) {
|
|
3211
|
-
stops.unshift(0);
|
|
3212
|
-
}
|
|
3213
|
-
const attr = prop === "bgy" ? "height" : "width";
|
|
3214
|
-
props2[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));
|
|
3215
|
-
const bgProps = ["bgx", "bgy"].filter((prop2) => prop2 in props2);
|
|
3216
|
-
if (bgProps.length === 2 && prop === "bgx") {
|
|
3217
|
-
return noop;
|
|
3218
|
-
}
|
|
3219
|
-
if (getCssValue(el, "backgroundSize", "") === "cover") {
|
|
3220
|
-
return backgroundCoverFn(prop, el, stops, props2);
|
|
3221
|
-
}
|
|
3222
|
-
const positions = {};
|
|
3223
|
-
for (const prop2 of bgProps) {
|
|
3224
|
-
positions[prop2] = getBackgroundPos(el, prop2);
|
|
3225
|
-
}
|
|
3226
|
-
return setBackgroundPosFn(bgProps, positions, props2);
|
|
3227
|
-
}
|
|
3228
|
-
function backgroundCoverFn(prop, el, stops, props2) {
|
|
3229
|
-
const dimImage = getBackgroundImageDimensions(el);
|
|
3230
|
-
if (!dimImage.width) {
|
|
3231
|
-
return noop;
|
|
3232
|
-
}
|
|
3233
|
-
const dimEl = {
|
|
3234
|
-
width: el.offsetWidth,
|
|
3235
|
-
height: el.offsetHeight
|
|
3236
|
-
};
|
|
3237
|
-
const bgProps = ["bgx", "bgy"].filter((prop2) => prop2 in props2);
|
|
3238
|
-
const positions = {};
|
|
3239
|
-
for (const prop2 of bgProps) {
|
|
3240
|
-
const values = props2[prop2].map(([value]) => value);
|
|
3241
|
-
const min = Math.min(...values);
|
|
3242
|
-
const max = Math.max(...values);
|
|
3243
|
-
const down = values.indexOf(min) < values.indexOf(max);
|
|
3244
|
-
const diff = max - min;
|
|
3245
|
-
positions[prop2] = `${(down ? -diff : 0) - (down ? min : max)}px`;
|
|
3246
|
-
dimEl[prop2 === "bgy" ? "height" : "width"] += diff;
|
|
3247
|
-
}
|
|
3248
|
-
const dim = Dimensions.cover(dimImage, dimEl);
|
|
3249
|
-
for (const prop2 of bgProps) {
|
|
3250
|
-
const attr = prop2 === "bgy" ? "height" : "width";
|
|
3251
|
-
const overflow = dim[attr] - dimEl[attr];
|
|
3252
|
-
positions[prop2] = `max(${getBackgroundPos(el, prop2)},-${overflow}px) + ${positions[prop2]}`;
|
|
3253
|
-
}
|
|
3254
|
-
const fn = setBackgroundPosFn(bgProps, positions, props2);
|
|
3255
|
-
return (css2, percent) => {
|
|
3256
|
-
fn(css2, percent);
|
|
3257
|
-
css2.backgroundSize = `${dim.width}px ${dim.height}px`;
|
|
3258
|
-
css2.backgroundRepeat = "no-repeat";
|
|
3259
|
-
};
|
|
3260
|
-
}
|
|
3261
|
-
function getBackgroundPos(el, prop) {
|
|
3262
|
-
return getCssValue(el, `background-position-${prop.slice(-1)}`, "");
|
|
3263
|
-
}
|
|
3264
|
-
function setBackgroundPosFn(bgProps, positions, props2) {
|
|
3265
|
-
return function(css2, percent) {
|
|
3266
|
-
for (const prop of bgProps) {
|
|
3267
|
-
const value = getValue(props2[prop], percent);
|
|
3268
|
-
css2[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;
|
|
3269
|
-
}
|
|
3270
|
-
};
|
|
3271
|
-
}
|
|
3272
|
-
const loading = {};
|
|
3273
|
-
const dimensions = {};
|
|
3274
|
-
function getBackgroundImageDimensions(el) {
|
|
3275
|
-
const src = css(el, "backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/, "$1");
|
|
3276
|
-
if (dimensions[src]) {
|
|
3277
|
-
return dimensions[src];
|
|
3278
|
-
}
|
|
3279
|
-
const image = new Image();
|
|
3280
|
-
if (src) {
|
|
3281
|
-
image.src = src;
|
|
3282
|
-
if (!image.naturalWidth && !loading[src]) {
|
|
3283
|
-
once(image, "error load", () => {
|
|
3284
|
-
dimensions[src] = toDimensions(image);
|
|
3285
|
-
trigger(el, createEvent("load", false));
|
|
3286
|
-
});
|
|
3287
|
-
loading[src] = true;
|
|
3288
|
-
return toDimensions(image);
|
|
3289
|
-
}
|
|
3290
|
-
}
|
|
3291
|
-
return dimensions[src] = toDimensions(image);
|
|
3292
|
-
}
|
|
3293
|
-
function toDimensions(image) {
|
|
3294
|
-
return {
|
|
3295
|
-
width: image.naturalWidth,
|
|
3296
|
-
height: image.naturalHeight
|
|
3297
|
-
};
|
|
3298
|
-
}
|
|
3299
|
-
function parseStops(stops, fn = toFloat) {
|
|
3300
|
-
const result = [];
|
|
3301
|
-
const { length } = stops;
|
|
3302
|
-
let nullIndex = 0;
|
|
3303
|
-
for (let i = 0; i < length; i++) {
|
|
3304
|
-
let [value, percent] = isString(stops[i]) ? stops[i].trim().split(/ (?![^(]*\))/) : [stops[i]];
|
|
3305
|
-
value = fn(value);
|
|
3306
|
-
percent = percent ? toFloat(percent) / 100 : null;
|
|
3307
|
-
if (i === 0) {
|
|
3308
|
-
if (percent === null) {
|
|
3309
|
-
percent = 0;
|
|
3310
|
-
} else if (percent) {
|
|
3311
|
-
result.push([value, 0]);
|
|
3312
|
-
}
|
|
3313
|
-
} else if (i === length - 1) {
|
|
3314
|
-
if (percent === null) {
|
|
3315
|
-
percent = 1;
|
|
3316
|
-
} else if (percent !== 1) {
|
|
3317
|
-
result.push([value, percent]);
|
|
3318
|
-
percent = 1;
|
|
3319
|
-
}
|
|
3320
|
-
}
|
|
3321
|
-
result.push([value, percent]);
|
|
3322
|
-
if (percent === null) {
|
|
3323
|
-
nullIndex++;
|
|
3324
|
-
} else if (nullIndex) {
|
|
3325
|
-
const leftPercent = result[i - nullIndex - 1][1];
|
|
3326
|
-
const p = (percent - leftPercent) / (nullIndex + 1);
|
|
3327
|
-
for (let j = nullIndex; j > 0; j--) {
|
|
3328
|
-
result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
|
|
3329
|
-
}
|
|
3330
|
-
nullIndex = 0;
|
|
3331
|
-
}
|
|
3332
|
-
}
|
|
3333
|
-
return result;
|
|
3334
|
-
}
|
|
3335
|
-
function getStop(stops, percent) {
|
|
3336
|
-
const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;
|
|
3337
|
-
return [
|
|
3338
|
-
stops[index - 1][0],
|
|
3339
|
-
stops[index][0],
|
|
3340
|
-
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])
|
|
3341
|
-
];
|
|
3342
|
-
}
|
|
3343
|
-
function getValue(stops, percent) {
|
|
3344
|
-
const [start, end, p] = getStop(stops, percent);
|
|
3345
|
-
return start + (end - start) * p;
|
|
3346
|
-
}
|
|
3347
|
-
const unitRe = /^-?\d+(?:\.\d+)?(\S+)?/;
|
|
3348
|
-
function getUnit(stops, defaultUnit) {
|
|
3349
|
-
var _a;
|
|
3350
|
-
for (const stop of stops) {
|
|
3351
|
-
const match = (_a = stop.match) == null ? void 0 : _a.call(stop, unitRe);
|
|
3352
|
-
if (match) {
|
|
3353
|
-
return match[1];
|
|
3354
|
-
}
|
|
3355
|
-
}
|
|
3356
|
-
return defaultUnit;
|
|
3357
|
-
}
|
|
3358
|
-
function getCssValue(el, prop, value) {
|
|
3359
|
-
const prev = el.style[prop];
|
|
3360
|
-
const val = css(css(el, prop, value), prop);
|
|
3361
|
-
el.style[prop] = prev;
|
|
3362
|
-
return val;
|
|
3363
|
-
}
|
|
3364
|
-
function fillObject(keys2, value) {
|
|
3365
|
-
return Object.fromEntries(keys2.map((prop) => [prop, value]));
|
|
3366
|
-
}
|
|
3367
|
-
function ease(percent, easing) {
|
|
3368
|
-
return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);
|
|
3369
|
-
}
|
|
3370
|
-
|
|
3371
|
-
var ScrollDriven = {
|
|
3372
|
-
props: {
|
|
3373
|
-
parallaxTarget: Boolean,
|
|
3374
|
-
parallaxStart: String,
|
|
3375
|
-
parallaxEnd: String,
|
|
3376
|
-
parallaxEasing: Number
|
|
3377
|
-
},
|
|
3378
|
-
data: {
|
|
3379
|
-
parallaxTarget: false,
|
|
3380
|
-
parallaxStart: 0,
|
|
3381
|
-
parallaxEnd: 0,
|
|
3382
|
-
parallaxEasing: 0
|
|
3383
|
-
},
|
|
3384
|
-
observe: [
|
|
3385
|
-
resize({
|
|
3386
|
-
target: ({ $el, parallaxTarget }) => [$el, parallaxTarget],
|
|
3387
|
-
filter: ({ parallax }) => parallax
|
|
3388
|
-
}),
|
|
3389
|
-
scroll$1({ filter: ({ parallax }) => parallax })
|
|
3390
|
-
],
|
|
3391
|
-
computed: {
|
|
3392
|
-
parallaxTargetFallback: ($props, $el) => $el,
|
|
3393
|
-
parallaxTarget({ parallaxTarget }, $el) {
|
|
3394
|
-
return parallaxTarget && query(parallaxTarget, $el) || this.parallaxTargetFallback;
|
|
3395
|
-
}
|
|
3396
|
-
},
|
|
3397
|
-
update: {
|
|
3398
|
-
read() {
|
|
3399
|
-
if (!this.parallax) {
|
|
3400
|
-
return;
|
|
3401
|
-
}
|
|
3402
|
-
const target = this.parallaxTarget;
|
|
3403
|
-
if (!target) {
|
|
3404
|
-
return;
|
|
3405
|
-
}
|
|
3406
|
-
const start = toPx(this.parallaxStart, "height", target, true);
|
|
3407
|
-
const end = toPx(this.parallaxEnd, "height", target, true);
|
|
3408
|
-
const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);
|
|
3409
|
-
return { percent };
|
|
3410
|
-
},
|
|
3411
|
-
events: ["scroll", "resize"]
|
|
3412
|
-
}
|
|
3413
|
-
};
|
|
3414
|
-
|
|
3415
|
-
const loopKey = /* @__PURE__ */ Symbol();
|
|
3416
2963
|
var Video = {
|
|
3417
|
-
mixins: [Media, ScrollDriven],
|
|
3418
2964
|
args: "autoplay",
|
|
3419
2965
|
props: {
|
|
3420
2966
|
automute: Boolean,
|
|
3421
2967
|
autoplay: Boolean,
|
|
3422
2968
|
restart: Boolean,
|
|
3423
|
-
|
|
3424
|
-
inviewQueued: Number,
|
|
3425
|
-
hoverTarget: Boolean,
|
|
3426
|
-
hoverRewind: Number,
|
|
3427
|
-
reducedMotionTime: Number
|
|
2969
|
+
hoverTarget: Boolean
|
|
3428
2970
|
},
|
|
3429
2971
|
data: {
|
|
3430
2972
|
automute: false,
|
|
3431
2973
|
autoplay: true,
|
|
3432
2974
|
restart: false,
|
|
3433
|
-
|
|
3434
|
-
inviewQueued: 0,
|
|
3435
|
-
hoverTarget: false,
|
|
3436
|
-
hoverRewind: 0,
|
|
3437
|
-
reducedMotionTime: 0,
|
|
3438
|
-
media: "(prefers-reduced-motion: reduce)"
|
|
2975
|
+
hoverTarget: false
|
|
3439
2976
|
},
|
|
3440
2977
|
beforeConnect() {
|
|
3441
|
-
const isVideo =
|
|
3442
|
-
this.
|
|
3443
|
-
if (this.interactionDriven && !isVideo) {
|
|
3444
|
-
this.interactionDriven = this.autoplay = false;
|
|
3445
|
-
}
|
|
3446
|
-
this.restart = isVideo && this.restart;
|
|
3447
|
-
this.parallax = this.autoplay === "parallax";
|
|
3448
|
-
this.inviewQueued = isVideo && this.autoplay === "inview" && this.inviewQueued;
|
|
3449
|
-
if (this.inviewQueued) {
|
|
3450
|
-
this.$el[loopKey] = this.$el.loop;
|
|
3451
|
-
this.$el.loop = false;
|
|
3452
|
-
}
|
|
3453
|
-
if (["hover", "inview"].includes(this.autoplay) && isVideo && !hasAttr(this.$el, "preload")) {
|
|
2978
|
+
const isVideo = isTag(this.$el, "video");
|
|
2979
|
+
if (this.autoplay === "inview" && isVideo && !hasAttr(this.$el, "preload")) {
|
|
3454
2980
|
this.$el.preload = "none";
|
|
3455
2981
|
}
|
|
3456
2982
|
if (!isVideo && !hasAttr(this.$el, "allow")) {
|
|
3457
2983
|
this.$el.allow = "autoplay";
|
|
3458
2984
|
}
|
|
3459
2985
|
if (this.autoplay === "hover") {
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
2986
|
+
if (isVideo) {
|
|
2987
|
+
this.$el.tabIndex = 0;
|
|
2988
|
+
} else {
|
|
2989
|
+
this.autoplay = true;
|
|
3463
2990
|
}
|
|
3464
2991
|
}
|
|
3465
2992
|
if (this.automute || hasAttr(this.$el, "muted")) {
|
|
3466
2993
|
mute(this.$el);
|
|
3467
2994
|
}
|
|
3468
2995
|
},
|
|
3469
|
-
connected() {
|
|
3470
|
-
if (!this.$el.controls && !this.$el.poster && (this.interactionDriven || this.inviewQueued)) {
|
|
3471
|
-
this.cancelPreview = preview(this.$el);
|
|
3472
|
-
}
|
|
3473
|
-
},
|
|
3474
|
-
disconnected() {
|
|
3475
|
-
var _a, _b;
|
|
3476
|
-
(_a = this._reverseAbort) == null ? void 0 : _a.abort();
|
|
3477
|
-
(_b = this.cancelPreview) == null ? void 0 : _b.call(this);
|
|
3478
|
-
this.cancelPreview = null;
|
|
3479
|
-
if (this.$el[loopKey]) {
|
|
3480
|
-
this.$el.loop = true;
|
|
3481
|
-
}
|
|
3482
|
-
queue.delete(this.$el);
|
|
3483
|
-
},
|
|
3484
2996
|
events: [
|
|
3485
2997
|
{
|
|
3486
2998
|
name: `${pointerEnter} focusin`,
|
|
3487
|
-
el: ({ hoverTarget }) => hoverTarget,
|
|
2999
|
+
el: ({ hoverTarget, $el }) => query(hoverTarget, $el) || $el,
|
|
3488
3000
|
filter: ({ autoplay }) => autoplay === "hover",
|
|
3489
3001
|
handler(e) {
|
|
3490
|
-
var _a;
|
|
3491
|
-
(_a = this._reverseAbort) == null ? void 0 : _a.abort();
|
|
3492
3002
|
if (!isTouch(e) || !isPlaying(this.$el)) {
|
|
3493
|
-
|
|
3003
|
+
play(this.$el);
|
|
3494
3004
|
} else {
|
|
3495
|
-
this.
|
|
3005
|
+
pauseHover(this.$el, this.restart);
|
|
3496
3006
|
}
|
|
3497
3007
|
}
|
|
3498
3008
|
},
|
|
3499
3009
|
{
|
|
3500
3010
|
name: `${pointerLeave} focusout`,
|
|
3501
|
-
el: ({ hoverTarget }) => hoverTarget,
|
|
3011
|
+
el: ({ hoverTarget, $el }) => query(hoverTarget, $el) || $el,
|
|
3502
3012
|
filter: ({ autoplay }) => autoplay === "hover",
|
|
3503
3013
|
handler(e) {
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
(_a = this._reverseAbort) == null ? void 0 : _a.abort();
|
|
3507
|
-
this.pause();
|
|
3508
|
-
this._reverseAbort = playReverse(this.$el, this.hoverRewind);
|
|
3509
|
-
}
|
|
3510
|
-
}
|
|
3511
|
-
},
|
|
3512
|
-
{
|
|
3513
|
-
name: "loadedmetadata durationchange",
|
|
3514
|
-
filter: ({ parallax }) => parallax,
|
|
3515
|
-
handler() {
|
|
3516
|
-
this.$emit("resize");
|
|
3517
|
-
}
|
|
3518
|
-
},
|
|
3519
|
-
{
|
|
3520
|
-
name: "error pause ended",
|
|
3521
|
-
filter: ({ inviewQueued }) => inviewQueued,
|
|
3522
|
-
handler(e) {
|
|
3523
|
-
if (e.type === "error" || e.type === "ended" && !this.$el[loopKey]) {
|
|
3524
|
-
queue.delete(this.$el);
|
|
3014
|
+
if (!isTouch(e)) {
|
|
3015
|
+
pauseHover(this.$el, this.restart);
|
|
3525
3016
|
}
|
|
3526
|
-
playNextQueued();
|
|
3527
3017
|
}
|
|
3528
3018
|
}
|
|
3529
3019
|
],
|
|
@@ -3536,144 +3026,33 @@
|
|
|
3536
3026
|
}
|
|
3537
3027
|
}),
|
|
3538
3028
|
intersection({
|
|
3539
|
-
filter: ({ $el,
|
|
3540
|
-
handler([{ isIntersecting }]) {
|
|
3029
|
+
filter: ({ $el, autoplay }) => autoplay !== "hover" && $el.preload !== "none",
|
|
3030
|
+
handler([{ isIntersecting, target }]) {
|
|
3541
3031
|
if (!document.fullscreenElement) {
|
|
3542
3032
|
if (isIntersecting) {
|
|
3543
3033
|
if (this.autoplay) {
|
|
3544
|
-
|
|
3034
|
+
play(target);
|
|
3545
3035
|
}
|
|
3546
3036
|
} else {
|
|
3547
|
-
this.
|
|
3037
|
+
pauseHover(target, this.restart);
|
|
3548
3038
|
}
|
|
3549
3039
|
}
|
|
3550
3040
|
},
|
|
3551
3041
|
args: { intersecting: false },
|
|
3552
|
-
options: ({ $el, autoplay
|
|
3553
|
-
root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
|
|
3554
|
-
rootMargin: autoplay === "inview" ? inviewMargin : "0px"
|
|
3042
|
+
options: ({ $el, autoplay }) => ({
|
|
3043
|
+
root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
|
|
3555
3044
|
})
|
|
3556
3045
|
})
|
|
3557
|
-
]
|
|
3558
|
-
update: {
|
|
3559
|
-
write({ percent }) {
|
|
3560
|
-
if (!this.parallax) {
|
|
3561
|
-
return;
|
|
3562
|
-
}
|
|
3563
|
-
const { duration, seeking } = this.$el;
|
|
3564
|
-
if (!isNaN(duration) && !seeking) {
|
|
3565
|
-
const value = this.matchMedia ? this.reducedMotionTime : percent * duration;
|
|
3566
|
-
setCurrentTime(this.$el, value);
|
|
3567
|
-
}
|
|
3568
|
-
},
|
|
3569
|
-
events: ["scroll", "resize"]
|
|
3570
|
-
},
|
|
3571
|
-
methods: {
|
|
3572
|
-
play() {
|
|
3573
|
-
var _a;
|
|
3574
|
-
if (this.matchMedia) {
|
|
3575
|
-
this.pause();
|
|
3576
|
-
if (this.isVideo) {
|
|
3577
|
-
setCurrentTime(this.$el, this.reducedMotionTime);
|
|
3578
|
-
}
|
|
3579
|
-
} else if (this.inviewQueued) {
|
|
3580
|
-
queue.set(this.$el, this.inviewQueued);
|
|
3581
|
-
playNextQueued();
|
|
3582
|
-
} else {
|
|
3583
|
-
(_a = this.cancelPreview) == null ? void 0 : _a.call(this);
|
|
3584
|
-
play(this.$el);
|
|
3585
|
-
}
|
|
3586
|
-
},
|
|
3587
|
-
pause() {
|
|
3588
|
-
pause(this.$el);
|
|
3589
|
-
queue.delete(this.$el);
|
|
3590
|
-
if (this.restart) {
|
|
3591
|
-
setCurrentTime(this.$el, 0);
|
|
3592
|
-
}
|
|
3593
|
-
}
|
|
3594
|
-
}
|
|
3046
|
+
]
|
|
3595
3047
|
};
|
|
3596
|
-
function setCurrentTime(videoEl, time) {
|
|
3597
|
-
if (videoEl.currentTime !== time) {
|
|
3598
|
-
videoEl.currentTime = time;
|
|
3599
|
-
}
|
|
3600
|
-
}
|
|
3601
3048
|
function isPlaying(videoEl) {
|
|
3602
3049
|
return !videoEl.paused && !videoEl.ended;
|
|
3603
3050
|
}
|
|
3604
|
-
function
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
let frame2;
|
|
3609
|
-
const pausePreview = () => {
|
|
3610
|
-
disconnect();
|
|
3611
|
-
pause($el);
|
|
3612
|
-
};
|
|
3613
|
-
const observer = observeIntersection($el, () => {
|
|
3614
|
-
observer.disconnect();
|
|
3615
|
-
frame2 = $el.requestVideoFrameCallback(pausePreview);
|
|
3616
|
-
play($el);
|
|
3617
|
-
});
|
|
3618
|
-
const disconnect = () => {
|
|
3619
|
-
observer.disconnect();
|
|
3620
|
-
$el.cancelVideoFrameCallback(frame2);
|
|
3621
|
-
};
|
|
3622
|
-
return disconnect;
|
|
3623
|
-
}
|
|
3624
|
-
const queue = /* @__PURE__ */ new Map();
|
|
3625
|
-
const played = /* @__PURE__ */ new WeakMap();
|
|
3626
|
-
let frame;
|
|
3627
|
-
function playNextQueued() {
|
|
3628
|
-
cancelAnimationFrame(frame);
|
|
3629
|
-
frame = requestAnimationFrame(() => {
|
|
3630
|
-
const getPlayed = (el) => {
|
|
3631
|
-
var _a;
|
|
3632
|
-
return (_a = played.get(el)) != null ? _a : 0;
|
|
3633
|
-
};
|
|
3634
|
-
const videos = shuffle(queue.keys()).sort((a, b) => getPlayed(a) - getPlayed(b));
|
|
3635
|
-
let active = videos.filter(isPlaying).length;
|
|
3636
|
-
for (const el of videos) {
|
|
3637
|
-
const maxQueued = queue.get(el);
|
|
3638
|
-
if (isPlaying(el) || active / queue.size >= maxQueued) {
|
|
3639
|
-
continue;
|
|
3640
|
-
}
|
|
3641
|
-
played.set(el, getPlayed(el) + 1);
|
|
3642
|
-
play(el);
|
|
3643
|
-
active++;
|
|
3644
|
-
}
|
|
3645
|
-
});
|
|
3646
|
-
}
|
|
3647
|
-
function shuffle(array) {
|
|
3648
|
-
array = [...array];
|
|
3649
|
-
for (let i = array.length - 1; i > 0; i--) {
|
|
3650
|
-
let j = Math.floor(Math.random() * (i + 1));
|
|
3651
|
-
[array[i], array[j]] = [array[j], array[i]];
|
|
3051
|
+
function pauseHover(el, restart) {
|
|
3052
|
+
pause(el);
|
|
3053
|
+
if (restart && isTag(el, "video")) {
|
|
3054
|
+
el.currentTime = 0;
|
|
3652
3055
|
}
|
|
3653
|
-
return array;
|
|
3654
|
-
}
|
|
3655
|
-
function playReverse(el, playbackRate) {
|
|
3656
|
-
const start = el.currentTime;
|
|
3657
|
-
if (isNaN(start) || !playbackRate) {
|
|
3658
|
-
return;
|
|
3659
|
-
}
|
|
3660
|
-
playbackRate *= Math.max(1, start / 10 + 0.5);
|
|
3661
|
-
const controller = new AbortController();
|
|
3662
|
-
const time = Date.now();
|
|
3663
|
-
(function next() {
|
|
3664
|
-
requestAnimationFrame(() => {
|
|
3665
|
-
if (controller.signal.aborted) {
|
|
3666
|
-
return;
|
|
3667
|
-
}
|
|
3668
|
-
if (!el.seeking) {
|
|
3669
|
-
el.currentTime = Math.max(0, start - (Date.now() - time) * playbackRate / 1e3);
|
|
3670
|
-
}
|
|
3671
|
-
if (el.currentTime > 0) {
|
|
3672
|
-
next();
|
|
3673
|
-
}
|
|
3674
|
-
});
|
|
3675
|
-
})();
|
|
3676
|
-
return controller;
|
|
3677
3056
|
}
|
|
3678
3057
|
|
|
3679
3058
|
var cover = {
|
|
@@ -3749,7 +3128,7 @@
|
|
|
3749
3128
|
inset: false
|
|
3750
3129
|
},
|
|
3751
3130
|
connected() {
|
|
3752
|
-
this.pos =
|
|
3131
|
+
this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
|
|
3753
3132
|
[this.dir, this.align] = this.pos;
|
|
3754
3133
|
this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
|
|
3755
3134
|
},
|
|
@@ -3769,7 +3148,7 @@
|
|
|
3769
3148
|
placement.reverse();
|
|
3770
3149
|
}
|
|
3771
3150
|
const restoreScrollPosition = storeScrollPosition(element);
|
|
3772
|
-
const elDim = dimensions
|
|
3151
|
+
const elDim = dimensions(element);
|
|
3773
3152
|
css(element, { top: -elDim.height, left: -elDim.width });
|
|
3774
3153
|
positionAt(element, target, {
|
|
3775
3154
|
attach,
|
|
@@ -4136,7 +3515,6 @@
|
|
|
4136
3515
|
css(this.$el, this._style);
|
|
4137
3516
|
this.$el.hidden = true;
|
|
4138
3517
|
const viewports = this.target.map((target) => getViewport$1(this.$el, target));
|
|
4139
|
-
const boundaryOffsets = this.boundary.map((el) => offset(el));
|
|
4140
3518
|
const viewportOffset = this.getViewportOffset(this.$el);
|
|
4141
3519
|
const dirs = [
|
|
4142
3520
|
[0, ["x", "width", "left", "right"]],
|
|
@@ -4146,7 +3524,7 @@
|
|
|
4146
3524
|
if (this.axis !== axis && includes([axis, true], this.stretch)) {
|
|
4147
3525
|
css(this.$el, {
|
|
4148
3526
|
[prop]: Math.min(
|
|
4149
|
-
|
|
3527
|
+
offset(this.boundary[i])[prop],
|
|
4150
3528
|
viewports[i][prop] - 2 * viewportOffset
|
|
4151
3529
|
),
|
|
4152
3530
|
[`overflow-${axis}`]: "auto"
|
|
@@ -4168,10 +3546,10 @@
|
|
|
4168
3546
|
const elOffset = offset(this.$el);
|
|
4169
3547
|
css(this.$el, {
|
|
4170
3548
|
[prop]: (targetOffset[start] > elOffset[start] ? targetOffset[this.inset ? end : start] - Math.max(
|
|
4171
|
-
|
|
3549
|
+
offset(this.boundary[i])[start],
|
|
4172
3550
|
viewports[i][start] + viewportOffset
|
|
4173
3551
|
) : Math.min(
|
|
4174
|
-
|
|
3552
|
+
offset(this.boundary[i])[end],
|
|
4175
3553
|
viewports[i][end] - viewportOffset
|
|
4176
3554
|
) - targetOffset[this.inset ? start : end]) - positionOffset,
|
|
4177
3555
|
[`overflow-${axis}`]: "auto"
|
|
@@ -4427,9 +3805,7 @@
|
|
|
4427
3805
|
const drop = this.getDropdown(target);
|
|
4428
3806
|
const adjustHeight = () => {
|
|
4429
3807
|
const maxBottom = Math.max(
|
|
4430
|
-
...
|
|
4431
|
-
(el) => offset(el).bottom
|
|
4432
|
-
)
|
|
3808
|
+
...parents(target, `.${this.clsDrop}`).concat(target).map((el) => offset(el).bottom)
|
|
4433
3809
|
);
|
|
4434
3810
|
offset(this.dropbar, {
|
|
4435
3811
|
left: offset(this.dropbar).left,
|
|
@@ -4600,12 +3976,10 @@
|
|
|
4600
3976
|
var Margin = {
|
|
4601
3977
|
props: {
|
|
4602
3978
|
margin: String,
|
|
4603
|
-
firstRow: Boolean,
|
|
4604
3979
|
firstColumn: Boolean
|
|
4605
3980
|
},
|
|
4606
3981
|
data: {
|
|
4607
3982
|
margin: "uk-margin-small-top",
|
|
4608
|
-
firstRow: false,
|
|
4609
3983
|
firstColumn: "uk-first-column"
|
|
4610
3984
|
},
|
|
4611
3985
|
observe: [
|
|
@@ -4645,7 +4019,6 @@
|
|
|
4645
4019
|
for (const row of rows) {
|
|
4646
4020
|
for (const el of row) {
|
|
4647
4021
|
toggleClass(el, this.margin, rows[0] !== row);
|
|
4648
|
-
toggleClass(el, this.firstRow, rows[0] === row);
|
|
4649
4022
|
toggleClass(el, this.firstColumn, row[isRtl ? row.length - 1 : 0] === el);
|
|
4650
4023
|
}
|
|
4651
4024
|
}
|
|
@@ -4717,8 +4090,7 @@
|
|
|
4717
4090
|
parallaxJustify: Boolean
|
|
4718
4091
|
},
|
|
4719
4092
|
data: {
|
|
4720
|
-
margin: "",
|
|
4721
|
-
firstRow: "uk-first-row",
|
|
4093
|
+
margin: "uk-grid-margin",
|
|
4722
4094
|
clsStack: "uk-grid-stack",
|
|
4723
4095
|
masonry: false,
|
|
4724
4096
|
parallax: 0,
|
|
@@ -4740,14 +4112,14 @@
|
|
|
4740
4112
|
{
|
|
4741
4113
|
read(data) {
|
|
4742
4114
|
const { rows } = data;
|
|
4743
|
-
let { masonry, parallax, parallaxJustify } = this;
|
|
4115
|
+
let { masonry, parallax, parallaxJustify, margin } = this;
|
|
4744
4116
|
parallax = Math.max(0, toPx(parallax));
|
|
4745
4117
|
if (!(masonry || parallax || parallaxJustify) || positionedAbsolute(rows) || rows[0].some(
|
|
4746
4118
|
(el, i) => rows.some((row) => row[i] && row[i].offsetWidth !== el.offsetWidth)
|
|
4747
4119
|
)) {
|
|
4748
4120
|
return data.translates = data.scrollColumns = false;
|
|
4749
4121
|
}
|
|
4750
|
-
let gutter =
|
|
4122
|
+
let gutter = getGutter(rows, margin);
|
|
4751
4123
|
let columns;
|
|
4752
4124
|
let translates;
|
|
4753
4125
|
if (masonry) {
|
|
@@ -4840,6 +4212,10 @@
|
|
|
4840
4212
|
}
|
|
4841
4213
|
return [columns, translates];
|
|
4842
4214
|
}
|
|
4215
|
+
function getGutter(rows, cls) {
|
|
4216
|
+
const node = rows.flat().find((el) => hasClass(el, cls));
|
|
4217
|
+
return toFloat(node ? css(node, "marginTop") : css(rows[0][0], "paddingLeft"));
|
|
4218
|
+
}
|
|
4843
4219
|
function transpose(rows) {
|
|
4844
4220
|
const columns = [];
|
|
4845
4221
|
for (const row of rows) {
|
|
@@ -4911,7 +4287,7 @@
|
|
|
4911
4287
|
css(element, "display", "block", "important");
|
|
4912
4288
|
}
|
|
4913
4289
|
css(element, "minHeight", "");
|
|
4914
|
-
const height = dimensions
|
|
4290
|
+
const height = dimensions(element).height - boxModelAdjust(element, "height", "content-box");
|
|
4915
4291
|
css(element, style);
|
|
4916
4292
|
return height;
|
|
4917
4293
|
}
|
|
@@ -4942,6 +4318,45 @@
|
|
|
4942
4318
|
}
|
|
4943
4319
|
};
|
|
4944
4320
|
|
|
4321
|
+
var Media = {
|
|
4322
|
+
props: {
|
|
4323
|
+
media: Boolean
|
|
4324
|
+
},
|
|
4325
|
+
data: {
|
|
4326
|
+
media: false
|
|
4327
|
+
},
|
|
4328
|
+
connected() {
|
|
4329
|
+
const media = toMedia(this.media, this.$el);
|
|
4330
|
+
this.matchMedia = true;
|
|
4331
|
+
if (media) {
|
|
4332
|
+
this.mediaObj = window.matchMedia(media);
|
|
4333
|
+
const handler = () => {
|
|
4334
|
+
this.matchMedia = this.mediaObj.matches;
|
|
4335
|
+
trigger(this.$el, createEvent("mediachange", false, true, [this.mediaObj]));
|
|
4336
|
+
};
|
|
4337
|
+
this.offMediaObj = on(this.mediaObj, "change", () => {
|
|
4338
|
+
handler();
|
|
4339
|
+
this.$emit("resize");
|
|
4340
|
+
});
|
|
4341
|
+
handler();
|
|
4342
|
+
}
|
|
4343
|
+
},
|
|
4344
|
+
disconnected() {
|
|
4345
|
+
var _a;
|
|
4346
|
+
(_a = this.offMediaObj) == null ? void 0 : _a.call(this);
|
|
4347
|
+
}
|
|
4348
|
+
};
|
|
4349
|
+
function toMedia(value, element) {
|
|
4350
|
+
if (isString(value)) {
|
|
4351
|
+
if (startsWith(value, "@")) {
|
|
4352
|
+
value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));
|
|
4353
|
+
} else if (isNaN(value)) {
|
|
4354
|
+
return value;
|
|
4355
|
+
}
|
|
4356
|
+
}
|
|
4357
|
+
return value && isNumeric(value) ? `(min-width: ${value}px)` : "";
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4945
4360
|
var heightViewport = {
|
|
4946
4361
|
mixins: [Media],
|
|
4947
4362
|
props: {
|
|
@@ -4980,7 +4395,7 @@
|
|
|
4980
4395
|
const isScrollingElement = scrollingElement === scrollElement || body === scrollElement;
|
|
4981
4396
|
let minHeight = `calc(${isScrollingElement ? "100vh" : `${viewportHeight}px`}`;
|
|
4982
4397
|
if (this.expand) {
|
|
4983
|
-
const diff = dimensions
|
|
4398
|
+
const diff = dimensions(scrollElement).height - dimensions(this.$el).height;
|
|
4984
4399
|
minHeight += ` - ${diff}px`;
|
|
4985
4400
|
} else {
|
|
4986
4401
|
if (this.offsetTop) {
|
|
@@ -4993,13 +4408,13 @@
|
|
|
4993
4408
|
}
|
|
4994
4409
|
}
|
|
4995
4410
|
if (this.offsetBottom === true) {
|
|
4996
|
-
minHeight += ` - ${dimensions
|
|
4411
|
+
minHeight += ` - ${dimensions(this.$el.nextElementSibling).height}px`;
|
|
4997
4412
|
} else if (isNumeric(this.offsetBottom)) {
|
|
4998
4413
|
minHeight += ` - ${this.offsetBottom}vh`;
|
|
4999
4414
|
} else if (this.offsetBottom && endsWith(this.offsetBottom, "px")) {
|
|
5000
4415
|
minHeight += ` - ${toFloat(this.offsetBottom)}px`;
|
|
5001
4416
|
} else if (isString(this.offsetBottom)) {
|
|
5002
|
-
minHeight += ` - ${dimensions
|
|
4417
|
+
minHeight += ` - ${dimensions(query(this.offsetBottom, this.$el)).height}px`;
|
|
5003
4418
|
}
|
|
5004
4419
|
}
|
|
5005
4420
|
minHeight += `${box ? ` - ${box}px` : ""})`;
|
|
@@ -5547,8 +4962,8 @@
|
|
|
5547
4962
|
}
|
|
5548
4963
|
};
|
|
5549
4964
|
function findTargetColor(target) {
|
|
5550
|
-
const dim = dimensions
|
|
5551
|
-
const viewport = dimensions
|
|
4965
|
+
const dim = dimensions(target);
|
|
4966
|
+
const viewport = dimensions(window);
|
|
5552
4967
|
if (!intersectRect(dim, viewport)) {
|
|
5553
4968
|
return false;
|
|
5554
4969
|
}
|
|
@@ -5812,7 +5227,7 @@
|
|
|
5812
5227
|
if (last(active) !== modal || modal.$el.contains(e.target)) {
|
|
5813
5228
|
return;
|
|
5814
5229
|
}
|
|
5815
|
-
const { left, top, width, height } = dimensions
|
|
5230
|
+
const { left, top, width, height } = dimensions(e.target);
|
|
5816
5231
|
const topEl = document.elementFromPoint(left + width / 2, top + height / 2);
|
|
5817
5232
|
if (topEl && (e.target.contains(topEl) || topEl.contains(e.target))) {
|
|
5818
5233
|
return;
|
|
@@ -6179,7 +5594,7 @@
|
|
|
6179
5594
|
return {
|
|
6180
5595
|
max: Math.max(
|
|
6181
5596
|
this.minHeight,
|
|
6182
|
-
height(this.container) - (dimensions
|
|
5597
|
+
height(this.container) - (dimensions(this.content).height - height(this.$el))
|
|
6183
5598
|
)
|
|
6184
5599
|
};
|
|
6185
5600
|
},
|
|
@@ -6190,7 +5605,7 @@
|
|
|
6190
5605
|
}
|
|
6191
5606
|
};
|
|
6192
5607
|
function height(el) {
|
|
6193
|
-
return dimensions
|
|
5608
|
+
return dimensions(el).height - boxModelAdjust(el, "height", css(el, "boxSizing"));
|
|
6194
5609
|
}
|
|
6195
5610
|
|
|
6196
5611
|
var overflowFade = {
|
|
@@ -6314,6 +5729,11 @@
|
|
|
6314
5729
|
el = el && $(el) || document.body;
|
|
6315
5730
|
if (trigger(this.$el, "beforescroll", [this, el])) {
|
|
6316
5731
|
await scrollIntoView(el, { offset: this.offset });
|
|
5732
|
+
if (!isFocusable(el)) {
|
|
5733
|
+
attr(el, "tabindex", "-1");
|
|
5734
|
+
once(el, "blur", () => attr(el, "tabindex", null));
|
|
5735
|
+
}
|
|
5736
|
+
el.focus({ preventScroll: true });
|
|
6317
5737
|
trigger(this.$el, "scrolled", [this, el]);
|
|
6318
5738
|
}
|
|
6319
5739
|
}
|
|
@@ -6505,7 +5925,7 @@
|
|
|
6505
5925
|
if (scrollTop >= max) {
|
|
6506
5926
|
active = length - 1;
|
|
6507
5927
|
} else {
|
|
6508
|
-
const offsetBy = this.offset + dimensions
|
|
5928
|
+
const offsetBy = this.offset + dimensions(getCoveringElement()).height + viewport.height * 0.1;
|
|
6509
5929
|
for (let i = 0; i < targets.length; i++) {
|
|
6510
5930
|
if (offset(targets[i]).top - viewport.top - offsetBy > 0) {
|
|
6511
5931
|
break;
|
|
@@ -6644,7 +6064,7 @@
|
|
|
6644
6064
|
this.hide();
|
|
6645
6065
|
}
|
|
6646
6066
|
if (!this.active) {
|
|
6647
|
-
({ height, width } = dimensions
|
|
6067
|
+
({ height, width } = dimensions(this.$el));
|
|
6648
6068
|
margin = css(this.$el, "margin");
|
|
6649
6069
|
}
|
|
6650
6070
|
if (hide) {
|
|
@@ -6666,7 +6086,7 @@
|
|
|
6666
6086
|
const overflow = this.overflowFlip ? 0 : Math.max(0, elementBox - viewport2);
|
|
6667
6087
|
const topOffset = offset(referenceElement).top - // offset possible `transform: translateY` animation 'uk-animation-slide-top' while hiding
|
|
6668
6088
|
new DOMMatrix(css(referenceElement, "transform")).m42;
|
|
6669
|
-
const elHeight = dimensions
|
|
6089
|
+
const elHeight = dimensions(this.$el).height;
|
|
6670
6090
|
const start = (this.start === false ? topOffset : parseProp(this.start, this.$el, topOffset)) - offset$1;
|
|
6671
6091
|
const end = this.end === false ? maxScrollHeight : Math.min(
|
|
6672
6092
|
maxScrollHeight,
|
|
@@ -6858,7 +6278,7 @@
|
|
|
6858
6278
|
if (!value) {
|
|
6859
6279
|
return 0;
|
|
6860
6280
|
}
|
|
6861
|
-
if (isNumeric(value) || isString(value) && /^-?\d
|
|
6281
|
+
if (isNumeric(value) || isString(value) && value.match(/^-?\d/)) {
|
|
6862
6282
|
return propOffset + toPx(value, "height", el, true);
|
|
6863
6283
|
} else {
|
|
6864
6284
|
const refElement = value === true ? getVisibleParent(el) : query(value, el);
|
|
@@ -6892,6 +6312,15 @@
|
|
|
6892
6312
|
}
|
|
6893
6313
|
}
|
|
6894
6314
|
|
|
6315
|
+
function getMaxPathLength(el) {
|
|
6316
|
+
return isVisible(el) ? Math.ceil(
|
|
6317
|
+
Math.max(0, ...$$("[stroke]", el).map((stroke) => {
|
|
6318
|
+
var _a;
|
|
6319
|
+
return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
|
|
6320
|
+
}))
|
|
6321
|
+
) : 0;
|
|
6322
|
+
}
|
|
6323
|
+
|
|
6895
6324
|
var svg = {
|
|
6896
6325
|
mixins: [Svg],
|
|
6897
6326
|
args: "src",
|
|
@@ -6973,9 +6402,10 @@
|
|
|
6973
6402
|
|
|
6974
6403
|
const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
6975
6404
|
var Switcher = {
|
|
6976
|
-
mixins: [
|
|
6405
|
+
mixins: [Togglable],
|
|
6977
6406
|
args: "connect",
|
|
6978
6407
|
props: {
|
|
6408
|
+
connect: String,
|
|
6979
6409
|
toggle: String,
|
|
6980
6410
|
itemNav: String,
|
|
6981
6411
|
active: Number,
|
|
@@ -6987,12 +6417,20 @@
|
|
|
6987
6417
|
toggle: "> * > :first-child",
|
|
6988
6418
|
itemNav: false,
|
|
6989
6419
|
active: 0,
|
|
6420
|
+
cls: "uk-active",
|
|
6990
6421
|
attrItem: "uk-switcher-item",
|
|
6991
6422
|
selVertical: ".uk-nav",
|
|
6992
6423
|
followFocus: false,
|
|
6993
6424
|
swiping: true
|
|
6994
6425
|
},
|
|
6995
6426
|
computed: {
|
|
6427
|
+
connects: {
|
|
6428
|
+
get: ({ connect }, $el) => queryAll(connect, $el),
|
|
6429
|
+
observe: ({ connect }) => connect
|
|
6430
|
+
},
|
|
6431
|
+
connectChildren() {
|
|
6432
|
+
return this.connects.flatMap((el) => children(el));
|
|
6433
|
+
},
|
|
6996
6434
|
toggles: ({ toggle }, $el) => $$(toggle, $el),
|
|
6997
6435
|
children(_, $el) {
|
|
6998
6436
|
return children($el).filter(
|
|
@@ -7023,7 +6461,10 @@
|
|
|
7023
6461
|
connected() {
|
|
7024
6462
|
this.$el.role = "tablist";
|
|
7025
6463
|
},
|
|
7026
|
-
observe:
|
|
6464
|
+
observe: [
|
|
6465
|
+
lazyload({ targets: ({ connectChildren }) => connectChildren }),
|
|
6466
|
+
swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping })
|
|
6467
|
+
],
|
|
7027
6468
|
events: [
|
|
7028
6469
|
{
|
|
7029
6470
|
name: "click keydown",
|
|
@@ -7077,16 +6518,24 @@
|
|
|
7077
6518
|
}
|
|
7078
6519
|
],
|
|
7079
6520
|
update() {
|
|
6521
|
+
var _a;
|
|
6522
|
+
for (const el of this.connects) {
|
|
6523
|
+
if (isTag(el, "ul")) {
|
|
6524
|
+
el.role = "presentation";
|
|
6525
|
+
}
|
|
6526
|
+
}
|
|
7080
6527
|
attr(children(this.$el), "role", "presentation");
|
|
7081
6528
|
for (const index in this.toggles) {
|
|
7082
|
-
const
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
6529
|
+
const toggle = this.toggles[index];
|
|
6530
|
+
const item = (_a = this.connects[0]) == null ? void 0 : _a.children[index];
|
|
6531
|
+
toggle.role = "tab";
|
|
6532
|
+
if (!item) {
|
|
6533
|
+
continue;
|
|
6534
|
+
}
|
|
6535
|
+
toggle.id = generateId(this, toggle);
|
|
6536
|
+
item.id = generateId(this, item);
|
|
6537
|
+
attr(toggle, "aria-controls", item.id);
|
|
6538
|
+
attr(item, { role: "tabpanel", "aria-labelledby": toggle.id });
|
|
7090
6539
|
}
|
|
7091
6540
|
attr(this.$el, "aria-orientation", matches(this.$el, this.selVertical) ? "vertical" : null);
|
|
7092
6541
|
},
|
|
@@ -7119,7 +6568,15 @@
|
|
|
7119
6568
|
tabindex: next === i ? null : -1
|
|
7120
6569
|
});
|
|
7121
6570
|
});
|
|
7122
|
-
|
|
6571
|
+
const animate = prev >= 0 && prev !== next;
|
|
6572
|
+
this.connects.forEach(async ({ children: children2 }) => {
|
|
6573
|
+
const actives = toArray(children2).filter(
|
|
6574
|
+
(child, i) => i !== next && hasClass(child, this.cls)
|
|
6575
|
+
);
|
|
6576
|
+
if (await this.toggleElement(actives, false, animate)) {
|
|
6577
|
+
await this.toggleElement(children2[next], true, animate);
|
|
6578
|
+
}
|
|
6579
|
+
});
|
|
7123
6580
|
}
|
|
7124
6581
|
}
|
|
7125
6582
|
};
|