uikit 3.25.20-dev.e4f47fc → 3.25.21-dev.a074036
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 +4 -29
- 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 +917 -1045
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +917 -1045
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +936 -1064
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +936 -1064
- 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 +133 -134
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +134 -135
- 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 +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 +26 -42
- 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 +103 -72
- 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 +19 -19
- 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 +267 -752
- 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 +380 -628
- 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 -2
- package/src/js/api/options.js +3 -6
- package/src/js/api/props.js +4 -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/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/tooltip.js +2 -4
- package/src/js/core/accordion.js +29 -78
- package/src/js/core/drop.js +11 -5
- package/src/js/core/dropnav.js +3 -3
- package/src/js/core/grid.js +19 -5
- package/src/js/core/height-match.js +2 -1
- package/src/js/core/margin.js +0 -3
- package/src/js/core/overflow-fade.js +5 -5
- package/src/js/core/sticky.js +1 -1
- package/src/js/core/switcher.js +44 -24
- package/src/js/core/video.js +15 -172
- package/src/js/mixin/internal/slideshow-animations.js +13 -5
- package/src/js/mixin/internal/slideshow-transitioner.js +2 -2
- package/src/js/mixin/modal.js +3 -4
- package/src/js/mixin/parallax.js +4 -1
- package/src/js/mixin/position.js +1 -1
- package/src/js/mixin/slider-nav.js +2 -2
- 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/class.js +1 -1
- package/src/js/util/dom.js +4 -3
- package/src/js/util/lang.js +1 -1
- package/src/js/util/player.js +4 -4
- package/src/js/util/style.js +15 -10
- package/src/js/util/viewport.js +25 -22
- package/src/less/components/_import.less +1 -6
- package/src/less/components/base.less +1 -1
- package/src/less/components/button.less +1 -1
- package/src/less/components/form.less +5 -5
- package/src/less/components/grid.less +65 -58
- package/src/less/components/margin.less +124 -155
- package/src/less/components/nav.less +1 -1
- package/src/less/components/padding.less +9 -9
- package/src/less/components/text.less +0 -6
- package/src/less/components/utility.less +163 -0
- package/src/less/theme/_import.less +1 -5
- package/src/less/theme/utility.less +32 -0
- package/src/scss/components/_import.scss +1 -6
- package/src/scss/components/base.scss +1 -1
- package/src/scss/components/button.scss +1 -1
- package/src/scss/components/form.scss +5 -5
- package/src/scss/components/grid.scss +64 -57
- package/src/scss/components/margin.scss +124 -155
- package/src/scss/components/nav.scss +1 -1
- package/src/scss/components/padding.scss +9 -9
- package/src/scss/components/text.scss +0 -6
- package/src/scss/components/utility.scss +129 -0
- package/src/scss/mixins-theme.scss +33 -42
- package/src/scss/mixins.scss +30 -39
- 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 +3 -3
- 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 +6 -6
- 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 +14 -14
- package/tests/link.html +1 -1
- package/tests/list.html +4 -4
- package/tests/margin.html +7 -7
- package/tests/marker.html +3 -3
- package/tests/modal.html +4 -4
- package/tests/nav.html +5 -5
- package/tests/navbar.html +27 -27
- package/tests/notification.html +2 -2
- 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 +12 -12
- 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 +4 -34
- 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 +6 -6
- package/tests/tab.html +4 -4
- package/tests/text.html +3 -3
- 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 +27 -227
- package/tests/visibility.html +4 -4
- package/tests/width.html +12 -12
- package/dist/js/components/marquee.js +0 -179
- package/dist/js/components/marquee.min.js +0 -1
- package/src/js/components/marquee.js +0 -123
- package/src/js/mixin/connect.js +0 -55
- 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.
|
|
1
|
+
/*! UIkit 3.25.21-dev.a074036 | 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() :
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
return array.filter(({ [prop]: check }) => seen.has(check) ? false : seen.add(check));
|
|
135
135
|
}
|
|
136
136
|
function pick(obj, props) {
|
|
137
|
-
return
|
|
137
|
+
return props.reduce((res, prop) => ({ ...res, [prop]: obj[prop] }), {});
|
|
138
138
|
}
|
|
139
139
|
function clamp(number, min = 0, max = 1) {
|
|
140
140
|
return Math.min(Math.max(toNumber(number) || 0, min), max);
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
function toClasses(str) {
|
|
233
|
-
return str ? isArray(str) ? str.
|
|
233
|
+
return str ? isArray(str) ? str.map(toClasses).flat() : String(str).split(" ").filter(Boolean) : [];
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
function attr(element, name, value) {
|
|
@@ -243,12 +243,13 @@
|
|
|
243
243
|
}
|
|
244
244
|
if (isUndefined(value)) {
|
|
245
245
|
return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
246
|
+
} else {
|
|
247
|
+
for (const el of toNodes(element)) {
|
|
248
|
+
if (value === null) {
|
|
249
|
+
removeAttr(el, name);
|
|
250
|
+
} else {
|
|
251
|
+
el.setAttribute(name, value);
|
|
252
|
+
}
|
|
252
253
|
}
|
|
253
254
|
}
|
|
254
255
|
}
|
|
@@ -588,14 +589,19 @@
|
|
|
588
589
|
property = propName(property);
|
|
589
590
|
if (isUndefined(value)) {
|
|
590
591
|
return getComputedStyle(element2).getPropertyValue(property);
|
|
592
|
+
} else {
|
|
593
|
+
element2.style.setProperty(
|
|
594
|
+
property,
|
|
595
|
+
isNumeric(value) && !cssNumber[property] && !isCustomProperty(property) ? `${value}px` : value || isNumber(value) ? value : "",
|
|
596
|
+
priority
|
|
597
|
+
);
|
|
591
598
|
}
|
|
592
|
-
element2.style.setProperty(
|
|
593
|
-
property,
|
|
594
|
-
isNumeric(value) && !cssNumber[property] && !isCustomProperty(property) ? `${value}px` : value || isNumber(value) ? value : "",
|
|
595
|
-
priority
|
|
596
|
-
);
|
|
597
599
|
} else if (isArray(property)) {
|
|
598
|
-
|
|
600
|
+
const props = {};
|
|
601
|
+
for (const prop of property) {
|
|
602
|
+
props[prop] = css(element2, prop);
|
|
603
|
+
}
|
|
604
|
+
return props;
|
|
599
605
|
} else if (isObject(property)) {
|
|
600
606
|
for (const prop in property) {
|
|
601
607
|
css(element2, prop, property[prop], value);
|
|
@@ -779,9 +785,7 @@
|
|
|
779
785
|
);
|
|
780
786
|
}
|
|
781
787
|
function unwrap(element) {
|
|
782
|
-
|
|
783
|
-
elementParent.replaceWith(...elementParent.childNodes);
|
|
784
|
-
}
|
|
788
|
+
toNodes(element).map(parent).filter((value, index, self) => self.indexOf(value) === index).forEach((parent2) => parent2.replaceWith(...parent2.childNodes));
|
|
785
789
|
}
|
|
786
790
|
const singleTagRe = /^<(\w+)\s*\/?>(?:<\/\1>)?$/;
|
|
787
791
|
function fragment(html2) {
|
|
@@ -821,7 +825,7 @@
|
|
|
821
825
|
width: ["left", "right"],
|
|
822
826
|
height: ["top", "bottom"]
|
|
823
827
|
};
|
|
824
|
-
function dimensions
|
|
828
|
+
function dimensions(element) {
|
|
825
829
|
const rect = isElement(element) ? toNode(element).getBoundingClientRect() : { height: height(element), width: width(element), top: 0, left: 0 };
|
|
826
830
|
return {
|
|
827
831
|
height: rect.height,
|
|
@@ -836,7 +840,7 @@
|
|
|
836
840
|
if (coordinates) {
|
|
837
841
|
css(element, { left: 0, top: 0 });
|
|
838
842
|
}
|
|
839
|
-
const currentOffset = dimensions
|
|
843
|
+
const currentOffset = dimensions(element);
|
|
840
844
|
if (element) {
|
|
841
845
|
const { scrollY, scrollX } = toWindow(element);
|
|
842
846
|
const offsetBy = { height: scrollY, width: scrollX };
|
|
@@ -937,15 +941,15 @@
|
|
|
937
941
|
return sumBy(parseCalc(value), (value2) => {
|
|
938
942
|
const unit = parseUnit(value2);
|
|
939
943
|
return unit ? percent(
|
|
940
|
-
unit === "vh" ? getViewportHeight() : unit === "vw" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions
|
|
944
|
+
unit === "vh" ? getViewportHeight() : unit === "vw" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions(element)[property],
|
|
941
945
|
value2
|
|
942
946
|
) : value2;
|
|
943
947
|
});
|
|
944
948
|
}
|
|
945
949
|
const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
|
|
946
950
|
const parseCalc = memoize((calc) => calc.toString().replace(/\s/g, "").match(calcRe) || []);
|
|
947
|
-
const unitRe
|
|
948
|
-
const parseUnit = memoize((str) => (str.match(unitRe
|
|
951
|
+
const unitRe = /(?:v[hw]|%)$/;
|
|
952
|
+
const parseUnit = memoize((str) => (str.match(unitRe) || [])[0]);
|
|
949
953
|
function percent(base, value) {
|
|
950
954
|
return base * toFloat(value) / 100;
|
|
951
955
|
}
|
|
@@ -1040,7 +1044,7 @@
|
|
|
1040
1044
|
if (!this.positions || this.positions.length < 2) {
|
|
1041
1045
|
return false;
|
|
1042
1046
|
}
|
|
1043
|
-
const p = dimensions
|
|
1047
|
+
const p = dimensions(target);
|
|
1044
1048
|
const { left, right, top, bottom } = p;
|
|
1045
1049
|
const [prevPosition] = this.positions;
|
|
1046
1050
|
const position = last(this.positions);
|
|
@@ -1143,12 +1147,12 @@
|
|
|
1143
1147
|
return isTag(el, "iframe") && (isYoutube(el) || isVimeo(el));
|
|
1144
1148
|
}
|
|
1145
1149
|
function isYoutube(el) {
|
|
1146
|
-
return
|
|
1147
|
-
|
|
1150
|
+
return !!el.src.match(
|
|
1151
|
+
/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/
|
|
1148
1152
|
);
|
|
1149
1153
|
}
|
|
1150
1154
|
function isVimeo(el) {
|
|
1151
|
-
return /vimeo\.com\/video
|
|
1155
|
+
return !!el.src.match(/vimeo\.com\/video\/.*/);
|
|
1152
1156
|
}
|
|
1153
1157
|
async function call(el, cmd) {
|
|
1154
1158
|
await enableApi(el);
|
|
@@ -1157,7 +1161,7 @@
|
|
|
1157
1161
|
function post(el, cmd) {
|
|
1158
1162
|
el.contentWindow.postMessage(JSON.stringify({ event: "command", ...cmd }), "*");
|
|
1159
1163
|
}
|
|
1160
|
-
const stateKey =
|
|
1164
|
+
const stateKey = "_ukPlayer";
|
|
1161
1165
|
let counter = 0;
|
|
1162
1166
|
function enableApi(el) {
|
|
1163
1167
|
if (el[stateKey]) {
|
|
@@ -1188,16 +1192,17 @@
|
|
|
1188
1192
|
if (!isVisible(element)) {
|
|
1189
1193
|
return false;
|
|
1190
1194
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1195
|
+
return intersectRect(
|
|
1196
|
+
...overflowParents(element).map((parent2) => {
|
|
1197
|
+
const { top, left, bottom, right } = offsetViewport(parent2);
|
|
1198
|
+
return {
|
|
1199
|
+
top: top - offsetTop,
|
|
1200
|
+
left: left - offsetLeft,
|
|
1201
|
+
bottom: bottom + offsetTop,
|
|
1202
|
+
right: right + offsetLeft
|
|
1203
|
+
};
|
|
1204
|
+
}).concat(offset(element))
|
|
1205
|
+
);
|
|
1201
1206
|
}
|
|
1202
1207
|
function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
|
|
1203
1208
|
const parents2 = isVisible(element) ? scrollParents(element, false, ["hidden"]) : [];
|
|
@@ -1237,7 +1242,7 @@
|
|
|
1237
1242
|
const percent = ease(clamp((Date.now() - start) / duration));
|
|
1238
1243
|
let diff = 0;
|
|
1239
1244
|
if (parents2[0] === element2 && scroll + top < maxScroll) {
|
|
1240
|
-
diff = offset(targetEl).top + (isScrollingElement ? 0 : element2.scrollTop) - targetTop - dimensions
|
|
1245
|
+
diff = offset(targetEl).top + (isScrollingElement ? 0 : element2.scrollTop) - targetTop - dimensions(getCoveringElement(targetEl)).height;
|
|
1241
1246
|
}
|
|
1242
1247
|
if (css(element2, "scrollBehavior") !== "auto") {
|
|
1243
1248
|
css(element2, "scrollBehavior", "auto");
|
|
@@ -1281,12 +1286,11 @@
|
|
|
1281
1286
|
if (~fixedIndex) {
|
|
1282
1287
|
ancestors = ancestors.slice(fixedIndex);
|
|
1283
1288
|
}
|
|
1284
|
-
return [
|
|
1285
|
-
|
|
1286
|
-
...ancestors.filter(
|
|
1289
|
+
return [scrollEl].concat(
|
|
1290
|
+
ancestors.filter(
|
|
1287
1291
|
(parent2) => css(parent2, "overflow").split(" ").some((prop) => includes(["auto", "scroll", ...props], prop)) && (!scrollable || parent2.scrollHeight > offsetViewport(parent2).height)
|
|
1288
1292
|
)
|
|
1289
|
-
|
|
1293
|
+
).reverse();
|
|
1290
1294
|
}
|
|
1291
1295
|
function scrollParent(...args) {
|
|
1292
1296
|
return scrollParents(...args)[0];
|
|
@@ -1325,7 +1329,7 @@
|
|
|
1325
1329
|
function getCoveringElement(target) {
|
|
1326
1330
|
const { document } = toWindow(target);
|
|
1327
1331
|
target = target || document.body;
|
|
1328
|
-
const { left, width, top } = dimensions
|
|
1332
|
+
const { left, width, top } = dimensions(target);
|
|
1329
1333
|
for (const position of top ? [0, top] : [0]) {
|
|
1330
1334
|
let coverEl;
|
|
1331
1335
|
for (const el of document.elementsFromPoint(left + width / 2, position)) {
|
|
@@ -1334,7 +1338,7 @@
|
|
|
1334
1338
|
parents(target).reverse().find(
|
|
1335
1339
|
(parent2) => !parent2.contains(el) && !hasPosition(parent2, "static")
|
|
1336
1340
|
)
|
|
1337
|
-
) < zIndex(el) || hasPosition(el, "sticky") && (!target || parent(el).contains(target))) && (!coverEl || dimensions
|
|
1341
|
+
) < zIndex(el) || hasPosition(el, "sticky") && (!target || parent(el).contains(target))) && (!coverEl || dimensions(coverEl).height < dimensions(el).height)) {
|
|
1338
1342
|
coverEl = el;
|
|
1339
1343
|
}
|
|
1340
1344
|
}
|
|
@@ -1555,7 +1559,7 @@
|
|
|
1555
1559
|
createEvent: createEvent,
|
|
1556
1560
|
css: css,
|
|
1557
1561
|
data: data,
|
|
1558
|
-
dimensions: dimensions
|
|
1562
|
+
dimensions: dimensions,
|
|
1559
1563
|
each: each,
|
|
1560
1564
|
empty: empty,
|
|
1561
1565
|
endsWith: endsWith,
|
|
@@ -1675,7 +1679,7 @@
|
|
|
1675
1679
|
wrapInner: wrapInner
|
|
1676
1680
|
});
|
|
1677
1681
|
|
|
1678
|
-
var VERSION = '3.25.
|
|
1682
|
+
var VERSION = '3.25.21-dev.a074036';
|
|
1679
1683
|
|
|
1680
1684
|
function initUpdates(instance) {
|
|
1681
1685
|
instance._data = {};
|
|
@@ -1988,14 +1992,11 @@
|
|
|
1988
1992
|
function coerce$1(type, value) {
|
|
1989
1993
|
if (type === Boolean) {
|
|
1990
1994
|
return toBoolean(value);
|
|
1991
|
-
}
|
|
1992
|
-
if (type === Number) {
|
|
1995
|
+
} else if (type === Number) {
|
|
1993
1996
|
return toNumber(value);
|
|
1994
|
-
}
|
|
1995
|
-
if (type === "list") {
|
|
1997
|
+
} else if (type === "list") {
|
|
1996
1998
|
return toList(value);
|
|
1997
|
-
}
|
|
1998
|
-
if (type === Object && isString(value)) {
|
|
1999
|
+
} else if (type === Object && isString(value)) {
|
|
1999
2000
|
return parseOptions(value);
|
|
2000
2001
|
}
|
|
2001
2002
|
return type ? type(value) : value;
|
|
@@ -2045,7 +2046,7 @@
|
|
|
2045
2046
|
}
|
|
2046
2047
|
const getAttributes = memoize((id, props) => {
|
|
2047
2048
|
const attributes = Object.keys(props);
|
|
2048
|
-
const filter =
|
|
2049
|
+
const filter = attributes.concat(id).map((key) => [hyphenate(key), `data-${hyphenate(key)}`]).flat();
|
|
2049
2050
|
return { attributes, filter };
|
|
2050
2051
|
});
|
|
2051
2052
|
function initPropsObserver(instance) {
|
|
@@ -2135,10 +2136,14 @@
|
|
|
2135
2136
|
}
|
|
2136
2137
|
function normalizeData({ data = {} }, { args = [], props = {} }) {
|
|
2137
2138
|
if (isArray(data)) {
|
|
2138
|
-
data = data.slice(0, args.length).reduce(
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2139
|
+
data = data.slice(0, args.length).reduce((data2, value, index) => {
|
|
2140
|
+
if (isPlainObject(value)) {
|
|
2141
|
+
assign(data2, value);
|
|
2142
|
+
} else {
|
|
2143
|
+
data2[args[index]] = value;
|
|
2144
|
+
}
|
|
2145
|
+
return data2;
|
|
2146
|
+
}, {});
|
|
2142
2147
|
}
|
|
2143
2148
|
for (const key in data) {
|
|
2144
2149
|
if (isUndefined(data[key])) {
|
|
@@ -2186,10 +2191,11 @@
|
|
|
2186
2191
|
function init(element2) {
|
|
2187
2192
|
const instance = getComponent(element2, name);
|
|
2188
2193
|
if (instance) {
|
|
2189
|
-
if (
|
|
2194
|
+
if (data) {
|
|
2195
|
+
instance.$destroy();
|
|
2196
|
+
} else {
|
|
2190
2197
|
return instance;
|
|
2191
2198
|
}
|
|
2192
|
-
instance.$destroy();
|
|
2193
2199
|
}
|
|
2194
2200
|
return new Component({ el: element2, data });
|
|
2195
2201
|
}
|
|
@@ -2405,8 +2411,8 @@
|
|
|
2405
2411
|
for (const el of toNodes(isFunction(targets) ? targets(this) : targets)) {
|
|
2406
2412
|
$$('[loading="lazy"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, "loading"));
|
|
2407
2413
|
}
|
|
2408
|
-
for (const
|
|
2409
|
-
observer.unobserve(
|
|
2414
|
+
for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {
|
|
2415
|
+
observer.unobserve(el);
|
|
2410
2416
|
}
|
|
2411
2417
|
},
|
|
2412
2418
|
...options
|
|
@@ -2484,6 +2490,12 @@
|
|
|
2484
2490
|
}
|
|
2485
2491
|
};
|
|
2486
2492
|
|
|
2493
|
+
function maybeDefaultPreventClick(e) {
|
|
2494
|
+
if (e.target.closest('a[href="#"],a[href=""]')) {
|
|
2495
|
+
e.preventDefault();
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2487
2499
|
var Togglable = {
|
|
2488
2500
|
props: {
|
|
2489
2501
|
cls: Boolean,
|
|
@@ -2576,25 +2588,27 @@
|
|
|
2576
2588
|
const dimProp = props[dirs.indexOf(dir)];
|
|
2577
2589
|
const marginProp = `margin-${dir[0]}`;
|
|
2578
2590
|
const marginStartProp = `margin-${startProp}`;
|
|
2579
|
-
let currentDim = dimensions
|
|
2591
|
+
let currentDim = dimensions(el)[dimProp];
|
|
2580
2592
|
const inProgress = Transition.inProgress(el);
|
|
2581
2593
|
await Transition.cancel(el);
|
|
2582
2594
|
if (show) {
|
|
2583
2595
|
_toggle(el, true);
|
|
2584
2596
|
}
|
|
2585
|
-
const prevProps =
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2597
|
+
const prevProps = Object.fromEntries(
|
|
2598
|
+
[
|
|
2599
|
+
"padding",
|
|
2600
|
+
"border",
|
|
2601
|
+
"width",
|
|
2602
|
+
"height",
|
|
2603
|
+
"minWidth",
|
|
2604
|
+
"minHeight",
|
|
2605
|
+
"overflowY",
|
|
2606
|
+
"overflowX",
|
|
2607
|
+
marginProp,
|
|
2608
|
+
marginStartProp
|
|
2609
|
+
].map((key) => [key, el.style[key]])
|
|
2610
|
+
);
|
|
2611
|
+
const dim = dimensions(el);
|
|
2598
2612
|
const currentMargin = toFloat(css(el, marginProp));
|
|
2599
2613
|
const marginStart = toFloat(css(el, marginStartProp));
|
|
2600
2614
|
const endDim = dim[dimProp] + marginStart;
|
|
@@ -2660,55 +2674,6 @@
|
|
|
2660
2674
|
);
|
|
2661
2675
|
}
|
|
2662
2676
|
|
|
2663
|
-
var Connect = {
|
|
2664
|
-
mixins: [Togglable],
|
|
2665
|
-
props: {
|
|
2666
|
-
connect: String
|
|
2667
|
-
},
|
|
2668
|
-
data: {
|
|
2669
|
-
connect: "",
|
|
2670
|
-
cls: "uk-active"
|
|
2671
|
-
},
|
|
2672
|
-
computed: {
|
|
2673
|
-
connects: {
|
|
2674
|
-
get: ({ connect }, $el) => connect ? queryAll(connect, $el) : [],
|
|
2675
|
-
observe: ({ connect }) => connect
|
|
2676
|
-
},
|
|
2677
|
-
connectChildren() {
|
|
2678
|
-
return this.connects.flatMap((el) => children(el));
|
|
2679
|
-
}
|
|
2680
|
-
},
|
|
2681
|
-
watch: {
|
|
2682
|
-
connects(connects) {
|
|
2683
|
-
for (const el of connects) {
|
|
2684
|
-
if (isTag(el, "ul")) {
|
|
2685
|
-
el.role = "presentation";
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
}
|
|
2689
|
-
},
|
|
2690
|
-
observe: lazyload({ targets: ({ connectChildren }) => connectChildren }),
|
|
2691
|
-
methods: {
|
|
2692
|
-
showConnects(index, animate) {
|
|
2693
|
-
const toggle = async ({ children: children2 }) => {
|
|
2694
|
-
const actives = toArray(children2).filter(
|
|
2695
|
-
(child, i) => i !== index && hasClass(child, this.cls)
|
|
2696
|
-
);
|
|
2697
|
-
if (await this.toggleElement(actives, false, animate)) {
|
|
2698
|
-
await this.toggleElement(children2[index], true, animate);
|
|
2699
|
-
}
|
|
2700
|
-
};
|
|
2701
|
-
return Promise.all(this.connects.map(toggle));
|
|
2702
|
-
}
|
|
2703
|
-
}
|
|
2704
|
-
};
|
|
2705
|
-
|
|
2706
|
-
function maybeDefaultPreventClick(e) {
|
|
2707
|
-
if (e.target.closest('a[href="#"],a[href=""]')) {
|
|
2708
|
-
e.preventDefault();
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
|
|
2712
2677
|
const keyMap = {
|
|
2713
2678
|
TAB: 9,
|
|
2714
2679
|
ENTER: 13,
|
|
@@ -2723,32 +2688,27 @@
|
|
|
2723
2688
|
};
|
|
2724
2689
|
|
|
2725
2690
|
var Accordion = {
|
|
2726
|
-
mixins: [Class,
|
|
2691
|
+
mixins: [Class, Togglable],
|
|
2727
2692
|
props: {
|
|
2693
|
+
animation: Boolean,
|
|
2728
2694
|
targets: String,
|
|
2729
2695
|
active: null,
|
|
2730
2696
|
collapsible: Boolean,
|
|
2731
2697
|
multiple: Boolean,
|
|
2732
2698
|
toggle: String,
|
|
2733
2699
|
content: String,
|
|
2734
|
-
offset: Number
|
|
2735
|
-
switcherConnect: String
|
|
2700
|
+
offset: Number
|
|
2736
2701
|
},
|
|
2737
2702
|
data: {
|
|
2738
2703
|
targets: "> *",
|
|
2739
2704
|
active: false,
|
|
2740
|
-
animation:
|
|
2705
|
+
animation: true,
|
|
2741
2706
|
collapsible: true,
|
|
2742
2707
|
multiple: false,
|
|
2743
2708
|
clsOpen: "uk-open",
|
|
2744
|
-
cls: "uk-active",
|
|
2745
2709
|
toggle: ".uk-accordion-title",
|
|
2746
2710
|
content: ".uk-accordion-content",
|
|
2747
|
-
offset: 0
|
|
2748
|
-
switcherConnect: ""
|
|
2749
|
-
},
|
|
2750
|
-
beforeConnect() {
|
|
2751
|
-
this.connect = this.$props.connect = this.switcherConnect;
|
|
2711
|
+
offset: 0
|
|
2752
2712
|
},
|
|
2753
2713
|
computed: {
|
|
2754
2714
|
items: ({ targets }, $el) => $$(targets, $el),
|
|
@@ -2772,12 +2732,6 @@
|
|
|
2772
2732
|
this.toggle(active, false);
|
|
2773
2733
|
}
|
|
2774
2734
|
},
|
|
2775
|
-
connectChildren() {
|
|
2776
|
-
this.showConnects(
|
|
2777
|
-
findIndex(this.items, (el) => hasClass(el, this.clsOpen)),
|
|
2778
|
-
false
|
|
2779
|
-
);
|
|
2780
|
-
},
|
|
2781
2735
|
toggles() {
|
|
2782
2736
|
this.$emit();
|
|
2783
2737
|
},
|
|
@@ -2828,66 +2782,43 @@
|
|
|
2828
2782
|
continue;
|
|
2829
2783
|
}
|
|
2830
2784
|
toggle.id = generateId(this, toggle);
|
|
2785
|
+
content.id = generateId(this, content);
|
|
2831
2786
|
const active = includes(activeItems, this.items[index2]);
|
|
2832
|
-
attr(content, {
|
|
2833
|
-
id: generateId(this, content),
|
|
2834
|
-
role: "region",
|
|
2835
|
-
"aria-labelledby": toggle.id
|
|
2836
|
-
});
|
|
2837
|
-
if (isTag(content, "ul")) {
|
|
2838
|
-
attr(children(content), "role", "presentation");
|
|
2839
|
-
}
|
|
2840
|
-
const controls = [content.id];
|
|
2841
|
-
for (const { children: children2 } of this.connects) {
|
|
2842
|
-
const item = children2[index2];
|
|
2843
|
-
if (!item) {
|
|
2844
|
-
continue;
|
|
2845
|
-
}
|
|
2846
|
-
attr(item, {
|
|
2847
|
-
id: generateId(this, item),
|
|
2848
|
-
role: "tabpanel",
|
|
2849
|
-
"aria-labelledby": toggle.id
|
|
2850
|
-
});
|
|
2851
|
-
controls.push(item.id);
|
|
2852
|
-
}
|
|
2853
2787
|
attr(toggle, {
|
|
2854
2788
|
role: isTag(toggle, "a") ? "button" : null,
|
|
2855
|
-
"aria-controls":
|
|
2789
|
+
"aria-controls": content.id,
|
|
2856
2790
|
"aria-expanded": active,
|
|
2857
2791
|
"aria-disabled": !this.collapsible && activeItems.length < 2 && active
|
|
2858
2792
|
});
|
|
2793
|
+
attr(content, { role: "region", "aria-labelledby": toggle.id });
|
|
2794
|
+
if (isTag(content, "ul")) {
|
|
2795
|
+
attr(children(content), "role", "presentation");
|
|
2796
|
+
}
|
|
2859
2797
|
}
|
|
2860
2798
|
},
|
|
2861
2799
|
methods: {
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
const next = getIndex(item, this.items);
|
|
2865
|
-
item = this.items[next];
|
|
2800
|
+
toggle(item, animate) {
|
|
2801
|
+
item = this.items[getIndex(item, this.items)];
|
|
2866
2802
|
let items = [item];
|
|
2867
2803
|
const activeItems = filter(this.items, `.${this.clsOpen}`);
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
};
|
|
2887
|
-
return Promise.all([
|
|
2888
|
-
...items.map(toggle),
|
|
2889
|
-
this.showConnects(isActive ? hideIndex() : next, animate)
|
|
2890
|
-
]);
|
|
2804
|
+
if (!this.multiple && !includes(activeItems, items[0])) {
|
|
2805
|
+
items = items.concat(activeItems);
|
|
2806
|
+
}
|
|
2807
|
+
if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {
|
|
2808
|
+
items = [];
|
|
2809
|
+
}
|
|
2810
|
+
return Promise.all(
|
|
2811
|
+
items.map(
|
|
2812
|
+
(el) => this.toggleElement(el, !includes(activeItems, el), (el2, show) => {
|
|
2813
|
+
toggleClass(el2, this.clsOpen, show);
|
|
2814
|
+
if (animate === false || !this.animation) {
|
|
2815
|
+
hide($(this.content, el2), !show);
|
|
2816
|
+
return;
|
|
2817
|
+
}
|
|
2818
|
+
return transition(el2, show, this);
|
|
2819
|
+
})
|
|
2820
|
+
)
|
|
2821
|
+
);
|
|
2891
2822
|
}
|
|
2892
2823
|
}
|
|
2893
2824
|
};
|
|
@@ -2905,7 +2836,7 @@
|
|
|
2905
2836
|
const currentHeight = toFloat(css(wrapper, "height"));
|
|
2906
2837
|
await Transition.cancel(wrapper);
|
|
2907
2838
|
hide(content, false);
|
|
2908
|
-
const endHeight = sumBy(["marginTop", "marginBottom"], (prop) => css(content, prop)) + dimensions
|
|
2839
|
+
const endHeight = sumBy(["marginTop", "marginBottom"], (prop) => css(content, prop)) + dimensions(content).height;
|
|
2909
2840
|
const percent = currentHeight / endHeight;
|
|
2910
2841
|
duration = endHeight ? (velocity * endHeight + duration) * (show ? 1 - percent : percent) : 0;
|
|
2911
2842
|
css(wrapper, "height", currentHeight);
|
|
@@ -2921,7 +2852,7 @@
|
|
|
2921
2852
|
let frame;
|
|
2922
2853
|
(function scroll() {
|
|
2923
2854
|
frame = requestAnimationFrame(() => {
|
|
2924
|
-
const { top } = dimensions
|
|
2855
|
+
const { top } = dimensions(el);
|
|
2925
2856
|
if (top < 0) {
|
|
2926
2857
|
scrollElement.scrollTop += top;
|
|
2927
2858
|
}
|
|
@@ -2978,395 +2909,22 @@
|
|
|
2978
2909
|
);
|
|
2979
2910
|
}
|
|
2980
2911
|
|
|
2981
|
-
var Media = {
|
|
2982
|
-
props: {
|
|
2983
|
-
media: Boolean
|
|
2984
|
-
},
|
|
2985
|
-
data: {
|
|
2986
|
-
media: false
|
|
2987
|
-
},
|
|
2988
|
-
connected() {
|
|
2989
|
-
const media = toMedia(this.media, this.$el);
|
|
2990
|
-
this.matchMedia = true;
|
|
2991
|
-
if (media) {
|
|
2992
|
-
this.mediaObj = window.matchMedia(media);
|
|
2993
|
-
const handler = () => {
|
|
2994
|
-
this.matchMedia = this.mediaObj.matches;
|
|
2995
|
-
trigger(this.$el, createEvent("mediachange", false, true, [this.mediaObj]));
|
|
2996
|
-
};
|
|
2997
|
-
this.offMediaObj = on(this.mediaObj, "change", () => {
|
|
2998
|
-
handler();
|
|
2999
|
-
this.$emit("resize");
|
|
3000
|
-
});
|
|
3001
|
-
handler();
|
|
3002
|
-
}
|
|
3003
|
-
},
|
|
3004
|
-
disconnected() {
|
|
3005
|
-
var _a;
|
|
3006
|
-
(_a = this.offMediaObj) == null ? void 0 : _a.call(this);
|
|
3007
|
-
}
|
|
3008
|
-
};
|
|
3009
|
-
function toMedia(value, element) {
|
|
3010
|
-
if (isString(value)) {
|
|
3011
|
-
if (startsWith(value, "@")) {
|
|
3012
|
-
value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));
|
|
3013
|
-
} else if (isNaN(value)) {
|
|
3014
|
-
return value;
|
|
3015
|
-
}
|
|
3016
|
-
}
|
|
3017
|
-
return value && isNumeric(value) ? `(min-width: ${value}px)` : "";
|
|
3018
|
-
}
|
|
3019
|
-
|
|
3020
|
-
function getMaxPathLength(el) {
|
|
3021
|
-
return isVisible(el) ? Math.ceil(
|
|
3022
|
-
Math.max(0, ...$$("[stroke]", el).map((stroke) => {
|
|
3023
|
-
var _a;
|
|
3024
|
-
return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
|
|
3025
|
-
}))
|
|
3026
|
-
) : 0;
|
|
3027
|
-
}
|
|
3028
|
-
|
|
3029
|
-
const props = {
|
|
3030
|
-
x: transformFn,
|
|
3031
|
-
y: transformFn,
|
|
3032
|
-
rotate: transformFn,
|
|
3033
|
-
scale: transformFn,
|
|
3034
|
-
color: colorFn,
|
|
3035
|
-
backgroundColor: colorFn,
|
|
3036
|
-
borderColor: colorFn,
|
|
3037
|
-
blur: filterFn,
|
|
3038
|
-
hue: filterFn,
|
|
3039
|
-
fopacity: filterFn,
|
|
3040
|
-
grayscale: filterFn,
|
|
3041
|
-
invert: filterFn,
|
|
3042
|
-
saturate: filterFn,
|
|
3043
|
-
sepia: filterFn,
|
|
3044
|
-
opacity: cssPropFn,
|
|
3045
|
-
stroke: strokeFn,
|
|
3046
|
-
bgx: backgroundFn,
|
|
3047
|
-
bgy: backgroundFn
|
|
3048
|
-
};
|
|
3049
|
-
const { keys } = Object;
|
|
3050
|
-
({
|
|
3051
|
-
props: fillObject(keys(props), "list"),
|
|
3052
|
-
data: fillObject(keys(props), void 0)});
|
|
3053
|
-
function transformFn(prop, el, stops) {
|
|
3054
|
-
let unit = getUnit(stops) || { x: "px", y: "px", rotate: "deg" }[prop] || "";
|
|
3055
|
-
let transformFn2;
|
|
3056
|
-
if (prop === "x" || prop === "y") {
|
|
3057
|
-
prop = `translate${ucfirst(prop)}`;
|
|
3058
|
-
transformFn2 = (stop) => toFloat(toFloat(stop).toFixed(unit === "px" ? 0 : 6));
|
|
3059
|
-
} else if (prop === "scale") {
|
|
3060
|
-
unit = "";
|
|
3061
|
-
transformFn2 = (stop) => {
|
|
3062
|
-
var _a;
|
|
3063
|
-
return getUnit([stop]) ? toPx(stop, "width", el, true) / el[`offset${((_a = stop.endsWith) == null ? void 0 : _a.call(stop, "vh")) ? "Height" : "Width"}`] : toFloat(stop);
|
|
3064
|
-
};
|
|
3065
|
-
}
|
|
3066
|
-
if (stops.length === 1) {
|
|
3067
|
-
stops.unshift(prop === "scale" ? 1 : 0);
|
|
3068
|
-
}
|
|
3069
|
-
stops = parseStops(stops, transformFn2);
|
|
3070
|
-
return (css2, percent) => {
|
|
3071
|
-
css2.transform = `${css2.transform || ""} ${prop}(${getValue(stops, percent)}${unit})`;
|
|
3072
|
-
};
|
|
3073
|
-
}
|
|
3074
|
-
function colorFn(prop, el, stops) {
|
|
3075
|
-
if (stops.length === 1) {
|
|
3076
|
-
stops.unshift(getCssValue(el, prop, ""));
|
|
3077
|
-
}
|
|
3078
|
-
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
3079
|
-
return (css2, percent) => {
|
|
3080
|
-
const [start, end, p] = getStop(stops, percent);
|
|
3081
|
-
const value = start.map((value2, i) => {
|
|
3082
|
-
value2 += p * (end[i] - value2);
|
|
3083
|
-
return i === 3 ? toFloat(value2) : parseInt(value2, 10);
|
|
3084
|
-
}).join(",");
|
|
3085
|
-
css2[prop] = `rgba(${value})`;
|
|
3086
|
-
};
|
|
3087
|
-
}
|
|
3088
|
-
function parseColor(el, color) {
|
|
3089
|
-
return getCssValue(el, "color", color).split(/[(),]/g).slice(1, -1).concat(1).slice(0, 4).map(toFloat);
|
|
3090
|
-
}
|
|
3091
|
-
function filterFn(prop, el, stops) {
|
|
3092
|
-
if (stops.length === 1) {
|
|
3093
|
-
stops.unshift(0);
|
|
3094
|
-
}
|
|
3095
|
-
const unit = getUnit(stops) || { blur: "px", hue: "deg" }[prop] || "%";
|
|
3096
|
-
prop = { fopacity: "opacity", hue: "hue-rotate" }[prop] || prop;
|
|
3097
|
-
stops = parseStops(stops);
|
|
3098
|
-
return (css2, percent) => {
|
|
3099
|
-
const value = getValue(stops, percent);
|
|
3100
|
-
css2.filter = `${css2.filter || ""} ${prop}(${value + unit})`;
|
|
3101
|
-
};
|
|
3102
|
-
}
|
|
3103
|
-
function cssPropFn(prop, el, stops) {
|
|
3104
|
-
if (stops.length === 1) {
|
|
3105
|
-
stops.unshift(getCssValue(el, prop, ""));
|
|
3106
|
-
}
|
|
3107
|
-
stops = parseStops(stops);
|
|
3108
|
-
return (css2, percent) => {
|
|
3109
|
-
css2[prop] = getValue(stops, percent);
|
|
3110
|
-
};
|
|
3111
|
-
}
|
|
3112
|
-
function strokeFn(prop, el, stops) {
|
|
3113
|
-
if (stops.length === 1) {
|
|
3114
|
-
stops.unshift(0);
|
|
3115
|
-
}
|
|
3116
|
-
const unit = getUnit(stops);
|
|
3117
|
-
const length = getMaxPathLength(el);
|
|
3118
|
-
stops = parseStops(stops.reverse(), (stop) => {
|
|
3119
|
-
stop = toFloat(stop);
|
|
3120
|
-
return unit === "%" ? stop * length / 100 : stop;
|
|
3121
|
-
});
|
|
3122
|
-
if (!stops.some(([value]) => value)) {
|
|
3123
|
-
return noop;
|
|
3124
|
-
}
|
|
3125
|
-
css(el, "strokeDasharray", length);
|
|
3126
|
-
return (css2, percent) => {
|
|
3127
|
-
css2.strokeDashoffset = getValue(stops, percent);
|
|
3128
|
-
};
|
|
3129
|
-
}
|
|
3130
|
-
function backgroundFn(prop, el, stops, props2) {
|
|
3131
|
-
if (stops.length === 1) {
|
|
3132
|
-
stops.unshift(0);
|
|
3133
|
-
}
|
|
3134
|
-
const attr = prop === "bgy" ? "height" : "width";
|
|
3135
|
-
props2[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));
|
|
3136
|
-
const bgProps = ["bgx", "bgy"].filter((prop2) => prop2 in props2);
|
|
3137
|
-
if (bgProps.length === 2 && prop === "bgx") {
|
|
3138
|
-
return noop;
|
|
3139
|
-
}
|
|
3140
|
-
if (getCssValue(el, "backgroundSize", "") === "cover") {
|
|
3141
|
-
return backgroundCoverFn(prop, el, stops, props2);
|
|
3142
|
-
}
|
|
3143
|
-
const positions = {};
|
|
3144
|
-
for (const prop2 of bgProps) {
|
|
3145
|
-
positions[prop2] = getBackgroundPos(el, prop2);
|
|
3146
|
-
}
|
|
3147
|
-
return setBackgroundPosFn(bgProps, positions, props2);
|
|
3148
|
-
}
|
|
3149
|
-
function backgroundCoverFn(prop, el, stops, props2) {
|
|
3150
|
-
const dimImage = getBackgroundImageDimensions(el);
|
|
3151
|
-
if (!dimImage.width) {
|
|
3152
|
-
return noop;
|
|
3153
|
-
}
|
|
3154
|
-
const dimEl = {
|
|
3155
|
-
width: el.offsetWidth,
|
|
3156
|
-
height: el.offsetHeight
|
|
3157
|
-
};
|
|
3158
|
-
const bgProps = ["bgx", "bgy"].filter((prop2) => prop2 in props2);
|
|
3159
|
-
const positions = {};
|
|
3160
|
-
for (const prop2 of bgProps) {
|
|
3161
|
-
const values = props2[prop2].map(([value]) => value);
|
|
3162
|
-
const min = Math.min(...values);
|
|
3163
|
-
const max = Math.max(...values);
|
|
3164
|
-
const down = values.indexOf(min) < values.indexOf(max);
|
|
3165
|
-
const diff = max - min;
|
|
3166
|
-
positions[prop2] = `${(down ? -diff : 0) - (down ? min : max)}px`;
|
|
3167
|
-
dimEl[prop2 === "bgy" ? "height" : "width"] += diff;
|
|
3168
|
-
}
|
|
3169
|
-
const dim = Dimensions.cover(dimImage, dimEl);
|
|
3170
|
-
for (const prop2 of bgProps) {
|
|
3171
|
-
const attr = prop2 === "bgy" ? "height" : "width";
|
|
3172
|
-
const overflow = dim[attr] - dimEl[attr];
|
|
3173
|
-
positions[prop2] = `max(${getBackgroundPos(el, prop2)},-${overflow}px) + ${positions[prop2]}`;
|
|
3174
|
-
}
|
|
3175
|
-
const fn = setBackgroundPosFn(bgProps, positions, props2);
|
|
3176
|
-
return (css2, percent) => {
|
|
3177
|
-
fn(css2, percent);
|
|
3178
|
-
css2.backgroundSize = `${dim.width}px ${dim.height}px`;
|
|
3179
|
-
css2.backgroundRepeat = "no-repeat";
|
|
3180
|
-
};
|
|
3181
|
-
}
|
|
3182
|
-
function getBackgroundPos(el, prop) {
|
|
3183
|
-
return getCssValue(el, `background-position-${prop.slice(-1)}`, "");
|
|
3184
|
-
}
|
|
3185
|
-
function setBackgroundPosFn(bgProps, positions, props2) {
|
|
3186
|
-
return function(css2, percent) {
|
|
3187
|
-
for (const prop of bgProps) {
|
|
3188
|
-
const value = getValue(props2[prop], percent);
|
|
3189
|
-
css2[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;
|
|
3190
|
-
}
|
|
3191
|
-
};
|
|
3192
|
-
}
|
|
3193
|
-
const loading = {};
|
|
3194
|
-
const dimensions = {};
|
|
3195
|
-
function getBackgroundImageDimensions(el) {
|
|
3196
|
-
const src = css(el, "backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/, "$1");
|
|
3197
|
-
if (dimensions[src]) {
|
|
3198
|
-
return dimensions[src];
|
|
3199
|
-
}
|
|
3200
|
-
const image = new Image();
|
|
3201
|
-
if (src) {
|
|
3202
|
-
image.src = src;
|
|
3203
|
-
if (!image.naturalWidth && !loading[src]) {
|
|
3204
|
-
once(image, "error load", () => {
|
|
3205
|
-
dimensions[src] = toDimensions(image);
|
|
3206
|
-
trigger(el, createEvent("load", false));
|
|
3207
|
-
});
|
|
3208
|
-
loading[src] = true;
|
|
3209
|
-
return toDimensions(image);
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
return dimensions[src] = toDimensions(image);
|
|
3213
|
-
}
|
|
3214
|
-
function toDimensions(image) {
|
|
3215
|
-
return {
|
|
3216
|
-
width: image.naturalWidth,
|
|
3217
|
-
height: image.naturalHeight
|
|
3218
|
-
};
|
|
3219
|
-
}
|
|
3220
|
-
function parseStops(stops, fn = toFloat) {
|
|
3221
|
-
const result = [];
|
|
3222
|
-
const { length } = stops;
|
|
3223
|
-
let nullIndex = 0;
|
|
3224
|
-
for (let i = 0; i < length; i++) {
|
|
3225
|
-
let [value, percent] = isString(stops[i]) ? stops[i].trim().split(/ (?![^(]*\))/) : [stops[i]];
|
|
3226
|
-
value = fn(value);
|
|
3227
|
-
percent = percent ? toFloat(percent) / 100 : null;
|
|
3228
|
-
if (i === 0) {
|
|
3229
|
-
if (percent === null) {
|
|
3230
|
-
percent = 0;
|
|
3231
|
-
} else if (percent) {
|
|
3232
|
-
result.push([value, 0]);
|
|
3233
|
-
}
|
|
3234
|
-
} else if (i === length - 1) {
|
|
3235
|
-
if (percent === null) {
|
|
3236
|
-
percent = 1;
|
|
3237
|
-
} else if (percent !== 1) {
|
|
3238
|
-
result.push([value, percent]);
|
|
3239
|
-
percent = 1;
|
|
3240
|
-
}
|
|
3241
|
-
}
|
|
3242
|
-
result.push([value, percent]);
|
|
3243
|
-
if (percent === null) {
|
|
3244
|
-
nullIndex++;
|
|
3245
|
-
} else if (nullIndex) {
|
|
3246
|
-
const leftPercent = result[i - nullIndex - 1][1];
|
|
3247
|
-
const p = (percent - leftPercent) / (nullIndex + 1);
|
|
3248
|
-
for (let j = nullIndex; j > 0; j--) {
|
|
3249
|
-
result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
|
|
3250
|
-
}
|
|
3251
|
-
nullIndex = 0;
|
|
3252
|
-
}
|
|
3253
|
-
}
|
|
3254
|
-
return result;
|
|
3255
|
-
}
|
|
3256
|
-
function getStop(stops, percent) {
|
|
3257
|
-
const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;
|
|
3258
|
-
return [
|
|
3259
|
-
stops[index - 1][0],
|
|
3260
|
-
stops[index][0],
|
|
3261
|
-
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])
|
|
3262
|
-
];
|
|
3263
|
-
}
|
|
3264
|
-
function getValue(stops, percent) {
|
|
3265
|
-
const [start, end, p] = getStop(stops, percent);
|
|
3266
|
-
return start + (end - start) * p;
|
|
3267
|
-
}
|
|
3268
|
-
const unitRe = /^-?\d+(?:\.\d+)?(\S+)?/;
|
|
3269
|
-
function getUnit(stops, defaultUnit) {
|
|
3270
|
-
var _a;
|
|
3271
|
-
for (const stop of stops) {
|
|
3272
|
-
const match = (_a = stop.match) == null ? void 0 : _a.call(stop, unitRe);
|
|
3273
|
-
if (match) {
|
|
3274
|
-
return match[1];
|
|
3275
|
-
}
|
|
3276
|
-
}
|
|
3277
|
-
return defaultUnit;
|
|
3278
|
-
}
|
|
3279
|
-
function getCssValue(el, prop, value) {
|
|
3280
|
-
const prev = el.style[prop];
|
|
3281
|
-
const val = css(css(el, prop, value), prop);
|
|
3282
|
-
el.style[prop] = prev;
|
|
3283
|
-
return val;
|
|
3284
|
-
}
|
|
3285
|
-
function fillObject(keys2, value) {
|
|
3286
|
-
return Object.fromEntries(keys2.map((prop) => [prop, value]));
|
|
3287
|
-
}
|
|
3288
|
-
function ease(percent, easing) {
|
|
3289
|
-
return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);
|
|
3290
|
-
}
|
|
3291
|
-
|
|
3292
|
-
var ScrollDriven = {
|
|
3293
|
-
props: {
|
|
3294
|
-
parallaxTarget: Boolean,
|
|
3295
|
-
parallaxStart: String,
|
|
3296
|
-
parallaxEnd: String,
|
|
3297
|
-
parallaxEasing: Number
|
|
3298
|
-
},
|
|
3299
|
-
data: {
|
|
3300
|
-
parallaxTarget: false,
|
|
3301
|
-
parallaxStart: 0,
|
|
3302
|
-
parallaxEnd: 0,
|
|
3303
|
-
parallaxEasing: 0
|
|
3304
|
-
},
|
|
3305
|
-
observe: [
|
|
3306
|
-
resize({
|
|
3307
|
-
target: ({ $el, parallaxTarget }) => [$el, parallaxTarget],
|
|
3308
|
-
filter: ({ parallax }) => parallax
|
|
3309
|
-
}),
|
|
3310
|
-
scroll$1({ filter: ({ parallax }) => parallax })
|
|
3311
|
-
],
|
|
3312
|
-
computed: {
|
|
3313
|
-
parallaxTargetFallback: ($props, $el) => $el,
|
|
3314
|
-
parallaxTarget({ parallaxTarget }, $el) {
|
|
3315
|
-
return parallaxTarget && query(parallaxTarget, $el) || this.parallaxTargetFallback;
|
|
3316
|
-
}
|
|
3317
|
-
},
|
|
3318
|
-
update: {
|
|
3319
|
-
read() {
|
|
3320
|
-
if (!this.parallax) {
|
|
3321
|
-
return;
|
|
3322
|
-
}
|
|
3323
|
-
const target = this.parallaxTarget;
|
|
3324
|
-
if (!target) {
|
|
3325
|
-
return;
|
|
3326
|
-
}
|
|
3327
|
-
const start = toPx(this.parallaxStart, "height", target, true);
|
|
3328
|
-
const end = toPx(this.parallaxEnd, "height", target, true);
|
|
3329
|
-
const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);
|
|
3330
|
-
return { percent };
|
|
3331
|
-
},
|
|
3332
|
-
events: ["scroll", "resize"]
|
|
3333
|
-
}
|
|
3334
|
-
};
|
|
3335
|
-
|
|
3336
|
-
const loopKey = /* @__PURE__ */ Symbol();
|
|
3337
2912
|
var Video = {
|
|
3338
|
-
mixins: [ScrollDriven],
|
|
3339
2913
|
args: "autoplay",
|
|
3340
2914
|
props: {
|
|
3341
2915
|
automute: Boolean,
|
|
3342
2916
|
autoplay: Boolean,
|
|
3343
2917
|
restart: Boolean,
|
|
3344
|
-
|
|
3345
|
-
inviewQueued: Number,
|
|
3346
|
-
hoverTarget: Boolean,
|
|
3347
|
-
hoverRewind: Number,
|
|
3348
|
-
reducedMotionTime: Number
|
|
2918
|
+
hoverTarget: Boolean
|
|
3349
2919
|
},
|
|
3350
2920
|
data: {
|
|
3351
2921
|
automute: false,
|
|
3352
2922
|
autoplay: true,
|
|
3353
2923
|
restart: false,
|
|
3354
|
-
|
|
3355
|
-
inviewQueued: 0,
|
|
3356
|
-
hoverTarget: false,
|
|
3357
|
-
hoverRewind: 0,
|
|
3358
|
-
reducedMotionTime: 0
|
|
2924
|
+
hoverTarget: false
|
|
3359
2925
|
},
|
|
3360
2926
|
beforeConnect() {
|
|
3361
2927
|
const isVideo = isTag(this.$el, "video");
|
|
3362
|
-
this.restart = isVideo && this.restart;
|
|
3363
|
-
this.parallax = isVideo && this.autoplay === "parallax";
|
|
3364
|
-
this.manualControl = ["hover", "parallax"].includes(this.autoplay);
|
|
3365
|
-
this.inviewQueued = this.autoplay === "inview" && this.inviewQueued;
|
|
3366
|
-
if (this.inviewQueued) {
|
|
3367
|
-
this.$el[loopKey] = this.$el.loop;
|
|
3368
|
-
this.$el.loop = false;
|
|
3369
|
-
}
|
|
3370
2928
|
if (this.autoplay === "inview" && isVideo && !hasAttr(this.$el, "preload")) {
|
|
3371
2929
|
this.$el.preload = "none";
|
|
3372
2930
|
}
|
|
@@ -3375,10 +2933,7 @@
|
|
|
3375
2933
|
}
|
|
3376
2934
|
if (this.autoplay === "hover") {
|
|
3377
2935
|
if (isVideo) {
|
|
3378
|
-
this.
|
|
3379
|
-
if (!isFocusable(this.hoverTarget)) {
|
|
3380
|
-
this.hoverTarget.tabIndex = 0;
|
|
3381
|
-
}
|
|
2936
|
+
this.$el.tabIndex = 0;
|
|
3382
2937
|
} else {
|
|
3383
2938
|
this.autoplay = true;
|
|
3384
2939
|
}
|
|
@@ -3387,49 +2942,28 @@
|
|
|
3387
2942
|
mute(this.$el);
|
|
3388
2943
|
}
|
|
3389
2944
|
},
|
|
3390
|
-
disconnected() {
|
|
3391
|
-
if (this.$el[loopKey]) {
|
|
3392
|
-
this.$el.loop = true;
|
|
3393
|
-
}
|
|
3394
|
-
queue.delete(this.$el);
|
|
3395
|
-
},
|
|
3396
2945
|
events: [
|
|
3397
2946
|
{
|
|
3398
2947
|
name: `${pointerEnter} focusin`,
|
|
3399
|
-
el: ({ hoverTarget }) => hoverTarget,
|
|
2948
|
+
el: ({ hoverTarget, $el }) => query(hoverTarget, $el) || $el,
|
|
3400
2949
|
filter: ({ autoplay }) => autoplay === "hover",
|
|
3401
2950
|
handler(e) {
|
|
3402
|
-
var _a;
|
|
3403
|
-
(_a = this._reverseAbort) == null ? void 0 : _a.abort();
|
|
3404
2951
|
if (!isTouch(e) || !isPlaying(this.$el)) {
|
|
3405
|
-
|
|
2952
|
+
play(this.$el);
|
|
3406
2953
|
} else {
|
|
3407
|
-
this.
|
|
2954
|
+
pauseHover(this.$el, this.restart);
|
|
3408
2955
|
}
|
|
3409
2956
|
}
|
|
3410
2957
|
},
|
|
3411
2958
|
{
|
|
3412
2959
|
name: `${pointerLeave} focusout`,
|
|
3413
|
-
el: ({ hoverTarget }) => hoverTarget,
|
|
2960
|
+
el: ({ hoverTarget, $el }) => query(hoverTarget, $el) || $el,
|
|
3414
2961
|
filter: ({ autoplay }) => autoplay === "hover",
|
|
3415
2962
|
handler(e) {
|
|
3416
|
-
var _a;
|
|
3417
2963
|
if (!isTouch(e)) {
|
|
3418
|
-
(
|
|
3419
|
-
this.pause();
|
|
3420
|
-
this._reverseAbort = playReverse(this.$el, this.hoverRewind);
|
|
2964
|
+
pauseHover(this.$el, this.restart);
|
|
3421
2965
|
}
|
|
3422
2966
|
}
|
|
3423
|
-
},
|
|
3424
|
-
{
|
|
3425
|
-
name: "error pause ended",
|
|
3426
|
-
filter: ({ inviewQueued }) => inviewQueued,
|
|
3427
|
-
handler(e) {
|
|
3428
|
-
if (e.type === "error" || e.type === "ended" && !this.$el[loopKey]) {
|
|
3429
|
-
queue.delete(this.$el);
|
|
3430
|
-
}
|
|
3431
|
-
playNextQueued();
|
|
3432
|
-
}
|
|
3433
2967
|
}
|
|
3434
2968
|
],
|
|
3435
2969
|
observe: [
|
|
@@ -3441,118 +2975,33 @@
|
|
|
3441
2975
|
}
|
|
3442
2976
|
}),
|
|
3443
2977
|
intersection({
|
|
3444
|
-
filter: ({ $el,
|
|
3445
|
-
handler([{ isIntersecting }]) {
|
|
2978
|
+
filter: ({ $el, autoplay }) => autoplay !== "hover" && $el.preload !== "none",
|
|
2979
|
+
handler([{ isIntersecting, target }]) {
|
|
3446
2980
|
if (!document.fullscreenElement) {
|
|
3447
2981
|
if (isIntersecting) {
|
|
3448
2982
|
if (this.autoplay) {
|
|
3449
|
-
|
|
2983
|
+
play(target);
|
|
3450
2984
|
}
|
|
3451
2985
|
} else {
|
|
3452
|
-
this.
|
|
2986
|
+
pauseHover(target, this.restart);
|
|
3453
2987
|
}
|
|
3454
2988
|
}
|
|
3455
2989
|
},
|
|
3456
2990
|
args: { intersecting: false },
|
|
3457
|
-
options: ({ $el, autoplay
|
|
3458
|
-
root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
|
|
3459
|
-
rootMargin: autoplay === "inview" ? inviewMargin : "0px"
|
|
2991
|
+
options: ({ $el, autoplay }) => ({
|
|
2992
|
+
root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
|
|
3460
2993
|
})
|
|
3461
2994
|
})
|
|
3462
|
-
]
|
|
3463
|
-
update: {
|
|
3464
|
-
write({ percent }) {
|
|
3465
|
-
if (!this.parallax) {
|
|
3466
|
-
return;
|
|
3467
|
-
}
|
|
3468
|
-
const { duration, seeking } = this.$el;
|
|
3469
|
-
if (!isNaN(duration) && !seeking) {
|
|
3470
|
-
this.$el.currentTime = percent * duration;
|
|
3471
|
-
}
|
|
3472
|
-
},
|
|
3473
|
-
events: ["scroll", "resize"]
|
|
3474
|
-
},
|
|
3475
|
-
methods: {
|
|
3476
|
-
_autoplay() {
|
|
3477
|
-
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
3478
|
-
this.pause();
|
|
3479
|
-
if (isTag(this.$el, "video")) {
|
|
3480
|
-
this.$el.currentTime = this.reducedMotionTime;
|
|
3481
|
-
}
|
|
3482
|
-
} else {
|
|
3483
|
-
this.play();
|
|
3484
|
-
}
|
|
3485
|
-
},
|
|
3486
|
-
play() {
|
|
3487
|
-
if (this.inviewQueued) {
|
|
3488
|
-
queue.set(this.$el, this.inviewQueued);
|
|
3489
|
-
playNextQueued();
|
|
3490
|
-
} else {
|
|
3491
|
-
play(this.$el);
|
|
3492
|
-
}
|
|
3493
|
-
},
|
|
3494
|
-
pause() {
|
|
3495
|
-
pause(this.$el);
|
|
3496
|
-
queue.delete(this.$el);
|
|
3497
|
-
if (this.restart) {
|
|
3498
|
-
this.$el.currentTime = 0;
|
|
3499
|
-
}
|
|
3500
|
-
}
|
|
3501
|
-
}
|
|
2995
|
+
]
|
|
3502
2996
|
};
|
|
3503
2997
|
function isPlaying(videoEl) {
|
|
3504
2998
|
return !videoEl.paused && !videoEl.ended;
|
|
3505
2999
|
}
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
cancelAnimationFrame(frame);
|
|
3511
|
-
await new Promise((resolve) => frame = requestAnimationFrame(resolve));
|
|
3512
|
-
const getPlayed = (el) => {
|
|
3513
|
-
var _a;
|
|
3514
|
-
return (_a = played.get(el)) != null ? _a : 0;
|
|
3515
|
-
};
|
|
3516
|
-
const videos = shuffle(queue.keys()).sort((a, b) => getPlayed(a) - getPlayed(b));
|
|
3517
|
-
for (const el of videos) {
|
|
3518
|
-
const maxQueued = queue.get(el);
|
|
3519
|
-
if (isPlaying(el) || videos.filter(isPlaying).length / queue.size >= maxQueued) {
|
|
3520
|
-
continue;
|
|
3521
|
-
}
|
|
3522
|
-
played.set(el, getPlayed(el) + 1);
|
|
3523
|
-
play(el);
|
|
3524
|
-
}
|
|
3525
|
-
}
|
|
3526
|
-
function shuffle(array) {
|
|
3527
|
-
array = [...array];
|
|
3528
|
-
for (let i = array.length - 1; i > 0; i--) {
|
|
3529
|
-
let j = Math.floor(Math.random() * (i + 1));
|
|
3530
|
-
[array[i], array[j]] = [array[j], array[i]];
|
|
3531
|
-
}
|
|
3532
|
-
return array;
|
|
3533
|
-
}
|
|
3534
|
-
function playReverse(el, playbackRate) {
|
|
3535
|
-
const start = el.currentTime;
|
|
3536
|
-
if (isNaN(start) || !playbackRate) {
|
|
3537
|
-
return;
|
|
3000
|
+
function pauseHover(el, restart) {
|
|
3001
|
+
pause(el);
|
|
3002
|
+
if (restart && isTag(el, "video")) {
|
|
3003
|
+
el.currentTime = 0;
|
|
3538
3004
|
}
|
|
3539
|
-
playbackRate *= Math.max(1, start / 10 + 0.5);
|
|
3540
|
-
const controller = new AbortController();
|
|
3541
|
-
const time = Date.now();
|
|
3542
|
-
(function next() {
|
|
3543
|
-
requestAnimationFrame(() => {
|
|
3544
|
-
if (controller.signal.aborted) {
|
|
3545
|
-
return;
|
|
3546
|
-
}
|
|
3547
|
-
if (!el.seeking) {
|
|
3548
|
-
el.currentTime = Math.max(0, start - (Date.now() - time) * playbackRate / 1e3);
|
|
3549
|
-
}
|
|
3550
|
-
if (el.currentTime > 0) {
|
|
3551
|
-
next();
|
|
3552
|
-
}
|
|
3553
|
-
});
|
|
3554
|
-
})();
|
|
3555
|
-
return controller;
|
|
3556
3005
|
}
|
|
3557
3006
|
|
|
3558
3007
|
var cover = {
|
|
@@ -3628,7 +3077,7 @@
|
|
|
3628
3077
|
inset: false
|
|
3629
3078
|
},
|
|
3630
3079
|
connected() {
|
|
3631
|
-
this.pos =
|
|
3080
|
+
this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
|
|
3632
3081
|
[this.dir, this.align] = this.pos;
|
|
3633
3082
|
this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
|
|
3634
3083
|
},
|
|
@@ -3648,7 +3097,7 @@
|
|
|
3648
3097
|
placement.reverse();
|
|
3649
3098
|
}
|
|
3650
3099
|
const restoreScrollPosition = storeScrollPosition(element);
|
|
3651
|
-
const elDim = dimensions
|
|
3100
|
+
const elDim = dimensions(element);
|
|
3652
3101
|
css(element, { top: -elDim.height, left: -elDim.width });
|
|
3653
3102
|
positionAt(element, target, {
|
|
3654
3103
|
attach,
|
|
@@ -4013,7 +3462,6 @@
|
|
|
4013
3462
|
css(this.$el, this._style);
|
|
4014
3463
|
this.$el.hidden = true;
|
|
4015
3464
|
const viewports = this.target.map((target) => getViewport$1(this.$el, target));
|
|
4016
|
-
const boundaryOffsets = this.boundary.map((el) => offset(el));
|
|
4017
3465
|
const viewportOffset = this.getViewportOffset(this.$el);
|
|
4018
3466
|
const dirs = [
|
|
4019
3467
|
[0, ["x", "width", "left", "right"]],
|
|
@@ -4023,7 +3471,7 @@
|
|
|
4023
3471
|
if (this.axis !== axis && includes([axis, true], this.stretch)) {
|
|
4024
3472
|
css(this.$el, {
|
|
4025
3473
|
[prop]: Math.min(
|
|
4026
|
-
|
|
3474
|
+
offset(this.boundary[i])[prop],
|
|
4027
3475
|
viewports[i][prop] - 2 * viewportOffset
|
|
4028
3476
|
),
|
|
4029
3477
|
[`overflow-${axis}`]: "auto"
|
|
@@ -4045,10 +3493,10 @@
|
|
|
4045
3493
|
const elOffset = offset(this.$el);
|
|
4046
3494
|
css(this.$el, {
|
|
4047
3495
|
[prop]: (targetOffset[start] > elOffset[start] ? targetOffset[this.inset ? end : start] - Math.max(
|
|
4048
|
-
|
|
3496
|
+
offset(this.boundary[i])[start],
|
|
4049
3497
|
viewports[i][start] + viewportOffset
|
|
4050
3498
|
) : Math.min(
|
|
4051
|
-
|
|
3499
|
+
offset(this.boundary[i])[end],
|
|
4052
3500
|
viewports[i][end] - viewportOffset
|
|
4053
3501
|
) - targetOffset[this.inset ? start : end]) - positionOffset,
|
|
4054
3502
|
[`overflow-${axis}`]: "auto"
|
|
@@ -4068,6 +3516,11 @@
|
|
|
4068
3516
|
if (el) {
|
|
4069
3517
|
drop.$create("toggle", el, { target: drop.$el, mode: drop.mode });
|
|
4070
3518
|
el.ariaHasPopup = true;
|
|
3519
|
+
const dropEl = drop.$el;
|
|
3520
|
+
if (!dropEl.id) {
|
|
3521
|
+
dropEl.id = generateId(drop, dropEl);
|
|
3522
|
+
}
|
|
3523
|
+
attr(el, "aria-controls", dropEl.id);
|
|
4071
3524
|
}
|
|
4072
3525
|
return el;
|
|
4073
3526
|
}
|
|
@@ -4077,7 +3530,7 @@
|
|
|
4077
3530
|
observeViewportResize(update),
|
|
4078
3531
|
observeResize(overflowParents(drop.$el).concat(drop.target), update)
|
|
4079
3532
|
];
|
|
4080
|
-
return () => off.
|
|
3533
|
+
return () => off.map((observer) => observer.disconnect());
|
|
4081
3534
|
}
|
|
4082
3535
|
function listenForScroll(drop, fn = () => drop.$emit()) {
|
|
4083
3536
|
return on([document, ...overflowParents(drop.$el)], "scroll", fn, {
|
|
@@ -4312,9 +3765,7 @@
|
|
|
4312
3765
|
const drop = this.getDropdown(target);
|
|
4313
3766
|
const adjustHeight = () => {
|
|
4314
3767
|
const maxBottom = Math.max(
|
|
4315
|
-
...
|
|
4316
|
-
(el) => offset(el).bottom
|
|
4317
|
-
)
|
|
3768
|
+
...parents(target, `.${this.clsDrop}`).concat(target).map((el) => offset(el).bottom)
|
|
4318
3769
|
);
|
|
4319
3770
|
offset(this.dropbar, {
|
|
4320
3771
|
left: offset(this.dropbar).left,
|
|
@@ -4494,12 +3945,10 @@
|
|
|
4494
3945
|
var Margin = {
|
|
4495
3946
|
props: {
|
|
4496
3947
|
margin: String,
|
|
4497
|
-
firstRow: Boolean,
|
|
4498
3948
|
firstColumn: Boolean
|
|
4499
3949
|
},
|
|
4500
3950
|
data: {
|
|
4501
3951
|
margin: "uk-margin-small-top",
|
|
4502
|
-
firstRow: false,
|
|
4503
3952
|
firstColumn: "uk-first-column"
|
|
4504
3953
|
},
|
|
4505
3954
|
observe: [
|
|
@@ -4539,7 +3988,6 @@
|
|
|
4539
3988
|
for (const row of rows) {
|
|
4540
3989
|
for (const el of row) {
|
|
4541
3990
|
toggleClass(el, this.margin, rows[0] !== row);
|
|
4542
|
-
toggleClass(el, this.firstRow, rows[0] === row);
|
|
4543
3991
|
toggleClass(el, this.firstColumn, row[isRtl ? row.length - 1 : 0] === el);
|
|
4544
3992
|
}
|
|
4545
3993
|
}
|
|
@@ -4612,8 +4060,7 @@
|
|
|
4612
4060
|
parallaxJustify: Boolean
|
|
4613
4061
|
},
|
|
4614
4062
|
data: {
|
|
4615
|
-
margin: "",
|
|
4616
|
-
firstRow: "uk-first-row",
|
|
4063
|
+
margin: "uk-grid-margin",
|
|
4617
4064
|
clsStack: "uk-grid-stack",
|
|
4618
4065
|
masonry: false,
|
|
4619
4066
|
parallax: 0,
|
|
@@ -4635,14 +4082,14 @@
|
|
|
4635
4082
|
{
|
|
4636
4083
|
read(data) {
|
|
4637
4084
|
const { rows } = data;
|
|
4638
|
-
let { masonry, parallax, parallaxJustify } = this;
|
|
4085
|
+
let { masonry, parallax, parallaxJustify, margin } = this;
|
|
4639
4086
|
parallax = Math.max(0, toPx(parallax));
|
|
4640
4087
|
if (!(masonry || parallax || parallaxJustify) || positionedAbsolute(rows) || rows[0].some(
|
|
4641
4088
|
(el, i) => rows.some((row) => row[i] && row[i].offsetWidth !== el.offsetWidth)
|
|
4642
4089
|
)) {
|
|
4643
4090
|
return data.translates = data.scrollColumns = false;
|
|
4644
4091
|
}
|
|
4645
|
-
let gutter =
|
|
4092
|
+
let gutter = getGutter(rows, margin);
|
|
4646
4093
|
let columns;
|
|
4647
4094
|
let translates;
|
|
4648
4095
|
if (masonry) {
|
|
@@ -4735,6 +4182,10 @@
|
|
|
4735
4182
|
}
|
|
4736
4183
|
return [columns, translates];
|
|
4737
4184
|
}
|
|
4185
|
+
function getGutter(rows, cls) {
|
|
4186
|
+
const node = rows.flat().find((el) => hasClass(el, cls));
|
|
4187
|
+
return toFloat(node ? css(node, "marginTop") : css(rows[0][0], "paddingLeft"));
|
|
4188
|
+
}
|
|
4738
4189
|
function transpose(rows) {
|
|
4739
4190
|
const columns = [];
|
|
4740
4191
|
for (const row of rows) {
|
|
@@ -4765,7 +4216,7 @@
|
|
|
4765
4216
|
elements: ({ target }, $el) => $$(target, $el)
|
|
4766
4217
|
},
|
|
4767
4218
|
observe: resize({
|
|
4768
|
-
target: ({ $el, elements }) =>
|
|
4219
|
+
target: ({ $el, elements }) => elements.reduce((elements2, el) => elements2.concat(el, ...el.children), [$el])
|
|
4769
4220
|
}),
|
|
4770
4221
|
events: {
|
|
4771
4222
|
// Hidden elements may change height when fonts load
|
|
@@ -4806,7 +4257,7 @@
|
|
|
4806
4257
|
css(element, "display", "block", "important");
|
|
4807
4258
|
}
|
|
4808
4259
|
css(element, "minHeight", "");
|
|
4809
|
-
const height = dimensions
|
|
4260
|
+
const height = dimensions(element).height - boxModelAdjust(element, "height", "content-box");
|
|
4810
4261
|
css(element, style);
|
|
4811
4262
|
return height;
|
|
4812
4263
|
}
|
|
@@ -4837,6 +4288,45 @@
|
|
|
4837
4288
|
}
|
|
4838
4289
|
};
|
|
4839
4290
|
|
|
4291
|
+
var Media = {
|
|
4292
|
+
props: {
|
|
4293
|
+
media: Boolean
|
|
4294
|
+
},
|
|
4295
|
+
data: {
|
|
4296
|
+
media: false
|
|
4297
|
+
},
|
|
4298
|
+
connected() {
|
|
4299
|
+
const media = toMedia(this.media, this.$el);
|
|
4300
|
+
this.matchMedia = true;
|
|
4301
|
+
if (media) {
|
|
4302
|
+
this.mediaObj = window.matchMedia(media);
|
|
4303
|
+
const handler = () => {
|
|
4304
|
+
this.matchMedia = this.mediaObj.matches;
|
|
4305
|
+
trigger(this.$el, createEvent("mediachange", false, true, [this.mediaObj]));
|
|
4306
|
+
};
|
|
4307
|
+
this.offMediaObj = on(this.mediaObj, "change", () => {
|
|
4308
|
+
handler();
|
|
4309
|
+
this.$emit("resize");
|
|
4310
|
+
});
|
|
4311
|
+
handler();
|
|
4312
|
+
}
|
|
4313
|
+
},
|
|
4314
|
+
disconnected() {
|
|
4315
|
+
var _a;
|
|
4316
|
+
(_a = this.offMediaObj) == null ? void 0 : _a.call(this);
|
|
4317
|
+
}
|
|
4318
|
+
};
|
|
4319
|
+
function toMedia(value, element) {
|
|
4320
|
+
if (isString(value)) {
|
|
4321
|
+
if (startsWith(value, "@")) {
|
|
4322
|
+
value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));
|
|
4323
|
+
} else if (isNaN(value)) {
|
|
4324
|
+
return value;
|
|
4325
|
+
}
|
|
4326
|
+
}
|
|
4327
|
+
return value && isNumeric(value) ? `(min-width: ${value}px)` : "";
|
|
4328
|
+
}
|
|
4329
|
+
|
|
4840
4330
|
var heightViewport = {
|
|
4841
4331
|
mixins: [Media],
|
|
4842
4332
|
props: {
|
|
@@ -4875,7 +4365,7 @@
|
|
|
4875
4365
|
const isScrollingElement = scrollingElement === scrollElement || body === scrollElement;
|
|
4876
4366
|
let minHeight = `calc(${isScrollingElement ? "100vh" : `${viewportHeight}px`}`;
|
|
4877
4367
|
if (this.expand) {
|
|
4878
|
-
const diff = dimensions
|
|
4368
|
+
const diff = dimensions(scrollElement).height - dimensions(this.$el).height;
|
|
4879
4369
|
minHeight += ` - ${diff}px`;
|
|
4880
4370
|
} else {
|
|
4881
4371
|
if (this.offsetTop) {
|
|
@@ -4888,13 +4378,13 @@
|
|
|
4888
4378
|
}
|
|
4889
4379
|
}
|
|
4890
4380
|
if (this.offsetBottom === true) {
|
|
4891
|
-
minHeight += ` - ${dimensions
|
|
4381
|
+
minHeight += ` - ${dimensions(this.$el.nextElementSibling).height}px`;
|
|
4892
4382
|
} else if (isNumeric(this.offsetBottom)) {
|
|
4893
4383
|
minHeight += ` - ${this.offsetBottom}vh`;
|
|
4894
4384
|
} else if (this.offsetBottom && endsWith(this.offsetBottom, "px")) {
|
|
4895
4385
|
minHeight += ` - ${toFloat(this.offsetBottom)}px`;
|
|
4896
4386
|
} else if (isString(this.offsetBottom)) {
|
|
4897
|
-
minHeight += ` - ${dimensions
|
|
4387
|
+
minHeight += ` - ${dimensions(query(this.offsetBottom, this.$el)).height}px`;
|
|
4898
4388
|
}
|
|
4899
4389
|
}
|
|
4900
4390
|
minHeight += `${box ? ` - ${box}px` : ""})`;
|
|
@@ -5446,8 +4936,8 @@
|
|
|
5446
4936
|
}
|
|
5447
4937
|
};
|
|
5448
4938
|
function findTargetColor(target) {
|
|
5449
|
-
const dim = dimensions
|
|
5450
|
-
const viewport = dimensions
|
|
4939
|
+
const dim = dimensions(target);
|
|
4940
|
+
const viewport = dimensions(window);
|
|
5451
4941
|
if (!intersectRect(dim, viewport)) {
|
|
5452
4942
|
return false;
|
|
5453
4943
|
}
|
|
@@ -5686,13 +5176,12 @@
|
|
|
5686
5176
|
}
|
|
5687
5177
|
}
|
|
5688
5178
|
};
|
|
5689
|
-
const rejectKey = /* @__PURE__ */ Symbol();
|
|
5690
5179
|
function animate(el, show, { transitionElement, _toggle }) {
|
|
5691
5180
|
return new Promise(
|
|
5692
5181
|
(resolve, reject) => once(el, "show hide", () => {
|
|
5693
5182
|
var _a;
|
|
5694
|
-
(_a = el
|
|
5695
|
-
el
|
|
5183
|
+
(_a = el._reject) == null ? void 0 : _a.call(el);
|
|
5184
|
+
el._reject = reject;
|
|
5696
5185
|
_toggle(el, show);
|
|
5697
5186
|
const off = once(
|
|
5698
5187
|
transitionElement,
|
|
@@ -5713,7 +5202,7 @@
|
|
|
5713
5202
|
toMs(css(transitionElement, "transitionDuration"))
|
|
5714
5203
|
);
|
|
5715
5204
|
})
|
|
5716
|
-
).then(() => delete el
|
|
5205
|
+
).then(() => delete el._reject);
|
|
5717
5206
|
}
|
|
5718
5207
|
function toMs(time) {
|
|
5719
5208
|
return time ? endsWith(time, "ms") ? toFloat(time) : toFloat(time) * 1e3 : 0;
|
|
@@ -5723,7 +5212,7 @@
|
|
|
5723
5212
|
if (last(active) !== modal || modal.$el.contains(e.target)) {
|
|
5724
5213
|
return;
|
|
5725
5214
|
}
|
|
5726
|
-
const { left, top, width, height } = dimensions
|
|
5215
|
+
const { left, top, width, height } = dimensions(e.target);
|
|
5727
5216
|
const topEl = document.elementFromPoint(left + width / 2, top + height / 2);
|
|
5728
5217
|
if (topEl && (e.target.contains(topEl) || topEl.contains(e.target))) {
|
|
5729
5218
|
return;
|
|
@@ -6101,7 +5590,7 @@
|
|
|
6101
5590
|
return {
|
|
6102
5591
|
max: Math.max(
|
|
6103
5592
|
this.minHeight,
|
|
6104
|
-
height(this.container) - (dimensions
|
|
5593
|
+
height(this.container) - (dimensions(this.content).height - height(this.$el))
|
|
6105
5594
|
)
|
|
6106
5595
|
};
|
|
6107
5596
|
},
|
|
@@ -6144,11 +5633,11 @@
|
|
|
6144
5633
|
],
|
|
6145
5634
|
update: {
|
|
6146
5635
|
read() {
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
};
|
|
5636
|
+
const overflow = [];
|
|
5637
|
+
for (const prop of ["Width", "Height"]) {
|
|
5638
|
+
overflow.push(this.$el[`scroll${prop}`] - this.$el[`client${prop}`]);
|
|
5639
|
+
}
|
|
5640
|
+
return { overflow };
|
|
6152
5641
|
},
|
|
6153
5642
|
write({ overflow }) {
|
|
6154
5643
|
for (let i = 0; i < 2; i++) {
|
|
@@ -6426,7 +5915,7 @@
|
|
|
6426
5915
|
if (scrollTop >= max) {
|
|
6427
5916
|
active = length - 1;
|
|
6428
5917
|
} else {
|
|
6429
|
-
const offsetBy = this.offset + dimensions
|
|
5918
|
+
const offsetBy = this.offset + dimensions(getCoveringElement()).height + viewport.height * 0.1;
|
|
6430
5919
|
for (let i = 0; i < targets.length; i++) {
|
|
6431
5920
|
if (offset(targets[i]).top - viewport.top - offsetBy > 0) {
|
|
6432
5921
|
break;
|
|
@@ -6565,7 +6054,7 @@
|
|
|
6565
6054
|
this.hide();
|
|
6566
6055
|
}
|
|
6567
6056
|
if (!this.active) {
|
|
6568
|
-
({ height: height$1, width } = dimensions
|
|
6057
|
+
({ height: height$1, width } = dimensions(this.$el));
|
|
6569
6058
|
margin = css(this.$el, "margin");
|
|
6570
6059
|
}
|
|
6571
6060
|
if (hide) {
|
|
@@ -6587,7 +6076,7 @@
|
|
|
6587
6076
|
const overflow = this.overflowFlip ? 0 : Math.max(0, elementBox - viewport2);
|
|
6588
6077
|
const topOffset = offset(referenceElement).top - // offset possible `transform: translateY` animation 'uk-animation-slide-top' while hiding
|
|
6589
6078
|
new DOMMatrix(css(referenceElement, "transform")).m42;
|
|
6590
|
-
const elHeight = dimensions
|
|
6079
|
+
const elHeight = dimensions(this.$el).height;
|
|
6591
6080
|
const start = (this.start === false ? topOffset : parseProp(this.start, this.$el, topOffset)) - offset$1;
|
|
6592
6081
|
const end = this.end === false ? maxScrollHeight : Math.min(
|
|
6593
6082
|
maxScrollHeight,
|
|
@@ -6779,7 +6268,7 @@
|
|
|
6779
6268
|
if (!value) {
|
|
6780
6269
|
return 0;
|
|
6781
6270
|
}
|
|
6782
|
-
if (isNumeric(value) || isString(value) && /^-?\d
|
|
6271
|
+
if (isNumeric(value) || isString(value) && value.match(/^-?\d/)) {
|
|
6783
6272
|
return propOffset + toPx(value, "height", el, true);
|
|
6784
6273
|
} else {
|
|
6785
6274
|
const refElement = value === true ? getVisibleParent(el) : query(value, el);
|
|
@@ -6813,6 +6302,15 @@
|
|
|
6813
6302
|
}
|
|
6814
6303
|
}
|
|
6815
6304
|
|
|
6305
|
+
function getMaxPathLength(el) {
|
|
6306
|
+
return isVisible(el) ? Math.ceil(
|
|
6307
|
+
Math.max(0, ...$$("[stroke]", el).map((stroke) => {
|
|
6308
|
+
var _a;
|
|
6309
|
+
return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
|
|
6310
|
+
}))
|
|
6311
|
+
) : 0;
|
|
6312
|
+
}
|
|
6313
|
+
|
|
6816
6314
|
var svg = {
|
|
6817
6315
|
mixins: [Svg],
|
|
6818
6316
|
args: "src",
|
|
@@ -6894,9 +6392,10 @@
|
|
|
6894
6392
|
|
|
6895
6393
|
const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
6896
6394
|
var Switcher = {
|
|
6897
|
-
mixins: [
|
|
6395
|
+
mixins: [Togglable],
|
|
6898
6396
|
args: "connect",
|
|
6899
6397
|
props: {
|
|
6398
|
+
connect: String,
|
|
6900
6399
|
toggle: String,
|
|
6901
6400
|
itemNav: String,
|
|
6902
6401
|
active: Number,
|
|
@@ -6908,12 +6407,20 @@
|
|
|
6908
6407
|
toggle: "> * > :first-child",
|
|
6909
6408
|
itemNav: false,
|
|
6910
6409
|
active: 0,
|
|
6410
|
+
cls: "uk-active",
|
|
6911
6411
|
attrItem: "uk-switcher-item",
|
|
6912
6412
|
selVertical: ".uk-nav",
|
|
6913
6413
|
followFocus: false,
|
|
6914
6414
|
swiping: true
|
|
6915
6415
|
},
|
|
6916
6416
|
computed: {
|
|
6417
|
+
connects: {
|
|
6418
|
+
get: ({ connect }, $el) => queryAll(connect, $el),
|
|
6419
|
+
observe: ({ connect }) => connect
|
|
6420
|
+
},
|
|
6421
|
+
connectChildren() {
|
|
6422
|
+
return this.connects.map((el) => children(el)).flat();
|
|
6423
|
+
},
|
|
6917
6424
|
toggles: ({ toggle }, $el) => $$(toggle, $el),
|
|
6918
6425
|
children(_, $el) {
|
|
6919
6426
|
return children($el).filter(
|
|
@@ -6944,7 +6451,10 @@
|
|
|
6944
6451
|
connected() {
|
|
6945
6452
|
this.$el.role = "tablist";
|
|
6946
6453
|
},
|
|
6947
|
-
observe:
|
|
6454
|
+
observe: [
|
|
6455
|
+
lazyload({ targets: ({ connectChildren }) => connectChildren }),
|
|
6456
|
+
swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping })
|
|
6457
|
+
],
|
|
6948
6458
|
events: [
|
|
6949
6459
|
{
|
|
6950
6460
|
name: "click keydown",
|
|
@@ -6994,27 +6504,24 @@
|
|
|
6994
6504
|
}
|
|
6995
6505
|
],
|
|
6996
6506
|
update() {
|
|
6507
|
+
var _a;
|
|
6508
|
+
for (const el of this.connects) {
|
|
6509
|
+
if (isTag(el, "ul")) {
|
|
6510
|
+
el.role = "presentation";
|
|
6511
|
+
}
|
|
6512
|
+
}
|
|
6997
6513
|
attr(children(this.$el), "role", "presentation");
|
|
6998
6514
|
for (const index in this.toggles) {
|
|
6999
6515
|
const toggle = this.toggles[index];
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
if (!item) {
|
|
7005
|
-
continue;
|
|
7006
|
-
}
|
|
7007
|
-
attr(item, {
|
|
7008
|
-
id: generateId(this, item),
|
|
7009
|
-
role: "tabpanel",
|
|
7010
|
-
"aria-labelledby": toggle.id
|
|
7011
|
-
});
|
|
7012
|
-
controls.push(item.id);
|
|
6516
|
+
const item = (_a = this.connects[0]) == null ? void 0 : _a.children[index];
|
|
6517
|
+
toggle.role = "tab";
|
|
6518
|
+
if (!item) {
|
|
6519
|
+
continue;
|
|
7013
6520
|
}
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
});
|
|
6521
|
+
toggle.id = generateId(this, toggle);
|
|
6522
|
+
item.id = generateId(this, item);
|
|
6523
|
+
attr(toggle, "aria-controls", item.id);
|
|
6524
|
+
attr(item, { role: "tabpanel", "aria-labelledby": toggle.id });
|
|
7018
6525
|
}
|
|
7019
6526
|
attr(this.$el, "aria-orientation", matches(this.$el, this.selVertical) ? "vertical" : null);
|
|
7020
6527
|
},
|
|
@@ -7047,7 +6554,15 @@
|
|
|
7047
6554
|
tabindex: next === i ? null : -1
|
|
7048
6555
|
});
|
|
7049
6556
|
});
|
|
7050
|
-
|
|
6557
|
+
const animate = prev >= 0 && prev !== next;
|
|
6558
|
+
this.connects.forEach(async ({ children: children2 }) => {
|
|
6559
|
+
const actives = toArray(children2).filter(
|
|
6560
|
+
(child, i) => i !== next && hasClass(child, this.cls)
|
|
6561
|
+
);
|
|
6562
|
+
if (await this.toggleElement(actives, false, animate)) {
|
|
6563
|
+
await this.toggleElement(children2[next], true, animate);
|
|
6564
|
+
}
|
|
6565
|
+
});
|
|
7051
6566
|
}
|
|
7052
6567
|
}
|
|
7053
6568
|
};
|