@uozi-admin/curd
Version:
Easy to implement curd.
363 lines (362 loc) • 17.5 kB
TypeScript
import { Slot } from 'vue';
import { StdCurdProps } from '../types';
type __VLS_Props = StdCurdProps;
declare function refresh(reset?: boolean): void;
declare function handleAdd(data?: Record<string, any>): void;
type __VLS_PublicProps = {
'selectedRowKeys'?: any[];
'selectedRows'?: any[];
} & __VLS_Props;
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: Partial<Record<string, (_: any) => any>> & {
titleLeft?(_: {}): any;
title?(_: {}): any;
titleRight?(_: {}): any;
beforeListActions?(_: {}): any;
afterListActions?(_: {}): any;
beforeCardBody?(_: {}): any;
beforeSearch?(_: {
data: {};
}): any;
'search-actions-left'?(_: {}): any;
searchFormAction?(_: {}): any;
beforeTable?(_: {}): any;
beforeActions?(_: {
record: any;
column: import('antdv-next').TableColumnType<import('antdv-next/dist/_util/type').AnyObject>;
isTrash: boolean;
}): any;
afterActions?(_: {
record: any;
column: import('antdv-next').TableColumnType<import('antdv-next/dist/_util/type').AnyObject>;
isTrash: boolean;
}): any;
beforeForm?(_: {
record: Record<string, any>;
}): any;
afterForm?(_: {
record: Record<string, any>;
}): any;
};
refs: {
stdForm: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
data?: Record<string, any>;
} & {
labelAlign?: "left" | "right";
columns: import('..').StdTableColumn[];
layout?: "horizontal" | "vertical" | "inline";
formClass?: StdCurdProps["formClass"];
formRowProps?: import('antdv-next').RowProps;
errors?: Record<string, string>;
mode?: "edit" | "add";
}> & Readonly<{
"onUpdate:data"?: ((value: Record<string, any>) => any) | undefined;
onValidate?: ((payload: {
name: string | number | (string | number)[];
status: boolean;
errors: any[] | null;
}) => any) | undefined;
}>, {
formRef: import('vue').Ref<import('antdv-next').FormInstance | undefined, import('antdv-next').FormInstance | undefined>;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
"update:data": (value: Record<string, any>) => any;
} & {
validate: (payload: {
name: string | number | (string | number)[];
status: boolean;
errors: any[] | null;
}) => any;
}, import('vue').PublicProps, {
formRowProps: import('antdv-next').RowProps;
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
formRef: import('vue').CreateComponentPublicInstanceWithMixins<import('antdv-next').FormProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, import('antdv-next').FormEmits, import('vue').PublicProps, {}, false, {}, import('vue').SlotsType<import('antdv-next').FormSlots>, {}, {}, string, {}, any, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, import('antdv-next').FormProps, {}, {}, {}, {}, {}> | null;
}, any, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<{
data?: Record<string, any>;
} & {
labelAlign?: "left" | "right";
columns: import('..').StdTableColumn[];
layout?: "horizontal" | "vertical" | "inline";
formClass?: StdCurdProps["formClass"];
formRowProps?: import('antdv-next').RowProps;
errors?: Record<string, string>;
mode?: "edit" | "add";
}> & Readonly<{
"onUpdate:data"?: ((value: Record<string, any>) => any) | undefined;
onValidate?: ((payload: {
name: string | number | (string | number)[];
status: boolean;
errors: any[] | null;
}) => any) | undefined;
}>, {
formRef: import('vue').Ref<import('antdv-next').FormInstance | undefined, import('antdv-next').FormInstance | undefined>;
}, {}, {}, {}, {
formRowProps: import('antdv-next').RowProps;
}> | null;
stdBatchEdit: ({
$: import('vue').ComponentInternalInstance;
$data: {};
$props: {
readonly api: import('../types/api').CurdApi;
readonly beforeSave?: (() => Promise<void>) | undefined;
readonly columns: import('..').StdTableColumn[];
readonly formClass?: string | undefined;
readonly formRowProps?: any;
readonly onSave?: ((...args: any[]) => any) | undefined;
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
$attrs: {
[x: string]: unknown;
};
$refs: {
[x: string]: unknown;
};
$slots: Readonly<{
[name: string]: Slot<any> | undefined;
}>;
$root: import('vue').ComponentPublicInstance | null;
$parent: import('vue').ComponentPublicInstance | null;
$host: Element | null;
$emit: (event: "save", ...args: any[]) => void;
$el: any;
$options: import('vue').ComponentOptionsBase<Readonly<{
api: import('../types/api').CurdApi;
beforeSave?: () => Promise<void>;
columns: import('..').StdTableColumn[];
formClass?: string;
formRowProps?: any;
}> & Readonly<{
onSave?: ((...args: any[]) => any) | undefined;
}>, {
showModal: (rowKeys: (number | string)[], rows: any[]) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
save: (...args: any[]) => void;
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
beforeCreate?: (() => void) | (() => void)[];
created?: (() => void) | (() => void)[];
beforeMount?: (() => void) | (() => void)[];
mounted?: (() => void) | (() => void)[];
beforeUpdate?: (() => void) | (() => void)[];
updated?: (() => void) | (() => void)[];
activated?: (() => void) | (() => void)[];
deactivated?: (() => void) | (() => void)[];
beforeDestroy?: (() => void) | (() => void)[];
beforeUnmount?: (() => void) | (() => void)[];
destroyed?: (() => void) | (() => void)[];
unmounted?: (() => void) | (() => void)[];
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
};
$forceUpdate: () => void;
$nextTick: typeof import('vue').nextTick;
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
} & Readonly<{}> & Omit<Readonly<{
api: import('../types/api').CurdApi;
beforeSave?: () => Promise<void>;
columns: import('..').StdTableColumn[];
formClass?: string;
formRowProps?: any;
}> & Readonly<{
onSave?: ((...args: any[]) => any) | undefined;
}>, "showModal"> & import('vue').ShallowUnwrapRef<{
showModal: (rowKeys: (number | string)[], rows: any[]) => void;
}> & {} & import('vue').ComponentCustomProperties & {} & {
$slots: {
extra?(_: {}): any;
};
}) | null;
};
rootEl: HTMLDivElement;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
refresh: typeof refresh;
handleAdd: typeof handleAdd;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
"update:selectedRowKeys": (value: any[]) => any;
"update:selectedRows": (value: any[]) => any;
} & {
view: (record: any) => any;
add: () => any;
deleteItemTemporarily: (record: any) => any;
deleteItemPermanently: (record: any) => any;
restoreItem: (record: any) => any;
editItem: (record: any) => any;
resetSearchForm: () => any;
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
onView?: ((record: any) => any) | undefined;
onAdd?: (() => any) | undefined;
onDeleteItemTemporarily?: ((record: any) => any) | undefined;
onDeleteItemPermanently?: ((record: any) => any) | undefined;
onRestoreItem?: ((record: any) => any) | undefined;
onEditItem?: ((record: any) => any) | undefined;
onResetSearchForm?: (() => any) | undefined;
"onUpdate:selectedRowKeys"?: ((value: any[]) => any) | undefined;
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
}>, {
rowKey: string;
showSearchBtn: boolean;
deleteConfirmConfig: import('..').DeleteConfirmConfig;
formRowProps: import('antdv-next').RowProps;
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
stdForm: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
data?: Record<string, any>;
} & {
labelAlign?: "left" | "right";
columns: import('..').StdTableColumn[];
layout?: "horizontal" | "vertical" | "inline";
formClass?: StdCurdProps["formClass"];
formRowProps?: import('antdv-next').RowProps;
errors?: Record<string, string>;
mode?: "edit" | "add";
}> & Readonly<{
"onUpdate:data"?: ((value: Record<string, any>) => any) | undefined;
onValidate?: ((payload: {
name: string | number | (string | number)[];
status: boolean;
errors: any[] | null;
}) => any) | undefined;
}>, {
formRef: import('vue').Ref<import('antdv-next').FormInstance | undefined, import('antdv-next').FormInstance | undefined>;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
"update:data": (value: Record<string, any>) => any;
} & {
validate: (payload: {
name: string | number | (string | number)[];
status: boolean;
errors: any[] | null;
}) => any;
}, import('vue').PublicProps, {
formRowProps: import('antdv-next').RowProps;
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
formRef: import('vue').CreateComponentPublicInstanceWithMixins<import('antdv-next').FormProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, import('antdv-next').FormEmits, import('vue').PublicProps, {}, false, {}, import('vue').SlotsType<import('antdv-next').FormSlots>, {}, {}, string, {}, any, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, import('antdv-next').FormProps, {}, {}, {}, {}, {}> | null;
}, any, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<{
data?: Record<string, any>;
} & {
labelAlign?: "left" | "right";
columns: import('..').StdTableColumn[];
layout?: "horizontal" | "vertical" | "inline";
formClass?: StdCurdProps["formClass"];
formRowProps?: import('antdv-next').RowProps;
errors?: Record<string, string>;
mode?: "edit" | "add";
}> & Readonly<{
"onUpdate:data"?: ((value: Record<string, any>) => any) | undefined;
onValidate?: ((payload: {
name: string | number | (string | number)[];
status: boolean;
errors: any[] | null;
}) => any) | undefined;
}>, {
formRef: import('vue').Ref<import('antdv-next').FormInstance | undefined, import('antdv-next').FormInstance | undefined>;
}, {}, {}, {}, {
formRowProps: import('antdv-next').RowProps;
}> | null;
stdBatchEdit: ({
$: import('vue').ComponentInternalInstance;
$data: {};
$props: {
readonly api: import('../types/api').CurdApi;
readonly beforeSave?: (() => Promise<void>) | undefined;
readonly columns: import('..').StdTableColumn[];
readonly formClass?: string | undefined;
readonly formRowProps?: any;
readonly onSave?: ((...args: any[]) => any) | undefined;
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
$attrs: {
[x: string]: unknown;
};
$refs: {
[x: string]: unknown;
};
$slots: Readonly<{
[name: string]: Slot<any> | undefined;
}>;
$root: import('vue').ComponentPublicInstance | null;
$parent: import('vue').ComponentPublicInstance | null;
$host: Element | null;
$emit: (event: "save", ...args: any[]) => void;
$el: any;
$options: import('vue').ComponentOptionsBase<Readonly<{
api: import('../types/api').CurdApi;
beforeSave?: () => Promise<void>;
columns: import('..').StdTableColumn[];
formClass?: string;
formRowProps?: any;
}> & Readonly<{
onSave?: ((...args: any[]) => any) | undefined;
}>, {
showModal: (rowKeys: (number | string)[], rows: any[]) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
save: (...args: any[]) => void;
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
beforeCreate?: (() => void) | (() => void)[];
created?: (() => void) | (() => void)[];
beforeMount?: (() => void) | (() => void)[];
mounted?: (() => void) | (() => void)[];
beforeUpdate?: (() => void) | (() => void)[];
updated?: (() => void) | (() => void)[];
activated?: (() => void) | (() => void)[];
deactivated?: (() => void) | (() => void)[];
beforeDestroy?: (() => void) | (() => void)[];
beforeUnmount?: (() => void) | (() => void)[];
destroyed?: (() => void) | (() => void)[];
unmounted?: (() => void) | (() => void)[];
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
};
$forceUpdate: () => void;
$nextTick: typeof import('vue').nextTick;
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
} & Readonly<{}> & Omit<Readonly<{
api: import('../types/api').CurdApi;
beforeSave?: () => Promise<void>;
columns: import('..').StdTableColumn[];
formClass?: string;
formRowProps?: any;
}> & Readonly<{
onSave?: ((...args: any[]) => any) | undefined;
}>, "showModal"> & import('vue').ShallowUnwrapRef<{
showModal: (rowKeys: (number | string)[], rows: any[]) => void;
}> & {} & import('vue').ComponentCustomProperties & {} & {
$slots: {
extra?(_: {}): any;
};
}) | null;
}, HTMLDivElement>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};