@mc-markets/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +502 -0
- package/dist/index.js +23 -0
- package/dist/packages/components/Dialog/index.vue.d.ts +51 -0
- package/dist/packages/components/Grid/components/GridItem.vue.d.ts +37 -0
- package/dist/packages/components/Grid/index.vue.d.ts +31 -0
- package/dist/packages/components/Grid/interface/index.d.ts +5 -0
- package/dist/packages/components/Icon/index.vue.d.ts +2 -0
- package/dist/packages/components/SearchBar/index.vue.d.ts +42 -0
- package/dist/packages/components/SearchForm/components/SearchFormItem.vue.d.ts +24 -0
- package/dist/packages/components/SearchForm/index.vue.d.ts +3019 -0
- package/dist/packages/components/proForm/components/FormItem.vue.d.ts +46 -0
- package/dist/packages/components/proForm/components/interface/index.d.ts +66 -0
- package/dist/packages/components/proForm/index.vue.d.ts +230 -0
- package/dist/packages/components/proTable/components/ColSetting.vue.d.ts +8 -0
- package/dist/packages/components/proTable/components/Pagination.vue.d.ts +17 -0
- package/dist/packages/components/proTable/components/TableColumn.vue.d.ts +6 -0
- package/dist/packages/components/proTable/interface/index.d.ts +66 -0
- package/dist/packages/hooks/interface/index.d.ts +28 -0
- package/dist/packages/hooks/useSelection.d.ts +16 -0
- package/dist/packages/hooks/useTable.d.ts +54 -0
- package/dist/packages/index.d.ts +24 -0
- package/dist/packages/utils/common.d.ts +13 -0
- package/dist/packages/utils/composables/useGlobalProperties.d.ts +1 -0
- package/dist/packages/utils/dayjs.d.ts +2 -0
- package/dist/packages/utils/directive.d.ts +2 -0
- package/dist/packages/utils/eventBus.d.ts +2 -0
- package/dist/packages/utils/index.d.ts +152 -0
- package/dist/packages/utils/is/index.d.ts +72 -0
- package/dist/packages/utils/validate.d.ts +112 -0
- package/dist/src/api/index.d.ts +24 -0
- package/dist/src/api/interface/index.d.ts +34 -0
- package/dist/src/api/test.d.ts +1 -0
- package/dist/src/main.d.ts +0 -0
- package/dist/style.css +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +151 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { EnumProps } from './interface';
|
|
3
|
+
interface FormItemColumn {
|
|
4
|
+
el?: string;
|
|
5
|
+
render?: any;
|
|
6
|
+
props?: Record<string, any>;
|
|
7
|
+
on?: Record<string, any>;
|
|
8
|
+
options?: any[];
|
|
9
|
+
enum?: EnumProps[] | Ref<EnumProps[]> | ((params?: any) => Promise<any>);
|
|
10
|
+
fieldNames?: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
children?: string;
|
|
14
|
+
};
|
|
15
|
+
label?: string;
|
|
16
|
+
defaultValue?: any;
|
|
17
|
+
}
|
|
18
|
+
interface FormItem {
|
|
19
|
+
column: FormItemColumn;
|
|
20
|
+
formData: Record<string, any>;
|
|
21
|
+
}
|
|
22
|
+
type __VLS_Props = FormItem;
|
|
23
|
+
type __VLS_PublicProps = {
|
|
24
|
+
modelValue?: any;
|
|
25
|
+
} & __VLS_Props;
|
|
26
|
+
declare function __VLS_template(): {
|
|
27
|
+
attrs: Partial<{}>;
|
|
28
|
+
slots: {
|
|
29
|
+
default?(_: {}): any;
|
|
30
|
+
};
|
|
31
|
+
refs: {};
|
|
32
|
+
rootEl: any;
|
|
33
|
+
};
|
|
34
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
35
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
36
|
+
"update:modelValue": (value: any) => any;
|
|
37
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
38
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
39
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { VNode, ComponentPublicInstance, Ref } from 'vue';
|
|
2
|
+
import { BreakPoint, Responsive } from '../../../Grid/interface';
|
|
3
|
+
import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults';
|
|
4
|
+
import { DefaultRow } from 'element-plus/es/components/table/src/table/defaults';
|
|
5
|
+
import { default as ProTable } from '../../../proTable/index.vue';
|
|
6
|
+
export interface EnumProps {
|
|
7
|
+
label?: string;
|
|
8
|
+
value?: string | number | boolean | any[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
tagType?: string;
|
|
11
|
+
children?: EnumProps[];
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export type TypeProps = "index" | "selection" | "radio" | "expand" | "sort";
|
|
15
|
+
export type SearchType = "input" | "input-number" | "select" | "select-v2" | "tree-select" | "cascader" | "date-picker" | "time-picker" | "time-select" | "switch" | "slider";
|
|
16
|
+
export type SearchRenderScope = {
|
|
17
|
+
searchParam: {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
20
|
+
placeholder: string;
|
|
21
|
+
clearable: boolean;
|
|
22
|
+
options: EnumProps[];
|
|
23
|
+
data: EnumProps[];
|
|
24
|
+
};
|
|
25
|
+
export type SearchProps = {
|
|
26
|
+
el?: SearchType;
|
|
27
|
+
label?: string;
|
|
28
|
+
props?: any;
|
|
29
|
+
key?: string;
|
|
30
|
+
tooltip?: string;
|
|
31
|
+
order?: number;
|
|
32
|
+
span?: number;
|
|
33
|
+
offset?: number;
|
|
34
|
+
defaultValue?: string | number | boolean | any[] | Ref<any>;
|
|
35
|
+
render?: (scope: SearchRenderScope) => VNode;
|
|
36
|
+
} & Partial<Record<BreakPoint, Responsive>>;
|
|
37
|
+
export type FieldNamesProps = {
|
|
38
|
+
label: string;
|
|
39
|
+
value: string;
|
|
40
|
+
children?: string;
|
|
41
|
+
};
|
|
42
|
+
export type RenderScope<T extends DefaultRow = DefaultRow> = {
|
|
43
|
+
row: T;
|
|
44
|
+
$index: number;
|
|
45
|
+
column: TableColumnCtx<T>;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
export type HeaderRenderScope<T extends DefaultRow = DefaultRow> = {
|
|
49
|
+
$index: number;
|
|
50
|
+
column: TableColumnCtx<T>;
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
};
|
|
53
|
+
export interface ColumnProps<T extends DefaultRow = DefaultRow> extends Partial<Omit<TableColumnCtx<T>, "type" | "children" | "renderCell" | "renderHeader">> {
|
|
54
|
+
type?: TypeProps;
|
|
55
|
+
tag?: boolean | Ref<boolean>;
|
|
56
|
+
isShow?: boolean | Ref<boolean>;
|
|
57
|
+
isSetting?: boolean | Ref<boolean>;
|
|
58
|
+
search?: SearchProps | undefined;
|
|
59
|
+
enum?: EnumProps[] | Ref<EnumProps[]> | ((params?: any) => Promise<any>);
|
|
60
|
+
isFilterEnum?: boolean | Ref<boolean>;
|
|
61
|
+
fieldNames?: FieldNamesProps;
|
|
62
|
+
headerRender?: (scope: HeaderRenderScope<T>) => VNode;
|
|
63
|
+
render?: (scope: RenderScope<T>) => VNode | string;
|
|
64
|
+
_children?: ColumnProps<T>[];
|
|
65
|
+
}
|
|
66
|
+
export type ProTableInstance = Omit<InstanceType<typeof ProTable>, keyof ComponentPublicInstance>;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { FormInstance } from 'element-plus';
|
|
2
|
+
import { BreakPoint } from '../Grid/interface';
|
|
3
|
+
interface FormItemColumn {
|
|
4
|
+
el?: string;
|
|
5
|
+
render?: any;
|
|
6
|
+
props?: any;
|
|
7
|
+
on?: any;
|
|
8
|
+
options?: any[];
|
|
9
|
+
fieldNames?: {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
children?: string;
|
|
13
|
+
};
|
|
14
|
+
label?: string;
|
|
15
|
+
defaultValue?: any;
|
|
16
|
+
span?: number;
|
|
17
|
+
offset?: number;
|
|
18
|
+
xs?: number;
|
|
19
|
+
sm?: number;
|
|
20
|
+
md?: number;
|
|
21
|
+
lg?: number;
|
|
22
|
+
xl?: number;
|
|
23
|
+
solt?: string;
|
|
24
|
+
formItem?: any;
|
|
25
|
+
show?: (modelValue: any) => boolean;
|
|
26
|
+
}
|
|
27
|
+
interface formProps {
|
|
28
|
+
formJson: {
|
|
29
|
+
config?: any;
|
|
30
|
+
rules?: any;
|
|
31
|
+
fields: Record<string, FormItemColumn>;
|
|
32
|
+
};
|
|
33
|
+
formCol: number | Record<BreakPoint, number>;
|
|
34
|
+
gap?: [number, number] | number;
|
|
35
|
+
}
|
|
36
|
+
type __VLS_Props = formProps;
|
|
37
|
+
type __VLS_PublicProps = {
|
|
38
|
+
modelValue?: any;
|
|
39
|
+
} & __VLS_Props;
|
|
40
|
+
declare function __VLS_template(): {
|
|
41
|
+
attrs: Partial<{}>;
|
|
42
|
+
slots: Partial<Record<string, (_: {}) => any>> & {
|
|
43
|
+
default?(_: {}): any;
|
|
44
|
+
};
|
|
45
|
+
refs: {
|
|
46
|
+
formRef: unknown;
|
|
47
|
+
gridRef: {
|
|
48
|
+
$: import('vue').ComponentInternalInstance;
|
|
49
|
+
$data: {};
|
|
50
|
+
$props: Partial<{
|
|
51
|
+
cols: number | Record<BreakPoint, number>;
|
|
52
|
+
collapsed: boolean;
|
|
53
|
+
collapsedRows: number;
|
|
54
|
+
gap: [number, number] | number;
|
|
55
|
+
}> & Omit<{
|
|
56
|
+
readonly cols?: number | Record<BreakPoint, number>;
|
|
57
|
+
readonly collapsed?: boolean;
|
|
58
|
+
readonly collapsedRows?: number;
|
|
59
|
+
readonly gap?: [number, number] | number;
|
|
60
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "cols" | "collapsed" | "collapsedRows" | "gap">;
|
|
61
|
+
$attrs: {
|
|
62
|
+
[x: string]: unknown;
|
|
63
|
+
};
|
|
64
|
+
$refs: {
|
|
65
|
+
[x: string]: unknown;
|
|
66
|
+
};
|
|
67
|
+
$slots: Readonly<{
|
|
68
|
+
[name: string]: import('vue').Slot<any>;
|
|
69
|
+
}>;
|
|
70
|
+
$root: ComponentPublicInstance | null;
|
|
71
|
+
$parent: ComponentPublicInstance | null;
|
|
72
|
+
$host: Element | null;
|
|
73
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
74
|
+
$el: HTMLDivElement;
|
|
75
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
76
|
+
cols?: number | Record<BreakPoint, number>;
|
|
77
|
+
collapsed?: boolean;
|
|
78
|
+
collapsedRows?: number;
|
|
79
|
+
gap?: [number, number] | number;
|
|
80
|
+
}> & Readonly<{}>, {
|
|
81
|
+
breakPoint: globalThis.Ref<BreakPoint, BreakPoint>;
|
|
82
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
83
|
+
cols: number | Record<BreakPoint, number>;
|
|
84
|
+
collapsed: boolean;
|
|
85
|
+
collapsedRows: number;
|
|
86
|
+
gap: [number, number] | number;
|
|
87
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
88
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
89
|
+
created?: (() => void) | (() => void)[];
|
|
90
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
91
|
+
mounted?: (() => void) | (() => void)[];
|
|
92
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
93
|
+
updated?: (() => void) | (() => void)[];
|
|
94
|
+
activated?: (() => void) | (() => void)[];
|
|
95
|
+
deactivated?: (() => void) | (() => void)[];
|
|
96
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
97
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
98
|
+
destroyed?: (() => void) | (() => void)[];
|
|
99
|
+
unmounted?: (() => void) | (() => void)[];
|
|
100
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
101
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
102
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
103
|
+
};
|
|
104
|
+
$forceUpdate: () => void;
|
|
105
|
+
$nextTick: typeof import('vue').nextTick;
|
|
106
|
+
$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;
|
|
107
|
+
} & Readonly<{
|
|
108
|
+
cols: number | Record<BreakPoint, number>;
|
|
109
|
+
collapsed: boolean;
|
|
110
|
+
collapsedRows: number;
|
|
111
|
+
gap: [number, number] | number;
|
|
112
|
+
}> & Omit<Readonly<{
|
|
113
|
+
cols?: number | Record<BreakPoint, number>;
|
|
114
|
+
collapsed?: boolean;
|
|
115
|
+
collapsedRows?: number;
|
|
116
|
+
gap?: [number, number] | number;
|
|
117
|
+
}> & Readonly<{}>, "breakPoint" | ("cols" | "collapsed" | "collapsedRows" | "gap")> & import('vue').ShallowUnwrapRef<{
|
|
118
|
+
breakPoint: globalThis.Ref<BreakPoint, BreakPoint>;
|
|
119
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
120
|
+
$slots: {
|
|
121
|
+
default?(_: {}): any;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
rootEl: any;
|
|
126
|
+
};
|
|
127
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
128
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
129
|
+
validate: (callBack: (valid: boolean, fields?: any) => void) => void;
|
|
130
|
+
resetFields: () => void;
|
|
131
|
+
formRef: globalThis.Ref<FormInstance, FormInstance>;
|
|
132
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
133
|
+
"update:modelValue": (value: any) => any;
|
|
134
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
135
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
136
|
+
}>, {
|
|
137
|
+
gap: [number, number] | number;
|
|
138
|
+
formJson: {
|
|
139
|
+
config?: any;
|
|
140
|
+
rules?: any;
|
|
141
|
+
fields: Record<string, FormItemColumn>;
|
|
142
|
+
};
|
|
143
|
+
formCol: number | Record<BreakPoint, number>;
|
|
144
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
145
|
+
formRef: unknown;
|
|
146
|
+
gridRef: {
|
|
147
|
+
$: import('vue').ComponentInternalInstance;
|
|
148
|
+
$data: {};
|
|
149
|
+
$props: Partial<{
|
|
150
|
+
cols: number | Record<BreakPoint, number>;
|
|
151
|
+
collapsed: boolean;
|
|
152
|
+
collapsedRows: number;
|
|
153
|
+
gap: [number, number] | number;
|
|
154
|
+
}> & Omit<{
|
|
155
|
+
readonly cols?: number | Record<BreakPoint, number>;
|
|
156
|
+
readonly collapsed?: boolean;
|
|
157
|
+
readonly collapsedRows?: number;
|
|
158
|
+
readonly gap?: [number, number] | number;
|
|
159
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "cols" | "collapsed" | "collapsedRows" | "gap">;
|
|
160
|
+
$attrs: {
|
|
161
|
+
[x: string]: unknown;
|
|
162
|
+
};
|
|
163
|
+
$refs: {
|
|
164
|
+
[x: string]: unknown;
|
|
165
|
+
};
|
|
166
|
+
$slots: Readonly<{
|
|
167
|
+
[name: string]: import('vue').Slot<any>;
|
|
168
|
+
}>;
|
|
169
|
+
$root: ComponentPublicInstance | null;
|
|
170
|
+
$parent: ComponentPublicInstance | null;
|
|
171
|
+
$host: Element | null;
|
|
172
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
173
|
+
$el: HTMLDivElement;
|
|
174
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
175
|
+
cols?: number | Record<BreakPoint, number>;
|
|
176
|
+
collapsed?: boolean;
|
|
177
|
+
collapsedRows?: number;
|
|
178
|
+
gap?: [number, number] | number;
|
|
179
|
+
}> & Readonly<{}>, {
|
|
180
|
+
breakPoint: globalThis.Ref<BreakPoint, BreakPoint>;
|
|
181
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
182
|
+
cols: number | Record<BreakPoint, number>;
|
|
183
|
+
collapsed: boolean;
|
|
184
|
+
collapsedRows: number;
|
|
185
|
+
gap: [number, number] | number;
|
|
186
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
187
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
188
|
+
created?: (() => void) | (() => void)[];
|
|
189
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
190
|
+
mounted?: (() => void) | (() => void)[];
|
|
191
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
192
|
+
updated?: (() => void) | (() => void)[];
|
|
193
|
+
activated?: (() => void) | (() => void)[];
|
|
194
|
+
deactivated?: (() => void) | (() => void)[];
|
|
195
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
196
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
197
|
+
destroyed?: (() => void) | (() => void)[];
|
|
198
|
+
unmounted?: (() => void) | (() => void)[];
|
|
199
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
200
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
201
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
202
|
+
};
|
|
203
|
+
$forceUpdate: () => void;
|
|
204
|
+
$nextTick: typeof import('vue').nextTick;
|
|
205
|
+
$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;
|
|
206
|
+
} & Readonly<{
|
|
207
|
+
cols: number | Record<BreakPoint, number>;
|
|
208
|
+
collapsed: boolean;
|
|
209
|
+
collapsedRows: number;
|
|
210
|
+
gap: [number, number] | number;
|
|
211
|
+
}> & Omit<Readonly<{
|
|
212
|
+
cols?: number | Record<BreakPoint, number>;
|
|
213
|
+
collapsed?: boolean;
|
|
214
|
+
collapsedRows?: number;
|
|
215
|
+
gap?: [number, number] | number;
|
|
216
|
+
}> & Readonly<{}>, "breakPoint" | ("cols" | "collapsed" | "collapsedRows" | "gap")> & import('vue').ShallowUnwrapRef<{
|
|
217
|
+
breakPoint: globalThis.Ref<BreakPoint, BreakPoint>;
|
|
218
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
219
|
+
$slots: {
|
|
220
|
+
default?(_: {}): any;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
}, any>;
|
|
224
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
225
|
+
export default _default;
|
|
226
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
227
|
+
new (): {
|
|
228
|
+
$slots: S;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColumnProps } from '../interface';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
colSetting: ColumnProps[];
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
6
|
+
openColSetting: () => void;
|
|
7
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Pageable {
|
|
2
|
+
pageNum: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
total: number;
|
|
5
|
+
size: "default" | "small" | "large";
|
|
6
|
+
pageField?: string;
|
|
7
|
+
sizeField?: string;
|
|
8
|
+
totalField?: string;
|
|
9
|
+
listField?: string;
|
|
10
|
+
}
|
|
11
|
+
interface PaginationProps {
|
|
12
|
+
pageable: Pageable;
|
|
13
|
+
handleSizeChange: (size: number) => void;
|
|
14
|
+
handleCurrentChange: (currentPage: number) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import('vue').DefineComponent<PaginationProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PaginationProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ColumnProps } from '../interface';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
column: ColumnProps;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { VNode, ComponentPublicInstance, Ref } from 'vue';
|
|
2
|
+
import { BreakPoint, Responsive } from '../../Grid/interface';
|
|
3
|
+
import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults';
|
|
4
|
+
import { DefaultRow } from 'element-plus/es/components/table/src/table/defaults';
|
|
5
|
+
import { default as ProTable } from '../index.vue';
|
|
6
|
+
export interface EnumProps {
|
|
7
|
+
label?: string;
|
|
8
|
+
value?: string | number | boolean | any[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
tagType?: string;
|
|
11
|
+
children?: EnumProps[];
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export type TypeProps = "index" | "selection" | "radio" | "expand" | "sort";
|
|
15
|
+
export type SearchType = "input" | "input-number" | "select" | "select-v2" | "tree-select" | "cascader" | "date-picker" | "time-picker" | "time-select" | "switch" | "slider";
|
|
16
|
+
export type SearchRenderScope = {
|
|
17
|
+
searchParam: {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
20
|
+
placeholder: string;
|
|
21
|
+
clearable: boolean;
|
|
22
|
+
options: EnumProps[];
|
|
23
|
+
data: EnumProps[];
|
|
24
|
+
};
|
|
25
|
+
export type SearchProps = {
|
|
26
|
+
el?: SearchType;
|
|
27
|
+
label?: string;
|
|
28
|
+
props?: any;
|
|
29
|
+
key?: string;
|
|
30
|
+
tooltip?: string;
|
|
31
|
+
order?: number;
|
|
32
|
+
span?: number;
|
|
33
|
+
offset?: number;
|
|
34
|
+
defaultValue?: string | number | boolean | any[] | Ref<any>;
|
|
35
|
+
render?: (scope: SearchRenderScope) => VNode;
|
|
36
|
+
} & Partial<Record<BreakPoint, Responsive>>;
|
|
37
|
+
export type FieldNamesProps = {
|
|
38
|
+
label: string;
|
|
39
|
+
value: string;
|
|
40
|
+
children?: string;
|
|
41
|
+
};
|
|
42
|
+
export type RenderScope<T extends DefaultRow = DefaultRow> = {
|
|
43
|
+
row: T;
|
|
44
|
+
$index: number;
|
|
45
|
+
column: TableColumnCtx<T>;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
export type HeaderRenderScope<T extends DefaultRow = DefaultRow> = {
|
|
49
|
+
$index: number;
|
|
50
|
+
column: TableColumnCtx<T>;
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
};
|
|
53
|
+
export interface ColumnProps<T extends DefaultRow = DefaultRow> extends Partial<Omit<TableColumnCtx<T>, "type" | "children" | "renderCell" | "renderHeader">> {
|
|
54
|
+
type?: TypeProps;
|
|
55
|
+
tag?: boolean | Ref<boolean>;
|
|
56
|
+
isShow?: boolean | Ref<boolean>;
|
|
57
|
+
isSetting?: boolean | Ref<boolean>;
|
|
58
|
+
search?: SearchProps | undefined;
|
|
59
|
+
enum?: EnumProps[] | Ref<EnumProps[]> | ((params?: any) => Promise<any>);
|
|
60
|
+
isFilterEnum?: boolean | Ref<boolean>;
|
|
61
|
+
fieldNames?: FieldNamesProps;
|
|
62
|
+
headerRender?: (scope: HeaderRenderScope<T>) => VNode;
|
|
63
|
+
render?: (scope: RenderScope<T>) => VNode | string;
|
|
64
|
+
_children?: ColumnProps<T>[];
|
|
65
|
+
}
|
|
66
|
+
export type ProTableInstance = Omit<InstanceType<typeof ProTable>, keyof ComponentPublicInstance>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare namespace Table {
|
|
2
|
+
interface Pageable {
|
|
3
|
+
pageNum: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
total: number;
|
|
6
|
+
size: "default" | "small" | "large";
|
|
7
|
+
pageField?: string;
|
|
8
|
+
sizeField?: string;
|
|
9
|
+
totalField?: string;
|
|
10
|
+
listField?: string;
|
|
11
|
+
}
|
|
12
|
+
interface TableStateProps {
|
|
13
|
+
tableData: any[];
|
|
14
|
+
pageable: Pageable;
|
|
15
|
+
searchParam: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
searchInitParam: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
totalParam: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
icon?: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 表格多选数据操作
|
|
3
|
+
* @param {String} rowKey 当表格可以多选时,所指定的 id
|
|
4
|
+
* */
|
|
5
|
+
export declare function useSelection(rowKey?: string): {
|
|
6
|
+
isSelected: globalThis.Ref<boolean, boolean>;
|
|
7
|
+
selectedList: globalThis.Ref<{
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}[], {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}[]>;
|
|
12
|
+
selectedListIds: globalThis.ComputedRef<string[]>;
|
|
13
|
+
selectionChange: (rowArr: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}[]) => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const useTable: (api?: (params: any) => Promise<any>, initParam?: object, isPageable?: boolean, paginationInit?: Record<string, any>, paginationFields?: {
|
|
2
|
+
page?: string;
|
|
3
|
+
size?: string;
|
|
4
|
+
total?: string;
|
|
5
|
+
list?: string;
|
|
6
|
+
}, dataCallBack?: (data: any) => any, requestError?: (error: any) => void) => {
|
|
7
|
+
getTableList: () => Promise<void>;
|
|
8
|
+
search: () => void;
|
|
9
|
+
reset: () => void;
|
|
10
|
+
handleSizeChange: (val: number) => void;
|
|
11
|
+
handleCurrentChange: (val: number) => void;
|
|
12
|
+
updatedTotalParam: () => void;
|
|
13
|
+
initSearchParams: (defaultParams?: Record<string, any>) => void;
|
|
14
|
+
tableData: globalThis.Ref<any[], any[]>;
|
|
15
|
+
pageable: globalThis.Ref<{
|
|
16
|
+
pageNum: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
total: number;
|
|
19
|
+
size: "default" | "small" | "large";
|
|
20
|
+
pageField?: string;
|
|
21
|
+
sizeField?: string;
|
|
22
|
+
totalField?: string;
|
|
23
|
+
listField?: string;
|
|
24
|
+
}, {
|
|
25
|
+
pageNum: number;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
total: number;
|
|
28
|
+
size: "default" | "small" | "large";
|
|
29
|
+
pageField?: string;
|
|
30
|
+
sizeField?: string;
|
|
31
|
+
totalField?: string;
|
|
32
|
+
listField?: string;
|
|
33
|
+
}>;
|
|
34
|
+
searchParam: globalThis.Ref<{
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}, {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}>;
|
|
39
|
+
searchInitParam: globalThis.Ref<{
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}, {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}>;
|
|
44
|
+
totalParam: globalThis.Ref<{
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}, {
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
}>;
|
|
49
|
+
icon?: globalThis.Ref<{
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}, {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}>;
|
|
54
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
export * from './types/index.d';
|
|
3
|
+
export { default as ProTable } from './components/proTable/index.vue';
|
|
4
|
+
export { default as SearchForm } from './components/SearchForm/index.vue';
|
|
5
|
+
export { default as SearchFormItem } from './components/SearchForm/components/SearchFormItem.vue';
|
|
6
|
+
export { default as ProForm } from './components/proForm/index.vue';
|
|
7
|
+
export { default as FormItem } from './components/proForm/components/FormItem.vue';
|
|
8
|
+
export { default as Grid } from './components/Grid/index.vue';
|
|
9
|
+
export { default as GridItem } from './components/Grid/components/GridItem.vue';
|
|
10
|
+
export { default as Icon } from './components/Icon/index.vue';
|
|
11
|
+
export { default as Dialog } from './components/Dialog/index.vue';
|
|
12
|
+
export { useTable } from './hooks/useTable';
|
|
13
|
+
export { useSelection } from './hooks/useSelection';
|
|
14
|
+
export { generateUUID, handleProp } from './utils';
|
|
15
|
+
export { default as dayjs } from './utils/dayjs';
|
|
16
|
+
export { default as eventBus } from './utils/eventBus';
|
|
17
|
+
interface McProUI {
|
|
18
|
+
version: string;
|
|
19
|
+
author: string;
|
|
20
|
+
description: string;
|
|
21
|
+
install: (app: App) => void;
|
|
22
|
+
}
|
|
23
|
+
declare const mcProUI: McProUI;
|
|
24
|
+
export default mcProUI;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElForm } from 'element-plus';
|
|
2
|
+
/**
|
|
3
|
+
* 根据pk字段的值从数组中获取key
|
|
4
|
+
* @param arr
|
|
5
|
+
* @param pk
|
|
6
|
+
* @param value
|
|
7
|
+
*/
|
|
8
|
+
export declare function getArrayKey(arr: any, pk: string, value: string): any;
|
|
9
|
+
/**
|
|
10
|
+
* 表单重置
|
|
11
|
+
* @param formEl
|
|
12
|
+
*/
|
|
13
|
+
export declare function onResetForm(formEl: InstanceType<typeof ElForm> | undefined): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useGlobalProperties(): import('vue').ComponentCustomProperties & Record<string, any>;
|