uikit 3.16.4-dev.fd2458e3b → 3.16.5-dev.dda1f1b31
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/.eslintrc.json +1 -0
- package/CHANGELOG.md +9 -1
- package/build/build.js +5 -4
- package/build/icons.js +2 -1
- package/build/less.js +2 -11
- package/build/prefix.js +2 -1
- package/build/release.js +4 -3
- package/build/scope.js +2 -1
- package/build/scss.js +2 -1
- package/build/util.js +3 -3
- package/dist/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +12 -14
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +506 -22
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +2601 -310
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +2612 -323
- 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 +466 -43
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +184 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +2345 -49
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +184 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +2339 -49
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +472 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +2298 -11
- 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 +951 -931
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +153 -152
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +979 -954
- package/dist/js/uikit.min.js +1 -1
- package/package.json +2 -2
- package/src/images/icons/mastodon.svg +3 -0
- package/src/js/api/app.js +12 -0
- package/src/js/api/boot.js +64 -43
- package/src/js/api/component.js +60 -61
- package/src/js/api/computed.js +39 -0
- package/src/js/api/events.js +45 -0
- package/src/js/api/global.js +58 -56
- package/src/js/api/hooks.js +35 -114
- package/src/js/api/index.js +8 -24
- package/src/js/api/instance.js +55 -55
- package/src/js/api/log.js +10 -0
- package/src/js/api/observables.js +125 -0
- package/src/js/api/observer.js +76 -0
- package/src/js/{util → api}/options.js +38 -1
- package/src/js/api/props.js +102 -0
- package/src/js/api/state.js +26 -280
- package/src/js/api/update.js +77 -0
- package/src/js/api/watch.js +34 -0
- package/src/js/components/countdown.js +14 -16
- package/src/js/components/filter.js +18 -24
- package/src/js/components/internal/slider-preload.js +5 -6
- package/src/js/components/lightbox-panel.js +1 -1
- package/src/js/components/lightbox.js +11 -23
- package/src/js/components/parallax.js +8 -6
- package/src/js/components/slider.js +10 -0
- package/src/js/components/tooltip.js +2 -1
- package/src/js/core/accordion.js +5 -6
- package/src/js/core/cover.js +9 -9
- package/src/js/core/drop.js +13 -6
- package/src/js/core/dropnav.js +1 -1
- package/src/js/core/grid.js +2 -5
- package/src/js/core/height-match.js +9 -16
- package/src/js/core/height-viewport.js +5 -7
- package/src/js/core/img.js +12 -19
- package/src/js/core/leader.js +4 -2
- package/src/js/core/margin.js +11 -21
- package/src/js/core/modal.js +1 -1
- package/src/js/core/offcanvas.js +6 -2
- package/src/js/core/overflow-auto.js +5 -5
- package/src/js/core/responsive.js +5 -7
- package/src/js/core/scroll.js +19 -10
- package/src/js/core/scrollspy-nav.js +6 -5
- package/src/js/core/scrollspy.js +27 -36
- package/src/js/core/sticky.js +12 -10
- package/src/js/core/svg.js +4 -2
- package/src/js/core/switcher.js +11 -9
- package/src/js/core/toggle.js +4 -4
- package/src/js/core/video.js +6 -14
- package/src/js/mixin/modal.js +2 -1
- package/src/js/mixin/parallax.js +1 -1
- package/src/js/mixin/slider-nav.js +2 -1
- package/src/js/mixin/slider.js +9 -3
- package/src/js/util/filter.js +13 -0
- package/src/js/util/index.js +0 -1
- package/src/js/util/keys.js +11 -0
- package/src/js/util/lang.js +7 -7
- package/src/js/util/observer.js +4 -2
- package/src/js/util/scroll.js +42 -0
- package/src/js/util/svg.js +16 -0
- package/src/js/util/viewport.js +1 -1
- package/src/scss/mixins-theme.scss +1640 -1596
- package/src/scss/mixins.scss +1370 -1370
- package/src/scss/variables-theme.scss +1255 -1255
- package/src/scss/variables.scss +1113 -1113
- package/src/js/mixin/lazyload.js +0 -27
- package/src/js/mixin/resize.js +0 -11
- package/src/js/mixin/scroll.js +0 -32
- package/src/js/mixin/swipe.js +0 -72
- package/src/js/mixin/utils.js +0 -91
package/dist/js/uikit-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.16.
|
|
1
|
+
/*! UIkit 3.16.5-dev.dda1f1b31 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -13,13 +13,10 @@
|
|
|
13
13
|
const hyphenateRe = /\B([A-Z])/g;
|
|
14
14
|
const hyphenate = memoize((str) => str.replace(hyphenateRe, "-$1").toLowerCase());
|
|
15
15
|
const camelizeRe = /-(\w)/g;
|
|
16
|
-
const camelize = memoize(
|
|
17
|
-
|
|
18
|
-
(str) => str.length ? toUpper(null, str.charAt(0)) + str.slice(1) : ""
|
|
16
|
+
const camelize = memoize(
|
|
17
|
+
(str) => (str.charAt(0).toLowerCase() + str.slice(1)).replace(camelizeRe, (_, c) => c.toUpperCase())
|
|
19
18
|
);
|
|
20
|
-
|
|
21
|
-
return c ? c.toUpperCase() : "";
|
|
22
|
-
}
|
|
19
|
+
const ucfirst = memoize((str) => str.charAt(0).toUpperCase() + str.slice(1));
|
|
23
20
|
function startsWith(str, search) {
|
|
24
21
|
var _a;
|
|
25
22
|
return (_a = str == null ? void 0 : str.startsWith) == null ? void 0 : _a.call(str, search);
|
|
@@ -136,6 +133,9 @@
|
|
|
136
133
|
const seen = /* @__PURE__ */ new Set();
|
|
137
134
|
return array.filter(({ [prop]: check }) => seen.has(check) ? false : seen.add(check));
|
|
138
135
|
}
|
|
136
|
+
function pick(obj, props) {
|
|
137
|
+
return props.reduce((res, prop) => ({ ...res, [prop]: obj[prop] }), {});
|
|
138
|
+
}
|
|
139
139
|
function clamp(number, min = 0, max = 1) {
|
|
140
140
|
return Math.min(Math.max(toNumber(number) || 0, min), max);
|
|
141
141
|
}
|
|
@@ -303,6 +303,17 @@
|
|
|
303
303
|
function index(element, ref) {
|
|
304
304
|
return ref ? toNodes(element).indexOf(toNode(ref)) : children(parent(element)).indexOf(element);
|
|
305
305
|
}
|
|
306
|
+
function isSameSiteAnchor(el) {
|
|
307
|
+
el = toNode(el);
|
|
308
|
+
return el && ["origin", "pathname", "search"].every((part) => el[part] === location[part]);
|
|
309
|
+
}
|
|
310
|
+
function getTargetedElement(el) {
|
|
311
|
+
if (isSameSiteAnchor(el)) {
|
|
312
|
+
el = toNode(el);
|
|
313
|
+
const id = decodeURIComponent(el.hash).substring(1);
|
|
314
|
+
return document.getElementById(id) || document.getElementsByName(id)[0];
|
|
315
|
+
}
|
|
316
|
+
}
|
|
306
317
|
|
|
307
318
|
function query(selector, context) {
|
|
308
319
|
return find(selector, getContext(selector, context));
|
|
@@ -1062,7 +1073,7 @@
|
|
|
1062
1073
|
return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };
|
|
1063
1074
|
}
|
|
1064
1075
|
|
|
1065
|
-
function observeIntersection(targets, cb, options, intersecting = true) {
|
|
1076
|
+
function observeIntersection(targets, cb, options = {}, intersecting = true) {
|
|
1066
1077
|
const observer = new IntersectionObserver(
|
|
1067
1078
|
intersecting ? (entries, observer2) => {
|
|
1068
1079
|
if (entries.some((entry) => entry.isIntersecting)) {
|
|
@@ -1079,11 +1090,13 @@
|
|
|
1079
1090
|
const hasResizeObserver = inBrowser && window.ResizeObserver;
|
|
1080
1091
|
function observeResize(targets, cb, options = { box: "border-box" }) {
|
|
1081
1092
|
if (hasResizeObserver) {
|
|
1082
|
-
return observe(ResizeObserver, targets, cb, options);
|
|
1093
|
+
return observe$1(ResizeObserver, targets, cb, options);
|
|
1083
1094
|
}
|
|
1084
1095
|
initResizeListener();
|
|
1085
1096
|
listeners.add(cb);
|
|
1086
1097
|
return {
|
|
1098
|
+
observe: noop,
|
|
1099
|
+
unobserve: noop,
|
|
1087
1100
|
disconnect() {
|
|
1088
1101
|
listeners.delete(cb);
|
|
1089
1102
|
}
|
|
@@ -1110,9 +1123,9 @@
|
|
|
1110
1123
|
on(document, "loadedmetadata load", handleResize, true);
|
|
1111
1124
|
}
|
|
1112
1125
|
function observeMutation(targets, cb, options) {
|
|
1113
|
-
return observe(MutationObserver, targets, cb, options);
|
|
1126
|
+
return observe$1(MutationObserver, targets, cb, options);
|
|
1114
1127
|
}
|
|
1115
|
-
function observe(Observer, targets, cb, options) {
|
|
1128
|
+
function observe$1(Observer, targets, cb, options) {
|
|
1116
1129
|
const observer = new Observer(cb);
|
|
1117
1130
|
for (const el of toNodes(targets)) {
|
|
1118
1131
|
observer.observe(el, options);
|
|
@@ -1120,97 +1133,6 @@
|
|
|
1120
1133
|
return observer;
|
|
1121
1134
|
}
|
|
1122
1135
|
|
|
1123
|
-
const strats = {};
|
|
1124
|
-
strats.events = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;
|
|
1125
|
-
strats.args = function(parentVal, childVal) {
|
|
1126
|
-
return childVal !== false && concatStrat(childVal || parentVal);
|
|
1127
|
-
};
|
|
1128
|
-
strats.update = function(parentVal, childVal) {
|
|
1129
|
-
return sortBy$1(
|
|
1130
|
-
concatStrat(parentVal, isFunction(childVal) ? { read: childVal } : childVal),
|
|
1131
|
-
"order"
|
|
1132
|
-
);
|
|
1133
|
-
};
|
|
1134
|
-
strats.props = function(parentVal, childVal) {
|
|
1135
|
-
if (isArray(childVal)) {
|
|
1136
|
-
const value = {};
|
|
1137
|
-
for (const key of childVal) {
|
|
1138
|
-
value[key] = String;
|
|
1139
|
-
}
|
|
1140
|
-
childVal = value;
|
|
1141
|
-
}
|
|
1142
|
-
return strats.methods(parentVal, childVal);
|
|
1143
|
-
};
|
|
1144
|
-
strats.computed = strats.methods = function(parentVal, childVal) {
|
|
1145
|
-
return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
|
|
1146
|
-
};
|
|
1147
|
-
strats.i18n = strats.data = function(parentVal, childVal, vm) {
|
|
1148
|
-
if (!vm) {
|
|
1149
|
-
if (!childVal) {
|
|
1150
|
-
return parentVal;
|
|
1151
|
-
}
|
|
1152
|
-
if (!parentVal) {
|
|
1153
|
-
return childVal;
|
|
1154
|
-
}
|
|
1155
|
-
return function(vm2) {
|
|
1156
|
-
return mergeFnData(parentVal, childVal, vm2);
|
|
1157
|
-
};
|
|
1158
|
-
}
|
|
1159
|
-
return mergeFnData(parentVal, childVal, vm);
|
|
1160
|
-
};
|
|
1161
|
-
function mergeFnData(parentVal, childVal, vm) {
|
|
1162
|
-
return strats.computed(
|
|
1163
|
-
isFunction(parentVal) ? parentVal.call(vm, vm) : parentVal,
|
|
1164
|
-
isFunction(childVal) ? childVal.call(vm, vm) : childVal
|
|
1165
|
-
);
|
|
1166
|
-
}
|
|
1167
|
-
function concatStrat(parentVal, childVal) {
|
|
1168
|
-
parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;
|
|
1169
|
-
return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;
|
|
1170
|
-
}
|
|
1171
|
-
function defaultStrat(parentVal, childVal) {
|
|
1172
|
-
return isUndefined(childVal) ? parentVal : childVal;
|
|
1173
|
-
}
|
|
1174
|
-
function mergeOptions(parent, child, vm) {
|
|
1175
|
-
const options = {};
|
|
1176
|
-
if (isFunction(child)) {
|
|
1177
|
-
child = child.options;
|
|
1178
|
-
}
|
|
1179
|
-
if (child.extends) {
|
|
1180
|
-
parent = mergeOptions(parent, child.extends, vm);
|
|
1181
|
-
}
|
|
1182
|
-
if (child.mixins) {
|
|
1183
|
-
for (const mixin of child.mixins) {
|
|
1184
|
-
parent = mergeOptions(parent, mixin, vm);
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
for (const key in parent) {
|
|
1188
|
-
mergeKey(key);
|
|
1189
|
-
}
|
|
1190
|
-
for (const key in child) {
|
|
1191
|
-
if (!hasOwn(parent, key)) {
|
|
1192
|
-
mergeKey(key);
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
function mergeKey(key) {
|
|
1196
|
-
options[key] = (strats[key] || defaultStrat)(parent[key], child[key], vm);
|
|
1197
|
-
}
|
|
1198
|
-
return options;
|
|
1199
|
-
}
|
|
1200
|
-
function parseOptions(options, args = []) {
|
|
1201
|
-
try {
|
|
1202
|
-
return options ? startsWith(options, "{") ? JSON.parse(options) : args.length && !includes(options, ":") ? { [args[0]]: options } : options.split(";").reduce((options2, option) => {
|
|
1203
|
-
const [key, value] = option.split(/:(.*)/);
|
|
1204
|
-
if (key && !isUndefined(value)) {
|
|
1205
|
-
options2[key.trim()] = value.trim();
|
|
1206
|
-
}
|
|
1207
|
-
return options2;
|
|
1208
|
-
}, {}) : {};
|
|
1209
|
-
} catch (e) {
|
|
1210
|
-
return {};
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
1136
|
function play(el) {
|
|
1215
1137
|
if (isIFrame(el)) {
|
|
1216
1138
|
call(el, { func: "playVideo", method: "play" });
|
|
@@ -1389,10 +1311,10 @@
|
|
|
1389
1311
|
function offsetViewport(scrollElement) {
|
|
1390
1312
|
const window = toWindow(scrollElement);
|
|
1391
1313
|
const {
|
|
1314
|
+
visualViewport,
|
|
1392
1315
|
document: { documentElement }
|
|
1393
1316
|
} = window;
|
|
1394
1317
|
let viewportElement = scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
|
|
1395
|
-
const { visualViewport } = window;
|
|
1396
1318
|
if (isWindow(viewportElement) && visualViewport) {
|
|
1397
1319
|
let { height, width, scale, pageTop: top, pageLeft: left } = visualViewport;
|
|
1398
1320
|
height = Math.round(height * scale);
|
|
@@ -1639,6 +1561,7 @@
|
|
|
1639
1561
|
fragment: fragment,
|
|
1640
1562
|
getEventPos: getEventPos,
|
|
1641
1563
|
getIndex: getIndex,
|
|
1564
|
+
getTargetedElement: getTargetedElement,
|
|
1642
1565
|
hasAttr: hasAttr,
|
|
1643
1566
|
hasClass: hasClass,
|
|
1644
1567
|
hasOwn: hasOwn,
|
|
@@ -1666,6 +1589,7 @@
|
|
|
1666
1589
|
isObject: isObject,
|
|
1667
1590
|
isPlainObject: isPlainObject,
|
|
1668
1591
|
isRtl: isRtl,
|
|
1592
|
+
isSameSiteAnchor: isSameSiteAnchor,
|
|
1669
1593
|
isString: isString,
|
|
1670
1594
|
isTag: isTag,
|
|
1671
1595
|
isTouch: isTouch,
|
|
@@ -1677,7 +1601,6 @@
|
|
|
1677
1601
|
last: last,
|
|
1678
1602
|
matches: matches,
|
|
1679
1603
|
memoize: memoize,
|
|
1680
|
-
mergeOptions: mergeOptions,
|
|
1681
1604
|
mute: mute,
|
|
1682
1605
|
noop: noop,
|
|
1683
1606
|
observeIntersection: observeIntersection,
|
|
@@ -1692,8 +1615,8 @@
|
|
|
1692
1615
|
overflowParents: overflowParents,
|
|
1693
1616
|
parent: parent,
|
|
1694
1617
|
parents: parents,
|
|
1695
|
-
parseOptions: parseOptions,
|
|
1696
1618
|
pause: pause,
|
|
1619
|
+
pick: pick,
|
|
1697
1620
|
play: play,
|
|
1698
1621
|
pointInRect: pointInRect,
|
|
1699
1622
|
pointerCancel: pointerCancel,
|
|
@@ -1743,368 +1666,341 @@
|
|
|
1743
1666
|
wrapInner: wrapInner
|
|
1744
1667
|
});
|
|
1745
1668
|
|
|
1746
|
-
function
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
};
|
|
1756
|
-
UIkit.mixin = function(mixin, component) {
|
|
1757
|
-
component = (isString(component) ? UIkit.component(component) : component) || this;
|
|
1758
|
-
component.options = mergeOptions(component.options, mixin);
|
|
1759
|
-
};
|
|
1760
|
-
UIkit.extend = function(options) {
|
|
1761
|
-
options = options || {};
|
|
1762
|
-
const Super = this;
|
|
1763
|
-
const Sub = function UIkitComponent(options2) {
|
|
1764
|
-
this._init(options2);
|
|
1765
|
-
};
|
|
1766
|
-
Sub.prototype = Object.create(Super.prototype);
|
|
1767
|
-
Sub.prototype.constructor = Sub;
|
|
1768
|
-
Sub.options = mergeOptions(Super.options, options);
|
|
1769
|
-
Sub.super = Super;
|
|
1770
|
-
Sub.extend = Super.extend;
|
|
1771
|
-
return Sub;
|
|
1772
|
-
};
|
|
1773
|
-
UIkit.update = function(element, e) {
|
|
1774
|
-
element = element ? toNode(element) : document.body;
|
|
1775
|
-
for (const parentEl of parents(element).reverse()) {
|
|
1776
|
-
update(parentEl[DATA], e);
|
|
1777
|
-
}
|
|
1778
|
-
apply(element, (element2) => update(element2[DATA], e));
|
|
1779
|
-
};
|
|
1780
|
-
let container;
|
|
1781
|
-
Object.defineProperty(UIkit, "container", {
|
|
1782
|
-
get() {
|
|
1783
|
-
return container || document.body;
|
|
1784
|
-
},
|
|
1785
|
-
set(element) {
|
|
1786
|
-
container = $(element);
|
|
1787
|
-
}
|
|
1788
|
-
});
|
|
1789
|
-
function update(data, e) {
|
|
1790
|
-
if (!data) {
|
|
1791
|
-
return;
|
|
1792
|
-
}
|
|
1793
|
-
for (const name in data) {
|
|
1794
|
-
if (data[name]._connected) {
|
|
1795
|
-
data[name]._callUpdate(e);
|
|
1669
|
+
function initObservers(instance) {
|
|
1670
|
+
instance._observers = [];
|
|
1671
|
+
instance._observerUpdates = /* @__PURE__ */ new Map();
|
|
1672
|
+
for (const observer of instance.$options.observe || []) {
|
|
1673
|
+
if (hasOwn(observer, "handler")) {
|
|
1674
|
+
registerObservable(instance, observer);
|
|
1675
|
+
} else {
|
|
1676
|
+
for (const key in observer) {
|
|
1677
|
+
registerObservable(instance, observer[key], key);
|
|
1796
1678
|
}
|
|
1797
1679
|
}
|
|
1798
1680
|
}
|
|
1799
1681
|
}
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
if (!this._updates) {
|
|
1842
|
-
this._updates = /* @__PURE__ */ new Set();
|
|
1843
|
-
fastdom.read(() => {
|
|
1844
|
-
if (this._connected) {
|
|
1845
|
-
runUpdates.call(this, this._updates);
|
|
1846
|
-
}
|
|
1847
|
-
delete this._updates;
|
|
1848
|
-
});
|
|
1849
|
-
}
|
|
1850
|
-
this._updates.add(e.type || e);
|
|
1851
|
-
};
|
|
1852
|
-
UIkit.prototype._callWatches = function() {
|
|
1853
|
-
if (this._watch) {
|
|
1682
|
+
function registerObserver(instance, ...observer) {
|
|
1683
|
+
instance._observers.push(...observer);
|
|
1684
|
+
}
|
|
1685
|
+
function disconnectObservers(instance) {
|
|
1686
|
+
for (const observer of instance._observers) {
|
|
1687
|
+
observer == null ? void 0 : observer.disconnect();
|
|
1688
|
+
instance._observerUpdates.delete(observer);
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
function callObserverUpdates(instance) {
|
|
1692
|
+
for (const [observer, update] of instance._observerUpdates) {
|
|
1693
|
+
update(observer);
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
function registerObservable(instance, observable, key) {
|
|
1697
|
+
let {
|
|
1698
|
+
observe,
|
|
1699
|
+
target = instance.$el,
|
|
1700
|
+
handler,
|
|
1701
|
+
options,
|
|
1702
|
+
filter,
|
|
1703
|
+
args
|
|
1704
|
+
} = isPlainObject(observable) ? observable : { type: key, handler: observable };
|
|
1705
|
+
if (filter && !filter.call(instance, instance)) {
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
const targets = isFunction(target) ? target.call(instance, instance) : target;
|
|
1709
|
+
handler = isString(handler) ? instance[handler] : handler.bind(instance);
|
|
1710
|
+
if (isFunction(options)) {
|
|
1711
|
+
options = options.call(instance, instance);
|
|
1712
|
+
}
|
|
1713
|
+
const observer = observe(targets, handler, options, args);
|
|
1714
|
+
if (isFunction(target) && isArray(targets) && observer.unobserve) {
|
|
1715
|
+
instance._observerUpdates.set(observer, watchChange(instance, target, targets));
|
|
1716
|
+
}
|
|
1717
|
+
registerObserver(instance, observer);
|
|
1718
|
+
}
|
|
1719
|
+
function watchChange(instance, targetFn, targets) {
|
|
1720
|
+
return (observer) => {
|
|
1721
|
+
const newTargets = targetFn.call(instance, instance);
|
|
1722
|
+
if (isEqual(targets, newTargets)) {
|
|
1854
1723
|
return;
|
|
1855
1724
|
}
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
runWatches.call(this, initial);
|
|
1860
|
-
}
|
|
1861
|
-
this._watch = null;
|
|
1862
|
-
});
|
|
1725
|
+
targets.forEach((target) => !includes(newTargets, target) && observer.unobserve(target));
|
|
1726
|
+
newTargets.forEach((target) => !includes(targets, target) && observer.observe(target));
|
|
1727
|
+
targets.splice(0, targets.length, ...newTargets);
|
|
1863
1728
|
};
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
let result;
|
|
1870
|
-
if (read) {
|
|
1871
|
-
result = read.call(this, this._data, types);
|
|
1872
|
-
if (result && isPlainObject(result)) {
|
|
1873
|
-
assign(this._data, result);
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
if (write && result !== false) {
|
|
1877
|
-
fastdom.write(() => {
|
|
1878
|
-
if (this._connected) {
|
|
1879
|
-
write.call(this, this._data, types);
|
|
1880
|
-
}
|
|
1881
|
-
});
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
function callWatches(instance) {
|
|
1732
|
+
if (instance._watch) {
|
|
1733
|
+
return;
|
|
1884
1734
|
}
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1735
|
+
const initial = !hasOwn(instance, "_watch");
|
|
1736
|
+
instance._watch = fastdom.read(() => {
|
|
1737
|
+
if (instance._connected) {
|
|
1738
|
+
runWatches(instance, initial);
|
|
1739
|
+
}
|
|
1740
|
+
instance._watch = null;
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
function runWatches(instance, initial) {
|
|
1744
|
+
const values = { ...instance._computed };
|
|
1745
|
+
instance._computed = {};
|
|
1746
|
+
for (const [key, { watch, immediate }] of Object.entries(instance.$options.computed || {})) {
|
|
1747
|
+
if (watch && (initial && immediate || hasOwn(values, key) && !isEqual(values[key], instance[key]))) {
|
|
1748
|
+
watch.call(instance, instance[key], initial ? void 0 : values[key]);
|
|
1896
1749
|
}
|
|
1897
1750
|
}
|
|
1751
|
+
callObserverUpdates(instance);
|
|
1898
1752
|
}
|
|
1899
1753
|
|
|
1900
|
-
function
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
}
|
|
1916
|
-
};
|
|
1917
|
-
UIkit.prototype._initData = function() {
|
|
1918
|
-
const { data = {} } = this.$options;
|
|
1919
|
-
for (const key in data) {
|
|
1920
|
-
this.$props[key] = this[key] = data[key];
|
|
1921
|
-
}
|
|
1922
|
-
};
|
|
1923
|
-
UIkit.prototype._initMethods = function() {
|
|
1924
|
-
const { methods } = this.$options;
|
|
1925
|
-
if (methods) {
|
|
1926
|
-
for (const key in methods) {
|
|
1927
|
-
this[key] = methods[key].bind(this);
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
};
|
|
1931
|
-
UIkit.prototype._initComputeds = function() {
|
|
1932
|
-
const { computed } = this.$options;
|
|
1933
|
-
this._computed = {};
|
|
1934
|
-
if (computed) {
|
|
1935
|
-
for (const key in computed) {
|
|
1936
|
-
registerComputed(this, key, computed[key]);
|
|
1937
|
-
}
|
|
1938
|
-
}
|
|
1939
|
-
};
|
|
1940
|
-
UIkit.prototype._initProps = function(props) {
|
|
1941
|
-
let key;
|
|
1942
|
-
props = props || getProps(this.$options);
|
|
1943
|
-
for (key in props) {
|
|
1944
|
-
if (!isUndefined(props[key])) {
|
|
1945
|
-
this.$props[key] = props[key];
|
|
1754
|
+
function callUpdate(instance, e = "update") {
|
|
1755
|
+
if (!instance._connected) {
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
if (e === "update" || e === "resize") {
|
|
1759
|
+
callWatches(instance);
|
|
1760
|
+
}
|
|
1761
|
+
if (!instance.$options.update) {
|
|
1762
|
+
return;
|
|
1763
|
+
}
|
|
1764
|
+
if (!instance._updates) {
|
|
1765
|
+
instance._updates = /* @__PURE__ */ new Set();
|
|
1766
|
+
fastdom.read(() => {
|
|
1767
|
+
if (instance._connected) {
|
|
1768
|
+
runUpdates(instance, instance._updates);
|
|
1946
1769
|
}
|
|
1770
|
+
delete instance._updates;
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1773
|
+
instance._updates.add(e.type || e);
|
|
1774
|
+
}
|
|
1775
|
+
function runUpdates(instance, types) {
|
|
1776
|
+
for (const { read, write, events = [] } of instance.$options.update) {
|
|
1777
|
+
if (!types.has("update") && !events.some((type) => types.has(type))) {
|
|
1778
|
+
continue;
|
|
1947
1779
|
}
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1780
|
+
let result;
|
|
1781
|
+
if (read) {
|
|
1782
|
+
result = read.call(instance, instance._data, types);
|
|
1783
|
+
if (result && isPlainObject(result)) {
|
|
1784
|
+
assign(instance._data, result);
|
|
1952
1785
|
}
|
|
1953
1786
|
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
if (hasOwn(event, "handler")) {
|
|
1959
|
-
registerEvent(this, event);
|
|
1960
|
-
} else {
|
|
1961
|
-
for (const key in event) {
|
|
1962
|
-
registerEvent(this, event[key], key);
|
|
1787
|
+
if (write && result !== false) {
|
|
1788
|
+
fastdom.write(() => {
|
|
1789
|
+
if (instance._connected) {
|
|
1790
|
+
write.call(instance, instance._data, types);
|
|
1963
1791
|
}
|
|
1964
|
-
}
|
|
1792
|
+
});
|
|
1965
1793
|
}
|
|
1966
|
-
};
|
|
1967
|
-
UIkit.prototype._unbindEvents = function() {
|
|
1968
|
-
this._events.forEach((unbind) => unbind());
|
|
1969
|
-
delete this._events;
|
|
1970
|
-
};
|
|
1971
|
-
UIkit.prototype._initObservers = function() {
|
|
1972
|
-
this._observers = [initPropsObserver(this), initChildListObserver(this)];
|
|
1973
|
-
};
|
|
1974
|
-
UIkit.prototype.registerObserver = function(...observer) {
|
|
1975
|
-
this._observers.push(...observer);
|
|
1976
|
-
};
|
|
1977
|
-
UIkit.prototype._disconnectObservers = function() {
|
|
1978
|
-
this._observers.forEach((observer) => observer == null ? void 0 : observer.disconnect());
|
|
1979
|
-
};
|
|
1980
|
-
}
|
|
1981
|
-
function getProps(opts) {
|
|
1982
|
-
const data$1 = {};
|
|
1983
|
-
const { args = [], props = {}, el, id } = opts;
|
|
1984
|
-
if (!props) {
|
|
1985
|
-
return data$1;
|
|
1986
1794
|
}
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
}
|
|
1993
|
-
value = props[key] === Boolean && value === "" ? true : coerce$1(props[key], value);
|
|
1994
|
-
if (prop === "target" && startsWith(value, "_")) {
|
|
1995
|
-
continue;
|
|
1996
|
-
}
|
|
1997
|
-
data$1[key] = value;
|
|
1795
|
+
}
|
|
1796
|
+
function initUpdateObserver(instance) {
|
|
1797
|
+
let { el, computed, observe } = instance.$options;
|
|
1798
|
+
if (!computed && !(observe == null ? void 0 : observe.some((options) => isFunction(options.target)))) {
|
|
1799
|
+
return;
|
|
1998
1800
|
}
|
|
1999
|
-
const
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
data$1[prop] = coerce$1(props[prop], options[key]);
|
|
1801
|
+
for (const key in computed || {}) {
|
|
1802
|
+
if (computed[key].document) {
|
|
1803
|
+
el = el.ownerDocument;
|
|
1804
|
+
break;
|
|
2004
1805
|
}
|
|
2005
1806
|
}
|
|
2006
|
-
|
|
1807
|
+
const observer = new MutationObserver(() => callWatches(instance));
|
|
1808
|
+
observer.observe(el, {
|
|
1809
|
+
childList: true,
|
|
1810
|
+
subtree: true
|
|
1811
|
+
});
|
|
1812
|
+
registerObserver(instance, observer);
|
|
2007
1813
|
}
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
},
|
|
2018
|
-
set(value) {
|
|
2019
|
-
const { _computed } = component;
|
|
2020
|
-
_computed[key] = cb.set ? cb.set.call(component, value) : value;
|
|
2021
|
-
if (isUndefined(_computed[key])) {
|
|
2022
|
-
delete _computed[key];
|
|
1814
|
+
|
|
1815
|
+
function initEvents(instance) {
|
|
1816
|
+
instance._events = [];
|
|
1817
|
+
for (const event of instance.$options.events || []) {
|
|
1818
|
+
if (hasOwn(event, "handler")) {
|
|
1819
|
+
registerEvent(instance, event);
|
|
1820
|
+
} else {
|
|
1821
|
+
for (const key in event) {
|
|
1822
|
+
registerEvent(instance, event[key], key);
|
|
2023
1823
|
}
|
|
2024
1824
|
}
|
|
2025
|
-
});
|
|
2026
|
-
}
|
|
2027
|
-
function registerEvent(component, event, key) {
|
|
2028
|
-
if (!isPlainObject(event)) {
|
|
2029
|
-
event = { name: key, handler: event };
|
|
2030
1825
|
}
|
|
2031
|
-
|
|
2032
|
-
|
|
1826
|
+
}
|
|
1827
|
+
function unbindEvents(instance) {
|
|
1828
|
+
instance._events.forEach((unbind) => unbind());
|
|
1829
|
+
delete instance._events;
|
|
1830
|
+
}
|
|
1831
|
+
function registerEvent(instance, event, key) {
|
|
1832
|
+
let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event) ? event : { name: key, handler: event };
|
|
1833
|
+
el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;
|
|
2033
1834
|
if (isArray(el)) {
|
|
2034
|
-
el.forEach((el2) => registerEvent(
|
|
1835
|
+
el.forEach((el2) => registerEvent(instance, { ...event, el: el2 }, key));
|
|
2035
1836
|
return;
|
|
2036
1837
|
}
|
|
2037
|
-
if (!el || filter && !filter.call(
|
|
1838
|
+
if (!el || filter && !filter.call(instance)) {
|
|
2038
1839
|
return;
|
|
2039
1840
|
}
|
|
2040
|
-
|
|
1841
|
+
instance._events.push(
|
|
2041
1842
|
on(
|
|
2042
1843
|
el,
|
|
2043
1844
|
name,
|
|
2044
|
-
delegate ? isString(delegate) ? delegate : delegate.call(
|
|
2045
|
-
isString(handler) ?
|
|
1845
|
+
delegate ? isString(delegate) ? delegate : delegate.call(instance, instance) : null,
|
|
1846
|
+
isString(handler) ? instance[handler] : handler.bind(instance),
|
|
2046
1847
|
{ passive, capture, self }
|
|
2047
1848
|
)
|
|
2048
1849
|
);
|
|
2049
1850
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
function
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
1851
|
+
|
|
1852
|
+
const strats = {};
|
|
1853
|
+
strats.events = strats.observe = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;
|
|
1854
|
+
strats.args = function(parentVal, childVal) {
|
|
1855
|
+
return childVal !== false && concatStrat(childVal || parentVal);
|
|
1856
|
+
};
|
|
1857
|
+
strats.update = function(parentVal, childVal) {
|
|
1858
|
+
return sortBy$1(
|
|
1859
|
+
concatStrat(parentVal, isFunction(childVal) ? { read: childVal } : childVal),
|
|
1860
|
+
"order"
|
|
1861
|
+
);
|
|
1862
|
+
};
|
|
1863
|
+
strats.props = function(parentVal, childVal) {
|
|
1864
|
+
if (isArray(childVal)) {
|
|
1865
|
+
const value = {};
|
|
1866
|
+
for (const key of childVal) {
|
|
1867
|
+
value[key] = String;
|
|
1868
|
+
}
|
|
1869
|
+
childVal = value;
|
|
1870
|
+
}
|
|
1871
|
+
return strats.methods(parentVal, childVal);
|
|
1872
|
+
};
|
|
1873
|
+
strats.computed = strats.methods = function(parentVal, childVal) {
|
|
1874
|
+
return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
|
|
1875
|
+
};
|
|
1876
|
+
strats.i18n = strats.data = function(parentVal, childVal, vm) {
|
|
1877
|
+
if (!vm) {
|
|
1878
|
+
if (!childVal) {
|
|
1879
|
+
return parentVal;
|
|
1880
|
+
}
|
|
1881
|
+
if (!parentVal) {
|
|
1882
|
+
return childVal;
|
|
1883
|
+
}
|
|
1884
|
+
return function(vm2) {
|
|
1885
|
+
return mergeFnData(parentVal, childVal, vm2);
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
return mergeFnData(parentVal, childVal, vm);
|
|
1889
|
+
};
|
|
1890
|
+
function mergeFnData(parentVal, childVal, vm) {
|
|
1891
|
+
return strats.computed(
|
|
1892
|
+
isFunction(parentVal) ? parentVal.call(vm, vm) : parentVal,
|
|
1893
|
+
isFunction(childVal) ? childVal.call(vm, vm) : childVal
|
|
1894
|
+
);
|
|
1895
|
+
}
|
|
1896
|
+
function concatStrat(parentVal, childVal) {
|
|
1897
|
+
parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;
|
|
1898
|
+
return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;
|
|
1899
|
+
}
|
|
1900
|
+
function defaultStrat(parentVal, childVal) {
|
|
1901
|
+
return isUndefined(childVal) ? parentVal : childVal;
|
|
1902
|
+
}
|
|
1903
|
+
function mergeOptions(parent, child, vm) {
|
|
1904
|
+
const options = {};
|
|
1905
|
+
if (isFunction(child)) {
|
|
1906
|
+
child = child.options;
|
|
1907
|
+
}
|
|
1908
|
+
if (child.extends) {
|
|
1909
|
+
parent = mergeOptions(parent, child.extends, vm);
|
|
1910
|
+
}
|
|
1911
|
+
if (child.mixins) {
|
|
1912
|
+
for (const mixin of child.mixins) {
|
|
1913
|
+
parent = mergeOptions(parent, mixin, vm);
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
for (const key in parent) {
|
|
1917
|
+
mergeKey(key);
|
|
1918
|
+
}
|
|
1919
|
+
for (const key in child) {
|
|
1920
|
+
if (!hasOwn(parent, key)) {
|
|
1921
|
+
mergeKey(key);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
function mergeKey(key) {
|
|
1925
|
+
options[key] = (strats[key] || defaultStrat)(parent[key], child[key], vm);
|
|
1926
|
+
}
|
|
1927
|
+
return options;
|
|
1928
|
+
}
|
|
1929
|
+
function parseOptions(options, args = []) {
|
|
1930
|
+
try {
|
|
1931
|
+
return options ? startsWith(options, "{") ? JSON.parse(options) : args.length && !includes(options, ":") ? { [args[0]]: options } : options.split(";").reduce((options2, option) => {
|
|
1932
|
+
const [key, value] = option.split(/:(.*)/);
|
|
1933
|
+
if (key && !isUndefined(value)) {
|
|
1934
|
+
options2[key.trim()] = value.trim();
|
|
2075
1935
|
}
|
|
2076
|
-
return
|
|
2077
|
-
}, {});
|
|
1936
|
+
return options2;
|
|
1937
|
+
}, {}) : {};
|
|
1938
|
+
} catch (e) {
|
|
1939
|
+
return {};
|
|
2078
1940
|
}
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
1941
|
+
}
|
|
1942
|
+
function coerce$1(type, value) {
|
|
1943
|
+
if (type === Boolean) {
|
|
1944
|
+
return toBoolean(value);
|
|
1945
|
+
} else if (type === Number) {
|
|
1946
|
+
return toNumber(value);
|
|
1947
|
+
} else if (type === "list") {
|
|
1948
|
+
return toList(value);
|
|
1949
|
+
} else if (type === Object && isString(value)) {
|
|
1950
|
+
return parseOptions(value);
|
|
1951
|
+
}
|
|
1952
|
+
return type ? type(value) : value;
|
|
1953
|
+
}
|
|
1954
|
+
function toList(value) {
|
|
1955
|
+
return isArray(value) ? value : isString(value) ? value.split(/,(?![^(]*\))/).map((value2) => isNumeric(value2) ? toNumber(value2) : toBoolean(value2.trim())) : [value];
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
function initProps(instance) {
|
|
1959
|
+
const props = getProps(instance.$options);
|
|
1960
|
+
for (let key in props) {
|
|
1961
|
+
if (!isUndefined(props[key])) {
|
|
1962
|
+
instance.$props[key] = props[key];
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
const exclude = [instance.$options.computed, instance.$options.methods];
|
|
1966
|
+
for (let key in instance.$props) {
|
|
1967
|
+
if (key in props && notIn(exclude, key)) {
|
|
1968
|
+
instance[key] = instance.$props[key];
|
|
2084
1969
|
}
|
|
2085
1970
|
}
|
|
2086
|
-
return data;
|
|
2087
1971
|
}
|
|
2088
|
-
function
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
1972
|
+
function getProps(opts) {
|
|
1973
|
+
const data$1 = {};
|
|
1974
|
+
const { args = [], props = {}, el, id } = opts;
|
|
1975
|
+
if (!props) {
|
|
1976
|
+
return data$1;
|
|
2092
1977
|
}
|
|
2093
|
-
for (const key in
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
1978
|
+
for (const key in props) {
|
|
1979
|
+
const prop = hyphenate(key);
|
|
1980
|
+
let value = data(el, prop);
|
|
1981
|
+
if (isUndefined(value)) {
|
|
1982
|
+
continue;
|
|
2097
1983
|
}
|
|
1984
|
+
value = props[key] === Boolean && value === "" ? true : coerce$1(props[key], value);
|
|
1985
|
+
if (prop === "target" && startsWith(value, "_")) {
|
|
1986
|
+
continue;
|
|
1987
|
+
}
|
|
1988
|
+
data$1[key] = value;
|
|
2098
1989
|
}
|
|
2099
|
-
const
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
1990
|
+
const options = parseOptions(data(el, id), args);
|
|
1991
|
+
for (const key in options) {
|
|
1992
|
+
const prop = camelize(key);
|
|
1993
|
+
if (!isUndefined(props[prop])) {
|
|
1994
|
+
data$1[prop] = coerce$1(props[prop], options[key]);
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
return data$1;
|
|
2105
1998
|
}
|
|
2106
|
-
function
|
|
2107
|
-
|
|
1999
|
+
function notIn(options, key) {
|
|
2000
|
+
return options.every((arr) => !arr || !hasOwn(arr, key));
|
|
2001
|
+
}
|
|
2002
|
+
function initPropsObserver(instance) {
|
|
2003
|
+
const { $options, $props } = instance;
|
|
2108
2004
|
const { id, attrs, props, el } = $options;
|
|
2109
2005
|
if (!props || attrs === false) {
|
|
2110
2006
|
return;
|
|
@@ -2119,192 +2015,356 @@
|
|
|
2119
2015
|
(prop2) => !isUndefined(data[prop2]) && data[prop2] !== $props[prop2]
|
|
2120
2016
|
);
|
|
2121
2017
|
})) {
|
|
2122
|
-
|
|
2018
|
+
instance.$reset();
|
|
2123
2019
|
}
|
|
2124
2020
|
});
|
|
2125
2021
|
observer.observe(el, {
|
|
2126
2022
|
attributes: true,
|
|
2127
2023
|
attributeFilter: filter.concat(filter.map((key) => `data-${key}`))
|
|
2128
2024
|
});
|
|
2129
|
-
|
|
2025
|
+
registerObserver(instance, observer);
|
|
2130
2026
|
}
|
|
2131
2027
|
|
|
2132
|
-
function
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2028
|
+
function callHook(instance, hook) {
|
|
2029
|
+
var _a;
|
|
2030
|
+
(_a = instance.$options[hook]) == null ? void 0 : _a.forEach((handler) => handler.call(instance));
|
|
2031
|
+
}
|
|
2032
|
+
function callConnected(instance) {
|
|
2033
|
+
if (instance._connected) {
|
|
2034
|
+
return;
|
|
2035
|
+
}
|
|
2036
|
+
instance._data = {};
|
|
2037
|
+
instance._computed = {};
|
|
2038
|
+
initProps(instance);
|
|
2039
|
+
callHook(instance, "beforeConnect");
|
|
2040
|
+
instance._connected = true;
|
|
2041
|
+
initEvents(instance);
|
|
2042
|
+
initObservers(instance);
|
|
2043
|
+
initPropsObserver(instance);
|
|
2044
|
+
initUpdateObserver(instance);
|
|
2045
|
+
callHook(instance, "connected");
|
|
2046
|
+
callUpdate(instance);
|
|
2047
|
+
}
|
|
2048
|
+
function callDisconnected(instance) {
|
|
2049
|
+
if (!instance._connected) {
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
callHook(instance, "beforeDisconnect");
|
|
2053
|
+
disconnectObservers(instance);
|
|
2054
|
+
unbindEvents(instance);
|
|
2055
|
+
callHook(instance, "disconnected");
|
|
2056
|
+
instance._connected = false;
|
|
2057
|
+
delete instance._watch;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
function initComputed(instance) {
|
|
2061
|
+
const { computed } = instance.$options;
|
|
2062
|
+
instance._computed = {};
|
|
2063
|
+
if (computed) {
|
|
2064
|
+
for (const key in computed) {
|
|
2065
|
+
registerComputed(instance, key, computed[key]);
|
|
2159
2066
|
}
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
function registerComputed(instance, key, cb) {
|
|
2070
|
+
Object.defineProperty(instance, key, {
|
|
2071
|
+
enumerable: true,
|
|
2072
|
+
get() {
|
|
2073
|
+
const { _computed, $props, $el } = instance;
|
|
2074
|
+
if (!hasOwn(_computed, key)) {
|
|
2075
|
+
_computed[key] = (cb.get || cb).call(instance, $props, $el);
|
|
2076
|
+
}
|
|
2077
|
+
return _computed[key];
|
|
2078
|
+
},
|
|
2079
|
+
set(value) {
|
|
2080
|
+
const { _computed } = instance;
|
|
2081
|
+
_computed[key] = cb.set ? cb.set.call(instance, value) : value;
|
|
2082
|
+
if (isUndefined(_computed[key])) {
|
|
2083
|
+
delete _computed[key];
|
|
2084
|
+
}
|
|
2163
2085
|
}
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2086
|
+
});
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
let uid = 0;
|
|
2090
|
+
function init$1(instance, options = {}) {
|
|
2091
|
+
options.data = normalizeData(options, instance.constructor.options);
|
|
2092
|
+
instance.$options = mergeOptions(instance.constructor.options, options, instance);
|
|
2093
|
+
instance.$props = {};
|
|
2094
|
+
instance._uid = uid++;
|
|
2095
|
+
initData(instance);
|
|
2096
|
+
initMethods(instance);
|
|
2097
|
+
initComputed(instance);
|
|
2098
|
+
callHook(instance, "created");
|
|
2099
|
+
if (options.el) {
|
|
2100
|
+
instance.$mount(options.el);
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
function initData(instance) {
|
|
2104
|
+
const { data = {} } = instance.$options;
|
|
2105
|
+
for (const key in data) {
|
|
2106
|
+
instance.$props[key] = instance[key] = data[key];
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
function initMethods(instance) {
|
|
2110
|
+
const { methods } = instance.$options;
|
|
2111
|
+
if (methods) {
|
|
2112
|
+
for (const key in methods) {
|
|
2113
|
+
instance[key] = methods[key].bind(instance);
|
|
2167
2114
|
}
|
|
2168
|
-
|
|
2169
|
-
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
function normalizeData({ data = {} }, { args = [], props = {} }) {
|
|
2118
|
+
if (isArray(data)) {
|
|
2119
|
+
data = data.slice(0, args.length).reduce((data2, value, index) => {
|
|
2120
|
+
if (isPlainObject(value)) {
|
|
2121
|
+
assign(data2, value);
|
|
2122
|
+
} else {
|
|
2123
|
+
data2[args[index]] = value;
|
|
2124
|
+
}
|
|
2125
|
+
return data2;
|
|
2126
|
+
}, {});
|
|
2127
|
+
}
|
|
2128
|
+
for (const key in data) {
|
|
2129
|
+
if (isUndefined(data[key])) {
|
|
2130
|
+
delete data[key];
|
|
2131
|
+
} else if (props[key]) {
|
|
2132
|
+
data[key] = coerce$1(props[key], data[key]);
|
|
2170
2133
|
}
|
|
2171
|
-
}
|
|
2172
|
-
|
|
2173
|
-
this._callUpdate(e);
|
|
2174
|
-
};
|
|
2175
|
-
UIkit.prototype.$update = function(element = this.$el, e) {
|
|
2176
|
-
UIkit.update(element, e);
|
|
2177
|
-
};
|
|
2178
|
-
UIkit.prototype.$getComponent = UIkit.getComponent;
|
|
2179
|
-
Object.defineProperty(
|
|
2180
|
-
UIkit.prototype,
|
|
2181
|
-
"$container",
|
|
2182
|
-
Object.getOwnPropertyDescriptor(UIkit, "container")
|
|
2183
|
-
);
|
|
2134
|
+
}
|
|
2135
|
+
return data;
|
|
2184
2136
|
}
|
|
2185
2137
|
|
|
2186
|
-
const
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
UIkit.connect = (node) => {
|
|
2227
|
-
if (node[DATA]) {
|
|
2228
|
-
for (const name in node[DATA]) {
|
|
2229
|
-
node[DATA][name]._callConnected();
|
|
2138
|
+
const App = function(options) {
|
|
2139
|
+
init$1(this, options);
|
|
2140
|
+
};
|
|
2141
|
+
App.util = util;
|
|
2142
|
+
App.options = {};
|
|
2143
|
+
App.version = "3.16.5-dev.dda1f1b31";
|
|
2144
|
+
|
|
2145
|
+
const PREFIX = "uk-";
|
|
2146
|
+
const DATA = "__uikit__";
|
|
2147
|
+
const components$1 = {};
|
|
2148
|
+
function component(name, options) {
|
|
2149
|
+
var _a;
|
|
2150
|
+
const id = PREFIX + hyphenate(name);
|
|
2151
|
+
if (!options) {
|
|
2152
|
+
if (isPlainObject(components$1[id])) {
|
|
2153
|
+
components$1[id] = App.extend(components$1[id]);
|
|
2154
|
+
}
|
|
2155
|
+
return components$1[id];
|
|
2156
|
+
}
|
|
2157
|
+
name = camelize(name);
|
|
2158
|
+
App[name] = (element, data) => createComponent(name, element, data);
|
|
2159
|
+
const opt = isPlainObject(options) ? { ...options } : options.options;
|
|
2160
|
+
opt.id = id;
|
|
2161
|
+
opt.name = name;
|
|
2162
|
+
(_a = opt.install) == null ? void 0 : _a.call(opt, App, opt, name);
|
|
2163
|
+
if (App._initialized && !opt.functional) {
|
|
2164
|
+
requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
|
|
2165
|
+
}
|
|
2166
|
+
return components$1[id] = opt;
|
|
2167
|
+
}
|
|
2168
|
+
function createComponent(name, element, data) {
|
|
2169
|
+
const Component = component(name);
|
|
2170
|
+
return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [...arguments] }) : element ? $$(element).map(init)[0] : init();
|
|
2171
|
+
function init(element2) {
|
|
2172
|
+
const instance = getComponent(element2, name);
|
|
2173
|
+
if (instance) {
|
|
2174
|
+
if (data) {
|
|
2175
|
+
instance.$destroy();
|
|
2176
|
+
} else {
|
|
2177
|
+
return instance;
|
|
2230
2178
|
}
|
|
2231
2179
|
}
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
name && UIkit[name](node);
|
|
2235
|
-
}
|
|
2236
|
-
};
|
|
2237
|
-
UIkit.disconnect = (node) => {
|
|
2238
|
-
for (const name in node[DATA]) {
|
|
2239
|
-
node[DATA][name]._callDisconnected();
|
|
2240
|
-
}
|
|
2241
|
-
};
|
|
2180
|
+
return new Component({ el: element2, data });
|
|
2181
|
+
}
|
|
2242
2182
|
}
|
|
2243
|
-
function
|
|
2244
|
-
|
|
2245
|
-
|
|
2183
|
+
function getComponents(element) {
|
|
2184
|
+
return element[DATA] || {};
|
|
2185
|
+
}
|
|
2186
|
+
function getComponent(element, name) {
|
|
2187
|
+
return getComponents(element)[name];
|
|
2188
|
+
}
|
|
2189
|
+
function attachToElement(element, instance) {
|
|
2190
|
+
if (!element[DATA]) {
|
|
2191
|
+
element[DATA] = {};
|
|
2192
|
+
}
|
|
2193
|
+
element[DATA][instance.$options.name] = instance;
|
|
2194
|
+
}
|
|
2195
|
+
function detachFromElement(element, instance) {
|
|
2196
|
+
var _a;
|
|
2197
|
+
(_a = element[DATA]) == null ? true : delete _a[instance.$options.name];
|
|
2198
|
+
if (!isEmpty(element[DATA])) {
|
|
2199
|
+
delete element[DATA];
|
|
2200
|
+
}
|
|
2246
2201
|
}
|
|
2247
2202
|
|
|
2248
|
-
|
|
2249
|
-
|
|
2203
|
+
App.component = component;
|
|
2204
|
+
App.getComponents = getComponents;
|
|
2205
|
+
App.getComponent = getComponent;
|
|
2206
|
+
App.use = function(plugin) {
|
|
2207
|
+
if (plugin.installed) {
|
|
2208
|
+
return;
|
|
2209
|
+
}
|
|
2210
|
+
plugin.call(null, this);
|
|
2211
|
+
plugin.installed = true;
|
|
2212
|
+
return this;
|
|
2250
2213
|
};
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2214
|
+
App.mixin = function(mixin, component2) {
|
|
2215
|
+
component2 = (isString(component2) ? this.component(component2) : component2) || this;
|
|
2216
|
+
component2.options = mergeOptions(component2.options, mixin);
|
|
2217
|
+
};
|
|
2218
|
+
App.extend = function(options) {
|
|
2219
|
+
options = options || {};
|
|
2220
|
+
const Super = this;
|
|
2221
|
+
const Sub = function UIkitComponent(options2) {
|
|
2222
|
+
init$1(this, options2);
|
|
2223
|
+
};
|
|
2224
|
+
Sub.prototype = Object.create(Super.prototype);
|
|
2225
|
+
Sub.prototype.constructor = Sub;
|
|
2226
|
+
Sub.options = mergeOptions(Super.options, options);
|
|
2227
|
+
Sub.super = Super;
|
|
2228
|
+
Sub.extend = Super.extend;
|
|
2229
|
+
return Sub;
|
|
2230
|
+
};
|
|
2231
|
+
function update(element, e) {
|
|
2232
|
+
element = element ? toNode(element) : document.body;
|
|
2233
|
+
for (const parentEl of parents(element).reverse()) {
|
|
2234
|
+
updateElement(parentEl, e);
|
|
2235
|
+
}
|
|
2236
|
+
apply(element, (element2) => updateElement(element2, e));
|
|
2237
|
+
}
|
|
2238
|
+
App.update = update;
|
|
2239
|
+
function updateElement(element, e) {
|
|
2240
|
+
const components = getComponents(element);
|
|
2241
|
+
for (const name in components) {
|
|
2242
|
+
callUpdate(components[name], e);
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
let container;
|
|
2246
|
+
Object.defineProperty(App, "container", {
|
|
2247
|
+
get() {
|
|
2248
|
+
return container || document.body;
|
|
2249
|
+
},
|
|
2250
|
+
set(element) {
|
|
2251
|
+
container = $(element);
|
|
2252
|
+
}
|
|
2253
|
+
});
|
|
2261
2254
|
|
|
2262
|
-
function
|
|
2263
|
-
const
|
|
2264
|
-
|
|
2265
|
-
|
|
2255
|
+
App.prototype.$mount = function(el) {
|
|
2256
|
+
const instance = this;
|
|
2257
|
+
attachToElement(el, instance);
|
|
2258
|
+
instance.$options.el = el;
|
|
2259
|
+
if (within(el, document)) {
|
|
2260
|
+
callConnected(instance);
|
|
2266
2261
|
}
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2262
|
+
};
|
|
2263
|
+
App.prototype.$destroy = function(removeEl = false) {
|
|
2264
|
+
const instance = this;
|
|
2265
|
+
const { el } = instance.$options;
|
|
2266
|
+
if (el) {
|
|
2267
|
+
callDisconnected(instance);
|
|
2268
|
+
}
|
|
2269
|
+
callHook(instance, "destroy");
|
|
2270
|
+
detachFromElement(el, instance);
|
|
2271
|
+
if (removeEl) {
|
|
2272
|
+
remove$1(instance.$el);
|
|
2273
|
+
}
|
|
2274
|
+
};
|
|
2275
|
+
App.prototype.$create = createComponent;
|
|
2276
|
+
App.prototype.$emit = function(e) {
|
|
2277
|
+
callUpdate(this, e);
|
|
2278
|
+
};
|
|
2279
|
+
App.prototype.$update = function(element = this.$el, e) {
|
|
2280
|
+
update(element, e);
|
|
2281
|
+
};
|
|
2282
|
+
App.prototype.$reset = function() {
|
|
2283
|
+
callDisconnected(this);
|
|
2284
|
+
callConnected(this);
|
|
2285
|
+
};
|
|
2286
|
+
App.prototype.$getComponent = getComponent;
|
|
2287
|
+
Object.defineProperties(App.prototype, {
|
|
2288
|
+
$el: {
|
|
2289
|
+
get() {
|
|
2290
|
+
return this.$options.el;
|
|
2271
2291
|
}
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2292
|
+
},
|
|
2293
|
+
$container: Object.getOwnPropertyDescriptor(App, "container")
|
|
2294
|
+
});
|
|
2295
|
+
function generateId(instance, el = instance.$el, postfix = "") {
|
|
2296
|
+
if (el.id) {
|
|
2297
|
+
return el.id;
|
|
2298
|
+
}
|
|
2299
|
+
let id = `${instance.$options.id}-${instance._uid}${postfix}`;
|
|
2300
|
+
if ($(`#${id}`)) {
|
|
2301
|
+
id = generateId(instance, el, `${postfix}-2`);
|
|
2302
|
+
}
|
|
2303
|
+
return id;
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
function boot(App) {
|
|
2307
|
+
if (inBrowser && window.MutationObserver) {
|
|
2308
|
+
requestAnimationFrame(() => init(App));
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
function init(App) {
|
|
2312
|
+
trigger(document, "uikit:init", App);
|
|
2313
|
+
if (document.body) {
|
|
2314
|
+
apply(document.body, connect);
|
|
2315
|
+
}
|
|
2316
|
+
new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(document, {
|
|
2317
|
+
childList: true,
|
|
2318
|
+
subtree: true
|
|
2287
2319
|
});
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2320
|
+
new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(document, {
|
|
2321
|
+
attributes: true,
|
|
2322
|
+
subtree: true
|
|
2323
|
+
});
|
|
2324
|
+
App._initialized = true;
|
|
2325
|
+
}
|
|
2326
|
+
function applyChildListMutation({ addedNodes, removedNodes }) {
|
|
2327
|
+
for (const node of addedNodes) {
|
|
2328
|
+
apply(node, connect);
|
|
2329
|
+
}
|
|
2330
|
+
for (const node of removedNodes) {
|
|
2331
|
+
apply(node, disconnect);
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
function applyAttributeMutation({ target, attributeName }) {
|
|
2335
|
+
var _a;
|
|
2336
|
+
const name = getComponentName(attributeName);
|
|
2337
|
+
if (name) {
|
|
2338
|
+
if (hasAttr(target, attributeName)) {
|
|
2339
|
+
createComponent(name, target);
|
|
2340
|
+
return;
|
|
2294
2341
|
}
|
|
2342
|
+
(_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
|
|
2295
2343
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2344
|
+
}
|
|
2345
|
+
function connect(node) {
|
|
2346
|
+
const components2 = getComponents(node);
|
|
2347
|
+
for (const name in getComponents(node)) {
|
|
2348
|
+
callConnected(components2[name]);
|
|
2349
|
+
}
|
|
2350
|
+
for (const attributeName of node.getAttributeNames()) {
|
|
2298
2351
|
const name = getComponentName(attributeName);
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2352
|
+
name && createComponent(name, node);
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
function disconnect(node) {
|
|
2356
|
+
const components2 = getComponents(node);
|
|
2357
|
+
for (const name in getComponents(node)) {
|
|
2358
|
+
callDisconnected(components2[name]);
|
|
2306
2359
|
}
|
|
2307
2360
|
}
|
|
2361
|
+
function getComponentName(attribute) {
|
|
2362
|
+
if (startsWith(attribute, "data-")) {
|
|
2363
|
+
attribute = attribute.slice(5);
|
|
2364
|
+
}
|
|
2365
|
+
const cmp = components$1[attribute];
|
|
2366
|
+
return cmp && (isPlainObject(cmp) ? cmp : cmp.options).name;
|
|
2367
|
+
}
|
|
2308
2368
|
|
|
2309
2369
|
var Class = {
|
|
2310
2370
|
connected() {
|
|
@@ -2312,26 +2372,6 @@
|
|
|
2312
2372
|
}
|
|
2313
2373
|
};
|
|
2314
2374
|
|
|
2315
|
-
var Lazyload = {
|
|
2316
|
-
data: {
|
|
2317
|
-
preload: 5
|
|
2318
|
-
},
|
|
2319
|
-
methods: {
|
|
2320
|
-
lazyload(observeTargets = this.$el, targets = this.$el) {
|
|
2321
|
-
this.registerObserver(
|
|
2322
|
-
observeIntersection(observeTargets, (entries, observer) => {
|
|
2323
|
-
for (const el of toNodes(isFunction(targets) ? targets() : targets)) {
|
|
2324
|
-
$$('[loading="lazy"]', el).slice(0, this.preload - 1).forEach((el2) => removeAttr(el2, "loading"));
|
|
2325
|
-
}
|
|
2326
|
-
for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {
|
|
2327
|
-
observer.unobserve(el);
|
|
2328
|
-
}
|
|
2329
|
-
})
|
|
2330
|
-
);
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
};
|
|
2334
|
-
|
|
2335
2375
|
var Togglable = {
|
|
2336
2376
|
props: {
|
|
2337
2377
|
cls: Boolean,
|
|
@@ -2477,107 +2517,42 @@
|
|
|
2477
2517
|
[marginStartProp]: 0,
|
|
2478
2518
|
width: dim.width,
|
|
2479
2519
|
height: dim.height,
|
|
2480
|
-
overflow: "hidden",
|
|
2481
|
-
[dimProp]: currentDim
|
|
2482
|
-
});
|
|
2483
|
-
const percent = currentDim / endDim;
|
|
2484
|
-
duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
|
|
2485
|
-
const endProps = { [dimProp]: show ? endDim : 0 };
|
|
2486
|
-
if (end) {
|
|
2487
|
-
css(el, marginProp, endDim - currentDim + currentMargin);
|
|
2488
|
-
endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
|
|
2489
|
-
}
|
|
2490
|
-
if (!end ^ mode === "reveal") {
|
|
2491
|
-
css(wrapper, marginProp, -endDim + currentDim);
|
|
2492
|
-
Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
|
|
2493
|
-
}
|
|
2494
|
-
try {
|
|
2495
|
-
await Transition.start(el, endProps, duration, transition);
|
|
2496
|
-
} finally {
|
|
2497
|
-
css(el, prevProps);
|
|
2498
|
-
unwrap(wrapper.firstChild);
|
|
2499
|
-
if (!show) {
|
|
2500
|
-
_toggle(el, false);
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
function toggleAnimation(el, show, cmp) {
|
|
2505
|
-
Animation.cancel(el);
|
|
2506
|
-
const { animation, duration, _toggle } = cmp;
|
|
2507
|
-
if (show) {
|
|
2508
|
-
_toggle(el, true);
|
|
2509
|
-
return Animation.in(el, animation[0], duration, cmp.origin);
|
|
2510
|
-
}
|
|
2511
|
-
return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(
|
|
2512
|
-
() => _toggle(el, false)
|
|
2513
|
-
);
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
|
-
function getMaxPathLength(el) {
|
|
2517
|
-
return Math.ceil(
|
|
2518
|
-
Math.max(
|
|
2519
|
-
0,
|
|
2520
|
-
...$$("[stroke]", el).map((stroke) => {
|
|
2521
|
-
try {
|
|
2522
|
-
return stroke.getTotalLength();
|
|
2523
|
-
} catch (e) {
|
|
2524
|
-
return 0;
|
|
2525
|
-
}
|
|
2526
|
-
})
|
|
2527
|
-
)
|
|
2528
|
-
);
|
|
2529
|
-
}
|
|
2530
|
-
let prevented;
|
|
2531
|
-
function preventBackgroundScroll(el) {
|
|
2532
|
-
const off = on(
|
|
2533
|
-
el,
|
|
2534
|
-
"touchmove",
|
|
2535
|
-
(e) => {
|
|
2536
|
-
if (e.targetTouches.length !== 1) {
|
|
2537
|
-
return;
|
|
2538
|
-
}
|
|
2539
|
-
let [{ scrollHeight, clientHeight }] = scrollParents(e.target);
|
|
2540
|
-
if (clientHeight >= scrollHeight && e.cancelable) {
|
|
2541
|
-
e.preventDefault();
|
|
2542
|
-
}
|
|
2543
|
-
},
|
|
2544
|
-
{ passive: false }
|
|
2545
|
-
);
|
|
2546
|
-
if (prevented) {
|
|
2547
|
-
return off;
|
|
2548
|
-
}
|
|
2549
|
-
prevented = true;
|
|
2550
|
-
const { scrollingElement } = document;
|
|
2551
|
-
css(scrollingElement, {
|
|
2552
|
-
overflowY: CSS.supports("overflow", "clip") ? "clip" : "hidden",
|
|
2553
|
-
touchAction: "none",
|
|
2554
|
-
paddingRight: width(window) - scrollingElement.clientWidth || ""
|
|
2555
|
-
});
|
|
2556
|
-
return () => {
|
|
2557
|
-
prevented = false;
|
|
2558
|
-
off();
|
|
2559
|
-
css(scrollingElement, { overflowY: "", touchAction: "", paddingRight: "" });
|
|
2560
|
-
};
|
|
2561
|
-
}
|
|
2562
|
-
function isSameSiteAnchor(el) {
|
|
2563
|
-
return ["origin", "pathname", "search"].every((part) => el[part] === location[part]);
|
|
2564
|
-
}
|
|
2565
|
-
function getTargetElement(el) {
|
|
2566
|
-
if (isSameSiteAnchor(el)) {
|
|
2567
|
-
const id = decodeURIComponent(el.hash).substring(1);
|
|
2568
|
-
return document.getElementById(id) || document.getElementsByName(id)[0];
|
|
2520
|
+
overflow: "hidden",
|
|
2521
|
+
[dimProp]: currentDim
|
|
2522
|
+
});
|
|
2523
|
+
const percent = currentDim / endDim;
|
|
2524
|
+
duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
|
|
2525
|
+
const endProps = { [dimProp]: show ? endDim : 0 };
|
|
2526
|
+
if (end) {
|
|
2527
|
+
css(el, marginProp, endDim - currentDim + currentMargin);
|
|
2528
|
+
endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
|
|
2569
2529
|
}
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
return el.id;
|
|
2530
|
+
if (!end ^ mode === "reveal") {
|
|
2531
|
+
css(wrapper, marginProp, -endDim + currentDim);
|
|
2532
|
+
Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
|
|
2574
2533
|
}
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2534
|
+
try {
|
|
2535
|
+
await Transition.start(el, endProps, duration, transition);
|
|
2536
|
+
} finally {
|
|
2537
|
+
css(el, prevProps);
|
|
2538
|
+
unwrap(wrapper.firstChild);
|
|
2539
|
+
if (!show) {
|
|
2540
|
+
_toggle(el, false);
|
|
2541
|
+
}
|
|
2578
2542
|
}
|
|
2579
|
-
return id;
|
|
2580
2543
|
}
|
|
2544
|
+
function toggleAnimation(el, show, cmp) {
|
|
2545
|
+
Animation.cancel(el);
|
|
2546
|
+
const { animation, duration, _toggle } = cmp;
|
|
2547
|
+
if (show) {
|
|
2548
|
+
_toggle(el, true);
|
|
2549
|
+
return Animation.in(el, animation[0], duration, cmp.origin);
|
|
2550
|
+
}
|
|
2551
|
+
return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(
|
|
2552
|
+
() => _toggle(el, false)
|
|
2553
|
+
);
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2581
2556
|
const keyMap = {
|
|
2582
2557
|
TAB: 9,
|
|
2583
2558
|
ESC: 27,
|
|
@@ -2590,8 +2565,89 @@
|
|
|
2590
2565
|
DOWN: 40
|
|
2591
2566
|
};
|
|
2592
2567
|
|
|
2568
|
+
function resize(options) {
|
|
2569
|
+
return observe(observeResize, options, "resize");
|
|
2570
|
+
}
|
|
2571
|
+
function intersection(options) {
|
|
2572
|
+
return observe(observeIntersection, options);
|
|
2573
|
+
}
|
|
2574
|
+
function mutation(options) {
|
|
2575
|
+
return observe(observeMutation, options);
|
|
2576
|
+
}
|
|
2577
|
+
function lazyload(options = {}) {
|
|
2578
|
+
return intersection({
|
|
2579
|
+
handler: function(entries, observer) {
|
|
2580
|
+
const { targets = this.$el, preload = 5 } = options;
|
|
2581
|
+
for (const el of toNodes(isFunction(targets) ? targets(this) : targets)) {
|
|
2582
|
+
$$('[loading="lazy"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, "loading"));
|
|
2583
|
+
}
|
|
2584
|
+
for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {
|
|
2585
|
+
observer.unobserve(el);
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
...options
|
|
2589
|
+
});
|
|
2590
|
+
}
|
|
2591
|
+
function scroll$1(options) {
|
|
2592
|
+
return observe(
|
|
2593
|
+
function(target, handler) {
|
|
2594
|
+
return {
|
|
2595
|
+
disconnect: on(target, "scroll", handler, {
|
|
2596
|
+
passive: true,
|
|
2597
|
+
capture: true
|
|
2598
|
+
})
|
|
2599
|
+
};
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
target: window,
|
|
2603
|
+
...options
|
|
2604
|
+
},
|
|
2605
|
+
"scroll"
|
|
2606
|
+
);
|
|
2607
|
+
}
|
|
2608
|
+
function swipe(options) {
|
|
2609
|
+
return {
|
|
2610
|
+
observe(target, handler) {
|
|
2611
|
+
return {
|
|
2612
|
+
observe: noop,
|
|
2613
|
+
unobserve: noop,
|
|
2614
|
+
disconnect: on(target, pointerDown, handler, { passive: true })
|
|
2615
|
+
};
|
|
2616
|
+
},
|
|
2617
|
+
handler(e) {
|
|
2618
|
+
if (!isTouch(e)) {
|
|
2619
|
+
return;
|
|
2620
|
+
}
|
|
2621
|
+
const pos = getEventPos(e);
|
|
2622
|
+
const target = "tagName" in e.target ? e.target : parent(e.target);
|
|
2623
|
+
once(document, `${pointerUp} ${pointerCancel} scroll`, (e2) => {
|
|
2624
|
+
const { x, y } = getEventPos(e2);
|
|
2625
|
+
if (e2.type !== "scroll" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
|
|
2626
|
+
setTimeout(() => {
|
|
2627
|
+
trigger(target, "swipe");
|
|
2628
|
+
trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);
|
|
2629
|
+
});
|
|
2630
|
+
}
|
|
2631
|
+
});
|
|
2632
|
+
},
|
|
2633
|
+
...options
|
|
2634
|
+
};
|
|
2635
|
+
}
|
|
2636
|
+
function observe(observe2, options, emit) {
|
|
2637
|
+
return {
|
|
2638
|
+
observe: observe2,
|
|
2639
|
+
handler() {
|
|
2640
|
+
this.$emit(emit);
|
|
2641
|
+
},
|
|
2642
|
+
...options
|
|
2643
|
+
};
|
|
2644
|
+
}
|
|
2645
|
+
function swipeDirection(x1, y1, x2, y2) {
|
|
2646
|
+
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? "Left" : "Right" : y1 - y2 > 0 ? "Up" : "Down";
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2593
2649
|
var Accordion = {
|
|
2594
|
-
mixins: [Class,
|
|
2650
|
+
mixins: [Class, Togglable],
|
|
2595
2651
|
props: {
|
|
2596
2652
|
animation: Boolean,
|
|
2597
2653
|
targets: String,
|
|
@@ -2662,9 +2718,7 @@
|
|
|
2662
2718
|
immediate: true
|
|
2663
2719
|
}
|
|
2664
2720
|
},
|
|
2665
|
-
|
|
2666
|
-
this.lazyload();
|
|
2667
|
-
},
|
|
2721
|
+
observe: lazyload(),
|
|
2668
2722
|
events: [
|
|
2669
2723
|
{
|
|
2670
2724
|
name: "click keydown",
|
|
@@ -2850,8 +2904,10 @@
|
|
|
2850
2904
|
if (this.automute) {
|
|
2851
2905
|
mute(this.$el);
|
|
2852
2906
|
}
|
|
2853
|
-
this.registerObserver(observeIntersection(this.$el, () => this.$emit(), {}, false));
|
|
2854
2907
|
},
|
|
2908
|
+
observe: intersection({
|
|
2909
|
+
args: { intersecting: false }
|
|
2910
|
+
}),
|
|
2855
2911
|
update: {
|
|
2856
2912
|
read({ visible }) {
|
|
2857
2913
|
if (!isVideo(this.$el)) {
|
|
@@ -2873,20 +2929,8 @@
|
|
|
2873
2929
|
}
|
|
2874
2930
|
};
|
|
2875
2931
|
|
|
2876
|
-
var Resize = {
|
|
2877
|
-
connected() {
|
|
2878
|
-
var _a;
|
|
2879
|
-
this.registerObserver(
|
|
2880
|
-
observeResize(
|
|
2881
|
-
((_a = this.$options.resizeTargets) == null ? void 0 : _a.call(this)) || this.$el,
|
|
2882
|
-
() => this.$emit("resize")
|
|
2883
|
-
)
|
|
2884
|
-
);
|
|
2885
|
-
}
|
|
2886
|
-
};
|
|
2887
|
-
|
|
2888
2932
|
var cover = {
|
|
2889
|
-
mixins: [
|
|
2933
|
+
mixins: [Video],
|
|
2890
2934
|
props: {
|
|
2891
2935
|
width: Number,
|
|
2892
2936
|
height: Number
|
|
@@ -2899,23 +2943,23 @@
|
|
|
2899
2943
|
this.$emit("resize");
|
|
2900
2944
|
}
|
|
2901
2945
|
},
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
},
|
|
2946
|
+
observe: resize({
|
|
2947
|
+
target: ({ $el }) => [$el, getPositionedParent($el) || parent($el)]
|
|
2948
|
+
}),
|
|
2905
2949
|
update: {
|
|
2906
2950
|
read() {
|
|
2907
2951
|
const { ratio, cover } = Dimensions;
|
|
2908
2952
|
const { $el, width, height } = this;
|
|
2909
2953
|
let dim = { width, height };
|
|
2910
|
-
if (!
|
|
2954
|
+
if (!width || !height) {
|
|
2911
2955
|
const intrinsic = {
|
|
2912
2956
|
width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,
|
|
2913
2957
|
height: $el.naturalHeight || $el.videoHeight || $el.clientHeight
|
|
2914
2958
|
};
|
|
2915
|
-
if (
|
|
2916
|
-
dim = ratio(intrinsic, "width",
|
|
2959
|
+
if (width) {
|
|
2960
|
+
dim = ratio(intrinsic, "width", width);
|
|
2917
2961
|
} else if (height) {
|
|
2918
|
-
dim = ratio(intrinsic, "height",
|
|
2962
|
+
dim = ratio(intrinsic, "height", height);
|
|
2919
2963
|
} else {
|
|
2920
2964
|
dim = intrinsic;
|
|
2921
2965
|
}
|
|
@@ -2944,20 +2988,6 @@
|
|
|
2944
2988
|
}
|
|
2945
2989
|
}
|
|
2946
2990
|
|
|
2947
|
-
var Container = {
|
|
2948
|
-
props: {
|
|
2949
|
-
container: Boolean
|
|
2950
|
-
},
|
|
2951
|
-
data: {
|
|
2952
|
-
container: true
|
|
2953
|
-
},
|
|
2954
|
-
computed: {
|
|
2955
|
-
container({ container }) {
|
|
2956
|
-
return container === true && this.$container || container && $(container);
|
|
2957
|
-
}
|
|
2958
|
-
}
|
|
2959
|
-
};
|
|
2960
|
-
|
|
2961
2991
|
var Position = {
|
|
2962
2992
|
props: {
|
|
2963
2993
|
pos: String,
|
|
@@ -3034,9 +3064,56 @@
|
|
|
3034
3064
|
};
|
|
3035
3065
|
}
|
|
3036
3066
|
|
|
3067
|
+
var Container = {
|
|
3068
|
+
props: {
|
|
3069
|
+
container: Boolean
|
|
3070
|
+
},
|
|
3071
|
+
data: {
|
|
3072
|
+
container: true
|
|
3073
|
+
},
|
|
3074
|
+
computed: {
|
|
3075
|
+
container({ container }) {
|
|
3076
|
+
return container === true && this.$container || container && $(container);
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
};
|
|
3080
|
+
|
|
3081
|
+
let prevented;
|
|
3082
|
+
function preventBackgroundScroll(el) {
|
|
3083
|
+
const off = on(
|
|
3084
|
+
el,
|
|
3085
|
+
"touchmove",
|
|
3086
|
+
(e) => {
|
|
3087
|
+
if (e.targetTouches.length !== 1) {
|
|
3088
|
+
return;
|
|
3089
|
+
}
|
|
3090
|
+
let [{ scrollHeight, clientHeight }] = scrollParents(e.target);
|
|
3091
|
+
if (clientHeight >= scrollHeight && e.cancelable) {
|
|
3092
|
+
e.preventDefault();
|
|
3093
|
+
}
|
|
3094
|
+
},
|
|
3095
|
+
{ passive: false }
|
|
3096
|
+
);
|
|
3097
|
+
if (prevented) {
|
|
3098
|
+
return off;
|
|
3099
|
+
}
|
|
3100
|
+
prevented = true;
|
|
3101
|
+
const { scrollingElement } = document;
|
|
3102
|
+
css(scrollingElement, {
|
|
3103
|
+
overflowY: CSS.supports("overflow", "clip") ? "clip" : "hidden",
|
|
3104
|
+
touchAction: "none",
|
|
3105
|
+
paddingRight: width(window) - scrollingElement.clientWidth || ""
|
|
3106
|
+
});
|
|
3107
|
+
return () => {
|
|
3108
|
+
prevented = false;
|
|
3109
|
+
off();
|
|
3110
|
+
css(scrollingElement, { overflowY: "", touchAction: "", paddingRight: "" });
|
|
3111
|
+
};
|
|
3112
|
+
}
|
|
3113
|
+
|
|
3037
3114
|
let active$1;
|
|
3038
3115
|
var drop = {
|
|
3039
|
-
mixins: [Container,
|
|
3116
|
+
mixins: [Container, Position, Togglable],
|
|
3040
3117
|
args: "pos",
|
|
3041
3118
|
props: {
|
|
3042
3119
|
mode: "list",
|
|
@@ -3102,7 +3179,7 @@
|
|
|
3102
3179
|
if (this.toggle && !this.targetEl) {
|
|
3103
3180
|
this.targetEl = createToggleComponent(this);
|
|
3104
3181
|
}
|
|
3105
|
-
this._style = (
|
|
3182
|
+
this._style = pick(this.$el.style, ["width", "height"]);
|
|
3106
3183
|
},
|
|
3107
3184
|
disconnected() {
|
|
3108
3185
|
if (this.isActive()) {
|
|
@@ -3111,6 +3188,10 @@
|
|
|
3111
3188
|
}
|
|
3112
3189
|
css(this.$el, this._style);
|
|
3113
3190
|
},
|
|
3191
|
+
observe: lazyload({
|
|
3192
|
+
target: ({ toggle, $el }) => query(toggle, $el),
|
|
3193
|
+
targets: ({ $el }) => $el
|
|
3194
|
+
}),
|
|
3114
3195
|
events: [
|
|
3115
3196
|
{
|
|
3116
3197
|
name: "click",
|
|
@@ -3365,7 +3446,6 @@
|
|
|
3365
3446
|
mode: drop.mode
|
|
3366
3447
|
});
|
|
3367
3448
|
attr($el, "aria-haspopup", true);
|
|
3368
|
-
drop.lazyload($el);
|
|
3369
3449
|
return $el;
|
|
3370
3450
|
}
|
|
3371
3451
|
function listenForResize(drop) {
|
|
@@ -3804,7 +3884,6 @@
|
|
|
3804
3884
|
};
|
|
3805
3885
|
|
|
3806
3886
|
var Margin = {
|
|
3807
|
-
mixins: [Resize],
|
|
3808
3887
|
props: {
|
|
3809
3888
|
margin: String,
|
|
3810
3889
|
firstColumn: Boolean
|
|
@@ -3813,18 +3892,18 @@
|
|
|
3813
3892
|
margin: "uk-margin-small-top",
|
|
3814
3893
|
firstColumn: "uk-first-column"
|
|
3815
3894
|
},
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
connected() {
|
|
3820
|
-
this.registerObserver(
|
|
3821
|
-
observeMutation(this.$el, () => this.$reset(), {
|
|
3895
|
+
observe: [
|
|
3896
|
+
mutation({
|
|
3897
|
+
options: {
|
|
3822
3898
|
childList: true,
|
|
3823
3899
|
attributes: true,
|
|
3824
3900
|
attributeFilter: ["style"]
|
|
3825
|
-
}
|
|
3826
|
-
)
|
|
3827
|
-
|
|
3901
|
+
}
|
|
3902
|
+
}),
|
|
3903
|
+
resize({
|
|
3904
|
+
target: ({ $el }) => [$el, ...toArray($el.children)]
|
|
3905
|
+
})
|
|
3906
|
+
],
|
|
3828
3907
|
update: {
|
|
3829
3908
|
read() {
|
|
3830
3909
|
const rows = getRows(this.$el.children);
|
|
@@ -3906,31 +3985,6 @@
|
|
|
3906
3985
|
};
|
|
3907
3986
|
}
|
|
3908
3987
|
|
|
3909
|
-
var Scroll = {
|
|
3910
|
-
connected() {
|
|
3911
|
-
registerScrollListener(this._uid, () => this.$emit("scroll"));
|
|
3912
|
-
},
|
|
3913
|
-
disconnected() {
|
|
3914
|
-
unregisterScrollListener(this._uid);
|
|
3915
|
-
}
|
|
3916
|
-
};
|
|
3917
|
-
const scrollListeners = /* @__PURE__ */ new Map();
|
|
3918
|
-
let unbindScrollListener;
|
|
3919
|
-
function registerScrollListener(id, listener) {
|
|
3920
|
-
unbindScrollListener = unbindScrollListener || on(window, "scroll", () => scrollListeners.forEach((listener2) => listener2()), {
|
|
3921
|
-
passive: true,
|
|
3922
|
-
capture: true
|
|
3923
|
-
});
|
|
3924
|
-
scrollListeners.set(id, listener);
|
|
3925
|
-
}
|
|
3926
|
-
function unregisterScrollListener(id) {
|
|
3927
|
-
scrollListeners.delete(id);
|
|
3928
|
-
if (unbindScrollListener && !scrollListeners.size) {
|
|
3929
|
-
unbindScrollListener();
|
|
3930
|
-
unbindScrollListener = null;
|
|
3931
|
-
}
|
|
3932
|
-
}
|
|
3933
|
-
|
|
3934
3988
|
var grid = {
|
|
3935
3989
|
extends: Margin,
|
|
3936
3990
|
mixins: [Class],
|
|
@@ -3947,11 +4001,8 @@
|
|
|
3947
4001
|
},
|
|
3948
4002
|
connected() {
|
|
3949
4003
|
this.masonry && addClass(this.$el, "uk-flex-top uk-flex-wrap-top");
|
|
3950
|
-
this.parallax && registerScrollListener(this._uid, () => this.$emit("scroll"));
|
|
3951
|
-
},
|
|
3952
|
-
disconnected() {
|
|
3953
|
-
unregisterScrollListener(this._uid);
|
|
3954
4004
|
},
|
|
4005
|
+
observe: scroll$1({ filter: ({ parallax }) => parallax }),
|
|
3955
4006
|
update: [
|
|
3956
4007
|
{
|
|
3957
4008
|
write({ columns }) {
|
|
@@ -4038,7 +4089,6 @@
|
|
|
4038
4089
|
}
|
|
4039
4090
|
|
|
4040
4091
|
var heightMatch = {
|
|
4041
|
-
mixins: [Resize],
|
|
4042
4092
|
args: "target",
|
|
4043
4093
|
props: {
|
|
4044
4094
|
target: String,
|
|
@@ -4058,9 +4108,9 @@
|
|
|
4058
4108
|
}
|
|
4059
4109
|
}
|
|
4060
4110
|
},
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
},
|
|
4111
|
+
observe: resize({
|
|
4112
|
+
target: ({ $el, elements }) => [$el, ...elements]
|
|
4113
|
+
}),
|
|
4064
4114
|
update: {
|
|
4065
4115
|
read() {
|
|
4066
4116
|
return {
|
|
@@ -4079,7 +4129,6 @@
|
|
|
4079
4129
|
if (elements.length < 2) {
|
|
4080
4130
|
return { heights: [""], elements };
|
|
4081
4131
|
}
|
|
4082
|
-
css(elements, "minHeight", "");
|
|
4083
4132
|
let heights = elements.map(getHeight);
|
|
4084
4133
|
const max = Math.max(...heights);
|
|
4085
4134
|
return {
|
|
@@ -4088,20 +4137,17 @@
|
|
|
4088
4137
|
};
|
|
4089
4138
|
}
|
|
4090
4139
|
function getHeight(element) {
|
|
4091
|
-
|
|
4140
|
+
const style = pick(element.style, ["display", "minHeight"]);
|
|
4092
4141
|
if (!isVisible(element)) {
|
|
4093
|
-
style = element.style.display;
|
|
4094
4142
|
css(element, "display", "block", "important");
|
|
4095
4143
|
}
|
|
4144
|
+
css(element, "minHeight", "");
|
|
4096
4145
|
const height = dimensions(element).height - boxModelAdjust(element, "height", "content-box");
|
|
4097
|
-
|
|
4098
|
-
css(element, "display", style);
|
|
4099
|
-
}
|
|
4146
|
+
css(element, style);
|
|
4100
4147
|
return height;
|
|
4101
4148
|
}
|
|
4102
4149
|
|
|
4103
4150
|
var heightViewport = {
|
|
4104
|
-
mixins: [Resize],
|
|
4105
4151
|
props: {
|
|
4106
4152
|
expand: Boolean,
|
|
4107
4153
|
offsetTop: Boolean,
|
|
@@ -4114,9 +4160,10 @@
|
|
|
4114
4160
|
offsetBottom: false,
|
|
4115
4161
|
minHeight: 0
|
|
4116
4162
|
},
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4163
|
+
// check for offsetTop change
|
|
4164
|
+
observe: resize({
|
|
4165
|
+
target: ({ $el }) => [$el, ...scrollParents($el)]
|
|
4166
|
+
}),
|
|
4120
4167
|
update: {
|
|
4121
4168
|
read({ minHeight: prev }) {
|
|
4122
4169
|
if (!isVisible(this.$el)) {
|
|
@@ -4168,6 +4215,21 @@
|
|
|
4168
4215
|
}
|
|
4169
4216
|
};
|
|
4170
4217
|
|
|
4218
|
+
function getMaxPathLength(el) {
|
|
4219
|
+
return Math.ceil(
|
|
4220
|
+
Math.max(
|
|
4221
|
+
0,
|
|
4222
|
+
...$$("[stroke]", el).map((stroke) => {
|
|
4223
|
+
try {
|
|
4224
|
+
return stroke.getTotalLength();
|
|
4225
|
+
} catch (e) {
|
|
4226
|
+
return 0;
|
|
4227
|
+
}
|
|
4228
|
+
})
|
|
4229
|
+
)
|
|
4230
|
+
);
|
|
4231
|
+
}
|
|
4232
|
+
|
|
4171
4233
|
var SVG = {
|
|
4172
4234
|
args: "src",
|
|
4173
4235
|
props: {
|
|
@@ -4209,7 +4271,8 @@
|
|
|
4209
4271
|
this.svg.then((el) => {
|
|
4210
4272
|
if (this._connected && el) {
|
|
4211
4273
|
applyAnimation(el);
|
|
4212
|
-
|
|
4274
|
+
registerObserver(
|
|
4275
|
+
this,
|
|
4213
4276
|
observeIntersection(el, (records, observer) => {
|
|
4214
4277
|
applyAnimation(el);
|
|
4215
4278
|
observer.disconnect();
|
|
@@ -4558,31 +4621,26 @@
|
|
|
4558
4621
|
this.load();
|
|
4559
4622
|
return;
|
|
4560
4623
|
}
|
|
4561
|
-
const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
|
|
4562
4624
|
if (nativeLazyLoad && isImg(this.$el)) {
|
|
4563
4625
|
this.$el.loading = "lazy";
|
|
4564
4626
|
setSrcAttrs(this.$el);
|
|
4565
|
-
if (target.length === 1) {
|
|
4566
|
-
return;
|
|
4567
|
-
}
|
|
4568
4627
|
}
|
|
4569
4628
|
ensureSrcAttribute(this.$el);
|
|
4570
|
-
this.registerObserver(
|
|
4571
|
-
observeIntersection(
|
|
4572
|
-
target,
|
|
4573
|
-
(entries, observer) => {
|
|
4574
|
-
this.load();
|
|
4575
|
-
observer.disconnect();
|
|
4576
|
-
},
|
|
4577
|
-
{ rootMargin: this.margin }
|
|
4578
|
-
)
|
|
4579
|
-
);
|
|
4580
4629
|
},
|
|
4581
4630
|
disconnected() {
|
|
4582
4631
|
if (this._data.image) {
|
|
4583
4632
|
this._data.image.onload = "";
|
|
4584
4633
|
}
|
|
4585
4634
|
},
|
|
4635
|
+
observe: intersection({
|
|
4636
|
+
target: ({ $el, $props }) => [$el, ...queryAll($props.target, $el)],
|
|
4637
|
+
handler(entries, observer) {
|
|
4638
|
+
this.load();
|
|
4639
|
+
observer.disconnect();
|
|
4640
|
+
},
|
|
4641
|
+
options: ({ margin }) => ({ rootMargin: margin }),
|
|
4642
|
+
filter: ({ loading }) => loading === "lazy"
|
|
4643
|
+
}),
|
|
4586
4644
|
methods: {
|
|
4587
4645
|
load() {
|
|
4588
4646
|
if (this._data.image) {
|
|
@@ -4706,7 +4764,7 @@
|
|
|
4706
4764
|
}
|
|
4707
4765
|
|
|
4708
4766
|
var leader = {
|
|
4709
|
-
mixins: [Class, Media
|
|
4767
|
+
mixins: [Class, Media],
|
|
4710
4768
|
props: {
|
|
4711
4769
|
fill: String
|
|
4712
4770
|
},
|
|
@@ -4727,6 +4785,7 @@
|
|
|
4727
4785
|
disconnected() {
|
|
4728
4786
|
unwrap(this.wrapper.childNodes);
|
|
4729
4787
|
},
|
|
4788
|
+
observe: resize(),
|
|
4730
4789
|
update: {
|
|
4731
4790
|
read() {
|
|
4732
4791
|
const width = Math.trunc(this.$el.offsetWidth / 2);
|
|
@@ -5037,7 +5096,7 @@
|
|
|
5037
5096
|
escClose: true,
|
|
5038
5097
|
role: "alertdialog",
|
|
5039
5098
|
...options,
|
|
5040
|
-
i18n: { ...modal.i18n, ...options.i18n }
|
|
5099
|
+
i18n: { ...modal.i18n, ...options == null ? void 0 : options.i18n }
|
|
5041
5100
|
};
|
|
5042
5101
|
const dialog = modal.dialog(tmpl(options), options);
|
|
5043
5102
|
const deferred = new Deferred();
|
|
@@ -5092,56 +5151,14 @@
|
|
|
5092
5151
|
}
|
|
5093
5152
|
};
|
|
5094
5153
|
|
|
5095
|
-
var Swipe = {
|
|
5096
|
-
props: {
|
|
5097
|
-
swiping: Boolean
|
|
5098
|
-
},
|
|
5099
|
-
data: {
|
|
5100
|
-
swiping: true
|
|
5101
|
-
},
|
|
5102
|
-
computed: {
|
|
5103
|
-
swipeTarget(props, $el) {
|
|
5104
|
-
return $el;
|
|
5105
|
-
}
|
|
5106
|
-
},
|
|
5107
|
-
connected() {
|
|
5108
|
-
if (!this.swiping) {
|
|
5109
|
-
return;
|
|
5110
|
-
}
|
|
5111
|
-
registerEvent(this, {
|
|
5112
|
-
el: this.swipeTarget,
|
|
5113
|
-
name: pointerDown,
|
|
5114
|
-
passive: true,
|
|
5115
|
-
handler(e) {
|
|
5116
|
-
if (!isTouch(e)) {
|
|
5117
|
-
return;
|
|
5118
|
-
}
|
|
5119
|
-
const pos = getEventPos(e);
|
|
5120
|
-
const target = "tagName" in e.target ? e.target : parent(e.target);
|
|
5121
|
-
once(document, `${pointerUp} ${pointerCancel} scroll`, (e2) => {
|
|
5122
|
-
const { x, y } = getEventPos(e2);
|
|
5123
|
-
if (e2.type !== "scroll" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
|
|
5124
|
-
setTimeout(() => {
|
|
5125
|
-
trigger(target, "swipe");
|
|
5126
|
-
trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);
|
|
5127
|
-
});
|
|
5128
|
-
}
|
|
5129
|
-
});
|
|
5130
|
-
}
|
|
5131
|
-
});
|
|
5132
|
-
}
|
|
5133
|
-
};
|
|
5134
|
-
function swipeDirection(x1, y1, x2, y2) {
|
|
5135
|
-
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? "Left" : "Right" : y1 - y2 > 0 ? "Up" : "Down";
|
|
5136
|
-
}
|
|
5137
|
-
|
|
5138
5154
|
var offcanvas = {
|
|
5139
|
-
mixins: [Modal
|
|
5155
|
+
mixins: [Modal],
|
|
5140
5156
|
args: "mode",
|
|
5141
5157
|
props: {
|
|
5142
5158
|
mode: String,
|
|
5143
5159
|
flip: Boolean,
|
|
5144
|
-
overlay: Boolean
|
|
5160
|
+
overlay: Boolean,
|
|
5161
|
+
swiping: Boolean
|
|
5145
5162
|
},
|
|
5146
5163
|
data: {
|
|
5147
5164
|
mode: "slide",
|
|
@@ -5156,7 +5173,8 @@
|
|
|
5156
5173
|
clsMode: "uk-offcanvas",
|
|
5157
5174
|
clsOverlay: "uk-offcanvas-overlay",
|
|
5158
5175
|
selClose: ".uk-offcanvas-close",
|
|
5159
|
-
container: false
|
|
5176
|
+
container: false,
|
|
5177
|
+
swiping: true
|
|
5160
5178
|
},
|
|
5161
5179
|
computed: {
|
|
5162
5180
|
clsFlip({ flip, clsFlip }) {
|
|
@@ -5178,6 +5196,7 @@
|
|
|
5178
5196
|
return mode === "reveal" ? parent(this.panel) : this.panel;
|
|
5179
5197
|
}
|
|
5180
5198
|
},
|
|
5199
|
+
observe: swipe({ filter: ({ swiping }) => swiping }),
|
|
5181
5200
|
update: {
|
|
5182
5201
|
read() {
|
|
5183
5202
|
if (this.isToggled() && !isVisible(this.$el)) {
|
|
@@ -5267,7 +5286,7 @@
|
|
|
5267
5286
|
}
|
|
5268
5287
|
|
|
5269
5288
|
var overflowAuto = {
|
|
5270
|
-
mixins: [Class
|
|
5289
|
+
mixins: [Class],
|
|
5271
5290
|
props: {
|
|
5272
5291
|
selContainer: String,
|
|
5273
5292
|
selContent: String,
|
|
@@ -5286,9 +5305,9 @@
|
|
|
5286
5305
|
return closest($el, selContent);
|
|
5287
5306
|
}
|
|
5288
5307
|
},
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
},
|
|
5308
|
+
observe: resize({
|
|
5309
|
+
target: ({ container, content }) => [container, content]
|
|
5310
|
+
}),
|
|
5292
5311
|
update: {
|
|
5293
5312
|
read() {
|
|
5294
5313
|
if (!this.content || !this.container || !isVisible(this.$el)) {
|
|
@@ -5309,14 +5328,13 @@
|
|
|
5309
5328
|
};
|
|
5310
5329
|
|
|
5311
5330
|
var responsive = {
|
|
5312
|
-
mixins: [Resize],
|
|
5313
5331
|
props: ["width", "height"],
|
|
5314
|
-
resizeTargets() {
|
|
5315
|
-
return [this.$el, parent(this.$el)];
|
|
5316
|
-
},
|
|
5317
5332
|
connected() {
|
|
5318
5333
|
addClass(this.$el, "uk-responsive-width");
|
|
5319
5334
|
},
|
|
5335
|
+
observe: resize({
|
|
5336
|
+
target: ({ $el }) => [$el, parent($el)]
|
|
5337
|
+
}),
|
|
5320
5338
|
update: {
|
|
5321
5339
|
read() {
|
|
5322
5340
|
return isVisible(this.$el) && this.width && this.height ? { width: width(parent(this.$el)), height: this.height } : false;
|
|
@@ -5360,16 +5378,16 @@
|
|
|
5360
5378
|
}
|
|
5361
5379
|
}
|
|
5362
5380
|
};
|
|
5363
|
-
const
|
|
5381
|
+
const instances = /* @__PURE__ */ new Set();
|
|
5364
5382
|
function registerClick(cmp) {
|
|
5365
|
-
if (!
|
|
5383
|
+
if (!instances.size) {
|
|
5366
5384
|
on(document, "click", clickHandler);
|
|
5367
5385
|
}
|
|
5368
|
-
|
|
5386
|
+
instances.add(cmp);
|
|
5369
5387
|
}
|
|
5370
5388
|
function unregisterClick(cmp) {
|
|
5371
|
-
|
|
5372
|
-
if (!
|
|
5389
|
+
instances.delete(cmp);
|
|
5390
|
+
if (!instances.size) {
|
|
5373
5391
|
off(document, "click", clickHandler);
|
|
5374
5392
|
}
|
|
5375
5393
|
}
|
|
@@ -5377,16 +5395,16 @@
|
|
|
5377
5395
|
if (e.defaultPrevented) {
|
|
5378
5396
|
return;
|
|
5379
5397
|
}
|
|
5380
|
-
for (const
|
|
5381
|
-
if (within(e.target,
|
|
5398
|
+
for (const instance of instances) {
|
|
5399
|
+
if (within(e.target, instance.$el) && isSameSiteAnchor(instance.$el)) {
|
|
5382
5400
|
e.preventDefault();
|
|
5383
|
-
|
|
5401
|
+
window.history.pushState({}, "", instance.$el.href);
|
|
5402
|
+
instance.scrollTo(getTargetedElement(instance.$el));
|
|
5384
5403
|
}
|
|
5385
5404
|
}
|
|
5386
5405
|
}
|
|
5387
5406
|
|
|
5388
5407
|
var scrollspy = {
|
|
5389
|
-
mixins: [Scroll],
|
|
5390
5408
|
args: "cls",
|
|
5391
5409
|
props: {
|
|
5392
5410
|
cls: String,
|
|
@@ -5410,48 +5428,43 @@
|
|
|
5410
5428
|
get({ target }, $el) {
|
|
5411
5429
|
return target ? $$(target, $el) : [$el];
|
|
5412
5430
|
},
|
|
5413
|
-
watch(elements
|
|
5431
|
+
watch(elements) {
|
|
5414
5432
|
if (this.hidden) {
|
|
5415
5433
|
css(filter(elements, `:not(.${this.inViewClass})`), "opacity", 0);
|
|
5416
5434
|
}
|
|
5417
|
-
if (!isEqual(elements, prev)) {
|
|
5418
|
-
this.$reset();
|
|
5419
|
-
}
|
|
5420
5435
|
},
|
|
5421
5436
|
immediate: true
|
|
5422
5437
|
}
|
|
5423
5438
|
},
|
|
5424
5439
|
connected() {
|
|
5425
5440
|
this._data.elements = /* @__PURE__ */ new Map();
|
|
5426
|
-
this.registerObserver(
|
|
5427
|
-
observeIntersection(
|
|
5428
|
-
this.elements,
|
|
5429
|
-
(records) => {
|
|
5430
|
-
const elements = this._data.elements;
|
|
5431
|
-
for (const { target: el, isIntersecting } of records) {
|
|
5432
|
-
if (!elements.has(el)) {
|
|
5433
|
-
elements.set(el, {
|
|
5434
|
-
cls: data(el, "uk-scrollspy-class") || this.cls
|
|
5435
|
-
});
|
|
5436
|
-
}
|
|
5437
|
-
const state = elements.get(el);
|
|
5438
|
-
if (!this.repeat && state.show) {
|
|
5439
|
-
continue;
|
|
5440
|
-
}
|
|
5441
|
-
state.show = isIntersecting;
|
|
5442
|
-
}
|
|
5443
|
-
this.$emit();
|
|
5444
|
-
},
|
|
5445
|
-
{ rootMargin: this.margin },
|
|
5446
|
-
false
|
|
5447
|
-
)
|
|
5448
|
-
);
|
|
5449
5441
|
},
|
|
5450
5442
|
disconnected() {
|
|
5451
5443
|
for (const [el, state] of this._data.elements.entries()) {
|
|
5452
5444
|
removeClass(el, this.inViewClass, (state == null ? void 0 : state.cls) || "");
|
|
5453
5445
|
}
|
|
5454
5446
|
},
|
|
5447
|
+
observe: intersection({
|
|
5448
|
+
target: ({ elements }) => elements,
|
|
5449
|
+
handler(records) {
|
|
5450
|
+
const elements = this._data.elements;
|
|
5451
|
+
for (const { target: el, isIntersecting } of records) {
|
|
5452
|
+
if (!elements.has(el)) {
|
|
5453
|
+
elements.set(el, {
|
|
5454
|
+
cls: data(el, "uk-scrollspy-class") || this.cls
|
|
5455
|
+
});
|
|
5456
|
+
}
|
|
5457
|
+
const state = elements.get(el);
|
|
5458
|
+
if (!this.repeat && state.show) {
|
|
5459
|
+
continue;
|
|
5460
|
+
}
|
|
5461
|
+
state.show = isIntersecting;
|
|
5462
|
+
}
|
|
5463
|
+
this.$emit();
|
|
5464
|
+
},
|
|
5465
|
+
options: (instance) => ({ rootMargin: instance.margin }),
|
|
5466
|
+
args: { intersecting: false }
|
|
5467
|
+
}),
|
|
5455
5468
|
update: [
|
|
5456
5469
|
{
|
|
5457
5470
|
write(data) {
|
|
@@ -5499,7 +5512,6 @@
|
|
|
5499
5512
|
};
|
|
5500
5513
|
|
|
5501
5514
|
var scrollspyNav = {
|
|
5502
|
-
mixins: [Scroll],
|
|
5503
5515
|
props: {
|
|
5504
5516
|
cls: String,
|
|
5505
5517
|
closest: String,
|
|
@@ -5530,10 +5542,11 @@
|
|
|
5530
5542
|
return closest(this.links, selector || "*");
|
|
5531
5543
|
}
|
|
5532
5544
|
},
|
|
5545
|
+
observe: scroll$1(),
|
|
5533
5546
|
update: [
|
|
5534
5547
|
{
|
|
5535
5548
|
read() {
|
|
5536
|
-
const targets = this.links.map(
|
|
5549
|
+
const targets = this.links.map(getTargetedElement).filter(Boolean);
|
|
5537
5550
|
const { length } = targets;
|
|
5538
5551
|
if (!length || !isVisible(this.$el)) {
|
|
5539
5552
|
return false;
|
|
@@ -5574,7 +5587,7 @@
|
|
|
5574
5587
|
};
|
|
5575
5588
|
|
|
5576
5589
|
var sticky = {
|
|
5577
|
-
mixins: [Class, Media
|
|
5590
|
+
mixins: [Class, Media],
|
|
5578
5591
|
props: {
|
|
5579
5592
|
position: String,
|
|
5580
5593
|
top: null,
|
|
@@ -5614,16 +5627,12 @@
|
|
|
5614
5627
|
return selTarget && $(selTarget, $el) || $el;
|
|
5615
5628
|
}
|
|
5616
5629
|
},
|
|
5617
|
-
resizeTargets() {
|
|
5618
|
-
return document.documentElement;
|
|
5619
|
-
},
|
|
5620
5630
|
connected() {
|
|
5621
5631
|
this.start = coerce(this.start || this.top);
|
|
5622
5632
|
this.end = coerce(this.end || this.bottom);
|
|
5623
5633
|
this.placeholder = $("+ .uk-sticky-placeholder", this.$el) || $('<div class="uk-sticky-placeholder"></div>');
|
|
5624
5634
|
this.isFixed = false;
|
|
5625
5635
|
this.setActive(false);
|
|
5626
|
-
this.registerObserver(observeResize(this.$el, () => !this.isFixed && this.$emit("resize")));
|
|
5627
5636
|
},
|
|
5628
5637
|
disconnected() {
|
|
5629
5638
|
if (this.isFixed) {
|
|
@@ -5634,6 +5643,15 @@
|
|
|
5634
5643
|
remove$1(this.placeholder);
|
|
5635
5644
|
this.placeholder = null;
|
|
5636
5645
|
},
|
|
5646
|
+
observe: [
|
|
5647
|
+
resize({
|
|
5648
|
+
handler() {
|
|
5649
|
+
!this.isFixed && this.$emit("resize");
|
|
5650
|
+
}
|
|
5651
|
+
}),
|
|
5652
|
+
resize({ target: () => [document.documentElement] }),
|
|
5653
|
+
scroll$1()
|
|
5654
|
+
],
|
|
5637
5655
|
events: [
|
|
5638
5656
|
{
|
|
5639
5657
|
name: "resize",
|
|
@@ -5754,18 +5772,18 @@
|
|
|
5754
5772
|
start,
|
|
5755
5773
|
end
|
|
5756
5774
|
}) {
|
|
5757
|
-
const
|
|
5758
|
-
const dir = prevScroll <=
|
|
5775
|
+
const scroll2 = document.scrollingElement.scrollTop;
|
|
5776
|
+
const dir = prevScroll <= scroll2 ? "down" : "up";
|
|
5759
5777
|
return {
|
|
5760
5778
|
dir,
|
|
5761
5779
|
prevDir,
|
|
5762
|
-
scroll,
|
|
5780
|
+
scroll: scroll2,
|
|
5763
5781
|
prevScroll,
|
|
5764
5782
|
offsetParentTop: offset(
|
|
5765
5783
|
(this.isFixed ? this.placeholder : this.$el).offsetParent
|
|
5766
5784
|
).top,
|
|
5767
5785
|
overflowScroll: clamp(
|
|
5768
|
-
overflowScroll + clamp(
|
|
5786
|
+
overflowScroll + clamp(scroll2, start, end) - clamp(prevScroll, start, end),
|
|
5769
5787
|
0,
|
|
5770
5788
|
overflow
|
|
5771
5789
|
)
|
|
@@ -5777,33 +5795,33 @@
|
|
|
5777
5795
|
initTimestamp = 0,
|
|
5778
5796
|
dir,
|
|
5779
5797
|
prevDir,
|
|
5780
|
-
scroll,
|
|
5798
|
+
scroll: scroll2,
|
|
5781
5799
|
prevScroll = 0,
|
|
5782
5800
|
top,
|
|
5783
5801
|
start,
|
|
5784
5802
|
topOffset,
|
|
5785
5803
|
height
|
|
5786
5804
|
} = data;
|
|
5787
|
-
if (
|
|
5805
|
+
if (scroll2 < 0 || scroll2 === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
|
|
5788
5806
|
return;
|
|
5789
5807
|
}
|
|
5790
5808
|
const now = Date.now();
|
|
5791
5809
|
if (now - initTimestamp > 300 || dir !== prevDir) {
|
|
5792
|
-
data.initScroll =
|
|
5810
|
+
data.initScroll = scroll2;
|
|
5793
5811
|
data.initTimestamp = now;
|
|
5794
5812
|
}
|
|
5795
|
-
if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll -
|
|
5813
|
+
if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll2) <= 30 && Math.abs(prevScroll - scroll2) <= 10) {
|
|
5796
5814
|
return;
|
|
5797
5815
|
}
|
|
5798
|
-
if (this.inactive ||
|
|
5816
|
+
if (this.inactive || scroll2 < start || this.showOnUp && (scroll2 <= start || dir === "down" && isScrollUpdate || dir === "up" && !this.isFixed && scroll2 <= topOffset + height)) {
|
|
5799
5817
|
if (!this.isFixed) {
|
|
5800
|
-
if (Animation.inProgress(this.$el) && top >
|
|
5818
|
+
if (Animation.inProgress(this.$el) && top > scroll2) {
|
|
5801
5819
|
Animation.cancel(this.$el);
|
|
5802
5820
|
this.hide();
|
|
5803
5821
|
}
|
|
5804
5822
|
return;
|
|
5805
5823
|
}
|
|
5806
|
-
if (this.animation &&
|
|
5824
|
+
if (this.animation && scroll2 > topOffset) {
|
|
5807
5825
|
Animation.cancel(this.$el);
|
|
5808
5826
|
Animation.out(this.$el, this.animation).then(() => this.hide(), noop);
|
|
5809
5827
|
} else {
|
|
@@ -5811,7 +5829,7 @@
|
|
|
5811
5829
|
}
|
|
5812
5830
|
} else if (this.isFixed) {
|
|
5813
5831
|
this.update();
|
|
5814
|
-
} else if (this.animation &&
|
|
5832
|
+
} else if (this.animation && scroll2 > topOffset) {
|
|
5815
5833
|
Animation.cancel(this.$el);
|
|
5816
5834
|
this.show();
|
|
5817
5835
|
Animation.in(this.$el, this.animation).catch(noop);
|
|
@@ -5848,7 +5866,7 @@
|
|
|
5848
5866
|
update() {
|
|
5849
5867
|
let {
|
|
5850
5868
|
width,
|
|
5851
|
-
scroll = 0,
|
|
5869
|
+
scroll: scroll2 = 0,
|
|
5852
5870
|
overflow,
|
|
5853
5871
|
overflowScroll = 0,
|
|
5854
5872
|
start,
|
|
@@ -5860,10 +5878,10 @@
|
|
|
5860
5878
|
offsetParentTop,
|
|
5861
5879
|
sticky
|
|
5862
5880
|
} = this._data;
|
|
5863
|
-
const active = start !== 0 ||
|
|
5881
|
+
const active = start !== 0 || scroll2 > start;
|
|
5864
5882
|
if (!sticky) {
|
|
5865
5883
|
let position = "fixed";
|
|
5866
|
-
if (
|
|
5884
|
+
if (scroll2 > end) {
|
|
5867
5885
|
offset += end - offsetParentTop;
|
|
5868
5886
|
position = "absolute";
|
|
5869
5887
|
}
|
|
@@ -5878,7 +5896,7 @@
|
|
|
5878
5896
|
toggleClass(
|
|
5879
5897
|
this.$el,
|
|
5880
5898
|
this.clsBelow,
|
|
5881
|
-
|
|
5899
|
+
scroll2 > topOffset + (sticky ? Math.min(height, elHeight) : height)
|
|
5882
5900
|
);
|
|
5883
5901
|
addClass(this.$el, this.clsFixed);
|
|
5884
5902
|
},
|
|
@@ -5920,14 +5938,15 @@
|
|
|
5920
5938
|
|
|
5921
5939
|
const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
|
|
5922
5940
|
var Switcher = {
|
|
5923
|
-
mixins: [
|
|
5941
|
+
mixins: [Togglable],
|
|
5924
5942
|
args: "connect",
|
|
5925
5943
|
props: {
|
|
5926
5944
|
connect: String,
|
|
5927
5945
|
toggle: String,
|
|
5928
5946
|
itemNav: String,
|
|
5929
5947
|
active: Number,
|
|
5930
|
-
followFocus: Boolean
|
|
5948
|
+
followFocus: Boolean,
|
|
5949
|
+
swiping: Boolean
|
|
5931
5950
|
},
|
|
5932
5951
|
data: {
|
|
5933
5952
|
connect: "~.uk-switcher",
|
|
@@ -5937,7 +5956,8 @@
|
|
|
5937
5956
|
cls: "uk-active",
|
|
5938
5957
|
attrItem: "uk-switcher-item",
|
|
5939
5958
|
selVertical: ".uk-nav",
|
|
5940
|
-
followFocus: false
|
|
5959
|
+
followFocus: false,
|
|
5960
|
+
swiping: true
|
|
5941
5961
|
},
|
|
5942
5962
|
computed: {
|
|
5943
5963
|
connects: {
|
|
@@ -5961,7 +5981,6 @@
|
|
|
5961
5981
|
const index = this.index();
|
|
5962
5982
|
for (const el of this.connects) {
|
|
5963
5983
|
children(el).forEach((child, i) => toggleClass(child, this.cls, i === index));
|
|
5964
|
-
this.lazyload(this.$el, children(el));
|
|
5965
5984
|
}
|
|
5966
5985
|
this.$emit();
|
|
5967
5986
|
},
|
|
@@ -5982,14 +6001,15 @@
|
|
|
5982
6001
|
return children(this.$el).filter(
|
|
5983
6002
|
(child) => this.toggles.some((toggle) => within(toggle, child))
|
|
5984
6003
|
);
|
|
5985
|
-
},
|
|
5986
|
-
swipeTarget() {
|
|
5987
|
-
return this.connects;
|
|
5988
6004
|
}
|
|
5989
6005
|
},
|
|
5990
6006
|
connected() {
|
|
5991
6007
|
attr(this.$el, "role", "tablist");
|
|
5992
6008
|
},
|
|
6009
|
+
observe: [
|
|
6010
|
+
lazyload({ targets: ({ connectChildren }) => connectChildren }),
|
|
6011
|
+
swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping })
|
|
6012
|
+
],
|
|
5993
6013
|
events: [
|
|
5994
6014
|
{
|
|
5995
6015
|
name: "click keydown",
|
|
@@ -6123,7 +6143,7 @@
|
|
|
6123
6143
|
|
|
6124
6144
|
const KEY_SPACE = 32;
|
|
6125
6145
|
var toggle = {
|
|
6126
|
-
mixins: [
|
|
6146
|
+
mixins: [Media, Togglable],
|
|
6127
6147
|
args: "target",
|
|
6128
6148
|
props: {
|
|
6129
6149
|
href: String,
|
|
@@ -6152,8 +6172,8 @@
|
|
|
6152
6172
|
attr(this.$el, "role", "button");
|
|
6153
6173
|
}
|
|
6154
6174
|
}
|
|
6155
|
-
this.lazyload(this.$el, () => this.target);
|
|
6156
6175
|
},
|
|
6176
|
+
observe: lazyload({ target: ({ target }) => target }),
|
|
6157
6177
|
events: [
|
|
6158
6178
|
{
|
|
6159
6179
|
name: pointerDown,
|
|
@@ -6320,9 +6340,9 @@
|
|
|
6320
6340
|
Video: Video
|
|
6321
6341
|
});
|
|
6322
6342
|
|
|
6323
|
-
each(components, (component, name) =>
|
|
6324
|
-
boot(
|
|
6343
|
+
each(components, (component, name) => App.component(name, component));
|
|
6344
|
+
boot(App);
|
|
6325
6345
|
|
|
6326
|
-
return
|
|
6346
|
+
return App;
|
|
6327
6347
|
|
|
6328
6348
|
}));
|