dk-plus
Version:
96 lines (95 loc) • 2.86 kB
TypeScript
import type { ComputedRef, CSSProperties, Ref, InputHTMLAttributes, ShallowRef, TextareaHTMLAttributes } from 'vue';
import type { dkInputType, ClassListName } from '../../_interface';
export interface UseInputProps {
value: string | number;
type: string;
size: string;
disabled: boolean;
clearable: boolean;
readonly: boolean;
placeholder: string;
maxlength: number | string;
minlength: number | string;
showWordLimit: boolean;
prefixIcon: string;
suffixIcon: string;
rows: number | string;
autosize: boolean;
autocomplete: string;
}
export interface UseEmitType {
emit: (event: string, ...args: any[]) => void;
}
export interface propDataModel {
personalityProp: boolean;
labelTextProp: string;
prependText: string;
appendText: string;
placeholder: string;
clearable: boolean;
showPassword: boolean;
prependIcon: string;
appendIcon: string;
disabledProp: boolean;
prefixIcon: string;
typeProp: dkInputType;
suffixIcon: string;
maxlengthProp: number | string;
minlengthProp: number | string;
autosizeProp: boolean;
rowsProp: number | string;
readonlyProp: boolean;
showLengthProp: boolean;
}
export interface DataType {
personality: boolean;
labelText: string;
isPrepend: boolean;
isAppendTextLen: boolean;
isPrefix: boolean;
isClear: boolean;
inputmode: string;
isPrefixIcon: boolean;
isSuffix: boolean;
isSuffixIcon: boolean;
isShowPassword: boolean;
isPrependIcon: boolean;
isAppendIcon: boolean;
isAppend: boolean;
isLength: boolean;
rows: number | string;
showLength: boolean;
}
export interface PendType {
isPrependText: boolean;
isAppendText: boolean;
}
export interface SetupReturns {
clear: () => void;
togglePassword: () => void;
AppendIconEventClick: (event: MouseEvent) => void;
PrependIconEventClick: (event: MouseEvent) => void;
onKeydownEnter: (event: KeyboardEvent) => void;
prefixIconClass: string[];
suffixIconClass: string[];
showPasswordClass: string[];
appendClassList: string[];
classList: ComputedRef<ClassListName>;
wrapperClassList: ComputedRef<ClassListName>;
pendStyleList: ComputedRef<CSSProperties>;
isShowClear: ComputedRef<boolean>;
styleList: CSSProperties;
value: Ref<string | number>;
inputAttrs: InputHTMLAttributes;
input: ShallowRef<HTMLInputElement | undefined>;
textarea: ShallowRef<HTMLTextAreaElement | undefined>;
textareaAttrs: TextareaHTMLAttributes;
prependClassList: string[];
lengthLimit: string;
valueLength: Ref<number>;
showPasswordIcon: Ref<string>;
inputType: Ref<dkInputType>;
}
type ValuesType<T> = T[keyof T];
export type SetupReturnsType = ValuesType<SetupReturns> | boolean;
export {};