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