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 { ObserverMixin } from '@lion/core/src/ObserverMixin.js';
|
||||||
import { LionInput } from '@lion/input';
|
import { LionInput } from '@lion/input';
|
||||||
import { FieldCustomMixin } from '@lion/field';
|
import { FieldCustomMixin } from '@lion/field';
|
||||||
import { isNumberValidator, randomOkValidator } from '@lion/validate';
|
import { isNumberValidator } from '@lion/validate';
|
||||||
import { parseAmount } from './parsers.js';
|
import { parseAmount } from './parsers.js';
|
||||||
import { formatAmount } from './formatters.js';
|
import { formatAmount } from './formatters.js';
|
||||||
|
|
||||||
|
|
@ -65,14 +65,10 @@ export class LionInputAmount extends FieldCustomMixin(LocalizeMixin(ObserverMixi
|
||||||
}
|
}
|
||||||
|
|
||||||
getValidatorsForType(type) {
|
getValidatorsForType(type) {
|
||||||
switch (type) {
|
if (type === 'error') {
|
||||||
case 'error':
|
return [isNumberValidator()].concat(super.getValidatorsForType(type) || []);
|
||||||
return [isNumberValidator()].concat(super.getValidatorsForType(type) || []);
|
|
||||||
case 'success':
|
|
||||||
return [randomOkValidator()].concat(super.getValidatorsForType(type) || []);
|
|
||||||
default:
|
|
||||||
return super.getValidatorsForType(type);
|
|
||||||
}
|
}
|
||||||
|
return super.getValidatorsForType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static get styles() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue