feat(purchases): update terminology from "محصول" to "کالا" in purchase forms and templates

refactor(purchases): remove unused purchase receipt components and consolidate receipt template logic

fix(suppliers): enhance suppliers select component to support full data option values

style(tailwind): improve theme variables for better customization and consistency

feat(shared): introduce abstract select component for reusable select field logic

chore(purchases): clean up imports and improve component structure for better maintainability
This commit is contained in:
2025-12-10 16:54:25 +03:30
parent 50bc9a4632
commit b46b8b83f9
43 changed files with 450 additions and 391 deletions
@@ -0,0 +1,44 @@
import { Maybe } from '@/core';
import { Component, Input, signal } from '@angular/core';
import { FormControl } from '@angular/forms';
export interface ISelectItem {
id: number;
name: string;
}
@Component({
selector: 'abstract-select-field',
template: '',
})
export abstract class AbstractSelectComponent<T = ISelectItem> {
@Input() control!: FormControl<Maybe<number | T>>;
@Input() canInsert: boolean = false;
@Input() showLabel: boolean = true;
@Input() showErrors: boolean = true;
@Input() isFullDataOptionValue: boolean = false;
@Input() optionValue = 'id';
loading = signal(false);
items = signal<Maybe<T[]>>(null);
isOpenFormDialog = signal(false);
abstract getData(): void;
// abstract getLabel(): string;
refresh() {
this.getData();
}
onOpenForm() {
// Override in subclass if needed
}
get selectOptionValue() {
if (!this.control) return undefined;
if (this.isFullDataOptionValue) {
return undefined;
}
return this.optionValue;
}
}
+1
View File
@@ -1,3 +1,4 @@
export * from './abstract-select.component';
export * from './breadcrumb.component';
export * from './card-data.component';
export * from './inlineConfirmation/inline-confirmation.component';