@duxweb/dvha-pro 1.1.21 → 1.1.23
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/cascaderPanel/cascaderPanel.cjs +1 -0
- package/dist/cjs/components/chart/echart.cjs +1 -1
- package/dist/cjs/components/dashboard/helloBig.cjs +1 -1
- package/dist/cjs/components/data/dynamicData.cjs +1 -1
- package/dist/cjs/components/data/selectModal.cjs +1 -1
- package/dist/cjs/components/designEditor/editor/setting.cjs +1 -1
- package/dist/cjs/components/designEditor/editor.cjs +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +1 -1
- package/dist/cjs/components/flowEditor/components/setting.cjs +1 -1
- package/dist/cjs/components/form/drawerForm.cjs +1 -1
- package/dist/cjs/components/form/formItem.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/pageTabForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/formEditor/components/imageUpload.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/layout/tools.cjs +1 -1
- package/dist/cjs/components/mapCoord/mapCoord.cjs +1 -0
- package/dist/cjs/components/media/media.cjs +1 -1
- package/dist/cjs/components/modal/modalTab.cjs +1 -1
- package/dist/cjs/components/panel/setting.cjs +1 -1
- package/dist/cjs/components/posterEditor/posterEditor.cjs +1 -1
- package/dist/cjs/components/select/selectCard.cjs +1 -1
- package/dist/cjs/components/spec/spec.cjs +1 -1
- package/dist/cjs/components/stats/realTime.cjs +1 -1
- package/dist/cjs/components/table/table.cjs +1 -1
- package/dist/cjs/components/textImageEditor/textImageEditor.cjs +1 -0
- package/dist/cjs/components/textImageEditor/textModal.cjs +1 -0
- 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/components/upload/video.cjs +1 -0
- package/dist/cjs/components/widget/connect.cjs +1 -1
- package/dist/cjs/dvha-pro.css +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/switch.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/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/menuApp.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/menu/notice.cjs +1 -1
- package/dist/cjs/pages/page404.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +26 -4
- package/dist/esm/component.js +21 -20
- package/dist/esm/components/cascaderPanel/cascaderPanel.js +378 -0
- package/dist/esm/components/chart/echart.js +1 -1
- package/dist/esm/components/dashboard/helloBig.js +3 -2
- package/dist/esm/components/data/dynamicData.js +49 -40
- package/dist/esm/components/data/selectModal.js +3 -3
- package/dist/esm/components/designEditor/editor/setting.js +2 -2
- package/dist/esm/components/designEditor/editor.js +3 -2
- package/dist/esm/components/drawer/drawer.js +22 -19
- package/dist/esm/components/flowEditor/components/setting.js +1 -1
- package/dist/esm/components/form/drawerForm.js +1 -1
- package/dist/esm/components/form/formItem.js +1 -1
- package/dist/esm/components/form/modalForm.js +1 -1
- package/dist/esm/components/form/pageForm.js +1 -1
- package/dist/esm/components/form/pageTabForm.js +1 -1
- package/dist/esm/components/form/settingForm.js +1 -1
- package/dist/esm/components/formEditor/components/imageUpload.js +1 -1
- package/dist/esm/components/formEditor/editor.js +1 -1
- package/dist/esm/components/layout/table.js +74 -56
- package/dist/esm/components/layout/tools.js +8 -8
- package/dist/esm/components/mapCoord/mapCoord.js +218 -0
- package/dist/esm/components/media/media.js +57 -32
- package/dist/esm/components/modal/modalTab.js +20 -14
- package/dist/esm/components/panel/setting.js +3 -2
- package/dist/esm/components/posterEditor/posterEditor.js +1 -1
- package/dist/esm/components/select/selectCard.js +3 -3
- package/dist/esm/components/spec/spec.js +142 -103
- package/dist/esm/components/stats/realTime.js +5 -4
- package/dist/esm/components/table/table.js +19 -19
- package/dist/esm/components/textImageEditor/textImageEditor.js +405 -0
- package/dist/esm/components/textImageEditor/textModal.js +77 -0
- package/dist/esm/components/upload/image.js +35 -34
- package/dist/esm/components/upload/manage/item.js +1 -1
- package/dist/esm/components/upload/manager.js +155 -138
- package/dist/esm/components/upload/video.js +340 -0
- package/dist/esm/components/widget/connect.js +3 -2
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/dialog.js +2 -2
- package/dist/esm/hooks/drawer.js +2 -2
- package/dist/esm/hooks/modal.js +2 -2
- package/dist/esm/hooks/table/image.js +2 -2
- package/dist/esm/hooks/table/media.js +2 -2
- package/dist/esm/hooks/table/switch.js +58 -26
- package/dist/esm/index.js +308 -296
- package/dist/esm/langs/en-US.json.js +1 -1
- package/dist/esm/langs/zh-CN.json.js +1 -1
- package/dist/esm/pages/authLayout.js +1 -1
- package/dist/esm/pages/login.js +2 -2
- package/dist/esm/pages/menu/avatar.js +1 -1
- package/dist/esm/pages/menu/button.js +1 -1
- package/dist/esm/pages/menu/menuApp.js +1 -1
- package/dist/esm/pages/menu/mobile.js +1 -1
- package/dist/esm/pages/menu/notice.js +1 -1
- package/dist/esm/pages/page404.js +1 -1
- package/dist/esm/pages/pageStatus.js +2 -2
- package/dist/esm/theme/uno.css.js +26 -4
- package/dist/types/components/cascaderPanel/cascaderPanel.d.ts +110 -0
- package/dist/types/components/cascaderPanel/index.d.ts +1 -0
- package/dist/types/components/data/dynamicData.d.ts +10 -0
- package/dist/types/components/data/index.d.ts +1 -1
- package/dist/types/components/data/selectModal.d.ts +2 -2
- package/dist/types/components/drawer/drawer.d.ts +1 -1
- package/dist/types/components/flowEditor/components/kvInput.d.ts +1 -1
- package/dist/types/components/flowEditor/components/nodeCard.d.ts +1 -1
- package/dist/types/components/form/drawerForm.d.ts +2 -2
- package/dist/types/components/form/formLayout.d.ts +2 -2
- package/dist/types/components/form/modalForm.d.ts +2 -2
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/components/level/level.d.ts +2 -2
- package/dist/types/components/mapCoord/index.d.ts +1 -0
- package/dist/types/components/mapCoord/mapCoord.d.ts +93 -0
- package/dist/types/components/media/media.d.ts +3 -32
- package/dist/types/components/modal/modalTab.d.ts +5 -5
- package/dist/types/components/select/checkboxTag.d.ts +2 -2
- package/dist/types/components/select/dateTag.d.ts +2 -2
- package/dist/types/components/select/radioTag.d.ts +2 -2
- package/dist/types/components/select/selectCard.d.ts +4 -4
- package/dist/types/components/spec/spec.d.ts +21 -0
- package/dist/types/components/table/table.d.ts +3 -3
- package/dist/types/components/textImageEditor/index.d.ts +2 -0
- package/dist/types/components/textImageEditor/textImageEditor.d.ts +56 -0
- package/dist/types/components/textImageEditor/textModal.d.ts +72 -0
- package/dist/types/components/textImageEditor/types.d.ts +19 -0
- package/dist/types/components/upload/index.d.ts +1 -0
- package/dist/types/components/upload/video.d.ts +126 -0
- package/dist/types/components/widget/index.d.ts +1 -0
- package/dist/types/hooks/table/column.d.ts +1 -1
- package/dist/types/hooks/table/switch.d.ts +1 -1
- package/dist/types/main.d.ts +5 -0
- package/package.json +3 -3
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { defineComponent as B, computed as T, ref as f, watch as F, onMounted as $, createVNode as m, nextTick as P } from "vue";
|
|
2
|
+
import { useI18n as Z, useManage as E } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as b } from "@vueuse/core";
|
|
4
|
+
import { useMessage as j, NInput as q, NButton as O } from "naive-ui";
|
|
5
|
+
let h;
|
|
6
|
+
function W(n) {
|
|
7
|
+
return window.T ? Promise.resolve(window.T) : h || (h = new Promise((s, l) => {
|
|
8
|
+
const u = document.createElement("script");
|
|
9
|
+
u.async = !0, u.src = `https://api.tianditu.gov.cn/api?v=4.0&tk=${encodeURIComponent(n)}`, u.onload = () => {
|
|
10
|
+
window.T ? s(window.T) : l(new Error("Tianditu API load failed"));
|
|
11
|
+
}, u.onerror = () => l(new Error("Tianditu API load failed")), document.head.appendChild(u);
|
|
12
|
+
}), h);
|
|
13
|
+
}
|
|
14
|
+
async function z(n, s) {
|
|
15
|
+
const u = `https://api.tianditu.gov.cn/geocoder?ds=${encodeURIComponent(JSON.stringify({
|
|
16
|
+
keyWord: s
|
|
17
|
+
}))}&tk=${encodeURIComponent(n)}`;
|
|
18
|
+
return (await fetch(u)).json();
|
|
19
|
+
}
|
|
20
|
+
async function D(n, s, l) {
|
|
21
|
+
const i = `https://api.tianditu.gov.cn/geocoder?postStr=${encodeURIComponent(JSON.stringify({
|
|
22
|
+
lon: s,
|
|
23
|
+
lat: l,
|
|
24
|
+
ver: 1
|
|
25
|
+
}))}&type=geocode&tk=${encodeURIComponent(n)}`;
|
|
26
|
+
return (await fetch(i)).json();
|
|
27
|
+
}
|
|
28
|
+
const K = /* @__PURE__ */ B({
|
|
29
|
+
name: "DuxMapCoord",
|
|
30
|
+
props: {
|
|
31
|
+
/**
|
|
32
|
+
* 天地图密钥(可选)
|
|
33
|
+
* - 优先使用 props.tk
|
|
34
|
+
* - 否则读取 useManage().config.map.tiandituTk
|
|
35
|
+
*/
|
|
36
|
+
tk: String,
|
|
37
|
+
value: Array,
|
|
38
|
+
defaultValue: Array,
|
|
39
|
+
onUpdateValue: Function,
|
|
40
|
+
address: String,
|
|
41
|
+
defaultAddress: String,
|
|
42
|
+
onUpdateAddress: Function,
|
|
43
|
+
area: Array,
|
|
44
|
+
defaultArea: Array,
|
|
45
|
+
onUpdateArea: Function,
|
|
46
|
+
height: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "360px"
|
|
49
|
+
},
|
|
50
|
+
zoom: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 15
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* 是否显示地图默认控件(缩放、比例尺等)
|
|
56
|
+
*/
|
|
57
|
+
controls: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !0
|
|
60
|
+
},
|
|
61
|
+
showSearch: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !0
|
|
64
|
+
},
|
|
65
|
+
autoSearch: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !0
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
setup(n, {
|
|
71
|
+
emit: s
|
|
72
|
+
}) {
|
|
73
|
+
const {
|
|
74
|
+
t: l
|
|
75
|
+
} = Z(), {
|
|
76
|
+
config: u
|
|
77
|
+
} = E(), i = j(), d = T(() => n.tk || u?.map?.tiandituTk || ""), A = b(n, "value", s, {
|
|
78
|
+
passive: !0,
|
|
79
|
+
defaultValue: n.defaultValue,
|
|
80
|
+
deep: !0
|
|
81
|
+
}), v = b(n, "address", s, {
|
|
82
|
+
passive: !0,
|
|
83
|
+
defaultValue: n.defaultAddress
|
|
84
|
+
}), p = b(n, "area", s, {
|
|
85
|
+
passive: !0,
|
|
86
|
+
defaultValue: n.defaultArea,
|
|
87
|
+
deep: !0
|
|
88
|
+
}), S = f(null), C = f(!1), x = f(), U = f(), y = f(), g = T(() => {
|
|
89
|
+
const e = A.value;
|
|
90
|
+
if (!Array.isArray(e) || e.length < 2) return;
|
|
91
|
+
const t = Number(e[0]), r = Number(e[1]);
|
|
92
|
+
if (!(!Number.isFinite(t) || !Number.isFinite(r)))
|
|
93
|
+
return {
|
|
94
|
+
lat: t,
|
|
95
|
+
lng: r
|
|
96
|
+
};
|
|
97
|
+
}), L = T(() => {
|
|
98
|
+
const e = Array.isArray(p.value) ? p.value.filter(Boolean).join("") : "", t = String(v.value || "");
|
|
99
|
+
return `${e}${t}`.trim();
|
|
100
|
+
}), k = f(!1), N = f(!1);
|
|
101
|
+
async function w(e, t) {
|
|
102
|
+
await R();
|
|
103
|
+
const r = x.value, a = U.value;
|
|
104
|
+
if (!r || !a) return;
|
|
105
|
+
const o = new r.LngLat(t, e);
|
|
106
|
+
y.value ? y.value.setLngLat(o) : (y.value = new r.Marker(o), a.addOverLay(y.value)), a.panTo(o);
|
|
107
|
+
}
|
|
108
|
+
async function I(e, t) {
|
|
109
|
+
if (d.value)
|
|
110
|
+
try {
|
|
111
|
+
const r = await D(d.value, t, e);
|
|
112
|
+
let a = String(r?.result?.formatted_address || r?.result?.address || "");
|
|
113
|
+
const o = Array.isArray(p.value) ? p.value.filter(Boolean).join("") : "";
|
|
114
|
+
o && a.startsWith(o) && (a = a.slice(o.length).trim());
|
|
115
|
+
const c = String(r?.result?.addressComponent?.address || "").trim();
|
|
116
|
+
c && (a = c), a && !String(v.value || "").trim() && (N.value = !0, v.value = a, n.onUpdateAddress?.(a));
|
|
117
|
+
} catch {
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const R = async () => {
|
|
121
|
+
if (C.value || !S.value) return;
|
|
122
|
+
if (!d.value) {
|
|
123
|
+
i.error("tiandituTk 未配置");
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const e = await W(d.value);
|
|
127
|
+
x.value = e;
|
|
128
|
+
const t = new e.Map(S.value);
|
|
129
|
+
if (U.value = t, t.centerAndZoom(new e.LngLat(116.404, 39.915), n.zoom), t.enableScrollWheelZoom(), n.controls)
|
|
130
|
+
try {
|
|
131
|
+
const r = e?.Control?.Zoom || e?.Control?.ZoomControl;
|
|
132
|
+
r && t.addControl(new r());
|
|
133
|
+
const a = e?.Control?.Scale || e?.Control?.ScaleControl;
|
|
134
|
+
a && t.addControl(new a());
|
|
135
|
+
} catch {
|
|
136
|
+
}
|
|
137
|
+
t.addEventListener("click", async (r) => {
|
|
138
|
+
const a = Number(r?.lnglat?.lng), o = Number(r?.lnglat?.lat);
|
|
139
|
+
if (!Number.isFinite(o) || !Number.isFinite(a)) return;
|
|
140
|
+
const c = [o, a];
|
|
141
|
+
A.value = c, n.onUpdateValue?.(c), await w(o, a), await I(o, a);
|
|
142
|
+
}), C.value = !0, await P(), g.value && (await w(g.value.lat, g.value.lng), t.panTo(new e.LngLat(g.value.lng, g.value.lat)));
|
|
143
|
+
}, V = async () => {
|
|
144
|
+
if (!d.value) {
|
|
145
|
+
i.error("tiandituTk 未配置");
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const e = L.value;
|
|
149
|
+
if (!e) {
|
|
150
|
+
i.warning(l("common.keyword") || "请输入关键字");
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
k.value = !0;
|
|
154
|
+
try {
|
|
155
|
+
const t = await z(d.value, e), r = t?.location || t?.result?.location, a = Number(r?.lon ?? r?.lng), o = Number(r?.lat);
|
|
156
|
+
if (!Number.isFinite(o) || !Number.isFinite(a)) {
|
|
157
|
+
i.error(l("common.error") || "操作失败");
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const c = [o, a];
|
|
161
|
+
A.value = c, n.onUpdateValue?.(c), await w(o, a);
|
|
162
|
+
} catch (t) {
|
|
163
|
+
i.error(t?.message || l("common.error") || "操作失败");
|
|
164
|
+
} finally {
|
|
165
|
+
k.value = !1;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
let M;
|
|
169
|
+
return F([L, () => n.autoSearch], ([e, t]) => {
|
|
170
|
+
if (t) {
|
|
171
|
+
if (N.value) {
|
|
172
|
+
N.value = !1;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
String(v.value || "").trim() && (clearTimeout(M), M = setTimeout(() => {
|
|
176
|
+
V();
|
|
177
|
+
}, 400));
|
|
178
|
+
}
|
|
179
|
+
}), F(g, (e) => {
|
|
180
|
+
e && w(e.lat, e.lng);
|
|
181
|
+
}), $(() => {
|
|
182
|
+
R().catch((e) => {
|
|
183
|
+
i.error(e?.message || "地图加载失败");
|
|
184
|
+
});
|
|
185
|
+
}), () => m("div", {
|
|
186
|
+
class: "flex flex-col gap-3"
|
|
187
|
+
}, [n.showSearch && m("div", {
|
|
188
|
+
class: "flex gap-2 items-center"
|
|
189
|
+
}, [m(q, {
|
|
190
|
+
value: v.value,
|
|
191
|
+
onUpdateValue: (e) => {
|
|
192
|
+
v.value = e, n.onUpdateAddress?.(e);
|
|
193
|
+
},
|
|
194
|
+
placeholder: l("common.keyword") || "请输入关键字",
|
|
195
|
+
clearable: !0
|
|
196
|
+
}, null), m(O, {
|
|
197
|
+
type: "primary",
|
|
198
|
+
ghost: !0,
|
|
199
|
+
loading: k.value,
|
|
200
|
+
onClick: V
|
|
201
|
+
}, {
|
|
202
|
+
default: () => [l("common.search") || "搜索"]
|
|
203
|
+
})]), m("div", {
|
|
204
|
+
class: "w-full rounded border border-muted overflow-hidden"
|
|
205
|
+
}, [m("div", {
|
|
206
|
+
ref: S,
|
|
207
|
+
class: "w-full",
|
|
208
|
+
style: {
|
|
209
|
+
height: n.height
|
|
210
|
+
}
|
|
211
|
+
}, null), !C.value && m("div", {
|
|
212
|
+
class: "p-4 text-sm text-muted"
|
|
213
|
+
}, [l("common.loading") || "加载中..."])])]);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
export {
|
|
217
|
+
K as DuxMapCoord
|
|
218
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { defineComponent as y, computed as r, ref as v, watch as h, createVNode as t, Fragment as b, nextTick as k, isVNode as A } from "vue";
|
|
2
|
+
import { useResizeObserver as W } from "@vueuse/core";
|
|
3
|
+
import w from "clsx";
|
|
4
|
+
import { NImageGroup as C, NTooltip as j } from "naive-ui";
|
|
5
|
+
import { DuxAvatar as s } from "../widget/avatar.js";
|
|
6
|
+
import { DuxImage as N } from "../widget/image.js";
|
|
7
|
+
function S(e) {
|
|
8
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !A(e);
|
|
8
9
|
}
|
|
9
|
-
const
|
|
10
|
+
const I = /* @__PURE__ */ y({
|
|
10
11
|
name: "DuxMedia",
|
|
11
12
|
props: {
|
|
12
13
|
title: String,
|
|
13
14
|
avatar: Boolean,
|
|
14
|
-
image
|
|
15
|
+
// Support string(s) for default image/avatar rendering, or VNode / render fn for custom image area.
|
|
16
|
+
image: [String, Array, Object, Function],
|
|
15
17
|
desc: [String, Array],
|
|
16
18
|
extend: String,
|
|
17
19
|
onClick: Function,
|
|
@@ -25,54 +27,77 @@ const S = /* @__PURE__ */ u({
|
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
setup(e, {
|
|
28
|
-
slots:
|
|
30
|
+
slots: i
|
|
29
31
|
}) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
const c = r(() => typeof e.image == "string" ? [e.image] : Array.isArray(e.image) ? e.image : []), d = r(() => Array.isArray(e.desc) ? e.desc : e.desc !== void 0 ? [e.desc] : []), f = r(() => typeof e.image == "function" || e.image && typeof e.image == "object" && !Array.isArray(e.image)), x = r(() => f.value || !!e.avatar || c.value.length > 0), u = r(() => !!d.value?.length || !!i.desc), m = v(null), g = v(!1), o = async () => {
|
|
33
|
+
await k();
|
|
34
|
+
const a = m.value;
|
|
35
|
+
if (!a) {
|
|
36
|
+
g.value = !1;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
g.value = u.value ? a.scrollWidth > a.clientWidth : a.scrollHeight > a.clientHeight;
|
|
40
|
+
};
|
|
41
|
+
return h([() => e.title, u], o, {
|
|
42
|
+
immediate: !0
|
|
43
|
+
}), W(m, o), () => {
|
|
44
|
+
let a;
|
|
33
45
|
return t("div", {
|
|
34
46
|
class: "flex gap-2 items-center"
|
|
35
|
-
}, [
|
|
47
|
+
}, [i?.image && t("div", {
|
|
36
48
|
class: "flex-none flex items-center gap-2"
|
|
37
|
-
}, [
|
|
49
|
+
}, [i?.image?.()]), x.value && t("div", {
|
|
38
50
|
class: "flex-none flex items-center gap-2"
|
|
39
|
-
}, [e.avatar ? t(
|
|
51
|
+
}, [f.value ? typeof e.image == "function" ? e.image() : e.image : e.avatar ? t(b, null, [c.value.length > 0 ? c.value.map((l, n) => t(s, {
|
|
40
52
|
key: n,
|
|
41
|
-
src:
|
|
53
|
+
src: l,
|
|
42
54
|
round: !0,
|
|
43
55
|
size: e.imageWidth
|
|
44
|
-
}, null)) : t(
|
|
56
|
+
}, null)) : t(s, {
|
|
45
57
|
round: !0,
|
|
46
58
|
size: e.imageWidth
|
|
47
|
-
}, null)]) : t(
|
|
59
|
+
}, null)]) : t(C, null, S(a = c.value.map((l, n) => t(N, {
|
|
48
60
|
key: n,
|
|
49
|
-
src:
|
|
61
|
+
src: l,
|
|
50
62
|
class: "rounded",
|
|
51
63
|
objectFit: "cover",
|
|
52
64
|
width: e.imageWidth,
|
|
53
65
|
height: e.imageHeight
|
|
54
|
-
}, null))) ?
|
|
55
|
-
default: () => [
|
|
66
|
+
}, null))) ? a : {
|
|
67
|
+
default: () => [a]
|
|
56
68
|
})]), t("div", {
|
|
57
|
-
class: "flex-1 flex-col
|
|
69
|
+
class: "flex-1 flex flex-col min-w-0"
|
|
58
70
|
}, [t("div", {
|
|
59
71
|
class: "flex gap-2 items-center"
|
|
60
|
-
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
72
|
+
}, [i.prefix?.(), (e.title || i.default) && t(j, {
|
|
73
|
+
trigger: "hover",
|
|
74
|
+
disabled: !e.title || !g.value
|
|
75
|
+
}, {
|
|
76
|
+
default: () => e.title,
|
|
77
|
+
trigger: () => t("div", {
|
|
78
|
+
ref: m,
|
|
79
|
+
onClick: () => e.onClick?.(),
|
|
80
|
+
class: w(["transition-all", u.value ? "truncate" : "break-words", e?.onClick && "hover:text-primary cursor-pointer"]),
|
|
81
|
+
style: u.value ? void 0 : {
|
|
82
|
+
display: "-webkit-box",
|
|
83
|
+
overflow: "hidden",
|
|
84
|
+
WebkitBoxOrient: "vertical",
|
|
85
|
+
WebkitLineClamp: 2
|
|
86
|
+
}
|
|
87
|
+
}, [e.title || i.default?.()])
|
|
88
|
+
})]), (d?.value.length > 0 || i.desc) && t("div", {
|
|
64
89
|
class: "text-sm text-muted flex flex-col gap-0"
|
|
65
|
-
}, [
|
|
90
|
+
}, [d?.value.map?.((l, n) => t("div", {
|
|
66
91
|
key: n,
|
|
67
92
|
class: "truncate"
|
|
68
|
-
}, [
|
|
93
|
+
}, [l !== "" ? l : "-"])), i.desc?.()])]), e?.extend && t("div", {
|
|
69
94
|
class: "flex-none flex items-center gap-2 text-gray-7"
|
|
70
|
-
}, [e?.extend]),
|
|
95
|
+
}, [e?.extend]), i?.extend && t("div", {
|
|
71
96
|
class: "flex-none flex items-center gap-2 text-gray-7"
|
|
72
|
-
}, [
|
|
97
|
+
}, [i?.extend?.()])]);
|
|
73
98
|
};
|
|
74
99
|
}
|
|
75
100
|
});
|
|
76
101
|
export {
|
|
77
|
-
|
|
102
|
+
I as DuxMedia
|
|
78
103
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { NTabs as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as d, createVNode as e } from "vue";
|
|
2
|
+
import { NTabs as n, NButton as r } from "naive-ui";
|
|
3
|
+
const o = /* @__PURE__ */ d({
|
|
4
4
|
name: "ModalTab",
|
|
5
5
|
props: {
|
|
6
6
|
draggable: {
|
|
@@ -12,8 +12,9 @@ const f = /* @__PURE__ */ t({
|
|
|
12
12
|
default: "0"
|
|
13
13
|
},
|
|
14
14
|
handle: {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
// `DuxModal` passes `draggableClass` (string). Keep backward compatibility with ref usage.
|
|
16
|
+
type: [String, Object],
|
|
17
|
+
default: ""
|
|
17
18
|
},
|
|
18
19
|
onClose: {
|
|
19
20
|
type: Function,
|
|
@@ -26,7 +27,7 @@ const f = /* @__PURE__ */ t({
|
|
|
26
27
|
}) {
|
|
27
28
|
return () => e("div", {
|
|
28
29
|
class: "flex flex-col"
|
|
29
|
-
}, [e(
|
|
30
|
+
}, [e(n, {
|
|
30
31
|
type: "line",
|
|
31
32
|
defaultValue: a.defaultTab,
|
|
32
33
|
class: "app-modal-tabs",
|
|
@@ -37,15 +38,20 @@ const f = /* @__PURE__ */ t({
|
|
|
37
38
|
}
|
|
38
39
|
}, {
|
|
39
40
|
default: () => l.default?.(),
|
|
40
|
-
prefix: () =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
prefix: () => {
|
|
42
|
+
if (!a.draggable)
|
|
43
|
+
return null;
|
|
44
|
+
const t = typeof a.handle == "object" && a.handle !== null;
|
|
45
|
+
return e("div", {
|
|
46
|
+
class: ["pl-4 cursor-move flex items-center", !t && a.handle],
|
|
47
|
+
ref: t ? a.handle : void 0
|
|
48
|
+
}, [e("div", {
|
|
49
|
+
class: "i-tabler:grid-dots size-4"
|
|
50
|
+
}, null)]);
|
|
51
|
+
},
|
|
46
52
|
suffix: () => e("div", {
|
|
47
53
|
class: "pr-4 flex items-center"
|
|
48
|
-
}, [e(
|
|
54
|
+
}, [e(r, {
|
|
49
55
|
text: !0,
|
|
50
56
|
onClick: a.onClose,
|
|
51
57
|
"aria-label": "close"
|
|
@@ -60,5 +66,5 @@ const f = /* @__PURE__ */ t({
|
|
|
60
66
|
}
|
|
61
67
|
});
|
|
62
68
|
export {
|
|
63
|
-
|
|
69
|
+
o as default
|
|
64
70
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { defineComponent as i, createVNode as e } from "vue";
|
|
2
2
|
import { DuxCard as a } from "../card/card.js";
|
|
3
|
+
import "@vueuse/core";
|
|
3
4
|
import "clsx";
|
|
4
5
|
import "naive-ui";
|
|
5
|
-
const
|
|
6
|
+
const f = /* @__PURE__ */ i({
|
|
6
7
|
name: "DuxPanelCard",
|
|
7
8
|
props: {
|
|
8
9
|
title: {
|
|
@@ -46,5 +47,5 @@ const s = /* @__PURE__ */ i({
|
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
f as DuxPanelCard
|
|
50
51
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as T, ref as d, watch as F, onMounted as H, onUnmounted as R, createVNode as a } from "vue";
|
|
2
2
|
import { NSlider as V, NSwitch as W, NSelect as z, NColorPicker as A, NInputNumber as J, NInput as j } from "naive-ui";
|
|
3
3
|
import { DuxCard as L } from "../card/card.js";
|
|
4
|
+
import "@vueuse/core";
|
|
4
5
|
import "clsx";
|
|
5
6
|
import "@duxweb/dvha-core";
|
|
6
|
-
import "@vueuse/core";
|
|
7
7
|
import "mime";
|
|
8
8
|
import "vue-router";
|
|
9
9
|
import "@overlastic/vue";
|
|
@@ -58,7 +58,7 @@ const x = /* @__PURE__ */ n({
|
|
|
58
58
|
}, [a.options.map((e) => l("div", {
|
|
59
59
|
key: e.value,
|
|
60
60
|
class: ["relative cursor-pointer border rounded p-2.5 transition-all duration-200 hover:border-primary", {
|
|
61
|
-
"border-primary bg-primary/
|
|
61
|
+
"border-primary bg-primary/5": r(e.value),
|
|
62
62
|
"border-muted": !r(e.value),
|
|
63
63
|
"opacity-50 cursor-not-allowed": e.disabled || a.disabled
|
|
64
64
|
}],
|
|
@@ -79,11 +79,11 @@ const x = /* @__PURE__ */ n({
|
|
|
79
79
|
"flex-row items-start text-left": e.icon
|
|
80
80
|
}]
|
|
81
81
|
}, [e.icon && l("div", {
|
|
82
|
-
class: ["flex items-center justify-center p-3 rounded-lg", `bg-${e.iconColor}/10`, `text-${e.iconColor}`]
|
|
82
|
+
class: ["flex items-center justify-center p-3 rounded-lg", `bg-${e.iconColor || "primary"}/10`, `text-${e.iconColor || "primary"}`]
|
|
83
83
|
}, [l("div", {
|
|
84
84
|
class: `${e.icon} size-4`
|
|
85
85
|
}, null)]), l("div", {
|
|
86
|
-
class: "flex flex-col flex-1 gap-
|
|
86
|
+
class: "flex flex-col flex-1 gap-1"
|
|
87
87
|
}, [l("div", {
|
|
88
88
|
class: ["text-sm font-medium", {
|
|
89
89
|
"text-primary": r(e.value),
|