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.

74 lines 3.06 kB
export default TinyHtmlMonthInput; /** * TinyHtmlMonthInput is a helper class for managing `<input type="month">` elements. * It provides validation and convenient getters/setters for standard attributes. * * @example * const monthInput = new TinyHtmlMonthInput({ * value: '2025-09', * min: '2020-01', * max: '2030-12', * step: 1, * required: true, * name: 'billingMonth' * }); */ declare class TinyHtmlMonthInput extends TinyHtmlInput { /** * Creates a new TinyHtmlMonthInput instance. * @param {Object} config - Configuration object. * @param {string} [config.value] - Initial value (formatted as "YYYY-MM"). * @param {string} [config.min] - Minimum allowed value (formatted as "YYYY-MM"). * @param {string} [config.max] - Maximum allowed value (formatted as "YYYY-MM"). * @param {number} [config.step] - Step size (in months). * @param {string} [config.name] - Name of the input control. * @param {string} [config.placeholder] - Placeholder text. * @param {string} [config.autocomplete] - Autocomplete hint (e.g., "on", "off", "email"). * @param {string} [config.list] - ID of a linked `<datalist>`. * @param {boolean} [config.readonly=false] - Whether the input is read-only. * @param {boolean} [config.required=false] - Whether the input is required. * @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, min, max, step, name, readonly, required, placeholder, autocomplete, tags, mainClass, }?: { value?: string | undefined; min?: string | undefined; max?: string | undefined; step?: number | undefined; name?: string | undefined; placeholder?: string | undefined; autocomplete?: string | undefined; list?: string | undefined; readonly?: boolean | undefined; required?: boolean | undefined; tags?: string | string[] | Set<string> | undefined; mainClass?: string | undefined; }); /** @param {string|Date} value */ set value(value: string | Date); /** @returns {string|null} */ get value(): string | null; /** @param {string} min */ set min(min: string); /** @returns {string|null} */ get min(): string | null; /** @param {string} max */ set max(max: string); /** @returns {string|null} */ get max(): string | null; /** @param {number} step */ set step(step: number); /** @returns {number|null} */ get step(): number | null; /** @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; } import TinyHtmlInput from '../../TinyHtmlInput.mjs'; //# sourceMappingURL=TinyHtmlMonthInput.d.mts.map