fix(input-amount): remove randomOkValidator as default
This commit is contained in:
parent
813a790613
commit
d5e2dfe38e
1 changed files with 4 additions and 8 deletions
|
|
@ -3,7 +3,7 @@ import { LocalizeMixin } from '@lion/localize';
|
|||
import { ObserverMixin } from '@lion/core/src/ObserverMixin.js';
|
||||
import { LionInput } from '@lion/input';
|
||||
import { FieldCustomMixin } from '@lion/field';
|
||||
import { isNumberValidator, randomOkValidator } from '@lion/validate';
|
||||
import { isNumberValidator } from '@lion/validate';
|
||||
import { parseAmount } from './parsers.js';
|
||||
import { formatAmount } from './formatters.js';
|
||||
|
||||
|
|
@ -65,14 +65,10 @@ export class LionInputAmount extends FieldCustomMixin(LocalizeMixin(ObserverMixi
|
|||
}
|
||||
|
||||
getValidatorsForType(type) {
|
||||
switch (type) {
|
||||
case 'error':
|
||||
return [isNumberValidator()].concat(super.getValidatorsForType(type) || []);
|
||||
case 'success':
|
||||
return [randomOkValidator()].concat(super.getValidatorsForType(type) || []);
|
||||
default:
|
||||
return super.getValidatorsForType(type);
|
||||
if (type === 'error') {
|
||||
return [isNumberValidator()].concat(super.getValidatorsForType(type) || []);
|
||||
}
|
||||
return super.getValidatorsForType(type);
|
||||
}
|
||||
|
||||
static get styles() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue