uikit 3.25.16-dev.c408e8d → 3.25.17-dev.20f2548

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 (59) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/build/build.js +1 -1
  3. package/build/less.js +7 -7
  4. package/build/prefix.js +3 -3
  5. package/build/release.js +12 -8
  6. package/build/scss.js +13 -7
  7. package/build/util.js +17 -19
  8. package/build/watch.js +21 -0
  9. package/dist/css/uikit-core-rtl.css +7 -1
  10. package/dist/css/uikit-core-rtl.min.css +1 -1
  11. package/dist/css/uikit-core.css +7 -1
  12. package/dist/css/uikit-core.min.css +1 -1
  13. package/dist/css/uikit-rtl.css +7 -1
  14. package/dist/css/uikit-rtl.min.css +1 -1
  15. package/dist/css/uikit.css +7 -1
  16. package/dist/css/uikit.min.css +1 -1
  17. package/dist/js/components/countdown.js +7 -1
  18. package/dist/js/components/countdown.min.js +1 -1
  19. package/dist/js/components/filter.js +11 -2
  20. package/dist/js/components/filter.min.js +1 -1
  21. package/dist/js/components/lightbox-panel.js +39 -31
  22. package/dist/js/components/lightbox-panel.min.js +1 -1
  23. package/dist/js/components/lightbox.js +39 -31
  24. package/dist/js/components/lightbox.min.js +1 -1
  25. package/dist/js/components/notification.js +1 -1
  26. package/dist/js/components/notification.min.js +1 -1
  27. package/dist/js/components/parallax.js +1 -1
  28. package/dist/js/components/parallax.min.js +1 -1
  29. package/dist/js/components/slider-parallax.js +1 -1
  30. package/dist/js/components/slider-parallax.min.js +1 -1
  31. package/dist/js/components/slider.js +7 -1
  32. package/dist/js/components/slider.min.js +1 -1
  33. package/dist/js/components/slideshow-parallax.js +1 -1
  34. package/dist/js/components/slideshow-parallax.min.js +1 -1
  35. package/dist/js/components/slideshow.js +7 -1
  36. package/dist/js/components/slideshow.min.js +1 -1
  37. package/dist/js/components/sortable.js +7 -1
  38. package/dist/js/components/sortable.min.js +1 -1
  39. package/dist/js/components/tooltip.js +25 -29
  40. package/dist/js/components/tooltip.min.js +1 -1
  41. package/dist/js/components/upload.js +11 -3
  42. package/dist/js/components/upload.min.js +1 -1
  43. package/dist/js/uikit-core.js +47 -39
  44. package/dist/js/uikit-core.min.js +1 -1
  45. package/dist/js/uikit-icons.js +1 -1
  46. package/dist/js/uikit-icons.min.js +1 -1
  47. package/dist/js/uikit.js +67 -42
  48. package/dist/js/uikit.min.js +1 -1
  49. package/package.json +3 -8
  50. package/src/js/components/filter.js +12 -4
  51. package/src/js/components/upload.js +12 -2
  52. package/src/js/core/drop.js +7 -6
  53. package/src/js/mixin/class.js +8 -1
  54. package/src/js/mixin/modal.js +12 -2
  55. package/src/js/mixin/togglable.js +7 -8
  56. package/src/js/util/viewport.js +1 -1
  57. package/src/less/components/slideshow.less +5 -0
  58. package/src/scss/components/slideshow.scss +5 -0
  59. package/tests/upload.html +67 -0
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.16-dev.c408e8d | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
1
+ /*! UIkit 3.25.17-dev.20f2548 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1284,7 +1284,7 @@
1284
1284
  const scrollEl = scrollingElement(element);
1285
1285
  let ancestors = parents(element).reverse();
1286
1286
  ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);
1287
- const fixedIndex = findIndex(ancestors, (el) => css(el, "position") === "fixed");
1287
+ const fixedIndex = findIndex(ancestors, (el) => hasPosition(el, "fixed"));
1288
1288
  if (~fixedIndex) {
1289
1289
  ancestors = ancestors.slice(fixedIndex);
1290
1290
  }
@@ -1683,7 +1683,13 @@
1683
1683
 
1684
1684
  var Class = {
1685
1685
  connected() {
1686
+ this._cmpCls = hasClass(this.$el, this.$options.id);
1686
1687
  addClass(this.$el, this.$options.id);
1688
+ },
1689
+ disconnected() {
1690
+ if (!this._cmpCls) {
1691
+ removeClass(this.$el, this.$options.id);
1692
+ }
1687
1693
  }
1688
1694
  };
1689
1695
 
@@ -2480,7 +2486,16 @@
2480
2486
  }
2481
2487
  function matchFilter(el, attr, { filter: stateFilter = { "": "" }, sort: [stateSort, stateOrder] }) {
2482
2488
  const { filter = "", group = "", sort, order = "asc" } = getFilter(el, attr);
2483
- return isUndefined(sort) ? group in stateFilter && filter === stateFilter[group] || !filter && group && !(group in stateFilter) && !stateFilter[""] : stateSort === sort && stateOrder === order;
2489
+ const defaultFilterMatches = !group && filter === stateFilter[""];
2490
+ const groupFilterMatches = group in stateFilter && filter === stateFilter[group];
2491
+ const groupResetMatches = !filter && group && !(group in stateFilter) && !stateFilter[""];
2492
+ const filterMatches = defaultFilterMatches || groupFilterMatches || groupResetMatches;
2493
+ if (isUndefined(sort)) {
2494
+ return filterMatches;
2495
+ }
2496
+ const sortMatches = stateSort === sort && stateOrder === order;
2497
+ const hasFilter = filter || group;
2498
+ return sortMatches && (!hasFilter || filterMatches);
2484
2499
  }
2485
2500
  function sortItems(nodes, sort, order) {
2486
2501
  return [...nodes].sort((a, b) => {
@@ -2701,35 +2716,31 @@
2701
2716
  },
2702
2717
  methods: {
2703
2718
  async toggleElement(targets, toggle, animate) {
2704
- try {
2705
- await Promise.all(
2706
- toNodes(targets).map((el) => {
2707
- const show = isBoolean(toggle) ? toggle : !this.isToggled(el);
2708
- if (!trigger(el, `before${show ? "show" : "hide"}`, [this])) {
2709
- return Promise.reject();
2719
+ const CANCELLED = {};
2720
+ return (await Promise.all(
2721
+ toNodes(targets).map((el) => {
2722
+ const show = isBoolean(toggle) ? toggle : !this.isToggled(el);
2723
+ if (!trigger(el, `before${show ? "show" : "hide"}`, [this])) {
2724
+ return CANCELLED;
2725
+ }
2726
+ const promise = (isFunction(animate) ? animate : animate === false || !this.hasAnimation ? toggleInstant : this.hasTransition ? toggleTransition : toggleAnimation)(el, show, this);
2727
+ const cls = show ? this.clsEnter : this.clsLeave;
2728
+ addClass(el, cls);
2729
+ trigger(el, show ? "show" : "hide", [this]);
2730
+ const done = () => {
2731
+ var _a;
2732
+ removeClass(el, cls);
2733
+ trigger(el, show ? "shown" : "hidden", [this]);
2734
+ if (show) {
2735
+ (_a = $$("[autofocus]", el).find(isVisible)) == null ? void 0 : _a.focus({ preventScroll: true });
2710
2736
  }
2711
- const promise = (isFunction(animate) ? animate : animate === false || !this.hasAnimation ? toggleInstant : this.hasTransition ? toggleTransition : toggleAnimation)(el, show, this);
2712
- const cls = show ? this.clsEnter : this.clsLeave;
2713
- addClass(el, cls);
2714
- trigger(el, show ? "show" : "hide", [this]);
2715
- const done = () => {
2716
- var _a;
2717
- removeClass(el, cls);
2718
- trigger(el, show ? "shown" : "hidden", [this]);
2719
- if (show) {
2720
- (_a = $$("[autofocus]", el).find(isVisible)) == null ? void 0 : _a.focus({ preventScroll: true });
2721
- }
2722
- };
2723
- return promise ? promise.then(done, () => {
2724
- removeClass(el, cls);
2725
- return Promise.reject();
2726
- }) : done();
2727
- })
2728
- );
2729
- return true;
2730
- } catch {
2731
- return false;
2732
- }
2737
+ };
2738
+ return promise ? promise.then(done, () => {
2739
+ removeClass(el, cls);
2740
+ return CANCELLED;
2741
+ }) : done();
2742
+ })
2743
+ )).every((r) => r !== CANCELLED);
2733
2744
  },
2734
2745
  isToggled(el = this.$el) {
2735
2746
  el = toNode(el);
@@ -3045,9 +3056,15 @@
3045
3056
  }
3046
3057
  function preventBackgroundFocus(modal) {
3047
3058
  return on(document, "focusin", (e) => {
3048
- if (last(active$1) === modal && !modal.$el.contains(e.target)) {
3049
- modal.$el.focus();
3059
+ if (last(active$1) !== modal || modal.$el.contains(e.target)) {
3060
+ return;
3050
3061
  }
3062
+ const { left, top, width, height } = dimensions$1(e.target);
3063
+ const topEl = document.elementFromPoint(left + width / 2, top + height / 2);
3064
+ if (topEl && (e.target.contains(topEl) || topEl.contains(e.target))) {
3065
+ return;
3066
+ }
3067
+ modal.$el.focus();
3051
3068
  });
3052
3069
  }
3053
3070
  function listenForBackgroundClose$1(modal) {
@@ -3386,7 +3403,7 @@
3386
3403
  return Math.atan2(Math.abs(pos2.y - pos1.y), Math.abs(pos2.x - pos1.x)) * 180 / Math.PI;
3387
3404
  }
3388
3405
 
3389
- var VERSION = '3.25.16-dev.c408e8d';
3406
+ var VERSION = '3.25.17-dev.20f2548';
3390
3407
 
3391
3408
  function initWatches(instance) {
3392
3409
  instance._watches = [];
@@ -6544,7 +6561,9 @@
6544
6561
  this.completeAll(xhr);
6545
6562
  }
6546
6563
  } catch (e) {
6547
- this.error(e);
6564
+ if (e.name !== "AbortError") {
6565
+ this.error(e);
6566
+ }
6548
6567
  }
6549
6568
  };
6550
6569
  await upload(chunks.shift());
@@ -6581,7 +6600,9 @@
6581
6600
  responseType: "",
6582
6601
  ...options
6583
6602
  };
6584
- await env.beforeSend(env);
6603
+ if (await env.beforeSend(env) === false) {
6604
+ throw abortError(env.xhr);
6605
+ }
6585
6606
  return send(env.url, env);
6586
6607
  }
6587
6608
  function send(url, env) {
@@ -6613,9 +6634,13 @@
6613
6634
  });
6614
6635
  on(xhr, "error", () => reject(assign(Error("Network Error"), { xhr })));
6615
6636
  on(xhr, "timeout", () => reject(assign(Error("Network Timeout"), { xhr })));
6637
+ on(xhr, "abort", () => reject(abortError(xhr)));
6616
6638
  xhr.send(env.data);
6617
6639
  });
6618
6640
  }
6641
+ function abortError(xhr) {
6642
+ return assign(Error("Network Abort"), { xhr, name: "AbortError" });
6643
+ }
6619
6644
 
6620
6645
  var components$1 = /*#__PURE__*/Object.freeze({
6621
6646
  __proto__: null,
@@ -7388,12 +7413,12 @@
7388
7413
  return offsetViewport(overflowParents(target).find((parent2) => parent2.contains(el)));
7389
7414
  }
7390
7415
  function createToggleComponent(drop) {
7391
- const { $el } = drop.$create("toggle", query(drop.toggle, drop.$el), {
7392
- target: drop.$el,
7393
- mode: drop.mode
7394
- });
7395
- $el.ariaHasPopup = true;
7396
- return $el;
7416
+ const el = query(drop.toggle, drop.$el);
7417
+ if (el) {
7418
+ drop.$create("toggle", el, { target: drop.$el, mode: drop.mode });
7419
+ el.ariaHasPopup = true;
7420
+ }
7421
+ return el;
7397
7422
  }
7398
7423
  function listenForResize(drop) {
7399
7424
  const update = () => drop.$emit();