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.
Files changed (81) hide show
  1. package/CHANGELOG.md +10 -3
  2. package/dist/css/uikit-core-rtl.css +24 -11
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +24 -11
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +24 -11
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +24 -11
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +3 -3
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +5 -15
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +5 -15
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +9 -10
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +9 -10
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +59 -78
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +9 -10
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +23 -45
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +2 -2
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +2 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +427 -312
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +485 -410
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/hooks.js +2 -2
  44. package/src/js/api/state.js +173 -140
  45. package/src/js/components/countdown.js +2 -2
  46. package/src/js/components/internal/slider-preload.js +4 -32
  47. package/src/js/components/slider.js +39 -42
  48. package/src/js/components/upload.js +2 -1
  49. package/src/js/core/accordion.js +6 -1
  50. package/src/js/core/core.js +2 -75
  51. package/src/js/core/cover.js +5 -1
  52. package/src/js/core/drop.js +3 -1
  53. package/src/js/core/form-custom.js +2 -2
  54. package/src/js/core/height-viewport.js +3 -0
  55. package/src/js/core/icon.js +13 -6
  56. package/src/js/core/img.js +19 -25
  57. package/src/js/core/offcanvas.js +2 -1
  58. package/src/js/core/sticky.js +50 -56
  59. package/src/js/core/switcher.js +11 -3
  60. package/src/js/core/toggle.js +4 -2
  61. package/src/js/core/video.js +13 -1
  62. package/src/js/mixin/lazyload.js +20 -0
  63. package/src/js/mixin/parallax.js +9 -10
  64. package/src/js/mixin/slider.js +0 -6
  65. package/src/js/mixin/slideshow.js +0 -4
  66. package/src/js/mixin/swipe.js +72 -0
  67. package/src/js/mixin/togglable.js +1 -1
  68. package/src/js/util/ajax.js +6 -2
  69. package/src/js/util/dimensions.js +4 -4
  70. package/src/js/util/dom.js +16 -7
  71. package/src/js/util/index.js +1 -0
  72. package/src/js/util/observer.js +36 -0
  73. package/src/less/components/form-range.less +4 -6
  74. package/src/less/components/height.less +3 -0
  75. package/src/less/components/utility.less +6 -3
  76. package/src/scss/components/form-range.scss +4 -6
  77. package/src/scss/components/height.scss +3 -0
  78. package/src/scss/components/utility.scss +6 -3
  79. package/tests/parallax.html +5 -5
  80. package/tests/sticky-parallax.html +10 -10
  81. package/tests/utility.html +17 -0
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.92f357b93 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
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) => reject(e);
733
- img.onload = () => resolve(img);
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$1(element);
1017
1021
 
1018
1022
  if (element) {
1019
- const { pageYOffset, pageXOffset } = toWindow(element);
1020
- const offsetBy = { height: pageYOffset, width: pageXOffset };
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.pageYOffset;
1087
- offset[1] += win.pageXOffset;
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 template = document.createElement('template');
1257
- template.innerHTML = html.trim();
1258
- const nodes = toNodes(template.content.childNodes);
1259
- for (const node of nodes) {
1260
- document.adoptNode(node);
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
- return unwrapSingle(nodes);
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') && (!events || !events.some((type) => types.has(type)))) {
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
 
@@ -2406,7 +2457,7 @@
2406
2457
  UIkit.prototype._initProps = function (props) {
2407
2458
  let key;
2408
2459
 
2409
- props = props || getProps(this.$options, this.$name);
2460
+ props = props || getProps$1(this.$options, this.$name);
2410
2461
 
2411
2462
  for (key in props) {
2412
2463
  if (!isUndefined(props[key])) {
@@ -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
- function getProps(opts, name) {
2452
- const data$1 = {};
2453
- const { args = [], props = {}, el } = opts;
2514
+ function getProps$1(opts, name) {
2515
+ const data$1 = {};
2516
+ const { args = [], props = {}, el } = opts;
2454
2517
 
2455
- if (!props) {
2456
- return data$1;
2457
- }
2458
-
2459
- for (const key in props) {
2460
- const prop = hyphenate(key);
2461
- let value = data(el, prop);
2518
+ if (!props) {
2519
+ return data$1;
2520
+ }
2462
2521
 
2463
- if (isUndefined(value)) {
2464
- continue;
2465
- }
2522
+ for (const key in props) {
2523
+ const prop = hyphenate(key);
2524
+ let value = data(el, prop);
2466
2525
 
2467
- value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
2526
+ if (isUndefined(value)) {
2527
+ continue;
2528
+ }
2468
2529
 
2469
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2470
- continue;
2471
- }
2530
+ value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
2472
2531
 
2473
- data$1[key] = value;
2532
+ if (prop === 'target' && (!value || startsWith(value, '_'))) {
2533
+ continue;
2474
2534
  }
2475
2535
 
2476
- const options = parseOptions(data(el, name), args);
2536
+ data$1[key] = value;
2537
+ }
2477
2538
 
2478
- for (const key in options) {
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
- return data$1;
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
- function registerComputed(component, key, cb) {
2489
- Object.defineProperty(component, key, {
2490
- enumerable: true,
2548
+ return data$1;
2549
+ }
2491
2550
 
2492
- get() {
2493
- const { _computeds, $props, $el } = component;
2551
+ function registerComputed(component, key, cb) {
2552
+ Object.defineProperty(component, key, {
2553
+ enumerable: true,
2494
2554
 
2495
- if (!hasOwn(_computeds, key)) {
2496
- _computeds[key] = (cb.get || cb).call(component, $props, $el);
2497
- }
2555
+ get() {
2556
+ const { _computeds, $props, $el } = component;
2498
2557
 
2499
- return _computeds[key];
2500
- },
2558
+ if (!hasOwn(_computeds, key)) {
2559
+ _computeds[key] = (cb.get || cb).call(component, $props, $el);
2560
+ }
2501
2561
 
2502
- set(value) {
2503
- const { _computeds } = component;
2562
+ return _computeds[key];
2563
+ },
2504
2564
 
2505
- _computeds[key] = cb.set ? cb.set.call(component, value) : value;
2565
+ set(value) {
2566
+ const { _computeds } = component;
2506
2567
 
2507
- if (isUndefined(_computeds[key])) {
2508
- delete _computeds[key];
2509
- }
2510
- } });
2568
+ _computeds[key] = cb.set ? cb.set.call(component, value) : value;
2569
+
2570
+ if (isUndefined(_computeds[key])) {
2571
+ delete _computeds[key];
2572
+ }
2573
+ } });
2511
2574
 
2575
+ }
2576
+
2577
+ function registerEvent(component, event, key) {
2578
+ if (!isPlainObject(event)) {
2579
+ event = { name: key, handler: event };
2512
2580
  }
2513
2581
 
2514
- function registerEvent(component, event, key) {
2515
- if (!isPlainObject(event)) {
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
- let { name, el, handler, capture, passive, delegate, filter, self } = event;
2520
- el = isFunction(el) ? el.call(component) : el || component.$el;
2585
+ if (isArray(el)) {
2586
+ el.forEach((el) => registerEvent(component, { ...event, el }, key));
2587
+ return;
2588
+ }
2521
2589
 
2522
- if (isArray(el)) {
2523
- el.forEach((el) => registerEvent(component, { ...event, el }, key));
2524
- return;
2525
- }
2590
+ if (!el || filter && !filter.call(component)) {
2591
+ return;
2592
+ }
2526
2593
 
2527
- if (!el || filter && !filter.call(component)) {
2528
- return;
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
- function notIn(options, key) {
2543
- return options.every((arr) => !arr || !hasOwn(arr, key));
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
- function coerce(type, value) {
2547
- if (type === Boolean) {
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
- return type ? type(value) : value;
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
- function toList(value) {
2559
- return isArray(value) ?
2560
- value :
2561
- isString(value) ?
2562
- value.
2563
- split(/,(?![^(]*\))/).
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
- function normalizeData(_ref, _ref2) {let { data = {} } = _ref;let { args = [], props = {} } = _ref2;
2569
- if (isArray(data)) {
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
- for (const key in data) {
2581
- if (isUndefined(data[key])) {
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
- return data;
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
- const observer = new MutationObserver(() => component.$emit());
2595
- observer.observe(el, {
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
- return observer;
2670
+ if (!props || attrs === false) {
2671
+ return;
2601
2672
  }
2602
2673
 
2603
- function initPropsObserver(component) {
2604
- const { $name, $options, $props } = component;
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
- if (!props || attrs === false) {
2608
- return;
2677
+ const observer = new MutationObserver((records) => {
2678
+ const data = getProps$1($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
- const attributes = isArray(attrs) ? attrs : Object.keys(props);
2612
- const filter = attributes.map((key) => hyphenate(key)).concat($name);
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
- observer.observe(el, {
2629
- attributes: true,
2630
- attributeFilter: filter.concat(filter.map((key) => "data-" + key)) });
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 });
2631
2707
 
2632
2708
 
2633
- return observer;
2709
+ scrollListeners.set(id, listener);
2710
+ }
2711
+
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.92f357b93';
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.$update();
3998
+ this.$emit();
3947
3999
  } },
3948
4000
 
3949
4001
 
@@ -3955,7 +4007,7 @@
3955
4007
  },
3956
4008
 
3957
4009
  handler() {
3958
- this.$update();
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
- return Promise.reject('Icon not found.');
4718
+ throw 'Icon not found.';
4665
4719
  }
4666
4720
 
4667
- return Promise.resolve(icon);
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
- async connected() {
4726
- const svg = await this.svg;
4727
- svg && this.ratio !== 1 && css($('circle', svg), 'strokeWidth', 1 / this.ratio);
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.observe();
4857
+ this.$reset();
4798
4858
  } } },
4799
4859
 
4800
4860
 
4801
4861
 
4802
4862
  connected() {
4803
- if (this.loading !== 'lazy' || !window.IntersectionObserver || !nativeIsIntersecting) {
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
- const rootMargin = toPx(this.offsetTop, 'height') + "px " + toPx(
4820
- this.offsetLeft,
4821
- 'width') + "px";
4822
-
4823
- this.observer = new IntersectionObserver(
4824
- (entries) => {
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
- { rootMargin });
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() {var _this$observer;
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 = () => setSrcAttrs(el, img.currentSrc);
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
- position(_ref, $el) {let { position } = _ref;
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(_ref4, $el) {let { widthElement } = _ref4;
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 (!(this.targetOffset !== false && location.hash && scrollTop(window) > 0)) {
6657
+ if (!location.hash || scrollTop(window) === 0) {
6555
6658
  return;
6556
6659
  }
6557
6660
 
6558
- const target = $(location.hash);
6661
+ fastdom.read(() => {
6662
+ const targetOffset = offset($(location.hash));
6663
+ const elOffset = offset(this.$el);
6559
6664
 
6560
- if (target) {
6561
- fastdom.read(() => {
6562
- const { top } = offset(target);
6563
- const elTop = offset(this.$el).top;
6564
- const elHeight = this.$el.offsetHeight;
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'));
6565
6672
 
6566
- if (
6567
- this.isFixed &&
6568
- elTop + elHeight >= top &&
6569
- elTop <= top + target.offsetHeight)
6570
- {
6571
- scrollTop(
6572
- window,
6573
- top -
6574
- elHeight - (
6575
- isNumeric(this.targetOffset) ? this.targetOffset : 0) -
6576
- this.offset);
6577
-
6578
- }
6579
- });
6580
- }
6673
+ }
6674
+ });
6581
6675
  } }],
6582
6676
 
6583
6677
 
6584
6678
 
6585
6679
  update: [
6586
6680
  {
6587
- read(_ref5, types) {let { height: height$1, margin } = _ref5;
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.offsetHeight;
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) - this.offset;
6724
+ const start = Math.max(top, topOffset) - offset$1;
6618
6725
  const end = bottom ?
6619
- bottom - this.$el.offsetHeight + overflow - this.offset :
6620
- getScrollingElement(this.$el).scrollHeight - height(window);
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(_ref6) {let { height, margin } = _ref6;
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(_ref7)
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 } = _ref7;
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
- const {
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
- top = end + this.offset - offsetParentTop;
6893
+ offset += end - offsetParentTop;
6786
6894
  position = 'absolute';
6787
6895
  }
6788
6896
 
6789
6897
  if (overflow) {
6790
- top -= overflowScroll;
6898
+ offset -= overflowScroll;
6791
6899
  }
6792
6900
 
6793
6901
  css(this.$el, {
6794
6902
  position,
6795
- top: top + "px",
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) {
@@ -7368,8 +7483,8 @@
7368
7483
  this.stop();
7369
7484
 
7370
7485
  if (this.date && this.units.length) {
7371
- this.$update();
7372
- this.timer = setInterval(this.$update, 1000);
7486
+ this.$emit();
7487
+ this.timer = setInterval(() => this.$emit(), 1000);
7373
7488
  }
7374
7489
  },
7375
7490
 
@@ -8419,12 +8534,6 @@
8419
8534
  } },
8420
8535
 
8421
8536
 
8422
- events: {
8423
- itemshown() {
8424
- this.$update(this.list);
8425
- } },
8426
-
8427
-
8428
8537
  methods: {
8429
8538
  show(index, force) {if (force === void 0) {force = false;}
8430
8539
  if (this.dragging || !this.length) {
@@ -8586,19 +8695,15 @@
8586
8695
 
8587
8696
 
8588
8697
  events: {
8589
- 'itemshow itemhide itemshown itemhidden'(_ref2) {let { target } = _ref2;
8590
- this.$update(target);
8591
- },
8592
-
8593
- beforeitemshow(_ref3) {let { target } = _ref3;
8698
+ beforeitemshow(_ref2) {let { target } = _ref2;
8594
8699
  addClass(target, this.clsActive);
8595
8700
  },
8596
8701
 
8597
- itemshown(_ref4) {let { target } = _ref4;
8702
+ itemshown(_ref3) {let { target } = _ref3;
8598
8703
  addClass(target, this.clsActivated);
8599
8704
  },
8600
8705
 
8601
- itemhidden(_ref5) {let { target } = _ref5;
8706
+ itemhidden(_ref4) {let { target } = _ref4;
8602
8707
  removeClass(target, this.clsActive, this.clsActivated);
8603
8708
  } } };
8604
8709
 
@@ -9173,7 +9278,7 @@
9173
9278
 
9174
9279
 
9175
9280
  events: {
9176
- bgimageload() {
9281
+ load() {
9177
9282
  this.$emit();
9178
9283
  } },
9179
9284
 
@@ -9184,13 +9289,11 @@
9184
9289
  },
9185
9290
 
9186
9291
  getCss(percent) {
9187
- return keys(this.props).reduce(
9188
- (css, prop) => {
9292
+ const css = { transform: '', filter: '' };
9293
+ for (const prop in this.props) {
9189
9294
  this.props[prop](css, percent);
9190
- return css;
9191
- },
9192
- { transform: '', filter: '' });
9193
-
9295
+ }
9296
+ return css;
9194
9297
  } } };
9195
9298
 
9196
9299
 
@@ -9373,8 +9476,9 @@
9373
9476
  if (!image.naturalWidth) {
9374
9477
  image.onload = () => {
9375
9478
  dimensions[src] = toDimensions(image);
9376
- trigger(el, 'bgimageload');
9479
+ trigger(el, 'load');
9377
9480
  };
9481
+ return toDimensions(image);
9378
9482
  }
9379
9483
  }
9380
9484
 
@@ -9444,7 +9548,7 @@
9444
9548
  return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
9445
9549
  }
9446
9550
 
9447
- const unitRe = /^[\d-]+([^\s]+)/;
9551
+ const unitRe = /^-?\d+([^\s]*)/;
9448
9552
  function getUnit(stops, defaultUnit) {
9449
9553
  for (const stop of stops) {
9450
9554
  const match = stop.match == null ? void 0 : stop.match(unitRe);
@@ -9565,40 +9669,11 @@
9565
9669
  events: ['resize'] } };
9566
9670
 
9567
9671
  var SliderPreload = {
9568
- connected() {
9569
- if (window.IntersectionObserver) {
9570
- this.observer = new IntersectionObserver(
9571
- (entries) => {
9572
- if (entries.some((entry) => entry.isIntersecting)) {
9573
- removeLazyLoad(this.getAdjacentSlides());
9574
- }
9575
- },
9576
- { rootMargin: '50% 50%' });
9577
-
9578
- this.observer.observe(this.$el);
9579
- }
9580
- },
9581
-
9582
- disconnected() {
9583
- this.observer && this.observer.disconnect();
9584
- },
9585
-
9586
- update: {
9587
- read() {
9588
- if (isVisible(this.$el)) {
9589
- removeLazyLoad(this.getAdjacentSlides());
9590
- }
9591
- },
9592
-
9593
- events: ['resize'] } };
9594
-
9672
+ mixins: [Lazyload],
9595
9673
 
9596
-
9597
- function removeLazyLoad(elements) {if (elements === void 0) {elements = [];}
9598
- for (const el of elements) {
9599
- el && $$('img[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
9600
- }
9601
- }
9674
+ connected() {
9675
+ this.lazyload(this.slides, this.getAdjacentSlides);
9676
+ } };
9602
9677
 
9603
9678
  function Transitioner (prev, next, dir, _ref) {let { center, easing, list } = _ref;
9604
9679
  const deferred = new Deferred();
@@ -9818,48 +9893,39 @@
9818
9893
  return ~index ? index : this.length - 1;
9819
9894
  },
9820
9895
 
9821
- sets(_ref2) {let { sets } = _ref2;
9822
- if (!sets) {
9896
+ sets(_ref2) {let { sets: enabled } = _ref2;
9897
+ if (!enabled) {
9823
9898
  return;
9824
9899
  }
9825
9900
 
9826
- const width = dimensions$1(this.list).width / (this.center ? 2 : 1);
9827
-
9828
9901
  let left = 0;
9829
- let leftCenter = width;
9830
- let slideLeft = 0;
9902
+ const sets = [];
9903
+ const width = dimensions$1(this.list).width;
9904
+ for (let i in this.slides) {
9905
+ const slideWidth = dimensions$1(this.slides[i]).width;
9831
9906
 
9832
- sets = sortBy$1(this.slides, 'offsetLeft').reduce((sets, slide, i) => {
9833
- const slideWidth = dimensions$1(slide).width;
9834
- const slideRight = slideLeft + slideWidth;
9835
-
9836
- if (slideRight > left) {
9837
- if (!this.center && i > this.maxIndex) {
9838
- i = this.maxIndex;
9839
- }
9907
+ if (left + slideWidth > width) {
9908
+ left = 0;
9909
+ }
9840
9910
 
9841
- if (!includes(sets, i)) {
9842
- const cmp = this.slides[i + 1];
9843
- if (
9844
- this.center &&
9845
- cmp &&
9846
- slideWidth < leftCenter - dimensions$1(cmp).width / 2)
9847
- {
9848
- leftCenter -= slideWidth;
9849
- } else {
9850
- leftCenter = width;
9851
- sets.push(i);
9852
- left = slideLeft + width + (this.center ? slideWidth / 2 : 0);
9853
- }
9911
+ if (this.center) {
9912
+ if (
9913
+ left < width / 2 &&
9914
+ left + slideWidth + dimensions$1(this.slides[+i + 1]).width / 2 > width / 2)
9915
+ {
9916
+ sets.push(+i);
9917
+ left = width / 2 - slideWidth / 2;
9854
9918
  }
9919
+ } else if (left === 0) {
9920
+ sets.push(Math.min(+i, this.maxIndex));
9855
9921
  }
9856
9922
 
9857
- slideLeft += slideWidth;
9923
+ left += slideWidth;
9924
+ }
9858
9925
 
9926
+ if (sets.length) {
9859
9927
  return sets;
9860
- }, []);
9861
-
9862
- return !isEmpty(sets) && sets;
9928
+ }
9863
9929
  },
9864
9930
 
9865
9931
  transitionOptions() {
@@ -9891,15 +9957,7 @@
9891
9957
  this._translate(1);
9892
9958
  }
9893
9959
 
9894
- const actives = this._getTransitioner(this.index).getActives();
9895
- const activeClasses = [
9896
- this.clsActive,
9897
- (!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
9898
- ''];
9899
-
9900
- for (const slide of this.slides) {
9901
- toggleClass(slide, activeClasses, includes(actives, slide));
9902
- }
9960
+ this.updateActiveClasses();
9903
9961
  },
9904
9962
 
9905
9963
  events: ['resize'] },
@@ -9947,6 +10005,10 @@
9947
10005
  if (~this.prevIndex) {
9948
10006
  addClass(this._getTransitioner().getItemIn(), this.clsActive);
9949
10007
  }
10008
+ },
10009
+
10010
+ itemshown() {
10011
+ this.updateActiveClasses();
9950
10012
  } },
9951
10013
 
9952
10014
 
@@ -9984,6 +10046,18 @@
9984
10046
  }
9985
10047
  },
9986
10048
 
10049
+ updateActiveClasses() {
10050
+ const actives = this._getTransitioner(this.index).getActives();
10051
+ const activeClasses = [
10052
+ this.clsActive,
10053
+ (!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
10054
+ ''];
10055
+
10056
+ for (const slide of this.slides) {
10057
+ toggleClass(slide, activeClasses, includes(actives, slide));
10058
+ }
10059
+ },
10060
+
9987
10061
  getValidIndex(index, prevIndex) {if (index === void 0) {index = this.index;}if (prevIndex === void 0) {prevIndex = this.prevIndex;}
9988
10062
  index = this.getIndex(index, prevIndex);
9989
10063
 
@@ -10964,6 +11038,7 @@
10964
11038
  }
10965
11039
 
10966
11040
  function chunk(files, size) {
11041
+ files = toArray(files);
10967
11042
  const chunks = [];
10968
11043
  for (let i = 0; i < files.length; i += size) {
10969
11044
  chunks.push(files.slice(i, i + size));