feat(cardex): implement cardex module with filters, templates, and service integration

This commit is contained in:
2025-12-23 20:35:20 +03:30
parent e937c994d7
commit 1373cc046d
23 changed files with 473 additions and 134 deletions
@@ -1,5 +1,5 @@
import { Maybe } from '@/core';
import { Component, Input, model, signal } from '@angular/core';
import { Component, EventEmitter, Input, model, Output, signal } from '@angular/core';
import { FormControl } from '@angular/forms';
export interface ISelectItem {
@@ -18,6 +18,7 @@ export abstract class AbstractSelectComponent<T = ISelectItem> {
@Input() showErrors: boolean = true;
@Input() isFullDataOptionValue: boolean = false;
@Input() optionValue = 'id';
@Output() onChange = new EventEmitter<Maybe<T>>();
loading = signal(false);
items = signal<Maybe<T[]>>(null);
@@ -50,4 +51,13 @@ export abstract class AbstractSelectComponent<T = ISelectItem> {
}
return this.optionValue;
}
change(value: Maybe<T>) {
if (typeof value !== 'object') {
// @ts-ignore
this.onChange.emit(this.items()?.find((item) => item[this.optionValue] === value));
} else {
this.onChange.emit(value);
}
}
}