uikit 3.25.30-dev.6f7d153 → 3.25.30

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 (47) hide show
  1. package/CHANGELOG.md +1 -6
  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 +1 -1
  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 +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  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 +81 -93
  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 -93
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/core/drop.js +3 -12
  44. package/src/js/core/dropnav.js +44 -67
  45. package/src/js/core/navbar.js +1 -1
  46. package/src/js/core/toggle.js +47 -36
  47. package/tests/toggle.html +2 -2
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.30-dev.6f7d153 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
1
+ /*! UIkit 3.25.30 | 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() :
@@ -1683,7 +1683,7 @@
1683
1683
  wrapInner: wrapInner
1684
1684
  });
1685
1685
 
1686
- var VERSION = '3.25.30-dev.6f7d153';
1686
+ var VERSION = '3.25.30';
1687
1687
 
1688
1688
  function initUpdates(instance) {
1689
1689
  instance._data = {};
@@ -3370,7 +3370,7 @@
3370
3370
  self: true,
3371
3371
  handler(e) {
3372
3372
  e.preventDefault();
3373
- if (!matches(this.$el, ":focus-within,:hover")) {
3373
+ if (!matches(this.$el, ":focus,:hover")) {
3374
3374
  this.hide();
3375
3375
  }
3376
3376
  }
@@ -3385,10 +3385,10 @@
3385
3385
  }
3386
3386
  },
3387
3387
  {
3388
- name: pointerLeave,
3388
+ name: `${pointerLeave} focusout`,
3389
3389
  filter: ({ mode }) => includes(mode, "hover"),
3390
3390
  handler(e) {
3391
- if (!isTouch(e) && e.relatedTarget && !matches(this.$el, ":focus-within")) {
3391
+ if (!isTouch(e) && e.relatedTarget) {
3392
3392
  this.hide();
3393
3393
  }
3394
3394
  }
@@ -3414,7 +3414,6 @@
3414
3414
  const handlers = [
3415
3415
  listenForResize(this),
3416
3416
  listenForEscClose$1(this),
3417
- listenForFocusClose(this),
3418
3417
  listenForBackgroundClose$1(this),
3419
3418
  this.autoUpdate && listenForScroll(this),
3420
3419
  this.closeOnScroll && listenForScrollClose(this)
@@ -3603,14 +3602,6 @@
3603
3602
  function listenForScrollClose(drop) {
3604
3603
  return listenForScroll(drop, () => drop.hide(false));
3605
3604
  }
3606
- function listenForFocusClose(drop) {
3607
- return on(document, "focusin", ({ target }) => {
3608
- var _a;
3609
- if (!drop.$el.contains(target) && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {
3610
- drop.hide(false);
3611
- }
3612
- });
3613
- }
3614
3605
  function listenForBackgroundClose$1(drop) {
3615
3606
  return onOutsidePointer(
3616
3607
  (target) => {
@@ -3654,7 +3645,7 @@
3654
3645
  delayShow: 160,
3655
3646
  duration: 200,
3656
3647
  container: false,
3657
- selNavItem: "> li > a, > li > button, > ul > li > a, > ul > li > button"
3648
+ selNavItem: "> li > a, > ul > li > a"
3658
3649
  },
3659
3650
  computed: {
3660
3651
  dropbarAnchor: ({ dropbarAnchor }, $el) => query(dropbarAnchor, $el) || $el,
@@ -3709,7 +3700,7 @@
3709
3700
  },
3710
3701
  events: [
3711
3702
  {
3712
- name: "mouseover",
3703
+ name: "mouseover focusin",
3713
3704
  delegate: ({ selNavItem }) => selNavItem,
3714
3705
  handler({ current }) {
3715
3706
  const active2 = this.getActive();
@@ -3723,24 +3714,31 @@
3723
3714
  self: true,
3724
3715
  delegate: ({ selNavItem }) => selNavItem,
3725
3716
  handler(e) {
3726
- if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) {
3727
- return;
3728
- }
3729
- const { current, keyCode, shiftKey } = e;
3717
+ var _a;
3718
+ const { current, keyCode } = e;
3730
3719
  const active2 = this.getActive();
3731
- if (keyCode === keyMap.ESC && active2) {
3732
- closeDropdown(e, active2);
3733
- return;
3734
- }
3735
- if ((active2 == null ? void 0 : active2.targetEl) === current && (keyCode === keyMap.DOWN || keyCode === keyMap.TAB && !shiftKey)) {
3736
- const [first] = getFocusableElements(active2.$el);
3737
- if (first) {
3720
+ if (keyCode === keyMap.DOWN) {
3721
+ if ((active2 == null ? void 0 : active2.targetEl) === current) {
3738
3722
  e.preventDefault();
3739
- first.focus();
3723
+ (_a = $(selFocusable, active2.$el)) == null ? void 0 : _a.focus();
3724
+ } else {
3725
+ const dropdown = this.dropdowns.find(
3726
+ (el) => {
3727
+ var _a2;
3728
+ return ((_a2 = this.getDropdown(el)) == null ? void 0 : _a2.targetEl) === current;
3729
+ }
3730
+ );
3731
+ if (dropdown) {
3732
+ e.preventDefault();
3733
+ current.click();
3734
+ once(dropdown, "show", (e2) => {
3735
+ var _a2;
3736
+ return (_a2 = $(selFocusable, e2.target)) == null ? void 0 : _a2.focus();
3737
+ });
3738
+ }
3740
3739
  }
3741
- return;
3742
3740
  }
3743
- handleNavigation(e, getFocusableElements(this.$el, this.selNavItem), current);
3741
+ handleNavItemNavigation(e, this.items, active2);
3744
3742
  }
3745
3743
  },
3746
3744
  {
@@ -3748,33 +3746,27 @@
3748
3746
  el: ({ dropContainer }) => dropContainer,
3749
3747
  delegate: ({ clsDrop }) => `.${clsDrop}`,
3750
3748
  handler(e) {
3751
- if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) {
3749
+ var _a, _b;
3750
+ const { current, keyCode, target } = e;
3751
+ if (isInput(target) || !includes(this.dropdowns, current)) {
3752
3752
  return;
3753
3753
  }
3754
- const { current, keyCode, target } = e;
3755
3754
  const active2 = this.getActive();
3756
- if (!active2 || active2.$el !== current) {
3755
+ const next = getNavigationIndex(keyCode, keyMap.UP, keyMap.DOWN);
3756
+ if (~next) {
3757
+ e.preventDefault();
3758
+ const elements = $$(selFocusable, current);
3759
+ (_a = elements[getIndex(
3760
+ next,
3761
+ elements,
3762
+ findIndex(elements, (el) => matches(el, ":focus"))
3763
+ )]) == null ? void 0 : _a.focus();
3757
3764
  return;
3758
3765
  }
3759
3766
  if (keyCode === keyMap.ESC) {
3760
- closeDropdown(e, active2);
3761
- return;
3762
- }
3763
- const elements = getFocusableElements(current);
3764
- if (keyCode === keyMap.TAB) {
3765
- if (target === elements[e.shiftKey ? 0 : elements.length - 1]) {
3766
- active2.targetEl.focus();
3767
- if (e.shiftKey) {
3768
- e.preventDefault();
3769
- } else {
3770
- active2.hide(false, false);
3771
- }
3772
- }
3773
- return;
3774
- }
3775
- if (!isInput(target)) {
3776
- handleNavigation(e, elements, target);
3767
+ (_b = active2.targetEl) == null ? void 0 : _b.focus();
3777
3768
  }
3769
+ handleNavItemNavigation(e, this.items, active2);
3778
3770
  }
3779
3771
  },
3780
3772
  {
@@ -3910,32 +3902,25 @@
3910
3902
  }
3911
3903
  }
3912
3904
  };
3913
- function handleNavigation(e, elements, current) {
3914
- var _a;
3915
- const keyCode = { [keyMap.UP]: keyMap.LEFT, [keyMap.DOWN]: keyMap.RIGHT }[e.keyCode] || e.keyCode;
3905
+ function handleNavItemNavigation(e, toggles, active2) {
3906
+ var _a, _b, _c;
3907
+ const { current, keyCode } = e;
3916
3908
  const next = getNavigationIndex(keyCode);
3917
3909
  if (~next) {
3918
3910
  e.preventDefault();
3919
- (_a = elements[getIndex(next, elements, elements.indexOf(current), true)]) == null ? void 0 : _a.focus();
3911
+ (_a = active2.hide) == null ? void 0 : _a.call(active2, false);
3912
+ toggles[getIndex(next, toggles, toggles.indexOf(active2.targetEl || current))].focus();
3913
+ } else if (keyCode === keyMap.TAB) {
3914
+ (_b = active2.targetEl) == null ? void 0 : _b.focus();
3915
+ (_c = active2.hide) == null ? void 0 : _c.call(active2, false);
3920
3916
  }
3921
3917
  }
3922
- function closeDropdown(e, drop) {
3923
- var _a;
3924
- e.preventDefault();
3925
- drop.hide(false);
3926
- (_a = drop.targetEl) == null ? void 0 : _a.focus();
3927
- }
3928
- function getFocusableElements(el, selector = selFocusable) {
3929
- return $$(selector, el).filter(
3930
- (el2) => el2.tabIndex >= 0 && !matches(el2, ":disabled") && !el2.closest("[inert]") && isVisible(el2)
3931
- );
3932
- }
3933
3918
  function preventInitialPointerEnter(el) {
3934
3919
  const off = () => handlers.forEach((handler) => handler());
3935
3920
  const handlers = [
3936
3921
  once(el.ownerDocument, pointerMove, (e) => el.contains(e.target) || off()),
3937
- on(el, `mouseenter ${pointerEnter}`, (e) => e.stopPropagation(), true),
3938
- on(el, `mouseleave ${pointerLeave}`, off, true)
3922
+ on(el, `mouseenter ${pointerEnter}`, (e) => e.stopPropagation(), { capture: true }),
3923
+ on(el, `mouseleave ${pointerLeave}`, off, { capture: true })
3939
3924
  ];
3940
3925
  }
3941
3926
 
@@ -5392,7 +5377,7 @@
5392
5377
  autoUpdate: false,
5393
5378
  delayShow: 200,
5394
5379
  clsDrop: "uk-navbar-dropdown",
5395
- selNavItem: ".uk-navbar-nav > li > a,.uk-navbar-nav > li > button,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle",
5380
+ selNavItem: ".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle",
5396
5381
  // Simplify with :where() selector once browser target is Safari 14+
5397
5382
  dropbarTransparentMode: false
5398
5383
  },
@@ -6664,43 +6649,48 @@
6664
6649
  name: pointerDown,
6665
6650
  filter: ({ mode }) => includes(mode, "hover"),
6666
6651
  handler(e) {
6667
- this._touch = isTouch(e);
6652
+ this._preventClick = null;
6653
+ if (!isTouch(e) || isBoolean(this._showState) || this.$el.disabled) {
6654
+ return;
6655
+ }
6656
+ trigger(this.$el, "focus");
6657
+ once(
6658
+ document,
6659
+ pointerDown,
6660
+ () => trigger(this.$el, "blur"),
6661
+ true,
6662
+ (e2) => !this.$el.contains(e2.target)
6663
+ );
6664
+ if (includes(this.mode, "click")) {
6665
+ this._preventClick = true;
6666
+ }
6668
6667
  }
6669
6668
  },
6670
6669
  {
6671
- name: `${pointerEnter} ${pointerLeave} click`,
6670
+ name: `${pointerEnter} ${pointerLeave} focus blur`,
6672
6671
  filter: ({ mode }) => includes(mode, "hover"),
6673
6672
  handler(e) {
6674
- const click = e.type === "click";
6675
- const allowClick = includes(this.mode, "click") || e.detail === 0 || isTouch(e) || this._touch;
6676
- if (this.$el.disabled || (click ? e.defaultPrevented || !allowClick : isTouch(e) || document.readyState === "loading")) {
6673
+ if (isTouch(e) || this.$el.disabled || document.readyState === "loading") {
6677
6674
  return;
6678
6675
  }
6676
+ const show = includes([pointerEnter, "focus"], e.type);
6679
6677
  const expanded = this.isToggled(this.target);
6680
- if (e.type === pointerLeave) {
6681
- const initial = this._showState;
6682
- if (!isBoolean(initial)) {
6683
- return;
6684
- }
6685
- this._showState = null;
6686
- if (expanded !== initial) {
6687
- this.toggle("togglehide");
6688
- } else {
6689
- trigger(this.target, "togglehide", [this]);
6678
+ if (!show && (!isBoolean(this._showState) || e.type === pointerLeave && matches(this.$el, ":focus") || e.type === "blur" && matches(this.$el, ":hover"))) {
6679
+ if (expanded === this._showState) {
6680
+ this._showState = null;
6690
6681
  }
6691
6682
  return;
6692
6683
  }
6693
- if (!isBoolean(this._showState)) {
6694
- this._showState = expanded;
6695
- }
6696
- if (!click && expanded === this._showState) {
6697
- this.toggle("toggleshow");
6684
+ if (show && isBoolean(this._showState) && expanded !== this._showState) {
6685
+ return;
6698
6686
  }
6687
+ this._showState = show ? expanded : null;
6688
+ this.toggle(`toggle${show ? "show" : "hide"}`);
6699
6689
  }
6700
6690
  },
6701
6691
  {
6702
6692
  name: "keydown",
6703
- filter: ({ $el, mode }) => ["click", "hover"].some((m) => includes(mode, m)) && !isTag($el, "input"),
6693
+ filter: ({ $el, mode }) => includes(mode, "click") && !isTag($el, "input"),
6704
6694
  handler(e) {
6705
6695
  if (e.keyCode === keyMap.SPACE || e.keyCode === keyMap.ENTER) {
6706
6696
  e.preventDefault();
@@ -6712,17 +6702,15 @@
6712
6702
  name: "click",
6713
6703
  filter: ({ mode }) => ["click", "hover"].some((m) => includes(mode, m)),
6714
6704
  handler(e) {
6715
- const touch = this._touch;
6716
- this._touch = false;
6717
6705
  if (e.defaultPrevented) {
6718
6706
  return;
6719
6707
  }
6720
6708
  const link = e.target.closest("a[href]");
6721
6709
  const isButtonLike = isSameSiteAnchor(link) && (!link.hash || matches(this.target, link.hash));
6722
- if (isButtonLike || link && !this.isToggled(this.target)) {
6710
+ if (this._preventClick || isButtonLike || link && !this.isToggled(this.target)) {
6723
6711
  e.preventDefault();
6724
6712
  }
6725
- if ((includes(this.mode, "click") || e.detail === 0 || isTouch(e) || touch) && (!link || isButtonLike || e.defaultPrevented)) {
6713
+ if (!this._preventClick && includes(this.mode, "click") && (!link || isButtonLike || e.defaultPrevented)) {
6726
6714
  this.toggle();
6727
6715
  }
6728
6716
  }