feat: enhance form components with validation and dynamic properties; update payment handling and UI interactions

This commit is contained in:
2026-05-24 19:40:02 +03:30
parent cdd2bd6bee
commit eb671d5949
15 changed files with 283 additions and 865 deletions
@@ -63,7 +63,7 @@ export abstract class AbstractForm<
finalize(() => {
this.submitLoading.set(false);
// this.form.enable();
}),
})
)
.subscribe((res) => {
this.onSuccess(res);
@@ -132,12 +132,16 @@ export class SharedLightBottomsheetComponent implements OnInit, OnDestroy, OnCha
this.syncZIndex();
}
if (changes['visible']) {
console.log('changed', this.visible);
this.toggleBodyScrollLock(this.visible);
}
}
ngOnDestroy() {
this.toggleBodyScrollLock(false);
console.log('destroyed');
this.removeDrawer();
}
@@ -167,6 +171,8 @@ export class SharedLightBottomsheetComponent implements OnInit, OnDestroy, OnCha
}
private toggleBodyScrollLock(locked: boolean) {
console.log('locked', locked);
const body = this.document.body;
if (!body) return;
@@ -182,8 +188,8 @@ export class SharedLightBottomsheetComponent implements OnInit, OnDestroy, OnCha
return;
}
this.renderer.setStyle(body, 'overflow', this.previousBodyOverflow);
this.renderer.setStyle(body, 'touch-action', this.previousBodyTouchAction);
this.renderer.removeStyle(body, 'overflow');
this.renderer.removeStyle(body, 'touch-action');
this.previousBodyOverflow = '';
this.previousBodyTouchAction = '';
}
@@ -4,10 +4,19 @@ import { InputComponent } from '../input/input.component';
@Component({
selector: 'field-quantity',
template: `<app-input label="مقدار" [control]="control" [name]="name" type="number" />`,
template: `<app-input
label="مقدار"
[control]="control"
[name]="name"
type="number"
[min]="min"
[max]="max"
/>`,
imports: [ReactiveFormsModule, InputComponent],
})
export class QuantityComponent {
@Input({ required: true }) control = new FormControl<string>('');
@Input() min = 0;
@Input() max = undefined;
@Input() name = 'quantity';
}