field-basepackage.src.validate-mixin.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-webcomponents Show documentation
Show all versions of vaadin-webcomponents Show documentation
Mvnpm composite: Vaadin webcomponents
/**
* @license
* Copyright (c) 2021 - 2024 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import type { Constructor } from '@open-wc/dedupe-mixin';
/**
* A mixin to provide required state and validation logic.
*/
export declare function ValidateMixin>(base: T): Constructor & T;
export declare class ValidateMixinClass {
/**
* Set to true when the field is invalid.
*/
invalid: boolean;
/**
* Specifies that the user must fill in a value.
*/
required: boolean;
/**
* Returns true if field is valid, and sets `invalid` based on the field validity.
*/
validate(): boolean;
/**
* Returns true if the field value satisfies all constraints (if any).
*/
checkValidity(): boolean;
/**
* Fired whenever the field is validated.
*
* @event validated
* @param {Object} detail
* @param {boolean} detail.valid the result of the validation.
*/
}