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
package/dist/js/uikit.js CHANGED
@@ -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
  });
@@ -3262,6 +3254,7 @@
3262
3254
  }
3263
3255
  }
3264
3256
  }
3257
+ const mutationOptions = { subtree: true, childList: true };
3265
3258
  function registerComputed(instance, key, cb) {
3266
3259
  instance._hasComputed = true;
3267
3260
  Object.defineProperty(instance, key, {
@@ -3270,6 +3263,15 @@
3270
3263
  const { _computed, $props, $el } = instance;
3271
3264
  if (!hasOwn(_computed, key)) {
3272
3265
  _computed[key] = (cb.get || cb).call(instance, $props, $el);
3266
+ if (cb.observe && instance._computedObserver) {
3267
+ const observeEl = cb.observe.call(instance, _computed[key]);
3268
+ if (observeEl && observeEl !== $el) {
3269
+ instance._computedObserver.observe(
3270
+ findClosestCommonParent(observeEl, $el),
3271
+ mutationOptions
3272
+ );
3273
+ }
3274
+ }
3273
3275
  }
3274
3276
  return _computed[key];
3275
3277
  },
@@ -3290,11 +3292,16 @@
3290
3292
  read: () => runWatches(instance, resetComputed(instance)),
3291
3293
  events: ["resize", "computed"]
3292
3294
  });
3293
- registerComputedObserver();
3294
- instances$1.add(instance);
3295
+ instance._computedObserver = observeMutation(
3296
+ instance.$el,
3297
+ () => callUpdate(instance, "computed"),
3298
+ mutationOptions
3299
+ );
3295
3300
  }
3296
3301
  function disconnectComputedUpdates(instance) {
3297
- instances$1 == null ? void 0 : instances$1.delete(instance);
3302
+ var _a;
3303
+ (_a = instance._computedObserver) == null ? void 0 : _a.disconnect();
3304
+ delete instance._computedObserver;
3298
3305
  resetComputed(instance);
3299
3306
  }
3300
3307
  function resetComputed(instance) {
@@ -3302,22 +3309,11 @@
3302
3309
  instance._computed = {};
3303
3310
  return values;
3304
3311
  }
3305
- let observer;
3306
- let instances$1;
3307
- function registerComputedObserver() {
3308
- if (observer) {
3309
- return;
3312
+ function findClosestCommonParent(el1, el2) {
3313
+ while (el1 && !el1.contains(el2)) {
3314
+ el1 = el1.parentNode;
3310
3315
  }
3311
- instances$1 = /* @__PURE__ */ new Set();
3312
- observer = new MutationObserver(() => {
3313
- for (const instance of instances$1) {
3314
- callUpdate(instance, "computed");
3315
- }
3316
- });
3317
- observer.observe(document, {
3318
- subtree: true,
3319
- childList: true
3320
- });
3316
+ return el1;
3321
3317
  }
3322
3318
 
3323
3319
  function initEvents(instance) {
@@ -3388,18 +3384,30 @@
3388
3384
  }
3389
3385
  const targets = hasOwn(instance, key) ? instance[key] : target;
3390
3386
  const observer = observe(targets, handler, options, args);
3391
- if (isFunction(target) && isArray(instance[key]) && observer.unobserve) {
3392
- registerWatch(instance, { handler: updateTargets(observer), immediate: false }, key);
3387
+ if (isFunction(target) && isArray(instance[key])) {
3388
+ registerWatch(
3389
+ instance,
3390
+ { handler: updateTargets(observer, options), immediate: false },
3391
+ key
3392
+ );
3393
3393
  }
3394
3394
  registerObserver(instance, observer);
3395
3395
  }
3396
- function updateTargets(observer) {
3396
+ function updateTargets(observer, options) {
3397
3397
  return (targets, prev) => {
3398
3398
  for (const target of prev) {
3399
- !includes(targets, target) && observer.unobserve(target);
3399
+ if (!includes(targets, target)) {
3400
+ if (observer.unobserve) {
3401
+ observer.unobserve(target);
3402
+ } else if (observer.observe) {
3403
+ observer.disconnect();
3404
+ }
3405
+ }
3400
3406
  }
3401
3407
  for (const target of targets) {
3402
- !includes(prev, target) && observer.observe(target);
3408
+ if (!includes(prev, target) || !observer.unobserve) {
3409
+ observer.observe(target, options);
3410
+ }
3403
3411
  }
3404
3412
  };
3405
3413
  }
@@ -3559,26 +3567,26 @@
3559
3567
  };
3560
3568
  App.util = util;
3561
3569
  App.options = {};
3562
- App.version = "3.19.5-dev.8317c4705";
3570
+ App.version = "3.19.5-dev.97cca0902";
3563
3571
 
3564
3572
  const PREFIX = "uk-";
3565
3573
  const DATA = "__uikit__";
3566
3574
  const components$2 = {};
3567
3575
  function component(name, options) {
3568
- var _a;
3576
+ var _a, _b;
3569
3577
  const id = PREFIX + hyphenate(name);
3570
3578
  if (!options) {
3571
- if (isPlainObject(components$2[id])) {
3579
+ if (!components$2[id].options) {
3572
3580
  components$2[id] = App.extend(components$2[id]);
3573
3581
  }
3574
3582
  return components$2[id];
3575
3583
  }
3576
3584
  name = camelize(name);
3577
3585
  App[name] = (element, data) => createComponent(name, element, data);
3578
- const opt = isPlainObject(options) ? { ...options } : options.options;
3586
+ const opt = (_a = options.options) != null ? _a : { ...options };
3579
3587
  opt.id = id;
3580
3588
  opt.name = name;
3581
- (_a = opt.install) == null ? void 0 : _a.call(opt, App, opt, name);
3589
+ (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);
3582
3590
  if (App._initialized && !opt.functional) {
3583
3591
  requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
3584
3592
  }
@@ -3586,7 +3594,7 @@
3586
3594
  }
3587
3595
  function createComponent(name, element, data, ...args) {
3588
3596
  const Component = component(name);
3589
- return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? $$(element).map(init)[0] : init();
3597
+ return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? findAll(element).map(init)[0] : init();
3590
3598
  function init(element2) {
3591
3599
  const instance = getComponent(element2, name);
3592
3600
  if (instance) {
@@ -3948,7 +3956,6 @@
3948
3956
  }
3949
3957
  }
3950
3958
  },
3951
- observe: resize(),
3952
3959
  events: {
3953
3960
  itemshow({ target }) {
3954
3961
  addClass(target, this.clsEnter, this.clsSlideActive);
@@ -4077,6 +4084,7 @@
4077
4084
  return { animation: this.animation };
4078
4085
  }
4079
4086
  },
4087
+ observe: resize(),
4080
4088
  events: {
4081
4089
  beforeitemshow({ target }) {
4082
4090
  addClass(target, this.clsActive);
@@ -4559,18 +4567,10 @@
4559
4567
  }
4560
4568
 
4561
4569
  function getMaxPathLength(el) {
4562
- return Math.ceil(
4563
- Math.max(
4564
- 0,
4565
- ...$$("[stroke]", el).map((stroke) => {
4566
- try {
4567
- return stroke.getTotalLength();
4568
- } catch (e) {
4569
- return 0;
4570
- }
4571
- })
4572
- )
4573
- );
4570
+ return Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => {
4571
+ var _a;
4572
+ return (_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke);
4573
+ })));
4574
4574
  }
4575
4575
 
4576
4576
  const props = {
@@ -5277,7 +5277,7 @@
5277
5277
  toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));
5278
5278
  },
5279
5279
  observe: resize({
5280
- target: ({ slides }) => slides
5280
+ target: ({ slides, $el }) => [$el, ...slides]
5281
5281
  }),
5282
5282
  update: {
5283
5283
  write() {
@@ -5465,7 +5465,7 @@
5465
5465
  var sliderParallax = {
5466
5466
  mixins: [Parallax],
5467
5467
  beforeConnect() {
5468
- this.item = closest(this.$el, `.${this.$options.id.replace("parallax", "items")} > *`);
5468
+ this.item = this.$el.closest(`.${this.$options.id.replace("parallax", "items")} > *`);
5469
5469
  },
5470
5470
  disconnected() {
5471
5471
  this.item = null;
@@ -6402,14 +6402,14 @@
6402
6402
  if (name) {
6403
6403
  if (hasAttr(target, attributeName)) {
6404
6404
  createComponent(name, target);
6405
- return;
6405
+ } else {
6406
+ (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
6406
6407
  }
6407
- (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
6408
6408
  }
6409
6409
  }
6410
6410
  function connect(node) {
6411
6411
  const components2 = getComponents(node);
6412
- for (const name in getComponents(node)) {
6412
+ for (const name in components2) {
6413
6413
  callConnected(components2[name]);
6414
6414
  }
6415
6415
  for (const attributeName of node.getAttributeNames()) {
@@ -6419,7 +6419,7 @@
6419
6419
  }
6420
6420
  function disconnect(node) {
6421
6421
  const components2 = getComponents(node);
6422
- for (const name in getComponents(node)) {
6422
+ for (const name in components2) {
6423
6423
  callDisconnected(components2[name]);
6424
6424
  }
6425
6425
  }
@@ -6428,7 +6428,7 @@
6428
6428
  attribute = attribute.slice(5);
6429
6429
  }
6430
6430
  const cmp = components$2[attribute];
6431
- return cmp && (isPlainObject(cmp) ? cmp : cmp.options).name;
6431
+ return cmp && (cmp.options || cmp).name;
6432
6432
  }
6433
6433
 
6434
6434
  globalApi(App);
@@ -7171,7 +7171,8 @@
7171
7171
  document,
7172
7172
  `${pointerUp$1} ${pointerCancel} scroll`,
7173
7173
  ({ defaultPrevented, type, target: newTarget }) => {
7174
- if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !(drop.targetEl && within(target, drop.targetEl))) {
7174
+ var _a;
7175
+ if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {
7175
7176
  drop.hide(false);
7176
7177
  }
7177
7178
  },
@@ -7787,7 +7788,10 @@
7787
7788
  target: ""
7788
7789
  },
7789
7790
  computed: {
7790
- target: ({ target }, $el) => query(target, $el)
7791
+ target: {
7792
+ get: ({ target }, $el) => query(target, $el),
7793
+ observe: (target) => parent(target)
7794
+ }
7791
7795
  },
7792
7796
  observe: resize({ target: ({ target }) => target }),
7793
7797
  update: {
@@ -7843,7 +7847,7 @@
7843
7847
  const top = offsetPosition(offsetTopEl)[0] - offsetPosition(scrollElement)[0];
7844
7848
  minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : "";
7845
7849
  } else {
7846
- minHeight += ` - ${css(scrollElement, "paddingTop")}`;
7850
+ minHeight += ` - ${boxModelAdjust(scrollElement, "height", css(scrollElement, "boxSizing"))}px`;
7847
7851
  }
7848
7852
  }
7849
7853
  if (this.offsetBottom === true) {
@@ -8037,7 +8041,7 @@
8037
8041
  i18n: { toggle: "Open Search", submit: "Submit Search" },
8038
8042
  beforeConnect() {
8039
8043
  const isToggle = hasClass(this.$el, "uk-search-toggle") || hasClass(this.$el, "uk-navbar-toggle");
8040
- 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;
8044
+ 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;
8041
8045
  if (hasAttr(this.$el, "aria-label")) {
8042
8046
  return;
8043
8047
  }
@@ -8181,13 +8185,13 @@
8181
8185
  delete this.img;
8182
8186
  },
8183
8187
  observe: intersection({
8184
- target: ({ $el, $props }) => [$el, ...queryAll($props.target, $el)],
8185
8188
  handler(entries, observer) {
8186
8189
  this.load();
8187
8190
  observer.disconnect();
8188
8191
  },
8189
8192
  options: ({ margin }) => ({ rootMargin: margin }),
8190
- filter: ({ loading }) => loading === "lazy"
8193
+ filter: ({ loading }) => loading === "lazy",
8194
+ target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
8191
8195
  }),
8192
8196
  methods: {
8193
8197
  load() {
@@ -8277,9 +8281,17 @@
8277
8281
  selActive: false
8278
8282
  },
8279
8283
  computed: {
8280
- target: ({ target }, $el) => target ? $$(target, $el) : [$el]
8284
+ target: ({ target }, $el) => target ? $$(target, $el) : $el
8281
8285
  },
8282
8286
  observe: [
8287
+ intersection({
8288
+ handler(entries) {
8289
+ this.isIntersecting = entries.some(({ isIntersecting }) => isIntersecting);
8290
+ this.$emit();
8291
+ },
8292
+ target: ({ target }) => target,
8293
+ args: { intersecting: false }
8294
+ }),
8283
8295
  mutation({
8284
8296
  target: ({ target }) => target,
8285
8297
  options: { attributes: true, attributeFilter: ["class"], attributeOldValue: true }
@@ -8287,7 +8299,10 @@
8287
8299
  {
8288
8300
  target: ({ target }) => target,
8289
8301
  observe: (target, handler) => {
8290
- const observer = observeResize([...target, document.documentElement], handler);
8302
+ const observer = observeResize(
8303
+ [...toNodes(target), document.documentElement],
8304
+ handler
8305
+ );
8291
8306
  const listener = [
8292
8307
  on(document, "scroll itemshown itemhidden", handler, {
8293
8308
  passive: true,
@@ -8303,6 +8318,8 @@
8303
8318
  })
8304
8319
  ];
8305
8320
  return {
8321
+ observe: observer.observe.bind(observer),
8322
+ unobserve: observer.unobserve.bind(observer),
8306
8323
  disconnect() {
8307
8324
  observer.disconnect();
8308
8325
  listener.map((off) => off());
@@ -8316,7 +8333,10 @@
8316
8333
  ],
8317
8334
  update: {
8318
8335
  read() {
8319
- for (const target of this.target) {
8336
+ if (!this.isIntersecting) {
8337
+ return false;
8338
+ }
8339
+ for (const target of toNodes(this.target)) {
8320
8340
  replaceClass(
8321
8341
  target,
8322
8342
  "uk-light,uk-dark",
@@ -9466,7 +9486,10 @@
9466
9486
  swiping: true
9467
9487
  },
9468
9488
  computed: {
9469
- connects: ({ connect }, $el) => queryAll(connect, $el),
9489
+ connects: {
9490
+ get: ({ connect }, $el) => queryAll(connect, $el),
9491
+ observe: (connects) => parent(connects[0])
9492
+ },
9470
9493
  connectChildren() {
9471
9494
  return this.connects.map((el) => children(el)).flat();
9472
9495
  },
@@ -9655,9 +9678,12 @@
9655
9678
  queued: true
9656
9679
  },
9657
9680
  computed: {
9658
- target({ target }, $el) {
9659
- target = queryAll(target || $el.hash, $el);
9660
- return target.length ? target : [$el];
9681
+ target: {
9682
+ get: ({ target }, $el) => {
9683
+ target = queryAll(target || $el.hash, $el);
9684
+ return target.length ? target : [$el];
9685
+ },
9686
+ observe: (target) => parent(target[0])
9661
9687
  }
9662
9688
  },
9663
9689
  connected() {