Skip to content

Commit

Permalink
fix: implement input mask for IBAN and BIC (#1655)
Browse files Browse the repository at this point in the history
  • Loading branch information
suschneider authored May 15, 2024
1 parent db448ae commit 06b5461
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ export class PaymentParameterFormComponent implements OnInit, OnChanges {
ngOnInit() {
this.fields = [];
this.paymentMethod.parameters.forEach(param => this.fields.push({ ...param }));
this.fields.forEach(field => (this.model[field.key as string] = field.props?.options ? undefined : ''));
this.fields.forEach(field => {
if (field.key === 'IBAN') {
field.props.mask = 'UU00 AAAA 0000 0009 9999 9999 9999 9999 99';
field.props.placeholder = 'XX00 0000 0000 000';
// max length of IBAN is 34, but the 8 spaces of the mask must be added
field.props.maxLength = 42;
} else if (field.key === 'BIC') {
field.props.mask = 'AAAAAAAA||AAAAAAAAAAA';
}
this.model[field.key as string] = field.props?.options ? undefined : '';
});
}

/**
Expand Down

0 comments on commit 06b5461

Please sign in to comment.