@vue-start/pro 0.4.11 → 0.4.13

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/dist/index.d.ts CHANGED
@@ -1,956 +1,960 @@
1
1
  import * as vue from 'vue';
2
- import { ExtractPropTypes, PropType, VNode, Ref as Ref$1 } from 'vue';
2
+ import { ExtractPropTypes, PropType, VNode, App, Ref as Ref$1 } from 'vue';
3
3
  import { UnwrapNestedRefs, Ref, ComputedRef } from '@vue/reactivity';
4
4
  import { Subject } from 'rxjs';
5
5
  import { IRequestActor } from '@vue-start/request';
6
6
 
7
- declare const proGridProps: () => {
8
- row: {
9
- type: PropType<Record<string, any>>;
10
- default: undefined;
11
- };
12
- col: {
13
- type: PropType<Record<string, any>>;
14
- };
15
- items: {
16
- type: PropType<{
17
- vNode: VNode;
18
- rowKey?: string | number | undefined;
19
- col?: Record<string, any> | undefined;
20
- }[]>;
21
- };
22
- };
23
- declare type GridProps = Partial<ExtractPropTypes<ReturnType<typeof proGridProps>>>;
7
+ declare const proGridProps: () => {
8
+ row: {
9
+ type: PropType<Record<string, any>>;
10
+ default: undefined;
11
+ };
12
+ col: {
13
+ type: PropType<Record<string, any>>;
14
+ };
15
+ items: {
16
+ type: PropType<{
17
+ vNode: VNode;
18
+ rowKey?: string | number | undefined;
19
+ col?: Record<string, any> | undefined;
20
+ }[]>;
21
+ };
22
+ };
23
+ declare type GridProps = Partial<ExtractPropTypes<ReturnType<typeof proGridProps>>>;
24
24
  declare const createGrid: (Row: any, Col: any) => any;
25
25
 
26
- declare type TDefaultValueType = "text" | "textarea" | "password" | "digit" | "date" | "dateRange" | "time" | "timeRange" | "select" | "treeSelect" | "checkbox" | "radio" | "slider" | "switch" | "rate" | "cascader";
27
- declare type TValueType = TDefaultValueType | string;
28
- declare type TOption = {
29
- label?: string;
30
- value: string | number;
31
- disabled?: boolean;
32
- };
33
- declare type TOptions = TOption[];
34
- declare type TreeOption = {
35
- label?: string;
36
- value: string | number;
37
- disabled?: boolean;
38
- children?: TreeOption[];
39
- };
40
- declare type TreeOptions = TreeOption[];
41
- declare type TColumn = {
42
- title?: string | VNode;
43
- dataIndex?: string | number;
44
- valueType?: TValueType;
45
- formValueType?: TValueType;
46
- showProps?: Record<string, any>;
47
- formItemProps?: {
48
- name?: string;
49
- label?: string;
50
- };
51
- formFieldProps?: Record<string, any>;
52
- search?: boolean;
53
- extra?: {
54
- desc?: Record<string, any>;
55
- col?: Record<string, any>;
56
- } & Record<string, any>;
57
- };
58
- declare type TColumns = TColumn[];
59
- /**
60
- * 发送事件对象
61
- */
62
- declare type TActionEvent = {
63
- type: string;
64
- payload?: any;
65
- /**
66
- * 发送事件源
67
- * 公共组件(如:Curd)只处理source为undefined的事件
68
- * 业务组件可以传入该参数覆盖之前的默认行为
69
- */
70
- source?: string;
71
- extra?: Record<string, any>;
72
- };
73
- /**
74
- * 发送state对象
75
- */
76
- declare type TActionState = {
77
- type: string;
78
- payload: any;
79
- extra?: Record<string, any>;
80
- };
81
- /**
82
- * 组件Map
83
- */
84
- declare type TElementMap = Record<string, any>;
85
- declare type BooleanObjType = {
86
- [key: string]: boolean;
87
- };
88
- declare type BooleanRulesObjType = {
89
- [key: string]: (record: any) => boolean;
90
- };
91
- /**
92
- *
93
- */
94
- interface FieldNames {
95
- value?: string;
96
- label?: string;
97
- children?: string;
26
+ declare type TDefaultValueType = "text" | "textarea" | "password" | "digit" | "date" | "dateRange" | "time" | "timeRange" | "select" | "treeSelect" | "checkbox" | "radio" | "slider" | "switch" | "rate" | "cascader";
27
+ declare type TValueType = TDefaultValueType | string;
28
+ declare type TOption = {
29
+ label?: string;
30
+ value: string | number;
31
+ disabled?: boolean;
32
+ };
33
+ declare type TOptions = TOption[];
34
+ declare type TreeOption = {
35
+ label?: string;
36
+ value: string | number;
37
+ disabled?: boolean;
38
+ children?: TreeOption[];
39
+ };
40
+ declare type TreeOptions = TreeOption[];
41
+ declare type TColumn = {
42
+ title?: string | VNode;
43
+ dataIndex?: string | number;
44
+ valueType?: TValueType;
45
+ formValueType?: TValueType;
46
+ showProps?: Record<string, any>;
47
+ formItemProps?: {
48
+ name?: string;
49
+ label?: string;
50
+ };
51
+ formFieldProps?: Record<string, any>;
52
+ search?: boolean;
53
+ extra?: {
54
+ desc?: Record<string, any>;
55
+ col?: Record<string, any>;
56
+ } & Record<string, any>;
57
+ };
58
+ declare type TColumns = TColumn[];
59
+ /**
60
+ * 发送事件对象
61
+ */
62
+ declare type TActionEvent = {
63
+ type: string;
64
+ payload?: any;
65
+ /**
66
+ * 发送事件源
67
+ * 公共组件(如:Curd)只处理source为undefined的事件
68
+ * 业务组件可以传入该参数覆盖之前的默认行为
69
+ */
70
+ source?: string;
71
+ extra?: Record<string, any>;
72
+ };
73
+ /**
74
+ * 发送state对象
75
+ */
76
+ declare type TActionState = {
77
+ type: string;
78
+ payload: any;
79
+ extra?: Record<string, any>;
80
+ };
81
+ /**
82
+ * 组件Map
83
+ */
84
+ declare type TElementMap = Record<string, any>;
85
+ declare type BooleanObjType = {
86
+ [key: string]: boolean;
87
+ };
88
+ declare type BooleanRulesObjType = {
89
+ [key: string]: (record: any) => boolean;
90
+ };
91
+ /**
92
+ *
93
+ */
94
+ interface FieldNames {
95
+ value?: string;
96
+ label?: string;
97
+ children?: string;
98
98
  }
99
99
 
100
- /***************************************** curd模式 *****************************************/
101
- /**
102
- * 获取Column的valueType,默认"text"
103
- * @param column
104
- */
105
- declare const getColumnValueType: (column: TColumn) => TValueType;
106
- /**
107
- *获取Column的FormItem name
108
- * @param column
109
- */
110
- declare const getColumnFormItemName: (column: TColumn) => string | number | undefined;
111
- /**
112
- * 根据Column生成FormItem VNode
113
- * formFieldProps中的slots参数会以v-slots的形式传递到FormItem的录入组件(子组件)中
114
- * @param formElementMap
115
- * @param column
116
- * @param needRules
117
- */
118
- declare const getFormItemEl: (formElementMap: any, column: TColumn, needRules?: boolean | undefined) => VNode | null;
119
- /**
120
- * 根据Column生成Item VNode
121
- * @param elementMap
122
- * @param column
123
- * @param value
124
- */
125
- declare const getItemEl: <T extends TColumn>(elementMap: any, column: T, value: any) => VNode | null;
126
- /***************************************** 通用模式 *****************************************/
127
- declare type InternalNamePath = (string | number)[];
128
- declare type NamePath = string | number | InternalNamePath;
129
- interface IHighConfig {
130
- registerStateList?: {
131
- name: NamePath;
132
- mapName?: NamePath;
133
- }[];
134
- registerEventList?: {
135
- name: string;
136
- sendEventName?: TActionEvent["type"];
137
- }[];
138
- registerPropsTrans?: {
139
- name: NamePath;
140
- isFun?: boolean;
141
- needParams?: boolean;
142
- }[];
143
- }
144
- /**
145
- * 组件树描述
146
- */
147
- interface IElementConfig {
148
- elementType: string;
149
- elementId: string;
150
- elementProps?: Record<string, any>;
151
- slots?: {
152
- [name: string]: ((...params$: any[]) => any) | (IElementConfig & {
153
- needParams?: boolean;
154
- });
155
- };
156
- children?: IElementConfig[];
157
- childrenSlotName?: string;
158
- highConfig$?: IHighConfig;
159
- }
160
- declare const renderElements: (elementMap: TElementMap, elementConfigs: IElementConfig[]) => (VNode | null)[];
161
- /**
162
- *
163
- * @param elementMap
164
- * @param elementConfig
165
- */
166
- declare const renderElement: (elementMap: TElementMap, elementConfig: IElementConfig) => VNode<vue.RendererNode, vue.RendererElement, {
167
- [key: string]: any;
168
- }>;
169
- /**
170
- * 获取第一层级属性名
171
- * 如:['aaa','bbb',...] 中的 'aaa'
172
- * 如:"aaa.bbb.ccc..." 中的 'aaa'
173
- */
174
- declare const getFirstPropName: (name: NamePath) => string | number | undefined;
175
- /**
176
- * 处理highConfig$
177
- */
178
- declare const Wrapper: vue.DefineComponent<{
179
- elementMap: TElementMap;
180
- elementConfig: IElementConfig;
181
- }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{
182
- elementMap: TElementMap;
183
- elementConfig: IElementConfig;
100
+ /***************************************** curd模式 *****************************************/
101
+ /**
102
+ * 获取Column的valueType,默认"text"
103
+ * @param column
104
+ */
105
+ declare const getColumnValueType: (column: TColumn) => TValueType;
106
+ /**
107
+ *获取Column的FormItem name
108
+ * @param column
109
+ */
110
+ declare const getColumnFormItemName: (column: TColumn) => string | number | undefined;
111
+ /**
112
+ * 根据Column生成FormItem VNode
113
+ * formFieldProps中的slots参数会以v-slots的形式传递到FormItem的录入组件(子组件)中
114
+ * @param formElementMap
115
+ * @param column
116
+ * @param needRules
117
+ */
118
+ declare const getFormItemEl: (formElementMap: any, column: TColumn, needRules?: boolean | undefined) => VNode | null;
119
+ /**
120
+ * 根据Column生成Item VNode
121
+ * @param elementMap
122
+ * @param column
123
+ * @param value
124
+ */
125
+ declare const getItemEl: <T extends TColumn>(elementMap: any, column: T, value: any) => VNode | null;
126
+ /***************************************** 通用模式 *****************************************/
127
+ declare type InternalNamePath = (string | number)[];
128
+ declare type NamePath = string | number | InternalNamePath;
129
+ interface IHighConfig {
130
+ registerStateList?: {
131
+ name: NamePath;
132
+ mapName?: NamePath;
133
+ }[];
134
+ registerEventList?: {
135
+ name: string;
136
+ sendEventName?: TActionEvent["type"];
137
+ }[];
138
+ registerPropsTrans?: {
139
+ name: NamePath;
140
+ isFun?: boolean;
141
+ needParams?: boolean;
142
+ }[];
143
+ }
144
+ /**
145
+ * 组件树描述
146
+ */
147
+ interface IElementConfig {
148
+ elementType: string;
149
+ elementId: string;
150
+ elementProps?: Record<string, any>;
151
+ slots?: {
152
+ [name: string]: ((...params$: any[]) => any) | (IElementConfig & {
153
+ needParams?: boolean;
154
+ });
155
+ };
156
+ children?: IElementConfig[];
157
+ childrenSlotName?: string;
158
+ highConfig$?: IHighConfig;
159
+ }
160
+ declare const renderElements: (elementMap: TElementMap, elementConfigs: IElementConfig[]) => (VNode | null)[];
161
+ /**
162
+ *
163
+ * @param elementMap
164
+ * @param elementConfig
165
+ */
166
+ declare const renderElement: (elementMap: TElementMap, elementConfig: IElementConfig) => VNode<vue.RendererNode, vue.RendererElement, {
167
+ [key: string]: any;
168
+ }>;
169
+ /**
170
+ * 获取第一层级属性名
171
+ * 如:['aaa','bbb',...] 中的 'aaa'
172
+ * 如:"aaa.bbb.ccc..." 中的 'aaa'
173
+ */
174
+ declare const getFirstPropName: (name: NamePath) => string | number | undefined;
175
+ /**
176
+ * 处理highConfig$
177
+ */
178
+ declare const Wrapper: vue.DefineComponent<{
179
+ elementMap: TElementMap;
180
+ elementConfig: IElementConfig;
181
+ }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{
182
+ elementMap: TElementMap;
183
+ elementConfig: IElementConfig;
184
184
  }>, {}>;
185
185
 
186
- interface IProModuleProvide {
187
- elementMap: TElementMap;
188
- subject$: Subject<TActionEvent>;
189
- sendEvent: (action: TActionEvent) => void;
190
- state: UnwrapNestedRefs<Record<string, any>>;
191
- dispatch: (action: TActionState) => void;
192
- requests: IRequestOpts[];
193
- sendRequest: (requestNameOrAction: string, ...params: any[]) => void;
194
- }
195
- declare const useProModule: () => IProModuleProvide;
196
- declare const provideProModule: (ctx: IProModuleProvide) => void;
197
- interface IRequestOpts {
198
- actor: IRequestActor;
199
- /**
200
- * 如果设置action,可以使用该值发起请求 住:要保证唯一性
201
- * 设置该字段原因:因为actor中的name不友好,可以理解为一个备选方案
202
- */
203
- action?: string;
204
- stateName?: string;
205
- loadingName?: string;
206
- convertParams?: (...params: any[]) => Record<string, any>;
207
- convertData?: (actor: IRequestActor) => Record<string, any>;
208
- onSuccess?: (actor?: IRequestActor) => void;
209
- onFailed?: (actor?: IRequestActor) => void;
210
- }
211
- declare const RequestAction: {
212
- Success: string;
213
- Fail: string;
214
- };
215
- declare const proModuleProps: () => {
216
- /**
217
- * module状态
218
- */
219
- state: {
220
- type: PropType<Record<string, any>>;
221
- };
222
- /**
223
- * 组件集
224
- */
225
- elementMap: {
226
- type: PropType<TElementMap>;
227
- };
228
- /**
229
- * 组件描述(树)
230
- */
231
- elementConfigs: {
232
- type: PropType<IElementConfig[]>;
233
- };
234
- /**
235
- * requests
236
- */
237
- requests: {
238
- type: PropType<IRequestOpts[]>;
239
- };
240
- };
241
- declare type ProModuleProps = Partial<ExtractPropTypes<ReturnType<typeof proModuleProps>>>;
242
- declare const ProModule: vue.DefineComponent<Partial<ExtractPropTypes<{
243
- /**
244
- * module状态
245
- */
246
- state: {
247
- type: PropType<Record<string, any>>;
248
- };
249
- /**
250
- * 组件集
251
- */
252
- elementMap: {
253
- type: PropType<TElementMap>;
254
- };
255
- /**
256
- * 组件描述(树)
257
- */
258
- elementConfigs: {
259
- type: PropType<IElementConfig[]>;
260
- };
261
- /**
262
- * requests
263
- */
264
- requests: {
265
- type: PropType<IRequestOpts[]>;
266
- };
267
- }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
268
- /**
269
- * module状态
270
- */
271
- state: {
272
- type: PropType<Record<string, any>>;
273
- };
274
- /**
275
- * 组件集
276
- */
277
- elementMap: {
278
- type: PropType<TElementMap>;
279
- };
280
- /**
281
- * 组件描述(树)
282
- */
283
- elementConfigs: {
284
- type: PropType<IElementConfig[]>;
285
- };
286
- /**
287
- * requests
288
- */
289
- requests: {
290
- type: PropType<IRequestOpts[]>;
291
- };
186
+ interface IProModuleProvide {
187
+ elementMap: TElementMap;
188
+ subject$: Subject<TActionEvent>;
189
+ sendEvent: (action: TActionEvent) => void;
190
+ state: UnwrapNestedRefs<Record<string, any>>;
191
+ dispatch: (action: TActionState) => void;
192
+ requests: IRequestOpts[];
193
+ sendRequest: (requestNameOrAction: string, ...params: any[]) => void;
194
+ }
195
+ declare const useProModule: () => IProModuleProvide;
196
+ declare const provideProModule: (ctx: IProModuleProvide) => void;
197
+ interface IRequestOpts {
198
+ actor: IRequestActor;
199
+ /**
200
+ * 如果设置action,可以使用该值发起请求 住:要保证唯一性
201
+ * 设置该字段原因:因为actor中的name不友好,可以理解为一个备选方案
202
+ */
203
+ action?: string;
204
+ stateName?: string;
205
+ loadingName?: string;
206
+ convertParams?: (...params: any[]) => Record<string, any>;
207
+ convertData?: (actor: IRequestActor) => Record<string, any>;
208
+ onSuccess?: (actor?: IRequestActor) => void;
209
+ onFailed?: (actor?: IRequestActor) => void;
210
+ }
211
+ declare const RequestAction: {
212
+ Success: string;
213
+ Fail: string;
214
+ };
215
+ declare const proModuleProps: () => {
216
+ /**
217
+ * module状态
218
+ */
219
+ state: {
220
+ type: PropType<Record<string, any>>;
221
+ };
222
+ /**
223
+ * 组件集
224
+ */
225
+ elementMap: {
226
+ type: PropType<TElementMap>;
227
+ };
228
+ /**
229
+ * 组件描述(树)
230
+ */
231
+ elementConfigs: {
232
+ type: PropType<IElementConfig[]>;
233
+ };
234
+ /**
235
+ * requests
236
+ */
237
+ requests: {
238
+ type: PropType<IRequestOpts[]>;
239
+ };
240
+ };
241
+ declare type ProModuleProps = Partial<ExtractPropTypes<ReturnType<typeof proModuleProps>>>;
242
+ declare const ProModule: vue.DefineComponent<Partial<ExtractPropTypes<{
243
+ /**
244
+ * module状态
245
+ */
246
+ state: {
247
+ type: PropType<Record<string, any>>;
248
+ };
249
+ /**
250
+ * 组件集
251
+ */
252
+ elementMap: {
253
+ type: PropType<TElementMap>;
254
+ };
255
+ /**
256
+ * 组件描述(树)
257
+ */
258
+ elementConfigs: {
259
+ type: PropType<IElementConfig[]>;
260
+ };
261
+ /**
262
+ * requests
263
+ */
264
+ requests: {
265
+ type: PropType<IRequestOpts[]>;
266
+ };
267
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
268
+ /**
269
+ * module状态
270
+ */
271
+ state: {
272
+ type: PropType<Record<string, any>>;
273
+ };
274
+ /**
275
+ * 组件集
276
+ */
277
+ elementMap: {
278
+ type: PropType<TElementMap>;
279
+ };
280
+ /**
281
+ * 组件描述(树)
282
+ */
283
+ elementConfigs: {
284
+ type: PropType<IElementConfig[]>;
285
+ };
286
+ /**
287
+ * requests
288
+ */
289
+ requests: {
290
+ type: PropType<IRequestOpts[]>;
291
+ };
292
292
  }>>>, {}>;
293
293
 
294
294
  declare const useModuleEvent: (cb: (action: TActionEvent) => void) => void;
295
295
 
296
- declare const useDoneRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
297
- declare const useFailedRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
298
- declare const useComposeRequestActor: (actors: (IRequestActor | string)[], options: {
299
- onSuccess?: ((actor: IRequestActor) => void) | undefined;
300
- onFailed?: ((actor: IRequestActor) => void) | undefined;
301
- onFinish?: ((actor: IRequestActor) => void) | undefined;
296
+ declare const useDoneRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
297
+ declare const useFailedRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
298
+ declare const useComposeRequestActor: (actors: (IRequestActor | string)[], options: {
299
+ onSuccess?: ((actor: IRequestActor) => void) | undefined;
300
+ onFailed?: ((actor: IRequestActor) => void) | undefined;
301
+ onFinish?: ((actor: IRequestActor) => void) | undefined;
302
302
  }, cancelWhileUnmount?: boolean) => void;
303
303
 
304
- interface IProTableProvideExtra extends Record<string, any> {
305
- }
306
- interface IProTableProvide extends IProTableProvideExtra {
307
- columns: Ref<TTableColumns>;
308
- }
309
- declare const useProTable: () => IProTableProvide;
310
- declare type TTableColumn = {
311
- customRender?: (opt: {
312
- value: any;
313
- text: any;
314
- record: Record<string, any>;
315
- index: number;
316
- column: TTableColumn;
317
- }) => VNode | string | number;
318
- fixed?: boolean | string;
319
- width?: number | string;
320
- } & TColumn;
321
- declare type TTableColumns = TTableColumn[];
322
- /**
323
- * 单个操作描述
324
- */
325
- interface IOperateItem {
326
- value: string | number;
327
- label?: string | VNode;
328
- element?: (record: Record<string, any>, item: IOperateItem) => VNode;
329
- show?: boolean | ((record: Record<string, any>) => boolean);
330
- disabled?: boolean | ((record: Record<string, any>) => boolean);
331
- onClick?: (record: Record<string, any>) => void;
332
- sort?: number;
333
- }
334
- /**
335
- * 整个操作栏描述
336
- */
337
- interface ITableOperate {
338
- column?: TColumn;
339
- items?: IOperateItem[];
340
- itemState?: {
341
- [key: string]: Omit<IOperateItem, "value">;
342
- };
343
- }
344
- declare const proTableProps: () => {
345
- operate: {
346
- type: PropType<ITableOperate>;
347
- };
348
- columnEmptyText: {
349
- type: StringConstructor;
350
- };
351
- /**
352
- * 公共column,会merge到columns item中
353
- */
354
- column: {
355
- type: PropType<TTableColumn>;
356
- };
357
- columns: {
358
- type: PropType<TTableColumns>;
359
- };
360
- columnState: {
361
- type: PropType<Record<string, any>>;
362
- };
363
- /**
364
- * 展示控件集合,readonly模式下使用这些组件渲染
365
- */
366
- elementMap: {
367
- type: PropType<TElementMap>;
368
- };
369
- /**
370
- * 序号
371
- */
372
- serialNumber: {
373
- type: BooleanConstructor;
374
- };
375
- /**
376
- * 分页
377
- */
378
- paginationState: {
379
- type: PropType<{
380
- page?: number | undefined;
381
- pageSize?: number | undefined;
382
- }>;
383
- };
384
- /**
385
- * provide传递
386
- */
387
- provideExtra: {
388
- type: PropType<IProTableProvideExtra>;
389
- };
390
- };
391
- declare type ProTableProps = Partial<ExtractPropTypes<ReturnType<typeof proTableProps>>>;
304
+ declare const proBasePropsFn: () => {
305
+ /**
306
+ * 组件集
307
+ */
308
+ elementMap: {
309
+ type: PropType<TElementMap>;
310
+ };
311
+ /**
312
+ * form组件集(使用FormItem包裹的组件集合)
313
+ * readonly模式下使用elementMap中的组件渲染
314
+ */
315
+ formElementMap: {
316
+ type: PropType<TElementMap>;
317
+ };
318
+ /**
319
+ * 基础项配置
320
+ */
321
+ columns: {
322
+ type: PropType<TColumns>;
323
+ };
324
+ /**
325
+ * column 进行补充
326
+ * 通常对columns为静态值时候使用
327
+ */
328
+ columnState: {
329
+ type: PropType<Record<string, any>>;
330
+ };
331
+ };
332
+ declare type ProBaseProps = Partial<ExtractPropTypes<ReturnType<typeof proBasePropsFn>>>;
333
+ declare const proBaseProps: ProBaseProps;
334
+ interface IProConfigProvide {
335
+ /**
336
+ * 组件集
337
+ */
338
+ elementMap?: TElementMap;
339
+ /**
340
+ * form组件集(使用FormItem包裹的组件集合)
341
+ */
342
+ formElementMap?: TElementMap;
343
+ }
344
+ declare const proConfigProps: () => {
345
+ config: {
346
+ type: PropType<IProConfigProvide>;
347
+ default: {};
348
+ };
349
+ };
350
+ declare const useProConfig: () => IProConfigProvide;
351
+ declare type ProConfigProps = Partial<ExtractPropTypes<ReturnType<typeof proConfigProps>>>;
352
+ /**
353
+ * 组件方式注册
354
+ */
355
+ declare const ProConfig: vue.DefineComponent<Partial<ExtractPropTypes<{
356
+ config: {
357
+ type: PropType<IProConfigProvide>;
358
+ default: {};
359
+ };
360
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
361
+ config: {
362
+ type: PropType<IProConfigProvide>;
363
+ default: {};
364
+ };
365
+ }>>>, {}>;
366
+ /**
367
+ * app.use 方式注册
368
+ * @param config
369
+ */
370
+ declare const createProConfig: (config?: IProConfigProvide) => (app: App) => void;
371
+
372
+ interface IProTableProvideExtra extends Record<string, any> {
373
+ }
374
+ interface IProTableProvide extends IProTableProvideExtra {
375
+ columns: Ref<TTableColumns>;
376
+ }
377
+ declare const useProTable: () => IProTableProvide;
378
+ declare type TTableColumn = {
379
+ customRender?: (opt: {
380
+ value: any;
381
+ text: any;
382
+ record: Record<string, any>;
383
+ index: number;
384
+ column: TTableColumn;
385
+ }) => VNode | string | number;
386
+ fixed?: boolean | string;
387
+ width?: number | string;
388
+ } & TColumn;
389
+ declare type TTableColumns = TTableColumn[];
390
+ /**
391
+ * 单个操作描述
392
+ */
393
+ interface IOperateItem {
394
+ value: string | number;
395
+ label?: string | VNode;
396
+ element?: (record: Record<string, any>, item: IOperateItem) => VNode;
397
+ show?: boolean | ((record: Record<string, any>) => boolean);
398
+ disabled?: boolean | ((record: Record<string, any>) => boolean);
399
+ onClick?: (record: Record<string, any>) => void;
400
+ sort?: number;
401
+ }
402
+ /**
403
+ * 整个操作栏描述
404
+ */
405
+ interface ITableOperate {
406
+ column?: TColumn;
407
+ items?: IOperateItem[];
408
+ itemState?: {
409
+ [key: string]: Omit<IOperateItem, "value">;
410
+ };
411
+ }
412
+ declare const proTableProps: () => {
413
+ operate: {
414
+ type: PropType<ITableOperate>;
415
+ };
416
+ columnEmptyText: {
417
+ type: StringConstructor;
418
+ };
419
+ /**
420
+ * 公共column,会merge到columns item中
421
+ */
422
+ column: {
423
+ type: PropType<TTableColumn>;
424
+ };
425
+ /**
426
+ * 序号
427
+ */
428
+ serialNumber: {
429
+ type: BooleanConstructor;
430
+ };
431
+ /**
432
+ * 分页
433
+ */
434
+ paginationState: {
435
+ type: PropType<{
436
+ page?: number | undefined;
437
+ pageSize?: number | undefined;
438
+ }>;
439
+ };
440
+ /**
441
+ * provide传递
442
+ */
443
+ provideExtra: {
444
+ type: PropType<IProTableProvideExtra>;
445
+ };
446
+ };
447
+ declare type ProTableProps = Partial<ExtractPropTypes<ReturnType<typeof proTableProps>>> & ProBaseProps;
392
448
  declare const createTable: (Table: any, Props?: any, tableMethods?: string[]) => any;
393
449
 
394
- declare type TPageState = {
395
- page: number;
396
- pageSize: number;
397
- };
398
- declare const defaultPage: TPageState;
399
- interface IListData extends Record<string, any> {
400
- total: number;
401
- dataSource: Record<string, any>[];
402
- }
403
- interface ICurdState extends Record<string, any> {
404
- listLoading?: boolean;
405
- listData?: IListData;
406
- mode?: ICurdCurrentMode;
407
- detailLoading?: boolean;
408
- detailData?: Record<string, any>;
409
- operateLoading?: boolean;
410
- addAction?: ICurdAddAction;
411
- }
412
- /**
413
- * action:list,detail,add,edit,delete
414
- */
415
- interface ICurdOperateOpts extends Omit<IRequestOpts, "actor" | "action">, Omit<IOperateItem, "value"> {
416
- action: ICurdAction;
417
- actor?: IRequestActor;
418
- tableOperate?: boolean;
419
- }
420
- declare type TCurdActionEvent = {
421
- action: ICurdAction;
422
- type: ICurdSubAction;
423
- record?: Record<string, any>;
424
- values?: Record<string, any>;
425
- source?: TActionEvent["source"];
426
- };
427
- declare const proCurdProps: () => {
428
- /**
429
- * 配置(静态)
430
- */
431
- columns: {
432
- type: PropType<TColumns>;
433
- };
434
- /**
435
- * 配置(动态)
436
- * columns动态属性兼容
437
- */
438
- columnState: {
439
- type: PropType<Record<string, any>>;
440
- };
441
- /**
442
- * 录入组件集
443
- */
444
- formElementMap: {
445
- type: PropType<TElementMap>;
446
- };
447
- /**
448
- * 列表 或 详情 的唯一标识
449
- */
450
- rowKey: {
451
- type: StringConstructor;
452
- default: string;
453
- };
454
- /**
455
- * operates
456
- */
457
- operates: {
458
- type: PropType<ICurdOperateOpts[]>;
459
- };
460
- /************************* 子组件props *******************************/
461
- listProps: {
462
- type: PropType<Record<string, any>>;
463
- };
464
- formProps: {
465
- type: PropType<Record<string, any>>;
466
- };
467
- descProps: {
468
- type: PropType<Record<string, any>>;
469
- };
470
- modalProps: {
471
- type: PropType<Record<string, any>>;
472
- };
473
- };
474
- declare type CurdProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdProps>>>;
475
- declare const CurdMethods: string[];
476
- declare type ProCurdProps = CurdProps & Omit<ProModuleProps, "state" | "requests"> & {
477
- curdState?: UnwrapNestedRefs<ICurdState>;
478
- };
450
+ declare type TPageState = {
451
+ page: number;
452
+ pageSize: number;
453
+ };
454
+ declare const defaultPage: TPageState;
455
+ interface IListData extends Record<string, any> {
456
+ total: number;
457
+ dataSource: Record<string, any>[];
458
+ }
459
+ interface ICurdState extends Record<string, any> {
460
+ listLoading?: boolean;
461
+ listData?: IListData;
462
+ mode?: ICurdCurrentMode;
463
+ detailLoading?: boolean;
464
+ detailData?: Record<string, any>;
465
+ operateLoading?: boolean;
466
+ addAction?: ICurdAddAction;
467
+ }
468
+ /**
469
+ * action:list,detail,add,edit,delete
470
+ */
471
+ interface ICurdOperateOpts extends Omit<IRequestOpts, "actor" | "action">, Omit<IOperateItem, "value"> {
472
+ action: ICurdAction;
473
+ actor?: IRequestActor;
474
+ tableOperate?: boolean;
475
+ }
476
+ declare type TCurdActionEvent = {
477
+ action: ICurdAction;
478
+ type: ICurdSubAction;
479
+ record?: Record<string, any>;
480
+ values?: Record<string, any>;
481
+ source?: TActionEvent["source"];
482
+ };
483
+ declare const proCurdProps: () => {
484
+ /**
485
+ * 列表 或 详情 的唯一标识
486
+ */
487
+ rowKey: {
488
+ type: StringConstructor;
489
+ default: string;
490
+ };
491
+ /**
492
+ * operates
493
+ */
494
+ operates: {
495
+ type: PropType<ICurdOperateOpts[]>;
496
+ };
497
+ /************************* 子组件props *******************************/
498
+ listProps: {
499
+ type: PropType<Record<string, any>>;
500
+ };
501
+ formProps: {
502
+ type: PropType<Record<string, any>>;
503
+ };
504
+ descProps: {
505
+ type: PropType<Record<string, any>>;
506
+ };
507
+ modalProps: {
508
+ type: PropType<Record<string, any>>;
509
+ };
510
+ };
511
+ declare type CurdProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdProps>>> & ProBaseProps;
512
+ declare const CurdMethods: string[];
513
+ declare type ProCurdProps = CurdProps & Omit<ProModuleProps, "state" | "requests"> & {
514
+ curdState?: UnwrapNestedRefs<ICurdState>;
515
+ };
479
516
  declare const ProCurd: vue.DefineComponent<ProCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProCurdProps>, {}>;
480
517
 
481
- interface IProCurdProvide {
482
- columns: Ref<TColumns>;
483
- getSignColumns: (signName: string) => TColumns;
484
- getFormItemVNode: (column: TColumn, needRules: boolean | undefined) => VNode | null;
485
- getItemVNode: (column: TColumn, value: any) => VNode | null;
486
- elementMap: TElementMap;
487
- formElementMap: TElementMap;
488
- rowKey: string;
489
- curdState: UnwrapNestedRefs<ICurdState>;
490
- formColumns: Ref<TColumns>;
491
- descColumns: Ref<TColumns>;
492
- tableColumns: Ref<TColumns>;
493
- searchColumns: Ref<TColumns>;
494
- sendCurdEvent: (event: TCurdActionEvent) => void;
495
- operates: ICurdOperateOpts[];
496
- getOperate: (action: ICurdAction) => ICurdOperateOpts | undefined;
497
- refreshList: (extra?: Record<string, any>) => void;
498
- /******************子组件参数*******************/
499
- listProps?: ComputedRef<Record<string, any> | undefined>;
500
- formProps?: ComputedRef<Record<string, any> | undefined>;
501
- descProps?: ComputedRef<Record<string, any> | undefined>;
502
- modalProps?: ComputedRef<Record<string, any> | undefined>;
503
- }
504
- declare const useProCurd: <T extends IProCurdProvide>() => T;
505
- declare const provideProCurd: (ctx: IProCurdProvide) => void;
506
- /************************************ 常量 *************************************/
507
- /**
508
- * curd 5种基础Action
509
- */
510
- declare enum CurdAction {
511
- LIST = "LIST",
512
- DETAIL = "DETAIL",
513
- ADD = "ADD",
514
- EDIT = "EDIT",
515
- DELETE = "DELETE"
516
- }
517
- declare type ICurdAction = keyof typeof CurdAction | string;
518
- /**
519
- * CurdAction 的子事件
520
- */
521
- declare enum CurdSubAction {
522
- EMIT = "EMIT",
523
- EXECUTE = "EXECUTE",
524
- PAGE = "PAGE",
525
- SUCCESS = "SUCCESS",
526
- FAIL = "FAIL"
527
- }
528
- declare type ICurdSubAction = keyof typeof CurdSubAction;
529
- /**
530
- * curd 操作模式
531
- */
532
- declare enum CurdCurrentMode {
533
- ADD = "ADD",
534
- EDIT = "EDIT",
535
- DETAIL = "DETAIL"
536
- }
537
- declare type ICurdCurrentMode = keyof typeof CurdCurrentMode | string;
538
- /**
539
- * curd add 模式下 标记 "确定" "确定并继续" 触发
540
- */
541
- declare enum CurdAddAction {
542
- NORMAL = "NORMAL",
543
- CONTINUE = "CONTINUE"
544
- }
518
+ interface IProCurdProvide {
519
+ columns: Ref<TColumns>;
520
+ getSignColumns: (signName: string) => TColumns;
521
+ getFormItemVNode: (column: TColumn, needRules: boolean | undefined) => VNode | null;
522
+ getItemVNode: (column: TColumn, value: any) => VNode | null;
523
+ elementMap: TElementMap;
524
+ formElementMap: TElementMap;
525
+ rowKey: string;
526
+ curdState: UnwrapNestedRefs<ICurdState>;
527
+ formColumns: Ref<TColumns>;
528
+ descColumns: Ref<TColumns>;
529
+ tableColumns: Ref<TColumns>;
530
+ searchColumns: Ref<TColumns>;
531
+ sendCurdEvent: (event: TCurdActionEvent) => void;
532
+ operates: ICurdOperateOpts[];
533
+ getOperate: (action: ICurdAction) => ICurdOperateOpts | undefined;
534
+ refreshList: (extra?: Record<string, any>) => void;
535
+ /******************子组件参数*******************/
536
+ listProps?: ComputedRef<Record<string, any> | undefined>;
537
+ formProps?: ComputedRef<Record<string, any> | undefined>;
538
+ descProps?: ComputedRef<Record<string, any> | undefined>;
539
+ modalProps?: ComputedRef<Record<string, any> | undefined>;
540
+ }
541
+ declare const useProCurd: <T extends IProCurdProvide>() => T;
542
+ declare const provideProCurd: (ctx: IProCurdProvide) => void;
543
+ /************************************ 常量 *************************************/
544
+ /**
545
+ * curd 5种基础Action
546
+ */
547
+ declare enum CurdAction {
548
+ LIST = "LIST",
549
+ DETAIL = "DETAIL",
550
+ ADD = "ADD",
551
+ EDIT = "EDIT",
552
+ DELETE = "DELETE"
553
+ }
554
+ declare type ICurdAction = keyof typeof CurdAction | string;
555
+ /**
556
+ * CurdAction 的子事件
557
+ */
558
+ declare enum CurdSubAction {
559
+ EMIT = "EMIT",
560
+ EXECUTE = "EXECUTE",
561
+ PAGE = "PAGE",
562
+ SUCCESS = "SUCCESS",
563
+ FAIL = "FAIL"
564
+ }
565
+ declare type ICurdSubAction = keyof typeof CurdSubAction;
566
+ /**
567
+ * curd 操作模式
568
+ */
569
+ declare enum CurdCurrentMode {
570
+ ADD = "ADD",
571
+ EDIT = "EDIT",
572
+ DETAIL = "DETAIL"
573
+ }
574
+ declare type ICurdCurrentMode = keyof typeof CurdCurrentMode | string;
575
+ /**
576
+ * curd add 模式下 标记 "确定" "确定并继续" 触发
577
+ */
578
+ declare enum CurdAddAction {
579
+ NORMAL = "NORMAL",
580
+ CONTINUE = "CONTINUE"
581
+ }
545
582
  declare type ICurdAddAction = keyof typeof CurdAddAction;
546
583
 
547
- declare const modalCurdProps: () => {
548
- defaultAddRecord: {
549
- type: PropType<Record<string, any>>;
550
- };
551
- };
552
- declare type ModalCurdProps = Partial<ExtractPropTypes<ReturnType<typeof modalCurdProps>>>;
553
- declare type ProModalCurdProps = ModalCurdProps & ProCurdProps;
584
+ declare const modalCurdProps: () => {
585
+ defaultAddRecord: {
586
+ type: PropType<Record<string, any>>;
587
+ };
588
+ };
589
+ declare type ModalCurdProps = Partial<ExtractPropTypes<ReturnType<typeof modalCurdProps>>>;
590
+ declare type ProModalCurdProps = ModalCurdProps & ProCurdProps;
554
591
  declare const ProModalCurd: vue.DefineComponent<ProModalCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProModalCurdProps>, {}>;
555
592
 
556
- declare const pageCurdProps: () => {
557
- defaultAddRecord: {
558
- type: PropType<Record<string, any>>;
559
- };
560
- routeBack: {
561
- type: PropType<(action: ICurdAction) => void>;
562
- };
563
- };
564
- declare type PageCurdProps = Partial<ExtractPropTypes<ReturnType<typeof pageCurdProps>>>;
565
- declare type ProPageCurdProps = PageCurdProps & ProCurdProps;
593
+ declare const pageCurdProps: () => {
594
+ defaultAddRecord: {
595
+ type: PropType<Record<string, any>>;
596
+ };
597
+ routeBack: {
598
+ type: PropType<(action: ICurdAction) => void>;
599
+ };
600
+ };
601
+ declare type PageCurdProps = Partial<ExtractPropTypes<ReturnType<typeof pageCurdProps>>>;
602
+ declare type ProPageCurdProps = PageCurdProps & ProCurdProps;
566
603
  declare const ProPageCurd: vue.DefineComponent<ProPageCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProPageCurdProps>, {}>;
567
604
 
568
605
  declare const createCurdDesc: (Descriptions: any, DescriptionsItem: any) => any;
569
606
 
570
- declare const proCurdAddOrEditProps: () => {
571
- signName: {
572
- type: StringConstructor;
573
- };
574
- modelName: {
575
- type: StringConstructor;
576
- default: string;
577
- };
578
- operateBar: {
579
- type: BooleanConstructor;
580
- default: boolean;
581
- };
582
- showContinueAdd: {
583
- type: BooleanConstructor;
584
- default: boolean;
585
- };
586
- okText: {
587
- type: StringConstructor;
588
- default: string;
589
- };
590
- okButtonProps: {
591
- type: PropType<Record<string, any>>;
592
- };
593
- continueText: {
594
- type: StringConstructor;
595
- default: string;
596
- };
597
- continueButtonProps: {
598
- type: PropType<Record<string, any>>;
599
- };
600
- };
601
- declare type ProCurdAddOrEditProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdAddOrEditProps>>>;
607
+ declare const proCurdAddOrEditProps: () => {
608
+ signName: {
609
+ type: StringConstructor;
610
+ };
611
+ modelName: {
612
+ type: StringConstructor;
613
+ default: string;
614
+ };
615
+ operateBar: {
616
+ type: BooleanConstructor;
617
+ default: boolean;
618
+ };
619
+ showContinueAdd: {
620
+ type: BooleanConstructor;
621
+ default: boolean;
622
+ };
623
+ okText: {
624
+ type: StringConstructor;
625
+ default: string;
626
+ };
627
+ okButtonProps: {
628
+ type: PropType<Record<string, any>>;
629
+ };
630
+ continueText: {
631
+ type: StringConstructor;
632
+ default: string;
633
+ };
634
+ continueButtonProps: {
635
+ type: PropType<Record<string, any>>;
636
+ };
637
+ };
638
+ declare type ProCurdAddOrEditProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdAddOrEditProps>>>;
602
639
  declare const createCurdForm: (Form: any, Button: any, convertFormProps?: ((curdState: ICurdState) => Record<string, any>) | undefined, formMethods?: string[]) => any;
603
640
 
604
- declare const proCurdListProps: () => {
605
- /**
606
- * extra 是否放到SearchForm中
607
- */
608
- extraInSearch: {
609
- type: BooleanConstructor;
610
- default: undefined;
611
- };
612
- searchProps: {
613
- type: PropType<Record<string, any>>;
614
- };
615
- tableProps: {
616
- type: PropType<Record<string, any>>;
617
- };
618
- paginationProps: {
619
- type: PropType<Record<string, any>>;
620
- };
621
- showPagination: {
622
- type: BooleanConstructor;
623
- default: boolean;
624
- };
625
- pageState: {
626
- type: PropType<TPageState>;
627
- };
628
- };
629
- declare type ProCurdListProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdListProps>>>;
630
- declare const createCurdList: (SearchForm: any, Table: any) => vue.DefineComponent<Partial<ExtractPropTypes<{
631
- /**
632
- * extra 是否放到SearchForm中
633
- */
634
- extraInSearch: {
635
- type: BooleanConstructor;
636
- default: undefined;
637
- };
638
- searchProps: {
639
- type: PropType<Record<string, any>>;
640
- };
641
- tableProps: {
642
- type: PropType<Record<string, any>>;
643
- };
644
- paginationProps: {
645
- type: PropType<Record<string, any>>;
646
- };
647
- showPagination: {
648
- type: BooleanConstructor;
649
- default: boolean;
650
- };
651
- pageState: {
652
- type: PropType<TPageState>;
653
- };
654
- }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
655
- /**
656
- * extra 是否放到SearchForm中
657
- */
658
- extraInSearch: {
659
- type: BooleanConstructor;
660
- default: undefined;
661
- };
662
- searchProps: {
663
- type: PropType<Record<string, any>>;
664
- };
665
- tableProps: {
666
- type: PropType<Record<string, any>>;
667
- };
668
- paginationProps: {
669
- type: PropType<Record<string, any>>;
670
- };
671
- showPagination: {
672
- type: BooleanConstructor;
673
- default: boolean;
674
- };
675
- pageState: {
676
- type: PropType<TPageState>;
677
- };
641
+ declare const proCurdListProps: () => {
642
+ /**
643
+ * extra 是否放到SearchForm中
644
+ */
645
+ extraInSearch: {
646
+ type: BooleanConstructor;
647
+ default: undefined;
648
+ };
649
+ searchProps: {
650
+ type: PropType<Record<string, any>>;
651
+ };
652
+ tableProps: {
653
+ type: PropType<Record<string, any>>;
654
+ };
655
+ paginationProps: {
656
+ type: PropType<Record<string, any>>;
657
+ };
658
+ showPagination: {
659
+ type: BooleanConstructor;
660
+ default: boolean;
661
+ };
662
+ pageState: {
663
+ type: PropType<TPageState>;
664
+ };
665
+ };
666
+ declare type ProCurdListProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdListProps>>>;
667
+ declare const createCurdList: (SearchForm: any, Table: any) => vue.DefineComponent<Partial<ExtractPropTypes<{
668
+ /**
669
+ * extra 是否放到SearchForm中
670
+ */
671
+ extraInSearch: {
672
+ type: BooleanConstructor;
673
+ default: undefined;
674
+ };
675
+ searchProps: {
676
+ type: PropType<Record<string, any>>;
677
+ };
678
+ tableProps: {
679
+ type: PropType<Record<string, any>>;
680
+ };
681
+ paginationProps: {
682
+ type: PropType<Record<string, any>>;
683
+ };
684
+ showPagination: {
685
+ type: BooleanConstructor;
686
+ default: boolean;
687
+ };
688
+ pageState: {
689
+ type: PropType<TPageState>;
690
+ };
691
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
692
+ /**
693
+ * extra 是否放到SearchForm中
694
+ */
695
+ extraInSearch: {
696
+ type: BooleanConstructor;
697
+ default: undefined;
698
+ };
699
+ searchProps: {
700
+ type: PropType<Record<string, any>>;
701
+ };
702
+ tableProps: {
703
+ type: PropType<Record<string, any>>;
704
+ };
705
+ paginationProps: {
706
+ type: PropType<Record<string, any>>;
707
+ };
708
+ showPagination: {
709
+ type: BooleanConstructor;
710
+ default: boolean;
711
+ };
712
+ pageState: {
713
+ type: PropType<TPageState>;
714
+ };
678
715
  }>>>, {}>;
679
716
 
680
- interface IProFormProvideExtra extends Record<string, any> {
681
- }
682
- interface IProFormProvide extends IProFormProvideExtra {
683
- formState: UnwrapNestedRefs<Record<string, any>>;
684
- showState: UnwrapNestedRefs<Record<string, any>>;
685
- readonlyState: UnwrapNestedRefs<Record<string, any>>;
686
- disableState: UnwrapNestedRefs<Record<string, any>>;
687
- readonly: Ref<boolean | undefined>;
688
- elementMap?: TElementMap;
689
- formElementMap?: TElementMap;
690
- columns: Ref<TColumns>;
691
- }
692
- declare const useProForm: () => IProFormProvide;
693
- declare const proFormProps: () => {
694
- /**
695
- * 同 antd 或 element form中的model
696
- */
697
- model: {
698
- type: PropType<Record<string, any>>;
699
- };
700
- /**
701
- * 子组件是否只读样式
702
- */
703
- readonly: {
704
- type: BooleanConstructor;
705
- default: undefined;
706
- };
707
- /**
708
- * FormComponent 根据此项来确定组件是否显示
709
- * rules 根据rules中方法生成showState对象
710
- */
711
- showState: {
712
- type: PropType<BooleanObjType>;
713
- };
714
- showStateRules: {
715
- type: PropType<BooleanRulesObjType>;
716
- };
717
- /**
718
- * 是否只读
719
- */
720
- readonlyState: {
721
- type: PropType<BooleanObjType>;
722
- };
723
- readonlyStateRules: {
724
- type: PropType<BooleanRulesObjType>;
725
- };
726
- /**
727
- * 是否disabled
728
- */
729
- disableState: {
730
- type: PropType<BooleanObjType>;
731
- };
732
- disableStateRules: {
733
- type: PropType<BooleanRulesObjType>;
734
- };
735
- /**
736
- *
737
- */
738
- columns: {
739
- type: PropType<TColumns>;
740
- };
741
- columnState: {
742
- type: PropType<Record<string, any>>;
743
- };
744
- /**
745
- * 展示控件集合,readonly模式下使用这些组件渲染
746
- */
747
- elementMap: {
748
- type: PropType<TElementMap>;
749
- };
750
- /**
751
- * 录入控件集合
752
- */
753
- formElementMap: {
754
- type: PropType<TElementMap>;
755
- };
756
- /**
757
- * 是否启用rules验证
758
- */
759
- needRules: {
760
- type: BooleanConstructor;
761
- default: boolean;
762
- };
763
- /**
764
- * provide传递
765
- */
766
- provideExtra: {
767
- type: PropType<IProFormProvideExtra>;
768
- };
769
- };
770
- declare type ProFormProps = Partial<ExtractPropTypes<ReturnType<typeof proFormProps>>>;
717
+ interface IProFormProvideExtra extends Record<string, any> {
718
+ }
719
+ interface IProFormProvide extends IProFormProvideExtra {
720
+ formState: UnwrapNestedRefs<Record<string, any>>;
721
+ showState: UnwrapNestedRefs<Record<string, any>>;
722
+ readonlyState: UnwrapNestedRefs<Record<string, any>>;
723
+ disableState: UnwrapNestedRefs<Record<string, any>>;
724
+ readonly: Ref<boolean | undefined>;
725
+ elementMap?: TElementMap;
726
+ formElementMap?: TElementMap;
727
+ columns: Ref<TColumns>;
728
+ }
729
+ declare const useProForm: () => IProFormProvide;
730
+ declare const proFormProps: () => {
731
+ /**
732
+ * 同 antd 或 element form中的model
733
+ */
734
+ model: {
735
+ type: PropType<Record<string, any>>;
736
+ };
737
+ /**
738
+ * 子组件是否只读样式
739
+ */
740
+ readonly: {
741
+ type: BooleanConstructor;
742
+ default: undefined;
743
+ };
744
+ /**
745
+ * FormComponent 根据此项来确定组件是否显示
746
+ * rules 根据rules中方法生成showState对象
747
+ */
748
+ showState: {
749
+ type: PropType<BooleanObjType>;
750
+ };
751
+ showStateRules: {
752
+ type: PropType<BooleanRulesObjType>;
753
+ };
754
+ /**
755
+ * 是否只读
756
+ */
757
+ readonlyState: {
758
+ type: PropType<BooleanObjType>;
759
+ };
760
+ readonlyStateRules: {
761
+ type: PropType<BooleanRulesObjType>;
762
+ };
763
+ /**
764
+ * 是否disabled
765
+ */
766
+ disableState: {
767
+ type: PropType<BooleanObjType>;
768
+ };
769
+ disableStateRules: {
770
+ type: PropType<BooleanRulesObjType>;
771
+ };
772
+ /**
773
+ * 是否启用rules验证
774
+ */
775
+ needRules: {
776
+ type: BooleanConstructor;
777
+ default: boolean;
778
+ };
779
+ /**
780
+ * provide传递
781
+ */
782
+ provideExtra: {
783
+ type: PropType<IProFormProvideExtra>;
784
+ };
785
+ };
786
+ declare type ProFormProps = Partial<ExtractPropTypes<ReturnType<typeof proFormProps>>> & ProBaseProps;
771
787
  declare const createForm: (Form: any, Grid: any, formMethods: string[]) => any;
772
788
 
773
- declare enum SearchMode {
774
- AUTO = "AUTO",
775
- MANUAL = "MANUAL"
776
- }
777
- declare type ISearchMode = keyof typeof SearchMode;
778
- declare const proSearchFormProps: () => {
779
- /**
780
- * 需要监听的对象
781
- */
782
- model: {
783
- type: PropType<Record<string, any>>;
784
- };
785
- /**
786
- * 初始化触发 onFinish
787
- */
788
- initEmit: {
789
- type: BooleanConstructor;
790
- default: boolean;
791
- };
792
- /**
793
- * 模式 自动触发或者手动触发 onFinish
794
- */
795
- searchMode: {
796
- type: PropType<"AUTO" | "MANUAL">;
797
- default: SearchMode;
798
- };
799
- /**
800
- * 配置 同ProForm中的columns
801
- * 可以根据column中valueType计算出默认的debounceKeys
802
- */
803
- columns: {
804
- type: PropType<TColumns>;
805
- };
806
- /**
807
- * 需要debounce处理的字段
808
- */
809
- debounceKeys: {
810
- type: PropType<string[]>;
811
- };
812
- debounceTypes: {
813
- type: PropType<string[]>;
814
- default: string[];
815
- };
816
- debounceTime: {
817
- type: NumberConstructor;
818
- default: number;
819
- };
820
- };
821
- declare type ProSearchFormProps = Partial<ExtractPropTypes<ReturnType<typeof proSearchFormProps>>>;
822
- /**
823
- * 该组件只是个模式,最终返回null,不做任何渲染,应配合着ProForm的包装类一起使用
824
- * 针对传入的model(监听对象)做相应的finish(回调)处理
825
- */
789
+ declare enum SearchMode {
790
+ AUTO = "AUTO",
791
+ MANUAL = "MANUAL"
792
+ }
793
+ declare type ISearchMode = keyof typeof SearchMode;
794
+ declare const proSearchFormProps: () => {
795
+ /**
796
+ * 初始化触发 onFinish
797
+ */
798
+ initEmit: {
799
+ type: BooleanConstructor;
800
+ default: boolean;
801
+ };
802
+ /**
803
+ * 模式 自动触发或者手动触发 onFinish
804
+ */
805
+ searchMode: {
806
+ type: PropType<"AUTO" | "MANUAL">;
807
+ default: SearchMode;
808
+ };
809
+ /**
810
+ * 需要debounce处理的字段
811
+ */
812
+ debounceKeys: {
813
+ type: PropType<string[]>;
814
+ };
815
+ debounceTypes: {
816
+ type: PropType<string[]>;
817
+ default: string[];
818
+ };
819
+ debounceTime: {
820
+ type: NumberConstructor;
821
+ default: number;
822
+ };
823
+ };
824
+ declare type ProSearchFormProps = Partial<ExtractPropTypes<ReturnType<typeof proSearchFormProps>>> & ProFormProps;
825
+ /**
826
+ * 该组件只是个模式,最终返回null,不做任何渲染,应配合着ProForm的包装类一起使用
827
+ * 针对传入的model(监听对象)做相应的finish(回调)处理
828
+ */
826
829
  declare const createSearchForm: (Form: any, Props: any, formMethods: string[]) => any;
827
830
 
828
- interface FormItemProps {
829
- name?: string | number | (string | number)[];
830
- }
831
- declare const proFormItemProps: () => {
832
- readonly: {
833
- type: BooleanConstructor;
834
- default: undefined;
835
- };
836
- fieldProps: {
837
- type: ObjectConstructor;
838
- };
839
- showProps: {
840
- type: ObjectConstructor;
841
- };
842
- slots: {
843
- type: ObjectConstructor;
844
- };
845
- };
846
- declare type ProFormItemProps = Partial<ExtractPropTypes<ReturnType<typeof proFormItemProps>>> & Record<string, any>;
847
- declare const createFormItemCompFn: <T extends FormItemProps>(FormItem: any, convertInputCompProps: (value: any, setValue: (v: any) => void, disabled: boolean | undefined) => Record<string, any>) => ({ InputComp, valueType, name }: {
848
- InputComp: any;
849
- valueType: TValueType;
850
- name?: string | undefined;
851
- }) => vue.DefineComponent<T & Partial<ExtractPropTypes<{
852
- readonly: {
853
- type: BooleanConstructor;
854
- default: undefined;
855
- };
856
- fieldProps: {
857
- type: ObjectConstructor;
858
- };
859
- showProps: {
860
- type: ObjectConstructor;
861
- };
862
- slots: {
863
- type: ObjectConstructor;
864
- };
865
- }>> & Record<string, any>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<T & Partial<ExtractPropTypes<{
866
- readonly: {
867
- type: BooleanConstructor;
868
- default: undefined;
869
- };
870
- fieldProps: {
871
- type: ObjectConstructor;
872
- };
873
- showProps: {
874
- type: ObjectConstructor;
875
- };
876
- slots: {
877
- type: ObjectConstructor;
878
- };
879
- }>> & Record<string, any> extends infer T_1 ? T_1 extends T & Partial<ExtractPropTypes<{
880
- readonly: {
881
- type: BooleanConstructor;
882
- default: undefined;
883
- };
884
- fieldProps: {
885
- type: ObjectConstructor;
886
- };
887
- showProps: {
888
- type: ObjectConstructor;
889
- };
890
- slots: {
891
- type: ObjectConstructor;
892
- };
893
- }>> & Record<string, any> ? T_1 extends vue.ComponentPropsOptions<{
894
- [x: string]: unknown;
895
- }> ? ExtractPropTypes<T_1> : T_1 : never : never>, vue.ExtractDefaultPropTypes<T & Partial<ExtractPropTypes<{
896
- readonly: {
897
- type: BooleanConstructor;
898
- default: undefined;
899
- };
900
- fieldProps: {
901
- type: ObjectConstructor;
902
- };
903
- showProps: {
904
- type: ObjectConstructor;
905
- };
906
- slots: {
907
- type: ObjectConstructor;
908
- };
831
+ interface FormItemProps {
832
+ name?: string | number | (string | number)[];
833
+ }
834
+ declare const proFormItemProps: () => {
835
+ readonly: {
836
+ type: BooleanConstructor;
837
+ default: undefined;
838
+ };
839
+ fieldProps: {
840
+ type: ObjectConstructor;
841
+ };
842
+ showProps: {
843
+ type: ObjectConstructor;
844
+ };
845
+ slots: {
846
+ type: ObjectConstructor;
847
+ };
848
+ };
849
+ declare type ProFormItemProps = Partial<ExtractPropTypes<ReturnType<typeof proFormItemProps>>> & Record<string, any>;
850
+ declare const createFormItemCompFn: <T extends FormItemProps>(FormItem: any, convertInputCompProps: (value: any, setValue: (v: any) => void, disabled: boolean | undefined) => Record<string, any>) => ({ InputComp, valueType, name }: {
851
+ InputComp: any;
852
+ valueType: TValueType;
853
+ name?: string | undefined;
854
+ }) => vue.DefineComponent<T & Partial<ExtractPropTypes<{
855
+ readonly: {
856
+ type: BooleanConstructor;
857
+ default: undefined;
858
+ };
859
+ fieldProps: {
860
+ type: ObjectConstructor;
861
+ };
862
+ showProps: {
863
+ type: ObjectConstructor;
864
+ };
865
+ slots: {
866
+ type: ObjectConstructor;
867
+ };
868
+ }>> & Record<string, any>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<T & Partial<ExtractPropTypes<{
869
+ readonly: {
870
+ type: BooleanConstructor;
871
+ default: undefined;
872
+ };
873
+ fieldProps: {
874
+ type: ObjectConstructor;
875
+ };
876
+ showProps: {
877
+ type: ObjectConstructor;
878
+ };
879
+ slots: {
880
+ type: ObjectConstructor;
881
+ };
882
+ }>> & Record<string, any> extends infer T_1 ? T_1 extends T & Partial<ExtractPropTypes<{
883
+ readonly: {
884
+ type: BooleanConstructor;
885
+ default: undefined;
886
+ };
887
+ fieldProps: {
888
+ type: ObjectConstructor;
889
+ };
890
+ showProps: {
891
+ type: ObjectConstructor;
892
+ };
893
+ slots: {
894
+ type: ObjectConstructor;
895
+ };
896
+ }>> & Record<string, any> ? T_1 extends vue.ComponentPropsOptions<{
897
+ [x: string]: unknown;
898
+ }> ? ExtractPropTypes<T_1> : T_1 : never : never>, vue.ExtractDefaultPropTypes<T & Partial<ExtractPropTypes<{
899
+ readonly: {
900
+ type: BooleanConstructor;
901
+ default: undefined;
902
+ };
903
+ fieldProps: {
904
+ type: ObjectConstructor;
905
+ };
906
+ showProps: {
907
+ type: ObjectConstructor;
908
+ };
909
+ slots: {
910
+ type: ObjectConstructor;
911
+ };
909
912
  }>> & Record<string, any>>>;
910
913
 
911
- interface IProFormListProvide {
912
- pathList: (string | number)[];
913
- }
914
- declare const useProFormList: () => IProFormListProvide;
915
- declare const provideProFormList: (ctx: IProFormListProvide) => void;
916
- declare const proFormListProps: () => {
917
- rowKey: {
918
- type: StringConstructor;
919
- default: string;
920
- };
921
- name: {
922
- type: PropType<string | number | (string | number)[]>;
923
- required: boolean;
924
- };
925
- };
926
- declare type ProFormListProps = Partial<ExtractPropTypes<ReturnType<typeof proFormListProps>>>;
914
+ interface IProFormListProvide {
915
+ pathList: (string | number)[];
916
+ }
917
+ declare const useProFormList: () => IProFormListProvide;
918
+ declare const provideProFormList: (ctx: IProFormListProvide) => void;
919
+ declare const proFormListProps: () => {
920
+ rowKey: {
921
+ type: StringConstructor;
922
+ default: string;
923
+ };
924
+ name: {
925
+ type: PropType<string | number | (string | number)[]>;
926
+ required: boolean;
927
+ };
928
+ };
929
+ declare type ProFormListProps = Partial<ExtractPropTypes<ReturnType<typeof proFormListProps>>>;
927
930
  declare const createFormList: (FormItem: any) => any;
928
931
 
929
- /**
930
- * 剔除showState或showStateRules规则为!true的值
931
- * @param values
932
- * @param showState
933
- * @param showStateRules
934
- */
935
- declare const getValidValues: (values: Record<string, any>, showState?: BooleanObjType, showStateRules?: BooleanRulesObjType) => Record<string, any>;
936
- /**
937
- * string类型的path转为arr
938
- * @param path
939
- */
940
- declare const convertPathToList: (path: undefined | string | number | (string | number)[]) => undefined | (string | number)[];
941
- /**
942
- * 将listState 中的数据通过id merge到 list item中
943
- * ps:数组会替换
944
- * 注意:mergeWith 会改变原始对象
945
- * @param list
946
- * @param listState
947
- * @param id
948
- */
932
+ /**
933
+ * 剔除showState或showStateRules规则为!true的值
934
+ * @param values
935
+ * @param showState
936
+ * @param showStateRules
937
+ */
938
+ declare const getValidValues: (values: Record<string, any>, showState?: BooleanObjType, showStateRules?: BooleanRulesObjType) => Record<string, any>;
939
+ /**
940
+ * string类型的path转为arr
941
+ * @param path
942
+ */
943
+ declare const convertPathToList: (path: undefined | string | number | (string | number)[]) => undefined | (string | number)[];
944
+ /**
945
+ * 将listState 中的数据通过id merge到 list item中
946
+ * ps:数组会替换
947
+ * 注意:mergeWith 会改变原始对象
948
+ * @param list
949
+ * @param listState
950
+ * @param id
951
+ */
949
952
  declare const mergeStateToList: (list: Record<string, any>[], listState: Record<string, any>, id: string | number | ((item: Record<string, any>) => string | number)) => Record<string, any>[];
950
953
 
951
- /**
952
- * ref 传递
953
- */
954
- declare const createExpose: (methods: string[], targetRef: Ref$1) => {};
954
+ /**
955
+ * ref 传递
956
+ */
957
+ declare const createExpose: (methods: string[], targetRef: Ref$1) => Record<string, any>;
958
+ declare const createExposeObj: (targetRef: Ref$1, methods?: string[], opts?: Record<string, any>) => Record<string, any>;
955
959
 
956
- export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, TreeOption, TreeOptions, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
960
+ export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProConfigProvide, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProBaseProps, ProConfig, ProConfigProps, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, TreeOption, TreeOptions, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createExposeObj, createForm, createFormItemCompFn, createFormList, createGrid, createProConfig, createSearchForm, createTable, defaultPage, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, proBaseProps, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProConfig, useProCurd, useProForm, useProFormList, useProModule, useProTable };