@sinequa/atomic-angular 1.5.1 → 1.5.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.
|
@@ -7266,6 +7266,7 @@ class NavbarTabsComponent {
|
|
|
7266
7266
|
cn = cn;
|
|
7267
7267
|
class = input(...(ngDevMode ? [undefined, { debugName: "class" }] : []));
|
|
7268
7268
|
router = inject(Router);
|
|
7269
|
+
appStore = inject(AppStore);
|
|
7269
7270
|
showCount = input(true, ...(ngDevMode ? [{ debugName: "showCount", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
7270
7271
|
/**
|
|
7271
7272
|
* When enabled (default), tab labels are never clipped: tabs that do not fit
|
|
@@ -7295,6 +7296,42 @@ class NavbarTabsComponent {
|
|
|
7295
7296
|
return undefined;
|
|
7296
7297
|
return hasIcon ? "calc(1.5rem + 16px)" : "calc(1.5rem + 4ch)";
|
|
7297
7298
|
}
|
|
7299
|
+
persistFiltersAcrossTabs = computed(() => {
|
|
7300
|
+
const general = this.appStore.general?.();
|
|
7301
|
+
const appFeature = general?.features?.persistFiltersAcrossTabs;
|
|
7302
|
+
if (appFeature !== undefined)
|
|
7303
|
+
return appFeature;
|
|
7304
|
+
return false;
|
|
7305
|
+
}, ...(ngDevMode ? [{ debugName: "persistFiltersAcrossTabs" }] : []));
|
|
7306
|
+
// Determine how query params are applied on tab change.
|
|
7307
|
+
// - persist: 'merge' so the tab identity params (n/t/q) are updated while
|
|
7308
|
+
// the filter params (f/sort/id/page) already in the URL are kept.
|
|
7309
|
+
// - default: 'replace' so everything is rewritten from scratch.
|
|
7310
|
+
getQueryParamsHandling() {
|
|
7311
|
+
return this.persistFiltersAcrossTabs() ? 'merge' : 'replace';
|
|
7312
|
+
}
|
|
7313
|
+
// Get query params conditionally
|
|
7314
|
+
getQueryParams(tab) {
|
|
7315
|
+
if (this.persistFiltersAcrossTabs()) {
|
|
7316
|
+
// When preserving filters, still update the tab identity params so the
|
|
7317
|
+
// store rebuilds the query for the new tab. 'merge' keeps f/sort/id/page.
|
|
7318
|
+
return {
|
|
7319
|
+
n: tab.queryName,
|
|
7320
|
+
q: this.nav.searchText(),
|
|
7321
|
+
t: tab.wsQueryTab
|
|
7322
|
+
};
|
|
7323
|
+
}
|
|
7324
|
+
// When replacing, explicitly set the filters to undefined to clear them
|
|
7325
|
+
return {
|
|
7326
|
+
n: tab.queryName,
|
|
7327
|
+
q: this.nav.searchText(),
|
|
7328
|
+
t: tab.wsQueryTab,
|
|
7329
|
+
f: undefined,
|
|
7330
|
+
sort: undefined,
|
|
7331
|
+
id: undefined,
|
|
7332
|
+
page: undefined
|
|
7333
|
+
};
|
|
7334
|
+
}
|
|
7298
7335
|
changeTab() { }
|
|
7299
7336
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NavbarTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7300
7337
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", 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())" } }, ngImport: i0, template: `
|
|
@@ -7315,9 +7352,10 @@ class NavbarTabsComponent {
|
|
|
7315
7352
|
[attr.disabled]="showCount() && tab.count === 0 ? '' : null"
|
|
7316
7353
|
[active]="nav.currentPath() === tab.path"
|
|
7317
7354
|
[routerLink]="[tab.routerLink]"
|
|
7318
|
-
[queryParams]="
|
|
7355
|
+
[queryParams]="getQueryParams(tab)"
|
|
7356
|
+
[queryParamsHandling]="getQueryParamsHandling()"
|
|
7319
7357
|
(click)="changeTab()"
|
|
7320
|
-
(keydown.enter)="router.navigate([tab.routerLink], { queryParams:
|
|
7358
|
+
(keydown.enter)="router.navigate([tab.routerLink], { queryParams: getQueryParams(tab), queryParamsHandling: getQueryParamsHandling() })"
|
|
7321
7359
|
>
|
|
7322
7360
|
<div [class]="cn('flex items-center content-start w-full gap-1', !noTruncate() && '@container overflow-hidden min-w-0')">
|
|
7323
7361
|
@if (tab.icon) {
|
|
@@ -7355,7 +7393,8 @@ class NavbarTabsComponent {
|
|
|
7355
7393
|
<MenuItem>
|
|
7356
7394
|
<a class="inline-flex items-center gap-1 whitespace-nowrap first-letter:capitalize"
|
|
7357
7395
|
[routerLink]="[tab.routerLink]"
|
|
7358
|
-
[queryParams]="
|
|
7396
|
+
[queryParams]="getQueryParams(tab)"
|
|
7397
|
+
[queryParamsHandling]="getQueryParamsHandling()"
|
|
7359
7398
|
[attr.aria-selected]="nav.currentPath() === tab.path"
|
|
7360
7399
|
[attr.aria-label]="tab.display | syslang | transloco"
|
|
7361
7400
|
(click)="changeTab()">
|
|
@@ -7413,9 +7452,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
7413
7452
|
[attr.disabled]="showCount() && tab.count === 0 ? '' : null"
|
|
7414
7453
|
[active]="nav.currentPath() === tab.path"
|
|
7415
7454
|
[routerLink]="[tab.routerLink]"
|
|
7416
|
-
[queryParams]="
|
|
7455
|
+
[queryParams]="getQueryParams(tab)"
|
|
7456
|
+
[queryParamsHandling]="getQueryParamsHandling()"
|
|
7417
7457
|
(click)="changeTab()"
|
|
7418
|
-
(keydown.enter)="router.navigate([tab.routerLink], { queryParams:
|
|
7458
|
+
(keydown.enter)="router.navigate([tab.routerLink], { queryParams: getQueryParams(tab), queryParamsHandling: getQueryParamsHandling() })"
|
|
7419
7459
|
>
|
|
7420
7460
|
<div [class]="cn('flex items-center content-start w-full gap-1', !noTruncate() && '@container overflow-hidden min-w-0')">
|
|
7421
7461
|
@if (tab.icon) {
|
|
@@ -7453,7 +7493,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
7453
7493
|
<MenuItem>
|
|
7454
7494
|
<a class="inline-flex items-center gap-1 whitespace-nowrap first-letter:capitalize"
|
|
7455
7495
|
[routerLink]="[tab.routerLink]"
|
|
7456
|
-
[queryParams]="
|
|
7496
|
+
[queryParams]="getQueryParams(tab)"
|
|
7497
|
+
[queryParamsHandling]="getQueryParamsHandling()"
|
|
7457
7498
|
[attr.aria-selected]="nav.currentPath() === tab.path"
|
|
7458
7499
|
[attr.aria-label]="tab.display | syslang | transloco"
|
|
7459
7500
|
(click)="changeTab()">
|