Filter - QueryToken - Alle ausgewählten Options übernehmen

Styling Checkbox - padding bottom auf 1 rem
This commit is contained in:
Lorenz Hilpert
2021-07-29 17:48:25 +02:00
parent 4e478f2fc5
commit d454771c77
2 changed files with 11 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
}
.ui-option {
@apply px-4 py-2 flex flex-row justify-between items-center;
@apply px-4 pt-2 pb-4 flex flex-row justify-between items-center;
.btn-expand {
@apply border-none outline-none bg-transparent text-cool-grey;

View File

@@ -101,15 +101,19 @@ export class UiOption implements IUiOption {
}
getSelectedOptions(): UiOption[] {
const selected: UiOption[] = [];
if (this.selected) {
// Wenn selected oder alle Child UiOptions selected gebe aktuelle instanz zurück
return [this];
} else if (this.hasChildren()) {
// Finde alle UiOptions die selected sind
return this.values.map((f) => f.getSelectedOptions()).reduce((agg, options) => [...agg, ...options], []);
selected.push(this);
}
return [];
const selectedChildren = this.values?.map((f) => f.getSelectedOptions()).reduce((agg, options) => [...agg, ...options], []);
if (selectedChildren?.length) {
selected.push(...selectedChildren);
}
return selected;
}
getUnselectedOptions(): UiOption[] {