@sinequa/atomic-angular 1.9.1 → 1.9.2

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.
@@ -7716,6 +7716,21 @@ class NavbarTabsComponent {
7716
7716
  page: undefined
7717
7717
  };
7718
7718
  }
7719
+ // A tab with a known result count of 0 is disabled — both in the visible tab bar
7720
+ // and once it collapses into the overflow ("more") menu.
7721
+ isTabDisabled(tab) {
7722
+ return this.showCount() && tab.count === 0;
7723
+ }
7724
+ // pointer-events: none (applied via the [[disabled]] CSS selector) already blocks
7725
+ // mouse clicks on a disabled overflow item, but it does not stop a "click" fired by
7726
+ // keyboard activation (Enter) of a focused <a>, hence the explicit guard here.
7727
+ onOverflowItemClick(event, tab) {
7728
+ if (this.isTabDisabled(tab)) {
7729
+ event.preventDefault();
7730
+ return;
7731
+ }
7732
+ this.changeTab();
7733
+ }
7719
7734
  changeTab() { }
7720
7735
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: NavbarTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
7721
7736
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: NavbarTabsComponent, isStandalone: true, selector: "navbar-tabs", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, noTruncate: { classPropertyName: "noTruncate", publicName: "noTruncate", isSignal: true, isRequired: false, transformFunction: null }, minTabWidth: { classPropertyName: "minTabWidth", publicName: "minTabWidth", isSignal: true, isRequired: false, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "cn('block', class())" } }, providers: [provideTranslocoScope('navbar-tabs')], ngImport: i0, template: `
@@ -7733,7 +7748,7 @@ class NavbarTabsComponent {
7733
7748
  [noTruncate]="noTruncate()"
7734
7749
  [style.--tab-min-width]="tabMinWidth(!!tab.icon)"
7735
7750
  [attr.aria-selected]="nav.currentPath() === tab.path"
7736
- [attr.disabled]="showCount() && tab.count === 0 ? '' : null"
7751
+ [attr.disabled]="isTabDisabled(tab) ? '' : null"
7737
7752
  [active]="nav.currentPath() === tab.path"
7738
7753
  [routerLink]="[tab.routerLink]"
7739
7754
  [queryParams]="getQueryParams(tab)"
@@ -7778,14 +7793,16 @@ class NavbarTabsComponent {
7778
7793
 
7779
7794
  <MenuContent class="z-500 w-fit" position="bottom-end">
7780
7795
  @for (tab of moreTabs(); track $index) {
7781
- <MenuItem>
7796
+ <MenuItem [attr.disabled]="isTabDisabled(tab) ? '' : null">
7782
7797
  <a class="inline-flex items-center gap-1 whitespace-nowrap first-letter:capitalize"
7783
7798
  [routerLink]="[tab.routerLink]"
7784
7799
  [queryParams]="getQueryParams(tab)"
7785
7800
  [queryParamsHandling]="getQueryParamsHandling()"
7786
7801
  [attr.aria-selected]="nav.currentPath() === tab.path"
7787
7802
  [attr.aria-label]="tab.display | syslang | transloco"
7788
- (click)="changeTab()">
7803
+ [attr.aria-disabled]="isTabDisabled(tab) ? true : null"
7804
+ [attr.tabindex]="isTabDisabled(tab) ? -1 : null"
7805
+ (click)="onOverflowItemClick($event, tab)">
7789
7806
  @if (tab.icon) {
7790
7807
  <FaIcon [faClass]="tab.icon"/>
7791
7808
  }
@@ -7838,7 +7855,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
7838
7855
  [noTruncate]="noTruncate()"
7839
7856
  [style.--tab-min-width]="tabMinWidth(!!tab.icon)"
7840
7857
  [attr.aria-selected]="nav.currentPath() === tab.path"
7841
- [attr.disabled]="showCount() && tab.count === 0 ? '' : null"
7858
+ [attr.disabled]="isTabDisabled(tab) ? '' : null"
7842
7859
  [active]="nav.currentPath() === tab.path"
7843
7860
  [routerLink]="[tab.routerLink]"
7844
7861
  [queryParams]="getQueryParams(tab)"
@@ -7883,14 +7900,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
7883
7900
 
7884
7901
  <MenuContent class="z-500 w-fit" position="bottom-end">
7885
7902
  @for (tab of moreTabs(); track $index) {
7886
- <MenuItem>
7903
+ <MenuItem [attr.disabled]="isTabDisabled(tab) ? '' : null">
7887
7904
  <a class="inline-flex items-center gap-1 whitespace-nowrap first-letter:capitalize"
7888
7905
  [routerLink]="[tab.routerLink]"
7889
7906
  [queryParams]="getQueryParams(tab)"
7890
7907
  [queryParamsHandling]="getQueryParamsHandling()"
7891
7908
  [attr.aria-selected]="nav.currentPath() === tab.path"
7892
7909
  [attr.aria-label]="tab.display | syslang | transloco"
7893
- (click)="changeTab()">
7910
+ [attr.aria-disabled]="isTabDisabled(tab) ? true : null"
7911
+ [attr.tabindex]="isTabDisabled(tab) ? -1 : null"
7912
+ (click)="onOverflowItemClick($event, tab)">
7894
7913
  @if (tab.icon) {
7895
7914
  <FaIcon [faClass]="tab.icon"/>
7896
7915
  }