@ithinkdt/ui 4.0.0-402 → 4.0.0-404
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/auto-imports.js +4 -1
- package/dist/{components-B_qzc9ro.js → components-SsroO6X6.js} +45 -1
- package/dist/components.js +2 -2
- package/dist/page.js +29 -29
- package/esm/components.d.ts +25 -0
- package/package.json +1 -1
package/auto-imports.js
CHANGED
|
@@ -13,7 +13,10 @@ export const UIComponents = [
|
|
|
13
13
|
{
|
|
14
14
|
type: 'component',
|
|
15
15
|
resolve(name) {
|
|
16
|
-
return [
|
|
16
|
+
return [
|
|
17
|
+
'DataTable', 'DataForm', 'DataFormActions', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination',
|
|
18
|
+
'NCheckboxes', 'NRadios', 'NStateButton',
|
|
19
|
+
].includes(name)
|
|
17
20
|
? { name, from: '@ithinkdt/ui/components' }
|
|
18
21
|
: undefined
|
|
19
22
|
},
|
|
@@ -1732,5 +1732,49 @@ const DtDeptRender = /* @__PURE__ */ defineComponent({
|
|
|
1732
1732
|
});
|
|
1733
1733
|
}, { immediate: !0 }), () => renderUsers(v.value, e);
|
|
1734
1734
|
}
|
|
1735
|
+
}), StateButtonProps = {
|
|
1736
|
+
disabled: {
|
|
1737
|
+
type: Boolean,
|
|
1738
|
+
default: void 0
|
|
1739
|
+
},
|
|
1740
|
+
type: {
|
|
1741
|
+
type: String,
|
|
1742
|
+
default: void 0
|
|
1743
|
+
},
|
|
1744
|
+
succeeded: {
|
|
1745
|
+
type: [Boolean, Object],
|
|
1746
|
+
default: void 0
|
|
1747
|
+
},
|
|
1748
|
+
successText: {
|
|
1749
|
+
type: [
|
|
1750
|
+
String,
|
|
1751
|
+
Number,
|
|
1752
|
+
Object
|
|
1753
|
+
],
|
|
1754
|
+
default: void 0
|
|
1755
|
+
},
|
|
1756
|
+
failureText: {
|
|
1757
|
+
type: [
|
|
1758
|
+
String,
|
|
1759
|
+
Number,
|
|
1760
|
+
Object
|
|
1761
|
+
],
|
|
1762
|
+
default: void 0
|
|
1763
|
+
}
|
|
1764
|
+
}, NStateButton = /* @__PURE__ */ defineComponent({
|
|
1765
|
+
name: "StateButton",
|
|
1766
|
+
props: StateButtonProps,
|
|
1767
|
+
setup(e, { slots: v }) {
|
|
1768
|
+
return () => {
|
|
1769
|
+
let { type: y, disabled: b, succeeded: x, successText: S, failureText: C } = e;
|
|
1770
|
+
return createVNode(NButton, {
|
|
1771
|
+
type: x ? "success" : x === !1 ? "error" : y,
|
|
1772
|
+
disabled: typeof x == "boolean" ? !0 : b
|
|
1773
|
+
}, {
|
|
1774
|
+
default: () => (x ? v.success ? v.success() : S : x === !1 ? v.failure ? v.failure() : C : v.default?.()) ?? v.default(),
|
|
1775
|
+
icon: () => x ? v.successIcon ? v.successIcon() : createVNode(NIcon, null, { default: () => [createVNode(ICheck, null, null)] }) : x === !1 ? v.failureIcon ? v.failureIcon() : createVNode(NIcon, null, { default: () => [createVNode(IClose, null, null)] }) : v.icon?.()
|
|
1776
|
+
});
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1735
1779
|
});
|
|
1736
|
-
export {
|
|
1780
|
+
export { dataFormActionsProps as _, DtUserRender as a, NCheckboxes as b, DataTable as c, DataPagination as d, DataLocaleInput as f, DataFormActions as g, DataForm as h, DtUserDept as i, useDataTableDrag as l, DataFilter as m, StateButtonProps as n, renderUsers as o, useLocaleEdit as p, DtDeptRender as r, NRadios as s, NStateButton as t, DataSelection as u, DataCustom as v, DataActions as y };
|
package/dist/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./use-i18n-Dx7V4KrY.js";
|
|
2
2
|
import "./directives-qqYcWl1I.js";
|
|
3
3
|
import "./use-style-DcT-1dj4.js";
|
|
4
|
-
import { _ as
|
|
5
|
-
export { DataActions, DataCustom, DataFilter, DataForm, DataFormActions, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, dataFormActionsProps, renderUsers, useDataTableDrag, useLocaleEdit };
|
|
4
|
+
import { _ as dataFormActionsProps, a as DtUserRender, b as NCheckboxes, c as DataTable, d as DataPagination, f as DataLocaleInput, g as DataFormActions, h as DataForm, i as DtUserDept, l as useDataTableDrag, m as DataFilter, n as StateButtonProps, o as renderUsers, p as useLocaleEdit, r as DtDeptRender, s as NRadios, t as NStateButton, u as DataSelection, v as DataCustom, y as DataActions } from "./components-SsroO6X6.js";
|
|
5
|
+
export { DataActions, DataCustom, DataFilter, DataForm, DataFormActions, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, NStateButton, StateButtonProps, dataFormActionsProps, 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-qqYcWl1I.js";
|
|
3
3
|
import "./use-style-DcT-1dj4.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as DtUserRender, b as NCheckboxes, h as DataForm, i as DtUserDept, r as DtDeptRender, s as NRadios } from "./components-SsroO6X6.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";
|
|
@@ -156,42 +156,42 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
156
156
|
},
|
|
157
157
|
checkboxes: () => {
|
|
158
158
|
let n, c;
|
|
159
|
-
return ({ props:
|
|
160
|
-
let { dictType: g, options: v, ...y } = mapProps(
|
|
161
|
-
if (v ? c = v : n !== g && (n = g, !c && n && (c = useDict(n))),
|
|
159
|
+
return ({ props: u }, { modelValue: d, required: f, readonly: p, ...m }) => {
|
|
160
|
+
let { dictType: g, options: v, ...y } = mapProps(u);
|
|
161
|
+
if (v ? c = v : n !== g && (n = g, !c && n && (c = useDict(n))), p) {
|
|
162
162
|
let n;
|
|
163
163
|
return createVNode(NText, {
|
|
164
164
|
depth: 2,
|
|
165
165
|
style: "line-height: 2.4"
|
|
166
|
-
}, _isSlot(n = (
|
|
167
|
-
let
|
|
168
|
-
return createVNode("span", { key: n ? n[y.valueField ?? "value"] :
|
|
166
|
+
}, _isSlot(n = (d?.map((n) => c?.find((c) => c[y.valueField || "value"] === n)) ?? []).map((n, c, l) => {
|
|
167
|
+
let u = n ? n[y.labelField ?? "label"] ?? "" : d[c] ?? "";
|
|
168
|
+
return createVNode("span", { key: n ? n[y.valueField ?? "value"] : d[c] ?? "" }, [u, c < l.length - 1 ? ", " : ""]);
|
|
169
169
|
})) ? n : { default: () => [n] });
|
|
170
170
|
}
|
|
171
171
|
return h(NCheckboxes, {
|
|
172
172
|
...y,
|
|
173
173
|
...m,
|
|
174
174
|
options: c,
|
|
175
|
-
modelValue:
|
|
175
|
+
modelValue: d
|
|
176
176
|
});
|
|
177
177
|
};
|
|
178
178
|
},
|
|
179
179
|
radios: () => {
|
|
180
|
-
let n,
|
|
181
|
-
return ({ props:
|
|
182
|
-
let { dictType: g, options: v, ...y } = mapProps(
|
|
183
|
-
if (v ?
|
|
184
|
-
let n =
|
|
180
|
+
let n, c;
|
|
181
|
+
return ({ props: l }, { modelValue: u, required: d, readonly: f, ...m }) => {
|
|
182
|
+
let { dictType: g, options: v, ...y } = mapProps(l);
|
|
183
|
+
if (v ? c = v : n !== g && (n = g, !c && n && (c = useDict(n))), f) {
|
|
184
|
+
let n = c?.find((n) => n[y.valueField ?? "value"] === u);
|
|
185
185
|
return createVNode(NText, {
|
|
186
186
|
depth: 2,
|
|
187
187
|
style: "line-height: 1.25"
|
|
188
|
-
}, { default: () => [n ? n[y.labelField ?? "label"] ?? "" :
|
|
188
|
+
}, { default: () => [n ? n[y.labelField ?? "label"] ?? "" : u ?? ""] });
|
|
189
189
|
}
|
|
190
190
|
return h(NRadios, {
|
|
191
191
|
...y,
|
|
192
192
|
...m,
|
|
193
|
-
options:
|
|
194
|
-
modelValue:
|
|
193
|
+
options: c,
|
|
194
|
+
modelValue: u
|
|
195
195
|
});
|
|
196
196
|
};
|
|
197
197
|
},
|
|
@@ -287,11 +287,11 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
287
287
|
};
|
|
288
288
|
},
|
|
289
289
|
user: () => {
|
|
290
|
-
let
|
|
290
|
+
let l, p, v;
|
|
291
291
|
return ({ slots: y, props: b }, { modelValue: S, "onUpdate:modelValue": C, required: w, readonly: T, ...E }) => {
|
|
292
292
|
let D = mapProps(b);
|
|
293
|
-
return
|
|
294
|
-
|
|
293
|
+
return l || (l = shallowRef([]), p = shallowRef([]), v = shallowRef([]), g().then((n) => {
|
|
294
|
+
l.value = n;
|
|
295
295
|
}), n().then((n) => {
|
|
296
296
|
p.value = n;
|
|
297
297
|
}), f().then((n) => {
|
|
@@ -302,7 +302,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
302
302
|
getUsersByUsername: g
|
|
303
303
|
}, null) : h(DtUserDept, {
|
|
304
304
|
type: "user",
|
|
305
|
-
users:
|
|
305
|
+
users: l.value,
|
|
306
306
|
depts: v.value,
|
|
307
307
|
groups: p.value,
|
|
308
308
|
getUsersByDept: m,
|
|
@@ -316,7 +316,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
316
316
|
}
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername:
|
|
319
|
+
function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername: l, getFileInfos: u, previewFileUrl: d }) {
|
|
320
320
|
let p = (n) => () => (c, l, u, d) => {
|
|
321
321
|
if (c != null) return format(c, d.formatter ?? n);
|
|
322
322
|
}, m = (n = {}) => createVNode("svg", mergeProps({
|
|
@@ -376,12 +376,12 @@ function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername: c, getFi
|
|
|
376
376
|
disabled: !0,
|
|
377
377
|
size: "small"
|
|
378
378
|
}, null),
|
|
379
|
-
image: () => (n, c, l,
|
|
379
|
+
image: () => (n, c, l, u) => {
|
|
380
380
|
let f;
|
|
381
381
|
return n ? createVNode(NFlex, {
|
|
382
382
|
gap: "8",
|
|
383
383
|
wrap: !0
|
|
384
|
-
}, _isSlot(f = (Array.isArray(n) ? n :
|
|
384
|
+
}, _isSlot(f = (Array.isArray(n) ? n : u?.multiple ? n.split(",") : [n]).map((n) => d(n)).map((n) => createVNode("img", {
|
|
385
385
|
key: n,
|
|
386
386
|
src: n,
|
|
387
387
|
style: "max-height: 32px; max-width: 100px; object-fit: contain"
|
|
@@ -389,14 +389,14 @@ function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername: c, getFi
|
|
|
389
389
|
},
|
|
390
390
|
file: () => {
|
|
391
391
|
let n = nanoid();
|
|
392
|
-
return (c,
|
|
392
|
+
return (c, l, d, f) => {
|
|
393
393
|
let p;
|
|
394
|
-
return c ? (
|
|
395
|
-
|
|
394
|
+
return c ? (l.__file_urls ??= {}, l.__file_urls[n] || u(Array.isArray(c) ? c : f?.multiple ? c.split(",") : [c]).then((c) => {
|
|
395
|
+
l.__file_urls[n] = c;
|
|
396
396
|
}), createVNode(NFlex, {
|
|
397
397
|
gap: "8",
|
|
398
398
|
wrap: !0
|
|
399
|
-
}, _isSlot(p = (
|
|
399
|
+
}, _isSlot(p = (l.__file_urls[n] || []).map((n) => createVNode("a", {
|
|
400
400
|
key: n.id,
|
|
401
401
|
href: n.url,
|
|
402
402
|
target: "_blank",
|
|
@@ -412,11 +412,11 @@ function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername: c, getFi
|
|
|
412
412
|
getDeptsByCode: n
|
|
413
413
|
}, null);
|
|
414
414
|
},
|
|
415
|
-
user: () => (n,
|
|
415
|
+
user: () => (n, u, d, f) => {
|
|
416
416
|
if (n) return createVNode(DtUserRender, {
|
|
417
417
|
value: n,
|
|
418
418
|
multiple: f?.multiple,
|
|
419
|
-
getUsersByUsername:
|
|
419
|
+
getUsersByUsername: l
|
|
420
420
|
}, null);
|
|
421
421
|
}
|
|
422
422
|
};
|
package/esm/components.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ButtonProps,
|
|
3
|
+
ButtonSlots,
|
|
2
4
|
CheckboxGroupProps, DataTableInst as NDataTableInst, DataTableProps as NDataTableProps, FlexProps,
|
|
3
5
|
FormItemGiProps as NFormItemGiProps, FormProps as NFormProps, GridItemProps as NGridItemProps, GridProps as NGridProps,
|
|
4
6
|
PopoverProps,
|
|
@@ -51,9 +53,32 @@ declare module '@ithinkdt/page' {
|
|
|
51
53
|
interface FormItemRenderExtraParams {
|
|
52
54
|
size?: 'small' | 'medium' | 'large' | undefined
|
|
53
55
|
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type NStateButtonProps = ButtonProps & {
|
|
59
|
+
succeeded?: boolean | null | undefined
|
|
60
|
+
successText?: string | undefined
|
|
61
|
+
failureText?: string | undefined
|
|
62
|
+
}
|
|
54
63
|
|
|
64
|
+
export type NStateButtonEmits = {
|
|
65
|
+
(e: 'click', evt: MouseEvent): void
|
|
55
66
|
}
|
|
56
67
|
|
|
68
|
+
export type NStateButtonSlots = ButtonSlots & {
|
|
69
|
+
success?: () => VNodeChild
|
|
70
|
+
failure?: () => VNodeChild
|
|
71
|
+
successIcon?: () => VNodeChild
|
|
72
|
+
failureIcon?: () => VNodeChild
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export declare function NStateButton(
|
|
76
|
+
props: NStateButtonProps & PublicProps,
|
|
77
|
+
ctx?: Pick<GenericCtx<NStateButtonProps, NStateButtonEmits, NStateButtonSlots>, 'attrs' | 'emit' | 'slots'>,
|
|
78
|
+
expose?: (exposed?: GenericExposed) => void,
|
|
79
|
+
setup?: GenericCtx<NStateButtonProps, NStateButtonEmits, NStateButtonSlots>,
|
|
80
|
+
): GenericReturn<NStateButtonProps, NStateButtonEmits, NStateButtonSlots>
|
|
81
|
+
|
|
57
82
|
export type DataFormActionsProps = Pick<FlexProps, 'align' | 'justify' | 'vertical' | 'reverse'> & {
|
|
58
83
|
size?: 'small' | 'medium' | 'large' | undefined
|
|
59
84
|
gap?: number | string | undefined
|