@ithinkdt/ui 4.0.0-200 → 4.0.0-202
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.
|
@@ -664,7 +664,7 @@ const DataForm = /* @__PURE__ */ defineComponent({
|
|
|
664
664
|
immediate: !0,
|
|
665
665
|
debounce: 100
|
|
666
666
|
}), () => {
|
|
667
|
-
let { items: v, loading: D, validation: O, showColon: k, tooltipPlacement: j, showFeedback: M, labelWidth: N = "7.2em", labelAlign: P = e.labelPlacement === "top" ? "left" : "right", grid: F, showAction: I, showSubmitBtn: R, showResetBtn: z, showCancelBtn: B, actionAlign: V, actionJustify: H, actionGap: U, submitDisabled: W, submitText: G, resetText: K, cancelText: q, succeeded: J, successText: Y, failureText: X
|
|
667
|
+
let { items: v, loading: D, validation: O, showColon: k, tooltipPlacement: j, showFeedback: M, labelWidth: N = "7.2em", labelAlign: P = e.labelPlacement === "top" ? "left" : "right", grid: F, showAction: I, showSubmitBtn: R, showResetBtn: z, showCancelBtn: B, actionAlign: V, actionJustify: H, actionGap: U, submitDisabled: W, submitText: G, resetText: K, cancelText: q, succeeded: J, successText: Y, failureText: X, ...Z } = e, Q = !e.readonly && M !== !1;
|
|
668
668
|
return createVNode(NForm, mergeProps({
|
|
669
669
|
labelWidth: N,
|
|
670
670
|
labelAlign: P,
|
|
@@ -676,7 +676,7 @@ const DataForm = /* @__PURE__ */ defineComponent({
|
|
|
676
676
|
itemResponsive: !0
|
|
677
677
|
}, F, { yGap: Q ? 0 : F?.yGap ?? 24 }), { default: () => {
|
|
678
678
|
let b = 0;
|
|
679
|
-
return createVNode(Fragment, null, [v.map(({ hidden: v, name: y, render: x, label: S, showColon: C, span: w = 6, rowSpan: T, offset: D = 0, tooltip: k, tooltipPlacement: j = e.tooltipPlacement, validationStatus: M = O[y]?.errors?.some((e) => e !== void 0) ? "error" : O[y]?.warnings?.some((e) => e !== void 0) ? "warnings" : O[y] ? "success" : void 0, readonly: N = e.readonly, showRequireMark: P = !N, showTooltipWhenReadonly: F = !1
|
|
679
|
+
return createVNode(Fragment, null, [v.map(({ hidden: v, name: y, render: x, label: S, showColon: C, span: w = 6, rowSpan: T, offset: D = 0, tooltip: k, tooltipPlacement: j = e.tooltipPlacement, validationStatus: M = O[y]?.errors?.some((e) => e !== void 0) ? "error" : O[y]?.warnings?.some((e) => e !== void 0) ? "warnings" : O[y] ? "success" : void 0, readonly: N = e.readonly, showRequireMark: P = !N, showTooltipWhenReadonly: F = !1, ...I }) => {
|
|
680
680
|
if (v) return;
|
|
681
681
|
b += w;
|
|
682
682
|
let R;
|
|
@@ -826,7 +826,7 @@ const DataForm = /* @__PURE__ */ defineComponent({
|
|
|
826
826
|
suffix: !0
|
|
827
827
|
});
|
|
828
828
|
return () => {
|
|
829
|
-
let { filterOnReset: e, filterText: y, resetText: O, customizable: k, defaultCollapsed: j, collapsible: M, grid: N
|
|
829
|
+
let { filterOnReset: e, filterText: y, resetText: O, customizable: k, defaultCollapsed: j, collapsible: M, grid: N, ...P } = v;
|
|
830
830
|
return createVNode(DataForm, mergeProps({ grid: {
|
|
831
831
|
cols: "12 768:18 1280:24 1536:30",
|
|
832
832
|
yGap: 20,
|
|
@@ -1231,7 +1231,7 @@ const DataTable = /* @__PURE__ */ defineComponent({
|
|
|
1231
1231
|
}
|
|
1232
1232
|
});
|
|
1233
1233
|
var style = /* @__PURE__ */ cB("datatable", [cE("row-highlight", [c("& > td", { backgroundColor: "var(--n-tr-highlight-color, var(--n-merged-border-color)) !important" })])]);
|
|
1234
|
-
function useDataTableDrag(e, { data: v, onSort: y
|
|
1234
|
+
function useDataTableDrag(e, { data: v, onSort: y, ...b }) {
|
|
1235
1235
|
watch([ref(v), e], async ([e, v]) => {
|
|
1236
1236
|
if (e.length === 0) return;
|
|
1237
1237
|
await nextTick();
|
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 { _ as DataActions, a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as DataCustom, h as dataFormActionsProps, i as renderUsers, l as DataPagination, m as DataFormActions, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput, v as NCheckboxes } from "./components-
|
|
4
|
+
import { _ as DataActions, a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as DataCustom, h as dataFormActionsProps, i as renderUsers, l as DataPagination, m as DataFormActions, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput, v as NCheckboxes } from "./components-Ceazjkie.js";
|
|
5
5
|
export { DataActions, DataCustom, DataFilter, DataForm, DataFormActions, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, dataFormActionsProps, renderUsers, useDataTableDrag, useLocaleEdit };
|
package/dist/index.js
CHANGED
|
@@ -630,7 +630,7 @@ function useCtxMenu(z, B, V) {
|
|
|
630
630
|
{
|
|
631
631
|
key: "reload",
|
|
632
632
|
label: H("common.layout.tabs.reloadTab"),
|
|
633
|
-
disabled: U.tab
|
|
633
|
+
disabled: !U.tab || U.tab.key !== B.value,
|
|
634
634
|
icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
|
|
635
635
|
xmlns: "http://www.w3.org/2000/svg",
|
|
636
636
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
@@ -665,7 +665,7 @@ function useCtxMenu(z, B, V) {
|
|
|
665
665
|
{
|
|
666
666
|
key: "open",
|
|
667
667
|
label: H("common.layout.tabs.openTabBlank"),
|
|
668
|
-
disabled: U.tab
|
|
668
|
+
disabled: !U.tab,
|
|
669
669
|
icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
|
|
670
670
|
xmlns: "http://www.w3.org/2000/svg",
|
|
671
671
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
@@ -756,19 +756,7 @@ function useCtxMenu(z, B, V) {
|
|
|
756
756
|
V();
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
|
-
if (
|
|
760
|
-
let z = H.find((d) => d.key === B.value);
|
|
761
|
-
switch (d) {
|
|
762
|
-
case "open":
|
|
763
|
-
window.open(z.href, "_blank");
|
|
764
|
-
break;
|
|
765
|
-
case "reload":
|
|
766
|
-
z.reloading ||= (z.reloading = !0, await promiseTimeout(220), !1);
|
|
767
|
-
break;
|
|
768
|
-
}
|
|
769
|
-
return;
|
|
770
|
-
}
|
|
771
|
-
switch (d) {
|
|
759
|
+
if (U.tab) switch (d) {
|
|
772
760
|
case "open":
|
|
773
761
|
window.open(U.tab.href, "_blank");
|
|
774
762
|
break;
|
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, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender, v as NCheckboxes } from "./components-
|
|
4
|
+
import { a as NRadios, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender, v as NCheckboxes } from "./components-Ceazjkie.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";
|
|
@@ -66,15 +66,15 @@ var mapProps = (n) => Object.fromEntries(Object.entries(n || {}).map(([n, c]) =>
|
|
|
66
66
|
c.onUpdateFileList?.(n), nextTick(() => f.nTriggerFormChange());
|
|
67
67
|
};
|
|
68
68
|
return () => {
|
|
69
|
-
let { type: n, onUpdateFileList: u
|
|
69
|
+
let { type: n, onUpdateFileList: u, ...p } = c;
|
|
70
70
|
return createVNode(NUpload, mergeProps(p, {
|
|
71
71
|
ref: _,
|
|
72
72
|
customRequest: g.value,
|
|
73
73
|
listType: n === "image" ? "image-card" : "text",
|
|
74
74
|
accept: p.accept ?? n === "image" ? "image/*" : void 0,
|
|
75
75
|
"onUpdate:fileList": v
|
|
76
|
-
}), {
|
|
77
|
-
default: () => {
|
|
76
|
+
}), {
|
|
77
|
+
default: n === "image" ? void 0 : () => {
|
|
78
78
|
let n;
|
|
79
79
|
return createVNode(NButton, {
|
|
80
80
|
disabled: f.mergedDisabledRef.value,
|
|
@@ -82,13 +82,13 @@ var mapProps = (n) => Object.fromEntries(Object.entries(n || {}).map(([n, c]) =>
|
|
|
82
82
|
}, _isSlot(n = d("common.page.form.selectFileText")) ? n : { default: () => [n] });
|
|
83
83
|
},
|
|
84
84
|
...l
|
|
85
|
-
}
|
|
85
|
+
});
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsByCode: f, getUsersByDept: m, getUsersByUsername: g, uploadFile: v, getFileInfos: y }) {
|
|
90
90
|
return {
|
|
91
|
-
input: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f
|
|
91
|
+
input: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => f ? createVNode(NText, {
|
|
92
92
|
depth: 2,
|
|
93
93
|
style: "line-height: 1.25"
|
|
94
94
|
}, { default: () => [l ?? ""] }) : (c = mapProps(c), h(NInput, {
|
|
@@ -98,7 +98,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
98
98
|
value: l,
|
|
99
99
|
"onUpdate:value": u
|
|
100
100
|
}, n)),
|
|
101
|
-
number: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f
|
|
101
|
+
number: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => f ? createVNode(NText, {
|
|
102
102
|
depth: 2,
|
|
103
103
|
style: "line-height: 1.25"
|
|
104
104
|
}, { default: () => [l ?? ""] }) : (c = mapProps(c), h(NInputNumber, {
|
|
@@ -110,8 +110,8 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
110
110
|
}, n)),
|
|
111
111
|
select: () => {
|
|
112
112
|
let n, c;
|
|
113
|
-
return ({ slots: l, props: u }, { modelValue: d, "onUpdate:modelValue": f, required: p, readonly: m
|
|
114
|
-
let { dictType: v, options: y
|
|
113
|
+
return ({ slots: l, props: u }, { modelValue: d, "onUpdate:modelValue": f, required: p, readonly: m, ...g }) => {
|
|
114
|
+
let { dictType: v, options: y, ...b } = mapProps(u);
|
|
115
115
|
if (y ? c = y : n !== v && (n = v, !c && n && (c = useDict(n))), m) if (b.multiple) {
|
|
116
116
|
let n;
|
|
117
117
|
return createVNode(NText, {
|
|
@@ -139,7 +139,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
139
139
|
}, l);
|
|
140
140
|
};
|
|
141
141
|
},
|
|
142
|
-
checkbox: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f
|
|
142
|
+
checkbox: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => {
|
|
143
143
|
if (c = mapProps(c), f) {
|
|
144
144
|
let u;
|
|
145
145
|
return u = l === (c.checkedValue ?? !0) ? n?.checked ? n.checked() : createVNode(NCheckbox, { checked: !0 }, null) : n?.unchecked ? n.unchecked() : createVNode(NCheckbox, { disabled: !0 }, null), createVNode(NText, {
|
|
@@ -156,8 +156,8 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
156
156
|
},
|
|
157
157
|
checkboxes: () => {
|
|
158
158
|
let n, c;
|
|
159
|
-
return ({ props: l }, { modelValue: u, required: d, readonly: f
|
|
160
|
-
let { dictType: g, options: v
|
|
159
|
+
return ({ props: l }, { modelValue: u, required: d, readonly: f, ...m }) => {
|
|
160
|
+
let { dictType: g, options: v, ...y } = mapProps(l);
|
|
161
161
|
if (v ? c = v : n !== g && (n = g, !c && n && (c = useDict(n))), f) {
|
|
162
162
|
let n;
|
|
163
163
|
return createVNode(NText, {
|
|
@@ -178,8 +178,8 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
178
178
|
},
|
|
179
179
|
radios: () => {
|
|
180
180
|
let n, l;
|
|
181
|
-
return ({ props: u }, { modelValue: d, required: f, readonly: p
|
|
182
|
-
let { dictType: g, options: v
|
|
181
|
+
return ({ props: u }, { modelValue: d, required: f, readonly: p, ...m }) => {
|
|
182
|
+
let { dictType: g, options: v, ...y } = mapProps(u);
|
|
183
183
|
if (v ? l = v : n !== g && (n = g, !l && n && (l = useDict(n))), p) {
|
|
184
184
|
let n = l?.find((n) => n[y.valueField ?? "value"] === d);
|
|
185
185
|
return createVNode(NText, {
|
|
@@ -195,8 +195,8 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
195
195
|
});
|
|
196
196
|
};
|
|
197
197
|
},
|
|
198
|
-
datepicker: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f
|
|
199
|
-
let { type: m = "date", format: g = m.startsWith("datetime") ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd"
|
|
198
|
+
datepicker: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => {
|
|
199
|
+
let { type: m = "date", format: g = m.startsWith("datetime") ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd", ...v } = mapProps(c);
|
|
200
200
|
return f ? m.endsWith("range") ? createVNode(NText, {
|
|
201
201
|
depth: 2,
|
|
202
202
|
style: "line-height: 1.25"
|
|
@@ -213,7 +213,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
213
213
|
"onUpdate:value": u
|
|
214
214
|
}, n);
|
|
215
215
|
},
|
|
216
|
-
file: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f
|
|
216
|
+
file: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => {
|
|
217
217
|
if (c = mapProps(c), f) {
|
|
218
218
|
let n;
|
|
219
219
|
return console.warn("[file] 原则上此组建不应该显示在详情中"), fileList.value.length === 0 ? void 0 : createVNode(NFlex, {
|
|
@@ -249,7 +249,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
249
249
|
});
|
|
250
250
|
}, p;
|
|
251
251
|
return {
|
|
252
|
-
renderer: ({ slots: d, props: m }, { modelValue: g, "onUpdate:modelValue": y, required: b, readonly: S
|
|
252
|
+
renderer: ({ slots: d, props: m }, { modelValue: g, "onUpdate:modelValue": y, required: b, readonly: S, ...C }) => {
|
|
253
253
|
let w = mapProps(m);
|
|
254
254
|
if (p = w.ref ??= shallowRef(), n !== g && (n = g, f(g?.split(",") ?? [])), S) {
|
|
255
255
|
let n;
|
|
@@ -286,7 +286,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsBy
|
|
|
286
286
|
},
|
|
287
287
|
user: () => {
|
|
288
288
|
let c, p, v;
|
|
289
|
-
return ({ slots: y, props: b }, { modelValue: S, "onUpdate:modelValue": C, required: w, readonly: T
|
|
289
|
+
return ({ slots: y, props: b }, { modelValue: S, "onUpdate:modelValue": C, required: w, readonly: T, ...E }) => {
|
|
290
290
|
let D = mapProps(b);
|
|
291
291
|
return c || (c = shallowRef([]), p = shallowRef([]), v = shallowRef([]), g().then((n) => {
|
|
292
292
|
c.value = n;
|
|
@@ -444,7 +444,7 @@ function createModalHelper() {
|
|
|
444
444
|
display: "flex",
|
|
445
445
|
flexDirection: "column"
|
|
446
446
|
}, l = { content: !0 };
|
|
447
|
-
return () => ({ type: u = "dialog", visible: d, title: f, content: p, footer: m, placement: g, resizable: _, draggable: v, closeOnEsc: b, closable: x, showMask: S, maskClosable: C, width: T, height: E, style: D, onClose: O, onCancel: k, onConfirm: A, onAfterClose: j, onAfterOpen: M, confirmText: N, confirmDisabled: P, confirmLoading: F, cancelText: I, cancelDisabled: L, cancelLoading: R, nativeScrollbar: z
|
|
447
|
+
return () => ({ type: u = "dialog", visible: d, title: f, content: p, footer: m, placement: g, resizable: _, draggable: v, closeOnEsc: b, closable: x, showMask: S, maskClosable: C, width: T, height: E, style: D, onClose: O, onCancel: k, onConfirm: A, onAfterClose: j, onAfterOpen: M, confirmText: N, confirmDisabled: P, confirmLoading: F, cancelText: I, cancelDisabled: L, cancelLoading: R, nativeScrollbar: z, ...B }) => {
|
|
448
448
|
let V = m ? () => m : m === null ? null : () => createVNode(NFlex, {
|
|
449
449
|
justify: "end",
|
|
450
450
|
gap: "16"
|
|
@@ -489,7 +489,7 @@ function createModalHelper() {
|
|
|
489
489
|
action: V
|
|
490
490
|
});
|
|
491
491
|
}
|
|
492
|
-
let { bodyContentClass: H, bodyContentStyle: U
|
|
492
|
+
let { bodyContentClass: H, bodyContentStyle: U, ...W } = B;
|
|
493
493
|
return createVNode(NDrawer, mergeProps({
|
|
494
494
|
show: d,
|
|
495
495
|
trapFocus: !1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ithinkdt/ui",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-202",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "iThinkDT UI",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"sortablejs": "^1.15.6",
|
|
65
65
|
"@types/sortablejs": "^1.15.9",
|
|
66
66
|
"nanoid": "^5.1.6",
|
|
67
|
-
"@ithinkdt/common": "^4.0.0-
|
|
67
|
+
"@ithinkdt/common": "^4.0.0-202"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@ithinkdt/page": ">=4.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"ithinkdt-ui": "^1.8.0",
|
|
87
87
|
"typescript": "~5.9.3",
|
|
88
88
|
"unocss": ">=66.5.6",
|
|
89
|
-
"vite": "npm:rolldown-vite@^7.2.
|
|
89
|
+
"vite": "npm:rolldown-vite@^7.2.5",
|
|
90
90
|
"vue": "^3.5.24",
|
|
91
91
|
"vue-router": "^4.6.3",
|
|
92
92
|
"@ithinkdt/page": "^4.0.0-200"
|