@duxweb/dvha-pro 1.0.26 → 1.0.28
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/components/data/dynamicData.cjs +1 -1
- package/dist/cjs/components/designEditor/editor.cjs +1 -1
- package/dist/cjs/components/form/formItem.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/formEditor/editor.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/table/tablePage.cjs +1 -1
- package/dist/cjs/hooks/action.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +2 -1
- package/dist/esm/components/data/dynamicData.js +49 -46
- package/dist/esm/components/designEditor/editor.js +49 -49
- package/dist/esm/components/form/formItem.js +1 -1
- package/dist/esm/components/form/pageForm.js +36 -29
- package/dist/esm/components/formEditor/editor.js +34 -32
- package/dist/esm/components/layout/table.js +24 -24
- package/dist/esm/components/table/tablePage.js +9 -8
- package/dist/esm/hooks/action.js +42 -41
- package/dist/esm/theme/uno.css.js +2 -1
- package/dist/types/components/data/dynamicData.d.ts +1 -1
- package/dist/types/components/form/pageForm.d.ts +9 -0
- package/dist/types/components/table/tablePage.d.ts +1 -0
- package/dist/types/hooks/table/types.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as f, toRef as b, createVNode as e } from "vue";
|
|
2
2
|
import { useI18n as g, useTabStore as y, useInvalidate as S, useExtendForm as x } from "@duxweb/dvha-core";
|
|
3
|
-
import { useMessage as
|
|
3
|
+
import { useMessage as v, NButton as l, NScrollbar as h } from "naive-ui";
|
|
4
4
|
import { useRouter as E } from "vue-router";
|
|
5
5
|
import "@overlastic/vue";
|
|
6
6
|
import { DuxCard as F } from "../card/card.js";
|
|
@@ -24,7 +24,7 @@ import "lodash-es";
|
|
|
24
24
|
import "vue-draggable-plus";
|
|
25
25
|
import "short-unique-id";
|
|
26
26
|
import "aieditor";
|
|
27
|
-
import { DuxFormLayout as
|
|
27
|
+
import { DuxFormLayout as P } from "./formLayout.js";
|
|
28
28
|
import "vee-validate";
|
|
29
29
|
import "@duxweb/dvha-naiveui";
|
|
30
30
|
import "@iconify-json/tabler/icons.json";
|
|
@@ -44,9 +44,9 @@ import "unocss/preset-wind4";
|
|
|
44
44
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
45
45
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
46
46
|
import "vue-command-palette";
|
|
47
|
-
import { DuxPage as
|
|
47
|
+
import { DuxPage as C } from "../../pages/page.js";
|
|
48
48
|
import "../../pages/page404.js";
|
|
49
|
-
const
|
|
49
|
+
const vt = /* @__PURE__ */ f({
|
|
50
50
|
name: "DuxPageForm",
|
|
51
51
|
props: {
|
|
52
52
|
id: {
|
|
@@ -61,6 +61,10 @@ const ht = /* @__PURE__ */ f({
|
|
|
61
61
|
description: {
|
|
62
62
|
type: String
|
|
63
63
|
},
|
|
64
|
+
labelPlacement: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "left"
|
|
67
|
+
},
|
|
64
68
|
path: {
|
|
65
69
|
type: String
|
|
66
70
|
},
|
|
@@ -82,59 +86,62 @@ const ht = /* @__PURE__ */ f({
|
|
|
82
86
|
}
|
|
83
87
|
},
|
|
84
88
|
setup(t, {
|
|
85
|
-
slots:
|
|
89
|
+
slots: m
|
|
86
90
|
}) {
|
|
87
91
|
const {
|
|
88
|
-
t:
|
|
89
|
-
} = g(),
|
|
90
|
-
invalidate:
|
|
91
|
-
} = S(),
|
|
92
|
+
t: i
|
|
93
|
+
} = g(), p = b(t, "data", {}), a = v(), s = E(), n = y(), {
|
|
94
|
+
invalidate: c
|
|
95
|
+
} = S(), o = x({
|
|
92
96
|
id: t.id,
|
|
93
97
|
path: t.path,
|
|
94
|
-
form:
|
|
98
|
+
form: p,
|
|
95
99
|
action: t.action,
|
|
96
|
-
onError: (
|
|
97
|
-
a.error(
|
|
100
|
+
onError: (r) => {
|
|
101
|
+
a.error(r.message || i("components.form.error")), t.onError?.(r);
|
|
98
102
|
},
|
|
99
|
-
onSuccess: (
|
|
100
|
-
a.success(
|
|
103
|
+
onSuccess: (r) => {
|
|
104
|
+
a.success(i("components.form.success")), t.onSuccess?.(r), !o.isEdit.value && n.current && n.delTab(n.current, (d) => s.push(d.path || "")), t.invalidate && c(t.invalidate);
|
|
101
105
|
}
|
|
102
|
-
}), u =
|
|
103
|
-
return () => e(
|
|
106
|
+
}), u = n.tabs.find((r) => r.path === n.current);
|
|
107
|
+
return () => e(C, {
|
|
104
108
|
card: !1,
|
|
105
109
|
scrollbar: !1
|
|
106
110
|
}, {
|
|
107
111
|
default: () => [e(F, {
|
|
108
|
-
title: t?.title || u?.label || (
|
|
112
|
+
title: t?.title || u?.label || (o.isEdit.value ? i("components.form.edit") : i("components.form.create")),
|
|
109
113
|
description: t?.description,
|
|
110
114
|
class: "h-full flex flex-col",
|
|
111
115
|
contentClass: "flex-1 min-h-0",
|
|
112
116
|
contentSize: "none",
|
|
113
117
|
"header-bordered": !0
|
|
114
118
|
}, {
|
|
115
|
-
default: () => e(
|
|
116
|
-
default: () => [e(
|
|
117
|
-
|
|
119
|
+
default: () => e(h, null, {
|
|
120
|
+
default: () => [e(P, {
|
|
121
|
+
labelPlacement: t.labelPlacement,
|
|
122
|
+
class: "p-4"
|
|
118
123
|
}, {
|
|
119
|
-
default: () => [
|
|
124
|
+
default: () => [m?.default?.(o)]
|
|
120
125
|
})]
|
|
121
126
|
}),
|
|
122
127
|
headerExtra: () => e("div", {
|
|
123
128
|
class: "flex gap-6 items-center"
|
|
124
|
-
}, [
|
|
129
|
+
}, [m?.actions?.(o), e("div", {
|
|
125
130
|
class: "flex gap-2"
|
|
126
|
-
}, [e(
|
|
127
|
-
onClick: () =>
|
|
131
|
+
}, [e(l, {
|
|
132
|
+
onClick: () => o.onReset(),
|
|
133
|
+
loading: o.isLoading.value
|
|
128
134
|
}, {
|
|
129
|
-
default: () =>
|
|
135
|
+
default: () => i("components.button.reset"),
|
|
130
136
|
icon: () => e("i", {
|
|
131
137
|
class: "i-tabler:refresh"
|
|
132
138
|
}, null)
|
|
133
|
-
}), e(
|
|
139
|
+
}), e(l, {
|
|
134
140
|
type: "primary",
|
|
135
|
-
onClick: () =>
|
|
141
|
+
onClick: () => o.onSubmit(),
|
|
142
|
+
loading: o.isLoading.value
|
|
136
143
|
}, {
|
|
137
|
-
default: () =>
|
|
144
|
+
default: () => i("components.button.submit"),
|
|
138
145
|
icon: () => e("i", {
|
|
139
146
|
class: "i-tabler:device-floppy"
|
|
140
147
|
}, null)
|
|
@@ -144,5 +151,5 @@ const ht = /* @__PURE__ */ f({
|
|
|
144
151
|
}
|
|
145
152
|
});
|
|
146
153
|
export {
|
|
147
|
-
|
|
154
|
+
vt as DuxPageForm
|
|
148
155
|
};
|
|
@@ -34,32 +34,32 @@ import "vee-validate";
|
|
|
34
34
|
import "vue-command-palette";
|
|
35
35
|
import "@duxweb/dvha-naiveui";
|
|
36
36
|
import "../../pages/page404.js";
|
|
37
|
-
import { DuxDesignEditor as
|
|
37
|
+
import { DuxDesignEditor as c } from "../designEditor/editor.js";
|
|
38
38
|
import "short-unique-id";
|
|
39
39
|
import "aieditor";
|
|
40
40
|
import { DuxFormLayout as g } from "../form/formLayout.js";
|
|
41
|
+
import { DuxFormEditorSettingPage as v } from "./base/setting.js";
|
|
41
42
|
import { duxFormEditorCascader as y } from "./components/cascader.js";
|
|
42
43
|
import { duxFormEditorCascaderAsync as b } from "./components/cascaderAsync.js";
|
|
43
|
-
import { duxFormEditorCheckbox as
|
|
44
|
-
import { duxFormEditorColor as
|
|
45
|
-
import { duxFormEditorDate as
|
|
46
|
-
import { duxFormEditorDynamicInput as
|
|
47
|
-
import { duxFormEditorDynamicTags as
|
|
48
|
-
import { duxFormEditorAIEditor as
|
|
49
|
-
import { duxFormEditorInput as
|
|
50
|
-
import { duxFormEditorInputNumber as
|
|
51
|
-
import { duxFormEditorMentionAsync as
|
|
52
|
-
import { duxFormEditorRadio as
|
|
53
|
-
import { duxFormEditorRegion as
|
|
54
|
-
import { duxFormEditorSider as
|
|
55
|
-
import { duxFormEditorSwitch as
|
|
56
|
-
import { duxFormEditorTime as
|
|
57
|
-
import { duxFormEditorTransferAsync as
|
|
58
|
-
import { duxFormEditorTreeSelect as
|
|
59
|
-
import { duxFormEditorTreeSelectAsync as
|
|
60
|
-
import { duxFormEditorSelect as
|
|
61
|
-
import { duxFormEditorSelectAsync as
|
|
62
|
-
import { DuxFormEditorSettingPage as L } from "./base/setting.js";
|
|
44
|
+
import { duxFormEditorCheckbox as S } from "./components/checkbox.js";
|
|
45
|
+
import { duxFormEditorColor as D } from "./components/color.js";
|
|
46
|
+
import { duxFormEditorDate as C } from "./components/date.js";
|
|
47
|
+
import { duxFormEditorDynamicInput as P } from "./components/dynamicInput.js";
|
|
48
|
+
import { duxFormEditorDynamicTags as k } from "./components/dynamicTags.js";
|
|
49
|
+
import { duxFormEditorAIEditor as A } from "./components/editor.js";
|
|
50
|
+
import { duxFormEditorInput as h } from "./components/input.js";
|
|
51
|
+
import { duxFormEditorInputNumber as j } from "./components/inputNumber.js";
|
|
52
|
+
import { duxFormEditorMentionAsync as I } from "./components/mentionAsync.js";
|
|
53
|
+
import { duxFormEditorRadio as T } from "./components/radio.js";
|
|
54
|
+
import { duxFormEditorRegion as w } from "./components/region.js";
|
|
55
|
+
import { duxFormEditorSider as N } from "./components/sider.js";
|
|
56
|
+
import { duxFormEditorSwitch as O } from "./components/switch.js";
|
|
57
|
+
import { duxFormEditorTime as _ } from "./components/time.js";
|
|
58
|
+
import { duxFormEditorTransferAsync as R } from "./components/transferAsync.js";
|
|
59
|
+
import { duxFormEditorTreeSelect as M } from "./components/treeSelect.js";
|
|
60
|
+
import { duxFormEditorTreeSelectAsync as V } from "./components/treeSelectAsync.js";
|
|
61
|
+
import { duxFormEditorSelect as B } from "./components/select.js";
|
|
62
|
+
import { duxFormEditorSelectAsync as L } from "./components/selectAsync.js";
|
|
63
63
|
import "@iconify-json/tabler/icons.json";
|
|
64
64
|
import "../posterEditor/elements/index.js";
|
|
65
65
|
import "fabric";
|
|
@@ -76,9 +76,11 @@ const er = /* @__PURE__ */ f({
|
|
|
76
76
|
props: {
|
|
77
77
|
onSave: Function
|
|
78
78
|
},
|
|
79
|
-
extends:
|
|
79
|
+
extends: c,
|
|
80
80
|
setup(m) {
|
|
81
|
-
const
|
|
81
|
+
const {
|
|
82
|
+
t: o
|
|
83
|
+
} = F(), l = W(), d = u(() => [{
|
|
82
84
|
name: "form",
|
|
83
85
|
label: o("components.formEditor.groups.form"),
|
|
84
86
|
icon: "i-tabler:forms"
|
|
@@ -90,14 +92,12 @@ const er = /* @__PURE__ */ f({
|
|
|
90
92
|
name: "async",
|
|
91
93
|
label: o("components.formEditor.groups.async"),
|
|
92
94
|
icon: "i-tabler:loader"
|
|
93
|
-
}]),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return () => t(d, E(m, {
|
|
97
|
-
groups: l.value,
|
|
95
|
+
}]), s = u(() => [h(o), j(o), A(o), N(o), C(o), _(o), D(o), S(o), T(o), O(o), P(o), k(o), B(o), y(o), M(o), w(o), L(o), b(o), V(o), R(o), I(o)]);
|
|
96
|
+
return () => t(c, E(m, {
|
|
97
|
+
groups: d.value,
|
|
98
98
|
components: s.value,
|
|
99
99
|
settingPage: {
|
|
100
|
-
component: (r) => t(
|
|
100
|
+
component: (r) => t(v, r, null),
|
|
101
101
|
default: {
|
|
102
102
|
labelPlacement: "left"
|
|
103
103
|
}
|
|
@@ -120,7 +120,7 @@ const er = /* @__PURE__ */ f({
|
|
|
120
120
|
secondary: !0,
|
|
121
121
|
block: !0,
|
|
122
122
|
onClick: () => {
|
|
123
|
-
|
|
123
|
+
l.show({
|
|
124
124
|
title: o("components.formEditor.main.actions.jsonOutput"),
|
|
125
125
|
component: () => import("./json.js"),
|
|
126
126
|
componentProps: {
|
|
@@ -135,7 +135,7 @@ const er = /* @__PURE__ */ f({
|
|
|
135
135
|
secondary: !0,
|
|
136
136
|
block: !0,
|
|
137
137
|
onClick: () => {
|
|
138
|
-
|
|
138
|
+
l.show({
|
|
139
139
|
title: o("common.preview"),
|
|
140
140
|
component: () => import("./preview.js"),
|
|
141
141
|
componentProps: {
|
|
@@ -149,7 +149,9 @@ const er = /* @__PURE__ */ f({
|
|
|
149
149
|
}), t(a, {
|
|
150
150
|
type: "primary",
|
|
151
151
|
block: !0,
|
|
152
|
-
onClick: () =>
|
|
152
|
+
onClick: () => {
|
|
153
|
+
m.onSave?.(r?.value?.value || {});
|
|
154
|
+
}
|
|
153
155
|
}, p(n = o("components.formEditor.main.actions.save")) ? n : {
|
|
154
156
|
default: () => [n]
|
|
155
157
|
})]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as J, toRef as x, computed as
|
|
1
|
+
import { defineComponent as J, toRef as x, computed as s, reactive as v, createVNode as e, h as k, mergeProps as K, isVNode as G } from "vue";
|
|
2
2
|
import { useI18n as H, useJsonSchema as C } from "@duxweb/dvha-core";
|
|
3
3
|
import { useWindowSize as Q } from "@vueuse/core";
|
|
4
4
|
import { NTabs as X, NTab as Y, NButton as r, NPopselect as Z, NTooltip as f, NProgress as $, NPagination as ee, NModal as te, NDrawer as N } from "naive-ui";
|
|
@@ -129,38 +129,38 @@ const ut = /* @__PURE__ */ J({
|
|
|
129
129
|
onExport: V,
|
|
130
130
|
onExportRows: W,
|
|
131
131
|
onImport: I
|
|
132
|
-
} = b, B =
|
|
132
|
+
} = b, B = s(() => w.value.filter((o) => "title" in o && "key" in o).map((o) => ({
|
|
133
133
|
label: o.title,
|
|
134
134
|
value: o.key
|
|
135
135
|
}))), {
|
|
136
136
|
width: n
|
|
137
|
-
} = Q(), M =
|
|
138
|
-
show: !1
|
|
139
|
-
}), u = v({
|
|
137
|
+
} = Q(), M = s(() => w.value.reduce((a, m) => a + (Number(m?.width) || Number(m?.minWidth) || 110), 0)), u = v({
|
|
140
138
|
show: !1
|
|
141
139
|
}), c = v({
|
|
142
140
|
show: !1
|
|
143
|
-
}),
|
|
141
|
+
}), d = v({
|
|
142
|
+
show: !1
|
|
143
|
+
}), h = s(() => (t.filterSchema || []).map((o) => {
|
|
144
144
|
const {
|
|
145
145
|
label: a,
|
|
146
|
-
...
|
|
146
|
+
...m
|
|
147
147
|
} = o;
|
|
148
148
|
return {
|
|
149
149
|
tag: ie,
|
|
150
150
|
attrs: {
|
|
151
151
|
label: a
|
|
152
152
|
},
|
|
153
|
-
children:
|
|
153
|
+
children: m
|
|
154
154
|
};
|
|
155
155
|
})), {
|
|
156
156
|
render: _
|
|
157
157
|
} = C({
|
|
158
|
-
data: h.value?.slice(t.filterNumber)
|
|
158
|
+
data: s(() => h.value?.slice(t.filterNumber))
|
|
159
159
|
}), {
|
|
160
160
|
render: q
|
|
161
161
|
} = C({
|
|
162
|
-
data: h.value?.slice(0, t.filterNumber)
|
|
163
|
-
}), g =
|
|
162
|
+
data: s(() => h.value?.slice(0, t.filterNumber))
|
|
163
|
+
}), g = s(() => ({
|
|
164
164
|
import: !1,
|
|
165
165
|
export: !0,
|
|
166
166
|
refresh: !0,
|
|
@@ -200,7 +200,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
200
200
|
class: "flex-none",
|
|
201
201
|
secondary: !0,
|
|
202
202
|
onClick: () => {
|
|
203
|
-
|
|
203
|
+
c.show = !c.show;
|
|
204
204
|
}
|
|
205
205
|
}, {
|
|
206
206
|
icon: () => e("div", {
|
|
@@ -212,7 +212,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
212
212
|
class: "flex-none",
|
|
213
213
|
secondary: !0,
|
|
214
214
|
onClick: () => {
|
|
215
|
-
|
|
215
|
+
d.show = !d.show;
|
|
216
216
|
}
|
|
217
217
|
}, {
|
|
218
218
|
icon: () => e("div", {
|
|
@@ -225,7 +225,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
225
225
|
}, [h.value.length > t.filterNumber && e(r, {
|
|
226
226
|
iconPlacement: "right",
|
|
227
227
|
onClick: () => {
|
|
228
|
-
|
|
228
|
+
u.show = !u.show;
|
|
229
229
|
}
|
|
230
230
|
}, {
|
|
231
231
|
default: () => i("components.button.filter"),
|
|
@@ -300,7 +300,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
300
300
|
}, [l.actions?.(), t.actions?.length > 0 && T({
|
|
301
301
|
type: n.value < 1024 ? "dropdown" : "button",
|
|
302
302
|
items: t.actions
|
|
303
|
-
})])])]), e("div", {
|
|
303
|
+
})])])]), l?.header?.(), e("div", {
|
|
304
304
|
class: "flex-1 min-h-0"
|
|
305
305
|
}, [l?.default?.({
|
|
306
306
|
...b,
|
|
@@ -333,8 +333,8 @@ const ut = /* @__PURE__ */ J({
|
|
|
333
333
|
}, null), e(te, {
|
|
334
334
|
draggable: !0,
|
|
335
335
|
class: "bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur min-w-110",
|
|
336
|
-
show:
|
|
337
|
-
onUpdateShow: (o) =>
|
|
336
|
+
show: u.show,
|
|
337
|
+
onUpdateShow: (o) => u.show = o
|
|
338
338
|
}, {
|
|
339
339
|
default: ({
|
|
340
340
|
draggableClass: o
|
|
@@ -343,7 +343,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
343
343
|
return e(le, {
|
|
344
344
|
title: i("components.button.filter"),
|
|
345
345
|
handle: o,
|
|
346
|
-
onClose: () =>
|
|
346
|
+
onClose: () => u.show = !1
|
|
347
347
|
}, {
|
|
348
348
|
default: () => [e(ae, {
|
|
349
349
|
showLabel: !0,
|
|
@@ -354,27 +354,27 @@ const ut = /* @__PURE__ */ J({
|
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
356
|
}), e(N, {
|
|
357
|
-
show:
|
|
358
|
-
onUpdateShow: (o) =>
|
|
357
|
+
show: c.show,
|
|
358
|
+
onUpdateShow: (o) => c.show = o,
|
|
359
359
|
autoFocus: !1,
|
|
360
360
|
placement: "left"
|
|
361
361
|
}, {
|
|
362
362
|
default: () => [e(R, {
|
|
363
363
|
title: t.sideLeftTitle || i("components.button.sideLeft"),
|
|
364
|
-
onClose: () =>
|
|
364
|
+
onClose: () => c.show = !1,
|
|
365
365
|
scrollbar: !1
|
|
366
366
|
}, {
|
|
367
367
|
default: () => [l?.sideLeft?.()]
|
|
368
368
|
})]
|
|
369
369
|
}), e(N, {
|
|
370
|
-
show:
|
|
371
|
-
onUpdateShow: (o) =>
|
|
370
|
+
show: d.show,
|
|
371
|
+
onUpdateShow: (o) => d.show = o,
|
|
372
372
|
autoFocus: !1,
|
|
373
373
|
placement: "right"
|
|
374
374
|
}, {
|
|
375
375
|
default: () => [e(R, {
|
|
376
376
|
title: t.sideRightTitle || i("components.button.sideRight"),
|
|
377
|
-
onClose: () =>
|
|
377
|
+
onClose: () => d.show = !1,
|
|
378
378
|
scrollbar: !1
|
|
379
379
|
}, {
|
|
380
380
|
default: () => [l?.sideRight?.()]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as l, computed as m, createVNode as r, mergeProps as n } from "vue";
|
|
2
2
|
import { NDataTable as p } from "naive-ui";
|
|
3
3
|
import { DuxTableLayout as i } from "../layout/table.js";
|
|
4
4
|
import "@duxweb/dvha-core";
|
|
5
5
|
import "clsx";
|
|
6
|
-
import { DuxListEmpty as
|
|
7
|
-
const
|
|
6
|
+
import { DuxListEmpty as b } from "../status/listEmpty.js";
|
|
7
|
+
const g = /* @__PURE__ */ l({
|
|
8
8
|
name: "DuxTablePage",
|
|
9
9
|
props: {
|
|
10
10
|
tableProps: {
|
|
@@ -16,14 +16,14 @@ const P = /* @__PURE__ */ d({
|
|
|
16
16
|
setup(a, {
|
|
17
17
|
slots: t
|
|
18
18
|
}) {
|
|
19
|
-
const
|
|
19
|
+
const d = m(() => {
|
|
20
20
|
const {
|
|
21
21
|
tableProps: o,
|
|
22
22
|
...e
|
|
23
23
|
} = a;
|
|
24
24
|
return e;
|
|
25
25
|
});
|
|
26
|
-
return () => r(i,
|
|
26
|
+
return () => r(i, d.value, {
|
|
27
27
|
default: (o) => r(p, n(o.table.value, a.tableProps, {
|
|
28
28
|
class: "h-full",
|
|
29
29
|
minHeight: 200,
|
|
@@ -34,7 +34,7 @@ const P = /* @__PURE__ */ d({
|
|
|
34
34
|
scrollX: o.width,
|
|
35
35
|
renderCell: (e) => e == null || e === "" ? "-" : e
|
|
36
36
|
}), {
|
|
37
|
-
empty: () => r(
|
|
37
|
+
empty: () => r(b, {
|
|
38
38
|
bordered: !1
|
|
39
39
|
}, null)
|
|
40
40
|
}),
|
|
@@ -42,10 +42,11 @@ const P = /* @__PURE__ */ d({
|
|
|
42
42
|
tools: t?.tools,
|
|
43
43
|
actions: t?.actions,
|
|
44
44
|
sideLeft: t?.sideLeft,
|
|
45
|
-
sideRight: t?.sideRight
|
|
45
|
+
sideRight: t?.sideRight,
|
|
46
|
+
header: t?.header
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
g as DuxTablePage
|
|
51
52
|
};
|
package/dist/esm/hooks/action.js
CHANGED
|
@@ -3,48 +3,48 @@ import { useMessage as D, NButton as b, NDropdown as C } from "naive-ui";
|
|
|
3
3
|
import { h as l } from "vue";
|
|
4
4
|
import { useRouter as I } from "vue-router";
|
|
5
5
|
import { useDialog as N } from "./dialog.js";
|
|
6
|
-
import { useDrawer as
|
|
7
|
-
import { useModal as
|
|
6
|
+
import { useDrawer as W } from "./drawer.js";
|
|
7
|
+
import { useModal as $ } from "./modal.js";
|
|
8
8
|
function K(o) {
|
|
9
|
-
const u =
|
|
9
|
+
const u = $(), i = W(), m = N(), {
|
|
10
10
|
t: n
|
|
11
|
-
} = h(),
|
|
11
|
+
} = h(), d = D(), g = A(), w = I(), P = M({
|
|
12
12
|
onSuccess: (t) => {
|
|
13
|
-
|
|
13
|
+
d.success(t.message || n("common.success"));
|
|
14
14
|
},
|
|
15
15
|
onError: (t) => {
|
|
16
|
-
|
|
16
|
+
d.error(t.message || n("common.error"));
|
|
17
17
|
}
|
|
18
18
|
}), k = S({
|
|
19
19
|
onSuccess: (t) => {
|
|
20
|
-
|
|
20
|
+
d.success(t.message || n("common.success"));
|
|
21
21
|
},
|
|
22
22
|
onError: (t) => {
|
|
23
|
-
|
|
23
|
+
d.error(t.message || n("common.error"));
|
|
24
24
|
}
|
|
25
25
|
}), r = o?.path || g.getPath(), f = (t) => {
|
|
26
|
-
const
|
|
26
|
+
const c = n(t.item.title || "", {}, t.item.title), s = n(t.item.label || "", {}, t.item.label);
|
|
27
27
|
if (t.item.type === "modal") {
|
|
28
|
-
const e = t.item,
|
|
28
|
+
const e = t.item, a = typeof e.componentProps == "function" ? e.componentProps(t.data) : e.componentProps;
|
|
29
29
|
u.show({
|
|
30
|
-
title:
|
|
30
|
+
title: c || s,
|
|
31
31
|
component: e.component,
|
|
32
32
|
componentProps: {
|
|
33
33
|
id: t.id,
|
|
34
|
-
...
|
|
34
|
+
...a
|
|
35
35
|
},
|
|
36
36
|
width: e.width,
|
|
37
37
|
draggable: e.draggable !== void 0 ? e.draggable : !0
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
if (t.item.type === "drawer") {
|
|
41
|
-
const e = t.item,
|
|
41
|
+
const e = t.item, a = typeof e.componentProps == "function" ? e.componentProps(t.data) : e.componentProps;
|
|
42
42
|
i.show({
|
|
43
|
-
title:
|
|
43
|
+
title: c || s,
|
|
44
44
|
component: e.component,
|
|
45
45
|
componentProps: {
|
|
46
46
|
id: t.id,
|
|
47
|
-
...
|
|
47
|
+
...a
|
|
48
48
|
},
|
|
49
49
|
width: e.width,
|
|
50
50
|
maxWidth: e.maxWidth
|
|
@@ -53,30 +53,30 @@ function K(o) {
|
|
|
53
53
|
if (t.item.type === "confirm") {
|
|
54
54
|
const e = t.item;
|
|
55
55
|
m.confirm({
|
|
56
|
-
title:
|
|
56
|
+
title: c || s,
|
|
57
57
|
content: e.content
|
|
58
|
-
}).then((
|
|
59
|
-
|
|
58
|
+
}).then((a) => {
|
|
59
|
+
a && e.callback?.(t.id, t.data);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
if (t.item.type === "request") {
|
|
63
63
|
const e = t.item;
|
|
64
64
|
m.confirm({
|
|
65
|
-
title:
|
|
65
|
+
title: c || s,
|
|
66
66
|
content: e.content
|
|
67
67
|
}).then(() => {
|
|
68
|
-
const
|
|
68
|
+
const a = typeof e.data == "function" ? e.data(t.id, t.data) : e.data, j = (e.method || "post").toLowerCase(), v = typeof e.path == "function" ? e.path(t.id, t.data) : e.path || r;
|
|
69
69
|
P.mutate({
|
|
70
70
|
path: v,
|
|
71
71
|
method: j,
|
|
72
|
-
payload:
|
|
72
|
+
payload: a
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
if (t.item.type === "delete") {
|
|
77
77
|
const e = t.item;
|
|
78
78
|
m.confirm({
|
|
79
|
-
title:
|
|
79
|
+
title: c || s,
|
|
80
80
|
content: e.content
|
|
81
81
|
}).then(() => {
|
|
82
82
|
k.mutate({
|
|
@@ -86,17 +86,18 @@ function K(o) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
if (t.item.type === "link") {
|
|
89
|
-
const e = t.item
|
|
90
|
-
|
|
89
|
+
const e = t.item;
|
|
90
|
+
let a = typeof e.path == "function" ? e.path?.(t.id, t.data) : t.id ? `${e.path || r}${t.data === void 0 ? "" : `/${t.id}`}` : e.path || r;
|
|
91
|
+
a.startsWith("/") || (a = g.getRoutePath(a)), w.push(a);
|
|
91
92
|
}
|
|
92
93
|
t.item.type === "callback" && t.item.callback?.(t.id, t.data);
|
|
93
|
-
}, y =
|
|
94
|
+
}, y = B(), x = E();
|
|
94
95
|
return {
|
|
95
96
|
target: f,
|
|
96
|
-
renderTable: (t) => (
|
|
97
|
+
renderTable: (t) => (c, s) => {
|
|
97
98
|
const e = {
|
|
98
|
-
id:
|
|
99
|
-
data:
|
|
99
|
+
id: c[t.key || o?.key || "id"],
|
|
100
|
+
data: c,
|
|
100
101
|
index: s,
|
|
101
102
|
target: f,
|
|
102
103
|
text: t.text !== void 0 ? t.text : o?.text || !1,
|
|
@@ -111,29 +112,29 @@ function K(o) {
|
|
|
111
112
|
});
|
|
112
113
|
},
|
|
113
114
|
renderAction: (t) => {
|
|
114
|
-
const
|
|
115
|
+
const c = {
|
|
115
116
|
target: f,
|
|
116
117
|
text: t.text !== void 0 ? t.text : o?.text || !1,
|
|
117
118
|
align: t.align !== void 0 ? t.align : o?.align || "left"
|
|
118
119
|
};
|
|
119
120
|
return (t.type || o?.type) === "button" ? y.render({
|
|
120
|
-
...
|
|
121
|
+
...c,
|
|
121
122
|
action: t || o
|
|
122
123
|
}) : x.render({
|
|
123
|
-
...
|
|
124
|
+
...c,
|
|
124
125
|
action: t || o
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
};
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function B() {
|
|
130
131
|
const {
|
|
131
132
|
t: o
|
|
132
133
|
} = h();
|
|
133
134
|
return {
|
|
134
135
|
render: (i) => {
|
|
135
|
-
const m = i.action.items?.filter((n) => !n.show || n.show?.(i.data, i.index)).map((n,
|
|
136
|
-
key:
|
|
136
|
+
const m = i.action.items?.filter((n) => !n.show || n.show?.(i.data, i.index)).map((n, d) => l(b, {
|
|
137
|
+
key: d,
|
|
137
138
|
type: n.color || (n.type === "delete" ? "error" : "primary"),
|
|
138
139
|
text: i.text,
|
|
139
140
|
secondary: !i.text,
|
|
@@ -154,15 +155,15 @@ function E() {
|
|
|
154
155
|
}
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function E() {
|
|
158
159
|
const {
|
|
159
160
|
t: o
|
|
160
161
|
} = h();
|
|
161
162
|
return {
|
|
162
163
|
render: (i) => {
|
|
163
|
-
const m = i.action.items?.filter((n) => !n.show || n.show?.(i.data, i.index)).map((n,
|
|
164
|
+
const m = i.action.items?.filter((n) => !n.show || n.show?.(i.data, i.index)).map((n, d) => ({
|
|
164
165
|
label: o(n.label || "", {}, n.label),
|
|
165
|
-
key:
|
|
166
|
+
key: d,
|
|
166
167
|
icon: n.icon ? () => l("div", {
|
|
167
168
|
class: ["n-icon", n.icon]
|
|
168
169
|
}) : void 0,
|
|
@@ -177,8 +178,8 @@ function T() {
|
|
|
177
178
|
return l(C, {
|
|
178
179
|
trigger: "click",
|
|
179
180
|
options: m,
|
|
180
|
-
onSelect: (n,
|
|
181
|
-
|
|
181
|
+
onSelect: (n, d) => {
|
|
182
|
+
d?.onSelect?.();
|
|
182
183
|
}
|
|
183
184
|
}, () => [l("div", {
|
|
184
185
|
class: ["flex items-center", i.align === "right" ? "justify-end" : i.align === "center" ? "justify-center" : "justify-start"]
|
|
@@ -195,6 +196,6 @@ function T() {
|
|
|
195
196
|
}
|
|
196
197
|
export {
|
|
197
198
|
K as useAction,
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
B as useActionButton,
|
|
200
|
+
E as useActionDropdown
|
|
200
201
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const r = `/* layer: properties */
|
|
2
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-from-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-
|
|
2
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-text-opacity:100%;--un-bg-opacity:100%;--un-from-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-shadow-opacity:100%;--un-ease:initial;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-border-opacity:100%;--un-to-opacity:100%;--un-fill-opacity:100%;--un-outline-style:solid;}}
|
|
3
3
|
@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
4
4
|
@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid;}
|
|
5
5
|
@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
@@ -1048,6 +1048,7 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
1048
1048
|
.m-302\\.2{margin:calc(var(--spacing) * 302.2);}
|
|
1049
1049
|
.m14{margin:calc(var(--spacing) * 14);}
|
|
1050
1050
|
.m146\\.8{margin:calc(var(--spacing) * 146.8);}
|
|
1051
|
+
.m18{margin:calc(var(--spacing) * 18);}
|
|
1051
1052
|
.m29\\.3{margin:calc(var(--spacing) * 29.3);}
|
|
1052
1053
|
.m3{margin:calc(var(--spacing) * 3);}
|
|
1053
1054
|
.m5{margin:calc(var(--spacing) * 5);}
|