uikit 3.19.4 → 3.19.5-dev.8210c3e08

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 +10 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  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 +7 -8
  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 +58 -44
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +58 -44
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +59 -45
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +58 -44
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +58 -44
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +3 -3
  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 +95 -60
  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 +99 -65
  41. package/dist/js/uikit.min.js +1 -1
  42. package/eslint.config.js +8 -5
  43. package/package.json +3 -4
  44. package/src/js/api/observer.js +17 -5
  45. package/src/js/components/filter.js +4 -5
  46. package/src/js/core/drop.js +0 -6
  47. package/src/js/core/inverse.js +11 -1
  48. package/src/js/core/margin.js +1 -1
  49. package/src/js/core/switcher.js +6 -1
  50. package/src/js/core/toggle.js +1 -1
  51. package/src/js/util/selector.js +61 -37
  52. package/src/js/util/svg.js +1 -12
  53. package/tests/modal.html +2 -2
  54. package/build/package.json +0 -4
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.19.4 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.19.5-dev.8210c3e08 | 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() :
@@ -367,55 +367,77 @@
367
367
  function findAll(selector, context) {
368
368
  return toNodes(_query(selector, toNode(context), "querySelectorAll"));
369
369
  }
370
- const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
371
- const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
372
370
  function getContext(selector, context = document) {
373
- return isString(selector) && isContextSelector(selector) || isDocument(context) ? context : context.ownerDocument;
374
- }
375
- const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
376
- const sanatize = memoize((selector) => selector.replace(contextSanitizeRe, "$1 *"));
371
+ return isString(selector) && parseSelector(selector).isContextSelector || isDocument(context) ? context : context.ownerDocument;
372
+ }
373
+ const addStarRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
374
+ const splitSelectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
375
+ const trailingCommaRe = /\s*,$/;
376
+ const parseSelector = memoize((selector) => {
377
+ selector = selector.replace(addStarRe, "$1 *");
378
+ let isContextSelector = false;
379
+ const selectors = [];
380
+ for (let sel of selector.match(splitSelectorRe)) {
381
+ sel = sel.replace(trailingCommaRe, "").trim();
382
+ if (sel[0] === ">") {
383
+ sel = `:scope ${sel}`;
384
+ }
385
+ isContextSelector || (isContextSelector = ["!", "+", "~", "-"].includes(sel[0]));
386
+ selectors.push(sel);
387
+ }
388
+ return {
389
+ selector: selectors.join(","),
390
+ selectors,
391
+ isContextSelector
392
+ };
393
+ });
377
394
  function _query(selector, context = document, queryFn) {
378
395
  if (!selector || !isString(selector)) {
379
396
  return selector;
380
397
  }
381
- selector = sanatize(selector);
382
- if (isContextSelector(selector)) {
383
- const split = splitSelector(selector);
384
- selector = "";
385
- for (let sel of split) {
386
- let ctx = context;
387
- if (sel[0] === "!") {
388
- const selectors = sel.substr(1).trim().split(" ");
389
- ctx = parent(context).closest(selectors[0]);
390
- sel = selectors.slice(1).join(" ").trim();
391
- if (!sel.length && split.length === 1) {
392
- return ctx;
393
- }
394
- }
395
- if (sel[0] === "-") {
396
- const selectors = sel.substr(1).trim().split(" ");
397
- const prev = (ctx || context).previousElementSibling;
398
- ctx = matches(prev, sel.substr(1)) ? prev : null;
399
- sel = selectors.slice(1).join(" ");
398
+ const parsed = parseSelector(selector);
399
+ if (!parsed.isContextSelector) {
400
+ return _doQuery(context, queryFn, parsed.selector);
401
+ }
402
+ selector = "";
403
+ const isSingle = parsed.selectors.length === 1;
404
+ for (let sel of parsed.selectors) {
405
+ let ctx = context;
406
+ if (sel[0] === "!") {
407
+ const selectors = sel.substr(1).trim().split(" ");
408
+ ctx = parent(context).closest(selectors[0]);
409
+ sel = selectors.slice(1).join(" ").trim();
410
+ if (!sel.length && isSingle) {
411
+ return ctx;
400
412
  }
401
- if (ctx) {
402
- selector += `${selector ? "," : ""}${domPath(ctx)} ${sel}`;
413
+ }
414
+ if (sel[0] === "-") {
415
+ const selectors = sel.substr(1).trim().split(" ");
416
+ const prev = (ctx || context).previousElementSibling;
417
+ ctx = matches(prev, sel.substr(1)) ? prev : null;
418
+ sel = selectors.slice(1).join(" ");
419
+ if (!sel.length && isSingle) {
420
+ return ctx;
403
421
  }
422
+ } else if (sel[0] === "~" || sel[0] === "+" && isSingle) {
423
+ return _doQuery(parent(ctx), queryFn, `:scope :nth-child(${index(ctx) + 1}) ${sel}`);
404
424
  }
405
- if (!isDocument(context)) {
406
- context = context.ownerDocument;
425
+ if (ctx) {
426
+ selector += `${selector ? "," : ""}${domPath(ctx)} ${sel}`;
407
427
  }
408
428
  }
429
+ if (!isDocument(context)) {
430
+ context = context.ownerDocument;
431
+ }
432
+ return _doQuery(context, queryFn, selector);
433
+ }
434
+ function _doQuery(context, queryFn, selector) {
409
435
  try {
410
436
  return context[queryFn](selector);
411
437
  } catch (e) {
412
438
  return null;
413
439
  }
414
440
  }
415
- const selectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
416
- const splitSelector = memoize(
417
- (selector) => selector.match(selectorRe).map((selector2) => selector2.replace(/,$/, "").trim())
418
- );
419
441
  function domPath(element) {
420
442
  const names = [];
421
443
  while (element.parentNode) {
@@ -2011,10 +2033,10 @@
2011
2033
  observe: [
2012
2034
  mutation({
2013
2035
  options: {
2014
- childList: true,
2015
2036
  attributes: true,
2016
2037
  attributeFilter: ["style"]
2017
- }
2038
+ },
2039
+ target: ({ $el }) => [$el, ...children($el)]
2018
2040
  }),
2019
2041
  resize({
2020
2042
  target: ({ $el }) => [$el, ...children($el)]
@@ -2368,10 +2390,7 @@
2368
2390
  }
2369
2391
  await Promise.all(
2370
2392
  $$(this.target, this.$el).map((target) => {
2371
- const filterFn = () => {
2372
- applyState(state, target, children(target));
2373
- this.$update(this.$el);
2374
- };
2393
+ const filterFn = () => applyState(state, target, children(target));
2375
2394
  return animate ? this.animate(filterFn, target) : filterFn();
2376
2395
  })
2377
2396
  );
@@ -2390,7 +2409,9 @@
2390
2409
  }
2391
2410
  function applyState(state, target, children) {
2392
2411
  const selector = getSelector(state);
2393
- children.forEach((el) => css(el, "display", selector && !matches(el, selector) ? "none" : ""));
2412
+ for (const el of children) {
2413
+ css(el, "display", selector && !matches(el, selector) ? "none" : "");
2414
+ }
2394
2415
  const [sort, order] = state.sort;
2395
2416
  if (sort) {
2396
2417
  const sorted = sortItems(children, sort, order);
@@ -3363,18 +3384,30 @@
3363
3384
  }
3364
3385
  const targets = hasOwn(instance, key) ? instance[key] : target;
3365
3386
  const observer = observe(targets, handler, options, args);
3366
- if (isFunction(target) && isArray(instance[key]) && observer.unobserve) {
3367
- 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
+ );
3368
3393
  }
3369
3394
  registerObserver(instance, observer);
3370
3395
  }
3371
- function updateTargets(observer) {
3396
+ function updateTargets(observer, options) {
3372
3397
  return (targets, prev) => {
3373
3398
  for (const target of prev) {
3374
- !includes(targets, target) && observer.unobserve(target);
3399
+ if (!includes(targets, target)) {
3400
+ if (observer.unobserve) {
3401
+ observer.unobserve(target);
3402
+ } else {
3403
+ observer.disconnect();
3404
+ }
3405
+ }
3375
3406
  }
3376
3407
  for (const target of targets) {
3377
- !includes(prev, target) && observer.observe(target);
3408
+ if (!includes(prev, target) || !observer.unobserve) {
3409
+ observer.observe(target, options);
3410
+ }
3378
3411
  }
3379
3412
  };
3380
3413
  }
@@ -3534,7 +3567,7 @@
3534
3567
  };
3535
3568
  App.util = util;
3536
3569
  App.options = {};
3537
- App.version = "3.19.4";
3570
+ App.version = "3.19.5-dev.8210c3e08";
3538
3571
 
3539
3572
  const PREFIX = "uk-";
3540
3573
  const DATA = "__uikit__";
@@ -4534,18 +4567,10 @@
4534
4567
  }
4535
4568
 
4536
4569
  function getMaxPathLength(el) {
4537
- return Math.ceil(
4538
- Math.max(
4539
- 0,
4540
- ...$$("[stroke]", el).map((stroke) => {
4541
- try {
4542
- return stroke.getTotalLength();
4543
- } catch (e) {
4544
- return 0;
4545
- }
4546
- })
4547
- )
4548
- );
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
+ })));
4549
4574
  }
4550
4575
 
4551
4576
  const props = {
@@ -6856,10 +6881,6 @@
6856
6881
  }
6857
6882
  css(this.$el, this._style);
6858
6883
  },
6859
- observe: lazyload({
6860
- target: ({ toggle, $el }) => query(toggle, $el),
6861
- targets: ({ $el }) => $el
6862
- }),
6863
6884
  events: [
6864
6885
  {
6865
6886
  name: "click",
@@ -8259,6 +8280,12 @@
8259
8280
  target: ({ target }, $el) => target ? $$(target, $el) : [$el]
8260
8281
  },
8261
8282
  observe: [
8283
+ intersection({
8284
+ handler([{ isIntersecting }]) {
8285
+ this.isIntersecting = isIntersecting;
8286
+ },
8287
+ args: { intersecting: false }
8288
+ }),
8262
8289
  mutation({
8263
8290
  target: ({ target }) => target,
8264
8291
  options: { attributes: true, attributeFilter: ["class"], attributeOldValue: true }
@@ -8295,6 +8322,9 @@
8295
8322
  ],
8296
8323
  update: {
8297
8324
  read() {
8325
+ if (!this.isIntersecting) {
8326
+ return false;
8327
+ }
8298
8328
  for (const target of this.target) {
8299
8329
  replaceClass(
8300
8330
  target,
@@ -9546,7 +9576,11 @@
9546
9576
  ],
9547
9577
  update() {
9548
9578
  var _a;
9549
- attr(this.connects, "role", "presentation");
9579
+ for (const el of this.connects) {
9580
+ if (isTag(el, "ul")) {
9581
+ attr(el, "role", "presentation");
9582
+ }
9583
+ }
9550
9584
  attr(children(this.$el), "role", "presentation");
9551
9585
  for (const index in this.toggles) {
9552
9586
  const toggle = this.toggles[index];
@@ -9645,7 +9679,7 @@
9645
9679
  }
9646
9680
  }
9647
9681
  },
9648
- observe: lazyload({ target: ({ target }) => target }),
9682
+ observe: lazyload({ targets: ({ target }) => target }),
9649
9683
  events: [
9650
9684
  {
9651
9685
  name: pointerDown$1,