UNPKG

mithril-materialized

Version:
47 lines (46 loc) 2.08 kB
import m, { FactoryComponent, Attributes } from 'mithril'; import { InputAttrs } from './input-options'; /** Character counter component that tracks text length against maxLength */ export declare const CharacterCounter: FactoryComponent<{ currentLength: number; maxLength: number; show: boolean; }>; /** Create a TextArea */ export declare const TextArea: FactoryComponent<InputAttrs<string>>; /** Component for entering some text */ export declare const TextInput: m.FactoryComponent<InputAttrs<string>>; /** Component for entering a password */ export declare const PasswordInput: m.FactoryComponent<InputAttrs<string>>; /** Component for entering a number */ export declare const NumberInput: m.FactoryComponent<InputAttrs<number>>; /** Component for entering a URL */ export declare const UrlInput: m.FactoryComponent<InputAttrs<string>>; /** Component for entering a color */ export declare const ColorInput: m.FactoryComponent<InputAttrs<string>>; /** Component for entering a range */ export declare const RangeInput: m.FactoryComponent<InputAttrs<number>>; /** Component for entering an email */ export declare const EmailInput: m.FactoryComponent<InputAttrs<string>>; export interface FileInputAttrs extends Attributes { /** Displayed on the button, @default File */ label?: string; /** Current value of the file input, write only */ value?: string; /** Adds a placeholder message */ placeholder?: string; /** If true, upload multiple files */ multiple?: boolean; /** Called when the file input is changed */ onchange?: (files: FileList) => void; /** If true, disable the box */ disabled?: boolean; /** * Accepted file types, e.g. image/png, image/jpeg, * any image/*, video/*. audio/*, .pdf, a valid MIME type string, with no extensions, etc. * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers */ accept?: string | string[]; } /** Component for uploading a file */ export declare const FileInput: FactoryComponent<FileInputAttrs>;