@eagami/ui 5.82.1 → 5.82.3

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.
@@ -14892,6 +14892,10 @@ var MenuComponent = class MenuComponent {
14892
14892
  const list = this.listEl()?.nativeElement;
14893
14893
  const active = document.activeElement;
14894
14894
  if (!list || !active || !list.contains(active)) return;
14895
+ if (event.key === "Tab") {
14896
+ if (!this.asContextMenu()) this.close(true);
14897
+ return;
14898
+ }
14895
14899
  const items = this.getEnabledItems();
14896
14900
  if (items.length === 0) return;
14897
14901
  const current = items.indexOf(active);
@@ -18995,6 +18999,9 @@ var DropdownComponent = class DropdownComponent extends LabelledFieldControlBase
18995
18999
  this.elRef()?.nativeElement.focus();
18996
19000
  }
18997
19001
  break;
19002
+ case "Tab":
19003
+ if (this.isOpen()) this.close();
19004
+ break;
18998
19005
  case "Home":
18999
19006
  event.preventDefault();
19000
19007
  if (!this.isOpen()) this.toggle();
@@ -23702,7 +23709,10 @@ var MultiSelectComponent = class MultiSelectComponent extends LabelledFieldContr
23702
23709
  event.preventDefault();
23703
23710
  this.close();
23704
23711
  this.triggerEl()?.nativeElement.focus();
23705
- } else if (event.key === "Tab") this.close();
23712
+ } else if (event.key === "Tab") {
23713
+ this.triggerEl()?.nativeElement.focus();
23714
+ this.close();
23715
+ }
23706
23716
  }
23707
23717
  moveFocusedRow(row) {
23708
23718
  this.focusedIndex.set(row);
@@ -29392,6 +29402,12 @@ var TabsComponent = class TabsComponent {
29392
29402
  orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
29393
29403
  ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
29394
29404
  activeTab = model("", ...ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []);
29405
+ selectedTab = computed(() => {
29406
+ const tabs = this.registeredTabs();
29407
+ const active = this.activeTab();
29408
+ if (tabs.some((t) => t.value() === active)) return active;
29409
+ return tabs.find((t) => !t.disabled())?.value();
29410
+ }, ...ngDevMode ? [{ debugName: "selectedTab" }] : /* istanbul ignore next */ []);
29395
29411
  changed = output();
29396
29412
  registerTab(tab) {
29397
29413
  this.registeredTabs.update((tabs) => [...tabs, tab]);
@@ -29405,7 +29421,7 @@ var TabsComponent = class TabsComponent {
29405
29421
  }
29406
29422
  handleKeydown(event) {
29407
29423
  const tabList = this.registeredTabs().filter((t) => !t.disabled());
29408
- const currentIndex = tabList.findIndex((t) => t.value() === this.activeTab());
29424
+ const currentIndex = tabList.findIndex((t) => t.value() === this.selectedTab());
29409
29425
  let forwardKey = "ArrowDown";
29410
29426
  let backwardKey = "ArrowUp";
29411
29427
  if (this.orientation() === "horizontal") {
@@ -29564,7 +29580,7 @@ var TabComponent = class TabComponent {
29564
29580
  label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
29565
29581
  disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
29566
29582
  id = input(uniqueId("ea-tab"), ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
29567
- isActive = computed(() => this.tabs.activeTab() === this.value(), ...ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []);
29583
+ isActive = computed(() => this.tabs.selectedTab() === this.value(), ...ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []);
29568
29584
  vertical = computed(() => this.tabs.orientation() === "vertical", ...ngDevMode ? [{ debugName: "vertical" }] : /* istanbul ignore next */ []);
29569
29585
  ngOnInit() {
29570
29586
  this.tabs.registerTab(this);