feat(cojo): add cojo type de champ
This commit is contained in:
parent
c74351459e
commit
d5820277c0
31 changed files with 361 additions and 12 deletions
|
@ -15,6 +15,12 @@ export class FormatController extends ApplicationController {
|
|||
const target = event.target as HTMLInputElement;
|
||||
target.value = this.formatIBAN(target.value);
|
||||
});
|
||||
break;
|
||||
case 'integer':
|
||||
this.on('input', (event) => {
|
||||
const target = event.target as HTMLInputElement;
|
||||
target.value = this.formatInteger(target.value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,4 +34,8 @@ export class FormatController extends ApplicationController {
|
|||
.replace(/(.{4})/g, '$1 ')
|
||||
.trim();
|
||||
}
|
||||
|
||||
private formatInteger(value: string) {
|
||||
return value.replace(/[^\d]/g, '');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue