uikit 3.25.30-dev.188f79c → 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 (51) 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 +93 -81
  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 +93 -81
  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/toggle.js +36 -47
  47. package/src/js/util/lang.js +1 -1
  48. package/src/less/components/breadcrumb.less +7 -5
  49. package/src/scss/components/breadcrumb.scss +7 -5
  50. package/tests/js/index.js +2 -2
  51. package/tests/toggle.html +2 -2
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.30-dev.188f79c | 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() :
@@ -3421,7 +3421,7 @@
3421
3421
  return Math.atan2(Math.abs(pos2.y - pos1.y), Math.abs(pos2.x - pos1.x)) * 180 / Math.PI;
3422
3422
  }
3423
3423
 
3424
- var VERSION = '3.25.30-dev.188f79c';
3424
+ var VERSION = '3.25.30-dev.6f7d153';
3425
3425
 
3426
3426
  function initWatches(instance) {
3427
3427
  instance._watches = [];
@@ -7219,7 +7219,7 @@
7219
7219
  self: true,
7220
7220
  handler(e) {
7221
7221
  e.preventDefault();
7222
- if (!matches(this.$el, ":focus,:hover")) {
7222
+ if (!matches(this.$el, ":focus-within,:hover")) {
7223
7223
  this.hide();
7224
7224
  }
7225
7225
  }
@@ -7234,10 +7234,10 @@
7234
7234
  }
7235
7235
  },
7236
7236
  {
7237
- name: `${pointerLeave} focusout`,
7237
+ name: pointerLeave,
7238
7238
  filter: ({ mode }) => includes(mode, "hover"),
7239
7239
  handler(e) {
7240
- if (!isTouch(e) && e.relatedTarget) {
7240
+ if (!isTouch(e) && e.relatedTarget && !matches(this.$el, ":focus-within")) {
7241
7241
  this.hide();
7242
7242
  }
7243
7243
  }
@@ -7263,6 +7263,7 @@
7263
7263
  const handlers = [
7264
7264
  listenForResize(this),
7265
7265
  listenForEscClose(this),
7266
+ listenForFocusClose(this),
7266
7267
  listenForBackgroundClose(this),
7267
7268
  this.autoUpdate && listenForScroll(this),
7268
7269
  this.closeOnScroll && listenForScrollClose(this)
@@ -7451,6 +7452,14 @@
7451
7452
  function listenForScrollClose(drop) {
7452
7453
  return listenForScroll(drop, () => drop.hide(false));
7453
7454
  }
7455
+ function listenForFocusClose(drop) {
7456
+ return on(document, "focusin", ({ target }) => {
7457
+ var _a;
7458
+ if (!drop.$el.contains(target) && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {
7459
+ drop.hide(false);
7460
+ }
7461
+ });
7462
+ }
7454
7463
  function listenForBackgroundClose(drop) {
7455
7464
  return onOutsidePointer(
7456
7465
  (target) => {
@@ -7494,7 +7503,7 @@
7494
7503
  delayShow: 160,
7495
7504
  duration: 200,
7496
7505
  container: false,
7497
- selNavItem: "> li > a, > ul > li > a"
7506
+ selNavItem: "> li > a, > li > button, > ul > li > a, > ul > li > button"
7498
7507
  },
7499
7508
  computed: {
7500
7509
  dropbarAnchor: ({ dropbarAnchor }, $el) => query(dropbarAnchor, $el) || $el,
@@ -7549,7 +7558,7 @@
7549
7558
  },
7550
7559
  events: [
7551
7560
  {
7552
- name: "mouseover focusin",
7561
+ name: "mouseover",
7553
7562
  delegate: ({ selNavItem }) => selNavItem,
7554
7563
  handler({ current }) {
7555
7564
  const active2 = this.getActive();
@@ -7563,31 +7572,24 @@
7563
7572
  self: true,
7564
7573
  delegate: ({ selNavItem }) => selNavItem,
7565
7574
  handler(e) {
7566
- var _a;
7567
- const { current, keyCode } = e;
7575
+ if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) {
7576
+ return;
7577
+ }
7578
+ const { current, keyCode, shiftKey } = e;
7568
7579
  const active2 = this.getActive();
7569
- if (keyCode === keyMap.DOWN) {
7570
- if ((active2 == null ? void 0 : active2.targetEl) === current) {
7580
+ if (keyCode === keyMap.ESC && active2) {
7581
+ closeDropdown(e, active2);
7582
+ return;
7583
+ }
7584
+ if ((active2 == null ? void 0 : active2.targetEl) === current && (keyCode === keyMap.DOWN || keyCode === keyMap.TAB && !shiftKey)) {
7585
+ const [first] = getFocusableElements(active2.$el);
7586
+ if (first) {
7571
7587
  e.preventDefault();
7572
- (_a = $(selFocusable, active2.$el)) == null ? void 0 : _a.focus();
7573
- } else {
7574
- const dropdown = this.dropdowns.find(
7575
- (el) => {
7576
- var _a2;
7577
- return ((_a2 = this.getDropdown(el)) == null ? void 0 : _a2.targetEl) === current;
7578
- }
7579
- );
7580
- if (dropdown) {
7581
- e.preventDefault();
7582
- current.click();
7583
- once(dropdown, "show", (e2) => {
7584
- var _a2;
7585
- return (_a2 = $(selFocusable, e2.target)) == null ? void 0 : _a2.focus();
7586
- });
7587
- }
7588
+ first.focus();
7588
7589
  }
7590
+ return;
7589
7591
  }
7590
- handleNavItemNavigation(e, this.items, active2);
7592
+ handleNavigation(e, getFocusableElements(this.$el, this.selNavItem), current);
7591
7593
  }
7592
7594
  },
7593
7595
  {
@@ -7595,27 +7597,33 @@
7595
7597
  el: ({ dropContainer }) => dropContainer,
7596
7598
  delegate: ({ clsDrop }) => `.${clsDrop}`,
7597
7599
  handler(e) {
7598
- var _a, _b;
7599
- const { current, keyCode, target } = e;
7600
- if (isInput(target) || !includes(this.dropdowns, current)) {
7600
+ if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) {
7601
7601
  return;
7602
7602
  }
7603
+ const { current, keyCode, target } = e;
7603
7604
  const active2 = this.getActive();
7604
- const next = getNavigationIndex(keyCode, keyMap.UP, keyMap.DOWN);
7605
- if (~next) {
7606
- e.preventDefault();
7607
- const elements = $$(selFocusable, current);
7608
- (_a = elements[getIndex(
7609
- next,
7610
- elements,
7611
- findIndex(elements, (el) => matches(el, ":focus"))
7612
- )]) == null ? void 0 : _a.focus();
7605
+ if (!active2 || active2.$el !== current) {
7613
7606
  return;
7614
7607
  }
7615
7608
  if (keyCode === keyMap.ESC) {
7616
- (_b = active2.targetEl) == null ? void 0 : _b.focus();
7609
+ closeDropdown(e, active2);
7610
+ return;
7611
+ }
7612
+ const elements = getFocusableElements(current);
7613
+ if (keyCode === keyMap.TAB) {
7614
+ if (target === elements[e.shiftKey ? 0 : elements.length - 1]) {
7615
+ active2.targetEl.focus();
7616
+ if (e.shiftKey) {
7617
+ e.preventDefault();
7618
+ } else {
7619
+ active2.hide(false, false);
7620
+ }
7621
+ }
7622
+ return;
7623
+ }
7624
+ if (!isInput(target)) {
7625
+ handleNavigation(e, elements, target);
7617
7626
  }
7618
- handleNavItemNavigation(e, this.items, active2);
7619
7627
  }
7620
7628
  },
7621
7629
  {
@@ -7751,25 +7759,32 @@
7751
7759
  }
7752
7760
  }
7753
7761
  };
7754
- function handleNavItemNavigation(e, toggles, active2) {
7755
- var _a, _b, _c;
7756
- const { current, keyCode } = e;
7762
+ function handleNavigation(e, elements, current) {
7763
+ var _a;
7764
+ const keyCode = { [keyMap.UP]: keyMap.LEFT, [keyMap.DOWN]: keyMap.RIGHT }[e.keyCode] || e.keyCode;
7757
7765
  const next = getNavigationIndex(keyCode);
7758
7766
  if (~next) {
7759
7767
  e.preventDefault();
7760
- (_a = active2.hide) == null ? void 0 : _a.call(active2, false);
7761
- toggles[getIndex(next, toggles, toggles.indexOf(active2.targetEl || current))].focus();
7762
- } else if (keyCode === keyMap.TAB) {
7763
- (_b = active2.targetEl) == null ? void 0 : _b.focus();
7764
- (_c = active2.hide) == null ? void 0 : _c.call(active2, false);
7768
+ (_a = elements[getIndex(next, elements, elements.indexOf(current), true)]) == null ? void 0 : _a.focus();
7765
7769
  }
7766
7770
  }
7771
+ function closeDropdown(e, drop) {
7772
+ var _a;
7773
+ e.preventDefault();
7774
+ drop.hide(false);
7775
+ (_a = drop.targetEl) == null ? void 0 : _a.focus();
7776
+ }
7777
+ function getFocusableElements(el, selector = selFocusable) {
7778
+ return $$(selector, el).filter(
7779
+ (el2) => el2.tabIndex >= 0 && !matches(el2, ":disabled") && !el2.closest("[inert]") && isVisible(el2)
7780
+ );
7781
+ }
7767
7782
  function preventInitialPointerEnter(el) {
7768
7783
  const off = () => handlers.forEach((handler) => handler());
7769
7784
  const handlers = [
7770
7785
  once(el.ownerDocument, pointerMove$1, (e) => el.contains(e.target) || off()),
7771
- on(el, `mouseenter ${pointerEnter}`, (e) => e.stopPropagation(), { capture: true }),
7772
- on(el, `mouseleave ${pointerLeave}`, off, { capture: true })
7786
+ on(el, `mouseenter ${pointerEnter}`, (e) => e.stopPropagation(), true),
7787
+ on(el, `mouseleave ${pointerLeave}`, off, true)
7773
7788
  ];
7774
7789
  }
7775
7790
 
@@ -8738,7 +8753,7 @@
8738
8753
  autoUpdate: false,
8739
8754
  delayShow: 200,
8740
8755
  clsDrop: "uk-navbar-dropdown",
8741
- 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",
8756
+ 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",
8742
8757
  // Simplify with :where() selector once browser target is Safari 14+
8743
8758
  dropbarTransparentMode: false
8744
8759
  },
@@ -9997,48 +10012,43 @@
9997
10012
  name: pointerDown$1,
9998
10013
  filter: ({ mode }) => includes(mode, "hover"),
9999
10014
  handler(e) {
10000
- this._preventClick = null;
10001
- if (!isTouch(e) || isBoolean(this._showState) || this.$el.disabled) {
10002
- return;
10003
- }
10004
- trigger(this.$el, "focus");
10005
- once(
10006
- document,
10007
- pointerDown$1,
10008
- () => trigger(this.$el, "blur"),
10009
- true,
10010
- (e2) => !this.$el.contains(e2.target)
10011
- );
10012
- if (includes(this.mode, "click")) {
10013
- this._preventClick = true;
10014
- }
10015
+ this._touch = isTouch(e);
10015
10016
  }
10016
10017
  },
10017
10018
  {
10018
- name: `${pointerEnter} ${pointerLeave} focus blur`,
10019
+ name: `${pointerEnter} ${pointerLeave} click`,
10019
10020
  filter: ({ mode }) => includes(mode, "hover"),
10020
10021
  handler(e) {
10021
- if (isTouch(e) || this.$el.disabled || document.readyState === "loading") {
10022
+ const click = e.type === "click";
10023
+ const allowClick = includes(this.mode, "click") || e.detail === 0 || isTouch(e) || this._touch;
10024
+ if (this.$el.disabled || (click ? e.defaultPrevented || !allowClick : isTouch(e) || document.readyState === "loading")) {
10022
10025
  return;
10023
10026
  }
10024
- const show = includes([pointerEnter, "focus"], e.type);
10025
10027
  const expanded = this.isToggled(this.target);
10026
- if (!show && (!isBoolean(this._showState) || e.type === pointerLeave && matches(this.$el, ":focus") || e.type === "blur" && matches(this.$el, ":hover"))) {
10027
- if (expanded === this._showState) {
10028
- this._showState = null;
10028
+ if (e.type === pointerLeave) {
10029
+ const initial = this._showState;
10030
+ if (!isBoolean(initial)) {
10031
+ return;
10032
+ }
10033
+ this._showState = null;
10034
+ if (expanded !== initial) {
10035
+ this.toggle("togglehide");
10036
+ } else {
10037
+ trigger(this.target, "togglehide", [this]);
10029
10038
  }
10030
10039
  return;
10031
10040
  }
10032
- if (show && isBoolean(this._showState) && expanded !== this._showState) {
10033
- return;
10041
+ if (!isBoolean(this._showState)) {
10042
+ this._showState = expanded;
10043
+ }
10044
+ if (!click && expanded === this._showState) {
10045
+ this.toggle("toggleshow");
10034
10046
  }
10035
- this._showState = show ? expanded : null;
10036
- this.toggle(`toggle${show ? "show" : "hide"}`);
10037
10047
  }
10038
10048
  },
10039
10049
  {
10040
10050
  name: "keydown",
10041
- filter: ({ $el, mode }) => includes(mode, "click") && !isTag($el, "input"),
10051
+ filter: ({ $el, mode }) => ["click", "hover"].some((m) => includes(mode, m)) && !isTag($el, "input"),
10042
10052
  handler(e) {
10043
10053
  if (e.keyCode === keyMap.SPACE || e.keyCode === keyMap.ENTER) {
10044
10054
  e.preventDefault();
@@ -10050,15 +10060,17 @@
10050
10060
  name: "click",
10051
10061
  filter: ({ mode }) => ["click", "hover"].some((m) => includes(mode, m)),
10052
10062
  handler(e) {
10063
+ const touch = this._touch;
10064
+ this._touch = false;
10053
10065
  if (e.defaultPrevented) {
10054
10066
  return;
10055
10067
  }
10056
10068
  const link = e.target.closest("a[href]");
10057
10069
  const isButtonLike = isSameSiteAnchor(link) && (!link.hash || matches(this.target, link.hash));
10058
- if (this._preventClick || isButtonLike || link && !this.isToggled(this.target)) {
10070
+ if (isButtonLike || link && !this.isToggled(this.target)) {
10059
10071
  e.preventDefault();
10060
10072
  }
10061
- if (!this._preventClick && includes(this.mode, "click") && (!link || isButtonLike || e.defaultPrevented)) {
10073
+ if ((includes(this.mode, "click") || e.detail === 0 || isTouch(e) || touch) && (!link || isButtonLike || e.defaultPrevented)) {
10062
10074
  this.toggle();
10063
10075
  }
10064
10076
  }