@vtj/ui 0.8.39 → 0.8.40

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.
Files changed (31) hide show
  1. package/dist/index.mjs +18417 -17967
  2. package/dist/index.umd.js +14 -14
  3. package/dist/style.css +1 -1
  4. package/package.json +6 -6
  5. package/types/adapter.d.ts +3 -1
  6. package/types/components/field/Field.d.ts +3 -3
  7. package/types/components/field/builtin.d.ts +2 -1
  8. package/types/components/field/index.d.ts +1 -0
  9. package/types/components/field/types.d.ts +4 -4
  10. package/types/components/grid/Grid.d.ts +56 -46
  11. package/types/components/grid/hooks/index.d.ts +1 -0
  12. package/types/components/grid/hooks/useLoader.d.ts +661 -0
  13. package/types/components/grid/hooks/useProps.d.ts +6 -21
  14. package/types/components/grid/hooks/useState.d.ts +654 -0
  15. package/types/components/grid/props.d.ts +22 -25
  16. package/types/components/grid/renderers/components/PickerEdit.d.ts +18 -0
  17. package/types/components/grid/renderers/picker.d.ts +3 -0
  18. package/types/components/grid/types.d.ts +14 -0
  19. package/types/components/index.d.ts +1 -0
  20. package/types/components/list/List.d.ts +1 -1
  21. package/types/components/picker/Dialog.d.ts +24 -0
  22. package/types/components/picker/Picker.d.ts +436 -0
  23. package/types/components/picker/hooks.d.ts +14 -0
  24. package/types/components/picker/index.d.ts +4 -0
  25. package/types/components/picker/props.d.ts +269 -0
  26. package/types/components/picker/types.d.ts +19 -0
  27. package/types/components/query-form/QueryForm.d.ts +9 -0
  28. package/types/components/query-form/hooks.d.ts +2 -1
  29. package/types/components/query-form/props.d.ts +4 -0
  30. package/types/components/shared.d.ts +1 -0
  31. package/types/version.d.ts +2 -2
@@ -0,0 +1,269 @@
1
+ import { PropType, ExtractPropTypes, VNode, RendererNode, RendererElement, DefineComponent } from 'vue';
2
+ import { GridColumns, QueryFormItems, GridLoader, UnReadOnly, IconParam, BaseSize, DialogMode, GridCustomInfo, GridCellRenders, GridEditRenders, GridFilterRenders } from '..';
3
+ import { DraggableOptions, ResizableOptions } from '../..';
4
+ import { Options } from 'sortablejs';
5
+
6
+ export declare const pickerProps: {
7
+ /**
8
+ * 表格列配置
9
+ */
10
+ columns: {
11
+ type: PropType< GridColumns>;
12
+ };
13
+ /**
14
+ * 查询条件表单字段
15
+ */
16
+ fields: {
17
+ type: PropType< QueryFormItems>;
18
+ };
19
+ /**
20
+ * 表格数据加载器
21
+ */
22
+ loader: {
23
+ type: PropType< GridLoader>;
24
+ };
25
+ /**
26
+ * 值
27
+ */
28
+ modelValue: {
29
+ type: (StringConstructor | NumberConstructor | ObjectConstructor | ArrayConstructor)[];
30
+ };
31
+ /**
32
+ * 多选模式
33
+ */
34
+ multiple: {
35
+ type: BooleanConstructor;
36
+ };
37
+ /**
38
+ * 值为对象模式
39
+ */
40
+ raw: {
41
+ type: BooleanConstructor;
42
+ };
43
+ /**
44
+ * 禁用
45
+ */
46
+ disabled: {
47
+ type: BooleanConstructor;
48
+ };
49
+ /**
50
+ * 多选追加模式
51
+ */
52
+ append: {
53
+ type: BooleanConstructor;
54
+ };
55
+ /**
56
+ * 值映射字段名称
57
+ */
58
+ valueKey: {
59
+ type: StringConstructor;
60
+ default: string;
61
+ };
62
+ /**
63
+ * 输入框显示映射字段名称
64
+ */
65
+ labelKey: {
66
+ type: StringConstructor;
67
+ default: string;
68
+ };
69
+ /**
70
+ * 查询参数名称
71
+ */
72
+ queryKey: {
73
+ type: StringConstructor;
74
+ };
75
+ /**
76
+ * 单选模式,回车时自动检测取回有且计有唯一数据
77
+ */
78
+ preload: {
79
+ type: BooleanConstructor;
80
+ };
81
+ /**
82
+ * 初始默认查询参数
83
+ */
84
+ defaultQuery: {
85
+ type: PropType<() => any>;
86
+ };
87
+ /**
88
+ * 弹窗组件配置参数
89
+ */
90
+ dialogProps: {
91
+ type: PropType< UnReadOnly<Partial<Readonly<Partial< ExtractPropTypes<{
92
+ modelValue: {
93
+ type: BooleanConstructor;
94
+ default: boolean;
95
+ };
96
+ title: {
97
+ type: StringConstructor;
98
+ };
99
+ subtitle: {
100
+ type: StringConstructor;
101
+ };
102
+ icon: {
103
+ type: PropType< IconParam>;
104
+ };
105
+ size: {
106
+ /**
107
+ * 禁用
108
+ */
109
+ type: PropType< BaseSize>;
110
+ default: string;
111
+ };
112
+ width: {
113
+ type: (StringConstructor | NumberConstructor)[];
114
+ default: string;
115
+ };
116
+ height: {
117
+ type: (StringConstructor | NumberConstructor)[];
118
+ default: string;
119
+ };
120
+ left: {
121
+ type: (StringConstructor | NumberConstructor)[];
122
+ };
123
+ top: {
124
+ type: (StringConstructor | NumberConstructor)[];
125
+ };
126
+ modal: {
127
+ /**
128
+ * 查询参数名称
129
+ */
130
+ type: BooleanConstructor;
131
+ default: boolean;
132
+ };
133
+ draggable: {
134
+ type: PropType<boolean | DraggableOptions>;
135
+ default: boolean;
136
+ };
137
+ resizable: {
138
+ type: PropType<boolean | ResizableOptions>;
139
+ };
140
+ closable: {
141
+ type: BooleanConstructor;
142
+ default: boolean;
143
+ };
144
+ maximizable: {
145
+ type: BooleanConstructor; /**
146
+ * 表格组件配置参数
147
+ */
148
+ default: boolean;
149
+ };
150
+ minimizable: {
151
+ type: BooleanConstructor;
152
+ default: boolean;
153
+ };
154
+ mode: {
155
+ type: PropType< DialogMode>;
156
+ default: string;
157
+ };
158
+ content: {
159
+ type: PropType<Record<string, any> | VNode<RendererNode, RendererElement, {
160
+ [key: string]: any;
161
+ }> | DefineComponent<any, any, any, any>>;
162
+ };
163
+ src: {
164
+ type: StringConstructor;
165
+ };
166
+ componentInstance: {
167
+ type: PropType<Record<string, any> | null>;
168
+ };
169
+ beforeClose: {
170
+ type: PropType<() => boolean | Promise<boolean>>;
171
+ };
172
+ submit: {
173
+ type: (BooleanConstructor | StringConstructor)[];
174
+ };
175
+ cancel: {
176
+ type: (BooleanConstructor | StringConstructor)[];
177
+ };
178
+ bodyPadding: {
179
+ type: BooleanConstructor;
180
+ default: boolean;
181
+ };
182
+ primary: {
183
+ type: BooleanConstructor;
184
+ };
185
+ }>>>>>>;
186
+ };
187
+ /**
188
+ * 表格组件配置参数
189
+ */
190
+ gridProps: {
191
+ type: PropType< UnReadOnly<Partial<Readonly<Partial< ExtractPropTypes<{
192
+ columns: {
193
+ type: PropType< GridColumns>;
194
+ default(): GridColumns;
195
+ };
196
+ loader: {
197
+ type: PropType< GridLoader>;
198
+ };
199
+ rowSortable: {
200
+ /**
201
+ * 多选模式
202
+ */
203
+ type: PropType<boolean | Options>;
204
+ default: boolean;
205
+ };
206
+ columnSortable: {
207
+ type: PropType<boolean | Options>;
208
+ default: boolean;
209
+ };
210
+ customable: {
211
+ type: BooleanConstructor;
212
+ };
213
+ getCustom: {
214
+ type: PropType<(id: string) => Promise< GridCustomInfo>>;
215
+ };
216
+ saveCustom: {
217
+ type: PropType<(info: GridCustomInfo) => Promise<any>>;
218
+ };
219
+ resizable: {
220
+ type: BooleanConstructor;
221
+ default: boolean;
222
+ };
223
+ pager: {
224
+ type: BooleanConstructor;
225
+ };
226
+ page: {
227
+ type: NumberConstructor; /**
228
+ * 表格组件配置参数
229
+ */
230
+ default: number;
231
+ };
232
+ pageSize: {
233
+ type: NumberConstructor;
234
+ default: number;
235
+ };
236
+ pageSizes: {
237
+ type: PropType<number[]>;
238
+ default: () => number[];
239
+ };
240
+ auto: {
241
+ type: BooleanConstructor;
242
+ default: boolean;
243
+ };
244
+ virtual: {
245
+ type: BooleanConstructor;
246
+ default: boolean;
247
+ };
248
+ cellRenders: {
249
+ type: PropType< GridCellRenders>;
250
+ };
251
+ editRenders: {
252
+ type: PropType< GridEditRenders>;
253
+ };
254
+ filterRenders: {
255
+ type: PropType< GridFilterRenders>;
256
+ };
257
+ editable: {
258
+ type: BooleanConstructor;
259
+ default: boolean;
260
+ };
261
+ }>>>>>>;
262
+ };
263
+ /**
264
+ * 查询表单参数
265
+ */
266
+ formProps: {
267
+ type: PropType<Record<string, any>>;
268
+ };
269
+ };
@@ -0,0 +1,19 @@
1
+ import { ComponentPropsType, UnReadOnly } from '../shared';
2
+ import { GridColumns, QueryFormItems, DialogProps, GridProps, GridLoader } from '../';
3
+ import { pickerProps } from './props';
4
+
5
+ export type PickerColumns = GridColumns;
6
+ export type PrickerFields = QueryFormItems;
7
+ export type PickerLoader = GridLoader;
8
+ export type PickerDialogProps = UnReadOnly<Partial<DialogProps>>;
9
+ export type PickerGridProps = UnReadOnly<Partial<GridProps>>;
10
+ export type PickerProps = ComponentPropsType<typeof pickerProps>;
11
+ export type PickerEmits = {
12
+ 'update:modelValue': [value: any];
13
+ change: [value: any];
14
+ picked: [value: any];
15
+ };
16
+ export interface PickerOption {
17
+ label: string;
18
+ value: any;
19
+ }
@@ -10,6 +10,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<{
10
10
  items: {
11
11
  type: PropType<QueryFormItems>;
12
12
  };
13
+ inlineColumns: {
14
+ type: NumberConstructor;
15
+ default: number;
16
+ };
13
17
  }, {
14
18
  submit: () => Promise<void>;
15
19
  reset: (fields?: string | string[] | undefined) => void;
@@ -209,10 +213,15 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<{
209
213
  items: {
210
214
  type: PropType<QueryFormItems>;
211
215
  };
216
+ inlineColumns: {
217
+ type: NumberConstructor;
218
+ default: number;
219
+ };
212
220
  }>> & {
213
221
  onCollapsed?: ((Collapsed: boolean) => any) | undefined;
214
222
  }, {
215
223
  collapsible: boolean;
224
+ inlineColumns: number;
216
225
  }, {}>, {
217
226
  default?(_: {}): any;
218
227
  }>;
@@ -6,9 +6,10 @@ export declare function useCollapsed(props: QueryFormProps, emit: Emits<QueryFor
6
6
  collapsed: Ref<boolean>;
7
7
  toggleCollapsed: () => Promise<void>;
8
8
  collapsedClass: ComputedRef<{
9
- 'is-collapsed': boolean;
9
+ 'is-collapsed': boolean | undefined;
10
10
  }>;
11
11
  collapsedStyle: ComputedRef<{
12
12
  height: string;
13
13
  } | null>;
14
+ showCollapsible: ComputedRef<boolean | undefined>;
14
15
  };
@@ -9,4 +9,8 @@ export declare const queryFormProps: {
9
9
  items: {
10
10
  type: PropType<QueryFormItems>;
11
11
  };
12
+ inlineColumns: {
13
+ type: NumberConstructor;
14
+ default: number;
15
+ };
12
16
  };
@@ -26,3 +26,4 @@ export type Emits<T extends Record<string, any>> = UnionToIntersection<RecordToU
26
26
  [K in keyof T]: (evt: K, ...args: T[K]) => void;
27
27
  }>>;
28
28
  export type DataLoader<T = any, P = any> = T | ((params?: P) => T | Promise<T>);
29
+ export type MaybePromise<T = any> = T | Promise<T>;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/ui
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.8.38
5
+ * @version 0.8.39
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.8.38";
8
+ export declare const version = "0.8.39";