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.
43 lines • 1.9 kB
text/typescript
export default TinyHtmlResetInput;
/**
* TinyHtmlResetInput is a helper class for managing `<input type="reset">` elements.
* It allows configuring common attributes such as value, name, placeholder,
* readonly, and required, with validation and proper getter/setter methods.
*
* @example
* const resetBtn = new TinyHtmlResetInput({
* value: 'Clear Form',
* name: 'resetButton',
* required: false,
* tags: ['btn', 'btn-reset'],
* });
*/
declare class TinyHtmlResetInput extends TinyHtmlInput {
/**
* Creates a new TinyHtmlResetInput instance.
* @param {Object} config - Configuration object.
* @param {string|number} [config.value] - The initial value of the reset button.
* @param {string} [config.name] - The name of the control.
* @param {string} [config.placeholder] - Placeholder text (non-standard but supported).
* @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, name, placeholder, readonly, required, tags, mainClass, }?: {
value?: string | number | undefined;
name?: string | undefined;
placeholder?: string | undefined;
readonly?: boolean | undefined;
required?: boolean | undefined;
tags?: string | string[] | Set<string> | undefined;
mainClass?: string | undefined;
});
/** @param {string|number} value */
set value(value: string | number);
/** @returns {string|null} */
get value(): string | null;
}
import TinyHtmlInput from '../../TinyHtmlInput.mjs';
//# sourceMappingURL=TinyHtmlResetInput.d.mts.map