feat: enhance form components with validation and dynamic properties; update payment handling and UI interactions
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user