uikit 3.12.3-dev.0e7855b18 → 3.12.3-dev.8e3f8e19e

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 (70) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  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 +13 -2
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +13 -2
  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 +65 -8
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +30 -13
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +13 -2
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +30 -13
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +13 -2
  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 +12 -20
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +236 -185
  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 +246 -193
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/hooks.js +3 -3
  44. package/src/js/api/state.js +14 -39
  45. package/src/js/components/parallax.js +3 -1
  46. package/src/js/components/slider-parallax.js +6 -4
  47. package/src/js/core/core.js +2 -17
  48. package/src/js/core/cover.js +3 -6
  49. package/src/js/core/drop.js +5 -10
  50. package/src/js/core/gif.js +5 -3
  51. package/src/js/core/grid.js +2 -1
  52. package/src/js/core/height-match.js +21 -1
  53. package/src/js/core/height-viewport.js +1 -6
  54. package/src/js/core/img.js +1 -2
  55. package/src/js/core/leader.js +7 -13
  56. package/src/js/core/margin.js +18 -1
  57. package/src/js/core/overflow-auto.js +8 -7
  58. package/src/js/core/scrollspy-nav.js +3 -0
  59. package/src/js/core/scrollspy.js +3 -0
  60. package/src/js/core/sticky.js +7 -1
  61. package/src/js/core/svg.js +16 -14
  62. package/src/js/core/toggle.js +16 -13
  63. package/src/js/core/video.js +2 -8
  64. package/src/js/mixin/media.js +29 -5
  65. package/src/js/mixin/position.js +10 -18
  66. package/src/js/mixin/resize.js +13 -0
  67. package/src/js/mixin/scroll.js +32 -0
  68. package/src/js/mixin/slider.js +2 -1
  69. package/src/js/util/class.js +1 -6
  70. package/src/js/util/observer.js +57 -20
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.12.3-dev.0e7855b18 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.12.3-dev.8e3f8e19e | 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() :
@@ -850,12 +850,7 @@
850
850
 
851
851
  function hasClass(element, cls) {
852
852
  [cls] = getClasses(cls);
853
- for (const node of toNodes(element)) {
854
- if (cls && node.classList.contains(cls)) {
855
- return true;
856
- }
857
- }
858
- return false;
853
+ return !!cls && toNodes(element).some((node) => node.classList.contains(cls));
859
854
  }
860
855
 
861
856
  function toggleClass(element, cls, force) {
@@ -1467,34 +1462,69 @@
1467
1462
  return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };
1468
1463
  }
1469
1464
 
1470
- // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
1471
- const hasIntersectionObserver =
1472
- window.IntersectionObserver && 'isIntersecting' in IntersectionObserverEntry.prototype;
1473
1465
  function observeIntersection(targets, cb, options, intersecting) {if (intersecting === void 0) {intersecting = true;}
1474
- if (!hasIntersectionObserver) {
1475
- return;
1476
- }
1477
-
1478
- const observer = new IntersectionObserver((entries, observer) => {
1479
- if (!intersecting || entries.some((entry) => entry.isIntersecting)) {
1466
+ return observe(
1467
+ IntersectionObserver,
1468
+ targets,
1469
+ intersecting ?
1470
+ (entries, observer) => {
1471
+ if (entries.some((entry) => entry.isIntersecting)) {
1480
1472
  cb(entries, observer);
1481
1473
  }
1482
- }, options);
1483
- for (const el of toNodes(targets)) {
1484
- observer.observe(el);
1485
- }
1486
- return observer;
1474
+ } :
1475
+ cb,
1476
+ options);
1477
+
1487
1478
  }
1488
1479
 
1489
1480
  const hasResizeObserver = window.ResizeObserver;
1490
1481
  function observeResize(targets, cb, options) {if (options === void 0) {options = { box: 'border-box' };}
1491
- if (!hasResizeObserver) {
1482
+ if (hasResizeObserver) {
1483
+ return observe(ResizeObserver, targets, cb, options);
1484
+ }
1485
+
1486
+ // Fallback Safari < 13.1
1487
+ initResizeListener();
1488
+ listeners.add(cb);
1489
+
1490
+ return {
1491
+ disconnect() {
1492
+ listeners.delete(cb);
1493
+ } };
1494
+
1495
+ }
1496
+
1497
+ let listeners;
1498
+ function initResizeListener() {
1499
+ if (listeners) {
1492
1500
  return;
1493
1501
  }
1494
1502
 
1495
- const observer = new ResizeObserver((entries, observer) => {
1496
- cb(entries, observer);
1497
- });
1503
+ listeners = new Set();
1504
+
1505
+ // throttle 'resize'
1506
+ let pendingResize;
1507
+ const handleResize = () => {
1508
+ if (pendingResize) {
1509
+ return;
1510
+ }
1511
+ pendingResize = true;
1512
+ fastdom.read(() => pendingResize = false);
1513
+ for (const listener of listeners) {
1514
+ listener();
1515
+ }
1516
+ };
1517
+
1518
+ on(window, 'load resize', handleResize);
1519
+ on(document, 'loadedmetadata load', handleResize, true);
1520
+ }
1521
+
1522
+ function observeMutation(targets, cb, options) {
1523
+ return observe(MutationObserver, targets, cb, options);
1524
+ }
1525
+
1526
+ function observe(Observer, targets, cb, options) {
1527
+ const observer = new Observer(cb);
1498
1528
  for (const el of toNodes(targets)) {
1499
1529
  observer.observe(el, options);
1500
1530
  }
@@ -2179,9 +2209,9 @@
2179
2209
  memoize: memoize,
2180
2210
  Deferred: Deferred,
2181
2211
  MouseTracker: MouseTracker,
2182
- hasIntersectionObserver: hasIntersectionObserver,
2183
2212
  observeIntersection: observeIntersection,
2184
2213
  observeResize: observeResize,
2214
+ observeMutation: observeMutation,
2185
2215
  mergeOptions: mergeOptions,
2186
2216
  parseOptions: parseOptions,
2187
2217
  play: play,
@@ -2289,7 +2319,7 @@
2289
2319
  }
2290
2320
 
2291
2321
  this._data = {};
2292
- this._computeds = {};
2322
+ this._computed = {};
2293
2323
 
2294
2324
  this._initProps();
2295
2325
 
@@ -2383,8 +2413,8 @@
2383
2413
  const {
2384
2414
  $options: { computed } } =
2385
2415
  this;
2386
- const values = { ...this._computeds };
2387
- this._computeds = {};
2416
+ const values = { ...this._computed };
2417
+ this._computed = {};
2388
2418
 
2389
2419
  for (const key in computed) {
2390
2420
  const { watch, immediate } = computed[key];
@@ -2442,7 +2472,7 @@
2442
2472
  UIkit.prototype._initComputeds = function () {
2443
2473
  const { computed } = this.$options;
2444
2474
 
2445
- this._computeds = {};
2475
+ this._computed = {};
2446
2476
 
2447
2477
  if (computed) {
2448
2478
  for (const key in computed) {
@@ -2481,22 +2511,19 @@
2481
2511
  }
2482
2512
  }
2483
2513
  }
2484
- for (const { events = [] } of this.$options.update || []) {
2485
- if (includes(events, 'scroll')) {
2486
- registerScrollListener(this._uid, () => this.$emit('scroll'));
2487
- break;
2488
- }
2489
- }
2490
2514
  };
2491
2515
 
2492
2516
  UIkit.prototype._unbindEvents = function () {
2493
2517
  this._events.forEach((unbind) => unbind());
2494
2518
  delete this._events;
2495
- unregisterScrollListener(this._uid);
2496
2519
  };
2497
2520
 
2498
2521
  UIkit.prototype._initObservers = function () {
2499
- this._observers = [initChildListObserver(this), initPropsObserver(this)];
2522
+ this._observers = [initPropsObserver(this)];
2523
+
2524
+ if (this.$options.computed) {
2525
+ this.registerObserver(initChildListObserver(this));
2526
+ }
2500
2527
  };
2501
2528
 
2502
2529
  UIkit.prototype.registerObserver = function (observer) {
@@ -2550,22 +2577,22 @@
2550
2577
  enumerable: true,
2551
2578
 
2552
2579
  get() {
2553
- const { _computeds, $props, $el } = component;
2580
+ const { _computed, $props, $el } = component;
2554
2581
 
2555
- if (!hasOwn(_computeds, key)) {
2556
- _computeds[key] = (cb.get || cb).call(component, $props, $el);
2582
+ if (!hasOwn(_computed, key)) {
2583
+ _computed[key] = (cb.get || cb).call(component, $props, $el);
2557
2584
  }
2558
2585
 
2559
- return _computeds[key];
2586
+ return _computed[key];
2560
2587
  },
2561
2588
 
2562
2589
  set(value) {
2563
- const { _computeds } = component;
2590
+ const { _computed } = component;
2564
2591
 
2565
- _computeds[key] = cb.set ? cb.set.call(component, value) : value;
2592
+ _computed[key] = cb.set ? cb.set.call(component, value) : value;
2566
2593
 
2567
- if (isUndefined(_computeds[key])) {
2568
- delete _computeds[key];
2594
+ if (isUndefined(_computed[key])) {
2595
+ delete _computed[key];
2569
2596
  }
2570
2597
  } });
2571
2598
 
@@ -2693,27 +2720,6 @@
2693
2720
  return observer;
2694
2721
  }
2695
2722
 
2696
- const scrollListeners = new Map();
2697
- let unbindScrollListener;
2698
- function registerScrollListener(id, listener) {
2699
- unbindScrollListener =
2700
- unbindScrollListener ||
2701
- on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
2702
- passive: true,
2703
- capture: true });
2704
-
2705
-
2706
- scrollListeners.set(id, listener);
2707
- }
2708
-
2709
- function unregisterScrollListener(id) {
2710
- scrollListeners.delete(id);
2711
- if (unbindScrollListener && !scrollListeners.size) {
2712
- unbindScrollListener();
2713
- unbindScrollListener = null;
2714
- }
2715
- }
2716
-
2717
2723
  function instanceAPI (UIkit) {
2718
2724
  const DATA = UIkit.data;
2719
2725
 
@@ -2887,7 +2893,7 @@
2887
2893
  UIkit.data = '__uikit__';
2888
2894
  UIkit.prefix = 'uk-';
2889
2895
  UIkit.options = {};
2890
- UIkit.version = '3.12.3-dev.0e7855b18';
2896
+ UIkit.version = '3.12.3-dev.8e3f8e19e';
2891
2897
 
2892
2898
  globalAPI(UIkit);
2893
2899
  hooksAPI(UIkit);
@@ -2895,26 +2901,11 @@
2895
2901
  componentAPI(UIkit);
2896
2902
  instanceAPI(UIkit);
2897
2903
 
2898
- function Core (UIkit) {
2904
+ function Core () {
2899
2905
  if (!inBrowser) {
2900
2906
  return;
2901
2907
  }
2902
2908
 
2903
- // throttle 'resize'
2904
- let pendingResize;
2905
- const handleResize = () => {
2906
- if (pendingResize) {
2907
- return;
2908
- }
2909
- pendingResize = true;
2910
- fastdom.read(() => pendingResize = false);
2911
- UIkit.update(null, 'resize');
2912
- };
2913
-
2914
- on(window, 'load resize', handleResize);
2915
- on(document, 'loadedmetadata load', handleResize, true);
2916
- observeResize(document.documentElement, handleResize);
2917
-
2918
2909
  let started = 0;
2919
2910
  on(
2920
2911
  document,
@@ -3381,13 +3372,9 @@
3381
3372
  autoplay: true },
3382
3373
 
3383
3374
 
3384
- computed: {
3385
- inView(_ref) {let { autoplay } = _ref;
3386
- return autoplay === 'inview';
3387
- } },
3388
-
3389
-
3390
3375
  connected() {
3376
+ this.inView = this.autoplay === 'inview';
3377
+
3391
3378
  if (this.inView && !hasAttr(this.$el, 'preload')) {
3392
3379
  this.$el.preload = 'none';
3393
3380
  }
@@ -3411,18 +3398,27 @@
3411
3398
 
3412
3399
  },
3413
3400
 
3414
- write(_ref2) {let { visible, inView } = _ref2;
3401
+ write(_ref) {let { visible, inView } = _ref;
3415
3402
  if (!visible || this.inView && !inView) {
3416
3403
  pause(this.$el);
3417
3404
  } else if (this.autoplay === true || this.inView && inView) {
3418
3405
  play(this.$el);
3419
3406
  }
3420
- },
3407
+ } } };
3408
+
3409
+ var Resize = {
3410
+ computed: {
3411
+ resizeTargets() {
3412
+ return this.$el;
3413
+ } },
3421
3414
 
3422
- events: ['resize', 'scroll'] } };
3415
+
3416
+ connected() {
3417
+ this.registerObserver(observeResize(this.resizeTargets, () => this.$emit('resize')));
3418
+ } };
3423
3419
 
3424
3420
  var cover = {
3425
- mixins: [Video],
3421
+ mixins: [Resize, Video],
3426
3422
 
3427
3423
  props: {
3428
3424
  width: Number,
@@ -3433,10 +3429,6 @@
3433
3429
  automute: true },
3434
3430
 
3435
3431
 
3436
- connected() {
3437
- this.registerObserver(observeResize(this.$el, () => this.$emit('resize')));
3438
- },
3439
-
3440
3432
  update: {
3441
3433
  read() {
3442
3434
  const el = this.$el;
@@ -3505,19 +3497,11 @@
3505
3497
  clsPos: '' },
3506
3498
 
3507
3499
 
3508
- computed: {
3509
- pos(_ref) {let { pos } = _ref;
3510
- return pos.split('-').concat('center').slice(0, 2);
3511
- },
3512
-
3513
- dir() {
3514
- return this.pos[0];
3515
- },
3516
-
3517
- align() {
3518
- return this.pos[1];
3519
- } },
3520
-
3500
+ connected() {
3501
+ this.pos = this.pos.split('-').concat('center').slice(0, 2);
3502
+ this.dir = this.pos[0];
3503
+ this.align = this.pos[1];
3504
+ },
3521
3505
 
3522
3506
  methods: {
3523
3507
  positionAt(element, target, boundary) {
@@ -3525,6 +3509,8 @@
3525
3509
 
3526
3510
  let { offset: offset$1 } = this;
3527
3511
  const axis = this.getAxis();
3512
+ const dir = this.pos[0];
3513
+ const align = this.pos[1];
3528
3514
 
3529
3515
  if (!isNumeric(offset$1)) {
3530
3516
  const node = $(offset$1);
@@ -3537,13 +3523,11 @@
3537
3523
  const { x, y } = positionAt(
3538
3524
  element,
3539
3525
  target,
3540
- axis === 'x' ?
3541
- flipPosition(this.dir) + " " + this.align :
3542
- this.align + " " + flipPosition(this.dir),
3543
- axis === 'x' ? this.dir + " " + this.align : this.align + " " + this.dir,
3526
+ axis === 'x' ? flipPosition(dir) + " " + align : align + " " + flipPosition(dir),
3527
+ axis === 'x' ? dir + " " + align : align + " " + dir,
3544
3528
  axis === 'x' ? "" + (
3545
- this.dir === 'left' ? -offset$1 : offset$1) : " " + (
3546
- this.dir === 'top' ? -offset$1 : offset$1),
3529
+ dir === 'left' ? -offset$1 : offset$1) : " " + (
3530
+ dir === 'top' ? -offset$1 : offset$1),
3547
3531
  null,
3548
3532
  this.flip,
3549
3533
  boundary).
@@ -3755,9 +3739,7 @@
3755
3739
 
3756
3740
  this.tracker.init();
3757
3741
 
3758
- once(
3759
- this.$el,
3760
- 'hide',
3742
+ for (const handler of [
3761
3743
  on(
3762
3744
  document,
3763
3745
  pointerDown,
@@ -3779,19 +3761,16 @@
3779
3761
  true));}),
3780
3762
 
3781
3763
 
3782
- { self: true });
3783
3764
 
3784
-
3785
- once(
3786
- this.$el,
3787
- 'hide',
3788
3765
  on(document, 'keydown', (e) => {
3789
3766
  if (e.keyCode === 27) {
3790
3767
  this.hide(false);
3791
3768
  }
3792
3769
  }),
3793
- { self: true });
3794
-
3770
+ on(window, 'resize', () => this.$emit('resize'))])
3771
+ {
3772
+ once(this.$el, 'hide', handler, { self: true });
3773
+ }
3795
3774
  } },
3796
3775
 
3797
3776
 
@@ -4008,6 +3987,10 @@
4008
3987
 
4009
3988
  // Deprecated
4010
3989
  var gif = {
3990
+ connected() {
3991
+ this.registerObserver(observeIntersection(this.$el, () => this.$emit()));
3992
+ },
3993
+
4011
3994
  update: {
4012
3995
  read(data) {
4013
3996
  const inview = isInView(this.$el);
@@ -4021,9 +4004,7 @@
4021
4004
 
4022
4005
  write() {
4023
4006
  this.$el.src = '' + this.$el.src; // force self-assign
4024
- },
4025
-
4026
- events: ['scroll', 'resize'] } };
4007
+ } } };
4027
4008
 
4028
4009
  var Margin = {
4029
4010
  props: {
@@ -4036,6 +4017,16 @@
4036
4017
  firstColumn: 'uk-first-column' },
4037
4018
 
4038
4019
 
4020
+ connected() {
4021
+ this.registerObserver(
4022
+ observeMutation(this.$el, () => this.$reset(), {
4023
+ childList: true }));
4024
+
4025
+
4026
+
4027
+ this.registerObserver(observeResize(this.$el.children, () => this.$emit('resize')));
4028
+ },
4029
+
4039
4030
  update: {
4040
4031
  read() {
4041
4032
  const rows = getRows(this.$el.children);
@@ -4137,10 +4128,41 @@
4137
4128
 
4138
4129
  }
4139
4130
 
4131
+ var Scroll = {
4132
+ connected() {
4133
+ registerScrollListener(this._uid, () => this.$emit('scroll'));
4134
+ },
4135
+
4136
+ disconnected() {
4137
+ unregisterScrollListener(this._uid);
4138
+ } };
4139
+
4140
+
4141
+ const scrollListeners = new Map();
4142
+ let unbindScrollListener;
4143
+ function registerScrollListener(id, listener) {
4144
+ unbindScrollListener =
4145
+ unbindScrollListener ||
4146
+ on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
4147
+ passive: true,
4148
+ capture: true });
4149
+
4150
+
4151
+ scrollListeners.set(id, listener);
4152
+ }
4153
+
4154
+ function unregisterScrollListener(id) {
4155
+ scrollListeners.delete(id);
4156
+ if (unbindScrollListener && !scrollListeners.size) {
4157
+ unbindScrollListener();
4158
+ unbindScrollListener = null;
4159
+ }
4160
+ }
4161
+
4140
4162
  var grid = {
4141
4163
  extends: Margin,
4142
4164
 
4143
- mixins: [Class],
4165
+ mixins: [Class, Scroll],
4144
4166
 
4145
4167
  name: 'grid',
4146
4168
 
@@ -4300,9 +4322,21 @@
4300
4322
  computed: {
4301
4323
  elements(_ref, $el) {let { target } = _ref;
4302
4324
  return $$(target, $el);
4325
+ },
4326
+
4327
+ resizeTargets() {
4328
+ this.$el.children;
4303
4329
  } },
4304
4330
 
4305
4331
 
4332
+ connected() {
4333
+ this.registerObserver(
4334
+ observeMutation(this.$el, () => this.$reset(), {
4335
+ childList: true }));
4336
+
4337
+
4338
+ },
4339
+
4306
4340
  update: {
4307
4341
  read() {
4308
4342
  return {
@@ -4416,13 +4450,9 @@
4416
4450
  return { minHeight, prev };
4417
4451
  },
4418
4452
 
4419
- write(_ref2) {let { minHeight, prev } = _ref2;
4453
+ write(_ref2) {let { minHeight } = _ref2;
4420
4454
  css(this.$el, { minHeight });
4421
4455
 
4422
- if (minHeight !== prev) {
4423
- trigger(this.$el, 'resize');
4424
- }
4425
-
4426
4456
  if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
4427
4457
  css(this.$el, 'minHeight', this.minHeight);
4428
4458
  }
@@ -4472,10 +4502,24 @@
4472
4502
  }
4473
4503
 
4474
4504
  this.applyAttributes(svg, el);
4475
- this.$emit();
4505
+
4476
4506
  return this.svgEl = svg;
4477
4507
  }
4478
4508
  }, noop);
4509
+
4510
+ if (this.strokeAnimation) {
4511
+ this.svg.then((el) => {
4512
+ if (this._connected) {
4513
+ applyAnimation(el);
4514
+ this.registerObserver(
4515
+ observeIntersection(el, (records, observer) => {
4516
+ applyAnimation(el);
4517
+ observer.disconnect();
4518
+ }));
4519
+
4520
+ }
4521
+ });
4522
+ }
4479
4523
  },
4480
4524
 
4481
4525
  disconnected() {
@@ -4495,18 +4539,6 @@
4495
4539
  this.svg = null;
4496
4540
  },
4497
4541
 
4498
- update: {
4499
- read() {
4500
- return !!(this.strokeAnimation && this.svgEl && isVisible(this.svgEl));
4501
- },
4502
-
4503
- write() {
4504
- applyAnimation(this.svgEl);
4505
- },
4506
-
4507
- type: ['resize'] },
4508
-
4509
-
4510
4542
  methods: {
4511
4543
  async getSvg() {
4512
4544
  if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
@@ -4856,7 +4888,7 @@
4856
4888
 
4857
4889
 
4858
4890
  connected() {
4859
- if (this.loading !== 'lazy' || !hasIntersectionObserver) {
4891
+ if (this.loading !== 'lazy') {
4860
4892
  this.load();
4861
4893
  return;
4862
4894
  }
@@ -5064,16 +5096,31 @@
5064
5096
 
5065
5097
 
5066
5098
  computed: {
5067
- matchMedia() {
5068
- const media = toMedia(this.media);
5069
- return !media || window.matchMedia(media).matches;
5070
- } } };
5099
+ matchMedia() {var _this$mediaObj;
5100
+ return (_this$mediaObj = this.mediaObj) == null ? void 0 : _this$mediaObj.matches;
5101
+ } },
5071
5102
 
5072
5103
 
5104
+ connected() {
5105
+ const media = toMedia(this.media);
5106
+ this.mediaObj = window.matchMedia(media);
5107
+ const handler = () =>
5108
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5109
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5110
+ handler();
5111
+ this.$emit('resize');
5112
+ });
5113
+ handler();
5114
+ },
5115
+
5116
+ disconnected() {var _this$offMediaObj;
5117
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5118
+ } };
5119
+
5073
5120
 
5074
5121
  function toMedia(value) {
5075
5122
  if (isString(value)) {
5076
- if (value[0] === '@') {
5123
+ if (startsWith(value, '@')) {
5077
5124
  const name = "breakpoint-" + value.substr(1);
5078
5125
  value = toFloat(getCssVar(name));
5079
5126
  } else if (isNaN(value)) {
@@ -5081,11 +5128,11 @@
5081
5128
  }
5082
5129
  }
5083
5130
 
5084
- return value && !isNaN(value) ? "(min-width: " + value + "px)" : false;
5131
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5085
5132
  }
5086
5133
 
5087
5134
  var leader = {
5088
- mixins: [Class, Media],
5135
+ mixins: [Class, Media, Resize],
5089
5136
 
5090
5137
  props: {
5091
5138
  fill: String },
@@ -5113,26 +5160,19 @@
5113
5160
  },
5114
5161
 
5115
5162
  update: {
5116
- read(_ref2) {let { changed, width } = _ref2;
5117
- const prev = width;
5118
-
5119
- width = Math.floor(this.$el.offsetWidth / 2);
5163
+ read() {
5164
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5120
5165
 
5121
5166
  return {
5122
5167
  width,
5123
5168
  fill: this.fill,
5124
- changed: changed || prev !== width,
5125
5169
  hide: !this.matchMedia };
5126
5170
 
5127
5171
  },
5128
5172
 
5129
- write(data) {
5130
- toggleClass(this.wrapper, this.clsHide, data.hide);
5131
-
5132
- if (data.changed) {
5133
- data.changed = false;
5134
- attr(this.wrapper, this.attrFill, new Array(data.width).join(data.fill));
5135
- }
5173
+ write(_ref2) {let { width, fill, hide } = _ref2;
5174
+ toggleClass(this.wrapper, this.clsHide, hide);
5175
+ attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5136
5176
  },
5137
5177
 
5138
5178
  events: ['resize'] } };
@@ -6237,7 +6277,7 @@
6237
6277
  }
6238
6278
 
6239
6279
  var overflowAuto = {
6240
- mixins: [Class],
6280
+ mixins: [Class, Resize],
6241
6281
 
6242
6282
  props: {
6243
6283
  selContainer: String,
@@ -6258,6 +6298,10 @@
6258
6298
 
6259
6299
  content(_ref2, $el) {let { selContent } = _ref2;
6260
6300
  return closest($el, selContent);
6301
+ },
6302
+
6303
+ resizeTargets() {
6304
+ return [this.container, this.content];
6261
6305
  } },
6262
6306
 
6263
6307
 
@@ -6272,7 +6316,6 @@
6272
6316
  }
6273
6317
 
6274
6318
  return {
6275
- current: toFloat(css(this.$el, 'maxHeight')),
6276
6319
  max: Math.max(
6277
6320
  this.minHeight,
6278
6321
  height(this.container) - (dimensions(this.content).height - height(this.$el))) };
@@ -6280,11 +6323,8 @@
6280
6323
 
6281
6324
  },
6282
6325
 
6283
- write(_ref3) {let { current, max } = _ref3;
6326
+ write(_ref3) {let { max } = _ref3;
6284
6327
  css(this.$el, 'maxHeight', max);
6285
- if (Math.round(current) !== Math.round(max)) {
6286
- trigger(this.$el, 'resize');
6287
- }
6288
6328
  },
6289
6329
 
6290
6330
  events: ['resize'] } };
@@ -6356,6 +6396,8 @@
6356
6396
 
6357
6397
  const stateKey = '_ukScrollspy';
6358
6398
  var scrollspy = {
6399
+ mixins: [Scroll],
6400
+
6359
6401
  args: 'cls',
6360
6402
 
6361
6403
  props: {
@@ -6468,6 +6510,8 @@
6468
6510
  } } };
6469
6511
 
6470
6512
  var scrollspyNav = {
6513
+ mixins: [Scroll],
6514
+
6471
6515
  props: {
6472
6516
  cls: String,
6473
6517
  closest: String,
@@ -6559,7 +6603,7 @@
6559
6603
  events: ['scroll', 'resize'] }] };
6560
6604
 
6561
6605
  var sticky = {
6562
- mixins: [Class, Media],
6606
+ mixins: [Class, Media, Resize, Scroll],
6563
6607
 
6564
6608
  props: {
6565
6609
  position: String,
@@ -6602,6 +6646,10 @@
6602
6646
  return query(widthElement, $el) || this.placeholder;
6603
6647
  },
6604
6648
 
6649
+ resizeTargets() {
6650
+ return document.documentElement;
6651
+ },
6652
+
6605
6653
  isActive: {
6606
6654
  get() {
6607
6655
  return hasClass(this.selTarget, this.clsActive);
@@ -7268,23 +7316,26 @@
7268
7316
  if (e.target === this.target[0]) {
7269
7317
  this.updateAria(toggled);
7270
7318
  }
7271
- } }],
7319
+ } },
7272
7320
 
7273
7321
 
7322
+ {
7323
+ name: 'mediachange',
7274
7324
 
7275
- update: {
7276
- read() {
7277
- return includes(this.mode, 'media') && this.media ? { match: this.matchMedia } : false;
7325
+ filter() {
7326
+ return includes(this.mode, 'media');
7278
7327
  },
7279
7328
 
7280
- write(_ref2) {let { match } = _ref2;
7281
- const toggled = this.isToggled(this.target);
7282
- if (match ? !toggled : toggled) {
7329
+ el() {
7330
+ return this.target;
7331
+ },
7332
+
7333
+ handler(e, mediaObj) {
7334
+ if (mediaObj.matches ^ this.isToggled(this.target)) {
7283
7335
  this.toggle();
7284
7336
  }
7285
- },
7337
+ } }],
7286
7338
 
7287
- events: ['resize'] },
7288
7339
 
7289
7340
 
7290
7341
  methods: {