uikit 3.19.5-dev.8317c4705 → 3.19.5-dev.97cca0902

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 (64) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/css/uikit-core-rtl.css +2 -2
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +2 -2
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +2 -2
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +2 -2
  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 +55 -55
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +55 -55
  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 +11 -18
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +12 -19
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +12 -20
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +12 -19
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +12 -19
  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 +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 +100 -74
  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 +103 -77
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/boot.js +6 -7
  44. package/src/js/api/component.js +4 -4
  45. package/src/js/api/computed.js +24 -23
  46. package/src/js/api/observer.js +17 -5
  47. package/src/js/components/slider-parallax.js +2 -2
  48. package/src/js/components/slider.js +1 -1
  49. package/src/js/core/drop.js +1 -2
  50. package/src/js/core/height-placeholder.js +5 -2
  51. package/src/js/core/height-viewport.js +1 -1
  52. package/src/js/core/icon.js +2 -3
  53. package/src/js/core/img.js +1 -1
  54. package/src/js/core/inverse.js +22 -5
  55. package/src/js/core/switcher.js +5 -1
  56. package/src/js/core/toggle.js +7 -3
  57. package/src/js/mixin/slider.js +0 -3
  58. package/src/js/mixin/slideshow.js +3 -0
  59. package/src/js/util/filter.js +1 -11
  60. package/src/js/util/lang.js +1 -1
  61. package/src/js/util/selector.js +5 -5
  62. package/src/js/util/svg.js +1 -12
  63. package/src/less/components/utility.less +1 -1
  64. package/src/scss/components/utility.scss +1 -1
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.19.5-dev.8317c4705 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.19.5-dev.97cca0902 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -88,7 +88,7 @@
88
88
  return parseFloat(value) || 0;
89
89
  }
90
90
  function toNode(element) {
91
- return toNodes(element)[0];
91
+ return element && toNodes(element)[0];
92
92
  }
93
93
  function toNodes(element) {
94
94
  return isNode(element) ? [element] : Array.from(element || []).filter(isNode);
@@ -319,13 +319,6 @@
319
319
  function matches(element, selector) {
320
320
  return toNodes(element).some((element2) => element2.matches(selector));
321
321
  }
322
- function closest(element, selector) {
323
- var _a;
324
- return (_a = toNode(element)) == null ? void 0 : _a.closest(startsWith(selector, ">") ? selector.slice(1) : selector);
325
- }
326
- function within(element, selector) {
327
- return isString(selector) ? !!closest(element, selector) : toNode(selector).contains(toNode(element));
328
- }
329
322
  function parents(element, selector) {
330
323
  const elements = [];
331
324
  while (element = parent(element)) {
@@ -374,10 +367,11 @@
374
367
  const splitSelectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
375
368
  const trailingCommaRe = /\s*,$/;
376
369
  const parseSelector = memoize((selector) => {
370
+ var _a;
377
371
  selector = selector.replace(addStarRe, "$1 *");
378
372
  let isContextSelector = false;
379
373
  const selectors = [];
380
- for (let sel of selector.match(splitSelectorRe)) {
374
+ for (let sel of (_a = selector.match(splitSelectorRe)) != null ? _a : []) {
381
375
  sel = sel.replace(trailingCommaRe, "").trim();
382
376
  if (sel[0] === ">") {
383
377
  sel = `:scope ${sel}`;
@@ -405,7 +399,7 @@
405
399
  let ctx = context;
406
400
  if (sel[0] === "!") {
407
401
  const selectors = sel.substr(1).trim().split(" ");
408
- ctx = parent(context).closest(selectors[0]);
402
+ ctx = context.parentElement.closest(selectors[0]);
409
403
  sel = selectors.slice(1).join(" ").trim();
410
404
  if (!sel.length && isSingle) {
411
405
  return ctx;
@@ -421,9 +415,9 @@
421
415
  }
422
416
  } else if (sel[0] === "~" || sel[0] === "+" && isSingle) {
423
417
  return _doQuery(
424
- parent(context),
418
+ ctx.parentElement,
425
419
  queryFn,
426
- `:scope :nth-child(${index(context) + 1}) ${sel}`
420
+ `:scope :nth-child(${index(ctx) + 1}) ${sel}`
427
421
  );
428
422
  }
429
423
  if (ctx) {
@@ -1566,7 +1560,6 @@
1566
1560
  camelize: camelize,
1567
1561
  children: children,
1568
1562
  clamp: clamp,
1569
- closest: closest,
1570
1563
  createEvent: createEvent,
1571
1564
  css: css,
1572
1565
  data: data,
@@ -1687,7 +1680,6 @@
1687
1680
  uniqueBy: uniqueBy,
1688
1681
  unwrap: unwrap,
1689
1682
  width: width,
1690
- within: within,
1691
1683
  wrapAll: wrapAll,
1692
1684
  wrapInner: wrapInner
1693
1685
  });
@@ -1775,6 +1767,7 @@
1775
1767
  }
1776
1768
  }
1777
1769
  }
1770
+ const mutationOptions = { subtree: true, childList: true };
1778
1771
  function registerComputed(instance, key, cb) {
1779
1772
  instance._hasComputed = true;
1780
1773
  Object.defineProperty(instance, key, {
@@ -1783,6 +1776,15 @@
1783
1776
  const { _computed, $props, $el } = instance;
1784
1777
  if (!hasOwn(_computed, key)) {
1785
1778
  _computed[key] = (cb.get || cb).call(instance, $props, $el);
1779
+ if (cb.observe && instance._computedObserver) {
1780
+ const observeEl = cb.observe.call(instance, _computed[key]);
1781
+ if (observeEl && observeEl !== $el) {
1782
+ instance._computedObserver.observe(
1783
+ findClosestCommonParent(observeEl, $el),
1784
+ mutationOptions
1785
+ );
1786
+ }
1787
+ }
1786
1788
  }
1787
1789
  return _computed[key];
1788
1790
  },
@@ -1803,11 +1805,16 @@
1803
1805
  read: () => runWatches(instance, resetComputed(instance)),
1804
1806
  events: ["resize", "computed"]
1805
1807
  });
1806
- registerComputedObserver();
1807
- instances$1.add(instance);
1808
+ instance._computedObserver = observeMutation(
1809
+ instance.$el,
1810
+ () => callUpdate(instance, "computed"),
1811
+ mutationOptions
1812
+ );
1808
1813
  }
1809
1814
  function disconnectComputedUpdates(instance) {
1810
- instances$1 == null ? void 0 : instances$1.delete(instance);
1815
+ var _a;
1816
+ (_a = instance._computedObserver) == null ? void 0 : _a.disconnect();
1817
+ delete instance._computedObserver;
1811
1818
  resetComputed(instance);
1812
1819
  }
1813
1820
  function resetComputed(instance) {
@@ -1815,22 +1822,11 @@
1815
1822
  instance._computed = {};
1816
1823
  return values;
1817
1824
  }
1818
- let observer;
1819
- let instances$1;
1820
- function registerComputedObserver() {
1821
- if (observer) {
1822
- return;
1825
+ function findClosestCommonParent(el1, el2) {
1826
+ while (el1 && !el1.contains(el2)) {
1827
+ el1 = el1.parentNode;
1823
1828
  }
1824
- instances$1 = /* @__PURE__ */ new Set();
1825
- observer = new MutationObserver(() => {
1826
- for (const instance of instances$1) {
1827
- callUpdate(instance, "computed");
1828
- }
1829
- });
1830
- observer.observe(document, {
1831
- subtree: true,
1832
- childList: true
1833
- });
1829
+ return el1;
1834
1830
  }
1835
1831
 
1836
1832
  function initEvents(instance) {
@@ -1901,18 +1897,30 @@
1901
1897
  }
1902
1898
  const targets = hasOwn(instance, key) ? instance[key] : target;
1903
1899
  const observer = observe(targets, handler, options, args);
1904
- if (isFunction(target) && isArray(instance[key]) && observer.unobserve) {
1905
- registerWatch(instance, { handler: updateTargets(observer), immediate: false }, key);
1900
+ if (isFunction(target) && isArray(instance[key])) {
1901
+ registerWatch(
1902
+ instance,
1903
+ { handler: updateTargets(observer, options), immediate: false },
1904
+ key
1905
+ );
1906
1906
  }
1907
1907
  registerObserver(instance, observer);
1908
1908
  }
1909
- function updateTargets(observer) {
1909
+ function updateTargets(observer, options) {
1910
1910
  return (targets, prev) => {
1911
1911
  for (const target of prev) {
1912
- !includes(targets, target) && observer.unobserve(target);
1912
+ if (!includes(targets, target)) {
1913
+ if (observer.unobserve) {
1914
+ observer.unobserve(target);
1915
+ } else if (observer.observe) {
1916
+ observer.disconnect();
1917
+ }
1918
+ }
1913
1919
  }
1914
1920
  for (const target of targets) {
1915
- !includes(prev, target) && observer.observe(target);
1921
+ if (!includes(prev, target) || !observer.unobserve) {
1922
+ observer.observe(target, options);
1923
+ }
1916
1924
  }
1917
1925
  };
1918
1926
  }
@@ -2179,26 +2187,26 @@
2179
2187
  };
2180
2188
  App.util = util;
2181
2189
  App.options = {};
2182
- App.version = "3.19.5-dev.8317c4705";
2190
+ App.version = "3.19.5-dev.97cca0902";
2183
2191
 
2184
2192
  const PREFIX = "uk-";
2185
2193
  const DATA = "__uikit__";
2186
2194
  const components$1 = {};
2187
2195
  function component(name, options) {
2188
- var _a;
2196
+ var _a, _b;
2189
2197
  const id = PREFIX + hyphenate(name);
2190
2198
  if (!options) {
2191
- if (isPlainObject(components$1[id])) {
2199
+ if (!components$1[id].options) {
2192
2200
  components$1[id] = App.extend(components$1[id]);
2193
2201
  }
2194
2202
  return components$1[id];
2195
2203
  }
2196
2204
  name = camelize(name);
2197
2205
  App[name] = (element, data) => createComponent(name, element, data);
2198
- const opt = isPlainObject(options) ? { ...options } : options.options;
2206
+ const opt = (_a = options.options) != null ? _a : { ...options };
2199
2207
  opt.id = id;
2200
2208
  opt.name = name;
2201
- (_a = opt.install) == null ? void 0 : _a.call(opt, App, opt, name);
2209
+ (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);
2202
2210
  if (App._initialized && !opt.functional) {
2203
2211
  requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
2204
2212
  }
@@ -2206,7 +2214,7 @@
2206
2214
  }
2207
2215
  function createComponent(name, element, data, ...args) {
2208
2216
  const Component = component(name);
2209
- return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? $$(element).map(init)[0] : init();
2217
+ return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? findAll(element).map(init)[0] : init();
2210
2218
  function init(element2) {
2211
2219
  const instance = getComponent(element2, name);
2212
2220
  if (instance) {
@@ -2282,14 +2290,14 @@
2282
2290
  if (name) {
2283
2291
  if (hasAttr(target, attributeName)) {
2284
2292
  createComponent(name, target);
2285
- return;
2293
+ } else {
2294
+ (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
2286
2295
  }
2287
- (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
2288
2296
  }
2289
2297
  }
2290
2298
  function connect(node) {
2291
2299
  const components2 = getComponents(node);
2292
- for (const name in getComponents(node)) {
2300
+ for (const name in components2) {
2293
2301
  callConnected(components2[name]);
2294
2302
  }
2295
2303
  for (const attributeName of node.getAttributeNames()) {
@@ -2299,7 +2307,7 @@
2299
2307
  }
2300
2308
  function disconnect(node) {
2301
2309
  const components2 = getComponents(node);
2302
- for (const name in getComponents(node)) {
2310
+ for (const name in components2) {
2303
2311
  callDisconnected(components2[name]);
2304
2312
  }
2305
2313
  }
@@ -2308,7 +2316,7 @@
2308
2316
  attribute = attribute.slice(5);
2309
2317
  }
2310
2318
  const cmp = components$1[attribute];
2311
- return cmp && (isPlainObject(cmp) ? cmp : cmp.options).name;
2319
+ return cmp && (cmp.options || cmp).name;
2312
2320
  }
2313
2321
 
2314
2322
  function globalApi(App) {
@@ -3569,7 +3577,8 @@
3569
3577
  document,
3570
3578
  `${pointerUp} ${pointerCancel} scroll`,
3571
3579
  ({ defaultPrevented, type, target: newTarget }) => {
3572
- if (!defaultPrevented && type === pointerUp && target === newTarget && !(drop.targetEl && within(target, drop.targetEl))) {
3580
+ var _a;
3581
+ if (!defaultPrevented && type === pointerUp && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {
3573
3582
  drop.hide(false);
3574
3583
  }
3575
3584
  },
@@ -4276,7 +4285,10 @@
4276
4285
  target: ""
4277
4286
  },
4278
4287
  computed: {
4279
- target: ({ target }, $el) => query(target, $el)
4288
+ target: {
4289
+ get: ({ target }, $el) => query(target, $el),
4290
+ observe: (target) => parent(target)
4291
+ }
4280
4292
  },
4281
4293
  observe: resize({ target: ({ target }) => target }),
4282
4294
  update: {
@@ -4332,7 +4344,7 @@
4332
4344
  const top = offsetPosition(offsetTopEl)[0] - offsetPosition(scrollElement)[0];
4333
4345
  minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : "";
4334
4346
  } else {
4335
- minHeight += ` - ${css(scrollElement, "paddingTop")}`;
4347
+ minHeight += ` - ${boxModelAdjust(scrollElement, "height", css(scrollElement, "boxSizing"))}px`;
4336
4348
  }
4337
4349
  }
4338
4350
  if (this.offsetBottom === true) {
@@ -4545,7 +4557,7 @@
4545
4557
  i18n: { toggle: "Open Search", submit: "Submit Search" },
4546
4558
  beforeConnect() {
4547
4559
  const isToggle = hasClass(this.$el, "uk-search-toggle") || hasClass(this.$el, "uk-navbar-toggle");
4548
- this.icon = isToggle ? "search-toggle-icon" : hasClass(this.$el, "uk-search-icon") && closest(this.$el, ".uk-search-large") ? "search-large" : closest(this.$el, ".uk-search-navbar") ? "search-navbar" : this.$props.icon;
4560
+ this.icon = isToggle ? "search-toggle-icon" : hasClass(this.$el, "uk-search-icon") && this.$el.closest(".uk-search-large") ? "search-large" : this.$el.closest(".uk-search-navbar") ? "search-navbar" : this.$props.icon;
4549
4561
  if (hasAttr(this.$el, "aria-label")) {
4550
4562
  return;
4551
4563
  }
@@ -4689,13 +4701,13 @@
4689
4701
  delete this.img;
4690
4702
  },
4691
4703
  observe: intersection({
4692
- target: ({ $el, $props }) => [$el, ...queryAll($props.target, $el)],
4693
4704
  handler(entries, observer) {
4694
4705
  this.load();
4695
4706
  observer.disconnect();
4696
4707
  },
4697
4708
  options: ({ margin }) => ({ rootMargin: margin }),
4698
- filter: ({ loading }) => loading === "lazy"
4709
+ filter: ({ loading }) => loading === "lazy",
4710
+ target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
4699
4711
  }),
4700
4712
  methods: {
4701
4713
  load() {
@@ -4785,9 +4797,17 @@
4785
4797
  selActive: false
4786
4798
  },
4787
4799
  computed: {
4788
- target: ({ target }, $el) => target ? $$(target, $el) : [$el]
4800
+ target: ({ target }, $el) => target ? $$(target, $el) : $el
4789
4801
  },
4790
4802
  observe: [
4803
+ intersection({
4804
+ handler(entries) {
4805
+ this.isIntersecting = entries.some(({ isIntersecting }) => isIntersecting);
4806
+ this.$emit();
4807
+ },
4808
+ target: ({ target }) => target,
4809
+ args: { intersecting: false }
4810
+ }),
4791
4811
  mutation({
4792
4812
  target: ({ target }) => target,
4793
4813
  options: { attributes: true, attributeFilter: ["class"], attributeOldValue: true }
@@ -4795,7 +4815,10 @@
4795
4815
  {
4796
4816
  target: ({ target }) => target,
4797
4817
  observe: (target, handler) => {
4798
- const observer = observeResize([...target, document.documentElement], handler);
4818
+ const observer = observeResize(
4819
+ [...toNodes(target), document.documentElement],
4820
+ handler
4821
+ );
4799
4822
  const listener = [
4800
4823
  on(document, "scroll itemshown itemhidden", handler, {
4801
4824
  passive: true,
@@ -4811,6 +4834,8 @@
4811
4834
  })
4812
4835
  ];
4813
4836
  return {
4837
+ observe: observer.observe.bind(observer),
4838
+ unobserve: observer.unobserve.bind(observer),
4814
4839
  disconnect() {
4815
4840
  observer.disconnect();
4816
4841
  listener.map((off) => off());
@@ -4824,7 +4849,10 @@
4824
4849
  ],
4825
4850
  update: {
4826
4851
  read() {
4827
- for (const target of this.target) {
4852
+ if (!this.isIntersecting) {
4853
+ return false;
4854
+ }
4855
+ for (const target of toNodes(this.target)) {
4828
4856
  replaceClass(
4829
4857
  target,
4830
4858
  "uk-light,uk-dark",
@@ -6106,18 +6134,10 @@
6106
6134
  }
6107
6135
 
6108
6136
  function getMaxPathLength(el) {
6109
- return Math.ceil(
6110
- Math.max(
6111
- 0,
6112
- ...$$("[stroke]", el).map((stroke) => {
6113
- try {
6114
- return stroke.getTotalLength();
6115
- } catch (e) {
6116
- return 0;
6117
- }
6118
- })
6119
- )
6120
- );
6137
+ return Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => {
6138
+ var _a;
6139
+ return (_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke);
6140
+ })));
6121
6141
  }
6122
6142
 
6123
6143
  var svg = {
@@ -6241,7 +6261,10 @@
6241
6261
  swiping: true
6242
6262
  },
6243
6263
  computed: {
6244
- connects: ({ connect }, $el) => queryAll(connect, $el),
6264
+ connects: {
6265
+ get: ({ connect }, $el) => queryAll(connect, $el),
6266
+ observe: (connects) => parent(connects[0])
6267
+ },
6245
6268
  connectChildren() {
6246
6269
  return this.connects.map((el) => children(el)).flat();
6247
6270
  },
@@ -6430,9 +6453,12 @@
6430
6453
  queued: true
6431
6454
  },
6432
6455
  computed: {
6433
- target({ target }, $el) {
6434
- target = queryAll(target || $el.hash, $el);
6435
- return target.length ? target : [$el];
6456
+ target: {
6457
+ get: ({ target }, $el) => {
6458
+ target = queryAll(target || $el.hash, $el);
6459
+ return target.length ? target : [$el];
6460
+ },
6461
+ observe: (target) => parent(target[0])
6436
6462
  }
6437
6463
  },
6438
6464
  connected() {