uikit 3.19.5-dev.c75dd5d38 → 3.19.5-dev.e37e46798

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 +7 -6
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +8 -7
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +8 -8
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +8 -7
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +8 -7
  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 +78 -64
  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 +81 -67
  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 +1 -1
  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 +13 -6
  55. package/src/js/core/modal.js +5 -6
  56. package/src/js/core/switcher.js +5 -1
  57. package/src/js/core/toggle.js +7 -3
  58. package/src/js/mixin/slider.js +0 -3
  59. package/src/js/mixin/slideshow.js +3 -0
  60. package/src/js/util/filter.js +1 -11
  61. package/src/js/util/lang.js +1 -1
  62. package/src/js/util/selector.js +5 -5
  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.c75dd5d38 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.19.5-dev.e37e46798 | 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) {
@@ -3403,7 +3399,7 @@
3403
3399
  if (!includes(targets, target)) {
3404
3400
  if (observer.unobserve) {
3405
3401
  observer.unobserve(target);
3406
- } else {
3402
+ } else if (observer.observe) {
3407
3403
  observer.disconnect();
3408
3404
  }
3409
3405
  }
@@ -3571,26 +3567,26 @@
3571
3567
  };
3572
3568
  App.util = util;
3573
3569
  App.options = {};
3574
- App.version = "3.19.5-dev.c75dd5d38";
3570
+ App.version = "3.19.5-dev.e37e46798";
3575
3571
 
3576
3572
  const PREFIX = "uk-";
3577
3573
  const DATA = "__uikit__";
3578
3574
  const components$2 = {};
3579
3575
  function component(name, options) {
3580
- var _a;
3576
+ var _a, _b;
3581
3577
  const id = PREFIX + hyphenate(name);
3582
3578
  if (!options) {
3583
- if (isPlainObject(components$2[id])) {
3579
+ if (!components$2[id].options) {
3584
3580
  components$2[id] = App.extend(components$2[id]);
3585
3581
  }
3586
3582
  return components$2[id];
3587
3583
  }
3588
3584
  name = camelize(name);
3589
3585
  App[name] = (element, data) => createComponent(name, element, data);
3590
- const opt = isPlainObject(options) ? { ...options } : options.options;
3586
+ const opt = (_a = options.options) != null ? _a : { ...options };
3591
3587
  opt.id = id;
3592
3588
  opt.name = name;
3593
- (_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);
3594
3590
  if (App._initialized && !opt.functional) {
3595
3591
  requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
3596
3592
  }
@@ -3598,7 +3594,7 @@
3598
3594
  }
3599
3595
  function createComponent(name, element, data, ...args) {
3600
3596
  const Component = component(name);
3601
- 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();
3602
3598
  function init(element2) {
3603
3599
  const instance = getComponent(element2, name);
3604
3600
  if (instance) {
@@ -3960,7 +3956,6 @@
3960
3956
  }
3961
3957
  }
3962
3958
  },
3963
- observe: resize(),
3964
3959
  events: {
3965
3960
  itemshow({ target }) {
3966
3961
  addClass(target, this.clsEnter, this.clsSlideActive);
@@ -4089,6 +4084,7 @@
4089
4084
  return { animation: this.animation };
4090
4085
  }
4091
4086
  },
4087
+ observe: resize(),
4092
4088
  events: {
4093
4089
  beforeitemshow({ target }) {
4094
4090
  addClass(target, this.clsActive);
@@ -5281,7 +5277,7 @@
5281
5277
  toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));
5282
5278
  },
5283
5279
  observe: resize({
5284
- target: ({ slides }) => slides
5280
+ target: ({ slides, $el }) => [$el, ...slides]
5285
5281
  }),
5286
5282
  update: {
5287
5283
  write() {
@@ -5469,7 +5465,7 @@
5469
5465
  var sliderParallax = {
5470
5466
  mixins: [Parallax],
5471
5467
  beforeConnect() {
5472
- this.item = closest(this.$el, `.${this.$options.id.replace("parallax", "items")} > *`);
5468
+ this.item = this.$el.closest(`.${this.$options.id.replace("parallax", "items")} > *`);
5473
5469
  },
5474
5470
  disconnected() {
5475
5471
  this.item = null;
@@ -6406,14 +6402,14 @@
6406
6402
  if (name) {
6407
6403
  if (hasAttr(target, attributeName)) {
6408
6404
  createComponent(name, target);
6409
- return;
6405
+ } else {
6406
+ (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
6410
6407
  }
6411
- (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
6412
6408
  }
6413
6409
  }
6414
6410
  function connect(node) {
6415
6411
  const components2 = getComponents(node);
6416
- for (const name in getComponents(node)) {
6412
+ for (const name in components2) {
6417
6413
  callConnected(components2[name]);
6418
6414
  }
6419
6415
  for (const attributeName of node.getAttributeNames()) {
@@ -6423,7 +6419,7 @@
6423
6419
  }
6424
6420
  function disconnect(node) {
6425
6421
  const components2 = getComponents(node);
6426
- for (const name in getComponents(node)) {
6422
+ for (const name in components2) {
6427
6423
  callDisconnected(components2[name]);
6428
6424
  }
6429
6425
  }
@@ -6432,7 +6428,7 @@
6432
6428
  attribute = attribute.slice(5);
6433
6429
  }
6434
6430
  const cmp = components$2[attribute];
6435
- return cmp && (isPlainObject(cmp) ? cmp : cmp.options).name;
6431
+ return cmp && (cmp.options || cmp).name;
6436
6432
  }
6437
6433
 
6438
6434
  globalApi(App);
@@ -7175,7 +7171,8 @@
7175
7171
  document,
7176
7172
  `${pointerUp$1} ${pointerCancel} scroll`,
7177
7173
  ({ defaultPrevented, type, target: newTarget }) => {
7178
- 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))) {
7179
7176
  drop.hide(false);
7180
7177
  }
7181
7178
  },
@@ -7791,7 +7788,10 @@
7791
7788
  target: ""
7792
7789
  },
7793
7790
  computed: {
7794
- target: ({ target }, $el) => query(target, $el)
7791
+ target: {
7792
+ get: ({ target }, $el) => query(target, $el),
7793
+ observe: (target) => parent(target)
7794
+ }
7795
7795
  },
7796
7796
  observe: resize({ target: ({ target }) => target }),
7797
7797
  update: {
@@ -7847,7 +7847,7 @@
7847
7847
  const top = offsetPosition(offsetTopEl)[0] - offsetPosition(scrollElement)[0];
7848
7848
  minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : "";
7849
7849
  } else {
7850
- minHeight += ` - ${css(scrollElement, "paddingTop")}`;
7850
+ minHeight += ` - ${boxModelAdjust(scrollElement, "height", css(scrollElement, "boxSizing"))}px`;
7851
7851
  }
7852
7852
  }
7853
7853
  if (this.offsetBottom === true) {
@@ -8041,7 +8041,7 @@
8041
8041
  i18n: { toggle: "Open Search", submit: "Submit Search" },
8042
8042
  beforeConnect() {
8043
8043
  const isToggle = hasClass(this.$el, "uk-search-toggle") || hasClass(this.$el, "uk-navbar-toggle");
8044
- 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;
8045
8045
  if (hasAttr(this.$el, "aria-label")) {
8046
8046
  return;
8047
8047
  }
@@ -8185,13 +8185,13 @@
8185
8185
  delete this.img;
8186
8186
  },
8187
8187
  observe: intersection({
8188
- target: ({ $el, $props }) => [$el, ...queryAll($props.target, $el)],
8189
8188
  handler(entries, observer) {
8190
8189
  this.load();
8191
8190
  observer.disconnect();
8192
8191
  },
8193
8192
  options: ({ margin }) => ({ rootMargin: margin }),
8194
- filter: ({ loading }) => loading === "lazy"
8193
+ filter: ({ loading }) => loading === "lazy",
8194
+ target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
8195
8195
  }),
8196
8196
  methods: {
8197
8197
  load() {
@@ -8281,13 +8281,15 @@
8281
8281
  selActive: false
8282
8282
  },
8283
8283
  computed: {
8284
- target: ({ target }, $el) => target ? $$(target, $el) : [$el]
8284
+ target: ({ target }, $el) => target ? $$(target, $el) : $el
8285
8285
  },
8286
8286
  observe: [
8287
8287
  intersection({
8288
- handler([{ isIntersecting }]) {
8289
- this.isIntersecting = isIntersecting;
8288
+ handler(entries) {
8289
+ this.isIntersecting = entries.some(({ isIntersecting }) => isIntersecting);
8290
+ this.$emit();
8290
8291
  },
8292
+ target: ({ target }) => target,
8291
8293
  args: { intersecting: false }
8292
8294
  }),
8293
8295
  mutation({
@@ -8297,7 +8299,10 @@
8297
8299
  {
8298
8300
  target: ({ target }) => target,
8299
8301
  observe: (target, handler) => {
8300
- const observer = observeResize([...target, document.documentElement], handler);
8302
+ const observer = observeResize(
8303
+ [...toNodes(target), document.documentElement],
8304
+ handler
8305
+ );
8301
8306
  const listener = [
8302
8307
  on(document, "scroll itemshown itemhidden", handler, {
8303
8308
  passive: true,
@@ -8313,6 +8318,8 @@
8313
8318
  })
8314
8319
  ];
8315
8320
  return {
8321
+ observe: observer.observe.bind(observer),
8322
+ unobserve: observer.unobserve.bind(observer),
8316
8323
  disconnect() {
8317
8324
  observer.disconnect();
8318
8325
  listener.map((off) => off());
@@ -8329,7 +8336,7 @@
8329
8336
  if (!this.isIntersecting) {
8330
8337
  return false;
8331
8338
  }
8332
- for (const target of this.target) {
8339
+ for (const target of toNodes(this.target)) {
8333
8340
  replaceClass(
8334
8341
  target,
8335
8342
  "uk-light,uk-dark",
@@ -8444,10 +8451,11 @@
8444
8451
  };
8445
8452
  function install({ modal }) {
8446
8453
  modal.dialog = function(content, options) {
8447
- const dialog = modal(
8448
- `<div class="uk-modal"> <div class="uk-modal-dialog">${content}</div> </div>`,
8449
- { stack: true, role: "alertdialog", ...options }
8450
- );
8454
+ const dialog = modal($(`<div><div class="uk-modal-dialog">${content}</div></div>`), {
8455
+ stack: true,
8456
+ role: "alertdialog",
8457
+ ...options
8458
+ });
8451
8459
  dialog.show();
8452
8460
  on(
8453
8461
  dialog.$el,
@@ -9479,7 +9487,10 @@
9479
9487
  swiping: true
9480
9488
  },
9481
9489
  computed: {
9482
- connects: ({ connect }, $el) => queryAll(connect, $el),
9490
+ connects: {
9491
+ get: ({ connect }, $el) => queryAll(connect, $el),
9492
+ observe: (connects) => parent(connects[0])
9493
+ },
9483
9494
  connectChildren() {
9484
9495
  return this.connects.map((el) => children(el)).flat();
9485
9496
  },
@@ -9668,9 +9679,12 @@
9668
9679
  queued: true
9669
9680
  },
9670
9681
  computed: {
9671
- target({ target }, $el) {
9672
- target = queryAll(target || $el.hash, $el);
9673
- return target.length ? target : [$el];
9682
+ target: {
9683
+ get: ({ target }, $el) => {
9684
+ target = queryAll(target || $el.hash, $el);
9685
+ return target.length ? target : [$el];
9686
+ },
9687
+ observe: (target) => parent(target[0])
9674
9688
  }
9675
9689
  },
9676
9690
  connected() {