uikit 3.12.1 → 3.12.3-dev.3c9ee4dfd

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 (97) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/build/scss.js +9 -17
  3. package/dist/css/uikit-core-rtl.css +15 -81
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +15 -81
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +15 -81
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +15 -81
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +3 -3
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +1 -1
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +13 -2
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +15 -4
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +1 -1
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +65 -8
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +30 -13
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +14 -3
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +30 -13
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +13 -2
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +1 -1
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +12 -20
  34. package/dist/js/components/tooltip.min.js +1 -1
  35. package/dist/js/components/upload.js +1 -1
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +281 -224
  38. package/dist/js/uikit-core.min.js +1 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +296 -237
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/api/hooks.js +3 -3
  45. package/src/js/api/state.js +14 -39
  46. package/src/js/components/countdown.js +2 -2
  47. package/src/js/components/lightbox.js +1 -1
  48. package/src/js/components/parallax.js +3 -1
  49. package/src/js/components/slider-parallax.js +6 -4
  50. package/src/js/components/slider.js +1 -1
  51. package/src/js/core/core.js +2 -17
  52. package/src/js/core/cover.js +3 -6
  53. package/src/js/core/drop.js +5 -10
  54. package/src/js/core/form-custom.js +6 -7
  55. package/src/js/core/gif.js +5 -3
  56. package/src/js/core/grid.js +2 -1
  57. package/src/js/core/height-match.js +21 -1
  58. package/src/js/core/height-viewport.js +10 -7
  59. package/src/js/core/img.js +1 -2
  60. package/src/js/core/leader.js +7 -13
  61. package/src/js/core/margin.js +18 -1
  62. package/src/js/core/overflow-auto.js +8 -7
  63. package/src/js/core/scroll.js +6 -2
  64. package/src/js/core/scrollspy-nav.js +19 -16
  65. package/src/js/core/scrollspy.js +12 -15
  66. package/src/js/core/sticky.js +8 -3
  67. package/src/js/core/svg.js +16 -14
  68. package/src/js/core/toggle.js +16 -13
  69. package/src/js/core/video.js +2 -8
  70. package/src/js/mixin/media.js +29 -5
  71. package/src/js/mixin/position.js +10 -18
  72. package/src/js/mixin/resize.js +13 -0
  73. package/src/js/mixin/scroll.js +32 -0
  74. package/src/js/mixin/slider.js +2 -1
  75. package/src/js/util/class.js +1 -6
  76. package/src/js/util/mouse.js +1 -1
  77. package/src/js/util/observer.js +57 -20
  78. package/src/js/util/style.js +1 -1
  79. package/src/less/components/base.less +0 -19
  80. package/src/less/components/form.less +1 -9
  81. package/src/less/components/icon.less +6 -0
  82. package/src/less/components/list.less +1 -0
  83. package/src/less/components/search.less +0 -3
  84. package/src/less/components/slider.less +3 -0
  85. package/src/less/components/slideshow.less +3 -0
  86. package/src/less/components/utility.less +0 -9
  87. package/src/scss/components/base.scss +0 -19
  88. package/src/scss/components/form.scss +1 -7
  89. package/src/scss/components/icon.scss +6 -0
  90. package/src/scss/components/list.scss +1 -0
  91. package/src/scss/components/search.scss +0 -1
  92. package/src/scss/components/slider.scss +3 -0
  93. package/src/scss/components/slideshow.scss +3 -0
  94. package/src/scss/components/utility.scss +0 -9
  95. package/src/scss/mixins-theme.scss +0 -4
  96. package/src/scss/mixins.scss +0 -4
  97. package/tests/js/index.js +1 -1
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.12.1 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.12.3-dev.3c9ee4dfd | 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() :
@@ -809,7 +809,7 @@
809
809
  // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
810
810
  const propName = memoize((name) => vendorPropName(name));
811
811
 
812
- const cssPrefixes = ['webkit', 'moz', 'ms'];
812
+ const cssPrefixes = ['webkit', 'moz'];
813
813
 
814
814
  function vendorPropName(name) {
815
815
  name = hyphenate(name);
@@ -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) {
@@ -1409,8 +1404,8 @@
1409
1404
  }, 50);
1410
1405
  },
1411
1406
 
1412
- cancel() {
1413
- this.unbind && this.unbind();
1407
+ cancel() {var _this$unbind;
1408
+ (_this$unbind = this.unbind) == null ? void 0 : _this$unbind.call(this);
1414
1409
  this.interval && clearInterval(this.interval);
1415
1410
  },
1416
1411
 
@@ -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.1';
2896
+ UIkit.version = '3.12.3-dev.3c9ee4dfd';
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.$props.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
 
@@ -3964,7 +3943,7 @@
3964
3943
  } },
3965
3944
 
3966
3945
 
3967
- update() {
3946
+ update() {var _input$files;
3968
3947
  const { target, input } = this;
3969
3948
 
3970
3949
  if (!target) {
@@ -3974,8 +3953,7 @@
3974
3953
  let option;
3975
3954
  const prop = isInput(target) ? 'value' : 'textContent';
3976
3955
  const prev = target[prop];
3977
- const value =
3978
- input.files && input.files[0] ?
3956
+ const value = (_input$files = input.files) != null && _input$files[0] ?
3979
3957
  input.files[0].name :
3980
3958
  matches(input, 'select') && (
3981
3959
  option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
@@ -4009,6 +3987,10 @@
4009
3987
 
4010
3988
  // Deprecated
4011
3989
  var gif = {
3990
+ connected() {
3991
+ this.registerObserver(observeIntersection(this.$el, () => this.$emit()));
3992
+ },
3993
+
4012
3994
  update: {
4013
3995
  read(data) {
4014
3996
  const inview = isInView(this.$el);
@@ -4022,9 +4004,7 @@
4022
4004
 
4023
4005
  write() {
4024
4006
  this.$el.src = '' + this.$el.src; // force self-assign
4025
- },
4026
-
4027
- events: ['scroll', 'resize'] } };
4007
+ } } };
4028
4008
 
4029
4009
  var Margin = {
4030
4010
  props: {
@@ -4037,6 +4017,16 @@
4037
4017
  firstColumn: 'uk-first-column' },
4038
4018
 
4039
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
+
4040
4030
  update: {
4041
4031
  read() {
4042
4032
  const rows = getRows(this.$el.children);
@@ -4138,10 +4128,41 @@
4138
4128
 
4139
4129
  }
4140
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
+
4141
4162
  var grid = {
4142
4163
  extends: Margin,
4143
4164
 
4144
- mixins: [Class],
4165
+ mixins: [Class, Scroll],
4145
4166
 
4146
4167
  name: 'grid',
4147
4168
 
@@ -4301,9 +4322,21 @@
4301
4322
  computed: {
4302
4323
  elements(_ref, $el) {let { target } = _ref;
4303
4324
  return $$(target, $el);
4325
+ },
4326
+
4327
+ resizeTargets() {
4328
+ this.$el.children;
4304
4329
  } },
4305
4330
 
4306
4331
 
4332
+ connected() {
4333
+ this.registerObserver(
4334
+ observeMutation(this.$el, () => this.$reset(), {
4335
+ childList: true }));
4336
+
4337
+
4338
+ },
4339
+
4307
4340
  update: {
4308
4341
  read() {
4309
4342
  return {
@@ -4361,7 +4394,7 @@
4361
4394
  }
4362
4395
 
4363
4396
  var heightViewport = {
4364
- mixins: [Class],
4397
+ mixins: [Class, Resize],
4365
4398
 
4366
4399
  props: {
4367
4400
  expand: Boolean,
@@ -4377,6 +4410,13 @@
4377
4410
  minHeight: 0 },
4378
4411
 
4379
4412
 
4413
+ computed: {
4414
+ resizeTargets() {
4415
+ // check for offsetTop change
4416
+ return [this.$el, document.documentElement];
4417
+ } },
4418
+
4419
+
4380
4420
  update: {
4381
4421
  read(_ref) {let { minHeight: prev } = _ref;
4382
4422
  if (!isVisible(this.$el)) {
@@ -4417,13 +4457,9 @@
4417
4457
  return { minHeight, prev };
4418
4458
  },
4419
4459
 
4420
- write(_ref2) {let { minHeight, prev } = _ref2;
4460
+ write(_ref2) {let { minHeight } = _ref2;
4421
4461
  css(this.$el, { minHeight });
4422
4462
 
4423
- if (minHeight !== prev) {
4424
- trigger(this.$el, 'resize');
4425
- }
4426
-
4427
4463
  if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
4428
4464
  css(this.$el, 'minHeight', this.minHeight);
4429
4465
  }
@@ -4473,10 +4509,24 @@
4473
4509
  }
4474
4510
 
4475
4511
  this.applyAttributes(svg, el);
4476
- this.$emit();
4512
+
4477
4513
  return this.svgEl = svg;
4478
4514
  }
4479
4515
  }, noop);
4516
+
4517
+ if (this.strokeAnimation) {
4518
+ this.svg.then((el) => {
4519
+ if (this._connected) {
4520
+ applyAnimation(el);
4521
+ this.registerObserver(
4522
+ observeIntersection(el, (records, observer) => {
4523
+ applyAnimation(el);
4524
+ observer.disconnect();
4525
+ }));
4526
+
4527
+ }
4528
+ });
4529
+ }
4480
4530
  },
4481
4531
 
4482
4532
  disconnected() {
@@ -4496,18 +4546,6 @@
4496
4546
  this.svg = null;
4497
4547
  },
4498
4548
 
4499
- update: {
4500
- read() {
4501
- return !!(this.strokeAnimation && this.svgEl && isVisible(this.svgEl));
4502
- },
4503
-
4504
- write() {
4505
- applyAnimation(this.svgEl);
4506
- },
4507
-
4508
- type: ['resize'] },
4509
-
4510
-
4511
4549
  methods: {
4512
4550
  async getSvg() {
4513
4551
  if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
@@ -4857,7 +4895,7 @@
4857
4895
 
4858
4896
 
4859
4897
  connected() {
4860
- if (this.loading !== 'lazy' || !hasIntersectionObserver) {
4898
+ if (this.loading !== 'lazy') {
4861
4899
  this.load();
4862
4900
  return;
4863
4901
  }
@@ -5065,16 +5103,31 @@
5065
5103
 
5066
5104
 
5067
5105
  computed: {
5068
- matchMedia() {
5069
- const media = toMedia(this.media);
5070
- return !media || window.matchMedia(media).matches;
5071
- } } };
5106
+ matchMedia() {var _this$mediaObj;
5107
+ return (_this$mediaObj = this.mediaObj) == null ? void 0 : _this$mediaObj.matches;
5108
+ } },
5109
+
5110
+
5111
+ connected() {
5112
+ const media = toMedia(this.media);
5113
+ this.mediaObj = window.matchMedia(media);
5114
+ const handler = () =>
5115
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5116
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5117
+ handler();
5118
+ this.$emit('resize');
5119
+ });
5120
+ handler();
5121
+ },
5072
5122
 
5123
+ disconnected() {var _this$offMediaObj;
5124
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5125
+ } };
5073
5126
 
5074
5127
 
5075
5128
  function toMedia(value) {
5076
5129
  if (isString(value)) {
5077
- if (value[0] === '@') {
5130
+ if (startsWith(value, '@')) {
5078
5131
  const name = "breakpoint-" + value.substr(1);
5079
5132
  value = toFloat(getCssVar(name));
5080
5133
  } else if (isNaN(value)) {
@@ -5082,11 +5135,11 @@
5082
5135
  }
5083
5136
  }
5084
5137
 
5085
- return value && !isNaN(value) ? "(min-width: " + value + "px)" : false;
5138
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5086
5139
  }
5087
5140
 
5088
5141
  var leader = {
5089
- mixins: [Class, Media],
5142
+ mixins: [Class, Media, Resize],
5090
5143
 
5091
5144
  props: {
5092
5145
  fill: String },
@@ -5114,26 +5167,19 @@
5114
5167
  },
5115
5168
 
5116
5169
  update: {
5117
- read(_ref2) {let { changed, width } = _ref2;
5118
- const prev = width;
5119
-
5120
- width = Math.floor(this.$el.offsetWidth / 2);
5170
+ read() {
5171
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5121
5172
 
5122
5173
  return {
5123
5174
  width,
5124
5175
  fill: this.fill,
5125
- changed: changed || prev !== width,
5126
5176
  hide: !this.matchMedia };
5127
5177
 
5128
5178
  },
5129
5179
 
5130
- write(data) {
5131
- toggleClass(this.wrapper, this.clsHide, data.hide);
5132
-
5133
- if (data.changed) {
5134
- data.changed = false;
5135
- attr(this.wrapper, this.attrFill, new Array(data.width).join(data.fill));
5136
- }
5180
+ write(_ref2) {let { width, fill, hide } = _ref2;
5181
+ toggleClass(this.wrapper, this.clsHide, hide);
5182
+ attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5137
5183
  },
5138
5184
 
5139
5185
  events: ['resize'] } };
@@ -6238,7 +6284,7 @@
6238
6284
  }
6239
6285
 
6240
6286
  var overflowAuto = {
6241
- mixins: [Class],
6287
+ mixins: [Class, Resize],
6242
6288
 
6243
6289
  props: {
6244
6290
  selContainer: String,
@@ -6259,6 +6305,10 @@
6259
6305
 
6260
6306
  content(_ref2, $el) {let { selContent } = _ref2;
6261
6307
  return closest($el, selContent);
6308
+ },
6309
+
6310
+ resizeTargets() {
6311
+ return [this.container, this.content];
6262
6312
  } },
6263
6313
 
6264
6314
 
@@ -6273,7 +6323,6 @@
6273
6323
  }
6274
6324
 
6275
6325
  return {
6276
- current: toFloat(css(this.$el, 'maxHeight')),
6277
6326
  max: Math.max(
6278
6327
  this.minHeight,
6279
6328
  height(this.container) - (dimensions$1(this.content).height - height(this.$el))) };
@@ -6281,11 +6330,8 @@
6281
6330
 
6282
6331
  },
6283
6332
 
6284
- write(_ref3) {let { current, max } = _ref3;
6333
+ write(_ref3) {let { max } = _ref3;
6285
6334
  css(this.$el, 'maxHeight', max);
6286
- if (Math.round(current) !== Math.round(max)) {
6287
- trigger(this.$el, 'resize');
6288
- }
6289
6335
  },
6290
6336
 
6291
6337
  events: ['resize'] } };
@@ -6346,11 +6392,19 @@
6346
6392
  }
6347
6393
 
6348
6394
  e.preventDefault();
6349
- this.scrollTo("#" + escape(decodeURIComponent((this.$el.hash || '').substr(1))));
6395
+ this.scrollTo(getTargetElement(this.$el));
6350
6396
  } } };
6351
6397
 
6398
+
6399
+
6400
+ function getTargetElement(el) {
6401
+ return document.getElementById(decodeURIComponent(el.hash).substring(1));
6402
+ }
6403
+
6352
6404
  const stateKey = '_ukScrollspy';
6353
6405
  var scrollspy = {
6406
+ mixins: [Scroll],
6407
+
6354
6408
  args: 'cls',
6355
6409
 
6356
6410
  props: {
@@ -6391,24 +6445,15 @@
6391
6445
 
6392
6446
 
6393
6447
  disconnected() {
6394
- for (const el of this.elements) {
6395
- removeClass(el, this.inViewClass, el[stateKey] ? el[stateKey].cls : '');
6448
+ for (const el of this.elements) {var _el$stateKey;
6449
+ removeClass(el, this.inViewClass, ((_el$stateKey = el[stateKey]) == null ? void 0 : _el$stateKey.cls) || '');
6396
6450
  delete el[stateKey];
6397
6451
  }
6398
6452
  },
6399
6453
 
6400
6454
  update: [
6401
6455
  {
6402
- read(data$1) {
6403
- // Let child components be applied at least once first
6404
- if (!data$1.update) {
6405
- Promise.resolve().then(() => {
6406
- this.$emit();
6407
- data$1.update = true;
6408
- });
6409
- return false;
6410
- }
6411
-
6456
+ read() {
6412
6457
  for (const el of this.elements) {
6413
6458
  if (!el[stateKey]) {
6414
6459
  el[stateKey] = { cls: data(el, 'uk-scrollspy-class') || this.cls };
@@ -6448,7 +6493,7 @@
6448
6493
  toggle(el, inview) {
6449
6494
  const state = el[stateKey];
6450
6495
 
6451
- state.off && state.off();
6496
+ state.off == null ? void 0 : state.off();
6452
6497
 
6453
6498
  css(el, 'visibility', !inview && this.hidden ? 'hidden' : '');
6454
6499
 
@@ -6456,9 +6501,12 @@
6456
6501
  toggleClass(el, state.cls);
6457
6502
 
6458
6503
  if (/\buk-animation-/.test(state.cls)) {
6459
- state.off = once(el, 'animationcancel animationend', () =>
6460
- removeClasses(el, 'uk-animation-[\\w-]+'));
6461
-
6504
+ const removeAnimationClasses = () => removeClasses(el, 'uk-animation-[\\w-]+');
6505
+ if (inview) {
6506
+ state.off = once(el, 'animationcancel animationend', removeAnimationClasses);
6507
+ } else {
6508
+ removeAnimationClasses();
6509
+ }
6462
6510
  }
6463
6511
 
6464
6512
  trigger(el, inview ? 'inview' : 'outview');
@@ -6469,6 +6517,8 @@
6469
6517
  } } };
6470
6518
 
6471
6519
  var scrollspyNav = {
6520
+ mixins: [Scroll],
6521
+
6472
6522
  props: {
6473
6523
  cls: String,
6474
6524
  closest: String,
@@ -6500,10 +6550,6 @@
6500
6550
  immediate: true },
6501
6551
 
6502
6552
 
6503
- targets() {
6504
- return $$(this.links.map((el) => escape(el.hash).substr(1)).join(','));
6505
- },
6506
-
6507
6553
  elements(_ref) {let { closest: selector } = _ref;
6508
6554
  return closest(this.links, selector || '*');
6509
6555
  } },
@@ -6512,13 +6558,15 @@
6512
6558
  update: [
6513
6559
  {
6514
6560
  read() {
6515
- const { length } = this.targets;
6561
+ const targets = this.links.map(getTargetElement).filter(Boolean);
6562
+
6563
+ const { length } = targets;
6516
6564
 
6517
6565
  if (!length || !isVisible(this.$el)) {
6518
6566
  return false;
6519
6567
  }
6520
6568
 
6521
- const [scrollElement] = scrollParents(this.targets, /auto|scroll/, true);
6569
+ const [scrollElement] = scrollParents(targets, /auto|scroll/, true);
6522
6570
  const { scrollTop, scrollHeight } = scrollElement;
6523
6571
  const max = scrollHeight - getViewportClientHeight(scrollElement);
6524
6572
  let active = false;
@@ -6526,15 +6574,17 @@
6526
6574
  if (scrollTop === max) {
6527
6575
  active = length - 1;
6528
6576
  } else {
6529
- this.targets.every((el, i) => {
6577
+ for (const i in targets) {
6530
6578
  if (
6531
- offset(el).top - offset(getViewport$1(scrollElement)).top - this.offset <=
6579
+ offset(targets[i]).top -
6580
+ offset(getViewport$1(scrollElement)).top -
6581
+ this.offset >
6532
6582
  0)
6533
6583
  {
6534
- active = i;
6535
- return true;
6584
+ break;
6536
6585
  }
6537
- });
6586
+ active = +i;
6587
+ }
6538
6588
 
6539
6589
  if (active === false && this.overflow) {
6540
6590
  active = 0;
@@ -6548,8 +6598,9 @@
6548
6598
  const changed = active !== false && !hasClass(this.elements[active], this.cls);
6549
6599
 
6550
6600
  this.links.forEach((el) => el.blur());
6551
- removeClass(this.elements, this.cls);
6552
- addClass(this.elements[active], this.cls);
6601
+ for (const i in this.elements) {
6602
+ toggleClass(this.elements[i], this.cls, +i === active);
6603
+ }
6553
6604
 
6554
6605
  if (changed) {
6555
6606
  trigger(this.$el, 'active', [active, this.elements[active]]);
@@ -6559,7 +6610,7 @@
6559
6610
  events: ['scroll', 'resize'] }] };
6560
6611
 
6561
6612
  var sticky = {
6562
- mixins: [Class, Media],
6613
+ mixins: [Class, Media, Resize, Scroll],
6563
6614
 
6564
6615
  props: {
6565
6616
  position: String,
@@ -6602,6 +6653,10 @@
6602
6653
  return query(widthElement, $el) || this.placeholder;
6603
6654
  },
6604
6655
 
6656
+ resizeTargets() {
6657
+ return document.documentElement;
6658
+ },
6659
+
6605
6660
  isActive: {
6606
6661
  get() {
6607
6662
  return hasClass(this.selTarget, this.clsActive);
@@ -6713,7 +6768,6 @@
6713
6768
 
6714
6769
  const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
6715
6770
  const topOffset = offset(referenceElement).top;
6716
- const offsetParentTop = offset(referenceElement.offsetParent).top;
6717
6771
 
6718
6772
  const top = parseProp(this.top, this.$el, topOffset);
6719
6773
  const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
@@ -6729,7 +6783,6 @@
6729
6783
  offset: offset$1,
6730
6784
  overflow,
6731
6785
  topOffset,
6732
- offsetParentTop,
6733
6786
  height: height$1,
6734
6787
  margin,
6735
6788
  width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).
@@ -6771,6 +6824,7 @@
6771
6824
  prevDir,
6772
6825
  scroll,
6773
6826
  prevScroll,
6827
+ offsetParentTop: offset(this.$el.offsetParent).top,
6774
6828
  overflowScroll: clamp(
6775
6829
  overflowScroll + clamp(scroll, start, end) - clamp(prevScroll, start, end),
6776
6830
  0,
@@ -7269,23 +7323,26 @@
7269
7323
  if (e.target === this.target[0]) {
7270
7324
  this.updateAria(toggled);
7271
7325
  }
7272
- } }],
7326
+ } },
7273
7327
 
7274
7328
 
7329
+ {
7330
+ name: 'mediachange',
7275
7331
 
7276
- update: {
7277
- read() {
7278
- return includes(this.mode, 'media') && this.media ? { match: this.matchMedia } : false;
7332
+ filter() {
7333
+ return includes(this.mode, 'media');
7279
7334
  },
7280
7335
 
7281
- write(_ref2) {let { match } = _ref2;
7282
- const toggled = this.isToggled(this.target);
7283
- if (match ? !toggled : toggled) {
7336
+ el() {
7337
+ return this.target;
7338
+ },
7339
+
7340
+ handler(e, mediaObj) {
7341
+ if (mediaObj.matches ^ this.isToggled(this.target)) {
7284
7342
  this.toggle();
7285
7343
  }
7286
- },
7344
+ } }],
7287
7345
 
7288
- events: ['resize'] },
7289
7346
 
7290
7347
 
7291
7348
  methods: {
@@ -7396,7 +7453,7 @@
7396
7453
 
7397
7454
 
7398
7455
  connected() {
7399
- this.date = Date.parse(this.date);
7456
+ this.date = Date.parse(this.$props.date);
7400
7457
  this.start();
7401
7458
  },
7402
7459
 
@@ -7449,7 +7506,7 @@
7449
7506
  continue;
7450
7507
  }
7451
7508
 
7452
- let digits = String(Math.floor(timespan[unit]));
7509
+ let digits = String(Math.trunc(timespan[unit]));
7453
7510
 
7454
7511
  digits = digits.length < 2 ? "0" + digits : digits;
7455
7512
 
@@ -8437,7 +8494,7 @@
8437
8494
  } } };
8438
8495
 
8439
8496
  var Slider = {
8440
- mixins: [SliderAutoplay, SliderDrag, SliderNav],
8497
+ mixins: [SliderAutoplay, SliderDrag, SliderNav, Resize],
8441
8498
 
8442
8499
  props: {
8443
8500
  clsActivated: Boolean,
@@ -9061,8 +9118,8 @@
9061
9118
  return this.panel.show(index);
9062
9119
  },
9063
9120
 
9064
- hide() {
9065
- return this.panel && this.panel.hide();
9121
+ hide() {var _this$panel;
9122
+ return (_this$panel = this.panel) == null ? void 0 : _this$panel.hide();
9066
9123
  } } };
9067
9124
 
9068
9125
 
@@ -9544,7 +9601,7 @@
9544
9601
  }
9545
9602
 
9546
9603
  var parallax = {
9547
- mixins: [Parallax],
9604
+ mixins: [Parallax, Resize, Scroll],
9548
9605
 
9549
9606
  props: {
9550
9607
  target: String,
@@ -9837,7 +9894,7 @@
9837
9894
  return (
9838
9895
  finite ||
9839
9896
  Math.ceil(getWidth(this.list)) <
9840
- Math.floor(dimensions$1(this.list).width + getMaxElWidth(this.list) + this.center));
9897
+ Math.trunc(dimensions$1(this.list).width + getMaxElWidth(this.list) + this.center));
9841
9898
 
9842
9899
  },
9843
9900
 
@@ -10081,11 +10138,13 @@
10081
10138
  selItem: '!li' },
10082
10139
 
10083
10140
 
10084
- computed: {
10085
- item(_ref, $el) {let { selItem } = _ref;
10086
- return query(selItem, $el);
10087
- } },
10141
+ connected() {
10142
+ this.item = query(this.selItem, this.$el);
10143
+ },
10088
10144
 
10145
+ disconnected() {
10146
+ this.item = null;
10147
+ },
10089
10148
 
10090
10149
  events: [
10091
10150
  {
@@ -10097,7 +10156,7 @@
10097
10156
  return this.item;
10098
10157
  },
10099
10158
 
10100
- handler(_ref2) {let { type, detail: { percent, duration, timing, dir } } = _ref2;
10159
+ handler(_ref) {let { type, detail: { percent, duration, timing, dir } } = _ref;
10101
10160
  fastdom.read(() => {
10102
10161
  const propsFrom = this.getCss(getCurrentPercent(type, dir, percent));
10103
10162
  const propsTo = this.getCss(isIn(type) ? 0.5 : dir > 0 ? 1 : 0);
@@ -10132,7 +10191,7 @@
10132
10191
  return this.item;
10133
10192
  },
10134
10193
 
10135
- handler(_ref3) {let { type, detail: { percent, dir } } = _ref3;
10194
+ handler(_ref2) {let { type, detail: { percent, dir } } = _ref2;
10136
10195
  fastdom.read(() => {
10137
10196
  const props = this.getCss(getCurrentPercent(type, dir, percent));
10138
10197
  fastdom.write(() => css(this.$el, props));