@sinequa/atomic-angular 1.0.4 → 1.0.7

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.
@@ -1551,6 +1551,16 @@ function withThemes(app, themes) {
1551
1551
  return app;
1552
1552
  }
1553
1553
 
1554
+ /**
1555
+ * Signs in the user by checking the global configuration for authentication method and acting accordingly.
1556
+ *
1557
+ * This function first clears any existing session tokens to ensure a clean authentication state. It then checks the
1558
+ * global configuration to determine whether to use credentials-based authentication or Single Sign-On (SSO). If
1559
+ * credentials are used, it redirects the user to the login page. If SSO is enabled, it reloads the page to trigger
1560
+ * the SSO login process. If neither method is specified, it attempts a standard login and handles any errors that
1561
+ * may occur during the process.
1562
+ * @returns A promise resolving to a boolean indicating the success of the sign-in operation.
1563
+ */
1554
1564
  async function signIn() {
1555
1565
  assertInInjectionContext(signIn);
1556
1566
  const router = inject(Router);
@@ -1561,21 +1571,24 @@ async function signIn() {
1561
1571
  // If credentials are used and user override is not active, redirect to the login page
1562
1572
  if (useCredentials) {
1563
1573
  router.navigate([loginPath], { queryParams: { returnUrl: lastUrlAfterNavigation } });
1564
- return; // prevent further execution
1574
+ return false; // prevent further execution
1565
1575
  }
1566
1576
  // SSO is set to true when the browser handles authentication automatically
1567
1577
  // If SSO is used, reload the page to trigger SSO login
1568
1578
  if (useSSO) {
1569
1579
  // reload the page to trigger SSO login
1570
1580
  window.location.reload();
1571
- return; // prevent further execution
1581
+ return false; // prevent further execution
1572
1582
  }
1573
1583
  // Otherwise, perform a standard login
1574
1584
  try {
1575
1585
  const response = await login();
1576
- info("Response from login", response);
1577
- if (!response) {
1578
- warn("No response from login, redirecting to login page", response);
1586
+ if (response) {
1587
+ info("Response from login", response);
1588
+ return true;
1589
+ }
1590
+ else {
1591
+ warn("Response from login", response);
1579
1592
  }
1580
1593
  }
1581
1594
  catch (err) {
@@ -1586,7 +1599,7 @@ async function signIn() {
1586
1599
  }
1587
1600
  throw err;
1588
1601
  }
1589
- return; // prevent further execution
1602
+ return false; // prevent further execution
1590
1603
  }
1591
1604
 
1592
1605
  /**
@@ -1607,24 +1620,28 @@ async function withBootstrapApp(applicationService, { createRoutes = true }) {
1607
1620
  return new Promise(resolve => {
1608
1621
  // Check if the user is authenticated
1609
1622
  signIn()
1610
- .then(() => {
1611
- info('User authenticated, initializing application...');
1612
- // Initialize the application
1613
- applicationService
1614
- .initialize(createRoutes)
1615
- .then(() => {
1616
- info(`Application initialized with routes: ${createRoutes} successfully.`);
1617
- resolve();
1618
- })
1619
- .catch(err => {
1620
- error(`Error initializing application with routes: ${createRoutes}:`, err);
1621
- resolve();
1622
- });
1623
+ .then((response) => {
1624
+ if (response) {
1625
+ info('User authenticated, initializing application...');
1626
+ // Initialize the application
1627
+ applicationService
1628
+ .initialize(createRoutes)
1629
+ .then(() => {
1630
+ info(`Application initialized with routes: ${createRoutes} successfully.`);
1631
+ })
1632
+ .catch(err => {
1633
+ error(`Error initializing application with routes: ${createRoutes}:`, err);
1634
+ });
1635
+ }
1636
+ else {
1637
+ info('User not authenticated, skipping application initialization.');
1638
+ }
1639
+ ;
1623
1640
  })
1624
1641
  .catch(err => {
1625
1642
  error('Error while signing in:', err);
1626
- resolve();
1627
- });
1643
+ })
1644
+ .finally(() => resolve());
1628
1645
  });
1629
1646
  }
1630
1647
 
@@ -3301,39 +3318,53 @@ class AggregationsService {
3301
3318
  return node;
3302
3319
  }
3303
3320
  /* aggregations helpers fot the filters components */
3304
- getAuthorizedFilters(aggregations, includedFilters = [], excludedFilters = []) {
3321
+ getAuthorizedFilters(aggregations, includedFilters = [], excludedFilters = [], homepageOnly = false) {
3305
3322
  const agg = aggregations || this.appStore.getAuthorizedFilters();
3306
3323
  const authorizedFilters = agg
3307
3324
  .filter((f) => this.getFilterCriteria()(f)) // filter only the filters present
3325
+ .filter((f) => !homepageOnly || this.getHomepageFilterCriteria()(f)) // when requested, keep only filters flagged `homepage: true`
3308
3326
  .filter((f) => !excludedFilters.includes(f.name))
3309
3327
  .filter((f) => !includedFilters.length || includedFilters.includes(f.name))
3310
3328
  .map((f) => ({ field: f.column, column: f.column, name: f.name })); // field is needed for filters constructions
3311
3329
  return authorizedFilters;
3312
3330
  }
3331
+ /**
3332
+ * Determines whether a custom JSON filter refers to the given aggregation.
3333
+ *
3334
+ * Matches by `name` when it is defined, otherwise falls back to `column`,
3335
+ * resolving column/alias ambiguity through the app store's column map.
3336
+ *
3337
+ * @param filter - The filter object coming from the custom JSON.
3338
+ * @param agg - The aggregation returned by the backend.
3339
+ * @returns `true` if the filter refers to the aggregation.
3340
+ */
3341
+ matchesAggregation(filter, agg) {
3342
+ // if filter.name is defined, use it to compare
3343
+ if (filter.name) {
3344
+ return filter.name.toLocaleLowerCase() === agg.name.toLocaleLowerCase();
3345
+ }
3346
+ // fallback to column comparison
3347
+ // column can be a column's name or an alias
3348
+ // resolve ambiguity between column and alias
3349
+ const { columnMap } = getState(this.appStore);
3350
+ // get the actual column for both filter and f
3351
+ const aggColumn = columnMap?.[agg.column.toLocaleLowerCase()];
3352
+ const filterColumn = columnMap?.[filter?.column?.toLocaleLowerCase() || filter.name.toLocaleLowerCase()];
3353
+ // if either column is not found, fallback to comparing the raw values
3354
+ if (!aggColumn || !filterColumn) {
3355
+ return filter?.column?.toLocaleLowerCase() === agg?.column?.toLocaleLowerCase();
3356
+ }
3357
+ // compare the actual column names coming from the column map
3358
+ return aggColumn?.name === filterColumn?.name;
3359
+ }
3313
3360
  getFilterCriteria = () => {
3314
3361
  // filter: object filter from the custom JSON
3315
3362
  // agg: object aggregation returned by the backend
3316
- return (agg) => {
3317
- return this.appStore.filters().some((filter) => {
3318
- // if filter.name is defined, use it to compare
3319
- if (filter.name) {
3320
- return filter.name.toLocaleLowerCase() === agg.name.toLocaleLowerCase();
3321
- }
3322
- // fallback to column comparison
3323
- // column can be a column's name or an alias
3324
- // resolve ambiguity between column and alias
3325
- const { columnMap } = getState(this.appStore);
3326
- // get the actual column for both filter and f
3327
- const aggColumn = columnMap?.[agg.column.toLocaleLowerCase()];
3328
- const filterColumn = columnMap?.[filter?.column?.toLocaleLowerCase() || filter.name.toLocaleLowerCase()];
3329
- // if either column is not found, fallback to comparing the raw values
3330
- if (!aggColumn || !filterColumn) {
3331
- return filter?.column?.toLocaleLowerCase() === agg?.column?.toLocaleLowerCase();
3332
- }
3333
- // compare the actual column names coming from the column map
3334
- return aggColumn?.name === filterColumn?.name;
3335
- });
3336
- };
3363
+ return (agg) => this.appStore.filters().some((filter) => this.matchesAggregation(filter, agg));
3364
+ };
3365
+ getHomepageFilterCriteria = () => {
3366
+ // only consider filters explicitly flagged with `homepage: true` in the custom JSON
3367
+ return (agg) => this.appStore.filters().some((filter) => filter.homepage && this.matchesAggregation(filter, agg));
3337
3368
  };
3338
3369
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AggregationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3339
3370
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AggregationsService, providedIn: "root" });
@@ -4983,8 +5014,9 @@ class SourceComponent {
4983
5014
  iconDetails = computed(() => {
4984
5015
  const [collection] = this.collection() || [];
4985
5016
  const connector = (this.connector() ?? "").toLocaleLowerCase();
4986
- if (!collection)
4987
- return undefined;
5017
+ if (!collection) {
5018
+ return { iconClass: "", iconPath: undefined };
5019
+ }
4988
5020
  const src = this.appStore.sources();
4989
5021
  const name = collection.split("/")[1].toLocaleLowerCase();
4990
5022
  const defaultIconClass = "far fa-file";
@@ -5007,11 +5039,11 @@ class SourceComponent {
5007
5039
  return { iconClass: defaultIconClass };
5008
5040
  }, ...(ngDevMode ? [{ debugName: "iconDetails" }] : []));
5009
5041
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SourceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5010
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: SourceComponent, isStandalone: true, selector: "source, Source", inputs: { collection: { classPropertyName: "collection", publicName: "collection", isSignal: true, isRequired: false, transformFunction: null }, connector: { classPropertyName: "connector", publicName: "connector", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideTranslocoScope("sources")], ngImport: i0, template: "@if (iconDetails()?.iconPath) {\r\n <img\r\n [src]=\"iconDetails()?.iconPath\"\r\n [alt]=\"collection()?.[0] || ('sources.sourceIcon' | transloco)\" />\r\n} @else {\r\n <FaIcon\r\n [faClass]=\"iconDetails()!.iconClass\"\r\n [attr.aria-label]=\"'sources.sourceIcon' | transloco\" />\r\n}\r\n", dependencies: [{ kind: "component", type: FaIconComponent, selector: "fa-icon, FaIcon", inputs: ["faClass"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
5042
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: SourceComponent, isStandalone: true, selector: "source, Source", inputs: { collection: { classPropertyName: "collection", publicName: "collection", isSignal: true, isRequired: false, transformFunction: null }, connector: { classPropertyName: "connector", publicName: "connector", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideTranslocoScope("sources")], ngImport: i0, template: "@if (iconDetails().iconPath) {\r\n <img\r\n [src]=\"iconDetails().iconPath\"\r\n [alt]=\"collection()?.[0] || ('sources.sourceIcon' | transloco)\" />\r\n} @else {\r\n <FaIcon\r\n [faClass]=\"iconDetails().iconClass\"\r\n [attr.aria-label]=\"'sources.sourceIcon' | transloco\" />\r\n}\r\n", dependencies: [{ kind: "component", type: FaIconComponent, selector: "fa-icon, FaIcon", inputs: ["faClass"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
5011
5043
  }
5012
5044
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SourceComponent, decorators: [{
5013
5045
  type: Component,
5014
- args: [{ selector: "source, Source", standalone: true, imports: [TranslocoPipe, FaIconComponent], providers: [provideTranslocoScope("sources")], template: "@if (iconDetails()?.iconPath) {\r\n <img\r\n [src]=\"iconDetails()?.iconPath\"\r\n [alt]=\"collection()?.[0] || ('sources.sourceIcon' | transloco)\" />\r\n} @else {\r\n <FaIcon\r\n [faClass]=\"iconDetails()!.iconClass\"\r\n [attr.aria-label]=\"'sources.sourceIcon' | transloco\" />\r\n}\r\n" }]
5046
+ args: [{ selector: "source, Source", standalone: true, imports: [TranslocoPipe, FaIconComponent], providers: [provideTranslocoScope("sources")], template: "@if (iconDetails().iconPath) {\r\n <img\r\n [src]=\"iconDetails().iconPath\"\r\n [alt]=\"collection()?.[0] || ('sources.sourceIcon' | transloco)\" />\r\n} @else {\r\n <FaIcon\r\n [faClass]=\"iconDetails().iconClass\"\r\n [attr.aria-label]=\"'sources.sourceIcon' | transloco\" />\r\n}\r\n" }]
5015
5047
  }], propDecorators: { collection: [{ type: i0.Input, args: [{ isSignal: true, alias: "collection", required: false }] }], connector: [{ type: i0.Input, args: [{ isSignal: true, alias: "connector", required: false }] }] } });
5016
5048
 
5017
5049
  class DocumentLocatorComponent {
@@ -7896,11 +7928,16 @@ class AdvancedFiltersComponent {
7896
7928
  }, ...(ngDevMode ? [{ debugName: "allowEmptySearch" }] : []));
7897
7929
  text = "";
7898
7930
  constructor() {
7899
- this.getFirstPageQuery();
7931
+ effect(() => {
7932
+ getState(this.appStore);
7933
+ const query = this.appStore.getDefaultQuery();
7934
+ if (query?.name) {
7935
+ this.getFirstPageQuery(query?.name);
7936
+ }
7937
+ });
7900
7938
  }
7901
- async getFirstPageQuery() {
7902
- const query = this.appStore.getDefaultQuery() || { name: "_default" };
7903
- const response = await fetchQuery({ isFirstPage: true, name: query.name });
7939
+ async getFirstPageQuery(queryName) {
7940
+ const response = await fetchQuery({ isFirstPage: true, name: queryName });
7904
7941
  this.aggregations.set(response.aggregations);
7905
7942
  }
7906
7943
  onTabChange(tab) {
@@ -11860,11 +11897,16 @@ class DrawerAdvancedFiltersComponent extends DrawerComponent {
11860
11897
  text = "";
11861
11898
  constructor() {
11862
11899
  super();
11863
- this.getFirstPageQuery();
11900
+ effect(() => {
11901
+ getState(this.appStore);
11902
+ const query = this.appStore.getDefaultQuery();
11903
+ if (query?.name) {
11904
+ this.getFirstPageQuery(query?.name);
11905
+ }
11906
+ });
11864
11907
  }
11865
- async getFirstPageQuery() {
11866
- const query = this.appStore.getDefaultQuery() || { name: "_default" };
11867
- const response = await fetchQuery({ isFirstPage: true, name: query.name });
11908
+ async getFirstPageQuery(queryName) {
11909
+ const response = await fetchQuery({ isFirstPage: true, name: queryName });
11868
11910
  this.aggregations.set(response.aggregations);
11869
11911
  }
11870
11912
  onTabChange(tab) {
@@ -14253,6 +14295,7 @@ class MoreComponent {
14253
14295
  includedFilters = input([], ...(ngDevMode ? [{ debugName: "includedFilters" }] : []));
14254
14296
  excludedFilters = input([], ...(ngDevMode ? [{ debugName: "excludedFilters" }] : []));
14255
14297
  aggregations = input(...(ngDevMode ? [undefined, { debugName: "aggregations" }] : []));
14298
+ homepage = input(false, ...(ngDevMode ? [{ debugName: "homepage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
14256
14299
  appStore = inject(AppStore);
14257
14300
  aggregationsStore = inject(AggregationsStore);
14258
14301
  queryParamsStore = inject(QueryParamsStore);
@@ -14280,7 +14323,7 @@ class MoreComponent {
14280
14323
  effect(() => {
14281
14324
  const count = this.count();
14282
14325
  const authorizedFilters = this.aggregationsService
14283
- .getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters())
14326
+ .getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters(), this.homepage())
14284
14327
  .toSpliced(0, count);
14285
14328
  const f = authorizedFilters.map((agg) => {
14286
14329
  const { icon = "far fa-list", hidden = false } = this.appStore.getAggregationCustomization(agg.column, agg.name) || {};
@@ -14331,7 +14374,7 @@ class MoreComponent {
14331
14374
  return count > 0;
14332
14375
  }
14333
14376
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
14334
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: MoreComponent, isStandalone: true, selector: "more, More", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, includedFilters: { classPropertyName: "includedFilters", publicName: "includedFilters", isSignal: true, isRequired: false, transformFunction: null }, excludedFilters: { classPropertyName: "excludedFilters", publicName: "excludedFilters", isSignal: true, isRequired: false, transformFunction: null }, aggregations: { classPropertyName: "aggregations", publicName: "aggregations", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "divide-y divide-muted-foreground/18" }, ngImport: i0, template: `
14377
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: MoreComponent, isStandalone: true, selector: "more, More", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, includedFilters: { classPropertyName: "includedFilters", publicName: "includedFilters", isSignal: true, isRequired: false, transformFunction: null }, excludedFilters: { classPropertyName: "excludedFilters", publicName: "excludedFilters", isSignal: true, isRequired: false, transformFunction: null }, aggregations: { classPropertyName: "aggregations", publicName: "aggregations", isSignal: true, isRequired: false, transformFunction: null }, homepage: { classPropertyName: "homepage", publicName: "homepage", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "divide-y divide-muted-foreground/18" }, ngImport: i0, template: `
14335
14378
  @for (filter of visibleFilters(); track $index) {
14336
14379
  <Aggregation
14337
14380
  class="w-60 max-w-80 [--height:15lh]"
@@ -14362,7 +14405,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
14362
14405
  `, host: {
14363
14406
  class: "divide-y divide-muted-foreground/18"
14364
14407
  }, styles: [":host{scrollbar-width:none}\n"] }]
14365
- }], ctorParameters: () => [], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], includedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "includedFilters", required: false }] }], excludedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludedFilters", required: false }] }], aggregations: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregations", required: false }] }] } });
14408
+ }], ctorParameters: () => [], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], includedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "includedFilters", required: false }] }], excludedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludedFilters", required: false }] }], aggregations: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregations", required: false }] }], homepage: [{ type: i0.Input, args: [{ isSignal: true, alias: "homepage", required: false }] }] } });
14366
14409
 
14367
14410
  class MoreButtonComponent {
14368
14411
  appStore = inject(AppStore);
@@ -14374,10 +14417,11 @@ class MoreButtonComponent {
14374
14417
  includedFilters = input([], ...(ngDevMode ? [{ debugName: "includedFilters" }] : []));
14375
14418
  excludedFilters = input([], ...(ngDevMode ? [{ debugName: "excludedFilters" }] : []));
14376
14419
  aggregations = input(...(ngDevMode ? [undefined, { debugName: "aggregations" }] : []));
14420
+ homepage = input(false, ...(ngDevMode ? [{ debugName: "homepage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
14377
14421
  totalFiltersCount = computed(() => {
14378
14422
  const count = this.count();
14379
14423
  const authorizedFilters = this.aggregationsService
14380
- .getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters())
14424
+ .getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters(), this.homepage())
14381
14425
  .toSpliced(0, count);
14382
14426
  const total = authorizedFilters.reduce((acc, filter) => {
14383
14427
  const f = this.queryParamsStore.getFilter(filter);
@@ -14387,7 +14431,7 @@ class MoreButtonComponent {
14387
14431
  return total;
14388
14432
  }, ...(ngDevMode ? [{ debugName: "totalFiltersCount" }] : []));
14389
14433
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MoreButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
14390
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: MoreButtonComponent, isStandalone: true, selector: "more-button, MoreButton", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, includedFilters: { classPropertyName: "includedFilters", publicName: "includedFilters", isSignal: true, isRequired: false, transformFunction: null }, excludedFilters: { classPropertyName: "excludedFilters", publicName: "excludedFilters", isSignal: true, isRequired: false, transformFunction: null }, aggregations: { classPropertyName: "aggregations", publicName: "aggregations", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
14434
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: MoreButtonComponent, isStandalone: true, selector: "more-button, MoreButton", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, includedFilters: { classPropertyName: "includedFilters", publicName: "includedFilters", isSignal: true, isRequired: false, transformFunction: null }, excludedFilters: { classPropertyName: "excludedFilters", publicName: "excludedFilters", isSignal: true, isRequired: false, transformFunction: null }, aggregations: { classPropertyName: "aggregations", publicName: "aggregations", isSignal: true, isRequired: false, transformFunction: null }, homepage: { classPropertyName: "homepage", publicName: "homepage", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
14391
14435
  <Popover class="group/more">
14392
14436
  <button
14393
14437
  variant="ghost"
@@ -14405,11 +14449,11 @@ class MoreButtonComponent {
14405
14449
 
14406
14450
  <PopoverContent #contentRef="popoverContent" [position]="position()" class="min-w-max">
14407
14451
  @if(contentRef.isVisible) {
14408
- <More [count]="count()" [includedFilters]="includedFilters()" [excludedFilters]="excludedFilters()" [aggregations]="aggregations()" class="block h-full w-full max-w-80 [--height:55vh] min-w-40 overflow-hidden" />
14452
+ <More [count]="count()" [includedFilters]="includedFilters()" [excludedFilters]="excludedFilters()" [aggregations]="aggregations()" [homepage]="homepage()" class="block h-full w-full max-w-80 [--height:55vh] min-w-40 overflow-hidden" />
14409
14453
  }
14410
14454
  </PopoverContent>
14411
14455
  </Popover>
14412
- `, isInline: true, dependencies: [{ kind: "directive", type: ButtonComponent, selector: "button", inputs: ["class", "variant", "decoration", "scheme", "iconOnly", "size"] }, { kind: "component", type: PopoverComponent, selector: "popover, Popover", inputs: ["disabled", "closeOnScroll"], outputs: ["closed"] }, { kind: "directive", type: PopoverContentComponent, selector: "popover-content, PopoverContent, popovercontent", inputs: ["class", "position", "keepOpen", "offset", "strategy"], exportAs: ["popoverContent"] }, { kind: "component", type: MoreComponent, selector: "more, More", inputs: ["count", "includedFilters", "excludedFilters", "aggregations"] }, { kind: "directive", type: BadgeComponent, selector: "badge, Badge", inputs: ["class", "variant", "size"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
14456
+ `, isInline: true, dependencies: [{ kind: "directive", type: ButtonComponent, selector: "button", inputs: ["class", "variant", "decoration", "scheme", "iconOnly", "size"] }, { kind: "component", type: PopoverComponent, selector: "popover, Popover", inputs: ["disabled", "closeOnScroll"], outputs: ["closed"] }, { kind: "directive", type: PopoverContentComponent, selector: "popover-content, PopoverContent, popovercontent", inputs: ["class", "position", "keepOpen", "offset", "strategy"], exportAs: ["popoverContent"] }, { kind: "component", type: MoreComponent, selector: "more, More", inputs: ["count", "includedFilters", "excludedFilters", "aggregations", "homepage"] }, { kind: "directive", type: BadgeComponent, selector: "badge, Badge", inputs: ["class", "variant", "size"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
14413
14457
  }
14414
14458
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MoreButtonComponent, decorators: [{
14415
14459
  type: Component,
@@ -14435,13 +14479,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
14435
14479
 
14436
14480
  <PopoverContent #contentRef="popoverContent" [position]="position()" class="min-w-max">
14437
14481
  @if(contentRef.isVisible) {
14438
- <More [count]="count()" [includedFilters]="includedFilters()" [excludedFilters]="excludedFilters()" [aggregations]="aggregations()" class="block h-full w-full max-w-80 [--height:55vh] min-w-40 overflow-hidden" />
14482
+ <More [count]="count()" [includedFilters]="includedFilters()" [excludedFilters]="excludedFilters()" [aggregations]="aggregations()" [homepage]="homepage()" class="block h-full w-full max-w-80 [--height:55vh] min-w-40 overflow-hidden" />
14439
14483
  }
14440
14484
  </PopoverContent>
14441
14485
  </Popover>
14442
14486
  `
14443
14487
  }]
14444
- }], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], includedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "includedFilters", required: false }] }], excludedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludedFilters", required: false }] }], aggregations: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregations", required: false }] }] } });
14488
+ }], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], includedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "includedFilters", required: false }] }], excludedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludedFilters", required: false }] }], aggregations: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregations", required: false }] }], homepage: [{ type: i0.Input, args: [{ isSignal: true, alias: "homepage", required: false }] }] } });
14445
14489
 
14446
14490
  class FiltersBarComponent {
14447
14491
  class = input(...(ngDevMode ? [undefined, { debugName: "class" }] : []));
@@ -14479,6 +14523,15 @@ class FiltersBarComponent {
14479
14523
  * @default true
14480
14524
  */
14481
14525
  showMoreFiltersButton = input(true, ...(ngDevMode ? [{ debugName: "showMoreFiltersButton", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
14526
+ /**
14527
+ * When enabled, only the filters flagged with `homepage: true` in the "filters" custom JSON
14528
+ * are displayed. If no filter is flagged, the bar shows no filters.
14529
+ *
14530
+ * Accepts a boolean value or a string that can be transformed to a boolean.
14531
+ *
14532
+ * @default false
14533
+ */
14534
+ homepage = input(false, ...(ngDevMode ? [{ debugName: "homepage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
14482
14535
  direction = input("horizontal", ...(ngDevMode ? [{ debugName: "direction" }] : []));
14483
14536
  /**
14484
14537
  * The distance in pixels between the popover and its trigger element.
@@ -14563,7 +14616,7 @@ class FiltersBarComponent {
14563
14616
  */
14564
14617
  authorizedFilters = computed(() => {
14565
14618
  const authorizedFilters = this.aggregationsService
14566
- .getAuthorizedFilters(this.aggregations(), this.includeFilters(), this.excludeFilters())
14619
+ .getAuthorizedFilters(this.aggregations(), this.includeFilters(), this.excludeFilters(), this.homepage())
14567
14620
  .map((f) => ({ name: f.name, column: f.column }))
14568
14621
  .toSpliced(this.filtersCount());
14569
14622
  return authorizedFilters;
@@ -14620,7 +14673,7 @@ class FiltersBarComponent {
14620
14673
  });
14621
14674
  }
14622
14675
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: FiltersBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
14623
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: FiltersBarComponent, isStandalone: true, selector: "filters-bar, FiltersBar, filtersbar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, morePosition: { classPropertyName: "morePosition", publicName: "morePosition", isSignal: true, isRequired: false, transformFunction: null }, aggregations: { classPropertyName: "aggregations", publicName: "aggregations", isSignal: true, isRequired: false, transformFunction: null }, includeFilters: { classPropertyName: "includeFilters", publicName: "includeFilters", isSignal: true, isRequired: false, transformFunction: null }, excludeFilters: { classPropertyName: "excludeFilters", publicName: "excludeFilters", isSignal: true, isRequired: false, transformFunction: null }, filtersCount: { classPropertyName: "filtersCount", publicName: "filtersCount", isSignal: true, isRequired: false, transformFunction: null }, showMoreFiltersButton: { classPropertyName: "showMoreFiltersButton", publicName: "showMoreFiltersButton", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, expandedLevel: { classPropertyName: "expandedLevel", publicName: "expandedLevel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClearFilters: "onClearFilters", onClearBasket: "onClearBasket" }, host: { listeners: { "click": "handleClick($event)" }, properties: { "class": "cn('block relative', class())" } }, providers: [provideTranslocoScope("filters")], viewQueries: [{ propertyName: "moreButtonRef", first: true, predicate: MoreButtonComponent, descendants: true, isSignal: true }, { propertyName: "filterButtonRefs", predicate: FilterButtonComponent, descendants: true, isSignal: true }, { propertyName: "overflowManagerRef", first: true, predicate: OverflowManagerDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
14676
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: FiltersBarComponent, isStandalone: true, selector: "filters-bar, FiltersBar, filtersbar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, morePosition: { classPropertyName: "morePosition", publicName: "morePosition", isSignal: true, isRequired: false, transformFunction: null }, aggregations: { classPropertyName: "aggregations", publicName: "aggregations", isSignal: true, isRequired: false, transformFunction: null }, includeFilters: { classPropertyName: "includeFilters", publicName: "includeFilters", isSignal: true, isRequired: false, transformFunction: null }, excludeFilters: { classPropertyName: "excludeFilters", publicName: "excludeFilters", isSignal: true, isRequired: false, transformFunction: null }, filtersCount: { classPropertyName: "filtersCount", publicName: "filtersCount", isSignal: true, isRequired: false, transformFunction: null }, showMoreFiltersButton: { classPropertyName: "showMoreFiltersButton", publicName: "showMoreFiltersButton", isSignal: true, isRequired: false, transformFunction: null }, homepage: { classPropertyName: "homepage", publicName: "homepage", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, expandedLevel: { classPropertyName: "expandedLevel", publicName: "expandedLevel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClearFilters: "onClearFilters", onClearBasket: "onClearBasket" }, host: { listeners: { "click": "handleClick($event)" }, properties: { "class": "cn('block relative', class())" } }, providers: [provideTranslocoScope("filters")], viewQueries: [{ propertyName: "moreButtonRef", first: true, predicate: MoreButtonComponent, descendants: true, isSignal: true }, { propertyName: "filterButtonRefs", predicate: FilterButtonComponent, descendants: true, isSignal: true }, { propertyName: "overflowManagerRef", first: true, predicate: OverflowManagerDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
14624
14677
  <div overflowManager [direction]="direction()" (count)="adjustFiltersCount($event)" class="flex items-end gap-2 rounded-[inherit] bg-inherit">
14625
14678
  @if (hasFilters()) {
14626
14679
  <button
@@ -14668,11 +14721,12 @@ class FiltersBarComponent {
14668
14721
  [position]="morePosition()"
14669
14722
  [includedFilters]="includeFilters()"
14670
14723
  [excludedFilters]="excludeFilters()"
14671
- [aggregations]="aggregations()" />
14724
+ [aggregations]="aggregations()"
14725
+ [homepage]="homepage()" />
14672
14726
  }
14673
14727
  }
14674
14728
  </div>
14675
- `, isInline: true, dependencies: [{ kind: "directive", type: ButtonComponent, selector: "button", inputs: ["class", "variant", "decoration", "scheme", "iconOnly", "size"] }, { kind: "component", type: MoreButtonComponent, selector: "more-button, MoreButton", inputs: ["count", "position", "includedFilters", "excludedFilters", "aggregations"] }, { kind: "component", type: FilterButtonComponent, selector: "filter-button, FilterButton", inputs: ["name", "column", "position", "offset", "expandedLevel"] }, { kind: "directive", type: OverflowManagerDirective, selector: "[overflowManager]", inputs: ["target", "margin", "direction"], outputs: ["count"] }, { kind: "directive", type: OverflowItemDirective, selector: "[overflowItem]" }, { kind: "directive", type: OverflowStopDirective, selector: "[overflowStop]" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
14729
+ `, isInline: true, dependencies: [{ kind: "directive", type: ButtonComponent, selector: "button", inputs: ["class", "variant", "decoration", "scheme", "iconOnly", "size"] }, { kind: "component", type: MoreButtonComponent, selector: "more-button, MoreButton", inputs: ["count", "position", "includedFilters", "excludedFilters", "aggregations", "homepage"] }, { kind: "component", type: FilterButtonComponent, selector: "filter-button, FilterButton", inputs: ["name", "column", "position", "offset", "expandedLevel"] }, { kind: "directive", type: OverflowManagerDirective, selector: "[overflowManager]", inputs: ["target", "margin", "direction"], outputs: ["count"] }, { kind: "directive", type: OverflowItemDirective, selector: "[overflowItem]" }, { kind: "directive", type: OverflowStopDirective, selector: "[overflowStop]" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
14676
14730
  }
14677
14731
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: FiltersBarComponent, decorators: [{
14678
14732
  type: Component,
@@ -14737,7 +14791,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
14737
14791
  [position]="morePosition()"
14738
14792
  [includedFilters]="includeFilters()"
14739
14793
  [excludedFilters]="excludeFilters()"
14740
- [aggregations]="aggregations()" />
14794
+ [aggregations]="aggregations()"
14795
+ [homepage]="homepage()" />
14741
14796
  }
14742
14797
  }
14743
14798
  </div>
@@ -14747,7 +14802,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
14747
14802
  "(click)": "handleClick($event)"
14748
14803
  }
14749
14804
  }]
14750
- }], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], morePosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "morePosition", required: false }] }], aggregations: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregations", required: false }] }], includeFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "includeFilters", required: false }] }], excludeFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludeFilters", required: false }] }], filtersCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "filtersCount", required: false }] }], showMoreFiltersButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMoreFiltersButton", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], expandedLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedLevel", required: false }] }], onClearFilters: [{ type: i0.Output, args: ["onClearFilters"] }], onClearBasket: [{ type: i0.Output, args: ["onClearBasket"] }], moreButtonRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MoreButtonComponent), { isSignal: true }] }], filterButtonRefs: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => FilterButtonComponent), { isSignal: true }] }], overflowManagerRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => OverflowManagerDirective), { isSignal: true }] }] } });
14805
+ }], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], morePosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "morePosition", required: false }] }], aggregations: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregations", required: false }] }], includeFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "includeFilters", required: false }] }], excludeFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludeFilters", required: false }] }], filtersCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "filtersCount", required: false }] }], showMoreFiltersButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMoreFiltersButton", required: false }] }], homepage: [{ type: i0.Input, args: [{ isSignal: true, alias: "homepage", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], expandedLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedLevel", required: false }] }], onClearFilters: [{ type: i0.Output, args: ["onClearFilters"] }], onClearBasket: [{ type: i0.Output, args: ["onClearBasket"] }], moreButtonRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MoreButtonComponent), { isSignal: true }] }], filterButtonRefs: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => FilterButtonComponent), { isSignal: true }] }], overflowManagerRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => OverflowManagerDirective), { isSignal: true }] }] } });
14751
14806
 
14752
14807
  class LabelService {
14753
14808
  appStore = inject(AppStore);