Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-05-07 23:28:12 +03:30
parent b2a1eb8e5b
commit ce40bd8c75
54 changed files with 260 additions and 183 deletions
@@ -0,0 +1,13 @@
import { Component, Input } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
@Component({
selector: 'abstract-field',
template: '',
imports: [ReactiveFormsModule],
})
export abstract class AbstractFieldComponent<T = string> {
@Input({ required: true }) control!: FormControl<T>;
@Input({ required: true }) name!: string;
@Input({ required: true }) label!: string;
}
@@ -10,6 +10,7 @@ export * from './email.component';
export * from './first_name.component';
export * from './fiscal_id.component';
export * from './guild_id.component';
export * from './invoice_templates.component';
export * from './last_name.component';
export * from './legal_name.component';
export * from './license_starts_at.component';
@@ -0,0 +1,19 @@
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
import { Component, Input } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
@Component({
selector: 'field-invoice-templates',
template: `<app-enum-select
type="invoice_template_type"
[customLabel]="label"
[control]="control"
[name]="name"
/>`,
imports: [ReactiveFormsModule, EnumSelectComponent],
})
export class FieldInvoiceTemplatesComponent {
@Input({ required: true }) control = new FormControl<string>('');
@Input() name = 'invoice-template';
@Input() label = 'قالب فاکتور';
}