uikit 3.19.5-dev.a8d51a358 → 3.19.5-dev.b0b54f9e4

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 (54) 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 +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 +6 -4
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +7 -5
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +6 -4
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +7 -5
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +6 -4
  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 +50 -43
  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 +56 -47
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/computed.js +24 -23
  44. package/src/js/components/slider-parallax.js +2 -2
  45. package/src/js/core/drop.js +1 -2
  46. package/src/js/core/height-placeholder.js +5 -2
  47. package/src/js/core/icon.js +2 -3
  48. package/src/js/core/modal.js +5 -6
  49. package/src/js/core/switcher.js +5 -1
  50. package/src/js/core/toggle.js +7 -3
  51. package/src/js/mixin/parallax.js +7 -3
  52. package/src/js/util/filter.js +7 -14
  53. package/src/less/components/utility.less +1 -1
  54. package/src/scss/components/utility.scss +1 -1
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.19.5-dev.a8d51a358 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.19.5-dev.b0b54f9e4 | 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() :
@@ -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)) {
@@ -1567,7 +1561,6 @@
1567
1561
  camelize: camelize,
1568
1562
  children: children,
1569
1563
  clamp: clamp,
1570
- closest: closest,
1571
1564
  createEvent: createEvent,
1572
1565
  css: css,
1573
1566
  data: data,
@@ -1688,7 +1681,6 @@
1688
1681
  uniqueBy: uniqueBy,
1689
1682
  unwrap: unwrap,
1690
1683
  width: width,
1691
- within: within,
1692
1684
  wrapAll: wrapAll,
1693
1685
  wrapInner: wrapInner
1694
1686
  });
@@ -3263,6 +3255,7 @@
3263
3255
  }
3264
3256
  }
3265
3257
  }
3258
+ const mutationOptions = { subtree: true, childList: true };
3266
3259
  function registerComputed(instance, key, cb) {
3267
3260
  instance._hasComputed = true;
3268
3261
  Object.defineProperty(instance, key, {
@@ -3271,6 +3264,15 @@
3271
3264
  const { _computed, $props, $el } = instance;
3272
3265
  if (!hasOwn(_computed, key)) {
3273
3266
  _computed[key] = (cb.get || cb).call(instance, $props, $el);
3267
+ if (cb.observe && instance._computedObserver) {
3268
+ const observeEl = cb.observe.call(instance, _computed[key]);
3269
+ if (observeEl && observeEl !== $el) {
3270
+ instance._computedObserver.observe(
3271
+ findClosestCommonParent(observeEl, $el),
3272
+ mutationOptions
3273
+ );
3274
+ }
3275
+ }
3274
3276
  }
3275
3277
  return _computed[key];
3276
3278
  },
@@ -3291,11 +3293,16 @@
3291
3293
  read: () => runWatches(instance, resetComputed(instance)),
3292
3294
  events: ["resize", "computed"]
3293
3295
  });
3294
- registerComputedObserver();
3295
- instances$1.add(instance);
3296
+ instance._computedObserver = observeMutation(
3297
+ instance.$el,
3298
+ () => callUpdate(instance, "computed"),
3299
+ mutationOptions
3300
+ );
3296
3301
  }
3297
3302
  function disconnectComputedUpdates(instance) {
3298
- instances$1 == null ? void 0 : instances$1.delete(instance);
3303
+ var _a;
3304
+ (_a = instance._computedObserver) == null ? void 0 : _a.disconnect();
3305
+ delete instance._computedObserver;
3299
3306
  resetComputed(instance);
3300
3307
  }
3301
3308
  function resetComputed(instance) {
@@ -3303,22 +3310,11 @@
3303
3310
  instance._computed = {};
3304
3311
  return values;
3305
3312
  }
3306
- let observer;
3307
- let instances$1;
3308
- function registerComputedObserver() {
3309
- if (observer) {
3310
- return;
3313
+ function findClosestCommonParent(el1, el2) {
3314
+ while (el1 && !el1.contains(el2)) {
3315
+ el1 = el1.parentNode;
3311
3316
  }
3312
- instances$1 = /* @__PURE__ */ new Set();
3313
- observer = new MutationObserver(() => {
3314
- for (const instance of instances$1) {
3315
- callUpdate(instance, "computed");
3316
- }
3317
- });
3318
- observer.observe(document, {
3319
- subtree: true,
3320
- childList: true
3321
- });
3317
+ return el1;
3322
3318
  }
3323
3319
 
3324
3320
  function initEvents(instance) {
@@ -3572,7 +3568,7 @@
3572
3568
  };
3573
3569
  App.util = util;
3574
3570
  App.options = {};
3575
- App.version = "3.19.5-dev.a8d51a358";
3571
+ App.version = "3.19.5-dev.b0b54f9e4";
3576
3572
 
3577
3573
  const PREFIX = "uk-";
3578
3574
  const DATA = "__uikit__";
@@ -4779,6 +4775,7 @@
4779
4775
  }
4780
4776
  };
4781
4777
  }
4778
+ const loading = {};
4782
4779
  const dimensions = {};
4783
4780
  function getBackgroundImageDimensions(el) {
4784
4781
  const src = css(el, "backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/, "$1");
@@ -4788,11 +4785,12 @@
4788
4785
  const image = new Image();
4789
4786
  if (src) {
4790
4787
  image.src = src;
4791
- if (!image.naturalWidth) {
4792
- image.onload = () => {
4788
+ if (!image.naturalWidth && !loading[src]) {
4789
+ once(image, "error load", () => {
4793
4790
  dimensions[src] = toDimensions(image);
4794
4791
  trigger(el, createEvent("load", false));
4795
- };
4792
+ });
4793
+ loading[src] = true;
4796
4794
  return toDimensions(image);
4797
4795
  }
4798
4796
  }
@@ -5470,7 +5468,7 @@
5470
5468
  var sliderParallax = {
5471
5469
  mixins: [Parallax],
5472
5470
  beforeConnect() {
5473
- this.item = closest(this.$el, `.${this.$options.id.replace("parallax", "items")} > *`);
5471
+ this.item = this.$el.closest(`.${this.$options.id.replace("parallax", "items")} > *`);
5474
5472
  },
5475
5473
  disconnected() {
5476
5474
  this.item = null;
@@ -7176,7 +7174,8 @@
7176
7174
  document,
7177
7175
  `${pointerUp$1} ${pointerCancel} scroll`,
7178
7176
  ({ defaultPrevented, type, target: newTarget }) => {
7179
- if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !(drop.targetEl && within(target, drop.targetEl))) {
7177
+ var _a;
7178
+ if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {
7180
7179
  drop.hide(false);
7181
7180
  }
7182
7181
  },
@@ -7792,7 +7791,10 @@
7792
7791
  target: ""
7793
7792
  },
7794
7793
  computed: {
7795
- target: ({ target }, $el) => query(target, $el)
7794
+ target: {
7795
+ get: ({ target }, $el) => query(target, $el),
7796
+ observe: (target) => parent(target)
7797
+ }
7796
7798
  },
7797
7799
  observe: resize({ target: ({ target }) => target }),
7798
7800
  update: {
@@ -8042,7 +8044,7 @@
8042
8044
  i18n: { toggle: "Open Search", submit: "Submit Search" },
8043
8045
  beforeConnect() {
8044
8046
  const isToggle = hasClass(this.$el, "uk-search-toggle") || hasClass(this.$el, "uk-navbar-toggle");
8045
- 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;
8047
+ 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;
8046
8048
  if (hasAttr(this.$el, "aria-label")) {
8047
8049
  return;
8048
8050
  }
@@ -8452,10 +8454,11 @@
8452
8454
  };
8453
8455
  function install({ modal }) {
8454
8456
  modal.dialog = function(content, options) {
8455
- const dialog = modal(
8456
- `<div class="uk-modal"> <div class="uk-modal-dialog">${content}</div> </div>`,
8457
- { stack: true, role: "alertdialog", ...options }
8458
- );
8457
+ const dialog = modal($(`<div><div class="uk-modal-dialog">${content}</div></div>`), {
8458
+ stack: true,
8459
+ role: "alertdialog",
8460
+ ...options
8461
+ });
8459
8462
  dialog.show();
8460
8463
  on(
8461
8464
  dialog.$el,
@@ -9487,7 +9490,10 @@
9487
9490
  swiping: true
9488
9491
  },
9489
9492
  computed: {
9490
- connects: ({ connect }, $el) => queryAll(connect, $el),
9493
+ connects: {
9494
+ get: ({ connect }, $el) => queryAll(connect, $el),
9495
+ observe: (connects) => parent(connects[0])
9496
+ },
9491
9497
  connectChildren() {
9492
9498
  return this.connects.map((el) => children(el)).flat();
9493
9499
  },
@@ -9676,9 +9682,12 @@
9676
9682
  queued: true
9677
9683
  },
9678
9684
  computed: {
9679
- target({ target }, $el) {
9680
- target = queryAll(target || $el.hash, $el);
9681
- return target.length ? target : [$el];
9685
+ target: {
9686
+ get: ({ target }, $el) => {
9687
+ target = queryAll(target || $el.hash, $el);
9688
+ return target.length ? target : [$el];
9689
+ },
9690
+ observe: (target) => parent(target[0])
9682
9691
  }
9683
9692
  },
9684
9693
  connected() {