uikit 3.16.11-dev.bde560a72 → 3.16.11-dev.cc1aeb568

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 (75) hide show
  1. package/CHANGELOG.md +1 -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 +24 -28
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +85 -562
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +96 -574
  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 +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +79 -72
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +79 -72
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +14 -18
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  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 +309 -336
  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 +435 -464
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/computed.js +48 -1
  44. package/src/js/api/hooks.js +12 -8
  45. package/src/js/api/observer.js +23 -41
  46. package/src/js/api/options.js +1 -0
  47. package/src/js/api/update.js +21 -37
  48. package/src/js/api/watch.js +21 -24
  49. package/src/js/components/filter.js +23 -29
  50. package/src/js/components/lightbox.js +12 -14
  51. package/src/js/components/sortable.js +13 -19
  52. package/src/js/core/accordion.js +32 -45
  53. package/src/js/core/drop.js +1 -1
  54. package/src/js/core/dropnav.js +46 -60
  55. package/src/js/core/height-match.js +2 -8
  56. package/src/js/core/img.js +6 -5
  57. package/src/js/core/navbar.js +19 -32
  58. package/src/js/core/scrollspy-nav.js +10 -12
  59. package/src/js/core/scrollspy.js +16 -17
  60. package/src/js/core/switcher.js +29 -40
  61. package/src/js/core/toggle.js +3 -7
  62. package/src/js/{util → mixin/internal}/scroll.js +1 -5
  63. package/src/js/mixin/modal.js +1 -1
  64. package/src/js/mixin/slider-nav.js +80 -76
  65. package/src/js/mixin/slider.js +10 -8
  66. package/src/js/util/fastdom.js +2 -2
  67. package/tests/drop.html +0 -1
  68. package/tests/dropnav.html +1 -1
  69. package/tests/icon.html +0 -2
  70. package/tests/modal.html +0 -1
  71. package/tests/nav.html +0 -1
  72. package/tests/navbar.html +0 -1
  73. package/tests/progress.html +0 -1
  74. package/tests/scroll.html +0 -1
  75. package/tests/sticky-navbar.html +6 -6
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.16.11-dev.bde560a72 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
1
+ /*! UIkit 3.16.11-dev.cc1aeb568 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -959,8 +959,8 @@
959
959
  const fastdom = {
960
960
  reads: [],
961
961
  writes: [],
962
- read(task, prepend) {
963
- this.reads[prepend ? "unshift" : "push"](task);
962
+ read(task) {
963
+ this.reads.push(task);
964
964
  scheduleFlush();
965
965
  return task;
966
966
  },
@@ -1666,114 +1666,60 @@
1666
1666
  wrapInner: wrapInner
1667
1667
  });
1668
1668
 
1669
- function initObservers(instance) {
1670
- instance._observers = [];
1671
- instance._observerUpdates = /* @__PURE__ */ new Map();
1672
- for (const observer of instance.$options.observe || []) {
1673
- if (hasOwn(observer, "handler")) {
1674
- registerObservable(instance, observer);
1675
- } else {
1676
- for (const key in observer) {
1677
- registerObservable(instance, observer[key], key);
1678
- }
1669
+ function initWatches(instance) {
1670
+ instance._watches = [];
1671
+ for (const watches of instance.$options.watch || []) {
1672
+ for (const [name, watch] of Object.entries(watches)) {
1673
+ registerWatch(instance, watch, name);
1679
1674
  }
1680
1675
  }
1676
+ instance._initial = true;
1681
1677
  }
1682
- function registerObserver(instance, ...observer) {
1683
- instance._observers.push(...observer);
1684
- }
1685
- function disconnectObservers(instance) {
1686
- for (const observer of instance._observers) {
1687
- observer == null ? void 0 : observer.disconnect();
1688
- instance._observerUpdates.delete(observer);
1689
- }
1690
- }
1691
- function callObserverUpdates(instance) {
1692
- for (const [observer, update] of instance._observerUpdates) {
1693
- update(observer);
1694
- }
1695
- }
1696
- function registerObservable(instance, observable, key) {
1697
- let {
1698
- observe,
1699
- target = instance.$el,
1700
- handler,
1701
- options,
1702
- filter,
1703
- args
1704
- } = isPlainObject(observable) ? observable : { type: key, handler: observable };
1705
- if (filter && !filter.call(instance, instance)) {
1706
- return;
1707
- }
1708
- const targets = isFunction(target) ? target.call(instance, instance) : target;
1709
- handler = isString(handler) ? instance[handler] : handler.bind(instance);
1710
- if (isFunction(options)) {
1711
- options = options.call(instance, instance);
1712
- }
1713
- const observer = observe(targets, handler, options, args);
1714
- if (isFunction(target) && isArray(targets) && observer.unobserve) {
1715
- instance._observerUpdates.set(observer, watchChange(instance, target, targets));
1716
- }
1717
- registerObserver(instance, observer);
1678
+ function registerWatch(instance, watch, name) {
1679
+ instance._watches.push({
1680
+ name,
1681
+ ...isPlainObject(watch) ? watch : { handler: watch }
1682
+ });
1718
1683
  }
1719
- function watchChange(instance, targetFn, targets) {
1720
- return (observer) => {
1721
- const newTargets = targetFn.call(instance, instance);
1722
- if (isEqual(targets, newTargets)) {
1723
- return;
1684
+ function runWatches(instance, values) {
1685
+ for (const { name, handler, immediate = true } of instance._watches) {
1686
+ if (instance._initial ? immediate : hasOwn(values, name) && !isEqual(values[name], instance[name])) {
1687
+ handler.call(instance, instance[name], instance._initial ? void 0 : values[name]);
1724
1688
  }
1725
- targets.forEach((target) => !includes(newTargets, target) && observer.unobserve(target));
1726
- newTargets.forEach((target) => !includes(targets, target) && observer.observe(target));
1727
- targets.splice(0, targets.length, ...newTargets);
1728
- };
1689
+ }
1690
+ instance._initial = false;
1729
1691
  }
1730
1692
 
1731
- function callWatches(instance) {
1732
- if (instance._watch) {
1733
- return;
1734
- }
1735
- const initial = !hasOwn(instance, "_watch");
1736
- instance._watch = fastdom.read(() => {
1737
- if (instance._connected) {
1738
- runWatches(instance, initial);
1739
- }
1740
- instance._watch = null;
1741
- }, true);
1693
+ function initUpdates(instance) {
1694
+ instance._data = {};
1695
+ instance._updates = [...instance.$options.update || []];
1742
1696
  }
1743
- function runWatches(instance, initial) {
1744
- const values = { ...instance._computed };
1745
- instance._computed = {};
1746
- for (const [key, { watch, immediate }] of Object.entries(instance.$options.computed || {})) {
1747
- if (watch && (initial && immediate || hasOwn(values, key) && !isEqual(values[key], instance[key]))) {
1748
- watch.call(instance, instance[key], initial ? void 0 : values[key]);
1749
- }
1750
- }
1751
- callObserverUpdates(instance);
1697
+ function prependUpdate(instance, update) {
1698
+ instance._updates.unshift(update);
1699
+ }
1700
+ function clearUpdateData(instance) {
1701
+ delete instance._data;
1752
1702
  }
1753
-
1754
1703
  function callUpdate(instance, e = "update") {
1755
1704
  if (!instance._connected) {
1756
1705
  return;
1757
1706
  }
1758
- if (e === "update" || e === "resize") {
1759
- callWatches(instance);
1760
- }
1761
- if (!instance.$options.update) {
1707
+ if (!instance._updates.length) {
1762
1708
  return;
1763
1709
  }
1764
- if (!instance._updates) {
1765
- instance._updates = /* @__PURE__ */ new Set();
1710
+ if (!instance._queued) {
1711
+ instance._queued = /* @__PURE__ */ new Set();
1766
1712
  fastdom.read(() => {
1767
1713
  if (instance._connected) {
1768
- runUpdates(instance, instance._updates);
1714
+ runUpdates(instance, instance._queued);
1769
1715
  }
1770
- delete instance._updates;
1716
+ delete instance._queued;
1771
1717
  });
1772
1718
  }
1773
- instance._updates.add(e.type || e);
1719
+ instance._queued.add(e.type || e);
1774
1720
  }
1775
1721
  function runUpdates(instance, types) {
1776
- for (const { read, write, events = [] } of instance.$options.update) {
1722
+ for (const { read, write, events = [] } of instance._updates) {
1777
1723
  if (!types.has("update") && !events.some((type) => types.has(type))) {
1778
1724
  continue;
1779
1725
  }
@@ -1793,23 +1739,72 @@
1793
1739
  }
1794
1740
  }
1795
1741
  }
1796
- function initUpdateObserver(instance) {
1797
- let { el, computed, observe } = instance.$options;
1798
- if (!computed && !(observe == null ? void 0 : observe.some((options) => isFunction(options.target)))) {
1799
- return;
1742
+
1743
+ function initComputed(instance) {
1744
+ const { computed } = instance.$options;
1745
+ instance._computed = {};
1746
+ if (computed) {
1747
+ for (const key in computed) {
1748
+ registerComputed(instance, key, computed[key]);
1749
+ }
1800
1750
  }
1801
- for (const key in computed || {}) {
1802
- if (computed[key].document) {
1803
- el = el.ownerDocument;
1804
- break;
1751
+ }
1752
+ function registerComputed(instance, key, cb) {
1753
+ instance._hasComputed = true;
1754
+ Object.defineProperty(instance, key, {
1755
+ enumerable: true,
1756
+ get() {
1757
+ const { _computed, $props, $el } = instance;
1758
+ if (!hasOwn(_computed, key)) {
1759
+ _computed[key] = (cb.get || cb).call(instance, $props, $el);
1760
+ }
1761
+ return _computed[key];
1762
+ },
1763
+ set(value) {
1764
+ const { _computed } = instance;
1765
+ _computed[key] = cb.set ? cb.set.call(instance, value) : value;
1766
+ if (isUndefined(_computed[key])) {
1767
+ delete _computed[key];
1768
+ }
1805
1769
  }
1770
+ });
1771
+ }
1772
+ function initComputedUpdates(instance) {
1773
+ if (!instance._hasComputed) {
1774
+ return;
1806
1775
  }
1807
- const observer = new MutationObserver(() => callWatches(instance));
1808
- observer.observe(el, {
1776
+ prependUpdate(instance, {
1777
+ read: () => runWatches(instance, resetComputed(instance)),
1778
+ events: ["resize", "computed"]
1779
+ });
1780
+ registerComputedObserver();
1781
+ instances$1.add(instance);
1782
+ }
1783
+ function disconnectComputedUpdates(instance) {
1784
+ instances$1 == null ? void 0 : instances$1.delete(instance);
1785
+ resetComputed(instance);
1786
+ }
1787
+ function resetComputed(instance) {
1788
+ const values = { ...instance._computed };
1789
+ instance._computed = {};
1790
+ return values;
1791
+ }
1792
+ let observer;
1793
+ let instances$1;
1794
+ function registerComputedObserver() {
1795
+ if (observer) {
1796
+ return;
1797
+ }
1798
+ instances$1 = /* @__PURE__ */ new Set();
1799
+ observer = new MutationObserver(() => {
1800
+ for (const instance of instances$1) {
1801
+ callUpdate(instance, "computed");
1802
+ }
1803
+ });
1804
+ observer.observe(document, {
1809
1805
  childList: true,
1810
1806
  subtree: true
1811
1807
  });
1812
- registerObserver(instance, observer);
1813
1808
  }
1814
1809
 
1815
1810
  function initEvents(instance) {
@@ -1849,8 +1844,59 @@
1849
1844
  );
1850
1845
  }
1851
1846
 
1847
+ function initObservers(instance) {
1848
+ instance._observers = [];
1849
+ for (const observer of instance.$options.observe || []) {
1850
+ if (hasOwn(observer, "handler")) {
1851
+ registerObservable(instance, observer);
1852
+ } else {
1853
+ for (const observable of observer) {
1854
+ registerObservable(instance, observable);
1855
+ }
1856
+ }
1857
+ }
1858
+ }
1859
+ function registerObserver(instance, ...observer) {
1860
+ instance._observers.push(...observer);
1861
+ }
1862
+ function disconnectObservers(instance) {
1863
+ for (const observer of instance._observers) {
1864
+ observer.disconnect();
1865
+ }
1866
+ }
1867
+ function registerObservable(instance, observable) {
1868
+ let { observe, target = instance.$el, handler, options, filter, args } = observable;
1869
+ if (filter && !filter.call(instance, instance)) {
1870
+ return;
1871
+ }
1872
+ const key = `_observe${instance._observers.length}`;
1873
+ if (isFunction(target) && !hasOwn(instance, key)) {
1874
+ registerComputed(instance, key, () => target.call(instance, instance));
1875
+ }
1876
+ handler = isString(handler) ? instance[handler] : handler.bind(instance);
1877
+ if (isFunction(options)) {
1878
+ options = options.call(instance, instance);
1879
+ }
1880
+ const targets = hasOwn(instance, key) ? instance[key] : target;
1881
+ const observer = observe(targets, handler, options, args);
1882
+ if (isFunction(target) && isArray(instance[key]) && observer.unobserve) {
1883
+ registerWatch(instance, { handler: updateTargets(observer), immediate: false }, key);
1884
+ }
1885
+ registerObserver(instance, observer);
1886
+ }
1887
+ function updateTargets(observer) {
1888
+ return (targets, prev) => {
1889
+ for (const target of prev) {
1890
+ !includes(targets, target) && observer.unobserve(target);
1891
+ }
1892
+ for (const target of targets) {
1893
+ !includes(prev, target) && observer.observe(target);
1894
+ }
1895
+ };
1896
+ }
1897
+
1852
1898
  const strats = {};
1853
- strats.events = strats.observe = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;
1899
+ strats.events = strats.watch = strats.observe = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;
1854
1900
  strats.args = function(parentVal, childVal) {
1855
1901
  return childVal !== false && concatStrat(childVal || parentVal);
1856
1902
  };
@@ -2033,15 +2079,15 @@
2033
2079
  if (instance._connected) {
2034
2080
  return;
2035
2081
  }
2036
- instance._data = {};
2037
- instance._computed = {};
2038
2082
  initProps(instance);
2039
2083
  callHook(instance, "beforeConnect");
2040
2084
  instance._connected = true;
2041
2085
  initEvents(instance);
2086
+ initUpdates(instance);
2087
+ initWatches(instance);
2042
2088
  initObservers(instance);
2043
2089
  initPropsObserver(instance);
2044
- initUpdateObserver(instance);
2090
+ initComputedUpdates(instance);
2045
2091
  callHook(instance, "connected");
2046
2092
  callUpdate(instance);
2047
2093
  }
@@ -2050,40 +2096,12 @@
2050
2096
  return;
2051
2097
  }
2052
2098
  callHook(instance, "beforeDisconnect");
2053
- disconnectObservers(instance);
2054
2099
  unbindEvents(instance);
2100
+ clearUpdateData(instance);
2101
+ disconnectObservers(instance);
2102
+ disconnectComputedUpdates(instance);
2055
2103
  callHook(instance, "disconnected");
2056
2104
  instance._connected = false;
2057
- delete instance._watch;
2058
- }
2059
-
2060
- function initComputed(instance) {
2061
- const { computed } = instance.$options;
2062
- instance._computed = {};
2063
- if (computed) {
2064
- for (const key in computed) {
2065
- registerComputed(instance, key, computed[key]);
2066
- }
2067
- }
2068
- }
2069
- function registerComputed(instance, key, cb) {
2070
- Object.defineProperty(instance, key, {
2071
- enumerable: true,
2072
- get() {
2073
- const { _computed, $props, $el } = instance;
2074
- if (!hasOwn(_computed, key)) {
2075
- _computed[key] = (cb.get || cb).call(instance, $props, $el);
2076
- }
2077
- return _computed[key];
2078
- },
2079
- set(value) {
2080
- const { _computed } = instance;
2081
- _computed[key] = cb.set ? cb.set.call(instance, value) : value;
2082
- if (isUndefined(_computed[key])) {
2083
- delete _computed[key];
2084
- }
2085
- }
2086
- });
2087
2105
  }
2088
2106
 
2089
2107
  let uid = 0;
@@ -2140,7 +2158,7 @@
2140
2158
  };
2141
2159
  App.util = util;
2142
2160
  App.options = {};
2143
- App.version = "3.16.11-dev.bde560a72";
2161
+ App.version = "3.16.11-dev.cc1aeb568";
2144
2162
 
2145
2163
  const PREFIX = "uk-";
2146
2164
  const DATA = "__uikit__";
@@ -2686,52 +2704,41 @@
2686
2704
  offset: 0
2687
2705
  },
2688
2706
  computed: {
2689
- items: {
2690
- get({ targets }, $el) {
2691
- return $$(targets, $el);
2692
- },
2693
- watch(items, prev) {
2694
- if (prev || hasClass(items, this.clsOpen)) {
2695
- return;
2696
- }
2697
- const active = this.active !== false && items[Number(this.active)] || !this.collapsible && items[0];
2698
- if (active) {
2699
- this.toggle(active, false);
2700
- }
2701
- },
2702
- immediate: true
2707
+ items({ targets }, $el) {
2708
+ return $$(targets, $el);
2703
2709
  },
2704
- toggles: {
2705
- get({ toggle }) {
2706
- return this.items.map((item) => $(toggle, item));
2707
- },
2708
- watch() {
2709
- this.$emit();
2710
- },
2711
- immediate: true
2712
- },
2713
- contents: {
2714
- get({ content }) {
2715
- return this.items.map(
2716
- (item) => {
2717
- var _a;
2718
- return ((_a = item._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, item);
2719
- }
2710
+ toggles({ toggle }) {
2711
+ return this.items.map((item) => $(toggle, item));
2712
+ },
2713
+ contents({ content }) {
2714
+ return this.items.map((item) => {
2715
+ var _a;
2716
+ return ((_a = item._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, item);
2717
+ });
2718
+ }
2719
+ },
2720
+ watch: {
2721
+ items(items, prev) {
2722
+ if (prev || hasClass(items, this.clsOpen)) {
2723
+ return;
2724
+ }
2725
+ const active = this.active !== false && items[Number(this.active)] || !this.collapsible && items[0];
2726
+ if (active) {
2727
+ this.toggle(active, false);
2728
+ }
2729
+ },
2730
+ toggles() {
2731
+ this.$emit();
2732
+ },
2733
+ contents(items) {
2734
+ for (const el of items) {
2735
+ const isOpen = hasClass(
2736
+ this.items.find((item) => within(el, item)),
2737
+ this.clsOpen
2720
2738
  );
2721
- },
2722
- watch(items) {
2723
- for (const el of items) {
2724
- hide(
2725
- el,
2726
- !hasClass(
2727
- this.items.find((item) => within(el, item)),
2728
- this.clsOpen
2729
- )
2730
- );
2731
- }
2732
- this.$emit();
2733
- },
2734
- immediate: true
2739
+ hide(el, !isOpen);
2740
+ }
2741
+ this.$emit();
2735
2742
  }
2736
2743
  },
2737
2744
  observe: lazyload(),
@@ -3540,67 +3547,59 @@
3540
3547
  dropbarAnchor({ dropbarAnchor }, $el) {
3541
3548
  return query(dropbarAnchor, $el) || $el;
3542
3549
  },
3543
- dropbar: {
3544
- get({ dropbar }) {
3545
- if (!dropbar) {
3546
- return null;
3547
- }
3548
- dropbar = this._dropbar || query(dropbar, this.$el) || $(`+ .${this.clsDropbar}`, this.$el);
3549
- return dropbar ? dropbar : this._dropbar = $("<div></div>");
3550
- },
3551
- watch(dropbar) {
3552
- addClass(
3553
- dropbar,
3554
- "uk-dropbar",
3555
- "uk-dropbar-top",
3556
- this.clsDropbar,
3557
- `uk-${this.$options.name}-dropbar`
3558
- );
3559
- },
3560
- immediate: true
3550
+ dropbar({ dropbar }) {
3551
+ if (!dropbar) {
3552
+ return null;
3553
+ }
3554
+ dropbar = this._dropbar || query(dropbar, this.$el) || $(`+ .${this.clsDropbar}`, this.$el);
3555
+ return dropbar ? dropbar : this._dropbar = $("<div></div>");
3561
3556
  },
3562
3557
  dropContainer(_, $el) {
3563
3558
  return this.container || $el;
3564
3559
  },
3565
- dropdowns: {
3566
- get({ clsDrop }, $el) {
3567
- var _a;
3568
- const dropdowns = $$(`.${clsDrop}`, $el);
3569
- if (this.dropContainer !== $el) {
3570
- for (const el of $$(`.${clsDrop}`, this.dropContainer)) {
3571
- const target = (_a = this.getDropdown(el)) == null ? void 0 : _a.targetEl;
3572
- if (!includes(dropdowns, el) && target && within(target, this.$el)) {
3573
- dropdowns.push(el);
3574
- }
3560
+ dropdowns({ clsDrop }, $el) {
3561
+ var _a;
3562
+ const dropdowns = $$(`.${clsDrop}`, $el);
3563
+ if (this.dropContainer !== $el) {
3564
+ for (const el of $$(`.${clsDrop}`, this.dropContainer)) {
3565
+ const target = (_a = this.getDropdown(el)) == null ? void 0 : _a.targetEl;
3566
+ if (!includes(dropdowns, el) && target && within(target, this.$el)) {
3567
+ dropdowns.push(el);
3575
3568
  }
3576
3569
  }
3577
- return dropdowns;
3578
- },
3579
- watch(dropdowns) {
3580
- this.$create(
3581
- "drop",
3582
- dropdowns.filter((el) => !this.getDropdown(el)),
3583
- {
3584
- ...this.$props,
3585
- flip: false,
3586
- shift: true,
3587
- pos: `bottom-${this.align}`,
3588
- boundary: this.boundary === true ? this.$el : this.boundary
3589
- }
3590
- );
3591
- },
3592
- immediate: true
3570
+ }
3571
+ return dropdowns;
3593
3572
  },
3594
- items: {
3595
- get({ selNavItem }, $el) {
3596
- return $$(selNavItem, $el);
3597
- },
3598
- watch(items) {
3599
- attr(children(this.$el), "role", "presentation");
3600
- attr(items, "tabindex", -1);
3601
- attr(items[0], "tabindex", 0);
3602
- },
3603
- immediate: true
3573
+ items({ selNavItem }, $el) {
3574
+ return $$(selNavItem, $el);
3575
+ }
3576
+ },
3577
+ watch: {
3578
+ dropbar(dropbar) {
3579
+ addClass(
3580
+ dropbar,
3581
+ "uk-dropbar",
3582
+ "uk-dropbar-top",
3583
+ this.clsDropbar,
3584
+ `uk-${this.$options.name}-dropbar`
3585
+ );
3586
+ },
3587
+ dropdowns(dropdowns) {
3588
+ this.$create(
3589
+ "drop",
3590
+ dropdowns.filter((el) => !this.getDropdown(el)),
3591
+ {
3592
+ ...this.$props,
3593
+ flip: false,
3594
+ shift: true,
3595
+ pos: `bottom-${this.align}`,
3596
+ boundary: this.boundary === true ? this.$el : this.boundary
3597
+ }
3598
+ );
3599
+ },
3600
+ items(items) {
3601
+ attr(items, "tabindex", -1);
3602
+ attr(items[0], "tabindex", 0);
3604
3603
  }
3605
3604
  },
3606
3605
  disconnected() {
@@ -4114,13 +4113,8 @@
4114
4113
  row: true
4115
4114
  },
4116
4115
  computed: {
4117
- elements: {
4118
- get({ target }, $el) {
4119
- return $$(target, $el);
4120
- },
4121
- watch() {
4122
- this.$reset();
4123
- }
4116
+ elements({ target }, $el) {
4117
+ return $$(target, $el);
4124
4118
  }
4125
4119
  },
4126
4120
  observe: resize({
@@ -4643,9 +4637,10 @@
4643
4637
  ensureSrcAttribute(this.$el);
4644
4638
  },
4645
4639
  disconnected() {
4646
- if (this._data.image) {
4647
- this._data.image.onload = "";
4640
+ if (this.img) {
4641
+ this.img.onload = "";
4648
4642
  }
4643
+ delete this.img;
4649
4644
  },
4650
4645
  observe: intersection({
4651
4646
  target: ({ $el, $props }) => [$el, ...queryAll($props.target, $el)],
@@ -4658,13 +4653,13 @@
4658
4653
  }),
4659
4654
  methods: {
4660
4655
  load() {
4661
- if (this._data.image) {
4662
- return this._data.image;
4656
+ if (this.img) {
4657
+ return this.img;
4663
4658
  }
4664
4659
  const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);
4665
4660
  removeAttr(image, "loading");
4666
4661
  setSrcAttrs(this.$el, image.currentSrc);
4667
- return this._data.image = image;
4662
+ return this.img = image;
4668
4663
  }
4669
4664
  }
4670
4665
  };
@@ -5144,32 +5139,22 @@
5144
5139
  selNavItem: ".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle"
5145
5140
  // Simplify with :where() selector once browser target is Safari 14+
5146
5141
  },
5147
- computed: {
5148
- items: {
5149
- get({ selNavItem }, $el) {
5150
- return $$(selNavItem, $el);
5151
- },
5152
- watch(items) {
5153
- const justify = hasClass(this.$el, "uk-navbar-justify");
5154
- for (const container of $$(
5155
- ".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right",
5156
- this.$el
5157
- )) {
5158
- css(
5159
- container,
5160
- "flexGrow",
5161
- justify ? $$(
5162
- ".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle",
5163
- container
5164
- ).length : ""
5165
- );
5166
- }
5167
- attr($$(".uk-navbar-nav", this.$el), "role", "group");
5168
- attr($$(".uk-navbar-nav > *", this.$el), "role", "presentation");
5169
- attr(items, "tabindex", -1);
5170
- attr(items[0], "tabindex", 0);
5171
- },
5172
- immediate: true
5142
+ watch: {
5143
+ items() {
5144
+ const justify = hasClass(this.$el, "uk-navbar-justify");
5145
+ for (const container of $$(
5146
+ ".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right",
5147
+ this.$el
5148
+ )) {
5149
+ css(
5150
+ container,
5151
+ "flexGrow",
5152
+ justify ? $$(
5153
+ ".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle",
5154
+ container
5155
+ ).length : ""
5156
+ );
5157
+ }
5173
5158
  }
5174
5159
  }
5175
5160
  };
@@ -5447,30 +5432,30 @@
5447
5432
  inViewClass: "uk-scrollspy-inview"
5448
5433
  }),
5449
5434
  computed: {
5450
- elements: {
5451
- get({ target }, $el) {
5452
- return target ? $$(target, $el) : [$el];
5453
- },
5454
- watch(elements) {
5455
- if (this.hidden) {
5456
- css(filter$1(elements, `:not(.${this.inViewClass})`), "opacity", 0);
5457
- }
5458
- },
5459
- immediate: true
5435
+ elements({ target }, $el) {
5436
+ return target ? $$(target, $el) : [$el];
5437
+ }
5438
+ },
5439
+ watch: {
5440
+ elements(elements) {
5441
+ if (this.hidden) {
5442
+ css(filter$1(elements, `:not(.${this.inViewClass})`), "opacity", 0);
5443
+ }
5460
5444
  }
5461
5445
  },
5462
5446
  connected() {
5463
- this._data.elements = /* @__PURE__ */ new Map();
5447
+ this.elementData = /* @__PURE__ */ new Map();
5464
5448
  },
5465
5449
  disconnected() {
5466
- for (const [el, state] of this._data.elements.entries()) {
5450
+ for (const [el, state] of this.elementData.entries()) {
5467
5451
  removeClass(el, this.inViewClass, (state == null ? void 0 : state.cls) || "");
5468
5452
  }
5453
+ delete this.elementData;
5469
5454
  },
5470
5455
  observe: intersection({
5471
5456
  target: ({ elements }) => elements,
5472
5457
  handler(records) {
5473
- const elements = this._data.elements;
5458
+ const elements = this.elementData;
5474
5459
  for (const { target: el, isIntersecting } of records) {
5475
5460
  if (!elements.has(el)) {
5476
5461
  elements.set(el, {
@@ -5491,7 +5476,7 @@
5491
5476
  update: [
5492
5477
  {
5493
5478
  write(data) {
5494
- for (const [el, state] of data.elements.entries()) {
5479
+ for (const [el, state] of this.elementData.entries()) {
5495
5480
  if (state.show && !state.inview && !state.queued) {
5496
5481
  state.queued = true;
5497
5482
  data.promise = (data.promise || Promise.resolve()).then(() => new Promise((resolve) => setTimeout(resolve, this.delay))).then(() => {
@@ -5511,7 +5496,7 @@
5511
5496
  methods: {
5512
5497
  toggle(el, inview) {
5513
5498
  var _a;
5514
- const state = this._data.elements.get(el);
5499
+ const state = this.elementData.get(el);
5515
5500
  if (!state) {
5516
5501
  return;
5517
5502
  }
@@ -5550,21 +5535,20 @@
5550
5535
  offset: 0
5551
5536
  },
5552
5537
  computed: {
5553
- links: {
5554
- get(_, $el) {
5555
- return $$('a[href*="#"]', $el).filter((el) => el.hash && isSameSiteAnchor(el));
5556
- },
5557
- watch(links) {
5558
- if (this.scroll) {
5559
- this.$create("scroll", links, { offset: this.offset || 0 });
5560
- }
5561
- },
5562
- immediate: true
5538
+ links(_, $el) {
5539
+ return $$('a[href*="#"]', $el).filter((el) => el.hash && isSameSiteAnchor(el));
5563
5540
  },
5564
5541
  elements({ closest: selector }) {
5565
5542
  return closest(this.links, selector || "*");
5566
5543
  }
5567
5544
  },
5545
+ watch: {
5546
+ links(links) {
5547
+ if (this.scroll) {
5548
+ this.$create("scroll", links, { offset: this.offset || 0 });
5549
+ }
5550
+ }
5551
+ },
5568
5552
  observe: scroll$1(),
5569
5553
  update: [
5570
5554
  {
@@ -5987,42 +5971,14 @@
5987
5971
  swiping: true
5988
5972
  },
5989
5973
  computed: {
5990
- connects: {
5991
- get({ connect }, $el) {
5992
- return queryAll(connect, $el);
5993
- },
5994
- watch(connects) {
5995
- if (this.swiping) {
5996
- css(connects, "touchAction", "pan-y pinch-zoom");
5997
- }
5998
- this.$emit();
5999
- },
6000
- document: true,
6001
- immediate: true
5974
+ connects({ connect }, $el) {
5975
+ return queryAll(connect, $el);
6002
5976
  },
6003
- connectChildren: {
6004
- get() {
6005
- return this.connects.map((el) => children(el)).flat();
6006
- },
6007
- watch() {
6008
- const index = this.index();
6009
- for (const el of this.connects) {
6010
- children(el).forEach((child, i) => toggleClass(child, this.cls, i === index));
6011
- }
6012
- this.$emit();
6013
- },
6014
- immediate: true
5977
+ connectChildren() {
5978
+ return this.connects.map((el) => children(el)).flat();
6015
5979
  },
6016
- toggles: {
6017
- get({ toggle }, $el) {
6018
- return $$(toggle, $el);
6019
- },
6020
- watch(toggles) {
6021
- this.$emit();
6022
- const active = this.index();
6023
- this.show(~active ? active : toggles[this.active] || toggles[0]);
6024
- },
6025
- immediate: true
5980
+ toggles({ toggle }, $el) {
5981
+ return $$(toggle, $el);
6026
5982
  },
6027
5983
  children() {
6028
5984
  return children(this.$el).filter(
@@ -6030,6 +5986,26 @@
6030
5986
  );
6031
5987
  }
6032
5988
  },
5989
+ watch: {
5990
+ connects(connects) {
5991
+ if (this.swiping) {
5992
+ css(connects, "touchAction", "pan-y pinch-zoom");
5993
+ }
5994
+ this.$emit();
5995
+ },
5996
+ connectChildren() {
5997
+ const index = this.index();
5998
+ for (const el of this.connects) {
5999
+ children(el).forEach((child, i) => toggleClass(child, this.cls, i === index));
6000
+ }
6001
+ this.$emit();
6002
+ },
6003
+ toggles(toggles) {
6004
+ this.$emit();
6005
+ const active = this.index();
6006
+ this.show(~active ? active : toggles[this.active] || toggles[0]);
6007
+ }
6008
+ },
6033
6009
  connected() {
6034
6010
  attr(this.$el, "role", "tablist");
6035
6011
  },
@@ -6185,12 +6161,9 @@
6185
6161
  queued: true
6186
6162
  },
6187
6163
  computed: {
6188
- target: {
6189
- get({ href, target }, $el) {
6190
- target = queryAll(target || href, $el);
6191
- return target.length && target || [$el];
6192
- },
6193
- document: true
6164
+ target({ href, target }, $el) {
6165
+ target = queryAll(target || href, $el);
6166
+ return target.length && target || [$el];
6194
6167
  }
6195
6168
  },
6196
6169
  connected() {
@@ -6676,35 +6649,31 @@
6676
6649
  duration: 250
6677
6650
  },
6678
6651
  computed: {
6679
- toggles: {
6680
- get({ attrItem }, $el) {
6681
- return $$(`[${attrItem}],[data-${attrItem}]`, $el);
6682
- },
6683
- watch(toggles) {
6684
- this.updateState();
6685
- const actives = $$(this.selActive, this.$el);
6686
- for (const toggle of toggles) {
6687
- if (this.selActive !== false) {
6688
- toggleClass(toggle, this.cls, includes(actives, toggle));
6689
- }
6690
- const button = findButton(toggle);
6691
- if (isTag(button, "a")) {
6692
- attr(button, "role", "button");
6693
- }
6694
- }
6695
- },
6696
- immediate: true
6652
+ toggles({ attrItem }, $el) {
6653
+ return $$(`[${attrItem}],[data-${attrItem}]`, $el);
6697
6654
  },
6698
- children: {
6699
- get({ target }, $el) {
6700
- return $$(`${target} > *`, $el);
6701
- },
6702
- watch(list, prev) {
6703
- if (prev) {
6704
- this.updateState();
6655
+ children({ target }, $el) {
6656
+ return $$(`${target} > *`, $el);
6657
+ }
6658
+ },
6659
+ watch: {
6660
+ toggles(toggles) {
6661
+ this.updateState();
6662
+ const actives = $$(this.selActive, this.$el);
6663
+ for (const toggle of toggles) {
6664
+ if (this.selActive !== false) {
6665
+ toggleClass(toggle, this.cls, includes(actives, toggle));
6705
6666
  }
6706
- },
6707
- immediate: true
6667
+ const button = findButton(toggle);
6668
+ if (isTag(button, "a")) {
6669
+ attr(button, "role", "button");
6670
+ }
6671
+ }
6672
+ },
6673
+ children(list, prev) {
6674
+ if (prev) {
6675
+ this.updateState();
6676
+ }
6708
6677
  }
6709
6678
  },
6710
6679
  events: {
@@ -6940,28 +6909,81 @@
6940
6909
  role: "region"
6941
6910
  },
6942
6911
  computed: {
6943
- nav: {
6944
- get({ selNav }, $el) {
6945
- return $(selNav, $el);
6946
- },
6947
- watch(nav, prev) {
6948
- attr(nav, "role", "tablist");
6949
- if (prev) {
6950
- this.$emit();
6951
- }
6952
- },
6953
- immediate: true
6912
+ nav({ selNav }, $el) {
6913
+ return $(selNav, $el);
6914
+ },
6915
+ navChildren() {
6916
+ return children(this.nav);
6954
6917
  },
6955
6918
  selNavItem({ attrItem }) {
6956
6919
  return `[${attrItem}],[data-${attrItem}]`;
6957
6920
  },
6958
- navItems: {
6959
- get(_, $el) {
6960
- return $$(this.selNavItem, $el);
6961
- },
6962
- watch() {
6921
+ navItems(_, $el) {
6922
+ return $$(this.selNavItem, $el);
6923
+ }
6924
+ },
6925
+ watch: {
6926
+ nav(nav, prev) {
6927
+ attr(nav, "role", "tablist");
6928
+ if (prev) {
6963
6929
  this.$emit();
6964
6930
  }
6931
+ },
6932
+ list(list) {
6933
+ attr(list, "role", "presentation");
6934
+ },
6935
+ navChildren(children2) {
6936
+ attr(children2, "role", "presentation");
6937
+ },
6938
+ navItems(items) {
6939
+ for (const el of items) {
6940
+ const cmd = data(el, this.attrItem);
6941
+ const button = $("a,button", el) || el;
6942
+ let ariaLabel;
6943
+ let ariaControls = null;
6944
+ if (isNumeric(cmd)) {
6945
+ const item = toNumber(cmd);
6946
+ const slide = this.slides[item];
6947
+ if (slide) {
6948
+ if (!slide.id) {
6949
+ slide.id = generateId(this, slide, `-item-${cmd}`);
6950
+ }
6951
+ ariaControls = slide.id;
6952
+ }
6953
+ ariaLabel = this.t("slideX", toFloat(cmd) + 1);
6954
+ attr(button, "role", "tab");
6955
+ } else {
6956
+ if (this.list) {
6957
+ if (!this.list.id) {
6958
+ this.list.id = generateId(this, this.list, "-items");
6959
+ }
6960
+ ariaControls = this.list.id;
6961
+ }
6962
+ ariaLabel = this.t(cmd);
6963
+ }
6964
+ attr(button, {
6965
+ "aria-controls": ariaControls,
6966
+ "aria-label": attr(button, "aria-label") || ariaLabel
6967
+ });
6968
+ }
6969
+ },
6970
+ slides(slides) {
6971
+ slides.forEach(
6972
+ (slide, i) => attr(slide, {
6973
+ role: this.nav ? "tabpanel" : "group",
6974
+ "aria-label": this.t("slideLabel", i + 1, this.length),
6975
+ "aria-roledescription": this.nav ? null : "slide"
6976
+ })
6977
+ );
6978
+ },
6979
+ length(length) {
6980
+ const navLength = this.navChildren.length;
6981
+ if (this.nav && length !== navLength) {
6982
+ empty(this.nav);
6983
+ for (let i = 0; i < length; i++) {
6984
+ append(this.nav, `<li ${this.attrItem}="${i}"><a href></a></li>`);
6985
+ }
6986
+ }
6965
6987
  }
6966
6988
  },
6967
6989
  connected() {
@@ -6971,54 +6993,6 @@
6971
6993
  });
6972
6994
  },
6973
6995
  update: [
6974
- {
6975
- write() {
6976
- this.slides.forEach(
6977
- (slide, i) => attr(slide, {
6978
- role: this.nav ? "tabpanel" : "group",
6979
- "aria-label": this.t("slideLabel", i + 1, this.length),
6980
- "aria-roledescription": this.nav ? null : "slide"
6981
- })
6982
- );
6983
- if (this.nav && this.length !== this.nav.children.length) {
6984
- html(
6985
- this.nav,
6986
- this.slides.map((_, i) => `<li ${this.attrItem}="${i}"><a href></a></li>`).join("")
6987
- );
6988
- }
6989
- attr(children(this.nav).concat(this.list), "role", "presentation");
6990
- for (const el of this.navItems) {
6991
- const cmd = data(el, this.attrItem);
6992
- const button = $("a,button", el) || el;
6993
- let ariaLabel;
6994
- let ariaControls = null;
6995
- if (isNumeric(cmd)) {
6996
- const item = toNumber(cmd);
6997
- const slide = this.slides[item];
6998
- if (slide) {
6999
- if (!slide.id) {
7000
- slide.id = generateId(this, slide, `-item-${cmd}`);
7001
- }
7002
- ariaControls = slide.id;
7003
- }
7004
- ariaLabel = this.t("slideX", toFloat(cmd) + 1);
7005
- attr(button, "role", "tab");
7006
- } else {
7007
- if (this.list) {
7008
- if (!this.list.id) {
7009
- this.list.id = generateId(this, this.list, "-items");
7010
- }
7011
- ariaControls = this.list.id;
7012
- }
7013
- ariaLabel = this.t(cmd);
7014
- }
7015
- attr(button, {
7016
- "aria-controls": ariaControls,
7017
- "aria-label": attr(button, "aria-label") || ariaLabel
7018
- });
7019
- }
7020
- }
7021
- },
7022
6996
  {
7023
6997
  write() {
7024
6998
  this.navItems.concat(this.nav).forEach((el) => el && (el.hidden = !this.maxIndex));
@@ -7343,18 +7317,20 @@
7343
7317
  maxIndex() {
7344
7318
  return this.length - 1;
7345
7319
  },
7346
- slides: {
7347
- get() {
7348
- return children(this.list);
7349
- },
7350
- watch() {
7351
- this.$emit();
7352
- }
7320
+ slides() {
7321
+ return children(this.list);
7353
7322
  },
7354
7323
  length() {
7355
7324
  return this.slides.length;
7356
7325
  }
7357
7326
  },
7327
+ watch: {
7328
+ slides(slides, prev) {
7329
+ if (prev) {
7330
+ this.$emit();
7331
+ }
7332
+ }
7333
+ },
7358
7334
  observe: resize(),
7359
7335
  methods: {
7360
7336
  show(index, force = false) {
@@ -7738,19 +7714,18 @@
7738
7714
  props: { toggle: String },
7739
7715
  data: { toggle: "a" },
7740
7716
  computed: {
7741
- toggles: {
7742
- get({ toggle }, $el) {
7743
- return $$(toggle, $el);
7744
- },
7745
- watch(toggles) {
7746
- this.hide();
7747
- for (const toggle of toggles) {
7748
- if (isTag(toggle, "a")) {
7749
- attr(toggle, "role", "button");
7750
- }
7717
+ toggles({ toggle }, $el) {
7718
+ return $$(toggle, $el);
7719
+ }
7720
+ },
7721
+ watch: {
7722
+ toggles(toggles) {
7723
+ this.hide();
7724
+ for (const toggle of toggles) {
7725
+ if (isTag(toggle, "a")) {
7726
+ attr(toggle, "role", "button");
7751
7727
  }
7752
- },
7753
- immediate: true
7728
+ }
7754
7729
  }
7755
7730
  },
7756
7731
  disconnected() {
@@ -8884,24 +8859,20 @@
8884
8859
  items() {
8885
8860
  return children(this.target);
8886
8861
  },
8887
- isEmpty: {
8888
- get() {
8889
- return isEmpty(this.items);
8890
- },
8891
- watch(empty) {
8892
- toggleClass(this.target, this.clsEmpty, empty);
8893
- },
8894
- immediate: true
8862
+ isEmpty() {
8863
+ return isEmpty(this.items);
8895
8864
  },
8896
- handles: {
8897
- get({ handle }, el) {
8898
- return handle ? $$(handle, el) : this.items;
8899
- },
8900
- watch(handles, prev) {
8901
- css(prev, { touchAction: "", userSelect: "" });
8902
- css(handles, { touchAction: hasTouch ? "none" : "", userSelect: "none" });
8903
- },
8904
- immediate: true
8865
+ handles({ handle }, el) {
8866
+ return handle ? $$(handle, el) : this.items;
8867
+ }
8868
+ },
8869
+ watch: {
8870
+ isEmpty(empty) {
8871
+ toggleClass(this.target, this.clsEmpty, empty);
8872
+ },
8873
+ handles(handles, prev) {
8874
+ css(prev, { touchAction: "", userSelect: "" });
8875
+ css(handles, { touchAction: hasTouch ? "none" : "", userSelect: "none" });
8905
8876
  }
8906
8877
  },
8907
8878
  update: {