@yeepay/yee-boss-ui 0.1.16 → 0.1.18
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 +124 -59
- package/dist/PlatformConfigProvider-BwqlDDcK.js +34 -0
- package/dist/YeeDescriptions-BZ33odSs.js +128 -0
- package/dist/YeeEllipsisText-CR94Jym2.js +100 -0
- package/dist/YeeFileUpload-DvRN1D-j.js +196 -0
- package/dist/YeePage-Dbvn1TNi.js +99 -0
- package/dist/YeeTabs-BPzlkZy6.js +891 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-shell.d.ts +2 -0
- package/dist/app-shell.js +20 -0
- package/dist/components/app-shell/YeeAppShell.vue.d.ts +28 -0
- package/dist/components/app-shell/YeeHeader.vue.d.ts +40 -0
- package/dist/components/app-shell/YeeMenu.vue.d.ts +32 -0
- package/dist/components/app-shell/YeeSidebar.vue.d.ts +35 -0
- package/dist/components/app-shell/YeeTabs.vue.d.ts +69 -0
- package/dist/components/app-shell/index.d.ts +6 -0
- package/dist/components/app-shell/types.d.ts +258 -0
- package/dist/components/app-shell/use-tabs-drag.d.ts +7 -0
- package/dist/components/app-shell/use-tabs-scroll.d.ts +15 -0
- package/dist/components/grid/types.d.ts +1 -4
- package/dist/components/grid/vxe-init.d.ts +1 -1
- package/dist/components/modal/YeeModal.vue.d.ts +3 -3
- package/dist/context-C5gszWl6.js +4 -0
- package/dist/context-DJQ4f46a.js +12 -0
- package/dist/core.d.ts +8 -0
- package/dist/core.js +14 -0
- package/dist/descriptions.d.ts +1 -0
- package/dist/descriptions.js +4 -0
- package/dist/ellipsis-text.d.ts +1 -0
- package/dist/ellipsis-text.js +4 -0
- package/dist/file-upload.d.ts +1 -0
- package/dist/file-upload.js +4 -0
- package/dist/form-api-DbIL_dvg.js +201 -0
- package/dist/form.d.ts +1 -0
- package/dist/form.js +5 -0
- package/dist/grid.d.ts +1 -0
- package/dist/grid.js +5 -0
- package/dist/index-DZP16zRG.js +261 -0
- package/dist/index-kF3hvw2Z.js +132 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +36 -2206
- package/dist/modal.d.ts +1 -0
- package/dist/modal.js +4 -0
- package/dist/page.d.ts +1 -0
- package/dist/page.js +4 -0
- package/dist/platform-message-BgD7E-34.js +22 -0
- package/dist/select.d.ts +1 -0
- package/dist/select.js +4 -0
- package/dist/style.css +1 -1
- package/dist/use-yee-grid-rYoenViE.js +464 -0
- package/package.json +68 -24
- package/dist/components/file-preview/YeeFilePreview.vue.d.ts +0 -23
- package/dist/components/file-preview/index.d.ts +0 -2
- package/dist/components/file-preview/source.d.ts +0 -8
- package/dist/components/file-preview/types.d.ts +0 -70
- package/dist/components/file-preview/useFilePreview.d.ts +0 -31
- package/dist/docx-preview.min-lCFRKxYn.js +0 -4852
- package/dist/marked.esm-DaHdfxOj.js +0 -1563
- package/dist/postal-mime-CPJ2QXsD.js +0 -3219
- package/dist/purify.es-HJ4qIUVZ.js +0 -869
- package/dist/xlsx-CF422ARu.js +0 -24728
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { defineComponent as te, ref as ne, shallowRef as U, computed as a, watch as B, openBlock as p, createElementBlock as g, createBlock as re, unref as k, mergeProps as oe, withCtx as ie, normalizeStyle as ue, createElementVNode as q, toDisplayString as ae, createCommentVNode as z, createVNode as le } from "vue";
|
|
2
|
+
import { Upload as se, Image as ce } from "ant-design-vue";
|
|
3
|
+
import { p as x } from "./platform-message-BgD7E-34.js";
|
|
4
|
+
import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const me = { class: "yee-ui-file-upload" }, de = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "yee-ui-file-upload__empty"
|
|
8
|
+
}, pe = {
|
|
9
|
+
key: 2,
|
|
10
|
+
class: "yee-ui-file-upload__preview"
|
|
11
|
+
}, ve = /* @__PURE__ */ te({
|
|
12
|
+
name: "YeeFileUpload",
|
|
13
|
+
__name: "YeeFileUpload",
|
|
14
|
+
props: {
|
|
15
|
+
accept: {},
|
|
16
|
+
customRequest: { type: Function },
|
|
17
|
+
fileList: {},
|
|
18
|
+
height: {},
|
|
19
|
+
manual: { type: Boolean },
|
|
20
|
+
maxCount: {},
|
|
21
|
+
maxSize: {},
|
|
22
|
+
multiple: { type: Boolean },
|
|
23
|
+
readonly: { type: Boolean },
|
|
24
|
+
uploadText: {},
|
|
25
|
+
width: {}
|
|
26
|
+
},
|
|
27
|
+
emits: ["fileRemoved", "fileSelect", "update:fileList", "uploadSuccess", "uploadingChange"],
|
|
28
|
+
setup(h, { expose: L, emit: M }) {
|
|
29
|
+
const i = h, f = M, o = ne([]), v = U(!1), l = U(""), P = a(() => i.fileList ?? []), $ = a(() => i.height ?? 100), _ = a(() => i.manual ?? !1), F = a(() => i.maxCount ?? 10), S = a(() => i.maxSize ?? 20), j = a(() => i.multiple ?? !1), w = a(() => i.readonly ?? !1), O = a(() => i.uploadText ?? "上传文件"), V = a(() => i.width ?? 100), I = a(() => ({
|
|
30
|
+
height: R($.value),
|
|
31
|
+
width: R(V.value)
|
|
32
|
+
})), Y = a(() => o.value.some((e) => e.status === "uploading"));
|
|
33
|
+
B(
|
|
34
|
+
P,
|
|
35
|
+
(e) => {
|
|
36
|
+
o.value = e.map((t) => ({ ...t })), l.value && !e.some((t) => t.url === l.value || t.thumbUrl === l.value) && C();
|
|
37
|
+
},
|
|
38
|
+
{ immediate: !0 }
|
|
39
|
+
), B(Y, (e) => f("uploadingChange", e), { immediate: !0 });
|
|
40
|
+
function R(e) {
|
|
41
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
42
|
+
}
|
|
43
|
+
function m() {
|
|
44
|
+
f("update:fileList", o.value.map((e) => ({ ...e })));
|
|
45
|
+
}
|
|
46
|
+
function N(e) {
|
|
47
|
+
return e < 1024 ? `${e}B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(2)}KB` : `${(e / (1024 * 1024)).toFixed(2)}MB`;
|
|
48
|
+
}
|
|
49
|
+
function E(e) {
|
|
50
|
+
return e.size <= S.value * 1024 * 1024 ? !1 : (x.error(`文件大小不能超过 ${S.value}MB,当前为 ${N(e.size)}`), !0);
|
|
51
|
+
}
|
|
52
|
+
function T(e) {
|
|
53
|
+
return e.type?.startsWith("image/") ?? /\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(e.url ?? "");
|
|
54
|
+
}
|
|
55
|
+
function D(e) {
|
|
56
|
+
const t = T(e), n = e.url ?? (t ? e.thumbUrl : void 0);
|
|
57
|
+
if (n) {
|
|
58
|
+
if (t) {
|
|
59
|
+
l.value = n, v.value = !0;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
window.open(n, "_blank", "noopener,noreferrer");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function K(e) {
|
|
66
|
+
v.value = e, e || (l.value = "");
|
|
67
|
+
}
|
|
68
|
+
function C() {
|
|
69
|
+
v.value = !1, l.value = "";
|
|
70
|
+
}
|
|
71
|
+
function b(e, t, n) {
|
|
72
|
+
e.status = "done", e.percent = 100, t?.name && (e.name = t.name), t?.url && (e.url = t.url), m(), n(t), f("uploadSuccess");
|
|
73
|
+
}
|
|
74
|
+
function y(e, t, n) {
|
|
75
|
+
e.status = "error", m(), n(t);
|
|
76
|
+
}
|
|
77
|
+
function W(e, t, n, u) {
|
|
78
|
+
const s = o.value.find((r) => r.uid === t);
|
|
79
|
+
if (!s) return;
|
|
80
|
+
if (s.status = "uploading", s.percent = 0, m(), !i.customRequest) {
|
|
81
|
+
const r = new Error("未配置 customRequest");
|
|
82
|
+
x.error(r.message), y(s, r, u);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let c = !1;
|
|
86
|
+
const d = {
|
|
87
|
+
file: e,
|
|
88
|
+
onError: (r) => {
|
|
89
|
+
c || (c = !0, y(s, r, u));
|
|
90
|
+
},
|
|
91
|
+
onProgress: (r) => {
|
|
92
|
+
c || (s.percent = Math.min(100, Math.max(0, r)), m());
|
|
93
|
+
},
|
|
94
|
+
onSuccess: (r) => {
|
|
95
|
+
c || (c = !0, b(s, r, n));
|
|
96
|
+
},
|
|
97
|
+
uid: t
|
|
98
|
+
};
|
|
99
|
+
try {
|
|
100
|
+
Promise.resolve(i.customRequest(d)).catch((r) => {
|
|
101
|
+
d.onError(r instanceof Error ? r : new Error("上传失败"));
|
|
102
|
+
});
|
|
103
|
+
} catch (r) {
|
|
104
|
+
d.onError(r instanceof Error ? r : new Error("上传失败"));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const A = (e) => E(e) || _.value ? !1 : i.customRequest ? !0 : (x.error("未配置 customRequest"), !1);
|
|
108
|
+
function G(e) {
|
|
109
|
+
const t = e.file instanceof File ? e.file : void 0;
|
|
110
|
+
if (!t || E(t)) {
|
|
111
|
+
e.onError?.(new Error("文件大小超过限制"));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const n = t.uid ?? String(Date.now());
|
|
115
|
+
W(t, n, e.onSuccess ?? (() => {
|
|
116
|
+
}), e.onError ?? (() => {
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
function H(e) {
|
|
120
|
+
if (!e || typeof e != "object") return;
|
|
121
|
+
const t = e, n = typeof t.name == "string" ? t.name : void 0, u = typeof t.url == "string" ? t.url : void 0;
|
|
122
|
+
if (!(!n && !u))
|
|
123
|
+
return {
|
|
124
|
+
...n ? { name: n } : {},
|
|
125
|
+
...u ? { url: u } : {}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function J(e) {
|
|
129
|
+
if (o.value = e.fileList.map((n) => {
|
|
130
|
+
const u = o.value.find((d) => d.uid === n.uid), s = H(n.response), c = n.url ?? s?.url ?? u?.url;
|
|
131
|
+
return {
|
|
132
|
+
...u,
|
|
133
|
+
...n,
|
|
134
|
+
name: s?.name ?? u?.name ?? n.name,
|
|
135
|
+
...c ? { url: c } : {}
|
|
136
|
+
};
|
|
137
|
+
}), m(), !_.value) return;
|
|
138
|
+
const t = o.value.at(-1);
|
|
139
|
+
t?.originFileObj instanceof File && f("fileSelect", { file: t.originFileObj, uid: t.uid });
|
|
140
|
+
}
|
|
141
|
+
function Q(e) {
|
|
142
|
+
(e.url === l.value || e.thumbUrl === l.value) && C(), f("fileRemoved", e);
|
|
143
|
+
}
|
|
144
|
+
function X(e, t) {
|
|
145
|
+
const n = o.value.find((u) => u.uid === e);
|
|
146
|
+
n && b(n, t, () => {
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function Z(e) {
|
|
150
|
+
const t = o.value.find((n) => n.uid === e);
|
|
151
|
+
t && y(t, new Error("上传失败"), () => {
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function ee() {
|
|
155
|
+
return o.value.flatMap((e) => e.originFileObj instanceof File ? [e.originFileObj] : []);
|
|
156
|
+
}
|
|
157
|
+
return L({ addError: Z, addResult: X, getFiles: ee }), (e, t) => (p(), g("div", me, [
|
|
158
|
+
!w.value || o.value.length > 0 ? (p(), re(k(se), oe({ key: 0 }, h.accept ? { accept: h.accept } : {}, {
|
|
159
|
+
"before-upload": A,
|
|
160
|
+
"custom-request": G,
|
|
161
|
+
"file-list": o.value,
|
|
162
|
+
"max-count": F.value,
|
|
163
|
+
multiple: j.value,
|
|
164
|
+
"show-upload-list": { showRemoveIcon: !w.value },
|
|
165
|
+
"list-type": "picture-card",
|
|
166
|
+
onChange: J,
|
|
167
|
+
onPreview: D,
|
|
168
|
+
onRemove: Q
|
|
169
|
+
}), {
|
|
170
|
+
default: ie(() => [
|
|
171
|
+
!w.value && o.value.length < F.value ? (p(), g("div", {
|
|
172
|
+
key: 0,
|
|
173
|
+
class: "yee-ui-file-upload__trigger",
|
|
174
|
+
style: ue(I.value)
|
|
175
|
+
}, [
|
|
176
|
+
t[0] || (t[0] = q("span", {
|
|
177
|
+
class: "yee-ui-file-upload__trigger-sign",
|
|
178
|
+
"aria-hidden": "true"
|
|
179
|
+
}, "+", -1)),
|
|
180
|
+
q("span", null, ae(O.value), 1)
|
|
181
|
+
], 4)) : z("", !0)
|
|
182
|
+
]),
|
|
183
|
+
_: 1
|
|
184
|
+
}, 16, ["file-list", "max-count", "multiple", "show-upload-list"])) : (p(), g("span", de, "暂无文件")),
|
|
185
|
+
l.value ? (p(), g("span", pe, [
|
|
186
|
+
le(k(ce), {
|
|
187
|
+
preview: { visible: v.value, onVisibleChange: K },
|
|
188
|
+
src: l.value
|
|
189
|
+
}, null, 8, ["preview", "src"])
|
|
190
|
+
])) : z("", !0)
|
|
191
|
+
]));
|
|
192
|
+
}
|
|
193
|
+
}), xe = /* @__PURE__ */ fe(ve, [["__scopeId", "data-v-ac555a97"]]);
|
|
194
|
+
export {
|
|
195
|
+
xe as Y
|
|
196
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { defineComponent as B, useSlots as w, computed as c, provide as z, shallowRef as p, useTemplateRef as _, watch as Y, onMounted as E, onBeforeUnmount as P, openBlock as a, createElementBlock as n, normalizeStyle as R, normalizeClass as d, createElementVNode as k, renderSlot as i, toDisplayString as $, createCommentVNode as r, nextTick as N } from "vue";
|
|
2
|
+
import { p as T } from "./context-C5gszWl6.js";
|
|
3
|
+
import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const A = { class: "yee-ui-page__heading" }, D = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "yee-ui-page__title"
|
|
7
|
+
}, F = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "yee-ui-page__description"
|
|
10
|
+
}, I = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "yee-ui-page__extra"
|
|
13
|
+
}, K = /* @__PURE__ */ B({
|
|
14
|
+
name: "YeePage",
|
|
15
|
+
__name: "YeePage",
|
|
16
|
+
props: {
|
|
17
|
+
autoContentHeight: { type: Boolean, default: !1 },
|
|
18
|
+
contentClass: {},
|
|
19
|
+
description: {},
|
|
20
|
+
footerClass: {},
|
|
21
|
+
headerClass: {},
|
|
22
|
+
heightOffset: { default: 0 },
|
|
23
|
+
title: {}
|
|
24
|
+
},
|
|
25
|
+
setup(t) {
|
|
26
|
+
const o = t, l = w(), m = c(() => !!(o.description || o.title || l.description || l.extra || l.title)), b = c(() => o.autoContentHeight);
|
|
27
|
+
z(T, b);
|
|
28
|
+
const h = p(0), g = p(0), v = p(!1), u = _("headerRef"), f = _("footerRef");
|
|
29
|
+
let s;
|
|
30
|
+
function C() {
|
|
31
|
+
const e = u.value?.offsetHeight ?? 0, y = f.value?.offsetHeight ?? 0;
|
|
32
|
+
h.value !== e && (h.value = e), g.value !== y && (g.value = y);
|
|
33
|
+
}
|
|
34
|
+
function S() {
|
|
35
|
+
s?.disconnect(), s = void 0, !(typeof ResizeObserver > "u") && (s = new ResizeObserver(C), u.value && s.observe(u.value), f.value && s.observe(f.value));
|
|
36
|
+
}
|
|
37
|
+
async function H() {
|
|
38
|
+
if (s?.disconnect(), s = void 0, !o.autoContentHeight) {
|
|
39
|
+
v.value = !1;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
await N(), C(), v.value = !0, S();
|
|
43
|
+
}
|
|
44
|
+
const O = c(() => ({
|
|
45
|
+
"--yee-page-height-offset": typeof o.heightOffset == "number" ? `${o.heightOffset}px` : o.heightOffset
|
|
46
|
+
})), x = c(() => o.autoContentHeight ? {
|
|
47
|
+
height: `calc(100% - ${h.value}px - ${g.value}px)`,
|
|
48
|
+
overflowY: v.value ? "auto" : "hidden"
|
|
49
|
+
} : {});
|
|
50
|
+
return Y(
|
|
51
|
+
[() => o.autoContentHeight, m, () => !!l.footer],
|
|
52
|
+
() => {
|
|
53
|
+
H();
|
|
54
|
+
},
|
|
55
|
+
{ flush: "post" }
|
|
56
|
+
), E(() => {
|
|
57
|
+
H();
|
|
58
|
+
}), P(() => s?.disconnect()), (e, y) => (a(), n("section", {
|
|
59
|
+
class: d(["yee-ui-page", { "yee-ui-page--auto-height": t.autoContentHeight }]),
|
|
60
|
+
style: R(O.value)
|
|
61
|
+
}, [
|
|
62
|
+
m.value ? (a(), n("header", {
|
|
63
|
+
key: 0,
|
|
64
|
+
ref_key: "headerRef",
|
|
65
|
+
ref: u,
|
|
66
|
+
class: d(["yee-ui-page__header", t.headerClass])
|
|
67
|
+
}, [
|
|
68
|
+
k("div", A, [
|
|
69
|
+
i(e.$slots, "title", {}, () => [
|
|
70
|
+
t.title ? (a(), n("h1", D, $(t.title), 1)) : r("", !0)
|
|
71
|
+
], !0),
|
|
72
|
+
i(e.$slots, "description", {}, () => [
|
|
73
|
+
t.description ? (a(), n("p", F, $(t.description), 1)) : r("", !0)
|
|
74
|
+
], !0)
|
|
75
|
+
]),
|
|
76
|
+
e.$slots.extra ? (a(), n("div", I, [
|
|
77
|
+
i(e.$slots, "extra", {}, void 0, !0)
|
|
78
|
+
])) : r("", !0)
|
|
79
|
+
], 2)) : r("", !0),
|
|
80
|
+
k("main", {
|
|
81
|
+
class: d(["yee-ui-page__content", t.contentClass]),
|
|
82
|
+
style: R(x.value)
|
|
83
|
+
}, [
|
|
84
|
+
i(e.$slots, "default", {}, void 0, !0)
|
|
85
|
+
], 6),
|
|
86
|
+
e.$slots.footer ? (a(), n("footer", {
|
|
87
|
+
key: 1,
|
|
88
|
+
ref_key: "footerRef",
|
|
89
|
+
ref: f,
|
|
90
|
+
class: d(["yee-ui-page__footer", t.footerClass])
|
|
91
|
+
}, [
|
|
92
|
+
i(e.$slots, "footer", {}, void 0, !0)
|
|
93
|
+
], 2)) : r("", !0)
|
|
94
|
+
], 6));
|
|
95
|
+
}
|
|
96
|
+
}), q = /* @__PURE__ */ V(K, [["__scopeId", "data-v-ba7ea0ff"]]);
|
|
97
|
+
export {
|
|
98
|
+
q as Y
|
|
99
|
+
};
|