UNPKG

tiny-essentials

Version:

Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.

87 lines 3.81 kB
export default TinyHtmlEmailInput; /** * TinyHtmlEmailInput is a helper class for managing <input type="email"> elements. * It provides strongly typed getters and setters for common attributes such as * minlength, maxlength, pattern, autocomplete, multiple, and more. * * @example * const emailInput = new TinyHtmlEmailInput({ * placeholder: 'Enter your email', * required: true, * maxlength: 100, * autocomplete: 'email' * }); */ declare class TinyHtmlEmailInput extends TinyHtmlInput { /** * Creates a new TinyHtmlEmailInput instance. * @param {Object} config - Configuration object. * @param {string} [config.value] - Initial value. * @param {number} [config.minLength] - Minimum number of characters allowed. * @param {number} [config.maxLength] - Maximum number of characters allowed. * @param {string} [config.pattern] - Regex pattern for validation. * @param {string} [config.autocomplete] - Autocomplete hint (e.g., "on", "off", "email"). * @param {string} [config.dirname] - Name of the directionality field (text-based inputs). * @param {string} [config.list] - ID of a <datalist> element. * @param {boolean} [config.multiple=false] - Whether multiple values are allowed. * @param {number} [config.size] - Size of the input box in characters. * @param {boolean} [config.readonly=false] - Whether the input is readonly. * @param {boolean} [config.required=false] - Whether the input is required. * @param {string} [config.placeholder] - Placeholder text. * @param {string} [config.name] - Name of the control. * @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes. * @param {string} [config.mainClass=''] - Main CSS class. * @throws {TypeError} If any attribute is of the wrong type. */ constructor({ value, list, placeholder, readonly, required, multiple, minLength, autocomplete, size, pattern, maxLength, dirname, name, tags, mainClass, }?: { value?: string | undefined; minLength?: number | undefined; maxLength?: number | undefined; pattern?: string | undefined; autocomplete?: string | undefined; dirname?: string | undefined; list?: string | undefined; multiple?: boolean | undefined; size?: number | undefined; readonly?: boolean | undefined; required?: boolean | undefined; placeholder?: string | undefined; name?: string | undefined; tags?: string | string[] | Set<string> | undefined; mainClass?: string | undefined; }); /** @param {number} minLength */ set minLength(minLength: number); /** @returns {number|null} */ get minLength(): number | null; /** @param {number} maxLength */ set maxLength(maxLength: number); /** @returns {number|null} */ get maxLength(): number | null; /** @param {string} pattern */ set pattern(pattern: string); /** @returns {string|null} */ get pattern(): string | null; /** @param {boolean} multiple */ set multiple(multiple: boolean); /** @returns {boolean} */ get multiple(): boolean; /** @param {string} list */ set list(list: string); /** @returns {string|null} */ get list(): string | null; /** @param {string} autocomplete */ set autocomplete(autocomplete: string); /** @returns {string|null} */ get autocomplete(): string | null; /** @param {string} dirname */ set dirname(dirname: string); /** @returns {string|null} */ get dirname(): string | null; /** @param {string} value */ set value(value: string); /** @returns {string} */ get value(): string; } import TinyHtmlInput from '../../TinyHtmlInput.mjs'; //# sourceMappingURL=TinyHtmlEmailInput.d.mts.map