@sinequa/atomic-angular 1.0.5 → 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.
|
@@ -3318,39 +3318,53 @@ class AggregationsService {
|
|
|
3318
3318
|
return node;
|
|
3319
3319
|
}
|
|
3320
3320
|
/* aggregations helpers fot the filters components */
|
|
3321
|
-
getAuthorizedFilters(aggregations, includedFilters = [], excludedFilters = []) {
|
|
3321
|
+
getAuthorizedFilters(aggregations, includedFilters = [], excludedFilters = [], homepageOnly = false) {
|
|
3322
3322
|
const agg = aggregations || this.appStore.getAuthorizedFilters();
|
|
3323
3323
|
const authorizedFilters = agg
|
|
3324
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`
|
|
3325
3326
|
.filter((f) => !excludedFilters.includes(f.name))
|
|
3326
3327
|
.filter((f) => !includedFilters.length || includedFilters.includes(f.name))
|
|
3327
3328
|
.map((f) => ({ field: f.column, column: f.column, name: f.name })); // field is needed for filters constructions
|
|
3328
3329
|
return authorizedFilters;
|
|
3329
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
|
+
}
|
|
3330
3360
|
getFilterCriteria = () => {
|
|
3331
3361
|
// filter: object filter from the custom JSON
|
|
3332
3362
|
// agg: object aggregation returned by the backend
|
|
3333
|
-
return (agg) =>
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
}
|
|
3339
|
-
// fallback to column comparison
|
|
3340
|
-
// column can be a column's name or an alias
|
|
3341
|
-
// resolve ambiguity between column and alias
|
|
3342
|
-
const { columnMap } = getState(this.appStore);
|
|
3343
|
-
// get the actual column for both filter and f
|
|
3344
|
-
const aggColumn = columnMap?.[agg.column.toLocaleLowerCase()];
|
|
3345
|
-
const filterColumn = columnMap?.[filter?.column?.toLocaleLowerCase() || filter.name.toLocaleLowerCase()];
|
|
3346
|
-
// if either column is not found, fallback to comparing the raw values
|
|
3347
|
-
if (!aggColumn || !filterColumn) {
|
|
3348
|
-
return filter?.column?.toLocaleLowerCase() === agg?.column?.toLocaleLowerCase();
|
|
3349
|
-
}
|
|
3350
|
-
// compare the actual column names coming from the column map
|
|
3351
|
-
return aggColumn?.name === filterColumn?.name;
|
|
3352
|
-
});
|
|
3353
|
-
};
|
|
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));
|
|
3354
3368
|
};
|
|
3355
3369
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AggregationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3356
3370
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AggregationsService, providedIn: "root" });
|
|
@@ -5000,8 +5014,9 @@ class SourceComponent {
|
|
|
5000
5014
|
iconDetails = computed(() => {
|
|
5001
5015
|
const [collection] = this.collection() || [];
|
|
5002
5016
|
const connector = (this.connector() ?? "").toLocaleLowerCase();
|
|
5003
|
-
if (!collection)
|
|
5004
|
-
return undefined;
|
|
5017
|
+
if (!collection) {
|
|
5018
|
+
return { iconClass: "", iconPath: undefined };
|
|
5019
|
+
}
|
|
5005
5020
|
const src = this.appStore.sources();
|
|
5006
5021
|
const name = collection.split("/")[1].toLocaleLowerCase();
|
|
5007
5022
|
const defaultIconClass = "far fa-file";
|
|
@@ -5024,11 +5039,11 @@ class SourceComponent {
|
|
|
5024
5039
|
return { iconClass: defaultIconClass };
|
|
5025
5040
|
}, ...(ngDevMode ? [{ debugName: "iconDetails" }] : []));
|
|
5026
5041
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SourceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5027
|
-
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()
|
|
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" }] });
|
|
5028
5043
|
}
|
|
5029
5044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SourceComponent, decorators: [{
|
|
5030
5045
|
type: Component,
|
|
5031
|
-
args: [{ selector: "source, Source", standalone: true, imports: [TranslocoPipe, FaIconComponent], providers: [provideTranslocoScope("sources")], template: "@if (iconDetails()
|
|
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" }]
|
|
5032
5047
|
}], propDecorators: { collection: [{ type: i0.Input, args: [{ isSignal: true, alias: "collection", required: false }] }], connector: [{ type: i0.Input, args: [{ isSignal: true, alias: "connector", required: false }] }] } });
|
|
5033
5048
|
|
|
5034
5049
|
class DocumentLocatorComponent {
|
|
@@ -14280,6 +14295,7 @@ class MoreComponent {
|
|
|
14280
14295
|
includedFilters = input([], ...(ngDevMode ? [{ debugName: "includedFilters" }] : []));
|
|
14281
14296
|
excludedFilters = input([], ...(ngDevMode ? [{ debugName: "excludedFilters" }] : []));
|
|
14282
14297
|
aggregations = input(...(ngDevMode ? [undefined, { debugName: "aggregations" }] : []));
|
|
14298
|
+
homepage = input(false, ...(ngDevMode ? [{ debugName: "homepage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
14283
14299
|
appStore = inject(AppStore);
|
|
14284
14300
|
aggregationsStore = inject(AggregationsStore);
|
|
14285
14301
|
queryParamsStore = inject(QueryParamsStore);
|
|
@@ -14307,7 +14323,7 @@ class MoreComponent {
|
|
|
14307
14323
|
effect(() => {
|
|
14308
14324
|
const count = this.count();
|
|
14309
14325
|
const authorizedFilters = this.aggregationsService
|
|
14310
|
-
.getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters())
|
|
14326
|
+
.getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters(), this.homepage())
|
|
14311
14327
|
.toSpliced(0, count);
|
|
14312
14328
|
const f = authorizedFilters.map((agg) => {
|
|
14313
14329
|
const { icon = "far fa-list", hidden = false } = this.appStore.getAggregationCustomization(agg.column, agg.name) || {};
|
|
@@ -14358,7 +14374,7 @@ class MoreComponent {
|
|
|
14358
14374
|
return count > 0;
|
|
14359
14375
|
}
|
|
14360
14376
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14361
|
-
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: `
|
|
14362
14378
|
@for (filter of visibleFilters(); track $index) {
|
|
14363
14379
|
<Aggregation
|
|
14364
14380
|
class="w-60 max-w-80 [--height:15lh]"
|
|
@@ -14389,7 +14405,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
14389
14405
|
`, host: {
|
|
14390
14406
|
class: "divide-y divide-muted-foreground/18"
|
|
14391
14407
|
}, styles: [":host{scrollbar-width:none}\n"] }]
|
|
14392
|
-
}], 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 }] }] } });
|
|
14393
14409
|
|
|
14394
14410
|
class MoreButtonComponent {
|
|
14395
14411
|
appStore = inject(AppStore);
|
|
@@ -14401,10 +14417,11 @@ class MoreButtonComponent {
|
|
|
14401
14417
|
includedFilters = input([], ...(ngDevMode ? [{ debugName: "includedFilters" }] : []));
|
|
14402
14418
|
excludedFilters = input([], ...(ngDevMode ? [{ debugName: "excludedFilters" }] : []));
|
|
14403
14419
|
aggregations = input(...(ngDevMode ? [undefined, { debugName: "aggregations" }] : []));
|
|
14420
|
+
homepage = input(false, ...(ngDevMode ? [{ debugName: "homepage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
14404
14421
|
totalFiltersCount = computed(() => {
|
|
14405
14422
|
const count = this.count();
|
|
14406
14423
|
const authorizedFilters = this.aggregationsService
|
|
14407
|
-
.getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters())
|
|
14424
|
+
.getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters(), this.homepage())
|
|
14408
14425
|
.toSpliced(0, count);
|
|
14409
14426
|
const total = authorizedFilters.reduce((acc, filter) => {
|
|
14410
14427
|
const f = this.queryParamsStore.getFilter(filter);
|
|
@@ -14414,7 +14431,7 @@ class MoreButtonComponent {
|
|
|
14414
14431
|
return total;
|
|
14415
14432
|
}, ...(ngDevMode ? [{ debugName: "totalFiltersCount" }] : []));
|
|
14416
14433
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MoreButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14417
|
-
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: `
|
|
14418
14435
|
<Popover class="group/more">
|
|
14419
14436
|
<button
|
|
14420
14437
|
variant="ghost"
|
|
@@ -14432,11 +14449,11 @@ class MoreButtonComponent {
|
|
|
14432
14449
|
|
|
14433
14450
|
<PopoverContent #contentRef="popoverContent" [position]="position()" class="min-w-max">
|
|
14434
14451
|
@if(contentRef.isVisible) {
|
|
14435
|
-
<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" />
|
|
14436
14453
|
}
|
|
14437
14454
|
</PopoverContent>
|
|
14438
14455
|
</Popover>
|
|
14439
|
-
`, 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" }] });
|
|
14440
14457
|
}
|
|
14441
14458
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MoreButtonComponent, decorators: [{
|
|
14442
14459
|
type: Component,
|
|
@@ -14462,13 +14479,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
14462
14479
|
|
|
14463
14480
|
<PopoverContent #contentRef="popoverContent" [position]="position()" class="min-w-max">
|
|
14464
14481
|
@if(contentRef.isVisible) {
|
|
14465
|
-
<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" />
|
|
14466
14483
|
}
|
|
14467
14484
|
</PopoverContent>
|
|
14468
14485
|
</Popover>
|
|
14469
14486
|
`
|
|
14470
14487
|
}]
|
|
14471
|
-
}], 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 }] }] } });
|
|
14472
14489
|
|
|
14473
14490
|
class FiltersBarComponent {
|
|
14474
14491
|
class = input(...(ngDevMode ? [undefined, { debugName: "class" }] : []));
|
|
@@ -14506,6 +14523,15 @@ class FiltersBarComponent {
|
|
|
14506
14523
|
* @default true
|
|
14507
14524
|
*/
|
|
14508
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 }]));
|
|
14509
14535
|
direction = input("horizontal", ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
14510
14536
|
/**
|
|
14511
14537
|
* The distance in pixels between the popover and its trigger element.
|
|
@@ -14590,7 +14616,7 @@ class FiltersBarComponent {
|
|
|
14590
14616
|
*/
|
|
14591
14617
|
authorizedFilters = computed(() => {
|
|
14592
14618
|
const authorizedFilters = this.aggregationsService
|
|
14593
|
-
.getAuthorizedFilters(this.aggregations(), this.includeFilters(), this.excludeFilters())
|
|
14619
|
+
.getAuthorizedFilters(this.aggregations(), this.includeFilters(), this.excludeFilters(), this.homepage())
|
|
14594
14620
|
.map((f) => ({ name: f.name, column: f.column }))
|
|
14595
14621
|
.toSpliced(this.filtersCount());
|
|
14596
14622
|
return authorizedFilters;
|
|
@@ -14647,7 +14673,7 @@ class FiltersBarComponent {
|
|
|
14647
14673
|
});
|
|
14648
14674
|
}
|
|
14649
14675
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: FiltersBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14650
|
-
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: `
|
|
14651
14677
|
<div overflowManager [direction]="direction()" (count)="adjustFiltersCount($event)" class="flex items-end gap-2 rounded-[inherit] bg-inherit">
|
|
14652
14678
|
@if (hasFilters()) {
|
|
14653
14679
|
<button
|
|
@@ -14695,11 +14721,12 @@ class FiltersBarComponent {
|
|
|
14695
14721
|
[position]="morePosition()"
|
|
14696
14722
|
[includedFilters]="includeFilters()"
|
|
14697
14723
|
[excludedFilters]="excludeFilters()"
|
|
14698
|
-
[aggregations]="aggregations()"
|
|
14724
|
+
[aggregations]="aggregations()"
|
|
14725
|
+
[homepage]="homepage()" />
|
|
14699
14726
|
}
|
|
14700
14727
|
}
|
|
14701
14728
|
</div>
|
|
14702
|
-
`, 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" }] });
|
|
14703
14730
|
}
|
|
14704
14731
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: FiltersBarComponent, decorators: [{
|
|
14705
14732
|
type: Component,
|
|
@@ -14764,7 +14791,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
14764
14791
|
[position]="morePosition()"
|
|
14765
14792
|
[includedFilters]="includeFilters()"
|
|
14766
14793
|
[excludedFilters]="excludeFilters()"
|
|
14767
|
-
[aggregations]="aggregations()"
|
|
14794
|
+
[aggregations]="aggregations()"
|
|
14795
|
+
[homepage]="homepage()" />
|
|
14768
14796
|
}
|
|
14769
14797
|
}
|
|
14770
14798
|
</div>
|
|
@@ -14774,7 +14802,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
14774
14802
|
"(click)": "handleClick($event)"
|
|
14775
14803
|
}
|
|
14776
14804
|
}]
|
|
14777
|
-
}], 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 }] }] } });
|
|
14778
14806
|
|
|
14779
14807
|
class LabelService {
|
|
14780
14808
|
appStore = inject(AppStore);
|