@ithinkdt/ui 4.0.0-50 → 4.0.0-52
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/{components-BC8oa62b.js → components-CTdt73l6.js} +523 -499
- package/dist/components.js +1 -1
- package/dist/page.js +34 -28
- package/esm/components.d.ts +9 -1
- package/esm/page.d.ts +2 -2
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./use-i18n-Dx7V4KrY.js";
|
|
2
2
|
import "./directives-DUuJW647.js";
|
|
3
3
|
import "./use-style-DcT-1dj4.js";
|
|
4
|
-
import { a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as NCheckboxes, h as DataActions, i as renderUsers, l as DataPagination, m as DataCustom, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput } from "./components-
|
|
4
|
+
import { a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as NCheckboxes, h as DataActions, i as renderUsers, l as DataPagination, m as DataCustom, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput } from "./components-CTdt73l6.js";
|
|
5
5
|
export { DataActions, DataCustom, DataFilter, DataForm, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, renderUsers, useDataTableDrag, useLocaleEdit };
|
package/dist/page.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as useI18n } from "./use-i18n-Dx7V4KrY.js";
|
|
2
2
|
import "./directives-DUuJW647.js";
|
|
3
3
|
import "./use-style-DcT-1dj4.js";
|
|
4
|
-
import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-
|
|
4
|
+
import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-CTdt73l6.js";
|
|
5
5
|
import { computed, createVNode, defineComponent, h, isVNode, mergeProps, ref, shallowRef, unref } from "vue";
|
|
6
6
|
import { until } from "@vueuse/core";
|
|
7
7
|
import { NButton, NCheckbox, NColorPicker, NDatePicker, NDrawer, NDrawerContent, NFlex, NInput, NInputNumber, NModal, NScrollbar, NSelect, NText, NUpload, useMessage } from "ithinkdt-ui";
|
|
@@ -86,7 +86,7 @@ var mapProps = (n) => Object.fromEntries(Object.entries(n || {}).map(([n, c]) =>
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
-
function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d,
|
|
89
|
+
function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getDeptsByCode: p, getUsersByDept: m, getUsersByUsername: g, uploadFile: v, getFileInfos: y }) {
|
|
90
90
|
return {
|
|
91
91
|
input: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f,...p }) => f ? createVNode(NText, {
|
|
92
92
|
depth: 2,
|
|
@@ -231,7 +231,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
|
|
|
231
231
|
...c,
|
|
232
232
|
...p,
|
|
233
233
|
defaultUpload: !1,
|
|
234
|
-
uploadFile:
|
|
234
|
+
uploadFile: v,
|
|
235
235
|
fileList: l,
|
|
236
236
|
onUpdateFileList: u
|
|
237
237
|
}, n);
|
|
@@ -241,7 +241,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
|
|
|
241
241
|
let c = ++d;
|
|
242
242
|
u.value = n.map((n) => l.get(n)).filter(Boolean);
|
|
243
243
|
let f = n.filter((n) => !l.has(n));
|
|
244
|
-
Promise.resolve(f.length > 0 ?
|
|
244
|
+
Promise.resolve(f.length > 0 ? y(f) : []).then((f) => {
|
|
245
245
|
if (c === d) {
|
|
246
246
|
u.value = n.map((n) => l.get(n) || f.find((c) => c.id === n)), l.clear();
|
|
247
247
|
for (let n of u.value) l.set(n.id, n);
|
|
@@ -249,9 +249,9 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
|
|
|
249
249
|
});
|
|
250
250
|
}, p;
|
|
251
251
|
return {
|
|
252
|
-
renderer: ({ slots: d, props: m }, { modelValue:
|
|
252
|
+
renderer: ({ slots: d, props: m }, { modelValue: g, "onUpdate:modelValue": y, required: b, readonly: S,...C }) => {
|
|
253
253
|
let w = mapProps(m);
|
|
254
|
-
if (p = w.ref ??= shallowRef(), n !==
|
|
254
|
+
if (p = w.ref ??= shallowRef(), n !== g && (n = g, f(g?.split(",") ?? [])), S) {
|
|
255
255
|
let n;
|
|
256
256
|
return u.value.length === 0 ? void 0 : createVNode(NFlex, {
|
|
257
257
|
gap: "8",
|
|
@@ -270,7 +270,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
|
|
|
270
270
|
return h(SimpleUpload, {
|
|
271
271
|
...w,
|
|
272
272
|
...C,
|
|
273
|
-
uploadFile:
|
|
273
|
+
uploadFile: v,
|
|
274
274
|
fileList: u.value,
|
|
275
275
|
onUpdateFileList: (n = []) => {
|
|
276
276
|
l.clear();
|
|
@@ -285,31 +285,31 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
|
|
|
285
285
|
};
|
|
286
286
|
},
|
|
287
287
|
user: () => {
|
|
288
|
-
let c;
|
|
289
|
-
return ({ slots:
|
|
290
|
-
let
|
|
291
|
-
return c || (c = shallowRef([]),
|
|
288
|
+
let c, l, v;
|
|
289
|
+
return ({ slots: y, props: b }, { modelValue: S, "onUpdate:modelValue": C, required: w, readonly: T,...E }) => {
|
|
290
|
+
let D = mapProps(b);
|
|
291
|
+
return c || (c = shallowRef([]), l = shallowRef([]), v = shallowRef([]), g().then((n) => {
|
|
292
292
|
c.value = n;
|
|
293
293
|
}), n().then((n) => {
|
|
294
|
-
|
|
295
|
-
}),
|
|
296
|
-
|
|
297
|
-
})),
|
|
298
|
-
value:
|
|
299
|
-
multiple:
|
|
300
|
-
getUsersByUsername:
|
|
294
|
+
l.value = n;
|
|
295
|
+
}), p().then((n) => {
|
|
296
|
+
v.value = n;
|
|
297
|
+
})), T ? createVNode(DtUserRender, {
|
|
298
|
+
value: S,
|
|
299
|
+
multiple: D.multiple,
|
|
300
|
+
getUsersByUsername: g
|
|
301
301
|
}, null) : h(DtUserDept, {
|
|
302
302
|
type: "user",
|
|
303
303
|
users: c.value,
|
|
304
|
-
depts:
|
|
305
|
-
groups:
|
|
306
|
-
getUsersByDept:
|
|
304
|
+
depts: v.value,
|
|
305
|
+
groups: l.value,
|
|
306
|
+
getUsersByDept: m,
|
|
307
307
|
getUsersByGroup: d,
|
|
308
|
-
...
|
|
309
|
-
...
|
|
310
|
-
modelValue:
|
|
311
|
-
"onUpdate:modelValue":
|
|
312
|
-
},
|
|
308
|
+
...D,
|
|
309
|
+
...E,
|
|
310
|
+
modelValue: S,
|
|
311
|
+
"onUpdate:modelValue": C
|
|
312
|
+
}, y);
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
};
|
|
@@ -420,12 +420,18 @@ function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername: c, getFi
|
|
|
420
420
|
};
|
|
421
421
|
}
|
|
422
422
|
function createFormHelper() {
|
|
423
|
-
return () => ({ items: n, model: c, handleSubmit: l, reset: u, validation: f, readonly: p, inModal: m,
|
|
423
|
+
return () => ({ items: n, model: c, handleSubmit: l, reset: u, validation: f, readonly: p, inModal: m, showFeedback: g, showColon: _, labelWidth: v, labelAlign: y, labelPlacement: b, showRequireMark: x, requireMarkPlacement: C }) => createVNode(DataForm, {
|
|
424
424
|
readonly: p,
|
|
425
425
|
model: c,
|
|
426
426
|
items: n,
|
|
427
427
|
validation: f,
|
|
428
|
-
showColon: unref(
|
|
428
|
+
showColon: unref(_) ?? !0,
|
|
429
|
+
labelWidth: unref(v),
|
|
430
|
+
labelAlign: unref(y),
|
|
431
|
+
labelPlacement: unref(b),
|
|
432
|
+
showRequireMark: unref(x),
|
|
433
|
+
requireMarkPlacement: unref(C),
|
|
434
|
+
showFeedback: unref(g) ?? !0,
|
|
429
435
|
showAction: !1,
|
|
430
436
|
onSubmit: l,
|
|
431
437
|
onRest: u,
|
package/esm/components.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ declare module '@ithinkdt/page' {
|
|
|
16
16
|
|
|
17
17
|
interface FormRenderExtraOptions {
|
|
18
18
|
showColon?: MaybeRef<boolean | undefined>
|
|
19
|
+
labelWidth?: MaybeRef<string | number | undefined>
|
|
20
|
+
labelAlign?: MaybeRef<'left' | 'right' | 'center' | undefined>
|
|
21
|
+
labelPlacement?: MaybeRef<'left' | 'top' | undefined>
|
|
22
|
+
showRequireMark?: MaybeRef<boolean | undefined>
|
|
23
|
+
requireMarkPlacement?: MaybeRef<'left' | 'right' | 'right-hanging' | undefined>
|
|
24
|
+
showFeedback?: MaybeRef<boolean | undefined>
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
type FormItemOptionKeys = 'size' | 'showLabel' | 'labelWidth' | 'labelStyle' | 'labelAlign' | 'labelPlacement' | 'labelProps'
|
|
@@ -367,6 +373,7 @@ export interface UserGroupOption {
|
|
|
367
373
|
name: string
|
|
368
374
|
}
|
|
369
375
|
export interface DeptOption {
|
|
376
|
+
id?: string | undefined
|
|
370
377
|
code: string
|
|
371
378
|
name: string
|
|
372
379
|
children?: DeptOption[]
|
|
@@ -382,7 +389,8 @@ interface UserDeptProps<Multiple extends boolean> {
|
|
|
382
389
|
'filterable'?: boolean | undefined
|
|
383
390
|
'disabled'?: boolean | undefined
|
|
384
391
|
'size'?: TransferProps['size'] | undefined
|
|
385
|
-
'
|
|
392
|
+
'valueField'?: 'id' | 'username' | 'code' | undefined
|
|
393
|
+
'users'?: { id?: string | undefined, username: string, nickname: string }[] | undefined
|
|
386
394
|
'groups'?: UserGroupOption[] | undefined
|
|
387
395
|
'depts'?: DeptOption[] | undefined
|
|
388
396
|
'getUsersByGroup'?: ((code: string) => Promise<{ username: string, nickname: string }[]>) | undefined
|
package/esm/page.d.ts
CHANGED
|
@@ -98,9 +98,9 @@ declare module '@ithinkdt/page' {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
user: {
|
|
101
|
-
|
|
101
|
+
userProps?: ShallowMaybeRef<Omit<UserDeptProps<boolean>, 'modelValue' | 'onUpdate:modelValue' | 'disabled'
|
|
102
102
|
| 'users' | 'groups' | 'depts' | 'getUsersByGroup' | 'getUsersByDept'>> & PublicProps
|
|
103
|
-
|
|
103
|
+
userSlots?: {}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|