// #region Imports
import { ElementValidatorBase } from './Abstracts/ElementValidatorBase';
import { minLengthValidator } from './MinLengthElementValidatorFn';
/**
 * @public
 */
export class MinLengthElementValidator extends ElementValidatorBase {
    // #region Ctor
    constructor(host, messageResolver) {
        super(host, messageResolver ?? ((params) => `The value must be at least ${params.minLength} characters long.`));
    }
    // #endregion
    // #region Properties
    get attributes() {
        return ['minlength', 'value'];
    }
    // #endregion
    // #region Methods
    validate() {
        const errors = minLengthValidator(this.host);
        return this.getMessage(errors);
    }
}
/**
 * A factory function for the `MinLengthElementValidator`.
 *
 * @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 minlengthElementValidator(resolver) {
    return (host) => {
        return new MinLengthElementValidator(host, resolver);
    };
}
//# sourceMappingURL=MinLengthElementValidator.js.map