disguise-ui 0.3.1 → 0.3.3

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.
@@ -1,120 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
2
- import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeProps as u, normalizeStyle as d, openBlock as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, useAttrs as _, withCtx as v } from "vue";
3
- import { ElEmpty as y, ElIcon as b, ElImage as x, ElTooltip as S } from "element-plus";
4
- import { Loading as C, Picture as w } from "@element-plus/icons-vue";
5
- // \0rolldown/runtime.js
6
- var T = Object.defineProperty, E = (e, t) => {
7
- let n = {};
8
- for (var r in e) T(n, r, {
9
- get: e[r],
10
- enumerable: !0
11
- });
12
- return t || T(n, Symbol.toStringTag, { value: "Module" }), n;
13
- }, D = { class: "inline-block" }, O = ["src"], k = { class: "flex h-full w-full items-center justify-center text-gray-400" }, A = { class: "flex h-full w-full items-center justify-center text-gray-400" }, j = /* @__PURE__ */ l({
14
- name: "ImagesView",
15
- __name: "index",
16
- props: {
17
- images: { default: () => [] },
18
- size: { default: 80 },
19
- maxStack: { default: 3 },
20
- offset: { default: 6 }
21
- },
22
- setup(e) {
23
- let l = e, u = n(() => [...l.images.slice(0, l.maxStack)].reverse()), _ = n(() => {
24
- let e = (Math.min(l.images.length, l.maxStack) - 1) * l.offset;
25
- return {
26
- width: `${l.size + e}px`,
27
- height: `${l.size + e}px`
28
- };
29
- }), T = (e) => {
30
- let t = e === Math.min(l.images.length, l.maxStack) - 1, n = e * l.offset;
31
- return {
32
- width: `${l.size}px`,
33
- height: `${l.size}px`,
34
- left: `${n}px`,
35
- top: `${n}px`,
36
- zIndex: e + 1,
37
- boxShadow: t ? "none" : "0 1px 4px rgba(0,0,0,0.08)"
38
- };
39
- };
40
- return (n, E) => (f(), a("div", D, [e.images.length ? (f(), a("div", {
41
- key: 0,
42
- class: "relative",
43
- style: d(_.value)
44
- }, [(f(!0), a(t, null, p(u.value, (t, n) => (f(), r(g(S), {
45
- key: n,
46
- placement: "top",
47
- effect: "light",
48
- "show-after": 100,
49
- teleported: !0,
50
- "z-index": 9e3
51
- }, {
52
- content: v(() => [o("img", {
53
- src: t,
54
- style: {
55
- display: "block",
56
- "max-width": "300px",
57
- "max-height": "300px"
58
- }
59
- }, null, 8, O)]),
60
- default: v(() => [o("div", {
61
- class: "group absolute overflow-hidden rounded-md border border-gray-200 bg-gray-50 cursor-pointer transition-all duration-200 hover:-translate-y-px hover:border-blue-500",
62
- style: d(T(n))
63
- }, [c(g(x), {
64
- src: t,
65
- fit: "cover",
66
- class: "block h-full w-full",
67
- "preview-src-list": e.images,
68
- "initial-index": u.value.length - 1 - n,
69
- "preview-teleported": !0,
70
- "hide-on-click-modal": !0,
71
- "z-index": 3e3
72
- }, {
73
- placeholder: v(() => [o("div", k, [c(g(b), { class: "is-loading text-xl" }, {
74
- default: v(() => [c(g(C))]),
75
- _: 1
76
- })])]),
77
- error: v(() => [o("div", A, [c(g(b), { class: "text-xl" }, {
78
- default: v(() => [c(g(w))]),
79
- _: 1
80
- })])]),
81
- _: 1
82
- }, 8, [
83
- "src",
84
- "preview-src-list",
85
- "initial-index"
86
- ]), n === u.value.length - 1 && e.images.length > 1 && l.size >= 80 ? (f(), a("span", {
87
- key: 0,
88
- style: d({
89
- width: l.size < 40 ? `${l.size / 1.5}px` : "40px",
90
- height: l.size < 25 ? `${l.size / 1.5}px` : "25px",
91
- fontSize: l.size / 4
92
- }),
93
- class: "pointer-events-none absolute right-1 bottom-1 inline-flex items-center gap-0.5 rounded-full bg-black/60 px-1.5 py-px text-xs leading-tight text-white"
94
- }, [c(g(b), { size: l.size / 4 }, {
95
- default: v(() => [c(g(w))]),
96
- _: 1
97
- }, 8, ["size"]), s(" " + h(e.images.length), 1)], 4)) : i("", !0)], 4)]),
98
- _: 2
99
- }, 1024))), 128))], 4)) : m(n.$slots, "empty", {}, () => [c(g(y), {
100
- description: "暂无图片",
101
- "image-size": 40
102
- })], void 0, 1)]));
103
- }
104
- }), M = { class: "picture-cell flex" }, N = { key: 1 }, P = /*@__PURE__*/ l({
105
- inheritAttrs: !1,
106
- __name: "picture-cell",
107
- props: {
108
- urls: {},
109
- maxPreviewCount: { default: 3 },
110
- imageListProps: { default: () => ({}) }
111
- },
112
- setup(e) {
113
- let t = e, i = _(), o = n(() => t.urls.filter((e) => e)), s = n(() => o.value.slice(0, t.maxPreviewCount)), c = n(() => ({
114
- ...i,
115
- ...t.imageListProps ?? {}
116
- }));
117
- return (e, t) => (f(), a("div", M, [s.value.length > 0 ? (f(), r(j, u({ key: 0 }, c.value, { images: s.value }), null, 16, ["images"])) : (f(), a("span", N, "-"))]));
118
- }
119
- }), F = /* @__PURE__ */ E({ default: () => I }), I = /*#__PURE__*/ e(P, [["__scopeId", "data-v-cb2252bb"]]);
120
- export { E as i, F as n, j as r, I as t };
@@ -1,276 +0,0 @@
1
- import { n as e } from "./i18n-_x6RCAst.js";
2
- import { t } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
3
- import { t as n } from "./use-image-url-Bs5WMZ6L.js";
4
- 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 m, normalizeClass as h, normalizeStyle as te, openBlock as g, ref as _, renderList as ne, renderSlot as v, resolveComponent as y, resolveDynamicComponent as re, toDisplayString as b, unref as x, useModel as ie, useSlots as ae, watch as S, watchEffect as oe, withCtx as C } from "vue";
5
- import { Badge as se, Briefcase as ce, 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
- // src/components/user-avatar-info/index.vue?vue&type=script&setup=true&lang.ts
7
- var _e = { class: "user-avatar-info-root" }, ve = {
8
- key: 0,
9
- class: "user-avatar-info__loading"
10
- }, ye = { class: "user-avatar-info__skeleton-row" }, be = { class: "user-avatar-info__skeleton-text" }, xe = [
11
- "role",
12
- "tabindex",
13
- "aria-label",
14
- "aria-disabled"
15
- ], Se = { class: "user-avatar-info__avatar-wrap" }, T = { class: "user-avatar-info__name" }, E = {
16
- key: 0,
17
- class: "user-avatar-info__subtitle-wrap"
18
- }, D = { class: "user-avatar-info__tooltip-text displaySubtitle" }, O = { class: "row-detail-drawer__header" }, k = { class: "row-detail-drawer__title" }, A = {
19
- key: 0,
20
- class: "user-avatar-info__drawer-slot"
21
- }, j = {
22
- key: 1,
23
- class: "user-avatar-info__drawer"
24
- }, Ce = { class: "user-avatar-info__hero" }, we = { class: "user-avatar-info__hero-avatar" }, Te = { class: "user-avatar-info__hero-main" }, Ee = { class: "user-avatar-info__hero-name-row" }, De = { class: "user-avatar-info__hero-name" }, Oe = {
25
- key: 0,
26
- class: "user-avatar-info__hero-gender"
27
- }, ke = { class: "user-avatar-info__hero-meta" }, Ae = { key: 0 }, je = { key: 1 }, Me = { class: "user-avatar-info__card-grid" }, Ne = { class: "user-avatar-info__field-icon" }, Pe = { class: "user-avatar-info__field-content" }, Fe = { class: "user-avatar-info__field-label" }, Ie = { class: "user-avatar-info__field-value" }, M = /*#__PURE__*/ t(/* @__PURE__ */ u({
28
- __name: "index",
29
- props: /*@__PURE__*/ f({
30
- userId: { default: void 0 },
31
- name: { default: void 0 },
32
- subtitle: { default: "" },
33
- src: {},
34
- gender: { default: void 0 },
35
- size: { default: 30 },
36
- avatar: { default: void 0 },
37
- drawerAvatarSize: { default: 64 },
38
- age: { default: void 0 },
39
- workYears: { default: void 0 },
40
- email: { default: void 0 },
41
- phone: { default: void 0 },
42
- department: { default: void 0 },
43
- jobLevel: { default: void 0 },
44
- enableDrawer: {
45
- type: Boolean,
46
- default: !0
47
- },
48
- drawerTitle: { default: void 0 },
49
- drawerSize: { default: "40%" },
50
- drawerProps: { default: void 0 },
51
- nickName: { default: "" },
52
- deptName: { default: "" },
53
- sex: { default: "" }
54
- }, {
55
- drawerVisible: {
56
- type: Boolean,
57
- default: !1
58
- },
59
- drawerVisibleModifiers: {}
60
- }),
61
- emits: ["update:drawerVisible"],
62
- setup(t, { expose: u }) {
63
- let f = t, { ensureImageBaseUrl: M, resolveImageUrl: Le } = n();
64
- M();
65
- let N = ie(t, "drawerVisible"), P = _(!1);
66
- S(N, (e) => {
67
- e && (P.value = !0);
68
- }, { immediate: !0 });
69
- function Re() {
70
- P.value = !1;
71
- }
72
- let { t: F } = e(), ze = ae(), I = r(() => null), L = r(() => I.value?.data), Be = r(() => !1), Ve = r(() => !1), R = r(() => ({ isUserOnline: (e) => !1 })).value, He = r(() => Be.value && Ve.value && !I.value), z = r(() => f.nickName || f.name || ""), B = r(() => f.subtitle || f.deptName || ""), Ue = r(() => f.age), We = r(() => f.workYears), Ge = r(() => f.jobLevel), V = r(() => L.value?.nickName ?? L.value?.userName ?? ""), H = r(() => L.value?.userId ?? f.userId), Ke = r(() => !!ze.default), U = r(() => {
73
- if (f.gender !== void 0 && f.gender !== null && f.gender !== "") return f.gender;
74
- let e = f.sex;
75
- return e === "0" ? "male" : e === "1" ? "female" : "unknown";
76
- }), W = r(() => {
77
- let e = L.value?.sex;
78
- return e === "0" ? "male" : e === "1" ? "female" : "unknown";
79
- }), G = r(() => W.value === "male" ? F("components.userAvatarInfo.genderMale") : W.value === "female" ? F("components.userAvatarInfo.genderFemale") : F("components.userAvatarInfo.genderUnknown")), qe = r(() => W.value === "male" || W.value === "female"), Je = r(() => ({
80
- "user-avatar-info__meta--male": U.value === "male",
81
- "user-avatar-info__meta--female": U.value === "female"
82
- })), Ye = r(() => U.value === "male" || U.value === "female"), Xe = r(() => f.userId != null && String(f.userId) !== ""), Ze = r(() => R.isUserOnline(f.userId == null ? null : String(f.userId))), K = r(() => Math.max(10, Math.min(16, Math.round(f.size * .36)))), q = r(() => ({
83
- ...f.avatar,
84
- size: f.size,
85
- src: Le(f.src || "--"),
86
- shape: "circle"
87
- })), Qe = r(() => f.drawerTitle ?? F("components.userAvatarInfo.drawerTitle")), J = {
88
- avatar: d(fe),
89
- name: d(he),
90
- gender: d(w),
91
- age: d(ue),
92
- workYears: d(de),
93
- email: d(pe),
94
- phone: d(me),
95
- department: d(le),
96
- jobLevel: d(se),
97
- position: d(ce)
98
- }, $e = r(() => [
99
- {
100
- key: "name",
101
- label: F("components.userAvatarInfo.fieldName"),
102
- icon: J.name,
103
- value: V.value
104
- },
105
- {
106
- key: "gender",
107
- label: F("components.userAvatarInfo.fieldGender"),
108
- icon: J.gender,
109
- value: G.value
110
- },
111
- {
112
- key: "age",
113
- label: F("components.userAvatarInfo.fieldAge"),
114
- icon: J.age,
115
- value: Y(Ue.value)
116
- },
117
- {
118
- key: "workYears",
119
- label: F("components.userAvatarInfo.fieldWorkYears"),
120
- icon: J.workYears,
121
- value: Y(We.value)
122
- },
123
- {
124
- key: "jobLevel",
125
- label: F("components.userAvatarInfo.fieldJobLevel"),
126
- icon: J.position,
127
- value: Y(Ge.value)
128
- },
129
- {
130
- key: "phone",
131
- label: F("components.userAvatarInfo.fieldPhone"),
132
- icon: J.phone,
133
- value: Y(L.value?.phonenumber ?? "")
134
- },
135
- {
136
- key: "email",
137
- label: F("components.userAvatarInfo.fieldEmail"),
138
- icon: J.email,
139
- value: Y(L.value?.email ?? "")
140
- },
141
- {
142
- key: "department",
143
- label: F("components.userAvatarInfo.fieldDepartment"),
144
- icon: J.department,
145
- value: X.value
146
- }
147
- ]), et = r(() => ({
148
- appendToBody: !0,
149
- destroyOnClose: !1,
150
- ...f.drawerProps
151
- })), tt = r(() => f.enableDrawer ? `${F("components.userAvatarInfo.ariaLabel")}, ${F("components.userAvatarInfo.clickToViewDetail")}` : F("components.userAvatarInfo.ariaLabel"));
152
- function Y(e) {
153
- return e == null || e === "" ? F("components.userAvatarInfo.empty") : String(e);
154
- }
155
- let X = r(() => Y(L.value?.dept?.deptName ?? ""));
156
- function nt() {
157
- f.enableDrawer && (N.value = !0);
158
- }
159
- function rt(e) {
160
- f.enableDrawer && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), N.value = !0);
161
- }
162
- let Z = _(null), Q = _(!1);
163
- function $() {
164
- let e = Z.value;
165
- e ? Q.value = e.scrollWidth > e.clientWidth + 1 : Q.value = !1;
166
- }
167
- oe((e) => {
168
- let t = Z.value;
169
- if (!t || typeof ResizeObserver > "u") {
170
- Q.value = !1;
171
- return;
172
- }
173
- $();
174
- let n = new ResizeObserver(() => $());
175
- n.observe(t), e(() => n.disconnect());
176
- }), S(() => B.value, () => m($));
177
- function it() {
178
- N.value = !0;
179
- }
180
- function at() {
181
- N.value = !1;
182
- }
183
- return u({
184
- openDrawer: it,
185
- closeDrawer: at,
186
- remoteUser: L,
187
- remoteDetail: I
188
- }), (e, n) => {
189
- let r = y("el-skeleton-item"), u = y("el-skeleton"), d = y("el-avatar"), m = y("el-tooltip"), _ = y("el-drawer");
190
- return g(), o("div", _e, [He.value ? (g(), o("div", ve, [l(u, { animated: "" }, {
191
- template: C(() => [s("div", ye, [l(r, {
192
- variant: "circle",
193
- style: te({
194
- width: `${t.size}px`,
195
- height: `${t.size}px`
196
- })
197
- }, null, 8, ["style"]), s("div", be, [l(r, {
198
- variant: "p",
199
- style: { width: "55%" }
200
- }), l(r, {
201
- variant: "p",
202
- style: { width: "40%" }
203
- })])])]),
204
- _: 1
205
- })])) : (g(), o("div", {
206
- key: 1,
207
- class: h(["user-avatar-info", { "user-avatar-info--clickable": t.enableDrawer }]),
208
- role: t.enableDrawer ? "button" : void 0,
209
- tabindex: t.enableDrawer ? 0 : void 0,
210
- "aria-label": tt.value,
211
- "aria-disabled": !t.enableDrawer,
212
- onClick: nt,
213
- onKeydown: rt
214
- }, [s("div", Se, [
215
- l(d, p({ class: "user-avatar-info__avatar" }, q.value), {
216
- default: C(() => [v(e.$slots, "avatar", {}, () => [c(b(z.value?.slice(0, 1)), 1)], !0)]),
217
- _: 3
218
- }, 16),
219
- Ye.value ? (g(), o("span", {
220
- key: 0,
221
- class: h(["user-avatar-info__gender-badge", `user-avatar-info__gender-badge--${U.value}`]),
222
- "aria-hidden": "true"
223
- }, [U.value === "male" ? (g(), i(x(w), {
224
- key: 0,
225
- size: K.value,
226
- "stroke-width": 2.5
227
- }, null, 8, ["size"])) : (g(), i(x(ge), {
228
- key: 1,
229
- size: K.value,
230
- "stroke-width": 2.5
231
- }, null, 8, ["size"]))], 2)) : a("", !0),
232
- Xe.value ? (g(), o("span", {
233
- key: 1,
234
- class: h(["user-avatar-info__presence-badge", { "user-avatar-info__presence-badge--online": Ze.value }]),
235
- "aria-hidden": "true"
236
- }, null, 2)) : a("", !0)
237
- ]), s("div", { class: h(["user-avatar-info__meta", Je.value]) }, [s("div", T, [v(e.$slots, "name", {}, () => [c(b(z.value), 1)], !0)]), B.value || e.$slots.subtitle ? (g(), o("div", E, [l(m, {
238
- placement: "top",
239
- disabled: !Q.value,
240
- "show-after": 200,
241
- "popper-class": "user-avatar-info-tooltip"
242
- }, {
243
- content: C(() => [s("div", D, [v(e.$slots, "subtitle", {}, () => [c(b(B.value), 1)], !0)])]),
244
- default: C(() => [s("div", {
245
- ref_key: "subtitleRef",
246
- ref: Z,
247
- class: h(["user-avatar-info__subtitle", { "user-avatar-info__subtitle--overflow": Q.value }])
248
- }, [v(e.$slots, "subtitle", {}, () => [c(b(B.value), 1)], !0)], 2)]),
249
- _: 3
250
- }, 8, ["disabled"])])) : a("", !0)], 2)], 42, xe)), P.value ? (g(), i(_, p({
251
- key: 2,
252
- modelValue: N.value,
253
- "onUpdate:modelValue": n[0] ||= (e) => N.value = e,
254
- size: t.drawerSize,
255
- class: "user-avatar-info-drawer row-detail-drawer"
256
- }, et.value, { onClosed: Re }), {
257
- header: C(() => [s("div", O, [s("span", k, b(Qe.value), 1)])]),
258
- default: C(() => [Ke.value ? (g(), o("div", A, [v(e.$slots, "default", {}, void 0, !0)])) : (g(), o("div", j, [s("section", Ce, [s("div", we, [v(e.$slots, "drawer-avatar", {}, () => [l(d, {
259
- size: f.drawerAvatarSize,
260
- src: q.value.src
261
- }, {
262
- default: C(() => [c(b(V.value?.slice(0, 1)), 1)]),
263
- _: 1
264
- }, 8, ["size", "src"])], !0)]), s("div", Te, [s("div", Ee, [v(e.$slots, "drawer-name", {}, () => [s("strong", De, b(V.value), 1)], !0), qe.value ? (g(), o("span", Oe, b(G.value), 1)) : a("", !0)]), s("div", ke, [H.value ? (g(), o("span", Ae, b(x(F)("field.id")) + ": " + b(H.value), 1)) : a("", !0), X.value ? (g(), o("span", je, b(X.value), 1)) : a("", !0)])])]), s("section", Me, [(g(!0), o(ee, null, ne($e.value, (e) => (g(), o("div", {
265
- key: e.key,
266
- class: "user-avatar-info__field-card"
267
- }, [s("div", Ne, [(g(), i(re(e.icon), {
268
- size: 18,
269
- "stroke-width": 2.2
270
- }))]), s("div", Pe, [s("div", Fe, b(e.label), 1), s("div", Ie, b(e.value), 1)])]))), 128))])]))]),
271
- _: 3
272
- }, 16, ["modelValue", "size"])) : a("", !0)]);
273
- };
274
- }
275
- }), [["__scopeId", "data-v-5b19a12c"]]);
276
- export { M as t };