@duxweb/dvha-pro 1.0.18 → 1.0.20
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/cjs/component.cjs +1 -1
- package/dist/cjs/components/card/card.cjs +1 -1
- package/dist/cjs/components/chart/echart.cjs +1 -1
- package/dist/cjs/components/code/code.cjs +1 -0
- package/dist/cjs/components/crop/imageCrop.cjs +1 -1
- package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
- package/dist/cjs/components/data/selectModal.cjs +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +1 -1
- package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
- package/dist/cjs/components/form/formItem.cjs +1 -1
- package/dist/cjs/components/form/formLayout.cjs +1 -1
- package/dist/cjs/components/form/modalForm.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/icon/icon.cjs +1 -1
- package/dist/cjs/components/layout/filter.cjs +1 -1
- package/dist/cjs/components/layout/filterLayout.cjs +1 -0
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/level/level.cjs +1 -1
- package/dist/cjs/components/modal/modal.cjs +1 -1
- package/dist/cjs/components/modal/modalPage.cjs +1 -1
- package/dist/cjs/components/panel/collapse.cjs +1 -0
- package/dist/cjs/components/panel/setting.cjs +1 -1
- package/dist/cjs/components/status/listEmpty.cjs +1 -0
- package/dist/cjs/components/table/table.cjs +1 -0
- package/dist/cjs/components/table/tablePage.cjs +1 -1
- package/dist/cjs/components/tree/treeFilter.cjs +1 -1
- package/dist/cjs/components/upload/config.cjs +1 -0
- package/dist/cjs/components/upload/file.cjs +1 -1
- package/dist/cjs/components/upload/image.cjs +1 -1
- package/dist/cjs/components/upload/manage/item.cjs +1 -1
- package/dist/cjs/components/upload/manager.cjs +1 -1
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/hooks/action.cjs +1 -1
- package/dist/cjs/hooks/dialog.cjs +1 -1
- package/dist/cjs/hooks/drawer.cjs +1 -1
- package/dist/cjs/hooks/modal.cjs +1 -1
- package/dist/cjs/hooks/table/image.cjs +1 -1
- package/dist/cjs/hooks/table/media.cjs +1 -1
- package/dist/cjs/hooks/table.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/langs/en-US.json.cjs +1 -1
- package/dist/cjs/langs/zh-CN.json.cjs +1 -1
- package/dist/cjs/pages/authLayout.cjs +1 -1
- package/dist/cjs/pages/layout/page.cjs +1 -1
- package/dist/cjs/pages/login.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/cmd.cjs +1 -1
- package/dist/cjs/pages/menu/main.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/page.cjs +1 -1
- package/dist/cjs/pages/page404.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/theme/naiveTheme.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +23 -7
- package/dist/esm/component.js +36 -34
- package/dist/esm/components/card/card.js +6 -6
- package/dist/esm/components/chart/echart.js +17 -6
- package/dist/esm/components/code/code.js +53 -0
- package/dist/esm/components/crop/imageCrop.js +37 -26
- package/dist/esm/components/data/dynamicSelect.js +29 -18
- package/dist/esm/components/data/selectModal.js +49 -38
- package/dist/esm/components/drawer/drawer.js +17 -28
- package/dist/esm/components/drawer/drawerPage.js +54 -17
- package/dist/esm/components/form/formItem.js +17 -17
- package/dist/esm/components/form/formLayout.js +8 -8
- package/dist/esm/components/form/modalForm.js +44 -35
- package/dist/esm/components/form/pageForm.js +81 -43
- package/dist/esm/components/form/settingForm.js +28 -17
- package/dist/esm/components/icon/icon.js +23 -12
- package/dist/esm/components/layout/filter.js +15 -11
- package/dist/esm/components/layout/filterLayout.js +34 -0
- package/dist/esm/components/layout/list.js +211 -161
- package/dist/esm/components/layout/table.js +217 -186
- package/dist/esm/components/level/level.js +28 -17
- package/dist/esm/components/modal/modal.js +9 -9
- package/dist/esm/components/modal/modalPage.js +2 -2
- package/dist/esm/components/panel/collapse.js +49 -0
- package/dist/esm/components/panel/setting.js +3 -3
- package/dist/esm/components/status/listEmpty.js +26 -0
- package/dist/esm/components/table/table.js +110 -0
- package/dist/esm/components/table/tablePage.js +24 -18
- package/dist/esm/components/tree/treeFilter.js +44 -39
- package/dist/esm/components/upload/config.js +32 -0
- package/dist/esm/components/upload/file.js +142 -116
- package/dist/esm/components/upload/image.js +95 -66
- package/dist/esm/components/upload/manage/item.js +17 -6
- package/dist/esm/components/upload/manager.js +202 -164
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/action.js +77 -75
- package/dist/esm/hooks/dialog.js +13 -2
- package/dist/esm/hooks/drawer.js +13 -2
- package/dist/esm/hooks/modal.js +13 -2
- package/dist/esm/hooks/table/image.js +21 -10
- package/dist/esm/hooks/table/media.js +20 -9
- package/dist/esm/hooks/table.js +16 -16
- package/dist/esm/index.js +174 -164
- package/dist/esm/langs/en-US.json.js +5 -3
- package/dist/esm/langs/zh-CN.json.js +5 -3
- package/dist/esm/pages/authLayout.js +19 -8
- package/dist/esm/pages/layout/page.js +17 -6
- package/dist/esm/pages/login.js +40 -29
- package/dist/esm/pages/menu/avatar.js +97 -86
- package/dist/esm/pages/menu/button.js +23 -12
- package/dist/esm/pages/menu/cmd.js +45 -34
- package/dist/esm/pages/menu/main.js +40 -27
- package/dist/esm/pages/menu/mobile.js +13 -2
- package/dist/esm/pages/page.js +1 -1
- package/dist/esm/pages/page404.js +20 -9
- package/dist/esm/pages/pageStatus.js +31 -15
- package/dist/esm/theme/naiveTheme.js +6 -6
- package/dist/esm/theme/uno.css.js +23 -7
- package/dist/types/components/code/code.d.ts +44 -0
- package/dist/types/components/code/index.d.ts +1 -0
- package/dist/types/components/drawer/drawer.d.ts +2 -0
- package/dist/types/components/drawer/drawerPage.d.ts +20 -1
- package/dist/types/components/form/formItem.d.ts +2 -2
- package/dist/types/components/form/formLayout.d.ts +3 -3
- package/dist/types/components/form/modalForm.d.ts +3 -3
- package/dist/types/components/form/pageForm.d.ts +12 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/layout/filterLayout.d.ts +32 -0
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/types/components/layout/list.d.ts +7 -1
- package/dist/types/components/layout/table.d.ts +10 -1
- package/dist/types/components/list/card.d.ts +6 -0
- package/dist/types/components/list/list.d.ts +6 -0
- package/dist/types/components/panel/collapse.d.ts +14 -0
- package/dist/types/components/panel/index.d.ts +1 -0
- package/dist/types/components/select/cardSelect.d.ts +1 -1
- package/dist/types/components/status/index.d.ts +1 -0
- package/dist/types/components/status/listEmpty.d.ts +11 -0
- package/dist/types/components/table/index.d.ts +1 -0
- package/dist/types/components/table/table.d.ts +6552 -0
- package/dist/types/components/table/tablePage.d.ts +9 -0
- package/dist/types/components/tree/treeFilter.d.ts +13 -12
- package/dist/types/components/upload/config.d.ts +13 -0
- package/dist/types/components/upload/file.d.ts +4 -0
- package/dist/types/components/upload/image.d.ts +30 -2
- package/dist/types/components/upload/manager.d.ts +4 -0
- package/dist/types/hooks/drawer.d.ts +1 -0
- package/dist/types/hooks/table/types.d.ts +1 -0
- package/dist/types/main.d.ts +6 -0
- package/dist/types/pages/pageStatus.d.ts +11 -1
- package/package.json +7 -5
|
@@ -27,11 +27,22 @@ import "../../pages/page404.js";
|
|
|
27
27
|
import "@iconify-json/tabler/icons.json";
|
|
28
28
|
import "mime";
|
|
29
29
|
import "vue-draggable-plus";
|
|
30
|
+
import "vue3-ace-editor";
|
|
31
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
32
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
33
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
34
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
35
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
36
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
37
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
38
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
39
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
40
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
30
41
|
import { useModal as C } from "../../hooks/modal.js";
|
|
31
42
|
import "dayjs";
|
|
32
43
|
import "@tanstack/vue-query";
|
|
33
44
|
import "pinia";
|
|
34
|
-
const
|
|
45
|
+
const vt = /* @__PURE__ */ y({
|
|
35
46
|
name: "DuxDynamicSelect",
|
|
36
47
|
props: {
|
|
37
48
|
rowKey: {
|
|
@@ -54,32 +65,32 @@ const ot = /* @__PURE__ */ y({
|
|
|
54
65
|
}
|
|
55
66
|
},
|
|
56
67
|
setup(t, {
|
|
57
|
-
emit:
|
|
68
|
+
emit: p
|
|
58
69
|
}) {
|
|
59
|
-
const e = K(t, "value",
|
|
70
|
+
const e = K(t, "value", p, {
|
|
60
71
|
passive: !0,
|
|
61
72
|
defaultValue: t.defaultValue,
|
|
62
73
|
deep: !0
|
|
63
|
-
}),
|
|
74
|
+
}), n = C(), c = D(), {
|
|
64
75
|
t: f
|
|
65
|
-
} = S(),
|
|
66
|
-
return d([e,
|
|
67
|
-
var
|
|
68
|
-
if (!
|
|
76
|
+
} = S(), i = h(!0);
|
|
77
|
+
return d([e, i], () => {
|
|
78
|
+
var r;
|
|
79
|
+
if (!i.value || !e.value || e.value.length === 0)
|
|
69
80
|
return;
|
|
70
|
-
const o = ((
|
|
81
|
+
const o = ((r = e.value) == null ? void 0 : r.map((m) => m[t.rowKey])) || [];
|
|
71
82
|
c.request({
|
|
72
83
|
path: t.path,
|
|
73
84
|
query: {
|
|
74
85
|
ids: (o == null ? void 0 : o.join(",")) || ""
|
|
75
86
|
}
|
|
76
|
-
}).then((
|
|
87
|
+
}).then((m) => {
|
|
77
88
|
var l;
|
|
78
|
-
|
|
79
|
-
e.value.some((v) => v[t.rowKey] ===
|
|
89
|
+
i.value = !1, (l = m == null ? void 0 : m.data) == null || l.forEach((a, u) => {
|
|
90
|
+
e.value.some((v) => v[t.rowKey] === a[t.rowKey]) ? e.value[u] = {
|
|
80
91
|
...e.value[u],
|
|
81
|
-
...
|
|
82
|
-
} : e.value.push(
|
|
92
|
+
...a
|
|
93
|
+
} : e.value.push(a);
|
|
83
94
|
});
|
|
84
95
|
});
|
|
85
96
|
}), () => s(A, {
|
|
@@ -87,7 +98,7 @@ const ot = /* @__PURE__ */ y({
|
|
|
87
98
|
"onUpdate:value": (o) => e.value = o,
|
|
88
99
|
columns: t.columns,
|
|
89
100
|
onCreate: () => {
|
|
90
|
-
|
|
101
|
+
n.show({
|
|
91
102
|
component: () => import("./selectModal.js"),
|
|
92
103
|
componentProps: {
|
|
93
104
|
path: t.path,
|
|
@@ -97,8 +108,8 @@ const ot = /* @__PURE__ */ y({
|
|
|
97
108
|
width: 1e3,
|
|
98
109
|
title: f("buttons.select")
|
|
99
110
|
}).then((o) => {
|
|
100
|
-
|
|
101
|
-
e.value.some((
|
|
111
|
+
i.value = !1, o == null || o.forEach((r) => {
|
|
112
|
+
e.value.some((m) => m[t.rowKey] === r[t.rowKey]) || e.value.push(r);
|
|
102
113
|
});
|
|
103
114
|
});
|
|
104
115
|
}
|
|
@@ -106,5 +117,5 @@ const ot = /* @__PURE__ */ y({
|
|
|
106
117
|
}
|
|
107
118
|
});
|
|
108
119
|
export {
|
|
109
|
-
|
|
120
|
+
vt as DuxDynamicSelect
|
|
110
121
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as h, computed as C, ref as
|
|
1
|
+
import { defineComponent as h, computed as C, ref as m, watch as b, createVNode as i, Fragment as x, h as w, mergeProps as z, isVNode as P } from "vue";
|
|
2
2
|
import { useI18n as j, useJsonSchema as k } from "@duxweb/dvha-core";
|
|
3
|
-
import { NButton as
|
|
3
|
+
import { NButton as p, NDataTable as K } from "naive-ui";
|
|
4
4
|
import "vue-router";
|
|
5
5
|
import "@overlastic/vue";
|
|
6
6
|
import "clsx";
|
|
@@ -27,14 +27,25 @@ import "@duxweb/dvha-naiveui";
|
|
|
27
27
|
import "../../pages/page404.js";
|
|
28
28
|
import "@iconify-json/tabler/icons.json";
|
|
29
29
|
import "mime";
|
|
30
|
+
import "vue3-ace-editor";
|
|
31
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
32
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
33
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
34
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
35
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
36
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
37
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
38
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
39
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
40
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
30
41
|
import "dayjs";
|
|
31
42
|
import "@tanstack/vue-query";
|
|
32
43
|
import { useTable as D } from "../../hooks/table.js";
|
|
33
44
|
import "pinia";
|
|
34
|
-
function
|
|
35
|
-
return typeof
|
|
45
|
+
function u(t) {
|
|
46
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !P(t);
|
|
36
47
|
}
|
|
37
|
-
const
|
|
48
|
+
const bt = /* @__PURE__ */ h({
|
|
38
49
|
name: "Select",
|
|
39
50
|
props: {
|
|
40
51
|
path: String,
|
|
@@ -49,13 +60,13 @@ const ue = /* @__PURE__ */ h({
|
|
|
49
60
|
onConfirm: Function,
|
|
50
61
|
onClose: Function
|
|
51
62
|
},
|
|
52
|
-
setup(
|
|
63
|
+
setup(t) {
|
|
53
64
|
const {
|
|
54
|
-
t:
|
|
65
|
+
t: n
|
|
55
66
|
} = j(), f = C(() => [{
|
|
56
67
|
type: "selection",
|
|
57
68
|
fixed: "left"
|
|
58
|
-
}, ...
|
|
69
|
+
}, ...t.columns || []]), l = m({}), a = m({
|
|
59
70
|
page: 1,
|
|
60
71
|
pageSize: 10
|
|
61
72
|
}), {
|
|
@@ -65,72 +76,72 @@ const ue = /* @__PURE__ */ h({
|
|
|
65
76
|
pageSizes: S,
|
|
66
77
|
checkeds: v
|
|
67
78
|
} = D({
|
|
68
|
-
path:
|
|
79
|
+
path: t.path || "",
|
|
69
80
|
columns: f.value || [],
|
|
70
|
-
filters:
|
|
71
|
-
pagination:
|
|
72
|
-
}), c =
|
|
73
|
-
b(v, (
|
|
74
|
-
var
|
|
75
|
-
c.value = (
|
|
81
|
+
filters: l,
|
|
82
|
+
pagination: a.value
|
|
83
|
+
}), c = m([]);
|
|
84
|
+
b(v, (e) => {
|
|
85
|
+
var r;
|
|
86
|
+
c.value = (r = g.value) == null ? void 0 : r.filter((o) => e.includes(o[t.rowKey]));
|
|
76
87
|
});
|
|
77
88
|
const y = k({
|
|
78
|
-
data:
|
|
89
|
+
data: t.filterSchema || [],
|
|
79
90
|
context: {
|
|
80
|
-
filter:
|
|
91
|
+
filter: l
|
|
81
92
|
}
|
|
82
93
|
});
|
|
83
94
|
return () => i(N, {
|
|
84
|
-
title:
|
|
95
|
+
title: n("components.data.selectTitle"),
|
|
85
96
|
onClose: () => {
|
|
86
|
-
var
|
|
87
|
-
(
|
|
97
|
+
var e;
|
|
98
|
+
(e = t.onClose) == null || e.call(t);
|
|
88
99
|
}
|
|
89
100
|
}, {
|
|
90
101
|
default: () => i("div", {
|
|
91
102
|
class: "flex flex-col gap-4"
|
|
92
|
-
}, [
|
|
103
|
+
}, [t.filterSchema && i("div", {
|
|
93
104
|
class: "grid grid-cols-1 md:grid-cols-4 gap-2"
|
|
94
105
|
}, [w(y.render)]), i(K, z({
|
|
95
106
|
bordered: !1,
|
|
96
107
|
maxHeight: 400,
|
|
97
|
-
rowKey: (
|
|
108
|
+
rowKey: (e) => e[t.rowKey]
|
|
98
109
|
}, d.value, {
|
|
99
110
|
pagination: {
|
|
100
|
-
page:
|
|
101
|
-
pageSize:
|
|
111
|
+
page: a.value.page,
|
|
112
|
+
pageSize: a.value.pageSize,
|
|
102
113
|
pageCount: s.value,
|
|
103
114
|
pageSizes: S,
|
|
104
|
-
onUpdatePage: (
|
|
105
|
-
|
|
115
|
+
onUpdatePage: (e) => {
|
|
116
|
+
a.value.page = e;
|
|
106
117
|
},
|
|
107
|
-
onUpdatePageSize: (
|
|
108
|
-
|
|
118
|
+
onUpdatePageSize: (e) => {
|
|
119
|
+
a.value.pageSize = e;
|
|
109
120
|
}
|
|
110
121
|
}
|
|
111
122
|
}), null)]),
|
|
112
123
|
footer: () => {
|
|
113
|
-
let
|
|
114
|
-
return i(x, null, [i(
|
|
124
|
+
let e, r;
|
|
125
|
+
return i(x, null, [i(p, {
|
|
115
126
|
onClick: () => {
|
|
116
127
|
var o;
|
|
117
|
-
(o =
|
|
128
|
+
(o = t.onClose) == null || o.call(t);
|
|
118
129
|
}
|
|
119
|
-
},
|
|
120
|
-
default: () => [
|
|
121
|
-
}), i(
|
|
130
|
+
}, u(e = n("components.button.cancel")) ? e : {
|
|
131
|
+
default: () => [e]
|
|
132
|
+
}), i(p, {
|
|
122
133
|
type: "primary",
|
|
123
134
|
onClick: () => {
|
|
124
135
|
var o;
|
|
125
|
-
(o =
|
|
136
|
+
(o = t.onConfirm) == null || o.call(t, c.value);
|
|
126
137
|
}
|
|
127
|
-
},
|
|
128
|
-
default: () => [
|
|
138
|
+
}, u(r = n("components.button.select")) ? r : {
|
|
139
|
+
default: () => [r]
|
|
129
140
|
})]);
|
|
130
141
|
}
|
|
131
142
|
});
|
|
132
143
|
}
|
|
133
144
|
});
|
|
134
145
|
export {
|
|
135
|
-
|
|
146
|
+
bt as default
|
|
136
147
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as u, defineAsyncComponent as
|
|
1
|
+
import { defineComponent as u, defineAsyncComponent as c, createVNode as t, Suspense as d } from "vue";
|
|
2
2
|
import { useExtendOverlay as f } from "@overlastic/vue";
|
|
3
|
-
import { NDrawer as
|
|
3
|
+
import { NDrawer as r, NSpin as s } from "naive-ui";
|
|
4
4
|
const w = /* @__PURE__ */ u({
|
|
5
5
|
name: "DuxDrawer",
|
|
6
6
|
props: {
|
|
7
7
|
title: String,
|
|
8
8
|
width: [Number, String],
|
|
9
|
+
maxWidth: [Number],
|
|
9
10
|
placement: {
|
|
10
11
|
type: String,
|
|
11
12
|
default: "right"
|
|
@@ -20,17 +21,18 @@ const w = /* @__PURE__ */ u({
|
|
|
20
21
|
const {
|
|
21
22
|
visible: i,
|
|
22
23
|
resolve: a,
|
|
23
|
-
reject:
|
|
24
|
+
reject: l,
|
|
24
25
|
vanish: o
|
|
25
26
|
} = f({
|
|
26
27
|
duration: 1e3
|
|
27
|
-
}),
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
return () => t(
|
|
28
|
+
}), n = (e == null ? void 0 : e.componentProps) || {};
|
|
29
|
+
n.title = e.title, n.onConfirm = a, n.onClose = l;
|
|
30
|
+
const m = typeof e.component == "function" ? c(e.component) : e.component;
|
|
31
|
+
return () => t(r, {
|
|
31
32
|
closeOnEsc: !1,
|
|
32
33
|
maskClosable: !1,
|
|
33
|
-
minWidth:
|
|
34
|
+
minWidth: 200,
|
|
35
|
+
maxWidth: (e == null ? void 0 : e.maxWidth) || 800,
|
|
34
36
|
defaultWidth: (e == null ? void 0 : e.width) || 400,
|
|
35
37
|
resizable: !0,
|
|
36
38
|
placement: e.placement,
|
|
@@ -40,28 +42,15 @@ const w = /* @__PURE__ */ u({
|
|
|
40
42
|
o();
|
|
41
43
|
},
|
|
42
44
|
onEsc: () => {
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
+
l();
|
|
46
|
+
},
|
|
47
|
+
autoFocus: !1
|
|
45
48
|
}, {
|
|
46
49
|
default: () => [t("div", {
|
|
47
|
-
class: "h-full
|
|
48
|
-
}, [t(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class: "text-base"
|
|
52
|
-
}, [e == null ? void 0 : e.title]), t("div", null, [t(m, {
|
|
53
|
-
quaternary: !0,
|
|
54
|
-
size: "small",
|
|
55
|
-
color: "default",
|
|
56
|
-
class: "!px-1 h-6",
|
|
57
|
-
onClick: () => n()
|
|
58
|
-
}, {
|
|
59
|
-
default: () => [t("div", {
|
|
60
|
-
class: "i-tabler:x w-5 h-5"
|
|
61
|
-
}, null)]
|
|
62
|
-
})])]), t(d, null, {
|
|
63
|
-
default: () => t(c, l, null),
|
|
64
|
-
fallback: () => t(b, {
|
|
50
|
+
class: "h-full"
|
|
51
|
+
}, [t(d, null, {
|
|
52
|
+
default: () => t(m, n, null),
|
|
53
|
+
fallback: () => t(s, {
|
|
65
54
|
show: !0
|
|
66
55
|
}, {
|
|
67
56
|
default: () => [t("div", {
|
|
@@ -1,28 +1,65 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { NScrollbar as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as t, ref as u, watch as d, nextTick as m, createVNode as a } from "vue";
|
|
2
|
+
import { NButton as o, NScrollbar as x } from "naive-ui";
|
|
3
|
+
const h = /* @__PURE__ */ t({
|
|
4
4
|
name: "DuxDrawerPage",
|
|
5
|
-
props: {
|
|
6
|
-
|
|
5
|
+
props: {
|
|
6
|
+
title: String,
|
|
7
|
+
onClose: Function,
|
|
8
|
+
onConfirm: Function,
|
|
9
|
+
scrollbar: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: !0
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(n, {
|
|
7
15
|
slots: e
|
|
8
16
|
}) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
const c = u();
|
|
18
|
+
return d(c, (r) => {
|
|
19
|
+
r && m(() => {
|
|
20
|
+
var i, f;
|
|
21
|
+
(f = (i = r.$el) == null ? void 0 : i.focus) == null || f.call(i);
|
|
22
|
+
});
|
|
23
|
+
}), () => {
|
|
24
|
+
var r, i, f;
|
|
25
|
+
return a("div", {
|
|
26
|
+
class: "h-full flex flex-col"
|
|
27
|
+
}, [a("div", {
|
|
28
|
+
class: "flex justify-between items-center p-2 border-b border-default"
|
|
29
|
+
}, [a("div", {
|
|
30
|
+
class: "text-base"
|
|
31
|
+
}, [n == null ? void 0 : n.title]), a("div", {
|
|
32
|
+
class: "flex items-center gap-2"
|
|
33
|
+
}, [(r = e.header) == null ? void 0 : r.call(e), a(o, {
|
|
34
|
+
quaternary: !0,
|
|
35
|
+
ref: c,
|
|
36
|
+
size: "small",
|
|
37
|
+
color: "default",
|
|
38
|
+
class: "!px-1 h-6",
|
|
39
|
+
onClick: () => {
|
|
40
|
+
var l;
|
|
41
|
+
return (l = n.onClose) == null ? void 0 : l.call(n);
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
default: () => [a("div", {
|
|
45
|
+
class: "i-tabler:x w-5 h-5"
|
|
46
|
+
}, null)]
|
|
47
|
+
})])]), a("div", {
|
|
14
48
|
class: "flex-1 min-h-1"
|
|
15
|
-
}, [
|
|
49
|
+
}, [n.scrollbar ? a(x, null, {
|
|
16
50
|
default: () => {
|
|
17
|
-
var
|
|
18
|
-
return [(
|
|
51
|
+
var l;
|
|
52
|
+
return [(l = e.default) == null ? void 0 : l.call(e)];
|
|
19
53
|
}
|
|
20
|
-
})]),
|
|
21
|
-
class: "flex-none border-t border-
|
|
22
|
-
}, [(
|
|
54
|
+
}) : (i = e.default) == null ? void 0 : i.call(e)]), e.actions && a("div", {
|
|
55
|
+
class: "flex-none border-t border-muted p-4 flex justify-end gap-2"
|
|
56
|
+
}, [(f = e.actions) == null ? void 0 : f.call(e, {
|
|
57
|
+
onClose: n.onClose,
|
|
58
|
+
onConfirm: n.onConfirm
|
|
59
|
+
})])]);
|
|
23
60
|
};
|
|
24
61
|
}
|
|
25
62
|
});
|
|
26
63
|
export {
|
|
27
|
-
|
|
64
|
+
h as DuxDrawerPage
|
|
28
65
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as x, toRef as
|
|
1
|
+
import { defineComponent as x, toRef as b, computed as r, watch as h, inject as y, createVNode as l, createTextVNode as p } from "vue";
|
|
2
2
|
import { watchThrottled as j } from "@vueuse/core";
|
|
3
|
-
import { useField as
|
|
4
|
-
const
|
|
3
|
+
import { useField as w } from "vee-validate";
|
|
4
|
+
const q = /* @__PURE__ */ x({
|
|
5
5
|
name: "DuxFormItem",
|
|
6
6
|
props: {
|
|
7
7
|
label: String,
|
|
@@ -17,17 +17,17 @@ const p = /* @__PURE__ */ x({
|
|
|
17
17
|
message: [String, Object]
|
|
18
18
|
},
|
|
19
19
|
setup(e, {
|
|
20
|
-
slots:
|
|
20
|
+
slots: i
|
|
21
21
|
}) {
|
|
22
|
-
const c =
|
|
22
|
+
const c = b(e.message), {
|
|
23
23
|
errorMessage: d,
|
|
24
24
|
value: m,
|
|
25
25
|
setErrors: f,
|
|
26
26
|
validate: s
|
|
27
|
-
} =
|
|
27
|
+
} = w(e.path || "", e.rule || {}, {
|
|
28
28
|
label: e.label
|
|
29
29
|
}), o = r(() => e.rule ? typeof e.rule == "string" ? e.rule.includes("required") : typeof e.rule == "object" ? "required" in e.rule : !1 : !1), n = r(() => d.value && (c.value || d.value));
|
|
30
|
-
|
|
30
|
+
h(n, (t) => {
|
|
31
31
|
t && f(t);
|
|
32
32
|
}, {
|
|
33
33
|
immediate: !0
|
|
@@ -37,20 +37,20 @@ const p = /* @__PURE__ */ x({
|
|
|
37
37
|
throttle: 300,
|
|
38
38
|
deep: !0
|
|
39
39
|
});
|
|
40
|
-
const u =
|
|
40
|
+
const u = y("dux.form", {
|
|
41
41
|
labelPlacement: "left",
|
|
42
42
|
labelWidth: 70,
|
|
43
43
|
divider: !1
|
|
44
|
-
}),
|
|
44
|
+
}), a = r(() => e.labelPlacement || u.labelPlacement), v = r(() => {
|
|
45
45
|
let t = e.labelWidth || u.labelWidth || 70;
|
|
46
|
-
return typeof t == "number" && (t = `${t}px`),
|
|
47
|
-
});
|
|
46
|
+
return typeof t == "number" && (t = `${t}px`), a.value !== "left" ? "auto" : t;
|
|
47
|
+
}), g = r(() => u.divider || a.value === "page");
|
|
48
48
|
return () => {
|
|
49
49
|
var t;
|
|
50
50
|
return l("div", {
|
|
51
|
-
class: [
|
|
51
|
+
class: [a.value !== "top" ? "md:flex-row gap-2" : "gap-1", g.value ? "py-6" : "", a.value === "setting" ? "md:justify-between md:items-start md:gap-4" : "", a.value === "page" ? "grid grid-cols-1 lg:grid-cols-4 px-4" : "flex flex-col lg:items-center"]
|
|
52
52
|
}, [l("div", {
|
|
53
|
-
class: [
|
|
53
|
+
class: [a.value === "left" ? "flex lg:items-center" : ""],
|
|
54
54
|
style: {
|
|
55
55
|
width: v.value
|
|
56
56
|
}
|
|
@@ -60,11 +60,11 @@ const p = /* @__PURE__ */ x({
|
|
|
60
60
|
class: "relative flex items-center gap-1"
|
|
61
61
|
}, [e.label, o.value && l("span", {
|
|
62
62
|
class: "text-error font-mono text-xs"
|
|
63
|
-
}, [
|
|
63
|
+
}, [p("*")])])]), e.description && typeof e.description == "string" && l("div", {
|
|
64
64
|
class: "text-sm text-muted"
|
|
65
65
|
}, [e.description])])]), l("div", {
|
|
66
|
-
class: ["flex flex-col gap-1",
|
|
67
|
-
}, [l("div", null, [(t =
|
|
66
|
+
class: ["flex flex-col gap-1", a.value !== "left" ? "md:mt-1" : "", a.value === "setting" ? "flex-none min-w-200px" : "flex-1", a.value === "page" ? "col-span-3" : ""]
|
|
67
|
+
}, [l("div", null, [(t = i == null ? void 0 : i.default) == null ? void 0 : t.call(i)]), e.description && typeof e.description != "string" && l("div", {
|
|
68
68
|
class: "text-sm text-muted"
|
|
69
69
|
}, [e.description]), n.value && l("div", {
|
|
70
70
|
class: "text-error"
|
|
@@ -73,5 +73,5 @@ const p = /* @__PURE__ */ x({
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
export {
|
|
76
|
-
|
|
76
|
+
q as DuxFormItem
|
|
77
77
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as d, provide as i, createVNode as t } from "vue";
|
|
2
|
+
const m = /* @__PURE__ */ d({
|
|
3
3
|
name: "DuxFormLayout",
|
|
4
4
|
props: {
|
|
5
5
|
labelPlacement: {
|
|
@@ -19,20 +19,20 @@ const r = /* @__PURE__ */ a({
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
setup(e, {
|
|
22
|
-
slots:
|
|
22
|
+
slots: a
|
|
23
23
|
}) {
|
|
24
|
-
return
|
|
24
|
+
return i("dux.form", {
|
|
25
25
|
labelPlacement: e.labelPlacement,
|
|
26
26
|
labelWidth: e.labelWidth,
|
|
27
27
|
divider: e.divider
|
|
28
28
|
}), () => {
|
|
29
|
-
var
|
|
29
|
+
var l;
|
|
30
30
|
return t("div", {
|
|
31
|
-
class: ["flex
|
|
32
|
-
}, [(
|
|
31
|
+
class: ["flex ", e.divider || e.labelPlacement === "page" ? " divide-y divide-default dark:divide-gray-800" : "", e.inline ? "flex-row" : "flex-col", e.labelPlacement === "page" || e.labelPlacement === "setting" ? "container mx-auto" : "gap-4"]
|
|
32
|
+
}, [(l = a == null ? void 0 : a.default) == null ? void 0 : l.call(a)]);
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
m as DuxFormLayout
|
|
38
38
|
};
|