disguise-ui 0.3.7 → 0.3.9
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/README.md +4 -2
- package/dist/{avatar-cell-Cns1UqiV.js → avatar-cell-Cx1YMRjp.js} +1 -1
- package/dist/disguise-ui.js +264 -255
- package/dist/{file-upload-D02tRF4e.js → file-upload-CJIkJlcK.js} +1 -1
- package/dist/{file-upload-BYq_ZBPv.js → file-upload-CdzTspvH.js} +3 -3
- package/dist/{i18n-DyM4J6Tt.js → i18n-DZQHHiTD.js} +47 -50
- package/dist/{picture-cell--GGQKBgi.js → picture-cell-CogcfWjM.js} +1 -1
- package/dist/{picture-upload-CmNsacpE.js → picture-upload-Ba5slmTG.js} +1 -1
- package/dist/{picture-upload-BQeS_ojB.js → picture-upload-By35hBTI.js} +3 -3
- package/dist/style.css +1 -1
- package/dist/types/components/async-select/async-select.vue.d.ts +1 -1
- package/dist/types/components/dialog-list/index.vue.d.ts +10 -10
- package/dist/types/components/dict-tag/index.vue.d.ts +1 -1
- package/dist/types/components/drawer-form-page/index.vue.d.ts +2 -2
- package/dist/types/components/file-upload/components/file-status.vue.d.ts +1 -1
- package/dist/types/components/file-upload/file-upload.vue.d.ts +4 -4
- package/dist/types/components/image-upload/index.vue.d.ts +2 -2
- package/dist/types/components/images-view/index.vue.d.ts +1 -1
- package/dist/types/components/import-dialog/index.type.d.ts +4 -0
- package/dist/types/components/import-dialog/index.vue.d.ts +19 -3
- package/dist/types/components/picture-upload/picture-upload.vue.d.ts +4 -4
- package/dist/types/components/rich-text-editor/index.vue.d.ts +1 -1
- package/dist/types/components/schema-form/schema-form.vue.d.ts +1 -1
- package/dist/types/components/schema-form/translate-field.vue.d.ts +1 -1
- package/dist/types/components/schema-form/translate-toolbar.vue.d.ts +6 -3
- package/dist/types/components/search-form/index.vue.d.ts +1 -1
- package/dist/types/components/table-entity/index.vue.d.ts +2 -2
- package/dist/types/components/user-avatar-info/index.vue.d.ts +8 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/runtime/context.d.ts +25 -3316
- package/dist/types/setup.d.ts +1 -1
- package/dist/{use-image-url-CWM0aE7u.js → use-image-url-o26z5K19.js} +1 -1
- package/dist/{use-multiple-file-upload-Vt01wSm6.js → use-multiple-file-upload-DoEljuzF.js} +2 -2
- package/dist/{user-avatar-info-CwXzoLlH.js → user-avatar-info-DObwPt9B.js} +80 -93
- package/package.json +1 -1
package/dist/types/setup.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import type { DisguiseOptions } from './runtime/context';
|
|
|
4
4
|
* 组件不直接依赖具体后台,这些能力都从这里进入。
|
|
5
5
|
*/
|
|
6
6
|
export declare function setupDisguise(options?: DisguiseOptions): void;
|
|
7
|
-
export type { DisguiseOptions, PaginationConfig } from './runtime/context';
|
|
7
|
+
export type { DisguiseOptions, PaginationConfig, UserAvatarDrawerField, } from './runtime/context';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, s as t } from "./i18n-
|
|
2
|
-
import { t as n } from "./use-image-url-
|
|
1
|
+
import { n as e, s as t } from "./i18n-DZQHHiTD.js";
|
|
2
|
+
import { t as n } from "./use-image-url-o26z5K19.js";
|
|
3
3
|
import { t as r } from "./use-file-type-rNstoxXw.js";
|
|
4
4
|
import { computed as i, ref as a, watch as o } from "vue";
|
|
5
5
|
import { ElMessage as s } from "element-plus";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./use-image-url-
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { ElAvatar as S, ElDrawer as
|
|
5
|
-
import {
|
|
1
|
+
import { d as e, n as t } from "./i18n-DZQHHiTD.js";
|
|
2
|
+
import { t as n } from "./use-image-url-o26z5K19.js";
|
|
3
|
+
import { Fragment as ee, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, markRaw as d, mergeModels as f, mergeProps as p, nextTick as te, normalizeClass as m, openBlock as h, ref as g, renderList as ne, renderSlot as _, resolveDynamicComponent as re, toDisplayString as v, unref as y, useModel as ie, useSlots as ae, watch as b, watchEffect as oe, withCtx as x } from "vue";
|
|
4
|
+
import { ElAvatar as S, ElDrawer as se, ElTooltip as ce } from "element-plus";
|
|
5
|
+
import { Briefcase as C, Building2 as le, Cake as ue, CalendarDays as de, Image as fe, Mail as pe, Mars as w, Phone as me, User as he, Venus as ge } from "lucide-vue-next";
|
|
6
6
|
// src/components/user-avatar-info/index.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var _e = { class: "inline-block max-w-full" }, ve = [
|
|
8
8
|
"role",
|
|
9
9
|
"tabindex",
|
|
10
10
|
"aria-label",
|
|
11
11
|
"aria-disabled"
|
|
12
|
-
],
|
|
12
|
+
], ye = { class: "relative flex-shrink-0 w-fit" }, be = { class: "overflow-hidden text-ellipsis text-[13px] font-medium whitespace-nowrap" }, xe = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "w-full min-w-0"
|
|
15
|
-
},
|
|
15
|
+
}, Se = { class: "max-w-[min(90vw,360px)] text-[10px] leading-[1.45] break-words whitespace-normal" }, T = { class: "flex items-center w-full min-h-[24px] gap-3" }, E = { class: "flex-1 font-semibold text-gray-900" }, D = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "text-sm text-gray-900"
|
|
18
18
|
}, O = {
|
|
@@ -48,6 +48,7 @@ var ve = { class: "inline-block max-w-full" }, ye = [
|
|
|
48
48
|
drawerTitle: { default: void 0 },
|
|
49
49
|
drawerSize: { default: "40%" },
|
|
50
50
|
drawerProps: { default: void 0 },
|
|
51
|
+
drawerFields: { default: void 0 },
|
|
51
52
|
nickName: { default: "" },
|
|
52
53
|
deptName: { default: "" },
|
|
53
54
|
sex: { default: "" }
|
|
@@ -60,16 +61,16 @@ var ve = { class: "inline-block max-w-full" }, ye = [
|
|
|
60
61
|
}),
|
|
61
62
|
emits: ["update:drawerVisible"],
|
|
62
63
|
setup(u, { expose: f }) {
|
|
63
|
-
let M = u, { ensureImageBaseUrl: je, resolveImageUrl: Me } =
|
|
64
|
+
let M = u, { ensureImageBaseUrl: je, resolveImageUrl: Me } = n();
|
|
64
65
|
je();
|
|
65
|
-
let N =
|
|
66
|
+
let N = ie(u, "drawerVisible"), P = g(!1);
|
|
66
67
|
b(N, (e) => {
|
|
67
68
|
e && (P.value = !0);
|
|
68
69
|
}, { immediate: !0 });
|
|
69
70
|
function Ne() {
|
|
70
71
|
P.value = !1;
|
|
71
72
|
}
|
|
72
|
-
let { t: F } =
|
|
73
|
+
let { t: F } = t(), Pe = ae(), I = r(() => M.nickName || M.name || ""), L = r(() => M.subtitle || M.deptName || ""), Fe = r(() => M.age), Ie = r(() => M.workYears), Le = r(() => M.jobLevel), Re = r(() => M.email), ze = r(() => M.phone), R = r(() => M.department || M.deptName || ""), z = r(() => M.nickName || M.name || ""), B = r(() => M.userId), Be = r(() => !!Pe.default), V = r(() => {
|
|
73
74
|
if (M.gender !== void 0 && M.gender !== null && M.gender !== "") return M.gender;
|
|
74
75
|
let e = M.sex;
|
|
75
76
|
return e === "0" ? "male" : e === "1" ? "female" : "unknown";
|
|
@@ -82,78 +83,64 @@ var ve = { class: "inline-block max-w-full" }, ye = [
|
|
|
82
83
|
src: Me(M.src || "--"),
|
|
83
84
|
shape: "circle"
|
|
84
85
|
})), qe = r(() => M.drawerTitle ?? F("components.userAvatarInfo.drawerTitle")), q = {
|
|
85
|
-
avatar: d(
|
|
86
|
-
name: d(
|
|
87
|
-
gender: d(
|
|
88
|
-
age: d(
|
|
89
|
-
workYears: d(
|
|
90
|
-
email: d(
|
|
91
|
-
phone: d(
|
|
92
|
-
department: d(
|
|
93
|
-
jobLevel: d(
|
|
94
|
-
position: d(
|
|
95
|
-
}, Je =
|
|
96
|
-
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
key: "email",
|
|
134
|
-
label: F("components.userAvatarInfo.fieldEmail"),
|
|
135
|
-
icon: q.email,
|
|
136
|
-
value: Y(Re.value)
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
key: "department",
|
|
140
|
-
label: F("components.userAvatarInfo.fieldDepartment"),
|
|
141
|
-
icon: q.department,
|
|
142
|
-
value: Y(R.value)
|
|
143
|
-
}
|
|
144
|
-
]), Ye = r(() => ({
|
|
86
|
+
avatar: d(fe),
|
|
87
|
+
name: d(he),
|
|
88
|
+
gender: d(w),
|
|
89
|
+
age: d(ue),
|
|
90
|
+
workYears: d(de),
|
|
91
|
+
email: d(pe),
|
|
92
|
+
phone: d(me),
|
|
93
|
+
department: d(le),
|
|
94
|
+
jobLevel: d(C),
|
|
95
|
+
position: d(C)
|
|
96
|
+
}, Je = [
|
|
97
|
+
{ key: "name" },
|
|
98
|
+
{ key: "gender" },
|
|
99
|
+
{ key: "age" },
|
|
100
|
+
{ key: "workYears" },
|
|
101
|
+
{ key: "jobLevel" },
|
|
102
|
+
{ key: "phone" },
|
|
103
|
+
{ key: "email" },
|
|
104
|
+
{ key: "department" }
|
|
105
|
+
], Ye = {
|
|
106
|
+
name: "components.userAvatarInfo.fieldName",
|
|
107
|
+
gender: "components.userAvatarInfo.fieldGender",
|
|
108
|
+
age: "components.userAvatarInfo.fieldAge",
|
|
109
|
+
workYears: "components.userAvatarInfo.fieldWorkYears",
|
|
110
|
+
jobLevel: "components.userAvatarInfo.fieldJobLevel",
|
|
111
|
+
phone: "components.userAvatarInfo.fieldPhone",
|
|
112
|
+
email: "components.userAvatarInfo.fieldEmail",
|
|
113
|
+
department: "components.userAvatarInfo.fieldDepartment"
|
|
114
|
+
}, J = r(() => ({
|
|
115
|
+
name: z.value,
|
|
116
|
+
gender: W.value,
|
|
117
|
+
age: Y(Fe.value),
|
|
118
|
+
workYears: Y(Ie.value),
|
|
119
|
+
jobLevel: Y(Le.value),
|
|
120
|
+
phone: Y(ze.value),
|
|
121
|
+
email: Y(Re.value),
|
|
122
|
+
department: Y(R.value)
|
|
123
|
+
})), Xe = r(() => (M.drawerFields ?? e().value ?? Je).map((e) => {
|
|
124
|
+
let t = Ye[e.key], n = e.value === void 0 ? J.value[e.key] ?? Y(void 0) : Y(e.value);
|
|
125
|
+
return {
|
|
126
|
+
key: e.key,
|
|
127
|
+
label: e.label ?? (t ? F(t) : e.key),
|
|
128
|
+
icon: e.icon ?? q[e.key] ?? q.name,
|
|
129
|
+
value: n
|
|
130
|
+
};
|
|
131
|
+
})), Ze = r(() => ({
|
|
145
132
|
appendToBody: !0,
|
|
146
133
|
destroyOnClose: !1,
|
|
147
134
|
...M.drawerProps
|
|
148
|
-
})),
|
|
135
|
+
})), Qe = r(() => M.enableDrawer ? `${F("components.userAvatarInfo.ariaLabel")}, ${F("components.userAvatarInfo.clickToViewDetail")}` : F("components.userAvatarInfo.ariaLabel"));
|
|
149
136
|
function Y(e) {
|
|
150
137
|
return e == null || e === "" ? F("components.userAvatarInfo.empty") : String(e);
|
|
151
138
|
}
|
|
152
139
|
let X = r(() => Y(R.value));
|
|
153
|
-
function
|
|
140
|
+
function $e() {
|
|
154
141
|
M.enableDrawer && (N.value = !0);
|
|
155
142
|
}
|
|
156
|
-
function
|
|
143
|
+
function et(e) {
|
|
157
144
|
M.enableDrawer && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), N.value = !0);
|
|
158
145
|
}
|
|
159
146
|
let Z = g(null), Q = g(!1);
|
|
@@ -161,7 +148,7 @@ var ve = { class: "inline-block max-w-full" }, ye = [
|
|
|
161
148
|
let e = Z.value;
|
|
162
149
|
e ? Q.value = e.scrollWidth > e.clientWidth + 1 : Q.value = !1;
|
|
163
150
|
}
|
|
164
|
-
|
|
151
|
+
oe((e) => {
|
|
165
152
|
let t = Z.value;
|
|
166
153
|
if (!t || typeof ResizeObserver > "u") {
|
|
167
154
|
Q.value = !1;
|
|
@@ -170,25 +157,25 @@ var ve = { class: "inline-block max-w-full" }, ye = [
|
|
|
170
157
|
$();
|
|
171
158
|
let n = new ResizeObserver(() => $());
|
|
172
159
|
n.observe(t), e(() => n.disconnect());
|
|
173
|
-
}), b(() => L.value, () =>
|
|
174
|
-
function
|
|
160
|
+
}), b(() => L.value, () => te($));
|
|
161
|
+
function tt() {
|
|
175
162
|
N.value = !0;
|
|
176
163
|
}
|
|
177
|
-
function
|
|
164
|
+
function nt() {
|
|
178
165
|
N.value = !1;
|
|
179
166
|
}
|
|
180
167
|
return f({
|
|
181
|
-
openDrawer:
|
|
182
|
-
closeDrawer:
|
|
183
|
-
}), (e, t) => (h(), o("div",
|
|
168
|
+
openDrawer: tt,
|
|
169
|
+
closeDrawer: nt
|
|
170
|
+
}), (e, t) => (h(), o("div", _e, [s("div", {
|
|
184
171
|
class: m(["inline-flex items-center min-w-0 max-w-full gap-2 outline-none rounded-md", { "cursor-pointer focus-visible:ring-2 focus-visible:ring-blue-100": u.enableDrawer }]),
|
|
185
172
|
role: u.enableDrawer ? "button" : void 0,
|
|
186
173
|
tabindex: u.enableDrawer ? 0 : void 0,
|
|
187
|
-
"aria-label":
|
|
174
|
+
"aria-label": Qe.value,
|
|
188
175
|
"aria-disabled": !u.enableDrawer,
|
|
189
|
-
onClick:
|
|
190
|
-
onKeydown:
|
|
191
|
-
}, [s("div",
|
|
176
|
+
onClick: $e,
|
|
177
|
+
onKeydown: et
|
|
178
|
+
}, [s("div", ye, [
|
|
192
179
|
l(y(S), p({ class: "inline-flex flex-shrink-0 items-center justify-center align-middle" }, K.value), {
|
|
193
180
|
default: x(() => [_(e.$slots, "avatar", {}, () => [c(v(I.value?.slice(0, 1)), 1)])]),
|
|
194
181
|
_: 3
|
|
@@ -197,11 +184,11 @@ var ve = { class: "inline-block max-w-full" }, ye = [
|
|
|
197
184
|
key: 0,
|
|
198
185
|
class: m(["absolute -top-0.5 -right-0.5 z-[1] box-border inline-flex items-center justify-center w-3 h-3 pointer-events-none rounded-full border-2 border-white bg-white", V.value === "male" ? "text-blue-600" : "text-pink-500"]),
|
|
199
186
|
"aria-hidden": "true"
|
|
200
|
-
}, [V.value === "male" ? (h(), i(y(
|
|
187
|
+
}, [V.value === "male" ? (h(), i(y(w), {
|
|
201
188
|
key: 0,
|
|
202
189
|
size: G.value,
|
|
203
190
|
"stroke-width": 2.5
|
|
204
|
-
}, null, 8, ["size"])) : (h(), i(y(
|
|
191
|
+
}, null, 8, ["size"])) : (h(), i(y(ge), {
|
|
205
192
|
key: 1,
|
|
206
193
|
size: G.value,
|
|
207
194
|
"stroke-width": 2.5
|
|
@@ -211,26 +198,26 @@ var ve = { class: "inline-block max-w-full" }, ye = [
|
|
|
211
198
|
class: m(["absolute right-0 bottom-0 z-[1] box-border w-2.5 h-2.5 pointer-events-none rounded-full border-2 border-white", Ke.value ? "bg-emerald-500" : "bg-gray-300"]),
|
|
212
199
|
"aria-hidden": "true"
|
|
213
200
|
}, null, 2)) : a("", !0)
|
|
214
|
-
]), s("div", { class: m(["flex flex-col flex-1 justify-center min-w-0 text-sm leading-[1.35]", He.value]) }, [s("div",
|
|
201
|
+
]), s("div", { class: m(["flex flex-col flex-1 justify-center min-w-0 text-sm leading-[1.35]", He.value]) }, [s("div", be, [_(e.$slots, "name", {}, () => [c(v(I.value), 1)])]), L.value || e.$slots.subtitle ? (h(), o("div", xe, [l(y(ce), {
|
|
215
202
|
placement: "top",
|
|
216
203
|
disabled: !Q.value,
|
|
217
204
|
"show-after": 200,
|
|
218
205
|
"popper-class": "max-w-[min(90vw,380px)]"
|
|
219
206
|
}, {
|
|
220
|
-
content: x(() => [s("div",
|
|
207
|
+
content: x(() => [s("div", Se, [_(e.$slots, "subtitle", {}, () => [c(v(L.value), 1)])])]),
|
|
221
208
|
default: x(() => [s("div", {
|
|
222
209
|
ref_key: "subtitleRef",
|
|
223
210
|
ref: Z,
|
|
224
211
|
class: m(["min-w-0 overflow-hidden text-ellipsis text-[10px] whitespace-nowrap", Q.value ? "cursor-help" : ""])
|
|
225
212
|
}, [_(e.$slots, "subtitle", {}, () => [c(v(L.value), 1)])], 2)]),
|
|
226
213
|
_: 3
|
|
227
|
-
}, 8, ["disabled"])])) : a("", !0)], 2)], 42,
|
|
214
|
+
}, 8, ["disabled"])])) : a("", !0)], 2)], 42, ve), P.value ? (h(), i(y(se), p({
|
|
228
215
|
key: 0,
|
|
229
216
|
modelValue: N.value,
|
|
230
217
|
"onUpdate:modelValue": t[0] ||= (e) => N.value = e,
|
|
231
218
|
size: u.drawerSize,
|
|
232
219
|
class: ["user-avatar-info-drawer", Ve.value]
|
|
233
|
-
},
|
|
220
|
+
}, Ze.value, { onClosed: Ne }), {
|
|
234
221
|
header: x(() => [s("div", T, [s("span", E, v(qe.value), 1)])]),
|
|
235
222
|
default: x(() => [Be.value ? (h(), o("div", D, [_(e.$slots, "default")])) : (h(), o("div", O, [s("section", { class: m(["relative flex flex-col items-center sm:flex-row gap-5 min-h-[140px] p-6 overflow-hidden rounded-2xl shadow-[inset_0_1px_0_rgba(255,255,255,0.6)]", U.value ? "bg-gradient-to-br from-pink-50 to-rose-100" : "bg-gradient-to-br from-sky-50 to-indigo-100"]) }, [
|
|
236
223
|
t[1] ||= s("div", { class: "absolute top-[-50%] right-[-10%] w-[300px] h-[300px] bg-[radial-gradient(circle,rgba(255,255,255,0.8)_0%,rgba(255,255,255,0)_70%)] rounded-full pointer-events-none" }, null, -1),
|
|
@@ -250,10 +237,10 @@ var ve = { class: "inline-block max-w-full" }, ye = [
|
|
|
250
237
|
key: 0,
|
|
251
238
|
class: m(["px-2.5 py-0.5 text-xs font-medium leading-5 rounded-xl", U.value ? "text-pink-600 bg-pink-600/10" : "text-blue-600 bg-blue-600/10"])
|
|
252
239
|
}, v(W.value), 3)) : a("", !0)]), s("div", we, [B.value ? (h(), o("span", Te, v(y(F)("components.userAvatarInfo.fieldId")) + ": " + v(B.value), 1)) : a("", !0), X.value ? (h(), o("span", Ee, v(X.value), 1)) : a("", !0)])])
|
|
253
|
-
], 2), s("section", De, [(h(!0), o(
|
|
240
|
+
], 2), s("section", De, [(h(!0), o(ee, null, ne(Xe.value, (e) => (h(), o("div", {
|
|
254
241
|
key: e.key,
|
|
255
242
|
class: "group flex items-center gap-4 min-w-0 p-4 sm:p-5 bg-white border border-slate-200/80 rounded-xl shadow-sm transition-all duration-200"
|
|
256
|
-
}, [s("div", { class: m(["flex flex-shrink-0 items-center justify-center w-10 h-10 rounded-[10px] transition-colors", U.value ? "text-pink-500 bg-pink-50 group-hover:bg-pink-100" : "text-blue-500 bg-blue-50 group-hover:bg-blue-100"]) }, [(h(), i(
|
|
243
|
+
}, [s("div", { class: m(["flex flex-shrink-0 items-center justify-center w-10 h-10 rounded-[10px] transition-colors", U.value ? "text-pink-500 bg-pink-50 group-hover:bg-pink-100" : "text-blue-500 bg-blue-50 group-hover:bg-blue-100"]) }, [(h(), i(re(e.icon), {
|
|
257
244
|
size: 18,
|
|
258
245
|
"stroke-width": 2
|
|
259
246
|
}))], 2), s("div", Oe, [s("div", ke, v(e.label), 1), s("div", {
|