uikit 3.19.5-dev.8317c4705 → 3.19.5-dev.a8d51a358

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 (53) hide show
  1. package/dist/css/uikit-core-rtl.css +1 -1
  2. package/dist/css/uikit-core-rtl.min.css +1 -1
  3. package/dist/css/uikit-core.css +1 -1
  4. package/dist/css/uikit-core.min.css +1 -1
  5. package/dist/css/uikit-rtl.css +1 -1
  6. package/dist/css/uikit-rtl.min.css +1 -1
  7. package/dist/css/uikit.css +1 -1
  8. package/dist/css/uikit.min.css +1 -1
  9. package/dist/js/components/countdown.js +1 -1
  10. package/dist/js/components/countdown.min.js +1 -1
  11. package/dist/js/components/filter.js +1 -1
  12. package/dist/js/components/filter.min.js +1 -1
  13. package/dist/js/components/lightbox-panel.js +55 -55
  14. package/dist/js/components/lightbox-panel.min.js +1 -1
  15. package/dist/js/components/lightbox.js +55 -55
  16. package/dist/js/components/lightbox.min.js +1 -1
  17. package/dist/js/components/notification.js +1 -1
  18. package/dist/js/components/notification.min.js +1 -1
  19. package/dist/js/components/parallax.js +11 -18
  20. package/dist/js/components/parallax.min.js +1 -1
  21. package/dist/js/components/slider-parallax.js +11 -18
  22. package/dist/js/components/slider-parallax.min.js +1 -1
  23. package/dist/js/components/slider.js +12 -20
  24. package/dist/js/components/slider.min.js +1 -1
  25. package/dist/js/components/slideshow-parallax.js +11 -18
  26. package/dist/js/components/slideshow-parallax.min.js +1 -1
  27. package/dist/js/components/slideshow.js +12 -19
  28. package/dist/js/components/slideshow.min.js +1 -1
  29. package/dist/js/components/sortable.js +1 -1
  30. package/dist/js/components/sortable.min.js +1 -1
  31. package/dist/js/components/tooltip.js +1 -1
  32. package/dist/js/components/tooltip.min.js +1 -1
  33. package/dist/js/components/upload.js +1 -1
  34. package/dist/js/components/upload.min.js +1 -1
  35. package/dist/js/uikit-core.js +61 -40
  36. package/dist/js/uikit-core.min.js +1 -1
  37. package/dist/js/uikit-icons.js +1 -1
  38. package/dist/js/uikit-icons.min.js +1 -1
  39. package/dist/js/uikit.js +63 -42
  40. package/dist/js/uikit.min.js +1 -1
  41. package/package.json +1 -1
  42. package/src/js/api/boot.js +6 -7
  43. package/src/js/api/component.js +4 -4
  44. package/src/js/api/observer.js +17 -5
  45. package/src/js/components/slider.js +1 -1
  46. package/src/js/core/height-viewport.js +1 -1
  47. package/src/js/core/img.js +1 -1
  48. package/src/js/core/inverse.js +22 -5
  49. package/src/js/mixin/slider.js +0 -3
  50. package/src/js/mixin/slideshow.js +3 -0
  51. package/src/js/util/lang.js +1 -1
  52. package/src/js/util/selector.js +5 -5
  53. package/src/js/util/svg.js +1 -12
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.a8d51a358 | 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);
@@ -374,10 +374,11 @@
374
374
  const splitSelectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
375
375
  const trailingCommaRe = /\s*,$/;
376
376
  const parseSelector = memoize((selector) => {
377
+ var _a;
377
378
  selector = selector.replace(addStarRe, "$1 *");
378
379
  let isContextSelector = false;
379
380
  const selectors = [];
380
- for (let sel of selector.match(splitSelectorRe)) {
381
+ for (let sel of (_a = selector.match(splitSelectorRe)) != null ? _a : []) {
381
382
  sel = sel.replace(trailingCommaRe, "").trim();
382
383
  if (sel[0] === ">") {
383
384
  sel = `:scope ${sel}`;
@@ -405,7 +406,7 @@
405
406
  let ctx = context;
406
407
  if (sel[0] === "!") {
407
408
  const selectors = sel.substr(1).trim().split(" ");
408
- ctx = parent(context).closest(selectors[0]);
409
+ ctx = context.parentElement.closest(selectors[0]);
409
410
  sel = selectors.slice(1).join(" ").trim();
410
411
  if (!sel.length && isSingle) {
411
412
  return ctx;
@@ -421,9 +422,9 @@
421
422
  }
422
423
  } else if (sel[0] === "~" || sel[0] === "+" && isSingle) {
423
424
  return _doQuery(
424
- parent(context),
425
+ ctx.parentElement,
425
426
  queryFn,
426
- `:scope :nth-child(${index(context) + 1}) ${sel}`
427
+ `:scope :nth-child(${index(ctx) + 1}) ${sel}`
427
428
  );
428
429
  }
429
430
  if (ctx) {
@@ -3388,18 +3389,30 @@
3388
3389
  }
3389
3390
  const targets = hasOwn(instance, key) ? instance[key] : target;
3390
3391
  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);
3392
+ if (isFunction(target) && isArray(instance[key])) {
3393
+ registerWatch(
3394
+ instance,
3395
+ { handler: updateTargets(observer, options), immediate: false },
3396
+ key
3397
+ );
3393
3398
  }
3394
3399
  registerObserver(instance, observer);
3395
3400
  }
3396
- function updateTargets(observer) {
3401
+ function updateTargets(observer, options) {
3397
3402
  return (targets, prev) => {
3398
3403
  for (const target of prev) {
3399
- !includes(targets, target) && observer.unobserve(target);
3404
+ if (!includes(targets, target)) {
3405
+ if (observer.unobserve) {
3406
+ observer.unobserve(target);
3407
+ } else if (observer.observe) {
3408
+ observer.disconnect();
3409
+ }
3410
+ }
3400
3411
  }
3401
3412
  for (const target of targets) {
3402
- !includes(prev, target) && observer.observe(target);
3413
+ if (!includes(prev, target) || !observer.unobserve) {
3414
+ observer.observe(target, options);
3415
+ }
3403
3416
  }
3404
3417
  };
3405
3418
  }
@@ -3559,26 +3572,26 @@
3559
3572
  };
3560
3573
  App.util = util;
3561
3574
  App.options = {};
3562
- App.version = "3.19.5-dev.8317c4705";
3575
+ App.version = "3.19.5-dev.a8d51a358";
3563
3576
 
3564
3577
  const PREFIX = "uk-";
3565
3578
  const DATA = "__uikit__";
3566
3579
  const components$2 = {};
3567
3580
  function component(name, options) {
3568
- var _a;
3581
+ var _a, _b;
3569
3582
  const id = PREFIX + hyphenate(name);
3570
3583
  if (!options) {
3571
- if (isPlainObject(components$2[id])) {
3584
+ if (!components$2[id].options) {
3572
3585
  components$2[id] = App.extend(components$2[id]);
3573
3586
  }
3574
3587
  return components$2[id];
3575
3588
  }
3576
3589
  name = camelize(name);
3577
3590
  App[name] = (element, data) => createComponent(name, element, data);
3578
- const opt = isPlainObject(options) ? { ...options } : options.options;
3591
+ const opt = (_a = options.options) != null ? _a : { ...options };
3579
3592
  opt.id = id;
3580
3593
  opt.name = name;
3581
- (_a = opt.install) == null ? void 0 : _a.call(opt, App, opt, name);
3594
+ (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);
3582
3595
  if (App._initialized && !opt.functional) {
3583
3596
  requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
3584
3597
  }
@@ -3586,7 +3599,7 @@
3586
3599
  }
3587
3600
  function createComponent(name, element, data, ...args) {
3588
3601
  const Component = component(name);
3589
- return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? $$(element).map(init)[0] : init();
3602
+ return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? findAll(element).map(init)[0] : init();
3590
3603
  function init(element2) {
3591
3604
  const instance = getComponent(element2, name);
3592
3605
  if (instance) {
@@ -3948,7 +3961,6 @@
3948
3961
  }
3949
3962
  }
3950
3963
  },
3951
- observe: resize(),
3952
3964
  events: {
3953
3965
  itemshow({ target }) {
3954
3966
  addClass(target, this.clsEnter, this.clsSlideActive);
@@ -4077,6 +4089,7 @@
4077
4089
  return { animation: this.animation };
4078
4090
  }
4079
4091
  },
4092
+ observe: resize(),
4080
4093
  events: {
4081
4094
  beforeitemshow({ target }) {
4082
4095
  addClass(target, this.clsActive);
@@ -4559,18 +4572,10 @@
4559
4572
  }
4560
4573
 
4561
4574
  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
- );
4575
+ return Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => {
4576
+ var _a;
4577
+ return (_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke);
4578
+ })));
4574
4579
  }
4575
4580
 
4576
4581
  const props = {
@@ -5277,7 +5282,7 @@
5277
5282
  toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));
5278
5283
  },
5279
5284
  observe: resize({
5280
- target: ({ slides }) => slides
5285
+ target: ({ slides, $el }) => [$el, ...slides]
5281
5286
  }),
5282
5287
  update: {
5283
5288
  write() {
@@ -6402,14 +6407,14 @@
6402
6407
  if (name) {
6403
6408
  if (hasAttr(target, attributeName)) {
6404
6409
  createComponent(name, target);
6405
- return;
6410
+ } else {
6411
+ (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
6406
6412
  }
6407
- (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
6408
6413
  }
6409
6414
  }
6410
6415
  function connect(node) {
6411
6416
  const components2 = getComponents(node);
6412
- for (const name in getComponents(node)) {
6417
+ for (const name in components2) {
6413
6418
  callConnected(components2[name]);
6414
6419
  }
6415
6420
  for (const attributeName of node.getAttributeNames()) {
@@ -6419,7 +6424,7 @@
6419
6424
  }
6420
6425
  function disconnect(node) {
6421
6426
  const components2 = getComponents(node);
6422
- for (const name in getComponents(node)) {
6427
+ for (const name in components2) {
6423
6428
  callDisconnected(components2[name]);
6424
6429
  }
6425
6430
  }
@@ -6428,7 +6433,7 @@
6428
6433
  attribute = attribute.slice(5);
6429
6434
  }
6430
6435
  const cmp = components$2[attribute];
6431
- return cmp && (isPlainObject(cmp) ? cmp : cmp.options).name;
6436
+ return cmp && (cmp.options || cmp).name;
6432
6437
  }
6433
6438
 
6434
6439
  globalApi(App);
@@ -7843,7 +7848,7 @@
7843
7848
  const top = offsetPosition(offsetTopEl)[0] - offsetPosition(scrollElement)[0];
7844
7849
  minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : "";
7845
7850
  } else {
7846
- minHeight += ` - ${css(scrollElement, "paddingTop")}`;
7851
+ minHeight += ` - ${boxModelAdjust(scrollElement, "height", css(scrollElement, "boxSizing"))}px`;
7847
7852
  }
7848
7853
  }
7849
7854
  if (this.offsetBottom === true) {
@@ -8181,13 +8186,13 @@
8181
8186
  delete this.img;
8182
8187
  },
8183
8188
  observe: intersection({
8184
- target: ({ $el, $props }) => [$el, ...queryAll($props.target, $el)],
8185
8189
  handler(entries, observer) {
8186
8190
  this.load();
8187
8191
  observer.disconnect();
8188
8192
  },
8189
8193
  options: ({ margin }) => ({ rootMargin: margin }),
8190
- filter: ({ loading }) => loading === "lazy"
8194
+ filter: ({ loading }) => loading === "lazy",
8195
+ target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
8191
8196
  }),
8192
8197
  methods: {
8193
8198
  load() {
@@ -8277,9 +8282,17 @@
8277
8282
  selActive: false
8278
8283
  },
8279
8284
  computed: {
8280
- target: ({ target }, $el) => target ? $$(target, $el) : [$el]
8285
+ target: ({ target }, $el) => target ? $$(target, $el) : $el
8281
8286
  },
8282
8287
  observe: [
8288
+ intersection({
8289
+ handler(entries) {
8290
+ this.isIntersecting = entries.some(({ isIntersecting }) => isIntersecting);
8291
+ this.$emit();
8292
+ },
8293
+ target: ({ target }) => target,
8294
+ args: { intersecting: false }
8295
+ }),
8283
8296
  mutation({
8284
8297
  target: ({ target }) => target,
8285
8298
  options: { attributes: true, attributeFilter: ["class"], attributeOldValue: true }
@@ -8287,7 +8300,10 @@
8287
8300
  {
8288
8301
  target: ({ target }) => target,
8289
8302
  observe: (target, handler) => {
8290
- const observer = observeResize([...target, document.documentElement], handler);
8303
+ const observer = observeResize(
8304
+ [...toNodes(target), document.documentElement],
8305
+ handler
8306
+ );
8291
8307
  const listener = [
8292
8308
  on(document, "scroll itemshown itemhidden", handler, {
8293
8309
  passive: true,
@@ -8303,6 +8319,8 @@
8303
8319
  })
8304
8320
  ];
8305
8321
  return {
8322
+ observe: observer.observe.bind(observer),
8323
+ unobserve: observer.unobserve.bind(observer),
8306
8324
  disconnect() {
8307
8325
  observer.disconnect();
8308
8326
  listener.map((off) => off());
@@ -8316,7 +8334,10 @@
8316
8334
  ],
8317
8335
  update: {
8318
8336
  read() {
8319
- for (const target of this.target) {
8337
+ if (!this.isIntersecting) {
8338
+ return false;
8339
+ }
8340
+ for (const target of toNodes(this.target)) {
8320
8341
  replaceClass(
8321
8342
  target,
8322
8343
  "uk-light,uk-dark",