mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-12 05:32:48 +00:00
dts
This commit is contained in:
parent
4d2815c39e
commit
d28ddd9c16
145
packages/crud/index.d.ts
vendored
145
packages/crud/index.d.ts
vendored
@ -143,6 +143,8 @@ declare namespace Render {
|
||||
}
|
||||
}
|
||||
|
||||
declare type PropKey<T> = Extract<keyof Required<T>, string>;
|
||||
|
||||
declare namespace ClCrud {
|
||||
interface Label {
|
||||
op: string;
|
||||
@ -323,7 +325,7 @@ declare namespace ClCrud {
|
||||
declare namespace ClTable {
|
||||
type OpButton = Array<"info" | "edit" | "delete" | Render.OpButton>;
|
||||
|
||||
interface Column {
|
||||
interface Column<T = any> {
|
||||
type: "index" | "selection" | "expand" | "op";
|
||||
hidden: boolean | Vue.Ref<boolean>;
|
||||
component: Render.Component;
|
||||
@ -332,31 +334,30 @@ declare namespace ClTable {
|
||||
value: any;
|
||||
component: Render.Component;
|
||||
};
|
||||
searchComponent: Render.Component;
|
||||
dict: DictOptions | Vue.Ref<DictOptions>;
|
||||
dictFormatter: (values: DictOptions) => string;
|
||||
dictColor: boolean;
|
||||
dictSeparator: string;
|
||||
dictAllLevels: boolean;
|
||||
buttons: OpButton | ((options: { scope: obj }) => OpButton);
|
||||
buttons: OpButton | ((options: { scope: T }) => OpButton);
|
||||
align: "left" | "center" | "right";
|
||||
label: string | Vue.Ref<string>;
|
||||
label: any;
|
||||
className: string;
|
||||
prop: string;
|
||||
prop: PropKey<T>;
|
||||
orderNum: number;
|
||||
width: number;
|
||||
minWidth: number | string;
|
||||
renderHeader: (options: { column: any; $index: number }) => any;
|
||||
sortable: boolean | "desc" | "descending" | "ascending" | "asc" | "custom";
|
||||
sortMethod: fn;
|
||||
sortBy: string | ((row: any, index: number) => any) | any[];
|
||||
sortBy: string | ((row: T, index: number) => any) | any[];
|
||||
resizable: boolean;
|
||||
columnKey: string;
|
||||
headerAlign: string;
|
||||
showOverflowTooltip: boolean;
|
||||
fixed: boolean | string;
|
||||
formatter: (row: any, column: any, value: any, index: number) => any;
|
||||
selectable: (row: any, index: number) => boolean;
|
||||
formatter: (row: T, column: any, value: any, index: number) => any;
|
||||
selectable: (row: T, index: number) => boolean;
|
||||
reserveSelection: boolean;
|
||||
filterMethod: fn;
|
||||
filteredValue: unknown[];
|
||||
@ -365,7 +366,7 @@ declare namespace ClTable {
|
||||
filterMultiple: boolean;
|
||||
index: ((index: number) => number) | number;
|
||||
sortOrders: unknown[];
|
||||
children: Column[];
|
||||
children: Column<T>[];
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@ -382,8 +383,8 @@ declare namespace ClTable {
|
||||
| "order-asc"
|
||||
>;
|
||||
|
||||
interface Config {
|
||||
columns: Column[];
|
||||
interface Config<T = any> {
|
||||
columns: Column<T>[];
|
||||
autoHeight: boolean;
|
||||
height: string | number;
|
||||
contextMenu: ContextMenu;
|
||||
@ -394,39 +395,39 @@ declare namespace ClTable {
|
||||
sortRefresh: boolean;
|
||||
emptyText: string;
|
||||
rowKey: string;
|
||||
onRowContextmenu?(row: any, column: any, event: any): void;
|
||||
onRowContextmenu?(row: T, column: any, event: any): void;
|
||||
}
|
||||
|
||||
interface Ref {
|
||||
interface Ref<T = any> {
|
||||
Table: any;
|
||||
config: obj;
|
||||
selection: obj[];
|
||||
data: obj[];
|
||||
columns: Column[];
|
||||
selection: T[];
|
||||
data: T[];
|
||||
columns: Column<T>[];
|
||||
reBuild(cb?: fn): void;
|
||||
calcMaxHeight(): void;
|
||||
setData(data: any[]): void;
|
||||
setData(data: T[]): void;
|
||||
setColumns(columns: Column[]): void;
|
||||
showColumn(props: string | string[], status?: boolean): void;
|
||||
hideColumn(props: string | string[]): void;
|
||||
changeSort(prop: string, order: string): void;
|
||||
showColumn(props: PropKey<T> | PropKey<T>[], status?: boolean): void;
|
||||
hideColumn(props: PropKey<T> | PropKey<T>[]): void;
|
||||
changeSort(prop: PropKey<T>, order: string): void;
|
||||
clearSelection(): void;
|
||||
getSelectionRows(): any[];
|
||||
toggleRowSelection(row: any, selected?: boolean): void;
|
||||
toggleRowSelection(row: T, selected?: boolean): void;
|
||||
toggleAllSelection(): void;
|
||||
toggleRowExpansion(row: any, expanded?: boolean): void;
|
||||
setCurrentRow(row: any): void;
|
||||
toggleRowExpansion(row: T, expanded?: boolean): void;
|
||||
setCurrentRow(row: T): void;
|
||||
clearSort(): void;
|
||||
clearFilter(columnKeys: string[]): void;
|
||||
clearFilter(columnKeys: PropKey<T>[]): void;
|
||||
doLayout(): void;
|
||||
sort(prop: string, order: string): void;
|
||||
sort(prop: PropKey<T>, order: string): void;
|
||||
scrollTo(position: { top?: number; left?: number }): void;
|
||||
setScrollTop(top: number): void;
|
||||
setScrollLeft(left: number): void;
|
||||
}
|
||||
|
||||
interface Options extends Config {
|
||||
columns: List<ClTable.Column>;
|
||||
interface Options<T = any> extends DeepPartial<Config<T>> {
|
||||
columns?: List<ClTable.Column<T>>;
|
||||
}
|
||||
}
|
||||
|
||||
@ -470,9 +471,9 @@ declare namespace ClForm {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface Item {
|
||||
interface Item<T = any> {
|
||||
type?: "tabs";
|
||||
prop?: string;
|
||||
prop?: PropKey<T>;
|
||||
props?: {
|
||||
labels?: ClFormTabs.labels;
|
||||
justify?: "left" | "center" | "right";
|
||||
@ -515,13 +516,6 @@ declare namespace ClForm {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
type Plugin = (options: {
|
||||
exposed: Ref;
|
||||
onOpen(cb: () => void): void;
|
||||
onClose(cb: () => void): void;
|
||||
onSubmit(cb: (data: obj) => obj): void;
|
||||
}) => void;
|
||||
|
||||
interface Config {
|
||||
title?: any;
|
||||
height?: string;
|
||||
@ -553,20 +547,23 @@ declare namespace ClForm {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
type Items = List<Item>;
|
||||
type Plugin = (options: {
|
||||
exposed: Ref;
|
||||
onOpen(cb: () => void): void;
|
||||
onClose(cb: () => void): void;
|
||||
onSubmit(cb: (data: obj) => obj): void;
|
||||
}) => void;
|
||||
|
||||
interface Options extends Config {
|
||||
items: Items;
|
||||
}
|
||||
type Items<T = any> = List<Item<T>>;
|
||||
|
||||
interface Ref {
|
||||
interface Ref<T = any> {
|
||||
Form: any;
|
||||
form: obj;
|
||||
form: T;
|
||||
config: {
|
||||
items: Item[];
|
||||
[key: string]: any;
|
||||
};
|
||||
open(options: DeepPartial<Options>, plugins?: Plugin[]): void;
|
||||
open(options: Options<T>, plugins?: Plugin[]): void;
|
||||
close(action?: CloseAction): void;
|
||||
done(): void;
|
||||
clear(): void;
|
||||
@ -596,72 +593,76 @@ declare namespace ClForm {
|
||||
submit(cb?: (data: obj) => void): void;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface Options<T = any> extends DeepPartial<Config> {
|
||||
items?: Items<T>;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace ClUpsert {
|
||||
interface Config {
|
||||
interface Config<T = obj> {
|
||||
sync: boolean;
|
||||
items: ClForm.Item[];
|
||||
props: ClForm.Config["props"];
|
||||
sync: boolean;
|
||||
op: ClForm.Config["op"];
|
||||
dialog: ClForm.Config["dialog"];
|
||||
onOpen?(data: obj): void;
|
||||
onOpened?(data: obj): void;
|
||||
onOpen?(): void;
|
||||
onOpened?(data: T): void;
|
||||
onClose?(action: ClForm.CloseAction, done: fn): void;
|
||||
onClosed?(): void;
|
||||
onInfo?(
|
||||
data: obj,
|
||||
event: { close: fn; done(data: obj): void; next: ClCrud.Service["api"]["info"] }
|
||||
data: T,
|
||||
event: { close: fn; done(data: T): void; next: ClCrud.Service["api"]["info"] }
|
||||
): void;
|
||||
onSubmit?(
|
||||
data: obj,
|
||||
data: T,
|
||||
event: { close: fn; done: fn; next: ClCrud.Service["api"]["update"] }
|
||||
): void;
|
||||
plugins?: ClForm.Plugin[];
|
||||
}
|
||||
|
||||
interface Ref extends ClForm.Ref {
|
||||
interface Ref<T = any> extends ClForm.Ref<T> {
|
||||
mode: "add" | "update" | "info";
|
||||
}
|
||||
|
||||
interface Options extends Config {
|
||||
items: List<ClForm.Item>;
|
||||
interface Options<T = any> extends DeepPartial<Config<T>> {
|
||||
items?: ClForm.Items<T>;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace ClAdvSearch {
|
||||
interface Config {
|
||||
interface Config<T = any> {
|
||||
items?: ClForm.Item[];
|
||||
title?: string;
|
||||
size?: string | number;
|
||||
op?: Array<"clear" | "reset" | "close" | "search">;
|
||||
onSearch?(data: obj, options: { next: ClCrud.Service["api"]["page"]; close(): void }): void;
|
||||
onSearch?(data: T, options: { next: ClCrud.Service["api"]["page"]; close(): void }): void;
|
||||
}
|
||||
|
||||
interface Options extends Config {
|
||||
items: ClForm.Items;
|
||||
}
|
||||
interface Ref<T = any> extends ClForm.Ref<T> {}
|
||||
|
||||
interface Ref extends ClForm.Ref {}
|
||||
interface Options<T = any> extends DeepPartial<Config<T>> {
|
||||
items?: ClForm.Items<T>;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace ClSearch {
|
||||
interface Config {
|
||||
interface Config<T = any> {
|
||||
items?: ClForm.Item[];
|
||||
data?: obj;
|
||||
data?: T;
|
||||
resetBtn?: boolean;
|
||||
onLoad?(data: obj): void;
|
||||
onSearch?(data: obj, options: { next: ClCrud.Service["api"]["page"] }): void;
|
||||
onLoad?(data: T): void;
|
||||
onSearch?(data: T, options: { next: ClCrud.Service["api"]["page"] }): void;
|
||||
}
|
||||
|
||||
interface Options extends Config {
|
||||
items: ClForm.Items;
|
||||
}
|
||||
|
||||
interface Ref extends ClForm.Ref {
|
||||
interface Ref<T = any> extends ClForm.Ref<T> {
|
||||
search(params?: obj): void;
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
interface Options<T = any> extends DeepPartial<Config<T>> {
|
||||
items?: ClForm.Items<T>;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace ClContextMenu {
|
||||
@ -748,3 +749,11 @@ declare type Options = DeepPartial<Config>;
|
||||
declare interface CrudOptions {
|
||||
options: Options;
|
||||
}
|
||||
|
||||
interface obj2 {
|
||||
[prop: string]: any;
|
||||
}
|
||||
|
||||
interface Item2<T = any2> {
|
||||
prop: keyof T;
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"tsc": "tsc --watch",
|
||||
"dist": "tsc && yarn build --target lib --name index ./src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@ -1,3 +1,66 @@
|
||||
<template>
|
||||
<div>CRUD v7.0.0</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useTable, useForm, useSearch, useUpsert, useAdvSearch } from "./hooks";
|
||||
// Test
|
||||
|
||||
interface Data {
|
||||
name?: string;
|
||||
age?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
const Table = useTable<Data>({
|
||||
columns: [
|
||||
{
|
||||
label: "xx",
|
||||
prop: "a"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const Form = useForm<Data>();
|
||||
|
||||
Form.value?.open({
|
||||
items: [
|
||||
{
|
||||
type: "tabs",
|
||||
prop: "age"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const Upsert = useUpsert<Data>({
|
||||
items: [
|
||||
{
|
||||
label: "xx",
|
||||
prop: "age"
|
||||
}
|
||||
],
|
||||
onOpened(data) {
|
||||
data.name = "";
|
||||
},
|
||||
onInfo(data) {},
|
||||
onSubmit(data) {}
|
||||
});
|
||||
|
||||
const Search = useSearch<Data>({
|
||||
items: [
|
||||
{
|
||||
label: "xx",
|
||||
prop: "age"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const AdvSearch = useAdvSearch<Data>({
|
||||
items: [
|
||||
{
|
||||
label: "xx",
|
||||
prop: "age"
|
||||
}
|
||||
]
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -34,6 +34,8 @@ export default defineComponent({
|
||||
onSearch: Function
|
||||
},
|
||||
|
||||
emits: ["reset"],
|
||||
|
||||
setup(props, { slots, expose, emit }) {
|
||||
const { crud } = useCore();
|
||||
const { style } = useConfig();
|
||||
|
||||
@ -143,9 +143,9 @@ export default defineComponent({
|
||||
dialog: config.dialog,
|
||||
items: config.items || [],
|
||||
on: {
|
||||
open(data) {
|
||||
open() {
|
||||
if (config.onOpen) {
|
||||
config.onOpen(data);
|
||||
config.onOpen();
|
||||
}
|
||||
|
||||
resolve(true);
|
||||
|
||||
@ -77,8 +77,8 @@ export function useCrud(options?: DeepPartial<ClCrud.Options>, cb?: (app: ClCrud
|
||||
}
|
||||
|
||||
// 新增、编辑
|
||||
export function useUpsert(options?: DeepPartial<ClUpsert.Options>) {
|
||||
const Upsert = ref<ClUpsert.Ref>();
|
||||
export function useUpsert<T>(options?: ClUpsert.Options<T>) {
|
||||
const Upsert = ref<ClUpsert.Ref<T>>();
|
||||
useParent("cl-upsert", Upsert);
|
||||
|
||||
if (options) {
|
||||
@ -109,8 +109,8 @@ export function useUpsert(options?: DeepPartial<ClUpsert.Options>) {
|
||||
}
|
||||
|
||||
// 表格
|
||||
export function useTable(options?: DeepPartial<ClTable.Options>) {
|
||||
const Table = ref<ClTable.Ref>();
|
||||
export function useTable<T = any>(options?: ClTable.Options<T>) {
|
||||
const Table = ref<ClTable.Ref<T>>();
|
||||
useParent("cl-table", Table);
|
||||
|
||||
if (options) {
|
||||
@ -121,8 +121,8 @@ export function useTable(options?: DeepPartial<ClTable.Options>) {
|
||||
}
|
||||
|
||||
// 表单
|
||||
export function useForm(cb?: (app: ClForm.Ref) => void) {
|
||||
const Form = ref<ClForm.Ref>();
|
||||
export function useForm<T = any>(cb?: (app: ClForm.Ref<T>) => void) {
|
||||
const Form = ref<ClForm.Ref<T>>();
|
||||
useParent("cl-form", Form);
|
||||
|
||||
nextTick(() => {
|
||||
@ -135,8 +135,8 @@ export function useForm(cb?: (app: ClForm.Ref) => void) {
|
||||
}
|
||||
|
||||
// 高级搜索
|
||||
export function useAdvSearch(options?: DeepPartial<ClAdvSearch.Options>) {
|
||||
const AdvSearch = ref<ClAdvSearch.Ref>();
|
||||
export function useAdvSearch<T = any>(options?: ClAdvSearch.Options<T>) {
|
||||
const AdvSearch = ref<ClAdvSearch.Ref<T>>();
|
||||
useParent("cl-adv-search", AdvSearch);
|
||||
|
||||
if (options) {
|
||||
@ -147,8 +147,8 @@ export function useAdvSearch(options?: DeepPartial<ClAdvSearch.Options>) {
|
||||
}
|
||||
|
||||
// 搜索
|
||||
export function useSearch(options?: DeepPartial<ClSearch.Options>) {
|
||||
const Search = ref<ClSearch.Ref>();
|
||||
export function useSearch<T = any>(options?: ClSearch.Options<T>) {
|
||||
const Search = ref<ClSearch.Ref<T>>();
|
||||
useParent("cl-search", Search);
|
||||
|
||||
if (options) {
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
/// <reference types="../index" />
|
||||
import { PropType } from "vue";
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
items: {
|
||||
type: PropType<ClForm.Item[]>;
|
||||
type: PropType<ClForm.Item<any>[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
title: StringConstructor;
|
||||
@ -17,7 +16,7 @@ declare const _default: import("vue").DefineComponent<{
|
||||
onSearch: FunctionConstructor;
|
||||
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "reset")[], "clear" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
items: {
|
||||
type: PropType<ClForm.Item[]>;
|
||||
type: PropType<ClForm.Item<any>[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
title: StringConstructor;
|
||||
@ -35,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
|
||||
onClear?: ((...args: any[]) => any) | undefined;
|
||||
}, {
|
||||
size: string | number;
|
||||
items: ClForm.Item[];
|
||||
items: ClForm.Item<any>[];
|
||||
op: unknown[];
|
||||
}, {}>;
|
||||
export default _default;
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/// <reference types="../index" />
|
||||
declare const ClContextMenu: import("vue").DefineComponent<{
|
||||
show: BooleanConstructor;
|
||||
options: {
|
||||
|
||||
@ -61,10 +61,10 @@ declare const _default: import("vue").DefineComponent<{
|
||||
title: string;
|
||||
padding: string;
|
||||
width: string;
|
||||
keepAlive: boolean;
|
||||
hideHeader: boolean;
|
||||
controls: unknown[];
|
||||
fullscreen: boolean;
|
||||
keepAlive: boolean;
|
||||
modelValue: boolean;
|
||||
}, {}>;
|
||||
export default _default;
|
||||
|
||||
@ -6,7 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
||||
default: () => never[];
|
||||
};
|
||||
justify: {
|
||||
type: PropType<"center" | "justify" | "left" | "right" | "end" | "start" | "match-parent">;
|
||||
type: PropType<"center" | "left" | "right" | "justify" | "end" | "start" | "match-parent">;
|
||||
default: string;
|
||||
};
|
||||
type: {
|
||||
@ -20,7 +20,7 @@ declare const _default: import("vue").DefineComponent<{
|
||||
default: () => never[];
|
||||
};
|
||||
justify: {
|
||||
type: PropType<"center" | "justify" | "left" | "right" | "end" | "start" | "match-parent">;
|
||||
type: PropType<"center" | "left" | "right" | "justify" | "end" | "start" | "match-parent">;
|
||||
default: string;
|
||||
};
|
||||
type: {
|
||||
@ -33,6 +33,6 @@ declare const _default: import("vue").DefineComponent<{
|
||||
}, {
|
||||
type: "default" | "card";
|
||||
labels: unknown[];
|
||||
justify: "center" | "justify" | "left" | "right" | "end" | "start" | "match-parent";
|
||||
justify: "center" | "left" | "right" | "justify" | "end" | "start" | "match-parent";
|
||||
}, {}>;
|
||||
export default _default;
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/// <reference types="../index" />
|
||||
export declare function useForm(): {
|
||||
Form: import("vue").Ref<any>;
|
||||
config: {
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/// <reference types="../index" />
|
||||
import { Ref } from "vue";
|
||||
export declare function usePlugins({ visible }: {
|
||||
visible: Ref<boolean>;
|
||||
|
||||
@ -7,7 +7,7 @@ export declare function useTabs({ config, Form }: {
|
||||
list: import("vue").ComputedRef<ClFormTabs.labels>;
|
||||
isLoaded: (value: any) => any;
|
||||
onLoad: (value: any) => void;
|
||||
get: () => ClForm.Item | undefined;
|
||||
get: () => ClForm.Item<any> | undefined;
|
||||
set: (data: any) => void;
|
||||
change: (value: any, isValid?: boolean) => Promise<unknown>;
|
||||
clear: () => void;
|
||||
|
||||
@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<{
|
||||
inner: BooleanConstructor;
|
||||
inline: BooleanConstructor;
|
||||
}>>, {
|
||||
inner: boolean;
|
||||
inline: boolean;
|
||||
inner: boolean;
|
||||
}, {}>;
|
||||
export default _default;
|
||||
|
||||
13
packages/crud/types/components/search/index.d.ts
vendored
13
packages/crud/types/components/search/index.d.ts
vendored
@ -1,4 +1,3 @@
|
||||
/// <reference types="../index" />
|
||||
import { PropType } from "vue";
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
data: {
|
||||
@ -6,7 +5,7 @@ declare const _default: import("vue").DefineComponent<{
|
||||
default: () => {};
|
||||
};
|
||||
items: {
|
||||
type: PropType<ClForm.Item[]>;
|
||||
type: PropType<ClForm.Item<any>[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
resetBtn: {
|
||||
@ -15,13 +14,13 @@ declare const _default: import("vue").DefineComponent<{
|
||||
};
|
||||
onLoad: FunctionConstructor;
|
||||
onSearch: FunctionConstructor;
|
||||
}, () => true | JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
}, () => true | JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reset"[], "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
data: {
|
||||
type: ObjectConstructor;
|
||||
default: () => {};
|
||||
};
|
||||
items: {
|
||||
type: PropType<ClForm.Item[]>;
|
||||
type: PropType<ClForm.Item<any>[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
resetBtn: {
|
||||
@ -30,8 +29,10 @@ declare const _default: import("vue").DefineComponent<{
|
||||
};
|
||||
onLoad: FunctionConstructor;
|
||||
onSearch: FunctionConstructor;
|
||||
}>>, {
|
||||
items: ClForm.Item[];
|
||||
}>> & {
|
||||
onReset?: ((...args: any[]) => any) | undefined;
|
||||
}, {
|
||||
items: ClForm.Item<any>[];
|
||||
data: Record<string, any>;
|
||||
resetBtn: boolean;
|
||||
}, {}>;
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/// <reference types="../index" />
|
||||
export declare function useTable(props: any): {
|
||||
Table: import("vue").Ref<any>;
|
||||
config: {
|
||||
@ -74,37 +73,6 @@ export declare function useTable(props: any): {
|
||||
vm?: any;
|
||||
};
|
||||
};
|
||||
searchComponent: {
|
||||
[x: string]: any;
|
||||
name?: string | undefined;
|
||||
options?: {
|
||||
[x: string]: any;
|
||||
label?: string | undefined;
|
||||
value?: any;
|
||||
color?: string | undefined;
|
||||
type?: string | undefined;
|
||||
}[] | {
|
||||
value: {
|
||||
[x: string]: any;
|
||||
label?: string | undefined;
|
||||
value?: any;
|
||||
color?: string | undefined;
|
||||
type?: string | undefined;
|
||||
}[];
|
||||
} | undefined;
|
||||
props?: {
|
||||
[x: string]: any;
|
||||
onChange?: ((value: any) => void) | undefined;
|
||||
} | {
|
||||
value: {
|
||||
[x: string]: any;
|
||||
onChange?: ((value: any) => void) | undefined;
|
||||
};
|
||||
} | undefined;
|
||||
style?: obj | undefined;
|
||||
functionSlot?: boolean | undefined;
|
||||
vm?: any;
|
||||
};
|
||||
dict: {
|
||||
[x: string]: any;
|
||||
label?: string | undefined;
|
||||
@ -125,7 +93,7 @@ export declare function useTable(props: any): {
|
||||
dictSeparator: string;
|
||||
dictAllLevels: boolean;
|
||||
buttons: ((options: {
|
||||
scope: obj;
|
||||
scope: any;
|
||||
}) => ClTable.OpButton) | ("info" | "delete" | "edit" | `slot-${string}` | {
|
||||
[x: string]: any;
|
||||
label: string;
|
||||
@ -136,9 +104,7 @@ export declare function useTable(props: any): {
|
||||
}) => void;
|
||||
})[];
|
||||
align: "center" | "left" | "right";
|
||||
label: string | {
|
||||
value: string;
|
||||
};
|
||||
label: any;
|
||||
className: string;
|
||||
prop: string;
|
||||
orderNum: number;
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/// <reference types="../index" />
|
||||
export declare function useRender(): {
|
||||
renderColumn: (columns: ClTable.Column[]) => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
|
||||
@ -32,7 +32,7 @@ declare const _default: import("vue").DefineComponent<{
|
||||
onOpened?: ((...args: any[]) => any) | undefined;
|
||||
onClosed?: ((...args: any[]) => any) | undefined;
|
||||
}, {
|
||||
items: unknown[];
|
||||
sync: boolean;
|
||||
items: unknown[];
|
||||
}, {}>;
|
||||
export default _default;
|
||||
|
||||
10
packages/crud/types/hooks/crud.d.ts
vendored
10
packages/crud/types/hooks/crud.d.ts
vendored
@ -1,11 +1,11 @@
|
||||
/// <reference types="../index" />
|
||||
import { Ref } from "vue";
|
||||
export declare function useCrud(options?: DeepPartial<ClCrud.Options>, cb?: (app: ClCrud.Ref) => void): Ref<ClCrud.Ref | undefined>;
|
||||
export declare function useUpsert(options?: DeepPartial<ClUpsert.Options>): Ref<ClUpsert.Ref | undefined>;
|
||||
export declare function useTable(options?: DeepPartial<ClTable.Options>): Ref<ClTable.Ref | undefined>;
|
||||
export declare function useForm(cb?: (app: ClForm.Ref) => void): Ref<ClForm.Ref | undefined>;
|
||||
export declare function useAdvSearch(options?: DeepPartial<ClAdvSearch.Options>): Ref<ClAdvSearch.Ref | undefined>;
|
||||
export declare function useSearch(options?: DeepPartial<ClSearch.Options>): Ref<ClSearch.Ref | undefined>;
|
||||
export declare function useUpsert<T>(options?: ClUpsert.Options<T>): Ref<ClUpsert.Ref<T> | undefined>;
|
||||
export declare function useTable<T = any>(options?: ClTable.Options<T>): Ref<ClTable.Ref<T> | undefined>;
|
||||
export declare function useForm<T = any>(cb?: (app: ClForm.Ref<T>) => void): Ref<ClForm.Ref<T> | undefined>;
|
||||
export declare function useAdvSearch<T = any>(options?: ClAdvSearch.Options<T>): Ref<ClAdvSearch.Ref<T> | undefined>;
|
||||
export declare function useSearch<T = any>(options?: ClSearch.Options<T>): Ref<ClSearch.Ref<T> | undefined>;
|
||||
export declare function useDialog(options?: {
|
||||
onFullscreen(visible: boolean): void;
|
||||
}): ClDialog.Provide;
|
||||
|
||||
1
packages/crud/types/index.d.ts
vendored
1
packages/crud/types/index.d.ts
vendored
@ -1,4 +1,3 @@
|
||||
/// <reference types="../index" />
|
||||
import { App } from "vue";
|
||||
import "./static/index.scss";
|
||||
declare const Crud: {
|
||||
|
||||
@ -12,9 +12,10 @@
|
||||
"lib": ["esnext", "dom", "WebWorker"],
|
||||
"types": ["vite/client", "element-plus/global"],
|
||||
"paths": {
|
||||
"/$/*": ["./src/modules/*"],
|
||||
"/@/*": ["./src/*"],
|
||||
"/#/*": ["./types/*"]
|
||||
"/$/*": ["./src/modules/*"],
|
||||
"/#/*": ["./types/*"],
|
||||
"/~/*": ["./packages/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "env.d.ts"],
|
||||
|
||||
@ -47,12 +47,13 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
||||
resolve: {
|
||||
alias: {
|
||||
"/@": resolve("src"),
|
||||
"/$": resolve("src/modules"),
|
||||
"/#": resolve("types"),
|
||||
"/$": resolve("src/modules")
|
||||
"/~": resolve("packages")
|
||||
}
|
||||
},
|
||||
esbuild: {
|
||||
drop: isDev(mode) ? [] : ["console", "debugger"],
|
||||
drop: isDev(mode) ? [] : ["console", "debugger"]
|
||||
},
|
||||
build: {
|
||||
minify: "esbuild",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user