@kevinkosterr/vue3-form-generator
Version:
A schema-based form generator component for Vue 3, based on the original [`vue-form-generator`](https://github.com/vue-generators/vue-form-generator) library.
51 lines (50 loc) • 2.47 kB
TypeScript
import { Field, FieldValue } from '../resources/types/field/fields';
import { FormModel } from '../resources/types/fieldAttributes';
declare const _default: {
/**
* Checks if a field meets the 'required' validation criteria.
* @returns {boolean} - Returns 'true' if the field is required and the value is not empty, otherwise false.
*/
required(value: FieldValue, field: Field, model: FormModel): boolean;
/**
* Check if field value is the minimum required length, value or amount of values
* @returns {boolean} - Returns 'true' if the field is required and the value is not empty, otherwise false.
*/
min(value: FieldValue, field: Field, model: FormModel): boolean;
/**
* Check if field value is the maximum provided length
* @returns {boolean} - Returns 'true' if the field is required and the value is not empty, otherwise false.
*/
max(value: FieldValue, field: Field, model: FormModel): boolean;
/**
* Checks if the field's value is of type string.
* @returns {boolean} - Returns 'true' if the field is required and the value is not empty, otherwise false.
*/
string(value: FieldValue, field: Field, model: FormModel): boolean;
/**
* Checks if the field's value is of type number.
* @returns {boolean} - Returns 'true' if the field is a number.
*/
number(value: FieldValue, field: Field, model: FormModel): boolean;
/**
* Check if the field's value is of a valid e-mail address format.
* @returns {boolean} - Returns 'true' if the field's format is a valid email format, otherwise false.
*/
email(value: FieldValue, field: Field, model: FormModel): boolean;
/**
* Check if a value is a phone number in E164 or E123 format.
* @returns {boolean} - Returns 'true' if value matches the format, otherwise false.
*/
phoneNumberE164andE123(value: FieldValue, field: Field, model: FormModel): boolean;
/**
* Check if value is a valid Dutch mobile phone number
* @returns {boolean} - Returns 'true' if value matches the format, otherwise false.
*/
mobilePhoneNL(value: FieldValue, field: Field, model: FormModel): boolean;
/**
* Check if a value is a valid HEX color value.
* @returns {boolean} - Returns `true` if value matches the format, otherwise false.
*/
hexColorValue(value: FieldValue, field: Field, model: FormModel): boolean;
};
export default _default;