uikit 3.11.2-dev.92f357b93 → 3.11.2-dev.946d2efea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -3
- package/dist/css/uikit-core-rtl.css +24 -11
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +24 -11
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +24 -11
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +24 -11
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +3 -3
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +5 -15
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +5 -15
- 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 +9 -10
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +9 -10
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +59 -78
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +9 -10
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +23 -45
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +2 -2
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +2 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +427 -312
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +485 -410
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/hooks.js +2 -2
- package/src/js/api/state.js +173 -140
- package/src/js/components/countdown.js +2 -2
- package/src/js/components/internal/slider-preload.js +4 -32
- package/src/js/components/slider.js +39 -42
- package/src/js/components/upload.js +2 -1
- package/src/js/core/accordion.js +6 -1
- package/src/js/core/core.js +2 -75
- package/src/js/core/cover.js +5 -1
- package/src/js/core/drop.js +3 -1
- package/src/js/core/form-custom.js +2 -2
- package/src/js/core/height-viewport.js +3 -0
- package/src/js/core/icon.js +13 -6
- package/src/js/core/img.js +19 -25
- package/src/js/core/offcanvas.js +2 -1
- package/src/js/core/sticky.js +50 -56
- package/src/js/core/switcher.js +11 -3
- package/src/js/core/toggle.js +4 -2
- package/src/js/core/video.js +13 -1
- package/src/js/mixin/lazyload.js +20 -0
- package/src/js/mixin/parallax.js +9 -10
- package/src/js/mixin/slider.js +0 -6
- package/src/js/mixin/slideshow.js +0 -4
- package/src/js/mixin/swipe.js +72 -0
- package/src/js/mixin/togglable.js +1 -1
- package/src/js/util/ajax.js +6 -2
- package/src/js/util/dimensions.js +4 -4
- package/src/js/util/dom.js +16 -7
- package/src/js/util/index.js +1 -0
- package/src/js/util/observer.js +36 -0
- package/src/less/components/form-range.less +4 -6
- package/src/less/components/height.less +3 -0
- package/src/less/components/utility.less +6 -3
- package/src/scss/components/form-range.scss +4 -6
- package/src/scss/components/height.scss +3 -0
- package/src/scss/components/utility.scss +6 -3
- package/tests/parallax.html +5 -5
- package/tests/sticky-parallax.html +10 -10
- package/tests/utility.html +17 -0
package/dist/js/uikit-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.946d2efea | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -729,8 +729,12 @@
|
|
|
729
729
|
return new Promise((resolve, reject) => {
|
|
730
730
|
const img = new Image();
|
|
731
731
|
|
|
732
|
-
img.onerror = (e) =>
|
|
733
|
-
|
|
732
|
+
img.onerror = (e) => {
|
|
733
|
+
reject(e);
|
|
734
|
+
};
|
|
735
|
+
img.onload = () => {
|
|
736
|
+
resolve(img);
|
|
737
|
+
};
|
|
734
738
|
|
|
735
739
|
sizes && (img.sizes = sizes);
|
|
736
740
|
srcset && (img.srcset = srcset);
|
|
@@ -1016,8 +1020,8 @@
|
|
|
1016
1020
|
const currentOffset = dimensions(element);
|
|
1017
1021
|
|
|
1018
1022
|
if (element) {
|
|
1019
|
-
const {
|
|
1020
|
-
const offsetBy = { height:
|
|
1023
|
+
const { scrollY, scrollX } = toWindow(element);
|
|
1024
|
+
const offsetBy = { height: scrollY, width: scrollX };
|
|
1021
1025
|
|
|
1022
1026
|
for (const dir in dirs$1) {
|
|
1023
1027
|
for (const i in dirs$1[dir]) {
|
|
@@ -1083,8 +1087,8 @@
|
|
|
1083
1087
|
|
|
1084
1088
|
if (css(element, 'position') === 'fixed') {
|
|
1085
1089
|
const win = toWindow(element);
|
|
1086
|
-
offset[0] += win.
|
|
1087
|
-
offset[1] += win.
|
|
1090
|
+
offset[0] += win.scrollY;
|
|
1091
|
+
offset[1] += win.scrollX;
|
|
1088
1092
|
return offset;
|
|
1089
1093
|
}
|
|
1090
1094
|
} while (element = element.offsetParent);
|
|
@@ -1238,7 +1242,7 @@
|
|
|
1238
1242
|
function wrapInner(element, structure) {
|
|
1239
1243
|
return toNodes(
|
|
1240
1244
|
toNodes(element).map((element) =>
|
|
1241
|
-
element.hasChildNodes ?
|
|
1245
|
+
element.hasChildNodes() ?
|
|
1242
1246
|
wrapAll(toNodes(element.childNodes), structure) :
|
|
1243
1247
|
append(element, structure)));
|
|
1244
1248
|
|
|
@@ -1252,14 +1256,23 @@
|
|
|
1252
1256
|
forEach((parent) => parent.replaceWith(...parent.childNodes));
|
|
1253
1257
|
}
|
|
1254
1258
|
|
|
1259
|
+
const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
|
|
1260
|
+
const singleTagRe = /^<(\w+)\s*\/?>(?:<\/\1>)?$/;
|
|
1261
|
+
|
|
1255
1262
|
function fragment(html) {
|
|
1256
|
-
const
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1263
|
+
const matches = singleTagRe.exec(html);
|
|
1264
|
+
if (matches) {
|
|
1265
|
+
return document.createElement(matches[1]);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
const container = document.createElement('div');
|
|
1269
|
+
if (fragmentRe.test(html)) {
|
|
1270
|
+
container.insertAdjacentHTML('beforeend', html.trim());
|
|
1271
|
+
} else {
|
|
1272
|
+
container.textContent = html;
|
|
1261
1273
|
}
|
|
1262
|
-
|
|
1274
|
+
|
|
1275
|
+
return unwrapSingle(container.childNodes);
|
|
1263
1276
|
}
|
|
1264
1277
|
|
|
1265
1278
|
function unwrapSingle(nodes) {
|
|
@@ -1457,6 +1470,41 @@
|
|
|
1457
1470
|
return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };
|
|
1458
1471
|
}
|
|
1459
1472
|
|
|
1473
|
+
// Old chromium based browsers (UC Browser) did not implement `isIntersecting`
|
|
1474
|
+
const hasIntersectionObserver =
|
|
1475
|
+
window.IntersectionObserver && 'isIntersecting' in IntersectionObserverEntry.prototype;
|
|
1476
|
+
function observeIntersection(targets, cb, options, intersecting) {if (intersecting === void 0) {intersecting = true;}
|
|
1477
|
+
if (!hasIntersectionObserver) {
|
|
1478
|
+
return;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
const observer = new IntersectionObserver((entries, observer) => {
|
|
1482
|
+
if (!intersecting || entries.some((entry) => entry.isIntersecting)) {
|
|
1483
|
+
cb(entries, observer);
|
|
1484
|
+
}
|
|
1485
|
+
}, options);
|
|
1486
|
+
for (const el of toNodes(targets)) {
|
|
1487
|
+
observer.observe(el);
|
|
1488
|
+
}
|
|
1489
|
+
return observer;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
const hasResizeObserver = window.ResizeObserver;
|
|
1493
|
+
function observeResize(targets, cb, options) {if (options === void 0) {options = { box: 'border-box' };}
|
|
1494
|
+
if (!hasResizeObserver) {
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
const observer = new ResizeObserver((entries, observer) => {
|
|
1499
|
+
cb(entries, observer);
|
|
1500
|
+
});
|
|
1501
|
+
for (const el of toNodes(targets)) {
|
|
1502
|
+
observer.observe(el, options);
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
return observer;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1460
1508
|
const strats = {};
|
|
1461
1509
|
|
|
1462
1510
|
strats.events =
|
|
@@ -2134,6 +2182,9 @@
|
|
|
2134
2182
|
memoize: memoize,
|
|
2135
2183
|
Deferred: Deferred,
|
|
2136
2184
|
MouseTracker: MouseTracker,
|
|
2185
|
+
hasIntersectionObserver: hasIntersectionObserver,
|
|
2186
|
+
observeIntersection: observeIntersection,
|
|
2187
|
+
observeResize: observeResize,
|
|
2137
2188
|
mergeOptions: mergeOptions,
|
|
2138
2189
|
parseOptions: parseOptions,
|
|
2139
2190
|
play: play,
|
|
@@ -2311,8 +2362,8 @@
|
|
|
2311
2362
|
};
|
|
2312
2363
|
|
|
2313
2364
|
function runUpdates(types) {
|
|
2314
|
-
for (const { read, write, events } of this.$options.update) {
|
|
2315
|
-
if (!types.has('update') &&
|
|
2365
|
+
for (const { read, write, events = [] } of this.$options.update) {
|
|
2366
|
+
if (!types.has('update') && !events.some((type) => types.has(type))) {
|
|
2316
2367
|
continue;
|
|
2317
2368
|
}
|
|
2318
2369
|
|
|
@@ -2433,204 +2484,236 @@
|
|
|
2433
2484
|
}
|
|
2434
2485
|
}
|
|
2435
2486
|
}
|
|
2487
|
+
for (const { events = [] } of this.$options.update || []) {
|
|
2488
|
+
if (includes(events, 'scroll')) {
|
|
2489
|
+
registerScrollListener(this._uid, () => this.$emit('scroll'));
|
|
2490
|
+
break;
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2436
2493
|
};
|
|
2437
2494
|
|
|
2438
2495
|
UIkit.prototype._unbindEvents = function () {
|
|
2439
2496
|
this._events.forEach((unbind) => unbind());
|
|
2440
2497
|
delete this._events;
|
|
2498
|
+
unregisterScrollListener(this._uid);
|
|
2441
2499
|
};
|
|
2442
2500
|
|
|
2443
2501
|
UIkit.prototype._initObservers = function () {
|
|
2444
2502
|
this._observers = [initChildListObserver(this), initPropsObserver(this)];
|
|
2445
2503
|
};
|
|
2446
2504
|
|
|
2505
|
+
UIkit.prototype.registerObserver = function (observer) {
|
|
2506
|
+
this._observers.push(observer);
|
|
2507
|
+
};
|
|
2508
|
+
|
|
2447
2509
|
UIkit.prototype._disconnectObservers = function () {
|
|
2448
2510
|
this._observers.forEach((observer) => observer == null ? void 0 : observer.disconnect());
|
|
2449
2511
|
};
|
|
2512
|
+
}
|
|
2450
2513
|
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
if (!props) {
|
|
2456
|
-
return data$1;
|
|
2457
|
-
}
|
|
2514
|
+
function getProps(opts, name) {
|
|
2515
|
+
const data$1 = {};
|
|
2516
|
+
const { args = [], props = {}, el } = opts;
|
|
2458
2517
|
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2518
|
+
if (!props) {
|
|
2519
|
+
return data$1;
|
|
2520
|
+
}
|
|
2462
2521
|
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2522
|
+
for (const key in props) {
|
|
2523
|
+
const prop = hyphenate(key);
|
|
2524
|
+
let value = data(el, prop);
|
|
2466
2525
|
|
|
2467
|
-
|
|
2526
|
+
if (isUndefined(value)) {
|
|
2527
|
+
continue;
|
|
2528
|
+
}
|
|
2468
2529
|
|
|
2469
|
-
|
|
2470
|
-
continue;
|
|
2471
|
-
}
|
|
2530
|
+
value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
|
|
2472
2531
|
|
|
2473
|
-
|
|
2532
|
+
if (prop === 'target' && (!value || startsWith(value, '_'))) {
|
|
2533
|
+
continue;
|
|
2474
2534
|
}
|
|
2475
2535
|
|
|
2476
|
-
|
|
2536
|
+
data$1[key] = value;
|
|
2537
|
+
}
|
|
2477
2538
|
|
|
2478
|
-
|
|
2479
|
-
const prop = camelize(key);
|
|
2480
|
-
if (props[prop] !== undefined) {
|
|
2481
|
-
data$1[prop] = coerce(props[prop], options[key]);
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2539
|
+
const options = parseOptions(data(el, name), args);
|
|
2484
2540
|
|
|
2485
|
-
|
|
2541
|
+
for (const key in options) {
|
|
2542
|
+
const prop = camelize(key);
|
|
2543
|
+
if (props[prop] !== undefined) {
|
|
2544
|
+
data$1[prop] = coerce(props[prop], options[key]);
|
|
2545
|
+
}
|
|
2486
2546
|
}
|
|
2487
2547
|
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
enumerable: true,
|
|
2548
|
+
return data$1;
|
|
2549
|
+
}
|
|
2491
2550
|
|
|
2492
|
-
|
|
2493
|
-
|
|
2551
|
+
function registerComputed(component, key, cb) {
|
|
2552
|
+
Object.defineProperty(component, key, {
|
|
2553
|
+
enumerable: true,
|
|
2494
2554
|
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
}
|
|
2555
|
+
get() {
|
|
2556
|
+
const { _computeds, $props, $el } = component;
|
|
2498
2557
|
|
|
2499
|
-
|
|
2500
|
-
|
|
2558
|
+
if (!hasOwn(_computeds, key)) {
|
|
2559
|
+
_computeds[key] = (cb.get || cb).call(component, $props, $el);
|
|
2560
|
+
}
|
|
2501
2561
|
|
|
2502
|
-
|
|
2503
|
-
|
|
2562
|
+
return _computeds[key];
|
|
2563
|
+
},
|
|
2504
2564
|
|
|
2505
|
-
|
|
2565
|
+
set(value) {
|
|
2566
|
+
const { _computeds } = component;
|
|
2506
2567
|
|
|
2507
|
-
|
|
2508
|
-
delete _computeds[key];
|
|
2509
|
-
}
|
|
2510
|
-
} });
|
|
2568
|
+
_computeds[key] = cb.set ? cb.set.call(component, value) : value;
|
|
2511
2569
|
|
|
2570
|
+
if (isUndefined(_computeds[key])) {
|
|
2571
|
+
delete _computeds[key];
|
|
2572
|
+
}
|
|
2573
|
+
} });
|
|
2574
|
+
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
function registerEvent(component, event, key) {
|
|
2578
|
+
if (!isPlainObject(event)) {
|
|
2579
|
+
event = { name: key, handler: event };
|
|
2512
2580
|
}
|
|
2513
2581
|
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
event = { name: key, handler: event };
|
|
2517
|
-
}
|
|
2582
|
+
let { name, el, handler, capture, passive, delegate, filter, self } = event;
|
|
2583
|
+
el = isFunction(el) ? el.call(component) : el || component.$el;
|
|
2518
2584
|
|
|
2519
|
-
|
|
2520
|
-
el
|
|
2585
|
+
if (isArray(el)) {
|
|
2586
|
+
el.forEach((el) => registerEvent(component, { ...event, el }, key));
|
|
2587
|
+
return;
|
|
2588
|
+
}
|
|
2521
2589
|
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
}
|
|
2590
|
+
if (!el || filter && !filter.call(component)) {
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2526
2593
|
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2594
|
+
component._events.push(
|
|
2595
|
+
on(
|
|
2596
|
+
el,
|
|
2597
|
+
name,
|
|
2598
|
+
delegate ? isString(delegate) ? delegate : delegate.call(component) : null,
|
|
2599
|
+
isString(handler) ? component[handler] : handler.bind(component),
|
|
2600
|
+
{ passive, capture, self }));
|
|
2530
2601
|
|
|
2531
|
-
component._events.push(
|
|
2532
|
-
on(
|
|
2533
|
-
el,
|
|
2534
|
-
name,
|
|
2535
|
-
delegate ? isString(delegate) ? delegate : delegate.call(component) : null,
|
|
2536
|
-
isString(handler) ? component[handler] : handler.bind(component),
|
|
2537
|
-
{ passive, capture, self }));
|
|
2538
2602
|
|
|
2603
|
+
}
|
|
2539
2604
|
|
|
2540
|
-
|
|
2605
|
+
function notIn(options, key) {
|
|
2606
|
+
return options.every((arr) => !arr || !hasOwn(arr, key));
|
|
2607
|
+
}
|
|
2541
2608
|
|
|
2542
|
-
|
|
2543
|
-
|
|
2609
|
+
function coerce(type, value) {
|
|
2610
|
+
if (type === Boolean) {
|
|
2611
|
+
return toBoolean(value);
|
|
2612
|
+
} else if (type === Number) {
|
|
2613
|
+
return toNumber(value);
|
|
2614
|
+
} else if (type === 'list') {
|
|
2615
|
+
return toList(value);
|
|
2544
2616
|
}
|
|
2545
2617
|
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
return toBoolean(value);
|
|
2549
|
-
} else if (type === Number) {
|
|
2550
|
-
return toNumber(value);
|
|
2551
|
-
} else if (type === 'list') {
|
|
2552
|
-
return toList(value);
|
|
2553
|
-
}
|
|
2618
|
+
return type ? type(value) : value;
|
|
2619
|
+
}
|
|
2554
2620
|
|
|
2555
|
-
|
|
2621
|
+
function toList(value) {
|
|
2622
|
+
return isArray(value) ?
|
|
2623
|
+
value :
|
|
2624
|
+
isString(value) ?
|
|
2625
|
+
value.
|
|
2626
|
+
split(/,(?![^(]*\))/).
|
|
2627
|
+
map((value) => isNumeric(value) ? toNumber(value) : toBoolean(value.trim())) :
|
|
2628
|
+
[value];
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
function normalizeData(_ref, _ref2) {let { data = {} } = _ref;let { args = [], props = {} } = _ref2;
|
|
2632
|
+
if (isArray(data)) {
|
|
2633
|
+
data = data.slice(0, args.length).reduce((data, value, index) => {
|
|
2634
|
+
if (isPlainObject(value)) {
|
|
2635
|
+
assign(data, value);
|
|
2636
|
+
} else {
|
|
2637
|
+
data[args[index]] = value;
|
|
2638
|
+
}
|
|
2639
|
+
return data;
|
|
2640
|
+
}, {});
|
|
2556
2641
|
}
|
|
2557
2642
|
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
map((value) => isNumeric(value) ? toNumber(value) : toBoolean(value.trim())) :
|
|
2565
|
-
[value];
|
|
2643
|
+
for (const key in data) {
|
|
2644
|
+
if (isUndefined(data[key])) {
|
|
2645
|
+
delete data[key];
|
|
2646
|
+
} else if (props[key]) {
|
|
2647
|
+
data[key] = coerce(props[key], data[key]);
|
|
2648
|
+
}
|
|
2566
2649
|
}
|
|
2567
2650
|
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
data = data.slice(0, args.length).reduce((data, value, index) => {
|
|
2571
|
-
if (isPlainObject(value)) {
|
|
2572
|
-
assign(data, value);
|
|
2573
|
-
} else {
|
|
2574
|
-
data[args[index]] = value;
|
|
2575
|
-
}
|
|
2576
|
-
return data;
|
|
2577
|
-
}, {});
|
|
2578
|
-
}
|
|
2651
|
+
return data;
|
|
2652
|
+
}
|
|
2579
2653
|
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
delete data[key];
|
|
2583
|
-
} else if (props[key]) {
|
|
2584
|
-
data[key] = coerce(props[key], data[key]);
|
|
2585
|
-
}
|
|
2586
|
-
}
|
|
2654
|
+
function initChildListObserver(component) {
|
|
2655
|
+
const { el } = component.$options;
|
|
2587
2656
|
|
|
2588
|
-
|
|
2589
|
-
|
|
2657
|
+
const observer = new MutationObserver(() => component.$emit());
|
|
2658
|
+
observer.observe(el, {
|
|
2659
|
+
childList: true,
|
|
2660
|
+
subtree: true });
|
|
2590
2661
|
|
|
2591
|
-
function initChildListObserver(component) {
|
|
2592
|
-
const { el } = component.$options;
|
|
2593
2662
|
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
childList: true,
|
|
2597
|
-
subtree: true });
|
|
2663
|
+
return observer;
|
|
2664
|
+
}
|
|
2598
2665
|
|
|
2666
|
+
function initPropsObserver(component) {
|
|
2667
|
+
const { $name, $options, $props } = component;
|
|
2668
|
+
const { attrs, props, el } = $options;
|
|
2599
2669
|
|
|
2600
|
-
|
|
2670
|
+
if (!props || attrs === false) {
|
|
2671
|
+
return;
|
|
2601
2672
|
}
|
|
2602
2673
|
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
const { attrs, props, el } = $options;
|
|
2674
|
+
const attributes = isArray(attrs) ? attrs : Object.keys(props);
|
|
2675
|
+
const filter = attributes.map((key) => hyphenate(key)).concat($name);
|
|
2606
2676
|
|
|
2607
|
-
|
|
2608
|
-
|
|
2677
|
+
const observer = new MutationObserver((records) => {
|
|
2678
|
+
const data = getProps($options, $name);
|
|
2679
|
+
if (
|
|
2680
|
+
records.some((_ref3) => {let { attributeName } = _ref3;
|
|
2681
|
+
const prop = attributeName.replace('data-', '');
|
|
2682
|
+
return (
|
|
2683
|
+
prop === $name ? attributes : [camelize(prop), camelize(attributeName)]).
|
|
2684
|
+
some((prop) => !isUndefined(data[prop]) && data[prop] !== $props[prop]);
|
|
2685
|
+
}))
|
|
2686
|
+
{
|
|
2687
|
+
component.$reset();
|
|
2609
2688
|
}
|
|
2689
|
+
});
|
|
2610
2690
|
|
|
2611
|
-
|
|
2612
|
-
|
|
2691
|
+
observer.observe(el, {
|
|
2692
|
+
attributes: true,
|
|
2693
|
+
attributeFilter: filter.concat(filter.map((key) => "data-" + key)) });
|
|
2613
2694
|
|
|
2614
|
-
const observer = new MutationObserver((records) => {
|
|
2615
|
-
const data = getProps($options, $name);
|
|
2616
|
-
if (
|
|
2617
|
-
records.some((_ref3) => {let { attributeName } = _ref3;
|
|
2618
|
-
const prop = attributeName.replace('data-', '');
|
|
2619
|
-
return (
|
|
2620
|
-
prop === $name ? attributes : [camelize(prop), camelize(attributeName)]).
|
|
2621
|
-
some((prop) => !isUndefined(data[prop]) && data[prop] !== $props[prop]);
|
|
2622
|
-
}))
|
|
2623
|
-
{
|
|
2624
|
-
component.$reset();
|
|
2625
|
-
}
|
|
2626
|
-
});
|
|
2627
2695
|
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2696
|
+
return observer;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
const scrollListeners = new Map();
|
|
2700
|
+
let unbindScrollListener;
|
|
2701
|
+
function registerScrollListener(id, listener) {
|
|
2702
|
+
unbindScrollListener =
|
|
2703
|
+
unbindScrollListener ||
|
|
2704
|
+
on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
|
|
2705
|
+
passive: true,
|
|
2706
|
+
capture: true });
|
|
2707
|
+
|
|
2631
2708
|
|
|
2709
|
+
scrollListeners.set(id, listener);
|
|
2710
|
+
}
|
|
2632
2711
|
|
|
2633
|
-
|
|
2712
|
+
function unregisterScrollListener(id) {
|
|
2713
|
+
scrollListeners.delete(id);
|
|
2714
|
+
if (unbindScrollListener && !scrollListeners.size) {
|
|
2715
|
+
unbindScrollListener();
|
|
2716
|
+
unbindScrollListener = null;
|
|
2634
2717
|
}
|
|
2635
2718
|
}
|
|
2636
2719
|
|
|
@@ -2807,7 +2890,7 @@
|
|
|
2807
2890
|
UIkit.data = '__uikit__';
|
|
2808
2891
|
UIkit.prefix = 'uk-';
|
|
2809
2892
|
UIkit.options = {};
|
|
2810
|
-
UIkit.version = '3.11.2-dev.
|
|
2893
|
+
UIkit.version = '3.11.2-dev.946d2efea';
|
|
2811
2894
|
|
|
2812
2895
|
globalAPI(UIkit);
|
|
2813
2896
|
hooksAPI(UIkit);
|
|
@@ -2833,27 +2916,7 @@
|
|
|
2833
2916
|
|
|
2834
2917
|
on(window, 'load resize', handleResize);
|
|
2835
2918
|
on(document, 'loadedmetadata load', handleResize, true);
|
|
2836
|
-
|
|
2837
|
-
if ('ResizeObserver' in window) {
|
|
2838
|
-
new ResizeObserver(handleResize).observe(document.documentElement);
|
|
2839
|
-
}
|
|
2840
|
-
|
|
2841
|
-
// throttle `scroll` event (Safari triggers multiple `scroll` events per frame)
|
|
2842
|
-
let pending;
|
|
2843
|
-
on(
|
|
2844
|
-
window,
|
|
2845
|
-
'scroll',
|
|
2846
|
-
(e) => {
|
|
2847
|
-
if (pending) {
|
|
2848
|
-
return;
|
|
2849
|
-
}
|
|
2850
|
-
pending = true;
|
|
2851
|
-
fastdom.read(() => pending = false);
|
|
2852
|
-
|
|
2853
|
-
UIkit.update(null, e.type);
|
|
2854
|
-
},
|
|
2855
|
-
{ passive: true, capture: true });
|
|
2856
|
-
|
|
2919
|
+
observeResize(document.documentElement, handleResize);
|
|
2857
2920
|
|
|
2858
2921
|
let started = 0;
|
|
2859
2922
|
on(
|
|
@@ -2872,45 +2935,6 @@
|
|
|
2872
2935
|
},
|
|
2873
2936
|
true);
|
|
2874
2937
|
|
|
2875
|
-
|
|
2876
|
-
on(
|
|
2877
|
-
document,
|
|
2878
|
-
pointerDown,
|
|
2879
|
-
(e) => {
|
|
2880
|
-
if (!isTouch(e)) {
|
|
2881
|
-
return;
|
|
2882
|
-
}
|
|
2883
|
-
|
|
2884
|
-
// Handle Swipe Gesture
|
|
2885
|
-
const pos = getEventPos(e);
|
|
2886
|
-
const target = 'tagName' in e.target ? e.target : parent(e.target);
|
|
2887
|
-
once(document, pointerUp + " " + pointerCancel + " scroll", (e) => {
|
|
2888
|
-
const { x, y } = getEventPos(e);
|
|
2889
|
-
|
|
2890
|
-
// swipe
|
|
2891
|
-
if (
|
|
2892
|
-
e.type !== 'scroll' && target && x && Math.abs(pos.x - x) > 100 ||
|
|
2893
|
-
y && Math.abs(pos.y - y) > 100)
|
|
2894
|
-
{
|
|
2895
|
-
setTimeout(() => {
|
|
2896
|
-
trigger(target, 'swipe');
|
|
2897
|
-
trigger(target, "swipe" + swipeDirection(pos.x, pos.y, x, y));
|
|
2898
|
-
});
|
|
2899
|
-
}
|
|
2900
|
-
});
|
|
2901
|
-
},
|
|
2902
|
-
{ passive: true });
|
|
2903
|
-
|
|
2904
|
-
}
|
|
2905
|
-
|
|
2906
|
-
function swipeDirection(x1, y1, x2, y2) {
|
|
2907
|
-
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ?
|
|
2908
|
-
x1 - x2 > 0 ?
|
|
2909
|
-
'Left' :
|
|
2910
|
-
'Right' :
|
|
2911
|
-
y1 - y2 > 0 ?
|
|
2912
|
-
'Up' :
|
|
2913
|
-
'Down';
|
|
2914
2938
|
}
|
|
2915
2939
|
|
|
2916
2940
|
function boot (UIkit) {
|
|
@@ -2975,6 +2999,23 @@
|
|
|
2975
2999
|
!hasClass(this.$el, this.$name) && addClass(this.$el, this.$name);
|
|
2976
3000
|
} };
|
|
2977
3001
|
|
|
3002
|
+
var Lazyload = {
|
|
3003
|
+
methods: {
|
|
3004
|
+
lazyload(observeTargets, targets) {if (observeTargets === void 0) {observeTargets = this.$el;}if (targets === void 0) {targets = this.$el;}
|
|
3005
|
+
this.registerObserver(
|
|
3006
|
+
observeIntersection(observeTargets, (entries, observer) => {
|
|
3007
|
+
for (const el of toNodes(isFunction(targets) ? targets() : targets)) {
|
|
3008
|
+
$$('[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
|
|
3009
|
+
}
|
|
3010
|
+
for (const el of entries.
|
|
3011
|
+
filter((_ref) => {let { isIntersecting } = _ref;return isIntersecting;}).
|
|
3012
|
+
map((_ref2) => {let { target } = _ref2;return target;})) {
|
|
3013
|
+
observer.unobserve(el);
|
|
3014
|
+
}
|
|
3015
|
+
}));
|
|
3016
|
+
|
|
3017
|
+
} } };
|
|
3018
|
+
|
|
2978
3019
|
var Togglable = {
|
|
2979
3020
|
props: {
|
|
2980
3021
|
cls: Boolean,
|
|
@@ -3106,7 +3147,7 @@
|
|
|
3106
3147
|
function toggleHeight(_ref3) {let { isToggled, duration, initProps, hideProps, transition, _toggle } = _ref3;
|
|
3107
3148
|
return (el, show) => {
|
|
3108
3149
|
const inProgress = Transition.inProgress(el);
|
|
3109
|
-
const inner = el.hasChildNodes ?
|
|
3150
|
+
const inner = el.hasChildNodes() ?
|
|
3110
3151
|
toFloat(css(el.firstElementChild, 'marginTop')) +
|
|
3111
3152
|
toFloat(css(el.lastElementChild, 'marginBottom')) :
|
|
3112
3153
|
0;
|
|
@@ -3162,7 +3203,7 @@
|
|
|
3162
3203
|
}
|
|
3163
3204
|
|
|
3164
3205
|
var Accordion = {
|
|
3165
|
-
mixins: [Class, Togglable],
|
|
3206
|
+
mixins: [Class, Lazyload, Togglable],
|
|
3166
3207
|
|
|
3167
3208
|
props: {
|
|
3168
3209
|
targets: String,
|
|
@@ -3218,6 +3259,10 @@
|
|
|
3218
3259
|
} },
|
|
3219
3260
|
|
|
3220
3261
|
|
|
3262
|
+
connected() {
|
|
3263
|
+
this.lazyload();
|
|
3264
|
+
},
|
|
3265
|
+
|
|
3221
3266
|
events: [
|
|
3222
3267
|
{
|
|
3223
3268
|
name: 'click',
|
|
@@ -3353,6 +3398,8 @@
|
|
|
3353
3398
|
if (this.automute) {
|
|
3354
3399
|
mute(this.$el);
|
|
3355
3400
|
}
|
|
3401
|
+
|
|
3402
|
+
this.registerObserver(observeIntersection(this.$el, () => this.$emit('resize')));
|
|
3356
3403
|
},
|
|
3357
3404
|
|
|
3358
3405
|
update: {
|
|
@@ -3389,6 +3436,10 @@
|
|
|
3389
3436
|
automute: true },
|
|
3390
3437
|
|
|
3391
3438
|
|
|
3439
|
+
connected() {
|
|
3440
|
+
this.registerObserver(observeResize(this.$el, () => this.$emit('resize')));
|
|
3441
|
+
},
|
|
3442
|
+
|
|
3392
3443
|
update: {
|
|
3393
3444
|
read() {
|
|
3394
3445
|
const el = this.$el;
|
|
@@ -3514,7 +3565,7 @@
|
|
|
3514
3565
|
let active$1;
|
|
3515
3566
|
|
|
3516
3567
|
var drop = {
|
|
3517
|
-
mixins: [Container, Position, Togglable],
|
|
3568
|
+
mixins: [Container, Lazyload, Position, Togglable],
|
|
3518
3569
|
|
|
3519
3570
|
args: 'pos',
|
|
3520
3571
|
|
|
@@ -3568,6 +3619,7 @@
|
|
|
3568
3619
|
mode: this.mode }).
|
|
3569
3620
|
$el;
|
|
3570
3621
|
attr(this.target, 'aria-haspopup', true);
|
|
3622
|
+
this.lazyload(this.target);
|
|
3571
3623
|
}
|
|
3572
3624
|
},
|
|
3573
3625
|
|
|
@@ -3943,7 +3995,7 @@
|
|
|
3943
3995
|
name: 'change',
|
|
3944
3996
|
|
|
3945
3997
|
handler() {
|
|
3946
|
-
this.$
|
|
3998
|
+
this.$emit();
|
|
3947
3999
|
} },
|
|
3948
4000
|
|
|
3949
4001
|
|
|
@@ -3955,7 +4007,7 @@
|
|
|
3955
4007
|
},
|
|
3956
4008
|
|
|
3957
4009
|
handler() {
|
|
3958
|
-
this.$
|
|
4010
|
+
this.$emit();
|
|
3959
4011
|
} }] };
|
|
3960
4012
|
|
|
3961
4013
|
// Deprecated
|
|
@@ -4312,6 +4364,8 @@
|
|
|
4312
4364
|
}
|
|
4313
4365
|
|
|
4314
4366
|
var heightViewport = {
|
|
4367
|
+
mixins: [Class],
|
|
4368
|
+
|
|
4315
4369
|
props: {
|
|
4316
4370
|
expand: Boolean,
|
|
4317
4371
|
offsetTop: Boolean,
|
|
@@ -4657,14 +4711,14 @@
|
|
|
4657
4711
|
},
|
|
4658
4712
|
|
|
4659
4713
|
methods: {
|
|
4660
|
-
getSvg() {
|
|
4714
|
+
async getSvg() {
|
|
4661
4715
|
const icon = getIcon(this.icon);
|
|
4662
4716
|
|
|
4663
4717
|
if (!icon) {
|
|
4664
|
-
|
|
4718
|
+
throw 'Icon not found.';
|
|
4665
4719
|
}
|
|
4666
4720
|
|
|
4667
|
-
return
|
|
4721
|
+
return icon;
|
|
4668
4722
|
} } };
|
|
4669
4723
|
|
|
4670
4724
|
const IconComponent = {
|
|
@@ -4722,10 +4776,17 @@
|
|
|
4722
4776
|
const Spinner = {
|
|
4723
4777
|
extends: IconComponent,
|
|
4724
4778
|
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4779
|
+
methods: {
|
|
4780
|
+
async getSvg() {
|
|
4781
|
+
const icon = await Icon.methods.getSvg.call(this);
|
|
4782
|
+
|
|
4783
|
+
if (this.ratio !== 1) {
|
|
4784
|
+
css($('circle', icon), 'strokeWidth', 1 / this.ratio);
|
|
4785
|
+
}
|
|
4786
|
+
|
|
4787
|
+
return icon;
|
|
4788
|
+
} } };
|
|
4789
|
+
|
|
4729
4790
|
|
|
4730
4791
|
|
|
4731
4792
|
const parsed = {};
|
|
@@ -4764,7 +4825,6 @@
|
|
|
4764
4825
|
}
|
|
4765
4826
|
|
|
4766
4827
|
const nativeLazyLoad = ('loading' in HTMLImageElement.prototype);
|
|
4767
|
-
const nativeIsIntersecting = ('isIntersecting' in IntersectionObserverEntry.prototype); // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
|
|
4768
4828
|
|
|
4769
4829
|
var img = {
|
|
4770
4830
|
args: 'dataSrc',
|
|
@@ -4794,13 +4854,13 @@
|
|
|
4794
4854
|
},
|
|
4795
4855
|
|
|
4796
4856
|
watch() {
|
|
4797
|
-
this
|
|
4857
|
+
this.$reset();
|
|
4798
4858
|
} } },
|
|
4799
4859
|
|
|
4800
4860
|
|
|
4801
4861
|
|
|
4802
4862
|
connected() {
|
|
4803
|
-
if (this.loading !== 'lazy' || !
|
|
4863
|
+
if (this.loading !== 'lazy' || !hasIntersectionObserver) {
|
|
4804
4864
|
this.load();
|
|
4805
4865
|
return;
|
|
4806
4866
|
}
|
|
@@ -4816,28 +4876,27 @@
|
|
|
4816
4876
|
|
|
4817
4877
|
ensureSrcAttribute(this.$el);
|
|
4818
4878
|
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
if (entries.some((entry) => entry.isIntersecting)) {
|
|
4826
|
-
this.load();
|
|
4827
|
-
this.observer.disconnect();
|
|
4828
|
-
}
|
|
4879
|
+
this.registerObserver(
|
|
4880
|
+
observeIntersection(
|
|
4881
|
+
this.target,
|
|
4882
|
+
(entries, observer) => {
|
|
4883
|
+
this.load();
|
|
4884
|
+
observer.disconnect();
|
|
4829
4885
|
},
|
|
4830
|
-
{
|
|
4886
|
+
{
|
|
4887
|
+
rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
|
|
4888
|
+
this.offsetLeft,
|
|
4889
|
+
'width') + "px" }));
|
|
4890
|
+
|
|
4891
|
+
|
|
4892
|
+
|
|
4831
4893
|
|
|
4832
|
-
this.observe();
|
|
4833
4894
|
},
|
|
4834
4895
|
|
|
4835
|
-
disconnected() {
|
|
4896
|
+
disconnected() {
|
|
4836
4897
|
if (this._data.image) {
|
|
4837
4898
|
this._data.image.onload = '';
|
|
4838
4899
|
}
|
|
4839
|
-
|
|
4840
|
-
(_this$observer = this.observer) == null ? void 0 : _this$observer.disconnect();
|
|
4841
4900
|
},
|
|
4842
4901
|
|
|
4843
4902
|
update: {
|
|
@@ -4872,14 +4931,6 @@
|
|
|
4872
4931
|
removeAttr(image, 'loading');
|
|
4873
4932
|
setSrcAttrs(this.$el, image.currentSrc);
|
|
4874
4933
|
return this._data.image = image;
|
|
4875
|
-
},
|
|
4876
|
-
|
|
4877
|
-
observe() {
|
|
4878
|
-
if (this._connected && !this._data.image) {
|
|
4879
|
-
for (const el of this.target) {
|
|
4880
|
-
this.observer.observe(el);
|
|
4881
|
-
}
|
|
4882
|
-
}
|
|
4883
4934
|
} } };
|
|
4884
4935
|
|
|
4885
4936
|
|
|
@@ -4913,7 +4964,9 @@
|
|
|
4913
4964
|
|
|
4914
4965
|
wrapInPicture(img, sources);
|
|
4915
4966
|
setSourceProps(el, img);
|
|
4916
|
-
img.onload = () =>
|
|
4967
|
+
img.onload = () => {
|
|
4968
|
+
setSrcAttrs(el, img.currentSrc);
|
|
4969
|
+
};
|
|
4917
4970
|
attr(img, 'src', src);
|
|
4918
4971
|
return img;
|
|
4919
4972
|
}
|
|
@@ -5901,8 +5954,69 @@
|
|
|
5901
5954
|
RIGHT: 39,
|
|
5902
5955
|
DOWN: 40 };
|
|
5903
5956
|
|
|
5957
|
+
var Swipe = {
|
|
5958
|
+
props: {
|
|
5959
|
+
swiping: Boolean },
|
|
5960
|
+
|
|
5961
|
+
|
|
5962
|
+
data: {
|
|
5963
|
+
swiping: true },
|
|
5964
|
+
|
|
5965
|
+
|
|
5966
|
+
computed: {
|
|
5967
|
+
swipeTarget(props, $el) {
|
|
5968
|
+
return $el;
|
|
5969
|
+
} },
|
|
5970
|
+
|
|
5971
|
+
|
|
5972
|
+
connected() {
|
|
5973
|
+
if (!this.swiping) {
|
|
5974
|
+
return;
|
|
5975
|
+
}
|
|
5976
|
+
|
|
5977
|
+
registerEvent(this, {
|
|
5978
|
+
el: this.swipeTarget,
|
|
5979
|
+
name: pointerDown,
|
|
5980
|
+
passive: true,
|
|
5981
|
+
handler(e) {
|
|
5982
|
+
if (!isTouch(e)) {
|
|
5983
|
+
return;
|
|
5984
|
+
}
|
|
5985
|
+
|
|
5986
|
+
// Handle Swipe Gesture
|
|
5987
|
+
const pos = getEventPos(e);
|
|
5988
|
+
const target = 'tagName' in e.target ? e.target : parent(e.target);
|
|
5989
|
+
once(document, pointerUp + " " + pointerCancel + " scroll", (e) => {
|
|
5990
|
+
const { x, y } = getEventPos(e);
|
|
5991
|
+
|
|
5992
|
+
// swipe
|
|
5993
|
+
if (
|
|
5994
|
+
e.type !== 'scroll' && target && x && Math.abs(pos.x - x) > 100 ||
|
|
5995
|
+
y && Math.abs(pos.y - y) > 100)
|
|
5996
|
+
{
|
|
5997
|
+
setTimeout(() => {
|
|
5998
|
+
trigger(target, 'swipe');
|
|
5999
|
+
trigger(target, "swipe" + swipeDirection(pos.x, pos.y, x, y));
|
|
6000
|
+
});
|
|
6001
|
+
}
|
|
6002
|
+
});
|
|
6003
|
+
} });
|
|
6004
|
+
|
|
6005
|
+
} };
|
|
6006
|
+
|
|
6007
|
+
|
|
6008
|
+
function swipeDirection(x1, y1, x2, y2) {
|
|
6009
|
+
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ?
|
|
6010
|
+
x1 - x2 > 0 ?
|
|
6011
|
+
'Left' :
|
|
6012
|
+
'Right' :
|
|
6013
|
+
y1 - y2 > 0 ?
|
|
6014
|
+
'Up' :
|
|
6015
|
+
'Down';
|
|
6016
|
+
}
|
|
6017
|
+
|
|
5904
6018
|
var offcanvas = {
|
|
5905
|
-
mixins: [Modal],
|
|
6019
|
+
mixins: [Modal, Swipe],
|
|
5906
6020
|
|
|
5907
6021
|
args: 'mode',
|
|
5908
6022
|
|
|
@@ -6483,26 +6597,11 @@
|
|
|
6483
6597
|
|
|
6484
6598
|
|
|
6485
6599
|
computed: {
|
|
6486
|
-
|
|
6487
|
-
return position === 'auto' ?
|
|
6488
|
-
(this.isFixed ? this.placeholder : $el).offsetHeight > height(window) ?
|
|
6489
|
-
'bottom' :
|
|
6490
|
-
'top' :
|
|
6491
|
-
position;
|
|
6492
|
-
},
|
|
6493
|
-
|
|
6494
|
-
offset(_ref2, $el) {let { offset } = _ref2;
|
|
6495
|
-
if (this.position === 'bottom') {
|
|
6496
|
-
offset += '+100vh-100%';
|
|
6497
|
-
}
|
|
6498
|
-
return toPx(offset, 'height', $el);
|
|
6499
|
-
},
|
|
6500
|
-
|
|
6501
|
-
selTarget(_ref3, $el) {let { selTarget } = _ref3;
|
|
6600
|
+
selTarget(_ref, $el) {let { selTarget } = _ref;
|
|
6502
6601
|
return selTarget && $(selTarget, $el) || $el;
|
|
6503
6602
|
},
|
|
6504
6603
|
|
|
6505
|
-
widthElement(
|
|
6604
|
+
widthElement(_ref2, $el) {let { widthElement } = _ref2;
|
|
6506
6605
|
return query(widthElement, $el) || this.placeholder;
|
|
6507
6606
|
},
|
|
6508
6607
|
|
|
@@ -6550,41 +6649,36 @@
|
|
|
6550
6649
|
return window;
|
|
6551
6650
|
},
|
|
6552
6651
|
|
|
6652
|
+
filter() {
|
|
6653
|
+
return this.targetOffset !== false;
|
|
6654
|
+
},
|
|
6655
|
+
|
|
6553
6656
|
handler() {
|
|
6554
|
-
if (!
|
|
6657
|
+
if (!location.hash || scrollTop(window) === 0) {
|
|
6555
6658
|
return;
|
|
6556
6659
|
}
|
|
6557
6660
|
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
fastdom.read(() => {
|
|
6562
|
-
const { top } = offset(target);
|
|
6563
|
-
const elTop = offset(this.$el).top;
|
|
6564
|
-
const elHeight = this.$el.offsetHeight;
|
|
6661
|
+
fastdom.read(() => {
|
|
6662
|
+
const targetOffset = offset($(location.hash));
|
|
6663
|
+
const elOffset = offset(this.$el);
|
|
6565
6664
|
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
top -
|
|
6574
|
-
elHeight - (
|
|
6575
|
-
isNumeric(this.targetOffset) ? this.targetOffset : 0) -
|
|
6576
|
-
this.offset);
|
|
6665
|
+
if (this.isFixed && intersectRect(targetOffset, elOffset)) {
|
|
6666
|
+
scrollTop(
|
|
6667
|
+
window,
|
|
6668
|
+
targetOffset.top -
|
|
6669
|
+
elOffset.height -
|
|
6670
|
+
toPx(this.targetOffset, 'height') -
|
|
6671
|
+
toPx(this.offset, 'height'));
|
|
6577
6672
|
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
}
|
|
6673
|
+
}
|
|
6674
|
+
});
|
|
6581
6675
|
} }],
|
|
6582
6676
|
|
|
6583
6677
|
|
|
6584
6678
|
|
|
6585
6679
|
update: [
|
|
6586
6680
|
{
|
|
6587
|
-
read(
|
|
6681
|
+
read(_ref3, types) {let { height: height$1, margin } = _ref3;
|
|
6588
6682
|
this.inactive = !this.matchMedia || !isVisible(this.$el);
|
|
6589
6683
|
|
|
6590
6684
|
if (this.inactive) {
|
|
@@ -6593,35 +6687,49 @@
|
|
|
6593
6687
|
|
|
6594
6688
|
const hide = this.isActive && types.has('resize');
|
|
6595
6689
|
if (hide) {
|
|
6690
|
+
css(this.selTarget, 'transition', '0s');
|
|
6596
6691
|
this.hide();
|
|
6597
6692
|
}
|
|
6598
6693
|
|
|
6599
6694
|
if (!this.isActive) {
|
|
6600
|
-
height$1 = this.$el.
|
|
6695
|
+
height$1 = offset(this.$el).height;
|
|
6601
6696
|
margin = css(this.$el, 'margin');
|
|
6602
6697
|
}
|
|
6603
6698
|
|
|
6604
6699
|
if (hide) {
|
|
6605
6700
|
this.show();
|
|
6701
|
+
fastdom.write(() => css(this.selTarget, 'transition', ''));
|
|
6606
6702
|
}
|
|
6607
6703
|
|
|
6608
|
-
const overflow = Math.max(0, height$1 + this.offset - height(window));
|
|
6609
|
-
|
|
6610
6704
|
const referenceElement = this.isFixed ? this.placeholder : this.$el;
|
|
6705
|
+
const windowHeight = height(window);
|
|
6706
|
+
|
|
6707
|
+
let position = this.position;
|
|
6708
|
+
if (position === 'auto' && height$1 > windowHeight) {
|
|
6709
|
+
position = 'bottom';
|
|
6710
|
+
}
|
|
6711
|
+
|
|
6712
|
+
let offset$1 = toPx(this.offset, 'height', referenceElement);
|
|
6713
|
+
if (position === 'bottom') {
|
|
6714
|
+
offset$1 += windowHeight - height$1;
|
|
6715
|
+
}
|
|
6716
|
+
|
|
6717
|
+
const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
|
|
6611
6718
|
const topOffset = offset(referenceElement).top;
|
|
6612
6719
|
const offsetParentTop = offset(referenceElement.offsetParent).top;
|
|
6613
6720
|
|
|
6614
6721
|
const top = parseProp(this.top, this.$el, topOffset);
|
|
6615
6722
|
const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
|
|
6616
6723
|
|
|
6617
|
-
const start = Math.max(top, topOffset) -
|
|
6724
|
+
const start = Math.max(top, topOffset) - offset$1;
|
|
6618
6725
|
const end = bottom ?
|
|
6619
|
-
bottom - this.$el.
|
|
6620
|
-
getScrollingElement(this.$el).scrollHeight -
|
|
6726
|
+
bottom - offset(this.$el).height + overflow - offset$1 :
|
|
6727
|
+
getScrollingElement(this.$el).scrollHeight - windowHeight;
|
|
6621
6728
|
|
|
6622
6729
|
return {
|
|
6623
6730
|
start,
|
|
6624
6731
|
end,
|
|
6732
|
+
offset: offset$1,
|
|
6625
6733
|
overflow,
|
|
6626
6734
|
topOffset,
|
|
6627
6735
|
offsetParentTop,
|
|
@@ -6633,7 +6741,7 @@
|
|
|
6633
6741
|
|
|
6634
6742
|
},
|
|
6635
6743
|
|
|
6636
|
-
write(
|
|
6744
|
+
write(_ref4) {let { height, margin } = _ref4;
|
|
6637
6745
|
const { placeholder } = this;
|
|
6638
6746
|
|
|
6639
6747
|
css(placeholder, { height, margin });
|
|
@@ -6650,14 +6758,14 @@
|
|
|
6650
6758
|
|
|
6651
6759
|
|
|
6652
6760
|
{
|
|
6653
|
-
read(
|
|
6761
|
+
read(_ref5)
|
|
6654
6762
|
|
|
6655
6763
|
|
|
6656
6764
|
|
|
6657
6765
|
|
|
6658
6766
|
|
|
6659
6767
|
|
|
6660
|
-
{let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } =
|
|
6768
|
+
{let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref5;
|
|
6661
6769
|
const scroll = scrollTop(window);
|
|
6662
6770
|
const dir = prevScroll <= scroll ? 'down' : 'up';
|
|
6663
6771
|
|
|
@@ -6738,7 +6846,7 @@
|
|
|
6738
6846
|
}
|
|
6739
6847
|
} else if (this.isFixed) {
|
|
6740
6848
|
this.update();
|
|
6741
|
-
} else if (this.animation) {
|
|
6849
|
+
} else if (this.animation && scroll > topOffset) {
|
|
6742
6850
|
Animation.cancel(this.$el);
|
|
6743
6851
|
this.show();
|
|
6744
6852
|
Animation.in(this.$el, this.animation).catch(noop);
|
|
@@ -6766,33 +6874,33 @@
|
|
|
6766
6874
|
},
|
|
6767
6875
|
|
|
6768
6876
|
update() {
|
|
6769
|
-
|
|
6877
|
+
let {
|
|
6770
6878
|
width,
|
|
6771
6879
|
scroll = 0,
|
|
6772
6880
|
overflow,
|
|
6773
6881
|
overflowScroll = 0,
|
|
6774
6882
|
start,
|
|
6775
6883
|
end,
|
|
6884
|
+
offset,
|
|
6776
6885
|
topOffset,
|
|
6777
6886
|
height,
|
|
6778
6887
|
offsetParentTop } =
|
|
6779
6888
|
this._data;
|
|
6780
6889
|
const active = start !== 0 || scroll > start;
|
|
6781
|
-
let top = this.offset;
|
|
6782
6890
|
let position = 'fixed';
|
|
6783
6891
|
|
|
6784
6892
|
if (scroll > end) {
|
|
6785
|
-
|
|
6893
|
+
offset += end - offsetParentTop;
|
|
6786
6894
|
position = 'absolute';
|
|
6787
6895
|
}
|
|
6788
6896
|
|
|
6789
6897
|
if (overflow) {
|
|
6790
|
-
|
|
6898
|
+
offset -= overflowScroll;
|
|
6791
6899
|
}
|
|
6792
6900
|
|
|
6793
6901
|
css(this.$el, {
|
|
6794
6902
|
position,
|
|
6795
|
-
top:
|
|
6903
|
+
top: offset + "px",
|
|
6796
6904
|
width });
|
|
6797
6905
|
|
|
6798
6906
|
|
|
@@ -6822,7 +6930,7 @@
|
|
|
6822
6930
|
}
|
|
6823
6931
|
|
|
6824
6932
|
var Switcher = {
|
|
6825
|
-
mixins: [Togglable],
|
|
6933
|
+
mixins: [Lazyload, Swipe, Togglable],
|
|
6826
6934
|
|
|
6827
6935
|
args: 'connect',
|
|
6828
6936
|
|
|
@@ -6830,8 +6938,7 @@
|
|
|
6830
6938
|
connect: String,
|
|
6831
6939
|
toggle: String,
|
|
6832
6940
|
itemNav: String,
|
|
6833
|
-
active: Number,
|
|
6834
|
-
swiping: Boolean },
|
|
6941
|
+
active: Number },
|
|
6835
6942
|
|
|
6836
6943
|
|
|
6837
6944
|
data: {
|
|
@@ -6839,7 +6946,6 @@
|
|
|
6839
6946
|
toggle: '> * > :first-child',
|
|
6840
6947
|
itemNav: false,
|
|
6841
6948
|
active: 0,
|
|
6842
|
-
swiping: true,
|
|
6843
6949
|
cls: 'uk-active',
|
|
6844
6950
|
attrItem: 'uk-switcher-item' },
|
|
6845
6951
|
|
|
@@ -6883,9 +6989,17 @@
|
|
|
6883
6989
|
return children(this.$el).filter((child) =>
|
|
6884
6990
|
this.toggles.some((toggle) => within(toggle, child)));
|
|
6885
6991
|
|
|
6992
|
+
},
|
|
6993
|
+
|
|
6994
|
+
swipeTarget() {
|
|
6995
|
+
return this.connects;
|
|
6886
6996
|
} },
|
|
6887
6997
|
|
|
6888
6998
|
|
|
6999
|
+
connected() {
|
|
7000
|
+
this.lazyload(this.$el, this.connects);
|
|
7001
|
+
},
|
|
7002
|
+
|
|
6889
7003
|
events: [
|
|
6890
7004
|
{
|
|
6891
7005
|
name: 'click',
|
|
@@ -6994,7 +7108,7 @@
|
|
|
6994
7108
|
const KEY_SPACE = 32;
|
|
6995
7109
|
|
|
6996
7110
|
var toggle = {
|
|
6997
|
-
mixins: [Media, Togglable],
|
|
7111
|
+
mixins: [Lazyload, Media, Togglable],
|
|
6998
7112
|
|
|
6999
7113
|
args: 'target',
|
|
7000
7114
|
|
|
@@ -7016,6 +7130,7 @@
|
|
|
7016
7130
|
if (!includes(this.mode, 'media') && !isFocusable(this.$el)) {
|
|
7017
7131
|
attr(this.$el, 'tabindex', '0');
|
|
7018
7132
|
}
|
|
7133
|
+
this.lazyload(this.$el, this.target);
|
|
7019
7134
|
},
|
|
7020
7135
|
|
|
7021
7136
|
computed: {
|
|
@@ -7107,7 +7222,7 @@
|
|
|
7107
7222
|
name: 'keydown',
|
|
7108
7223
|
|
|
7109
7224
|
filter() {
|
|
7110
|
-
return includes(this.mode, 'click') && isTag(this.$el, 'input');
|
|
7225
|
+
return includes(this.mode, 'click') && !isTag(this.$el, 'input');
|
|
7111
7226
|
},
|
|
7112
7227
|
|
|
7113
7228
|
handler(e) {
|