UNPKG

vuestic-ui

Version:
43 lines (42 loc) 1.5 kB
import { ExtractPropTypes } from 'vue'; export declare const useFormFieldProps: { disabled: { type: BooleanConstructor; default: boolean; }; readonly: { type: BooleanConstructor; default: boolean; }; }; export declare const useFormFieldPropsWithId: { id: { type: (StringConstructor | NumberConstructor)[]; default: undefined; }; name: { type: (StringConstructor | NumberConstructor)[]; default: undefined; }; disabled: { type: BooleanConstructor; default: boolean; }; readonly: { type: BooleanConstructor; default: boolean; }; }; /** * @description creates `readonly` and `disabled` BEM modifiers. * @param prefix string that classes start with (base BEM class). * @param props component props. * @returns computed classes object starting with `prefix` and ending with form state BEM modifier. */ export declare const useFormField: <Prefix extends string = "">(prefix: Prefix, props: ExtractPropTypes<typeof useFormFieldProps>) => { computedClasses: { [P in `${Prefix}--disabled` | `${Prefix}--readonly`]: boolean | undefined; } & { readonly asObject: import("vue").ComputedRef<{ [P in `${Prefix}--disabled` | `${Prefix}--readonly`]: boolean | undefined; }>; readonly asArray: import("vue").ComputedRef<(`${Prefix}--disabled` | `${Prefix}--readonly`)[]>; readonly asString: import("vue").ComputedRef<string>; }; };