uikit 3.25.30-dev.5de718d → 3.25.30-dev.6f7d153

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 (52) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/css/uikit-core-rtl.css +8 -6
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +8 -6
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +8 -6
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +8 -6
  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 +96 -84
  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 +96 -84
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +13 -13
  43. package/src/js/core/drop.js +12 -3
  44. package/src/js/core/dropnav.js +67 -44
  45. package/src/js/core/navbar.js +1 -1
  46. package/src/js/core/svg.js +3 -3
  47. package/src/js/core/toggle.js +36 -47
  48. package/src/js/util/lang.js +1 -1
  49. package/src/less/components/breadcrumb.less +7 -5
  50. package/src/scss/components/breadcrumb.scss +7 -5
  51. package/tests/js/index.js +2 -2
  52. package/tests/toggle.html +2 -2
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.30-dev.5de718d | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
1
+ /*! UIkit 3.25.30-dev.6f7d153 | 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.5de718d';
1686
+ var VERSION = '3.25.30-dev.6f7d153';
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,:hover")) {
3373
+ if (!matches(this.$el, ":focus-within,:hover")) {
3374
3374
  this.hide();
3375
3375
  }
3376
3376
  }
@@ -3385,10 +3385,10 @@
3385
3385
  }
3386
3386
  },
3387
3387
  {
3388
- name: `${pointerLeave} focusout`,
3388
+ name: pointerLeave,
3389
3389
  filter: ({ mode }) => includes(mode, "hover"),
3390
3390
  handler(e) {
3391
- if (!isTouch(e) && e.relatedTarget) {
3391
+ if (!isTouch(e) && e.relatedTarget && !matches(this.$el, ":focus-within")) {
3392
3392
  this.hide();
3393
3393
  }
3394
3394
  }
@@ -3414,6 +3414,7 @@
3414
3414
  const handlers = [
3415
3415
  listenForResize(this),
3416
3416
  listenForEscClose$1(this),
3417
+ listenForFocusClose(this),
3417
3418
  listenForBackgroundClose$1(this),
3418
3419
  this.autoUpdate && listenForScroll(this),
3419
3420
  this.closeOnScroll && listenForScrollClose(this)
@@ -3602,6 +3603,14 @@
3602
3603
  function listenForScrollClose(drop) {
3603
3604
  return listenForScroll(drop, () => drop.hide(false));
3604
3605
  }
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
+ }
3605
3614
  function listenForBackgroundClose$1(drop) {
3606
3615
  return onOutsidePointer(
3607
3616
  (target) => {
@@ -3645,7 +3654,7 @@
3645
3654
  delayShow: 160,
3646
3655
  duration: 200,
3647
3656
  container: false,
3648
- selNavItem: "> li > a, > ul > li > a"
3657
+ selNavItem: "> li > a, > li > button, > ul > li > a, > ul > li > button"
3649
3658
  },
3650
3659
  computed: {
3651
3660
  dropbarAnchor: ({ dropbarAnchor }, $el) => query(dropbarAnchor, $el) || $el,
@@ -3700,7 +3709,7 @@
3700
3709
  },
3701
3710
  events: [
3702
3711
  {
3703
- name: "mouseover focusin",
3712
+ name: "mouseover",
3704
3713
  delegate: ({ selNavItem }) => selNavItem,
3705
3714
  handler({ current }) {
3706
3715
  const active2 = this.getActive();
@@ -3714,31 +3723,24 @@
3714
3723
  self: true,
3715
3724
  delegate: ({ selNavItem }) => selNavItem,
3716
3725
  handler(e) {
3717
- var _a;
3718
- const { current, keyCode } = e;
3726
+ if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) {
3727
+ return;
3728
+ }
3729
+ const { current, keyCode, shiftKey } = e;
3719
3730
  const active2 = this.getActive();
3720
- if (keyCode === keyMap.DOWN) {
3721
- if ((active2 == null ? void 0 : active2.targetEl) === current) {
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) {
3722
3738
  e.preventDefault();
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
- }
3739
+ first.focus();
3739
3740
  }
3741
+ return;
3740
3742
  }
3741
- handleNavItemNavigation(e, this.items, active2);
3743
+ handleNavigation(e, getFocusableElements(this.$el, this.selNavItem), current);
3742
3744
  }
3743
3745
  },
3744
3746
  {
@@ -3746,27 +3748,33 @@
3746
3748
  el: ({ dropContainer }) => dropContainer,
3747
3749
  delegate: ({ clsDrop }) => `.${clsDrop}`,
3748
3750
  handler(e) {
3749
- var _a, _b;
3750
- const { current, keyCode, target } = e;
3751
- if (isInput(target) || !includes(this.dropdowns, current)) {
3751
+ if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) {
3752
3752
  return;
3753
3753
  }
3754
+ const { current, keyCode, target } = e;
3754
3755
  const active2 = this.getActive();
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();
3756
+ if (!active2 || active2.$el !== current) {
3764
3757
  return;
3765
3758
  }
3766
3759
  if (keyCode === keyMap.ESC) {
3767
- (_b = active2.targetEl) == null ? void 0 : _b.focus();
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);
3768
3777
  }
3769
- handleNavItemNavigation(e, this.items, active2);
3770
3778
  }
3771
3779
  },
3772
3780
  {
@@ -3902,25 +3910,32 @@
3902
3910
  }
3903
3911
  }
3904
3912
  };
3905
- function handleNavItemNavigation(e, toggles, active2) {
3906
- var _a, _b, _c;
3907
- const { current, keyCode } = e;
3913
+ function handleNavigation(e, elements, current) {
3914
+ var _a;
3915
+ const keyCode = { [keyMap.UP]: keyMap.LEFT, [keyMap.DOWN]: keyMap.RIGHT }[e.keyCode] || e.keyCode;
3908
3916
  const next = getNavigationIndex(keyCode);
3909
3917
  if (~next) {
3910
3918
  e.preventDefault();
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);
3919
+ (_a = elements[getIndex(next, elements, elements.indexOf(current), true)]) == null ? void 0 : _a.focus();
3916
3920
  }
3917
3921
  }
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
+ }
3918
3933
  function preventInitialPointerEnter(el) {
3919
3934
  const off = () => handlers.forEach((handler) => handler());
3920
3935
  const handlers = [
3921
3936
  once(el.ownerDocument, pointerMove, (e) => el.contains(e.target) || off()),
3922
- on(el, `mouseenter ${pointerEnter}`, (e) => e.stopPropagation(), { capture: true }),
3923
- on(el, `mouseleave ${pointerLeave}`, off, { capture: true })
3937
+ on(el, `mouseenter ${pointerEnter}`, (e) => e.stopPropagation(), true),
3938
+ on(el, `mouseleave ${pointerLeave}`, off, true)
3924
3939
  ];
3925
3940
  }
3926
3941
 
@@ -5377,7 +5392,7 @@
5377
5392
  autoUpdate: false,
5378
5393
  delayShow: 200,
5379
5394
  clsDrop: "uk-navbar-dropdown",
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",
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",
5381
5396
  // Simplify with :where() selector once browser target is Safari 14+
5382
5397
  dropbarTransparentMode: false
5383
5398
  },
@@ -6370,14 +6385,14 @@
6370
6385
  }
6371
6386
  };
6372
6387
  function applyAttributes(el) {
6373
- const { $el } = this;
6388
+ const { $el, attributes } = this;
6374
6389
  addClass(el, attr($el, "class"), "uk-svg");
6375
6390
  for (let i = 0; i < $el.style.length; i++) {
6376
6391
  const prop = $el.style[i];
6377
6392
  css(el, prop, css($el, prop));
6378
6393
  }
6379
- for (const attribute in this.attributes) {
6380
- const [prop, value] = this.attributes[attribute].split(":", 2);
6394
+ for (const attribute in attributes) {
6395
+ const [prop, value] = attributes[attribute].split(":", 2);
6381
6396
  attr(el, prop, value);
6382
6397
  }
6383
6398
  el.ariaHidden || (el.ariaHidden = $el.ariaHidden);
@@ -6649,48 +6664,43 @@
6649
6664
  name: pointerDown,
6650
6665
  filter: ({ mode }) => includes(mode, "hover"),
6651
6666
  handler(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
- }
6667
+ this._touch = isTouch(e);
6667
6668
  }
6668
6669
  },
6669
6670
  {
6670
- name: `${pointerEnter} ${pointerLeave} focus blur`,
6671
+ name: `${pointerEnter} ${pointerLeave} click`,
6671
6672
  filter: ({ mode }) => includes(mode, "hover"),
6672
6673
  handler(e) {
6673
- if (isTouch(e) || this.$el.disabled || document.readyState === "loading") {
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")) {
6674
6677
  return;
6675
6678
  }
6676
- const show = includes([pointerEnter, "focus"], e.type);
6677
6679
  const expanded = this.isToggled(this.target);
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;
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]);
6681
6690
  }
6682
6691
  return;
6683
6692
  }
6684
- if (show && isBoolean(this._showState) && expanded !== this._showState) {
6685
- return;
6693
+ if (!isBoolean(this._showState)) {
6694
+ this._showState = expanded;
6695
+ }
6696
+ if (!click && expanded === this._showState) {
6697
+ this.toggle("toggleshow");
6686
6698
  }
6687
- this._showState = show ? expanded : null;
6688
- this.toggle(`toggle${show ? "show" : "hide"}`);
6689
6699
  }
6690
6700
  },
6691
6701
  {
6692
6702
  name: "keydown",
6693
- filter: ({ $el, mode }) => includes(mode, "click") && !isTag($el, "input"),
6703
+ filter: ({ $el, mode }) => ["click", "hover"].some((m) => includes(mode, m)) && !isTag($el, "input"),
6694
6704
  handler(e) {
6695
6705
  if (e.keyCode === keyMap.SPACE || e.keyCode === keyMap.ENTER) {
6696
6706
  e.preventDefault();
@@ -6702,15 +6712,17 @@
6702
6712
  name: "click",
6703
6713
  filter: ({ mode }) => ["click", "hover"].some((m) => includes(mode, m)),
6704
6714
  handler(e) {
6715
+ const touch = this._touch;
6716
+ this._touch = false;
6705
6717
  if (e.defaultPrevented) {
6706
6718
  return;
6707
6719
  }
6708
6720
  const link = e.target.closest("a[href]");
6709
6721
  const isButtonLike = isSameSiteAnchor(link) && (!link.hash || matches(this.target, link.hash));
6710
- if (this._preventClick || isButtonLike || link && !this.isToggled(this.target)) {
6722
+ if (isButtonLike || link && !this.isToggled(this.target)) {
6711
6723
  e.preventDefault();
6712
6724
  }
6713
- if (!this._preventClick && includes(this.mode, "click") && (!link || isButtonLike || e.defaultPrevented)) {
6725
+ if ((includes(this.mode, "click") || e.detail === 0 || isTouch(e) || touch) && (!link || isButtonLike || e.defaultPrevented)) {
6714
6726
  this.toggle();
6715
6727
  }
6716
6728
  }