import { EventEmitter } from '../../stencil-public-runtime'; import { ErrorMap } from '../cat-form-hint/cat-form-hint'; import { InputType } from './input-type'; type TimeUnit = 'h' | 'm' | 's'; type TimeFormatType = '12' | '24'; type DateUnit = 'Y' | 'y' | 'm' | 'd'; export interface FormatTimeMaskOptions { timePattern?: TimeUnit[]; timeFormat?: TimeFormatType; } export interface FormatDateMaskOptions { delimiter?: string; datePattern?: DateUnit[]; dateMin?: string; dateMax?: string; } /** * Inputs are used to allow users to provide text input when the expected input * is short. As well as plain text, Input supports various types of text, * including passwords and numbers. * * @slot hint - Optional hint element to be displayed with the input. * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed. * @slot counter - Custom counter element to be displayed in the top right corner of the label. * @part label - The native label element. * @part input - The native input element. * @part prefix - The text prefix. * @part suffix - The text suffix. */ export declare class CatInput { private readonly _id; private get id(); private input; private errorMapSrc?; hostElement: HTMLElement; hasSlottedLabel: boolean; hasSlottedHint: boolean; hasSlottedCounter: boolean; isPasswordShown: boolean; errorMap?: ErrorMap | true; internals: ElementInternals; /** * Whether the label need a marker to shown if the input is required or optional. */ requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!'; /** * Whether the label is on top or left. */ horizontal?: boolean; /** * If the horizontal value is not provided, this fallback value is used. Can be set by form-group. * @internal */ fallbackHorizontal?: boolean; /** * Defines the file types the file input should accept. */ accept?: string; /** * Whether the input should allow multiple files to be selected. */ multiple?: boolean; /** * Hint for form autofill feature. */ autoComplete?: string; /** * Whether the input should show a clear button. */ clearable: boolean; /** * Whether the input should show a password toggle button for password inputs. */ togglePassword: boolean; /** * Whether the input is disabled. */ disabled: boolean; /** * Displays the input in a loading state with a spinner. */ loading: boolean; /** * Optional hint text(s) to be displayed with the input. */ hint?: string | string[]; /** * The name of an icon to be displayed in the input. */ icon?: string; /** * Display the icon on the right. */ iconRight: boolean; /** * A unique identifier for the input. */ identifier?: string; /** * The label for the input. */ label: string; /** * Visually hide the label, but still show it to assistive technologies like screen readers. */ labelHidden: boolean; /** * A maximum value for numeric values. */ max?: number | string; /** * A maximum length (number of characters) for textual values. */ maxLength?: number; /** * A minimum value for numeric values. */ min?: number | string; /** * A minimum length (number of characters) for textual values. */ minLength?: number; /** * The name of the form control. Submitted with the form as part of a name/value pair. */ name?: string; /** * The placeholder text to display within the input. */ placeholder?: string; /** * A textual prefix to be displayed in the input. */ textPrefix?: string; /** * A textual suffix to be displayed in the input. */ textSuffix?: string; /** * The value is not editable. */ readonly: boolean; /** * A value is required or must be check for the form to be submittable. */ required: boolean; /** * Use round input edges. */ round: boolean; /** * Type of form control. */ type: InputType; /** * The value of the control. */ value?: string; /** * The validation errors for this input. Will render a hint under the input * with the translated error message(s) `error.${key}`. If an object is * passed, the keys will be used as error keys and the values translation * parameters. * If the value is `true`, the input will be marked as invalid without any * hints under the input. */ errors?: boolean | string[] | ErrorMap; /** * Fine-grained control over when the errors are shown. Can be `false` to * never show errors, `true` to show errors on blur, or a number to show * errors change with the given delay in milliseconds or immediately on blur. */ errorUpdate: boolean | number; /** * Attributes that will be added to the native HTML input element. */ nativeAttributes?: { [key: string]: string; }; /** * A unique identifier for the underlying native element that is used for * testing purposes. The attribute is added as `data-test` attribute and acts * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`. */ testId?: string; /** * Activates cleave-zen time mask on input */ timeMaskOptions?: FormatTimeMaskOptions; /** * Activates cleave-zen date mask on input */ dateMaskOptions?: FormatDateMaskOptions; /** * Emitted when the value is changed. */ catChange: EventEmitter; /** * Emitted when the input received focus. */ catFocus: EventEmitter; /** * Emitted when the input loses focus. */ catBlur: EventEmitter; /** * Emitted if the input type is "file" and files are selected. */ catChangeFiles: EventEmitter; componentWillLoad(): void; componentWillRender(): void; /** * Programmatically move focus to the input. Use this method instead of * `input.focus()`. * * @param options An optional object providing options to control aspects of * the focusing process. */ doFocus(options?: FocusOptions): Promise; /** * Programmatically remove focus from the input. Use this method instead of * `input.blur()`. */ doBlur(): Promise; /** * Clear the input. */ clear(): Promise; onErrorsChanged(newValue?: boolean | string[] | ErrorMap, _oldValue?: unknown, update?: boolean): void; render(): any; private get hasHint(); private get invalid(); private onInput; private onFocus; private onBlur; private doTogglePassword; private showErrors; private errorUpdateTimeoutId?; private showErrorsIfTimeout; private showErrorsIfNoFocus; private findSiblingInput; } export {};