@indielayer/ui
Version:
Indielayer UI Components with Tailwind CSS build for Vue 3
107 lines (106 loc) • 3.11 kB
TypeScript
import { type PropType, type ExtractPublicPropTypes } from 'vue';
import { type ThemeComponent } from '../../composables/useTheme';
declare const formProps: {
autoValidate: {
type: BooleanConstructor;
default: boolean;
};
autoFocus: {
type: BooleanConstructor;
default: boolean;
};
disabled: BooleanConstructor;
errors: {
type: PropType<FormError | FormError[]>;
default: () => never[];
};
title: StringConstructor;
description: StringConstructor;
hasFooter: {
type: BooleanConstructor;
default: boolean;
};
};
export type FormProps = ExtractPublicPropTypes<typeof formProps>;
export type FormInjection = {
registerInput: (name: string, focus: () => void, validate: () => boolean, setError: (val: string) => void) => void;
unregisterInput: (name: string) => void;
isInsideForm: boolean;
};
export type FormError = {
field: string;
msg: string;
};
export type FormInput = {
name: string;
focus: () => void;
validate: (val?: any) => boolean;
setError: (val: string) => void;
};
type InternalClasses = 'wrapper' | 'content' | 'title' | 'description' | 'footer';
export interface FormTheme extends ThemeComponent<FormProps, InternalClasses> {
}
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
autoValidate: {
type: BooleanConstructor;
default: boolean;
};
autoFocus: {
type: BooleanConstructor;
default: boolean;
};
disabled: BooleanConstructor;
errors: {
type: PropType<FormError | FormError[]>;
default: () => never[];
};
title: StringConstructor;
description: StringConstructor;
hasFooter: {
type: BooleanConstructor;
default: boolean;
};
}>, {
validate: () => boolean;
submit: (e: Event) => void;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "submit"[], "submit", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
autoValidate: {
type: BooleanConstructor;
default: boolean;
};
autoFocus: {
type: BooleanConstructor;
default: boolean;
};
disabled: BooleanConstructor;
errors: {
type: PropType<FormError | FormError[]>;
default: () => never[];
};
title: StringConstructor;
description: StringConstructor;
hasFooter: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{
onSubmit?: ((...args: any[]) => any) | undefined;
}>, {
autoValidate: boolean;
autoFocus: boolean;
disabled: boolean;
errors: FormError | FormError[];
hasFooter: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
header?(_: {}): any;
default?(_: {}): any;
footer?(_: {}): any;
"primary-action"?(_: {}): any;
"secondary-action"?(_: {}): any;
}>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};