@ramathibodi/nuxt-commons 4.0.12 → 4.0.14
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/module.json +1 -1
- package/dist/runtime/components/dialog/ImportProgress.d.vue.ts +35 -0
- package/dist/runtime/components/dialog/ImportProgress.vue +53 -0
- package/dist/runtime/components/dialog/ImportProgress.vue.d.ts +35 -0
- package/dist/runtime/components/dialog/ImportResult.d.vue.ts +28 -0
- package/dist/runtime/components/dialog/ImportResult.vue +122 -0
- package/dist/runtime/components/dialog/ImportResult.vue.d.ts +28 -0
- package/dist/runtime/components/document/TemplateBuilder.vue +112 -7
- package/dist/runtime/components/model/Pad.vue +2 -1
- package/dist/runtime/components/model/Table.d.vue.ts +104 -28
- package/dist/runtime/components/model/Table.vue +118 -3
- package/dist/runtime/components/model/Table.vue.d.ts +104 -28
- package/dist/runtime/components/model/iterator.d.vue.ts +146 -49
- package/dist/runtime/components/model/iterator.vue +129 -5
- package/dist/runtime/components/model/iterator.vue.d.ts +146 -49
- package/dist/runtime/composables/api.d.ts +7 -0
- package/dist/runtime/composables/api.js +3 -2
- package/dist/runtime/composables/apiModel.d.ts +31 -3
- package/dist/runtime/composables/apiModel.js +30 -21
- package/dist/runtime/composables/apiModelOperation.d.ts +17 -3
- package/dist/runtime/composables/apiModelOperation.js +6 -6
- package/dist/runtime/composables/document/template.d.ts +61 -0
- package/dist/runtime/composables/document/template.js +59 -0
- package/dist/runtime/composables/document/validateTemplate.d.ts +62 -0
- package/dist/runtime/composables/document/validateTemplate.js +378 -0
- package/dist/runtime/composables/graphql.d.ts +3 -3
- package/dist/runtime/composables/graphql.js +6 -6
- package/dist/runtime/composables/graphqlModel.d.ts +31 -3
- package/dist/runtime/composables/graphqlModel.js +28 -20
- package/dist/runtime/composables/graphqlModelOperation.d.ts +1 -0
- package/dist/runtime/composables/graphqlOperation.d.ts +2 -1
- package/dist/runtime/composables/graphqlOperation.js +3 -3
- package/dist/runtime/composables/importProgress.d.ts +58 -0
- package/dist/runtime/composables/importProgress.js +130 -0
- package/dist/runtime/types/graphqlOperation.d.ts +12 -1
- package/dist/runtime/utils/virtualize.d.ts +15 -0
- package/dist/runtime/utils/virtualize.js +10 -0
- package/package.json +2 -1
- package/scripts/validate-document-template.mjs +158 -0
- package/templates/.codegen/plugin-schema-object.cjs +10 -13
|
@@ -18,6 +18,7 @@ interface Props extends /* @vue-ignore */ InstanceType<typeof VDataTable['$props
|
|
|
18
18
|
search?: string;
|
|
19
19
|
saveAndStay?: boolean;
|
|
20
20
|
stringFields?: Array<string>;
|
|
21
|
+
importConcurrency?: number;
|
|
21
22
|
onlyOwnerEdit?: boolean;
|
|
22
23
|
onlyOwnerOverridePermission?: string | string[];
|
|
23
24
|
api?: boolean;
|
|
@@ -26,6 +27,9 @@ interface Props extends /* @vue-ignore */ InstanceType<typeof VDataTable['$props
|
|
|
26
27
|
autoRefresh?: number | boolean;
|
|
27
28
|
autoRefreshDefault?: number;
|
|
28
29
|
autoRefreshControl?: boolean;
|
|
30
|
+
virtual?: boolean;
|
|
31
|
+
virtualThreshold?: number;
|
|
32
|
+
virtualHeight?: number | string;
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
31
35
|
* Public props accepted by ModelTable.
|
|
@@ -39,9 +43,9 @@ declare var __VLS_8: {
|
|
|
39
43
|
operation: {
|
|
40
44
|
openDialog: typeof openDialog;
|
|
41
45
|
openDialogReadonly: typeof openDialogReadonly;
|
|
42
|
-
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<any>);
|
|
43
|
-
importItems: ((
|
|
44
|
-
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
46
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
47
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
48
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
45
49
|
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
46
50
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
47
51
|
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
@@ -72,9 +76,9 @@ declare var __VLS_8: {
|
|
|
72
76
|
operation: {
|
|
73
77
|
openDialog: typeof openDialog;
|
|
74
78
|
openDialogReadonly: typeof openDialogReadonly;
|
|
75
|
-
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<any>);
|
|
76
|
-
importItems: ((
|
|
77
|
-
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
79
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
80
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
81
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
78
82
|
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
79
83
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
80
84
|
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
@@ -93,9 +97,9 @@ declare var __VLS_8: {
|
|
|
93
97
|
operation: {
|
|
94
98
|
openDialog: typeof openDialog;
|
|
95
99
|
openDialogReadonly: typeof openDialogReadonly;
|
|
96
|
-
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<any>);
|
|
97
|
-
importItems: ((
|
|
98
|
-
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
100
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
101
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
102
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
99
103
|
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
100
104
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
101
105
|
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
@@ -113,9 +117,9 @@ declare var __VLS_8: {
|
|
|
113
117
|
operation: {
|
|
114
118
|
openDialog: typeof openDialog;
|
|
115
119
|
openDialogReadonly: typeof openDialogReadonly;
|
|
116
|
-
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<any>);
|
|
117
|
-
importItems: ((
|
|
118
|
-
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
120
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
121
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
122
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
119
123
|
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
120
124
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
121
125
|
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
@@ -133,9 +137,9 @@ declare var __VLS_8: {
|
|
|
133
137
|
operation: {
|
|
134
138
|
openDialog: typeof openDialog;
|
|
135
139
|
openDialogReadonly: typeof openDialogReadonly;
|
|
136
|
-
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<any>);
|
|
137
|
-
importItems: ((
|
|
138
|
-
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
140
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
141
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
142
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
139
143
|
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
140
144
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
141
145
|
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
@@ -149,11 +153,40 @@ declare var __VLS_8: {
|
|
|
149
153
|
onlyOwnerOverridePermission: string | string[] | undefined;
|
|
150
154
|
autoRefresh: import("vue").Raw<import("#imports").UseAutoRefreshHandle>;
|
|
151
155
|
};
|
|
152
|
-
},
|
|
156
|
+
}, __VLS_176: never, __VLS_177: {
|
|
157
|
+
operation: {
|
|
158
|
+
openDialog: typeof openDialog;
|
|
159
|
+
openDialogReadonly: typeof openDialogReadonly;
|
|
160
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
161
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
162
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
163
|
+
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
164
|
+
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
165
|
+
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
166
|
+
canServerPageable: boolean;
|
|
167
|
+
canServerSearch: boolean;
|
|
168
|
+
canCreate: boolean;
|
|
169
|
+
canUpdate: boolean;
|
|
170
|
+
canDelete: boolean;
|
|
171
|
+
canEditRow: (item: Record<string, any>) => boolean;
|
|
172
|
+
onlyOwnerEdit: boolean;
|
|
173
|
+
onlyOwnerOverridePermission: string | string[] | undefined;
|
|
174
|
+
autoRefresh: import("vue").Raw<import("#imports").UseAutoRefreshHandle>;
|
|
175
|
+
};
|
|
176
|
+
}, __VLS_212: any, __VLS_215: any, __VLS_218: any, __VLS_220: {
|
|
177
|
+
isImporting: boolean;
|
|
178
|
+
total: number;
|
|
179
|
+
processed: number;
|
|
180
|
+
succeeded: number;
|
|
181
|
+
failed: number;
|
|
182
|
+
percent: number;
|
|
183
|
+
};
|
|
153
184
|
type __VLS_Slots = {} & {
|
|
154
185
|
[K in NonNullable<typeof __VLS_102>]?: (props: typeof __VLS_103) => any;
|
|
155
186
|
} & {
|
|
156
187
|
[K in NonNullable<typeof __VLS_135>]?: (props: typeof __VLS_136) => any;
|
|
188
|
+
} & {
|
|
189
|
+
[K in NonNullable<typeof __VLS_176>]?: (props: typeof __VLS_177) => any;
|
|
157
190
|
} & {
|
|
158
191
|
header?: (props: typeof __VLS_8) => any;
|
|
159
192
|
} & {
|
|
@@ -165,11 +198,13 @@ type __VLS_Slots = {} & {
|
|
|
165
198
|
} & {
|
|
166
199
|
toolbarItems?: (props: typeof __VLS_70) => any;
|
|
167
200
|
} & {
|
|
168
|
-
form?: (props: typeof
|
|
201
|
+
form?: (props: typeof __VLS_212) => any;
|
|
169
202
|
} & {
|
|
170
|
-
formTitle?: (props: typeof
|
|
203
|
+
formTitle?: (props: typeof __VLS_215) => any;
|
|
171
204
|
} & {
|
|
172
|
-
formAction?: (props: typeof
|
|
205
|
+
formAction?: (props: typeof __VLS_218) => any;
|
|
206
|
+
} & {
|
|
207
|
+
importProgress?: (props: typeof __VLS_220) => any;
|
|
173
208
|
};
|
|
174
209
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
175
210
|
noDataText: string;
|
|
@@ -184,20 +219,24 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
184
219
|
modelBy: undefined;
|
|
185
220
|
fields: () => never[];
|
|
186
221
|
stringFields: () => never[];
|
|
222
|
+
importConcurrency: number;
|
|
187
223
|
onlyOwnerEdit: boolean;
|
|
188
224
|
api: boolean;
|
|
189
225
|
perPageStorageEnabled: boolean;
|
|
190
226
|
autoRefresh: boolean;
|
|
191
227
|
autoRefreshDefault: number;
|
|
192
228
|
autoRefreshControl: boolean;
|
|
229
|
+
virtual: undefined;
|
|
230
|
+
virtualThreshold: number;
|
|
231
|
+
virtualHeight: string;
|
|
193
232
|
}>>, {
|
|
194
233
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
195
234
|
operation: import("vue").Ref<{
|
|
196
235
|
openDialog: typeof openDialog;
|
|
197
236
|
openDialogReadonly: typeof openDialogReadonly;
|
|
198
|
-
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<any>);
|
|
199
|
-
importItems: ((
|
|
200
|
-
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
237
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
238
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
239
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
201
240
|
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
202
241
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
203
242
|
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
@@ -213,9 +252,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
213
252
|
}, {
|
|
214
253
|
openDialog: typeof openDialog;
|
|
215
254
|
openDialogReadonly: typeof openDialogReadonly;
|
|
216
|
-
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<any>);
|
|
217
|
-
importItems: ((
|
|
218
|
-
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
255
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
256
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
257
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
219
258
|
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
220
259
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
221
260
|
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
@@ -231,9 +270,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
231
270
|
} | {
|
|
232
271
|
openDialog: typeof openDialog;
|
|
233
272
|
openDialogReadonly: typeof openDialogReadonly;
|
|
234
|
-
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<any>);
|
|
235
|
-
importItems: ((
|
|
236
|
-
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
273
|
+
createItem: ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
274
|
+
importItems: ((importData: Record<string, any>[], callback?: FormDialogCallback) => void) | ((importData: Record<string, any>[], callback?: FormDialogCallback) => void);
|
|
275
|
+
updateItem: ((item: Record<string, any>, callback?: FormDialogCallback, idempotencySalt?: string | number) => Promise<void>) | ((item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean, idempotencySalt?: string | number) => Promise<any>);
|
|
237
276
|
deleteItem: ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>) | ((item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>);
|
|
238
277
|
reload: (() => Promise<void> | undefined) | (() => Promise<void>);
|
|
239
278
|
setSearch: ((keyword: string) => void) | ((keyword: string) => void);
|
|
@@ -249,6 +288,39 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
249
288
|
}>;
|
|
250
289
|
items: import("vue").Ref<Record<string, any>[], Record<string, any>[]>;
|
|
251
290
|
autoRefresh: import("#imports").UseAutoRefreshHandle;
|
|
291
|
+
importProgress: {
|
|
292
|
+
isImporting: import("vue").Ref<boolean, boolean>;
|
|
293
|
+
total: import("vue").Ref<number, number>;
|
|
294
|
+
processed: import("vue").Ref<number, number>;
|
|
295
|
+
succeeded: import("vue").Ref<number, number>;
|
|
296
|
+
failed: import("vue").Ref<number, number>;
|
|
297
|
+
errors: import("vue").Ref<{
|
|
298
|
+
index: number;
|
|
299
|
+
item: any;
|
|
300
|
+
errorType: import("#imports").ImportErrorType;
|
|
301
|
+
message: string;
|
|
302
|
+
detail?: any;
|
|
303
|
+
}[], import("#imports").ImportError[] | {
|
|
304
|
+
index: number;
|
|
305
|
+
item: any;
|
|
306
|
+
errorType: import("#imports").ImportErrorType;
|
|
307
|
+
message: string;
|
|
308
|
+
detail?: any;
|
|
309
|
+
}[]>;
|
|
310
|
+
percent: import("vue").ComputedRef<number>;
|
|
311
|
+
resultVisible: import("vue").Ref<boolean, boolean>;
|
|
312
|
+
reset: () => void;
|
|
313
|
+
run: <T = any>(items: T[], worker: import("#imports").ImportWorker<T>, options?: {
|
|
314
|
+
concurrency
|
|
315
|
+
/**
|
|
316
|
+
* ModelTable connects model metadata to reusable selection, labeling, iterator, or table UI patterns.
|
|
317
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
318
|
+
*/
|
|
319
|
+
?: number;
|
|
320
|
+
}) => Promise<import("#imports").ImportSummary>;
|
|
321
|
+
retry: (indices?: number[]) => Promise<import("#imports").ImportSummary>;
|
|
322
|
+
dismissResult: () => void;
|
|
323
|
+
};
|
|
252
324
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
253
325
|
delete: (...args: any[]) => void;
|
|
254
326
|
create: (...args: any[]) => void;
|
|
@@ -268,12 +340,16 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
268
340
|
modelBy: undefined;
|
|
269
341
|
fields: () => never[];
|
|
270
342
|
stringFields: () => never[];
|
|
343
|
+
importConcurrency: number;
|
|
271
344
|
onlyOwnerEdit: boolean;
|
|
272
345
|
api: boolean;
|
|
273
346
|
perPageStorageEnabled: boolean;
|
|
274
347
|
autoRefresh: boolean;
|
|
275
348
|
autoRefreshDefault: number;
|
|
276
349
|
autoRefreshControl: boolean;
|
|
350
|
+
virtual: undefined;
|
|
351
|
+
virtualThreshold: number;
|
|
352
|
+
virtualHeight: string;
|
|
277
353
|
}>>> & Readonly<{
|
|
278
354
|
onDelete?: ((...args: any[]) => any) | undefined;
|
|
279
355
|
onCreate?: ((...args: any[]) => any) | undefined;
|
|
@@ -8,6 +8,7 @@ import { usePerPagePreference } from "../../composables/perPagePreference";
|
|
|
8
8
|
import { useDialog } from "../../composables/dialog";
|
|
9
9
|
import { useUserPermission } from "../../composables/userPermission";
|
|
10
10
|
import { useModelAutoRefresh } from "../../composables/modelAutoRefresh";
|
|
11
|
+
import { shouldVirtualize } from "../../utils/virtualize";
|
|
11
12
|
import { useState } from "#imports";
|
|
12
13
|
defineOptions({
|
|
13
14
|
inheritAttrs: false
|
|
@@ -29,6 +30,7 @@ const props = defineProps({
|
|
|
29
30
|
search: { type: String, required: false },
|
|
30
31
|
saveAndStay: { type: Boolean, required: false, default: false },
|
|
31
32
|
stringFields: { type: Array, required: false, default: () => [] },
|
|
33
|
+
importConcurrency: { type: Number, required: false, default: 3 },
|
|
32
34
|
onlyOwnerEdit: { type: Boolean, required: false, default: false },
|
|
33
35
|
onlyOwnerOverridePermission: { type: [String, Array], required: false },
|
|
34
36
|
api: { type: Boolean, required: false, default: false },
|
|
@@ -37,6 +39,9 @@ const props = defineProps({
|
|
|
37
39
|
autoRefresh: { type: [Number, Boolean], required: false, default: false },
|
|
38
40
|
autoRefreshDefault: { type: Number, required: false, default: 60 },
|
|
39
41
|
autoRefreshControl: { type: Boolean, required: false, default: true },
|
|
42
|
+
virtual: { type: Boolean, required: false, default: void 0 },
|
|
43
|
+
virtualThreshold: { type: Number, required: false, default: 500 },
|
|
44
|
+
virtualHeight: { type: [Number, String], required: false, default: "70vh" },
|
|
40
45
|
modelName: { type: String, required: true },
|
|
41
46
|
modelKey: { type: String, required: false, default: "id" },
|
|
42
47
|
modelBy: { type: Object, required: false, default: void 0 },
|
|
@@ -74,6 +79,7 @@ const {
|
|
|
74
79
|
itemsLength,
|
|
75
80
|
search,
|
|
76
81
|
setSearch,
|
|
82
|
+
currentOptions,
|
|
77
83
|
canServerPageable,
|
|
78
84
|
canServerSearch,
|
|
79
85
|
canCreate,
|
|
@@ -85,7 +91,8 @@ const {
|
|
|
85
91
|
deleteItem,
|
|
86
92
|
loadItems,
|
|
87
93
|
reload,
|
|
88
|
-
isLoading
|
|
94
|
+
isLoading,
|
|
95
|
+
importProgress
|
|
89
96
|
} = props.api ? useApiModel(props) : useGraphqlModel(props);
|
|
90
97
|
const { autoRefresh, manualReload } = useModelAutoRefresh(props, {
|
|
91
98
|
reload,
|
|
@@ -136,13 +143,25 @@ const canEditRow = function(item) {
|
|
|
136
143
|
return true;
|
|
137
144
|
};
|
|
138
145
|
const operation = ref({ openDialog, openDialogReadonly, createItem, importItems, updateItem, deleteItem, reload, setSearch, canServerPageable, canServerSearch, canCreate, canUpdate, canDelete, canEditRow, onlyOwnerEdit: props.onlyOwnerEdit, onlyOwnerOverridePermission: props.onlyOwnerOverridePermission, autoRefresh: markRaw(autoRefresh) });
|
|
146
|
+
const useVirtual = computed(() => shouldVirtualize(items.value.length, props.virtual, props.virtualThreshold));
|
|
147
|
+
const virtualPerPageOptions = computed(
|
|
148
|
+
() => plainAttrs.value["items-per-page-options"] ?? plainAttrs.value["itemsPerPageOptions"] ?? [{ value: 25, title: "25" }, { value: 50, title: "50" }, { value: 100, title: "100" }, { value: -1, title: "All" }]
|
|
149
|
+
);
|
|
150
|
+
function onVirtualPerPageChange(value) {
|
|
151
|
+
itemsPerPageInternal.value = value;
|
|
152
|
+
loadItems({
|
|
153
|
+
page: 1,
|
|
154
|
+
itemsPerPage: Number(value),
|
|
155
|
+
sortBy: currentOptions.value?.sortBy ?? []
|
|
156
|
+
});
|
|
157
|
+
}
|
|
139
158
|
const computedInitialData = computed(() => {
|
|
140
159
|
return Object.assign({}, props.initialData, props.modelBy);
|
|
141
160
|
});
|
|
142
161
|
watch(() => props.search, () => {
|
|
143
162
|
search.value = props.search;
|
|
144
163
|
}, { immediate: true });
|
|
145
|
-
defineExpose({ reload, operation, items, autoRefresh });
|
|
164
|
+
defineExpose({ reload, operation, items, autoRefresh, importProgress });
|
|
146
165
|
</script>
|
|
147
166
|
|
|
148
167
|
<template>
|
|
@@ -233,7 +252,7 @@ defineExpose({ reload, operation, items, autoRefresh });
|
|
|
233
252
|
</VToolbar>
|
|
234
253
|
</slot>
|
|
235
254
|
<v-data-table-server
|
|
236
|
-
v-if="canServerPageable"
|
|
255
|
+
v-if="canServerPageable && !useVirtual"
|
|
237
256
|
v-bind="plainAttrs"
|
|
238
257
|
v-model:items-per-page="itemsPerPageInternal"
|
|
239
258
|
color="primary"
|
|
@@ -283,6 +302,72 @@ defineExpose({ reload, operation, items, autoRefresh });
|
|
|
283
302
|
/>
|
|
284
303
|
</template>
|
|
285
304
|
</v-data-table-server>
|
|
305
|
+
<v-data-table-virtual
|
|
306
|
+
v-else-if="useVirtual"
|
|
307
|
+
v-bind="plainAttrs"
|
|
308
|
+
color="primary"
|
|
309
|
+
:items="items"
|
|
310
|
+
:item-value="props.modelKey"
|
|
311
|
+
:search="search"
|
|
312
|
+
:loading="isLoading"
|
|
313
|
+
:height="props.virtualHeight"
|
|
314
|
+
fixed-header
|
|
315
|
+
>
|
|
316
|
+
<!-- @ts-ignore -->
|
|
317
|
+
<template
|
|
318
|
+
v-for="(_, name, index) in $slots"
|
|
319
|
+
:key="index"
|
|
320
|
+
#[name]="slotData"
|
|
321
|
+
>
|
|
322
|
+
<slot
|
|
323
|
+
:name="name"
|
|
324
|
+
v-bind="slotData || {}"
|
|
325
|
+
:operation="operation"
|
|
326
|
+
/>
|
|
327
|
+
</template>
|
|
328
|
+
<!-- action-column: keep in sync with the v-data-table-server and v-data-table branches -->
|
|
329
|
+
<template
|
|
330
|
+
v-if="!$slots['item.action']"
|
|
331
|
+
#item.action="{ item }"
|
|
332
|
+
>
|
|
333
|
+
<v-btn
|
|
334
|
+
v-if="!canUpdate || !canEditRow(item)"
|
|
335
|
+
variant="flat"
|
|
336
|
+
density="compact"
|
|
337
|
+
icon="mdi mdi-note-search"
|
|
338
|
+
@click="openDialogReadonly(item)"
|
|
339
|
+
/>
|
|
340
|
+
<v-btn
|
|
341
|
+
v-if="canUpdate && canEditRow(item)"
|
|
342
|
+
variant="flat"
|
|
343
|
+
density="compact"
|
|
344
|
+
icon="mdi mdi-note-edit"
|
|
345
|
+
@click="openDialog(item)"
|
|
346
|
+
/>
|
|
347
|
+
<v-btn
|
|
348
|
+
v-if="canDelete && canEditRow(item)"
|
|
349
|
+
variant="flat"
|
|
350
|
+
density="compact"
|
|
351
|
+
icon="mdi mdi-delete"
|
|
352
|
+
@click="confirmDeleteItem(item)"
|
|
353
|
+
/>
|
|
354
|
+
</template>
|
|
355
|
+
<template #bottom>
|
|
356
|
+
<div class="d-flex align-center justify-end pa-2 ga-3">
|
|
357
|
+
<span class="text-caption text-medium-emphasis">{{ items.length }} rows</span>
|
|
358
|
+
<v-select
|
|
359
|
+
:model-value="itemsPerPageInternal"
|
|
360
|
+
:items="virtualPerPageOptions"
|
|
361
|
+
label="Items per page"
|
|
362
|
+
density="compact"
|
|
363
|
+
variant="outlined"
|
|
364
|
+
hide-details
|
|
365
|
+
style="max-width: 130px"
|
|
366
|
+
@update:model-value="onVirtualPerPageChange"
|
|
367
|
+
/>
|
|
368
|
+
</div>
|
|
369
|
+
</template>
|
|
370
|
+
</v-data-table-virtual>
|
|
286
371
|
<v-data-table
|
|
287
372
|
v-else
|
|
288
373
|
v-bind="plainAttrs"
|
|
@@ -373,5 +458,35 @@ defineExpose({ reload, operation, items, autoRefresh });
|
|
|
373
458
|
/>
|
|
374
459
|
</template>
|
|
375
460
|
</FormDialog>
|
|
461
|
+
<slot
|
|
462
|
+
name="importProgress"
|
|
463
|
+
:is-importing="importProgress.isImporting.value"
|
|
464
|
+
:total="importProgress.total.value"
|
|
465
|
+
:processed="importProgress.processed.value"
|
|
466
|
+
:succeeded="importProgress.succeeded.value"
|
|
467
|
+
:failed="importProgress.failed.value"
|
|
468
|
+
:percent="importProgress.percent.value"
|
|
469
|
+
>
|
|
470
|
+
<DialogImportProgress
|
|
471
|
+
:model-value="importProgress.isImporting.value"
|
|
472
|
+
:total="importProgress.total.value"
|
|
473
|
+
:processed="importProgress.processed.value"
|
|
474
|
+
:succeeded="importProgress.succeeded.value"
|
|
475
|
+
:failed="importProgress.failed.value"
|
|
476
|
+
:percent="importProgress.percent.value"
|
|
477
|
+
/>
|
|
478
|
+
</slot>
|
|
479
|
+
<DialogImportResult
|
|
480
|
+
:model-value="importProgress.resultVisible.value"
|
|
481
|
+
:errors="importProgress.errors.value"
|
|
482
|
+
:total="importProgress.total.value"
|
|
483
|
+
:failed="importProgress.failed.value"
|
|
484
|
+
:is-importing="importProgress.isImporting.value"
|
|
485
|
+
@update:model-value="(v) => {
|
|
486
|
+
if (!v) importProgress.dismissResult();
|
|
487
|
+
}"
|
|
488
|
+
@retry-all="() => importProgress.retry().then(reload)"
|
|
489
|
+
@retry="(i) => importProgress.retry([i]).then(reload)"
|
|
490
|
+
/>
|
|
376
491
|
</v-card>
|
|
377
492
|
</template>
|