@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
316 lines (315 loc) • 8.8 kB
TypeScript
import { NeonInputType } from '@/common/enums/NeonInputType';
import { NeonState } from '@/common/enums/NeonState';
import { NeonSize } from '@/common/enums/NeonSize';
import { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';
import { NeonInputMode } from '@/common/enums/NeonInputMode';
/**
* Equivalent of, and wrapper around, an HTML input. Also supports <strong>textarea</strong>.
*/
declare const _default: import("vue").DefineComponent<{
/**
* The id the input
*/
id: {
type: StringConstructor;
default: null;
};
/**
* The value of the input
*/
modelValue: {
type: StringConstructor;
default: null;
};
/**
* The type of input this is. NOTE: Neon provides custom components as alternatives in the following cases:
* * file (use <a href="/user-input/file">NeonFile</a>)
* * password (use <a href="/user-input/password">NeonPassword</a>)
*/
type: {
type: () => NeonInputType;
default: NeonInputType;
};
/**
* Placeholder text to display in the input
*/
placeholder: {
type: StringConstructor;
default: null;
};
/**
* Size of the input
*/
size: {
type: () => NeonSize;
default: NeonSize;
};
/**
* Color of the input
*/
color: {
type: () => NeonFunctionalColor;
default: NeonFunctionalColor;
};
/**
* The HTML input mode as specified <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode">here</a>.
*/
inputmode: {
type: () => NeonInputMode;
default: NeonInputMode;
};
/**
* The state of the input
*/
state: {
type: () => NeonState;
default: NeonState;
};
/**
* The number of rows to display in the case of a textarea
*/
rows: {
type: NumberConstructor;
default: null;
};
/**
* The name of a clickable icon to display inside the input. This is used for clearing contents or e.g. in the case of
* NeonPassword toggle showing/hiding the password. Defaults to <em>times</em> (for clearing the input's contents).
*/
icon: {
type: StringConstructor;
default: null;
};
/**
* Make the input field icon read-only, i.e. it will not emit events or be treated as a focusable button.
*/
iconReadonly: {
type: BooleanConstructor;
default: boolean;
};
/**
* Hide the icon button, e.g. the X button to clear the input's contents.
*/
hideIcon: {
type: BooleanConstructor;
default: boolean;
};
/**
* Tabindex to assign to the input.
*/
tabindex: {
type: NumberConstructor;
default: number;
};
/**
* The disabled state of the input
*/
disabled: {
type: BooleanConstructor;
default: boolean;
};
/**
* When the state is success or error, display the field with the state color indicator, e.g. border or background
* color.
*/
stateHighlight: {
type: BooleanConstructor;
default: boolean;
};
/**
* When the state is success or error, display the state icon.
*/
stateIcon: {
type: BooleanConstructor;
default: boolean;
};
/**
* The character limit for a textarea.
*/
maxlength: {
type: NumberConstructor;
default: null;
};
/**
* Debounce time in ms, if no value is provided the default value set in NeonDebounceUtils is used (=300ms).
* Set to 0 to disable debounce.
*/
debounce: {
type: NumberConstructor;
default: undefined;
};
}, {
neonInput: import("vue").Ref<HTMLElement | null>;
focused: import("vue").Ref<boolean>;
sanitizedAttributes: import("vue").ComputedRef<{
[x: string]: unknown;
}>;
iconVisible: import("vue").ComputedRef<string | boolean | undefined>;
iconName: import("vue").ComputedRef<string | undefined>;
iconColor: import("vue").ComputedRef<NeonFunctionalColor>;
computedPlaceholder: import("vue").ComputedRef<string>;
focus: () => void;
click: () => void;
onFocus: () => void;
onBlur: () => void;
iconClicked: ($event: Event) => void;
changeValue: (event: Event) => void;
onKeyDown: (event: KeyboardEvent) => void;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "focus" | "blur" | "icon-click")[], "update:modelValue" | "focus" | "blur" | "icon-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
/**
* The id the input
*/
id: {
type: StringConstructor;
default: null;
};
/**
* The value of the input
*/
modelValue: {
type: StringConstructor;
default: null;
};
/**
* The type of input this is. NOTE: Neon provides custom components as alternatives in the following cases:
* * file (use <a href="/user-input/file">NeonFile</a>)
* * password (use <a href="/user-input/password">NeonPassword</a>)
*/
type: {
type: () => NeonInputType;
default: NeonInputType;
};
/**
* Placeholder text to display in the input
*/
placeholder: {
type: StringConstructor;
default: null;
};
/**
* Size of the input
*/
size: {
type: () => NeonSize;
default: NeonSize;
};
/**
* Color of the input
*/
color: {
type: () => NeonFunctionalColor;
default: NeonFunctionalColor;
};
/**
* The HTML input mode as specified <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode">here</a>.
*/
inputmode: {
type: () => NeonInputMode;
default: NeonInputMode;
};
/**
* The state of the input
*/
state: {
type: () => NeonState;
default: NeonState;
};
/**
* The number of rows to display in the case of a textarea
*/
rows: {
type: NumberConstructor;
default: null;
};
/**
* The name of a clickable icon to display inside the input. This is used for clearing contents or e.g. in the case of
* NeonPassword toggle showing/hiding the password. Defaults to <em>times</em> (for clearing the input's contents).
*/
icon: {
type: StringConstructor;
default: null;
};
/**
* Make the input field icon read-only, i.e. it will not emit events or be treated as a focusable button.
*/
iconReadonly: {
type: BooleanConstructor;
default: boolean;
};
/**
* Hide the icon button, e.g. the X button to clear the input's contents.
*/
hideIcon: {
type: BooleanConstructor;
default: boolean;
};
/**
* Tabindex to assign to the input.
*/
tabindex: {
type: NumberConstructor;
default: number;
};
/**
* The disabled state of the input
*/
disabled: {
type: BooleanConstructor;
default: boolean;
};
/**
* When the state is success or error, display the field with the state color indicator, e.g. border or background
* color.
*/
stateHighlight: {
type: BooleanConstructor;
default: boolean;
};
/**
* When the state is success or error, display the state icon.
*/
stateIcon: {
type: BooleanConstructor;
default: boolean;
};
/**
* The character limit for a textarea.
*/
maxlength: {
type: NumberConstructor;
default: null;
};
/**
* Debounce time in ms, if no value is provided the default value set in NeonDebounceUtils is used (=300ms).
* Set to 0 to disable debounce.
*/
debounce: {
type: NumberConstructor;
default: undefined;
};
}>> & {
onFocus?: ((...args: any[]) => any) | undefined;
onBlur?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
"onIcon-click"?: ((...args: any[]) => any) | undefined;
}, {
disabled: boolean;
icon: string;
type: NeonInputType;
debounce: number;
size: NeonSize;
color: NeonFunctionalColor;
tabindex: number;
modelValue: string;
id: string;
state: NeonState;
placeholder: string;
inputmode: NeonInputMode;
rows: number;
iconReadonly: boolean;
hideIcon: boolean;
stateHighlight: boolean;
stateIcon: boolean;
maxlength: number;
}, {}>;
export default _default;