2023-07-05 11:52:56 +00:00
|
|
|
import Textfield from '../textfield/textfield';
|
2023-05-18 12:21:42 +00:00
|
|
|
import ngModule from '../../module';
|
|
|
|
|
2023-07-05 11:52:56 +00:00
|
|
|
export default class AccountNumber extends Textfield {
|
2023-05-18 12:21:42 +00:00
|
|
|
constructor($element, $) {
|
|
|
|
super($element, $);
|
|
|
|
this.$ = $;
|
2023-07-06 07:21:31 +00:00
|
|
|
super.insertable = true;
|
|
|
|
super.maxLength = 10;
|
|
|
|
this.element.addEventListener('change', () => this.accountShortToStandard());
|
2023-05-18 12:21:42 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 11:52:56 +00:00
|
|
|
accountShortToStandard() {
|
|
|
|
this.field = this.field.replace('.', '0'.repeat(11 - this.field.length));
|
|
|
|
this.$.$emit('accountShortToStandard', this.field);
|
2023-05-18 12:21:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AccountNumber.$inject = ['$element', '$scope'];
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnAccountNumber', {
|
|
|
|
controller: AccountNumber,
|
|
|
|
});
|