uikit 3.19.5-dev.c20f30a07 → 3.19.5-dev.c70b3862f

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 (69) hide show
  1. package/CHANGELOG.md +6 -1
  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 +87 -87
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  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 +40 -30
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +41 -31
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +40 -30
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +41 -31
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +40 -30
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +87 -87
  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 +90 -90
  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 +177 -180
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/computed.js +20 -26
  44. package/src/js/api/observer.js +1 -1
  45. package/src/js/components/slider-parallax.js +2 -2
  46. package/src/js/core/drop.js +1 -2
  47. package/src/js/core/height-placeholder.js +4 -1
  48. package/src/js/core/icon.js +2 -3
  49. package/src/js/core/inverse.js +2 -0
  50. package/src/js/core/margin.js +5 -0
  51. package/src/js/core/modal.js +5 -6
  52. package/src/js/core/scrollspy.js +0 -3
  53. package/src/js/core/sticky.js +1 -1
  54. package/src/js/core/switcher.js +4 -1
  55. package/src/js/core/toggle.js +6 -3
  56. package/src/js/mixin/internal/animate-fade.js +2 -7
  57. package/src/js/mixin/internal/animate-slide.js +2 -7
  58. package/src/js/mixin/parallax.js +7 -3
  59. package/src/js/util/class.js +1 -1
  60. package/src/js/util/fastdom.js +6 -13
  61. package/src/js/util/filter.js +7 -14
  62. package/src/js/util/selector.js +31 -22
  63. package/src/js/util/style.js +2 -4
  64. package/src/js/util/svg.js +4 -1
  65. package/src/less/components/utility.less +1 -1
  66. package/src/scss/components/utility.scss +1 -1
  67. package/tests/base.html +1 -1
  68. package/tests/js/index.js +12 -10
  69. package/tests/switcher.html +86 -86
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.19.5-dev.c20f30a07 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.19.5-dev.c70b3862f | 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() :
@@ -273,7 +273,7 @@
273
273
  }
274
274
  }
275
275
  function toClasses(str) {
276
- return str ? isArray(str) ? str.map(toClasses).flat() : String(str).split(/[ ,]/).filter(Boolean) : [];
276
+ return str ? isArray(str) ? str.map(toClasses).flat() : String(str).split(" ").filter(Boolean) : [];
277
277
  }
278
278
 
279
279
  const voidElements = {
@@ -296,10 +296,11 @@
296
296
  function isVoidElement(element) {
297
297
  return toNodes(element).some((element2) => voidElements[element2.tagName.toLowerCase()]);
298
298
  }
299
+ const isVisibleFn = Element.prototype.checkVisibility || function() {
300
+ return this.offsetWidth || this.offsetHeight || this.getClientRects().length;
301
+ };
299
302
  function isVisible(element) {
300
- return toNodes(element).some(
301
- (element2) => element2.offsetWidth || element2.offsetHeight || element2.getClientRects().length
302
- );
303
+ return toNodes(element).some((element2) => isVisibleFn.call(element2));
303
304
  }
304
305
  const selInput = "input,select,textarea,button";
305
306
  function isInput(element) {
@@ -319,13 +320,6 @@
319
320
  function matches(element, selector) {
320
321
  return toNodes(element).some((element2) => element2.matches(selector));
321
322
  }
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
323
  function parents(element, selector) {
330
324
  const elements = [];
331
325
  while (element = parent(element)) {
@@ -380,10 +374,7 @@
380
374
  const selectors = [];
381
375
  for (let sel of (_a = selector.match(splitSelectorRe)) != null ? _a : []) {
382
376
  sel = sel.replace(trailingCommaRe, "").trim();
383
- if (sel[0] === ">") {
384
- sel = `:scope ${sel}`;
385
- }
386
- isContextSelector || (isContextSelector = ["!", "+", "~", "-"].includes(sel[0]));
377
+ isContextSelector || (isContextSelector = ["!", "+", "~", "-", ">"].includes(sel[0]));
387
378
  selectors.push(sel);
388
379
  }
389
380
  return {
@@ -392,6 +383,11 @@
392
383
  isContextSelector
393
384
  };
394
385
  });
386
+ const parsePositionSelector = memoize((selector) => {
387
+ selector = selector.substr(1).trim();
388
+ const index2 = selector.indexOf(" ");
389
+ return ~index2 ? [selector.substring(0, index2), selector.substring(index2 + 1)] : [selector, ""];
390
+ });
395
391
  function _query(selector, context = document, queryFn) {
396
392
  if (!selector || !isString(selector)) {
397
393
  return selector;
@@ -403,33 +399,36 @@
403
399
  selector = "";
404
400
  const isSingle = parsed.selectors.length === 1;
405
401
  for (let sel of parsed.selectors) {
402
+ let positionSel;
406
403
  let ctx = context;
407
404
  if (sel[0] === "!") {
408
- const selectors = sel.substr(1).trim().split(" ");
409
- ctx = context.parentElement.closest(selectors[0]);
410
- sel = selectors.slice(1).join(" ").trim();
411
- if (!sel.length && isSingle) {
405
+ [positionSel, sel] = parsePositionSelector(sel);
406
+ ctx = context.parentElement.closest(positionSel);
407
+ if (!sel && isSingle) {
412
408
  return ctx;
413
409
  }
414
410
  }
415
- if (sel[0] === "-") {
416
- const selectors = sel.substr(1).trim().split(" ");
417
- const prev = (ctx || context).previousElementSibling;
418
- ctx = matches(prev, sel.substr(1)) ? prev : null;
419
- sel = selectors.slice(1).join(" ");
420
- if (!sel.length && isSingle) {
411
+ if (ctx && sel[0] === "-") {
412
+ [positionSel, sel] = parsePositionSelector(sel);
413
+ ctx = ctx.previousElementSibling;
414
+ ctx = matches(ctx, positionSel) ? ctx : null;
415
+ if (!sel && isSingle) {
421
416
  return ctx;
422
417
  }
423
- } else if (sel[0] === "~" || sel[0] === "+" && isSingle) {
424
- return _doQuery(
425
- ctx.parentElement,
426
- queryFn,
427
- `:scope :nth-child(${index(ctx) + 1}) ${sel}`
428
- );
429
418
  }
430
- if (ctx) {
431
- selector += `${selector ? "," : ""}${domPath(ctx)} ${sel}`;
419
+ if (!ctx) {
420
+ continue;
421
+ }
422
+ if (isSingle) {
423
+ if (sel[0] === "~" || sel[0] === "+") {
424
+ sel = `:scope :nth-child(${index(ctx) + 1}) ${sel}`;
425
+ ctx = ctx.parentElement;
426
+ } else if (sel[0] === ">") {
427
+ sel = `:scope ${sel}`;
428
+ }
429
+ return _doQuery(ctx, queryFn, sel);
432
430
  }
431
+ selector += `${selector ? "," : ""}${domPath(ctx)} ${sel}`;
433
432
  }
434
433
  if (!isDocument(context)) {
435
434
  context = context.ownerDocument;
@@ -612,8 +611,7 @@
612
611
  }
613
612
  return elements[0];
614
613
  }
615
- const propName = memoize((name) => vendorPropName(name));
616
- function vendorPropName(name) {
614
+ const propName = memoize((name) => {
617
615
  if (startsWith(name, "--")) {
618
616
  return name;
619
617
  }
@@ -628,7 +626,7 @@
628
626
  return prefixedName;
629
627
  }
630
628
  }
631
- }
629
+ });
632
630
 
633
631
  const clsTransition = "uk-transition";
634
632
  const transitionEnd = "transitionend";
@@ -1000,24 +998,18 @@
1000
998
  },
1001
999
  flush
1002
1000
  };
1003
- function flush(recursion) {
1001
+ function flush() {
1004
1002
  runTasks(fastdom.reads);
1005
1003
  runTasks(fastdom.writes.splice(0));
1006
1004
  fastdom.scheduled = false;
1007
1005
  if (fastdom.reads.length || fastdom.writes.length) {
1008
- scheduleFlush(recursion + 1);
1006
+ scheduleFlush();
1009
1007
  }
1010
1008
  }
1011
- const RECURSION_LIMIT = 4;
1012
- function scheduleFlush(recursion) {
1013
- if (fastdom.scheduled) {
1014
- return;
1015
- }
1016
- fastdom.scheduled = true;
1017
- if (recursion && recursion < RECURSION_LIMIT) {
1018
- Promise.resolve().then(() => flush(recursion));
1019
- } else {
1020
- requestAnimationFrame(() => flush(1));
1009
+ function scheduleFlush() {
1010
+ if (!fastdom.scheduled) {
1011
+ fastdom.scheduled = true;
1012
+ queueMicrotask(flush);
1021
1013
  }
1022
1014
  }
1023
1015
  function runTasks(tasks) {
@@ -1567,7 +1559,6 @@
1567
1559
  camelize: camelize,
1568
1560
  children: children,
1569
1561
  clamp: clamp,
1570
- closest: closest,
1571
1562
  createEvent: createEvent,
1572
1563
  css: css,
1573
1564
  data: data,
@@ -1688,7 +1679,6 @@
1688
1679
  uniqueBy: uniqueBy,
1689
1680
  unwrap: unwrap,
1690
1681
  width: width,
1691
- within: within,
1692
1682
  wrapAll: wrapAll,
1693
1683
  wrapInner: wrapInner
1694
1684
  });
@@ -1776,6 +1766,7 @@
1776
1766
  }
1777
1767
  }
1778
1768
  }
1769
+ const mutationOptions = { subtree: true, childList: true };
1779
1770
  function registerComputed(instance, key, cb) {
1780
1771
  instance._hasComputed = true;
1781
1772
  Object.defineProperty(instance, key, {
@@ -1784,6 +1775,13 @@
1784
1775
  const { _computed, $props, $el } = instance;
1785
1776
  if (!hasOwn(_computed, key)) {
1786
1777
  _computed[key] = (cb.get || cb).call(instance, $props, $el);
1778
+ if (cb.observe && instance._computedObserver) {
1779
+ const selector = cb.observe.call(instance, $props);
1780
+ instance._computedObserver.observe(
1781
+ ["~", "+", "-"].includes(selector[0]) ? $el.parentElement : $el.getRootNode(),
1782
+ mutationOptions
1783
+ );
1784
+ }
1787
1785
  }
1788
1786
  return _computed[key];
1789
1787
  },
@@ -1804,11 +1802,16 @@
1804
1802
  read: () => runWatches(instance, resetComputed(instance)),
1805
1803
  events: ["resize", "computed"]
1806
1804
  });
1807
- registerComputedObserver();
1808
- instances$1.add(instance);
1805
+ instance._computedObserver = observeMutation(
1806
+ instance.$el,
1807
+ () => callUpdate(instance, "computed"),
1808
+ mutationOptions
1809
+ );
1809
1810
  }
1810
1811
  function disconnectComputedUpdates(instance) {
1811
- instances$1 == null ? void 0 : instances$1.delete(instance);
1812
+ var _a;
1813
+ (_a = instance._computedObserver) == null ? void 0 : _a.disconnect();
1814
+ delete instance._computedObserver;
1812
1815
  resetComputed(instance);
1813
1816
  }
1814
1817
  function resetComputed(instance) {
@@ -1816,23 +1819,6 @@
1816
1819
  instance._computed = {};
1817
1820
  return values;
1818
1821
  }
1819
- let observer;
1820
- let instances$1;
1821
- function registerComputedObserver() {
1822
- if (observer) {
1823
- return;
1824
- }
1825
- instances$1 = /* @__PURE__ */ new Set();
1826
- observer = new MutationObserver(() => {
1827
- for (const instance of instances$1) {
1828
- callUpdate(instance, "computed");
1829
- }
1830
- });
1831
- observer.observe(document, {
1832
- subtree: true,
1833
- childList: true
1834
- });
1835
- }
1836
1822
 
1837
1823
  function initEvents(instance) {
1838
1824
  instance._events = [];
@@ -1917,7 +1903,7 @@
1917
1903
  if (!includes(targets, target)) {
1918
1904
  if (observer.unobserve) {
1919
1905
  observer.unobserve(target);
1920
- } else {
1906
+ } else if (observer.observe) {
1921
1907
  observer.disconnect();
1922
1908
  }
1923
1909
  }
@@ -2192,7 +2178,7 @@
2192
2178
  };
2193
2179
  App.util = util;
2194
2180
  App.options = {};
2195
- App.version = "3.19.5-dev.c20f30a07";
2181
+ App.version = "3.19.5-dev.c70b3862f";
2196
2182
 
2197
2183
  const PREFIX = "uk-";
2198
2184
  const DATA = "__uikit__";
@@ -3582,7 +3568,8 @@
3582
3568
  document,
3583
3569
  `${pointerUp} ${pointerCancel} scroll`,
3584
3570
  ({ defaultPrevented, type, target: newTarget }) => {
3585
- if (!defaultPrevented && type === pointerUp && target === newTarget && !(drop.targetEl && within(target, drop.targetEl))) {
3571
+ var _a;
3572
+ if (!defaultPrevented && type === pointerUp && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {
3586
3573
  drop.hide(false);
3587
3574
  }
3588
3575
  },
@@ -3978,6 +3965,11 @@
3978
3965
  firstColumn: "uk-first-column"
3979
3966
  },
3980
3967
  observe: [
3968
+ mutation({
3969
+ options: {
3970
+ childList: true
3971
+ }
3972
+ }),
3981
3973
  mutation({
3982
3974
  options: {
3983
3975
  attributes: true,
@@ -4289,7 +4281,10 @@
4289
4281
  target: ""
4290
4282
  },
4291
4283
  computed: {
4292
- target: ({ target }, $el) => query(target, $el)
4284
+ target: {
4285
+ get: ({ target }, $el) => query(target, $el),
4286
+ observe: ({ target }) => target
4287
+ }
4293
4288
  },
4294
4289
  observe: resize({ target: ({ target }) => target }),
4295
4290
  update: {
@@ -4558,7 +4553,7 @@
4558
4553
  i18n: { toggle: "Open Search", submit: "Submit Search" },
4559
4554
  beforeConnect() {
4560
4555
  const isToggle = hasClass(this.$el, "uk-search-toggle") || hasClass(this.$el, "uk-navbar-toggle");
4561
- 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;
4556
+ 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;
4562
4557
  if (hasAttr(this.$el, "aria-label")) {
4563
4558
  return;
4564
4559
  }
@@ -4835,6 +4830,8 @@
4835
4830
  })
4836
4831
  ];
4837
4832
  return {
4833
+ observe: observer.observe.bind(observer),
4834
+ unobserve: observer.unobserve.bind(observer),
4838
4835
  disconnect() {
4839
4836
  observer.disconnect();
4840
4837
  listener.map((off) => off());
@@ -5218,10 +5215,11 @@
5218
5215
  };
5219
5216
  function install({ modal }) {
5220
5217
  modal.dialog = function(content, options) {
5221
- const dialog = modal(
5222
- `<div class="uk-modal"> <div class="uk-modal-dialog">${content}</div> </div>`,
5223
- { stack: true, role: "alertdialog", ...options }
5224
- );
5218
+ const dialog = modal($(`<div><div class="uk-modal-dialog">${content}</div></div>`), {
5219
+ stack: true,
5220
+ role: "alertdialog",
5221
+ ...options
5222
+ });
5225
5223
  dialog.show();
5226
5224
  on(
5227
5225
  dialog.$el,
@@ -5693,7 +5691,6 @@
5693
5691
  }
5694
5692
  trigger(el, inview ? "inview" : "outview");
5695
5693
  state.inview = inview;
5696
- this.$update(el);
5697
5694
  }
5698
5695
  }
5699
5696
  };
@@ -5840,7 +5837,7 @@
5840
5837
  target: () => document.scrollingElement,
5841
5838
  options: { box: "content-box" }
5842
5839
  }),
5843
- resize({ target: ({ $el }) => $el })
5840
+ resize()
5844
5841
  ],
5845
5842
  events: [
5846
5843
  {
@@ -6133,10 +6130,7 @@
6133
6130
  }
6134
6131
 
6135
6132
  function getMaxPathLength(el) {
6136
- return Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => {
6137
- var _a;
6138
- return (_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke);
6139
- })));
6133
+ return isVisible(el) ? Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => stroke.getTotalLength()))) : 0;
6140
6134
  }
6141
6135
 
6142
6136
  var svg = {
@@ -6260,7 +6254,10 @@
6260
6254
  swiping: true
6261
6255
  },
6262
6256
  computed: {
6263
- connects: ({ connect }, $el) => queryAll(connect, $el),
6257
+ connects: {
6258
+ get: ({ connect }, $el) => queryAll(connect, $el),
6259
+ observe: ({ connect }) => connect
6260
+ },
6264
6261
  connectChildren() {
6265
6262
  return this.connects.map((el) => children(el)).flat();
6266
6263
  },
@@ -6449,9 +6446,12 @@
6449
6446
  queued: true
6450
6447
  },
6451
6448
  computed: {
6452
- target({ target }, $el) {
6453
- target = queryAll(target || $el.hash, $el);
6454
- return target.length ? target : [$el];
6449
+ target: {
6450
+ get: ({ target }, $el) => {
6451
+ target = queryAll(target || $el.hash, $el);
6452
+ return target.length ? target : [$el];
6453
+ },
6454
+ observe: ({ target }) => target
6455
6455
  }
6456
6456
  },
6457
6457
  connected() {