disguise-ui 0.3.1 → 0.3.2
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 +1 -21
- package/dist/{i18n-_x6RCAst.js → _plugin-vue_export-helper-BaV2q_qe.js} +176 -40
- package/dist/{avatar-cell-CSanGG5Y.js → avatar-cell-CGc64Tyy.js} +1 -1
- package/dist/disguise-ui.js +1225 -1211
- package/dist/{file-upload-D7N0tsLF.js → file-upload-BllX1YqY.js} +3 -4
- package/dist/{file-upload-ClPojHbE.js → file-upload-DSqjKCVS.js} +1 -1
- package/dist/picture-cell-D4IF_fwn.js +120 -0
- package/dist/{picture-upload-VK7YOAr4.js → picture-upload-CDMrYc5t.js} +1 -1
- package/dist/{picture-upload-BrrTtaCc.js → picture-upload-DO3ttk_V.js} +5 -6
- package/dist/style.css +1 -1
- package/dist/types/components/table-entity/index.type.d.ts +16 -3
- package/dist/types/composables/use-dict-data.d.ts +22 -22
- package/dist/types/index.d.ts +1 -1
- package/dist/types/runtime/context.d.ts +1 -1
- package/dist/types/runtime/dict.d.ts +1 -1
- package/dist/{use-image-url-Bs5WMZ6L.js → use-image-url-BnWCAP3q.js} +1 -1
- package/dist/{use-multiple-file-upload-Cv2dfA07.js → use-multiple-file-upload-D84IYptm.js} +2 -3
- package/dist/{user-avatar-info-BruEfYy4.js → user-avatar-info-CLHoRFpQ.js} +4 -5
- package/package.json +6 -1
- package/dist/_plugin-vue_export-helper-Djzt4Yr7.js +0 -7
- package/dist/context-DqlD6qDJ.js +0 -50
- package/dist/picture-cell-BhKqFZUx.js +0 -120
|
@@ -6,7 +6,7 @@ export interface DictOption {
|
|
|
6
6
|
label: string;
|
|
7
7
|
value: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function useAllDictDataQuery(enabled?: MaybeRefOrGetter<boolean>): import("@tanstack/vue-query").UseQueryReturnType<
|
|
9
|
+
export declare function useAllDictDataQuery(enabled?: MaybeRefOrGetter<boolean>): import("@tanstack/vue-query").UseQueryReturnType<Record<string, DictValueItem[]>, Error>;
|
|
10
10
|
export declare function isDictValueEnabled(status: unknown): status is true | 1 | "1" | undefined;
|
|
11
11
|
/** 某个字典编码下的可选项,供下拉 / 单选使用 */
|
|
12
12
|
export declare function toDictOptions(items: DictValueItem[] | undefined): DictOption[];
|
|
@@ -16,9 +16,9 @@ export declare function findDictValue(items: DictValueItem[], value: unknown): D
|
|
|
16
16
|
* 多个编码共用同一次全量请求。
|
|
17
17
|
*/
|
|
18
18
|
export declare function useDictData(code: MaybeRefOrGetter<string | undefined>): {
|
|
19
|
-
items: import("vue").ComputedRef<
|
|
19
|
+
items: import("vue").ComputedRef<DictValueItem[]>;
|
|
20
20
|
options: import("vue").ComputedRef<DictOption[]>;
|
|
21
|
-
data: import("vue").Ref<
|
|
21
|
+
data: import("vue").Ref<Record<string, DictValueItem[]>, Record<string, DictValueItem[]>>;
|
|
22
22
|
error: import("vue").Ref<Error, Error>;
|
|
23
23
|
isError: import("vue").Ref<true, true>;
|
|
24
24
|
isPending: import("vue").Ref<false, false>;
|
|
@@ -41,13 +41,13 @@ export declare function useDictData(code: MaybeRefOrGetter<string | undefined>):
|
|
|
41
41
|
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
42
42
|
isStale: import("vue").Ref<boolean, boolean>;
|
|
43
43
|
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
44
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
44
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
45
45
|
fetchStatus: import("vue").Ref<import("@tanstack/query-core").FetchStatus, import("@tanstack/query-core").FetchStatus>;
|
|
46
|
-
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
46
|
+
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
47
47
|
} | {
|
|
48
|
-
items: import("vue").ComputedRef<
|
|
48
|
+
items: import("vue").ComputedRef<DictValueItem[]>;
|
|
49
49
|
options: import("vue").ComputedRef<DictOption[]>;
|
|
50
|
-
data: import("vue").Ref<
|
|
50
|
+
data: import("vue").Ref<Record<string, DictValueItem[]>, Record<string, DictValueItem[]>>;
|
|
51
51
|
error: import("vue").Ref<null, null>;
|
|
52
52
|
isError: import("vue").Ref<false, false>;
|
|
53
53
|
isPending: import("vue").Ref<false, false>;
|
|
@@ -70,11 +70,11 @@ export declare function useDictData(code: MaybeRefOrGetter<string | undefined>):
|
|
|
70
70
|
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
71
71
|
isStale: import("vue").Ref<boolean, boolean>;
|
|
72
72
|
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
73
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
73
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
74
74
|
fetchStatus: import("vue").Ref<import("@tanstack/query-core").FetchStatus, import("@tanstack/query-core").FetchStatus>;
|
|
75
|
-
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
75
|
+
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
76
76
|
} | {
|
|
77
|
-
items: import("vue").ComputedRef<
|
|
77
|
+
items: import("vue").ComputedRef<DictValueItem[]>;
|
|
78
78
|
options: import("vue").ComputedRef<DictOption[]>;
|
|
79
79
|
data: import("vue").Ref<undefined, undefined>;
|
|
80
80
|
error: import("vue").Ref<Error, Error>;
|
|
@@ -99,11 +99,11 @@ export declare function useDictData(code: MaybeRefOrGetter<string | undefined>):
|
|
|
99
99
|
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
100
100
|
isStale: import("vue").Ref<boolean, boolean>;
|
|
101
101
|
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
102
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
102
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
103
103
|
fetchStatus: import("vue").Ref<import("@tanstack/query-core").FetchStatus, import("@tanstack/query-core").FetchStatus>;
|
|
104
|
-
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
104
|
+
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
105
105
|
} | {
|
|
106
|
-
items: import("vue").ComputedRef<
|
|
106
|
+
items: import("vue").ComputedRef<DictValueItem[]>;
|
|
107
107
|
options: import("vue").ComputedRef<DictOption[]>;
|
|
108
108
|
data: import("vue").Ref<undefined, undefined>;
|
|
109
109
|
error: import("vue").Ref<null, null>;
|
|
@@ -128,11 +128,11 @@ export declare function useDictData(code: MaybeRefOrGetter<string | undefined>):
|
|
|
128
128
|
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
129
129
|
isStale: import("vue").Ref<boolean, boolean>;
|
|
130
130
|
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
131
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
131
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
132
132
|
fetchStatus: import("vue").Ref<import("@tanstack/query-core").FetchStatus, import("@tanstack/query-core").FetchStatus>;
|
|
133
|
-
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
133
|
+
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
134
134
|
} | {
|
|
135
|
-
items: import("vue").ComputedRef<
|
|
135
|
+
items: import("vue").ComputedRef<DictValueItem[]>;
|
|
136
136
|
options: import("vue").ComputedRef<DictOption[]>;
|
|
137
137
|
data: import("vue").Ref<undefined, undefined>;
|
|
138
138
|
error: import("vue").Ref<null, null>;
|
|
@@ -157,13 +157,13 @@ export declare function useDictData(code: MaybeRefOrGetter<string | undefined>):
|
|
|
157
157
|
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
158
158
|
isStale: import("vue").Ref<boolean, boolean>;
|
|
159
159
|
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
160
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
160
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
161
161
|
fetchStatus: import("vue").Ref<import("@tanstack/query-core").FetchStatus, import("@tanstack/query-core").FetchStatus>;
|
|
162
|
-
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
162
|
+
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
163
163
|
} | {
|
|
164
|
-
items: import("vue").ComputedRef<
|
|
164
|
+
items: import("vue").ComputedRef<DictValueItem[]>;
|
|
165
165
|
options: import("vue").ComputedRef<DictOption[]>;
|
|
166
|
-
data: import("vue").Ref<
|
|
166
|
+
data: import("vue").Ref<Record<string, DictValueItem[]>, Record<string, DictValueItem[]>>;
|
|
167
167
|
isError: import("vue").Ref<false, false>;
|
|
168
168
|
error: import("vue").Ref<null, null>;
|
|
169
169
|
isPending: import("vue").Ref<false, false>;
|
|
@@ -186,7 +186,7 @@ export declare function useDictData(code: MaybeRefOrGetter<string | undefined>):
|
|
|
186
186
|
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
187
187
|
isStale: import("vue").Ref<boolean, boolean>;
|
|
188
188
|
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
189
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
189
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
190
190
|
fetchStatus: import("vue").Ref<import("@tanstack/query-core").FetchStatus, import("@tanstack/query-core").FetchStatus>;
|
|
191
|
-
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
191
|
+
suspense: () => Promise<import("@tanstack/query-core").QueryObserverResult<Record<string, DictValueItem[]>, Error>>;
|
|
192
192
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { default as PictureUpload } from './components/picture-upload/picture-up
|
|
|
19
19
|
export type * from './components/picture-upload/picture-upload.type.js';
|
|
20
20
|
export { default as RichTextEditor } from './components/rich-text-editor/index.vue';
|
|
21
21
|
export type * from './components/rich-text-editor/index.type.js';
|
|
22
|
-
export { registerSchemaFormComponents, SchemaForm } from './components/schema-form/index.js';
|
|
22
|
+
export { registerSchemaFormComponents, SchemaForm, } from './components/schema-form/index.js';
|
|
23
23
|
export type { SchemaFormComponent, SchemaFormComponentConfig, SchemaFormComponentRegistration, } from './components/schema-form/index.js';
|
|
24
24
|
export type * from './components/schema-form/schema-form.type.js';
|
|
25
25
|
export { SearchForm } from './components/search-form/index.js';
|
|
@@ -50,7 +50,7 @@ export declare function configureDisguise(options: DisguiseOptions): void;
|
|
|
50
50
|
export declare function getLocale(): import("vue").Ref<string, string>;
|
|
51
51
|
export declare function getExtraMessages(): import("vue").Ref<Record<string, Record<string, unknown>>, Record<string, Record<string, unknown>>>;
|
|
52
52
|
export declare function getRequestClient(): DisguiseRequestClient | null;
|
|
53
|
-
export declare function loadDictData(): Promise<
|
|
53
|
+
export declare function loadDictData(): Promise<Record<string, DictValueItem[]>>;
|
|
54
54
|
export declare function getFileUploader(): ((file: File, options?: UploadFileOptions) => Promise<UploadFileResult>) | undefined;
|
|
55
55
|
export declare function getImageBaseUrl(): string;
|
|
56
56
|
export declare function getAccessChecker(): import("vue").Ref<(codes: string[]) => boolean, (codes: string[]) => boolean>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as n } from "./use-image-url-Bs5WMZ6L.js";
|
|
1
|
+
import { c as e, r as t } from "./_plugin-vue_export-helper-BaV2q_qe.js";
|
|
2
|
+
import { t as n } from "./use-image-url-BnWCAP3q.js";
|
|
4
3
|
import { t as r } from "./use-file-type-rNstoxXw.js";
|
|
5
4
|
import { computed as i, ref as a, watch as o } from "vue";
|
|
6
5
|
import { ElMessage as s } from "element-plus";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as n } from "./use-image-url-Bs5WMZ6L.js";
|
|
1
|
+
import { r as e, t } from "./_plugin-vue_export-helper-BaV2q_qe.js";
|
|
2
|
+
import { t as n } from "./use-image-url-BnWCAP3q.js";
|
|
4
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 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
4
|
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
5
|
// src/components/user-avatar-info/index.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -261,7 +260,7 @@ var _e = { class: "user-avatar-info-root" }, ve = {
|
|
|
261
260
|
}, {
|
|
262
261
|
default: C(() => [c(b(V.value?.slice(0, 1)), 1)]),
|
|
263
262
|
_: 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)("
|
|
263
|
+
}, 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)("components.userAvatarInfo.fieldId")) + ": " + 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
264
|
key: e.key,
|
|
266
265
|
class: "user-avatar-info__field-card"
|
|
267
266
|
}, [s("div", Ne, [(g(), i(re(e.icon), {
|
|
@@ -272,5 +271,5 @@ var _e = { class: "user-avatar-info-root" }, ve = {
|
|
|
272
271
|
}, 16, ["modelValue", "size"])) : a("", !0)]);
|
|
273
272
|
};
|
|
274
273
|
}
|
|
275
|
-
}), [["__scopeId", "data-v-
|
|
274
|
+
}), [["__scopeId", "data-v-4bc5f50f"]]);
|
|
276
275
|
export { M as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "disguise-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Disguise:可独立使用的后台列表、表单和上传组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "vite build && node scripts/build-types.mjs",
|
|
25
|
+
"format": "prettier --write .",
|
|
26
|
+
"format:check": "prettier --check .",
|
|
27
|
+
"typecheck": "vue-tsc --noEmit",
|
|
28
|
+
"prepare": "node scripts/setup-hooks.mjs",
|
|
25
29
|
"deploy": "bash scripts/deploy.sh",
|
|
26
30
|
"docs:dev": "vitepress dev docs",
|
|
27
31
|
"docs:build": "node scripts/generate-version.mjs && vitepress build docs",
|
|
@@ -76,6 +80,7 @@
|
|
|
76
80
|
"dayjs": "^1.11.21",
|
|
77
81
|
"element-plus": "^2.14.3",
|
|
78
82
|
"lucide-vue-next": "^1.0.0",
|
|
83
|
+
"prettier": "^3.9.10",
|
|
79
84
|
"sass-embedded": "^1.107.0",
|
|
80
85
|
"tailwindcss": "^4.3.3",
|
|
81
86
|
"typescript": "^5.9.2",
|
package/dist/context-DqlD6qDJ.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ref as e } from "vue";
|
|
2
|
-
// src/runtime/context.ts
|
|
3
|
-
var t = e("zh-CN"), n = e({}), r = e(() => !0), i = e(() => ""), a = e("hover"), o = e({
|
|
4
|
-
layout: "total, sizes, prev, pager, next, jumper",
|
|
5
|
-
background: !0,
|
|
6
|
-
pageSizes: [
|
|
7
|
-
10,
|
|
8
|
-
20,
|
|
9
|
-
50,
|
|
10
|
-
100
|
|
11
|
-
],
|
|
12
|
-
popperStyle: { zIndex: 4e3 }
|
|
13
|
-
}), s = null, c, l, u = "";
|
|
14
|
-
function d(e) {
|
|
15
|
-
e.locale && (t.value = e.locale), e.messages && (n.value = e.messages), e.request && (s = e.request), e.fetchAllDictData && (c = e.fetchAllDictData), e.uploadFile && (l = e.uploadFile), e.imageBaseUrl !== void 0 && (u = e.imageBaseUrl), e.hasAccess && (r.value = e.hasAccess), e.getAccessToken && (i.value = e.getAccessToken), e.cardShadow && (a.value = e.cardShadow), e.paginationConfig && (o.value = {
|
|
16
|
-
...o.value,
|
|
17
|
-
...e.paginationConfig
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function f() {
|
|
21
|
-
return t;
|
|
22
|
-
}
|
|
23
|
-
function p() {
|
|
24
|
-
return n;
|
|
25
|
-
}
|
|
26
|
-
function m() {
|
|
27
|
-
return s;
|
|
28
|
-
}
|
|
29
|
-
function h() {
|
|
30
|
-
return c?.() ?? Promise.resolve({});
|
|
31
|
-
}
|
|
32
|
-
function g() {
|
|
33
|
-
return l;
|
|
34
|
-
}
|
|
35
|
-
function _() {
|
|
36
|
-
return u;
|
|
37
|
-
}
|
|
38
|
-
function v() {
|
|
39
|
-
return r;
|
|
40
|
-
}
|
|
41
|
-
function y() {
|
|
42
|
-
return i.value();
|
|
43
|
-
}
|
|
44
|
-
function b() {
|
|
45
|
-
return a;
|
|
46
|
-
}
|
|
47
|
-
function x() {
|
|
48
|
-
return o;
|
|
49
|
-
}
|
|
50
|
-
export { p as a, f as c, h as d, b as i, x as l, v as n, g as o, y as r, _ as s, d as t, m as u };
|
|
@@ -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 };
|