// #region Imports
import { ElementValidatorBase } from './Abstracts/ElementValidatorBase';
import { numericValidator, isNumericValue as _isNumericValue } from './NumericElementValidatorFn';
/**
 * @public
 */
export class NumericElementValidator extends ElementValidatorBase {
    // #region Ctor
    constructor(host, messageResolver) {
        super(host, messageResolver ?? ((_params) => 'The value must be numeric.'));
    }
    // #endregion
    // #region Properties
    get attributes() {
        return ['value'];
    }
    // #endregion
    // #region Methods
    validate() {
        const errors = numericValidator(this.host);
        return this.getMessage(errors);
    }
}
(function (NumericElementValidator) {
    NumericElementValidator.isNumericValue = _isNumericValue;
})(NumericElementValidator || (NumericElementValidator = {}));
/**
 * The factory function for the {@link NumericElementValidator}.
 *
 * @public
 * @param resolver - A *optional* message resolver to get the error message that will be displayed. When not provided, a default message will be used.
 */
export function numericElementValidator(resolver) {
    const fn = ([host]) => {
        const validator = new NumericElementValidator(host, resolver);
        return validator;
    };
    return fn;
}
//# sourceMappingURL=NumericElementValidator.js.map