@sinequa/atomic-angular 1.0.5 → 1.0.8
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.
- package/fesm2022/sinequa-atomic-angular.mjs +82 -43
- package/fesm2022/sinequa-atomic-angular.mjs.map +1 -1
- package/index.d.ts +185 -162
- package/package.json +1 -1
|
@@ -488,9 +488,13 @@ function withAppFeatures() {
|
|
|
488
488
|
* @returns The alias of the column if it exists, otherwise the original column name.
|
|
489
489
|
*/
|
|
490
490
|
getColumnAlias(column) {
|
|
491
|
+
if (typeof column !== "string" || column.length === 0) {
|
|
492
|
+
return column;
|
|
493
|
+
}
|
|
491
494
|
const state = getState(store);
|
|
492
495
|
const schema = state.indexes._.columns;
|
|
493
|
-
const
|
|
496
|
+
const key = column.toLocaleLowerCase();
|
|
497
|
+
const col = Object.hasOwn(schema, key) ? schema[key] : undefined;
|
|
494
498
|
if (col) {
|
|
495
499
|
return col.aliases?.[0] ? `${col.aliases[0].charAt(0).toLowerCase()}${col.aliases[0].slice(1)}` : column;
|
|
496
500
|
}
|
|
@@ -503,8 +507,15 @@ function withAppFeatures() {
|
|
|
503
507
|
* @returns The column definition as a `CCColumn` object if found, or `undefined` if the column does not exist.
|
|
504
508
|
*/
|
|
505
509
|
getColumn(columnOrAlias) {
|
|
510
|
+
if (typeof columnOrAlias !== "string" || columnOrAlias.length === 0) {
|
|
511
|
+
return undefined;
|
|
512
|
+
}
|
|
506
513
|
const state = getState(store);
|
|
507
|
-
|
|
514
|
+
const columnMap = state.columnMap;
|
|
515
|
+
if (!columnMap)
|
|
516
|
+
return undefined;
|
|
517
|
+
const key = columnOrAlias.toLocaleLowerCase();
|
|
518
|
+
return Object.hasOwn(columnMap, key) ? columnMap[key] : undefined;
|
|
508
519
|
},
|
|
509
520
|
/**
|
|
510
521
|
* Determines if the specified column is of a date-related type.
|
|
@@ -3318,39 +3329,53 @@ class AggregationsService {
|
|
|
3318
3329
|
return node;
|
|
3319
3330
|
}
|
|
3320
3331
|
/* aggregations helpers fot the filters components */
|
|
3321
|
-
getAuthorizedFilters(aggregations, includedFilters = [], excludedFilters = []) {
|
|
3332
|
+
getAuthorizedFilters(aggregations, includedFilters = [], excludedFilters = [], homepageOnly = false) {
|
|
3322
3333
|
const agg = aggregations || this.appStore.getAuthorizedFilters();
|
|
3323
3334
|
const authorizedFilters = agg
|
|
3324
3335
|
.filter((f) => this.getFilterCriteria()(f)) // filter only the filters present
|
|
3336
|
+
.filter((f) => !homepageOnly || this.getHomepageFilterCriteria()(f)) // when requested, keep only filters flagged `homepage: true`
|
|
3325
3337
|
.filter((f) => !excludedFilters.includes(f.name))
|
|
3326
3338
|
.filter((f) => !includedFilters.length || includedFilters.includes(f.name))
|
|
3327
3339
|
.map((f) => ({ field: f.column, column: f.column, name: f.name })); // field is needed for filters constructions
|
|
3328
3340
|
return authorizedFilters;
|
|
3329
3341
|
}
|
|
3342
|
+
/**
|
|
3343
|
+
* Determines whether a custom JSON filter refers to the given aggregation.
|
|
3344
|
+
*
|
|
3345
|
+
* Matches by `name` when it is defined, otherwise falls back to `column`,
|
|
3346
|
+
* resolving column/alias ambiguity through the app store's column map.
|
|
3347
|
+
*
|
|
3348
|
+
* @param filter - The filter object coming from the custom JSON.
|
|
3349
|
+
* @param agg - The aggregation returned by the backend.
|
|
3350
|
+
* @returns `true` if the filter refers to the aggregation.
|
|
3351
|
+
*/
|
|
3352
|
+
matchesAggregation(filter, agg) {
|
|
3353
|
+
// if filter.name is defined, use it to compare
|
|
3354
|
+
if (filter.name) {
|
|
3355
|
+
return filter.name.toLocaleLowerCase() === agg.name.toLocaleLowerCase();
|
|
3356
|
+
}
|
|
3357
|
+
// fallback to column comparison
|
|
3358
|
+
// column can be a column's name or an alias
|
|
3359
|
+
// resolve ambiguity between column and alias
|
|
3360
|
+
const { columnMap } = getState(this.appStore);
|
|
3361
|
+
// get the actual column for both filter and f
|
|
3362
|
+
const aggColumn = columnMap?.[agg.column.toLocaleLowerCase()];
|
|
3363
|
+
const filterColumn = columnMap?.[filter?.column?.toLocaleLowerCase() || filter.name.toLocaleLowerCase()];
|
|
3364
|
+
// if either column is not found, fallback to comparing the raw values
|
|
3365
|
+
if (!aggColumn || !filterColumn) {
|
|
3366
|
+
return filter?.column?.toLocaleLowerCase() === agg?.column?.toLocaleLowerCase();
|
|
3367
|
+
}
|
|
3368
|
+
// compare the actual column names coming from the column map
|
|
3369
|
+
return aggColumn?.name === filterColumn?.name;
|
|
3370
|
+
}
|
|
3330
3371
|
getFilterCriteria = () => {
|
|
3331
3372
|
// filter: object filter from the custom JSON
|
|
3332
3373
|
// 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
|
-
};
|
|
3374
|
+
return (agg) => this.appStore.filters().some((filter) => this.matchesAggregation(filter, agg));
|
|
3375
|
+
};
|
|
3376
|
+
getHomepageFilterCriteria = () => {
|
|
3377
|
+
// only consider filters explicitly flagged with `homepage: true` in the custom JSON
|
|
3378
|
+
return (agg) => this.appStore.filters().some((filter) => filter.homepage && this.matchesAggregation(filter, agg));
|
|
3354
3379
|
};
|
|
3355
3380
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AggregationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3356
3381
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AggregationsService, providedIn: "root" });
|
|
@@ -5000,8 +5025,9 @@ class SourceComponent {
|
|
|
5000
5025
|
iconDetails = computed(() => {
|
|
5001
5026
|
const [collection] = this.collection() || [];
|
|
5002
5027
|
const connector = (this.connector() ?? "").toLocaleLowerCase();
|
|
5003
|
-
if (!collection)
|
|
5004
|
-
return undefined;
|
|
5028
|
+
if (!collection) {
|
|
5029
|
+
return { iconClass: "", iconPath: undefined };
|
|
5030
|
+
}
|
|
5005
5031
|
const src = this.appStore.sources();
|
|
5006
5032
|
const name = collection.split("/")[1].toLocaleLowerCase();
|
|
5007
5033
|
const defaultIconClass = "far fa-file";
|
|
@@ -5024,11 +5050,11 @@ class SourceComponent {
|
|
|
5024
5050
|
return { iconClass: defaultIconClass };
|
|
5025
5051
|
}, ...(ngDevMode ? [{ debugName: "iconDetails" }] : []));
|
|
5026
5052
|
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()
|
|
5053
|
+
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
5054
|
}
|
|
5029
5055
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SourceComponent, decorators: [{
|
|
5030
5056
|
type: Component,
|
|
5031
|
-
args: [{ selector: "source, Source", standalone: true, imports: [TranslocoPipe, FaIconComponent], providers: [provideTranslocoScope("sources")], template: "@if (iconDetails()
|
|
5057
|
+
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
5058
|
}], propDecorators: { collection: [{ type: i0.Input, args: [{ isSignal: true, alias: "collection", required: false }] }], connector: [{ type: i0.Input, args: [{ isSignal: true, alias: "connector", required: false }] }] } });
|
|
5033
5059
|
|
|
5034
5060
|
class DocumentLocatorComponent {
|
|
@@ -14280,6 +14306,7 @@ class MoreComponent {
|
|
|
14280
14306
|
includedFilters = input([], ...(ngDevMode ? [{ debugName: "includedFilters" }] : []));
|
|
14281
14307
|
excludedFilters = input([], ...(ngDevMode ? [{ debugName: "excludedFilters" }] : []));
|
|
14282
14308
|
aggregations = input(...(ngDevMode ? [undefined, { debugName: "aggregations" }] : []));
|
|
14309
|
+
homepage = input(false, ...(ngDevMode ? [{ debugName: "homepage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
14283
14310
|
appStore = inject(AppStore);
|
|
14284
14311
|
aggregationsStore = inject(AggregationsStore);
|
|
14285
14312
|
queryParamsStore = inject(QueryParamsStore);
|
|
@@ -14307,7 +14334,7 @@ class MoreComponent {
|
|
|
14307
14334
|
effect(() => {
|
|
14308
14335
|
const count = this.count();
|
|
14309
14336
|
const authorizedFilters = this.aggregationsService
|
|
14310
|
-
.getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters())
|
|
14337
|
+
.getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters(), this.homepage())
|
|
14311
14338
|
.toSpliced(0, count);
|
|
14312
14339
|
const f = authorizedFilters.map((agg) => {
|
|
14313
14340
|
const { icon = "far fa-list", hidden = false } = this.appStore.getAggregationCustomization(agg.column, agg.name) || {};
|
|
@@ -14358,7 +14385,7 @@ class MoreComponent {
|
|
|
14358
14385
|
return count > 0;
|
|
14359
14386
|
}
|
|
14360
14387
|
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: `
|
|
14388
|
+
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
14389
|
@for (filter of visibleFilters(); track $index) {
|
|
14363
14390
|
<Aggregation
|
|
14364
14391
|
class="w-60 max-w-80 [--height:15lh]"
|
|
@@ -14389,7 +14416,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
14389
14416
|
`, host: {
|
|
14390
14417
|
class: "divide-y divide-muted-foreground/18"
|
|
14391
14418
|
}, 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 }] }] } });
|
|
14419
|
+
}], 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
14420
|
|
|
14394
14421
|
class MoreButtonComponent {
|
|
14395
14422
|
appStore = inject(AppStore);
|
|
@@ -14401,10 +14428,11 @@ class MoreButtonComponent {
|
|
|
14401
14428
|
includedFilters = input([], ...(ngDevMode ? [{ debugName: "includedFilters" }] : []));
|
|
14402
14429
|
excludedFilters = input([], ...(ngDevMode ? [{ debugName: "excludedFilters" }] : []));
|
|
14403
14430
|
aggregations = input(...(ngDevMode ? [undefined, { debugName: "aggregations" }] : []));
|
|
14431
|
+
homepage = input(false, ...(ngDevMode ? [{ debugName: "homepage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
14404
14432
|
totalFiltersCount = computed(() => {
|
|
14405
14433
|
const count = this.count();
|
|
14406
14434
|
const authorizedFilters = this.aggregationsService
|
|
14407
|
-
.getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters())
|
|
14435
|
+
.getAuthorizedFilters(this.aggregations(), this.includedFilters(), this.excludedFilters(), this.homepage())
|
|
14408
14436
|
.toSpliced(0, count);
|
|
14409
14437
|
const total = authorizedFilters.reduce((acc, filter) => {
|
|
14410
14438
|
const f = this.queryParamsStore.getFilter(filter);
|
|
@@ -14414,7 +14442,7 @@ class MoreButtonComponent {
|
|
|
14414
14442
|
return total;
|
|
14415
14443
|
}, ...(ngDevMode ? [{ debugName: "totalFiltersCount" }] : []));
|
|
14416
14444
|
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: `
|
|
14445
|
+
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
14446
|
<Popover class="group/more">
|
|
14419
14447
|
<button
|
|
14420
14448
|
variant="ghost"
|
|
@@ -14432,11 +14460,11 @@ class MoreButtonComponent {
|
|
|
14432
14460
|
|
|
14433
14461
|
<PopoverContent #contentRef="popoverContent" [position]="position()" class="min-w-max">
|
|
14434
14462
|
@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" />
|
|
14463
|
+
<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
14464
|
}
|
|
14437
14465
|
</PopoverContent>
|
|
14438
14466
|
</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" }] });
|
|
14467
|
+
`, 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
14468
|
}
|
|
14441
14469
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MoreButtonComponent, decorators: [{
|
|
14442
14470
|
type: Component,
|
|
@@ -14462,13 +14490,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
14462
14490
|
|
|
14463
14491
|
<PopoverContent #contentRef="popoverContent" [position]="position()" class="min-w-max">
|
|
14464
14492
|
@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" />
|
|
14493
|
+
<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
14494
|
}
|
|
14467
14495
|
</PopoverContent>
|
|
14468
14496
|
</Popover>
|
|
14469
14497
|
`
|
|
14470
14498
|
}]
|
|
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 }] }] } });
|
|
14499
|
+
}], 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
14500
|
|
|
14473
14501
|
class FiltersBarComponent {
|
|
14474
14502
|
class = input(...(ngDevMode ? [undefined, { debugName: "class" }] : []));
|
|
@@ -14506,6 +14534,15 @@ class FiltersBarComponent {
|
|
|
14506
14534
|
* @default true
|
|
14507
14535
|
*/
|
|
14508
14536
|
showMoreFiltersButton = input(true, ...(ngDevMode ? [{ debugName: "showMoreFiltersButton", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
14537
|
+
/**
|
|
14538
|
+
* When enabled, only the filters flagged with `homepage: true` in the "filters" custom JSON
|
|
14539
|
+
* are displayed. If no filter is flagged, the bar shows no filters.
|
|
14540
|
+
*
|
|
14541
|
+
* Accepts a boolean value or a string that can be transformed to a boolean.
|
|
14542
|
+
*
|
|
14543
|
+
* @default false
|
|
14544
|
+
*/
|
|
14545
|
+
homepage = input(false, ...(ngDevMode ? [{ debugName: "homepage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
14509
14546
|
direction = input("horizontal", ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
14510
14547
|
/**
|
|
14511
14548
|
* The distance in pixels between the popover and its trigger element.
|
|
@@ -14590,7 +14627,7 @@ class FiltersBarComponent {
|
|
|
14590
14627
|
*/
|
|
14591
14628
|
authorizedFilters = computed(() => {
|
|
14592
14629
|
const authorizedFilters = this.aggregationsService
|
|
14593
|
-
.getAuthorizedFilters(this.aggregations(), this.includeFilters(), this.excludeFilters())
|
|
14630
|
+
.getAuthorizedFilters(this.aggregations(), this.includeFilters(), this.excludeFilters(), this.homepage())
|
|
14594
14631
|
.map((f) => ({ name: f.name, column: f.column }))
|
|
14595
14632
|
.toSpliced(this.filtersCount());
|
|
14596
14633
|
return authorizedFilters;
|
|
@@ -14647,7 +14684,7 @@ class FiltersBarComponent {
|
|
|
14647
14684
|
});
|
|
14648
14685
|
}
|
|
14649
14686
|
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: `
|
|
14687
|
+
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
14688
|
<div overflowManager [direction]="direction()" (count)="adjustFiltersCount($event)" class="flex items-end gap-2 rounded-[inherit] bg-inherit">
|
|
14652
14689
|
@if (hasFilters()) {
|
|
14653
14690
|
<button
|
|
@@ -14695,11 +14732,12 @@ class FiltersBarComponent {
|
|
|
14695
14732
|
[position]="morePosition()"
|
|
14696
14733
|
[includedFilters]="includeFilters()"
|
|
14697
14734
|
[excludedFilters]="excludeFilters()"
|
|
14698
|
-
[aggregations]="aggregations()"
|
|
14735
|
+
[aggregations]="aggregations()"
|
|
14736
|
+
[homepage]="homepage()" />
|
|
14699
14737
|
}
|
|
14700
14738
|
}
|
|
14701
14739
|
</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" }] });
|
|
14740
|
+
`, 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
14741
|
}
|
|
14704
14742
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: FiltersBarComponent, decorators: [{
|
|
14705
14743
|
type: Component,
|
|
@@ -14764,7 +14802,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
14764
14802
|
[position]="morePosition()"
|
|
14765
14803
|
[includedFilters]="includeFilters()"
|
|
14766
14804
|
[excludedFilters]="excludeFilters()"
|
|
14767
|
-
[aggregations]="aggregations()"
|
|
14805
|
+
[aggregations]="aggregations()"
|
|
14806
|
+
[homepage]="homepage()" />
|
|
14768
14807
|
}
|
|
14769
14808
|
}
|
|
14770
14809
|
</div>
|
|
@@ -14774,7 +14813,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
14774
14813
|
"(click)": "handleClick($event)"
|
|
14775
14814
|
}
|
|
14776
14815
|
}]
|
|
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 }] }] } });
|
|
14816
|
+
}], 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
14817
|
|
|
14779
14818
|
class LabelService {
|
|
14780
14819
|
appStore = inject(AppStore);
|