@yeepay/yee-boss-ui 0.1.14 → 0.1.15
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 +245 -17
- package/dist/components/PlatformConfigProvider.vue.d.ts +4 -9
- package/dist/components/descriptions/YeeDescriptions.vue.d.ts +5 -7
- package/dist/components/descriptions/index.d.ts +1 -1
- package/dist/components/descriptions/types.d.ts +25 -1
- package/dist/components/ellipsis-text/YeeEllipsisText.vue.d.ts +2 -8
- package/dist/components/ellipsis-text/index.d.ts +1 -1
- package/dist/components/ellipsis-text/types.d.ts +12 -1
- package/dist/components/file-preview/YeeFilePreview.vue.d.ts +3 -3
- package/dist/components/file-preview/index.d.ts +1 -1
- package/dist/components/file-preview/types.d.ts +38 -0
- package/dist/components/file-upload/YeeFileUpload.vue.d.ts +5 -14
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/types.d.ts +51 -0
- package/dist/components/form/YeeForm.vue.d.ts +2 -2
- package/dist/components/form/component-map.d.ts +9 -0
- package/dist/components/form/form-api.d.ts +10 -4
- package/dist/components/form/index.d.ts +1 -1
- package/dist/components/form/types.d.ts +114 -5
- package/dist/components/grid/YeeGrid.vue.d.ts +4 -110
- package/dist/components/grid/index.d.ts +2 -2
- package/dist/components/grid/types.d.ts +40 -3
- package/dist/components/grid/use-yee-grid.d.ts +6 -3
- package/dist/components/grid/yee-grid-api.d.ts +11 -3
- package/dist/components/modal/YeeModal.vue.d.ts +3 -14
- package/dist/components/modal/index.d.ts +3 -2
- package/dist/components/modal/types.d.ts +64 -2
- package/dist/components/page/YeePage.vue.d.ts +2 -8
- package/dist/components/page/index.d.ts +1 -1
- package/dist/components/page/types.d.ts +22 -0
- package/dist/components/platform-config-provider/types.d.ts +12 -0
- package/dist/components/select/YeeSelect.vue.d.ts +15 -13
- package/dist/components/select/index.d.ts +3 -2
- package/dist/components/select/types.d.ts +115 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1102 -1037
- package/dist/style.css +1 -1
- package/dist/theme/types.d.ts +65 -0
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { ConfigProvider as
|
|
3
|
-
import { r as
|
|
4
|
-
import { d as
|
|
5
|
-
import { CheckOutlined as
|
|
6
|
-
import { VxeTable as
|
|
7
|
-
import { VxeButton as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
const o =
|
|
1
|
+
import { inject as Ve, defineComponent as se, computed as r, provide as Qe, openBlock as i, createBlock as L, unref as s, withCtx as F, createElementVNode as M, normalizeStyle as ge, renderSlot as Y, reactive as Ue, onBeforeUnmount as Se, mergeProps as ie, createElementBlock as g, Fragment as ke, renderList as he, createTextVNode as ce, toDisplayString as D, normalizeClass as ye, createCommentVNode as z, useTemplateRef as be, shallowRef as O, onMounted as Oe, onUpdated as mt, watch as Ce, nextTick as Te, ref as vt, createVNode as le, withModifiers as yt, resolveDynamicComponent as ht, useSlots as ze, onUnmounted as gt, withDirectives as bt, vShow as wt, toHandlers as _t, createSlots as Re, normalizeProps as Fe, guardReactiveProps as Ee, h as Xe, useModel as Ae, useAttrs as Ze, useId as xt, mergeModels as je } from "vue";
|
|
2
|
+
import { ConfigProvider as kt, message as Ne, Descriptions as qe, Tooltip as fe, Upload as Ct, Image as St, TreeSelect as Tt, TimeRangePicker as $t, TimePicker as Bt, Textarea as Ft, Switch as Et, Slider as Mt, Select as De, Segmented as Rt, Rate as Ot, RangePicker as Vt, RadioGroup as zt, Radio as Pt, Mentions as Nt, InputPassword as Ht, InputNumber as Lt, Input as At, DatePicker as jt, CheckboxGroup as It, Checkbox as Ut, Cascader as Dt, AutoComplete as Yt, Button as de, Modal as et, Drawer as Wt } from "ant-design-vue";
|
|
3
|
+
import { r as qt, t as Gt, a as Kt } from "./tokens-Dw6w0SSs.js";
|
|
4
|
+
import { d as ya, l as ha } from "./tokens-Dw6w0SSs.js";
|
|
5
|
+
import { CheckOutlined as Jt, CopyOutlined as Qt, FullscreenExitOutlined as tt, FullscreenOutlined as ot, DownloadOutlined as Xt, CloseOutlined as Zt } from "@ant-design/icons-vue";
|
|
6
|
+
import { VxeTable as eo, VxeColumn as to, VxeColgroup as oo, VxeGrid as nt, VxeToolbar as no, VxeUI as Me } from "vxe-table";
|
|
7
|
+
import { VxeButton as ao, VxeCheckbox as lo, VxeIcon as io, VxeInput as so, VxeLoading as ro, VxeModal as uo, VxeNumberInput as co, VxePager as fo, VxeRadioGroup as po, VxeSelect as mo } from "vxe-pc-ui";
|
|
8
|
+
const aa = "--yee-content-height", Pe = /* @__PURE__ */ Symbol("platform-theme");
|
|
9
|
+
function la() {
|
|
10
|
+
const o = Ve(Pe);
|
|
11
11
|
if (!o)
|
|
12
12
|
throw new Error("usePlatformTheme 必须在 PlatformConfigProvider 内使用。");
|
|
13
13
|
return o;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const vo = ["data-theme"], yo = /* @__PURE__ */ se({
|
|
16
16
|
name: "PlatformConfigProvider",
|
|
17
17
|
__name: "PlatformConfigProvider",
|
|
18
18
|
props: {
|
|
19
19
|
theme: { default: () => ({}) }
|
|
20
20
|
},
|
|
21
21
|
setup(o) {
|
|
22
|
-
const t = o, e =
|
|
23
|
-
return Qe(
|
|
22
|
+
const t = o, e = r(() => qt(t.theme)), n = r(() => Gt(e.value)), f = r(() => Kt(e.value));
|
|
23
|
+
return Qe(Pe, e), (_, h) => (i(), L(s(kt), {
|
|
24
24
|
"prefix-cls": "yee",
|
|
25
25
|
theme: n.value
|
|
26
26
|
}, {
|
|
27
|
-
default:
|
|
28
|
-
|
|
27
|
+
default: F(() => [
|
|
28
|
+
M("div", {
|
|
29
29
|
class: "yee-ui-platform-theme",
|
|
30
30
|
"data-theme": e.value.mode,
|
|
31
|
-
style:
|
|
31
|
+
style: ge(f.value)
|
|
32
32
|
}, [
|
|
33
|
-
|
|
34
|
-
], 12,
|
|
33
|
+
Y(_.$slots, "default", {}, void 0, !0)
|
|
34
|
+
], 12, vo)
|
|
35
35
|
]),
|
|
36
36
|
_: 3
|
|
37
37
|
}, 8, ["theme"]));
|
|
38
38
|
}
|
|
39
|
-
}),
|
|
39
|
+
}), pe = (o, t) => {
|
|
40
40
|
const e = o.__vccOpts || o;
|
|
41
|
-
for (const [n,
|
|
42
|
-
e[n] =
|
|
41
|
+
for (const [n, f] of t)
|
|
42
|
+
e[n] = f;
|
|
43
43
|
return e;
|
|
44
|
-
},
|
|
45
|
-
async function
|
|
44
|
+
}, ia = /* @__PURE__ */ pe(yo, [["__scopeId", "data-v-7e0afdd9"]]);
|
|
45
|
+
async function ho(o) {
|
|
46
46
|
if (!o) return !1;
|
|
47
47
|
try {
|
|
48
48
|
return await navigator.clipboard.writeText(o), !0;
|
|
@@ -58,32 +58,32 @@ async function Qt(o) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function He(o) {
|
|
62
62
|
return {
|
|
63
63
|
content: o,
|
|
64
64
|
prefixCls: "yee-message",
|
|
65
65
|
rootPrefixCls: "yee"
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const $e = {
|
|
69
69
|
error(o) {
|
|
70
|
-
return
|
|
70
|
+
return Ne.error(He(o));
|
|
71
71
|
},
|
|
72
72
|
success(o) {
|
|
73
|
-
return
|
|
73
|
+
return Ne.success(He(o));
|
|
74
74
|
},
|
|
75
75
|
warning(o) {
|
|
76
|
-
return
|
|
76
|
+
return Ne.warning(He(o));
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, go = { class: "yee-ui-descriptions__item" }, bo = { class: "yee-ui-descriptions__content-row" }, wo = { class: "yee-ui-descriptions__value yee-ui-descriptions__value--ellipsis" }, _o = {
|
|
79
79
|
key: 1,
|
|
80
80
|
class: "yee-ui-descriptions__value"
|
|
81
|
-
},
|
|
81
|
+
}, xo = ["aria-label", "disabled", "onClick"], ko = /* @__PURE__ */ se({
|
|
82
82
|
name: "YeeDescriptions",
|
|
83
83
|
__name: "YeeDescriptions",
|
|
84
84
|
props: {
|
|
85
85
|
bordered: { type: Boolean },
|
|
86
|
-
colon: { type: Boolean },
|
|
86
|
+
colon: { type: Boolean, default: !0 },
|
|
87
87
|
column: {},
|
|
88
88
|
items: {},
|
|
89
89
|
layout: {},
|
|
@@ -91,85 +91,85 @@ const Be = {
|
|
|
91
91
|
title: {}
|
|
92
92
|
},
|
|
93
93
|
setup(o) {
|
|
94
|
-
const t = o, e =
|
|
95
|
-
function
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
async function T(
|
|
99
|
-
const
|
|
100
|
-
if (!
|
|
101
|
-
|
|
94
|
+
const t = o, e = r(() => t.bordered ?? !1), n = r(() => t.colon), f = r(() => t.column ?? 3), _ = r(() => t.layout ?? "horizontal"), h = r(() => t.size ?? "default"), v = Ue(/* @__PURE__ */ new Set()), C = /* @__PURE__ */ new Set();
|
|
95
|
+
function y(S, R) {
|
|
96
|
+
return S.name ?? `${S.label}-${R}`;
|
|
97
|
+
}
|
|
98
|
+
async function T(S, R) {
|
|
99
|
+
const p = String(S.value ?? "");
|
|
100
|
+
if (!p.trim()) {
|
|
101
|
+
$e.warning("没有可复制的内容");
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
if (!await
|
|
105
|
-
|
|
104
|
+
if (!await ho(p)) {
|
|
105
|
+
$e.error("复制失败");
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
108
|
+
v.add(R), $e.success("已复制");
|
|
109
|
+
const c = setTimeout(() => {
|
|
110
|
+
v.delete(R), C.delete(c);
|
|
111
111
|
}, 1500);
|
|
112
|
-
C.add(
|
|
112
|
+
C.add(c);
|
|
113
113
|
}
|
|
114
|
-
return
|
|
115
|
-
C.forEach((
|
|
116
|
-
}), (
|
|
114
|
+
return Se(() => {
|
|
115
|
+
C.forEach((S) => clearTimeout(S)), C.clear();
|
|
116
|
+
}), (S, R) => (i(), L(s(qe), ie({
|
|
117
117
|
class: "yee-ui-descriptions",
|
|
118
118
|
bordered: e.value,
|
|
119
119
|
colon: n.value,
|
|
120
|
-
column:
|
|
121
|
-
layout:
|
|
122
|
-
size:
|
|
120
|
+
column: f.value,
|
|
121
|
+
layout: _.value,
|
|
122
|
+
size: h.value
|
|
123
123
|
}, t.title === void 0 ? {} : { title: t.title }), {
|
|
124
|
-
default:
|
|
125
|
-
(
|
|
126
|
-
key:
|
|
127
|
-
label:
|
|
128
|
-
span:
|
|
124
|
+
default: F(() => [
|
|
125
|
+
(i(!0), g(ke, null, he(o.items, (p, c) => (i(), L(s(qe).Item, {
|
|
126
|
+
key: y(p, c),
|
|
127
|
+
label: p.label,
|
|
128
|
+
span: p.span ?? 1
|
|
129
129
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
default: F(() => [
|
|
131
|
+
M("div", go, [
|
|
132
|
+
M("div", bo, [
|
|
133
|
+
p.ellipsis ? (i(), L(s(fe), {
|
|
134
134
|
key: 0,
|
|
135
|
-
title: String(
|
|
135
|
+
title: String(p.value ?? "")
|
|
136
136
|
}, {
|
|
137
|
-
default:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
default: F(() => [
|
|
138
|
+
M("span", wo, [
|
|
139
|
+
Y(S.$slots, `content-${p.name ?? p.label}`, { item: p }, () => [
|
|
140
|
+
ce(D(p.value), 1)
|
|
141
141
|
], !0)
|
|
142
142
|
])
|
|
143
143
|
]),
|
|
144
144
|
_: 2
|
|
145
|
-
}, 1032, ["title"])) : (
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
}, 1032, ["title"])) : (i(), g("span", _o, [
|
|
146
|
+
Y(S.$slots, `content-${p.name ?? p.label}`, { item: p }, () => [
|
|
147
|
+
ce(D(p.value), 1)
|
|
148
148
|
], !0)
|
|
149
149
|
])),
|
|
150
|
-
|
|
150
|
+
p.copyable ? (i(), L(s(fe), {
|
|
151
151
|
key: 2,
|
|
152
|
-
title:
|
|
152
|
+
title: v.has(y(p, c)) ? "已复制" : "复制"
|
|
153
153
|
}, {
|
|
154
|
-
default:
|
|
155
|
-
|
|
156
|
-
class: ye(["yee-ui-descriptions__copy", { "yee-ui-descriptions__copy--copied":
|
|
157
|
-
"aria-label":
|
|
158
|
-
disabled:
|
|
154
|
+
default: F(() => [
|
|
155
|
+
M("button", {
|
|
156
|
+
class: ye(["yee-ui-descriptions__copy", { "yee-ui-descriptions__copy--copied": v.has(y(p, c)) }]),
|
|
157
|
+
"aria-label": v.has(y(p, c)) ? "已复制" : "复制",
|
|
158
|
+
disabled: v.has(y(p, c)),
|
|
159
159
|
type: "button",
|
|
160
|
-
onClick: (N) => T(
|
|
160
|
+
onClick: (N) => T(p, y(p, c))
|
|
161
161
|
}, [
|
|
162
|
-
|
|
163
|
-
], 10,
|
|
162
|
+
v.has(y(p, c)) ? (i(), L(s(Jt), { key: 0 })) : (i(), L(s(Qt), { key: 1 }))
|
|
163
|
+
], 10, xo)
|
|
164
164
|
]),
|
|
165
165
|
_: 2
|
|
166
166
|
}, 1032, ["title"])) : z("", !0)
|
|
167
167
|
]),
|
|
168
|
-
|
|
168
|
+
p.info ? (i(), g("span", {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "yee-ui-descriptions__info",
|
|
171
|
-
style:
|
|
172
|
-
}, D(
|
|
171
|
+
style: ge(p.infoStyle)
|
|
172
|
+
}, D(p.info), 5)) : z("", !0)
|
|
173
173
|
])
|
|
174
174
|
]),
|
|
175
175
|
_: 2
|
|
@@ -178,7 +178,7 @@ const Be = {
|
|
|
178
178
|
_: 3
|
|
179
179
|
}, 16, ["bordered", "colon", "column", "layout", "size"]));
|
|
180
180
|
}
|
|
181
|
-
}),
|
|
181
|
+
}), sa = /* @__PURE__ */ pe(ko, [["__scopeId", "data-v-cd55dc37"]]), Co = ["aria-expanded", "role", "tabindex"], So = /* @__PURE__ */ se({
|
|
182
182
|
inheritAttrs: !1,
|
|
183
183
|
name: "YeeEllipsisText",
|
|
184
184
|
__name: "YeeEllipsisText",
|
|
@@ -198,82 +198,82 @@ const Be = {
|
|
|
198
198
|
},
|
|
199
199
|
emits: ["expandChange"],
|
|
200
200
|
setup(o, { emit: t }) {
|
|
201
|
-
const e = o, n = t,
|
|
202
|
-
const
|
|
203
|
-
return !
|
|
204
|
-
}),
|
|
201
|
+
const e = o, n = t, f = Ve(Pe, void 0), _ = be("text"), h = O(!1), v = O(!1), C = O(0), y = r(() => Number.isFinite(e.line) ? Math.max(1, Math.floor(e.line)) : 1), T = r(() => Number.isFinite(e.ellipsisThreshold) ? Math.max(0, e.ellipsisThreshold) : 3), S = r(() => typeof e.maxWidth == "number" ? `${e.maxWidth}px` : e.maxWidth), R = r(() => {
|
|
202
|
+
const k = { maxWidth: S.value };
|
|
203
|
+
return !v.value && y.value > 1 && (k.webkitLineClamp = y.value), k;
|
|
204
|
+
}), p = r(() => ({
|
|
205
205
|
"yee-ui-ellipsis-text--expandable": e.expand,
|
|
206
|
-
"yee-ui-ellipsis-text--expanded":
|
|
207
|
-
"yee-ui-ellipsis-text--multi-line": !
|
|
208
|
-
"yee-ui-ellipsis-text--single-line": !
|
|
209
|
-
})),
|
|
210
|
-
const
|
|
211
|
-
return
|
|
212
|
-
}),
|
|
213
|
-
const
|
|
206
|
+
"yee-ui-ellipsis-text--expanded": v.value,
|
|
207
|
+
"yee-ui-ellipsis-text--multi-line": !v.value && y.value > 1,
|
|
208
|
+
"yee-ui-ellipsis-text--single-line": !v.value && y.value === 1
|
|
209
|
+
})), c = r(() => e.tooltipMaxWidth !== void 0 ? e.tooltipMaxWidth : C.value > 0 ? C.value + 24 : void 0), N = r(() => {
|
|
210
|
+
const k = {};
|
|
211
|
+
return c.value !== void 0 && (k.maxWidth = `${c.value}px`), k;
|
|
212
|
+
}), $ = r(() => {
|
|
213
|
+
const k = {
|
|
214
214
|
...e.tooltipOverlayStyle,
|
|
215
|
-
backgroundColor:
|
|
216
|
-
color: e.tooltipColor ||
|
|
217
|
-
fontSize: e.tooltipFontSize === void 0 ?
|
|
215
|
+
backgroundColor: j.value,
|
|
216
|
+
color: e.tooltipColor || f?.value.tokens.popoverForeground || "var(--yee-popover-foreground)",
|
|
217
|
+
fontSize: e.tooltipFontSize === void 0 ? f ? `${f.value.tokens.fontSize}px` : "var(--yee-font-size)" : `${e.tooltipFontSize}px`
|
|
218
218
|
};
|
|
219
|
-
return
|
|
220
|
-
}),
|
|
221
|
-
let
|
|
222
|
-
function
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
226
|
-
if (C.value = Math.ceil(
|
|
227
|
-
|
|
219
|
+
return c.value !== void 0 && (k.maxWidth = `${c.value}px`), k;
|
|
220
|
+
}), j = r(() => e.tooltipBackgroundColor || f?.value.tokens.popover || "var(--yee-popover)"), q = r(() => e.tooltip && !v.value && (!e.tooltipWhenEllipsis || h.value)), B = r(() => q.value ? {} : { open: !1 });
|
|
221
|
+
let u;
|
|
222
|
+
function V() {
|
|
223
|
+
const k = _.value;
|
|
224
|
+
if (!k) return;
|
|
225
|
+
const A = k.getBoundingClientRect().width || k.clientWidth;
|
|
226
|
+
if (C.value = Math.ceil(A), !e.tooltipWhenEllipsis || v.value || !k.textContent?.trim()) {
|
|
227
|
+
h.value = !1;
|
|
228
228
|
return;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
function
|
|
234
|
-
e.expand && (
|
|
235
|
-
}
|
|
236
|
-
function
|
|
237
|
-
!e.expand ||
|
|
238
|
-
}
|
|
239
|
-
return
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
}),
|
|
243
|
-
|
|
244
|
-
}),
|
|
245
|
-
|
|
246
|
-
}), (
|
|
247
|
-
color:
|
|
248
|
-
"overlay-inner-style":
|
|
230
|
+
const m = y.value === 1 ? k.scrollWidth - k.clientWidth : k.scrollHeight - k.clientHeight;
|
|
231
|
+
h.value = m > T.value;
|
|
232
|
+
}
|
|
233
|
+
function I() {
|
|
234
|
+
e.expand && (v.value = !v.value, n("expandChange", v.value), Te(V));
|
|
235
|
+
}
|
|
236
|
+
function G(k) {
|
|
237
|
+
!e.expand || k.key !== "Enter" && k.key !== " " || (k.preventDefault(), I());
|
|
238
|
+
}
|
|
239
|
+
return Oe(() => {
|
|
240
|
+
const k = _.value;
|
|
241
|
+
k && typeof ResizeObserver < "u" && (u = new ResizeObserver(V), u.observe(k)), V();
|
|
242
|
+
}), mt(V), Ce(() => e.expand, (k) => {
|
|
243
|
+
k || (v.value = !1);
|
|
244
|
+
}), Se(() => {
|
|
245
|
+
u?.disconnect(), u = void 0;
|
|
246
|
+
}), (k, A) => (i(), L(s(fe), ie(B.value, {
|
|
247
|
+
color: j.value,
|
|
248
|
+
"overlay-inner-style": $.value,
|
|
249
249
|
"overlay-style": N.value,
|
|
250
250
|
placement: e.placement
|
|
251
251
|
}), {
|
|
252
|
-
title:
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
title: F(() => [
|
|
253
|
+
Y(k.$slots, "tooltip", {}, () => [
|
|
254
|
+
Y(k.$slots, "default", {}, void 0, !0)
|
|
255
255
|
], !0)
|
|
256
256
|
]),
|
|
257
|
-
default:
|
|
258
|
-
|
|
259
|
-
"aria-expanded": e.expand ?
|
|
260
|
-
class: ["yee-ui-ellipsis-text",
|
|
257
|
+
default: F(() => [
|
|
258
|
+
M("div", ie({ ref: "text" }, k.$attrs, {
|
|
259
|
+
"aria-expanded": e.expand ? v.value : void 0,
|
|
260
|
+
class: ["yee-ui-ellipsis-text", p.value],
|
|
261
261
|
role: e.expand ? "button" : void 0,
|
|
262
|
-
style:
|
|
262
|
+
style: R.value,
|
|
263
263
|
tabindex: e.expand ? 0 : void 0,
|
|
264
|
-
onClick:
|
|
265
|
-
onKeydown:
|
|
264
|
+
onClick: I,
|
|
265
|
+
onKeydown: G
|
|
266
266
|
}), [
|
|
267
|
-
|
|
268
|
-
], 16,
|
|
267
|
+
Y(k.$slots, "default", {}, void 0, !0)
|
|
268
|
+
], 16, Co)
|
|
269
269
|
]),
|
|
270
270
|
_: 3
|
|
271
271
|
}, 16, ["color", "overlay-inner-style", "overlay-style", "placement"]));
|
|
272
272
|
}
|
|
273
|
-
}),
|
|
273
|
+
}), ra = /* @__PURE__ */ pe(So, [["__scopeId", "data-v-3aaa7ae9"]]), To = { class: "yee-ui-file-upload" }, $o = {
|
|
274
274
|
key: 1,
|
|
275
275
|
class: "yee-ui-file-upload__empty"
|
|
276
|
-
},
|
|
276
|
+
}, Bo = /* @__PURE__ */ se({
|
|
277
277
|
name: "YeeFileUpload",
|
|
278
278
|
__name: "YeeFileUpload",
|
|
279
279
|
props: {
|
|
@@ -291,150 +291,168 @@ const Be = {
|
|
|
291
291
|
},
|
|
292
292
|
emits: ["fileRemoved", "fileSelect", "update:fileList", "uploadSuccess", "uploadingChange"],
|
|
293
293
|
setup(o, { expose: t, emit: e }) {
|
|
294
|
-
const n = o,
|
|
295
|
-
height:
|
|
296
|
-
width:
|
|
297
|
-
})),
|
|
298
|
-
|
|
294
|
+
const n = o, f = e, _ = vt([]), h = O(!1), v = O(""), C = r(() => n.fileList ?? []), y = r(() => n.height ?? 100), T = r(() => n.manual ?? !1), S = r(() => n.maxCount ?? 10), R = r(() => n.maxSize ?? 20), p = r(() => n.multiple ?? !1), c = r(() => n.readonly ?? !1), N = r(() => n.uploadText ?? "上传文件"), $ = r(() => n.width ?? 100), j = r(() => ({
|
|
295
|
+
height: B(y.value),
|
|
296
|
+
width: B($.value)
|
|
297
|
+
})), q = r(() => _.value.some((a) => a.status === "uploading"));
|
|
298
|
+
Ce(
|
|
299
299
|
C,
|
|
300
|
-
(
|
|
301
|
-
|
|
300
|
+
(a) => {
|
|
301
|
+
_.value = a.map((w) => ({ ...w }));
|
|
302
302
|
},
|
|
303
303
|
{ immediate: !0 }
|
|
304
|
-
),
|
|
305
|
-
function
|
|
306
|
-
return typeof
|
|
304
|
+
), Ce(q, (a) => f("uploadingChange", a), { immediate: !0 });
|
|
305
|
+
function B(a) {
|
|
306
|
+
return typeof a == "number" ? `${a}px` : a;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
|
|
308
|
+
function u() {
|
|
309
|
+
f("update:fileList", _.value.map((a) => ({ ...a })));
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
return
|
|
311
|
+
function V(a) {
|
|
312
|
+
return a < 1024 ? `${a}B` : a < 1024 * 1024 ? `${(a / 1024).toFixed(2)}KB` : `${(a / (1024 * 1024)).toFixed(2)}MB`;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
return
|
|
314
|
+
function I(a) {
|
|
315
|
+
return a.size <= R.value * 1024 * 1024 ? !1 : ($e.error(`文件大小不能超过 ${R.value}MB,当前为 ${V(a.size)}`), !0);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return
|
|
317
|
+
function G(a) {
|
|
318
|
+
return a.type?.startsWith("image/") ?? /\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(a.url ?? "");
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
320
|
+
function k(a) {
|
|
321
|
+
const w = G(a), H = a.url ?? (w ? a.thumbUrl : void 0);
|
|
322
|
+
if (H) {
|
|
323
|
+
if (w) {
|
|
324
|
+
v.value = H, h.value = !0;
|
|
324
325
|
return;
|
|
325
326
|
}
|
|
326
|
-
window.open(
|
|
327
|
+
window.open(H, "_blank", "noopener,noreferrer");
|
|
327
328
|
}
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
-
|
|
330
|
+
function A(a) {
|
|
331
|
+
h.value = a;
|
|
331
332
|
}
|
|
332
|
-
function
|
|
333
|
-
|
|
333
|
+
function m(a, w, H) {
|
|
334
|
+
a.status = "done", a.percent = 100, w?.name && (a.name = w.name), w?.url && (a.url = w.url), u(), H(w), f("uploadSuccess");
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
-
|
|
336
|
+
function d(a, w, H) {
|
|
337
|
+
a.status = "error", u(), H(w);
|
|
337
338
|
}
|
|
338
|
-
function
|
|
339
|
-
const
|
|
340
|
-
if (!
|
|
341
|
-
if (
|
|
339
|
+
function E(a, w, H, te) {
|
|
340
|
+
const ae = _.value.find((J) => J.uid === w);
|
|
341
|
+
if (!ae) return;
|
|
342
|
+
if (ae.status = "uploading", ae.percent = 0, u(), !n.customRequest) {
|
|
342
343
|
const J = new Error("未配置 customRequest");
|
|
343
|
-
|
|
344
|
+
$e.error(J.message), d(ae, J, te);
|
|
344
345
|
return;
|
|
345
346
|
}
|
|
346
|
-
let
|
|
347
|
-
const
|
|
348
|
-
file:
|
|
347
|
+
let ue = !1;
|
|
348
|
+
const xe = {
|
|
349
|
+
file: a,
|
|
349
350
|
onError: (J) => {
|
|
350
|
-
|
|
351
|
+
ue || (ue = !0, d(ae, J, te));
|
|
351
352
|
},
|
|
352
353
|
onProgress: (J) => {
|
|
353
|
-
|
|
354
|
+
ue || (ae.percent = Math.min(100, Math.max(0, J)), u());
|
|
354
355
|
},
|
|
355
356
|
onSuccess: (J) => {
|
|
356
|
-
|
|
357
|
+
ue || (ue = !0, m(ae, J, H));
|
|
357
358
|
},
|
|
358
|
-
uid:
|
|
359
|
+
uid: w
|
|
359
360
|
};
|
|
360
361
|
try {
|
|
361
|
-
Promise.resolve(n.customRequest(
|
|
362
|
-
|
|
362
|
+
Promise.resolve(n.customRequest(xe)).catch((J) => {
|
|
363
|
+
xe.onError(J instanceof Error ? J : new Error("上传失败"));
|
|
363
364
|
});
|
|
364
365
|
} catch (J) {
|
|
365
|
-
|
|
366
|
+
xe.onError(J instanceof Error ? J : new Error("上传失败"));
|
|
366
367
|
}
|
|
367
368
|
}
|
|
368
|
-
const
|
|
369
|
-
function
|
|
370
|
-
const
|
|
371
|
-
if (!
|
|
372
|
-
|
|
369
|
+
const X = (a) => I(a) || T.value ? !1 : n.customRequest ? !0 : ($e.error("未配置 customRequest"), !1);
|
|
370
|
+
function oe(a) {
|
|
371
|
+
const w = a.file instanceof File ? a.file : void 0;
|
|
372
|
+
if (!w || I(w)) {
|
|
373
|
+
a.onError?.(new Error("文件大小超过限制"));
|
|
373
374
|
return;
|
|
374
375
|
}
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
}),
|
|
376
|
+
const H = w.uid ?? String(Date.now());
|
|
377
|
+
E(w, H, a.onSuccess ?? (() => {
|
|
378
|
+
}), a.onError ?? (() => {
|
|
378
379
|
}));
|
|
379
380
|
}
|
|
380
|
-
function
|
|
381
|
-
if (
|
|
382
|
-
const
|
|
383
|
-
|
|
381
|
+
function re(a) {
|
|
382
|
+
if (!a || typeof a != "object") return;
|
|
383
|
+
const w = a, H = typeof w.name == "string" ? w.name : void 0, te = typeof w.url == "string" ? w.url : void 0;
|
|
384
|
+
if (!(!H && !te))
|
|
385
|
+
return {
|
|
386
|
+
...H ? { name: H } : {},
|
|
387
|
+
...te ? { url: te } : {}
|
|
388
|
+
};
|
|
384
389
|
}
|
|
385
|
-
function
|
|
386
|
-
|
|
390
|
+
function we(a) {
|
|
391
|
+
if (_.value = a.fileList.map((H) => {
|
|
392
|
+
const te = _.value.find((xe) => xe.uid === H.uid), ae = re(H.response), ue = H.url ?? ae?.url ?? te?.url;
|
|
393
|
+
return {
|
|
394
|
+
...te,
|
|
395
|
+
...H,
|
|
396
|
+
name: ae?.name ?? te?.name ?? H.name,
|
|
397
|
+
...ue ? { url: ue } : {}
|
|
398
|
+
};
|
|
399
|
+
}), u(), !T.value) return;
|
|
400
|
+
const w = _.value.at(-1);
|
|
401
|
+
w?.originFileObj instanceof File && f("fileSelect", { file: w.originFileObj, uid: w.uid });
|
|
402
|
+
}
|
|
403
|
+
function _e(a) {
|
|
404
|
+
f("fileRemoved", a);
|
|
387
405
|
}
|
|
388
|
-
function
|
|
389
|
-
const
|
|
390
|
-
|
|
406
|
+
function Be(a, w) {
|
|
407
|
+
const H = _.value.find((te) => te.uid === a);
|
|
408
|
+
H && m(H, w, () => {
|
|
391
409
|
});
|
|
392
410
|
}
|
|
393
|
-
function
|
|
394
|
-
const
|
|
395
|
-
|
|
411
|
+
function Q(a) {
|
|
412
|
+
const w = _.value.find((H) => H.uid === a);
|
|
413
|
+
w && d(w, new Error("上传失败"), () => {
|
|
396
414
|
});
|
|
397
415
|
}
|
|
398
|
-
function
|
|
399
|
-
return
|
|
400
|
-
}
|
|
401
|
-
return t({ addError:
|
|
402
|
-
!
|
|
403
|
-
"before-upload":
|
|
404
|
-
"custom-request":
|
|
405
|
-
"file-list":
|
|
406
|
-
"max-count":
|
|
407
|
-
multiple:
|
|
408
|
-
"show-upload-list": { showRemoveIcon: !
|
|
416
|
+
function ee() {
|
|
417
|
+
return _.value.flatMap((a) => a.originFileObj instanceof File ? [a.originFileObj] : []);
|
|
418
|
+
}
|
|
419
|
+
return t({ addError: Q, addResult: Be, getFiles: ee }), (a, w) => (i(), g("div", To, [
|
|
420
|
+
!c.value || _.value.length > 0 ? (i(), L(s(Ct), ie({ key: 0 }, o.accept ? { accept: o.accept } : {}, {
|
|
421
|
+
"before-upload": X,
|
|
422
|
+
"custom-request": oe,
|
|
423
|
+
"file-list": _.value,
|
|
424
|
+
"max-count": S.value,
|
|
425
|
+
multiple: p.value,
|
|
426
|
+
"show-upload-list": { showRemoveIcon: !c.value },
|
|
409
427
|
"list-type": "picture-card",
|
|
410
|
-
onChange:
|
|
411
|
-
onPreview:
|
|
412
|
-
onRemove:
|
|
428
|
+
onChange: we,
|
|
429
|
+
onPreview: k,
|
|
430
|
+
onRemove: _e
|
|
413
431
|
}), {
|
|
414
|
-
default:
|
|
415
|
-
!
|
|
432
|
+
default: F(() => [
|
|
433
|
+
!c.value && _.value.length < S.value ? (i(), g("div", {
|
|
416
434
|
key: 0,
|
|
417
435
|
class: "yee-ui-file-upload__trigger",
|
|
418
|
-
style:
|
|
436
|
+
style: ge(j.value)
|
|
419
437
|
}, [
|
|
420
|
-
|
|
438
|
+
w[0] || (w[0] = M("span", {
|
|
421
439
|
class: "yee-ui-file-upload__trigger-sign",
|
|
422
440
|
"aria-hidden": "true"
|
|
423
441
|
}, "+", -1)),
|
|
424
|
-
|
|
442
|
+
M("span", null, D(N.value), 1)
|
|
425
443
|
], 4)) : z("", !0)
|
|
426
444
|
]),
|
|
427
445
|
_: 1
|
|
428
|
-
}, 16, ["file-list", "max-count", "multiple", "show-upload-list"])) : (
|
|
429
|
-
|
|
446
|
+
}, 16, ["file-list", "max-count", "multiple", "show-upload-list"])) : (i(), g("span", $o, "暂无文件")),
|
|
447
|
+
v.value ? (i(), L(s(St), {
|
|
430
448
|
key: 2,
|
|
431
449
|
class: "yee-ui-file-upload__preview",
|
|
432
|
-
preview: { visible:
|
|
433
|
-
src:
|
|
450
|
+
preview: { visible: h.value, onVisibleChange: A },
|
|
451
|
+
src: v.value
|
|
434
452
|
}, null, 8, ["preview", "src"])) : z("", !0)
|
|
435
453
|
]));
|
|
436
454
|
}
|
|
437
|
-
}),
|
|
455
|
+
}), Fo = /* @__PURE__ */ pe(Bo, [["__scopeId", "data-v-42e427cd"]]), Ge = {
|
|
438
456
|
aac: "audio",
|
|
439
457
|
avif: "image",
|
|
440
458
|
bmp: "image",
|
|
@@ -470,7 +488,7 @@ const Be = {
|
|
|
470
488
|
xls: "spreadsheet",
|
|
471
489
|
xlsx: "spreadsheet",
|
|
472
490
|
xml: "xml"
|
|
473
|
-
},
|
|
491
|
+
}, Eo = [
|
|
474
492
|
[/^audio\//i, "audio"],
|
|
475
493
|
[/^image\//i, "image"],
|
|
476
494
|
[/^video\//i, "video"],
|
|
@@ -486,10 +504,10 @@ const Be = {
|
|
|
486
504
|
[/text\/plain/i, "text"],
|
|
487
505
|
[/text\/xml/i, "xml"]
|
|
488
506
|
];
|
|
489
|
-
function
|
|
507
|
+
function Mo(o) {
|
|
490
508
|
return String(o ?? "").trim().toLowerCase().split(";", 1)[0] ?? "";
|
|
491
509
|
}
|
|
492
|
-
function
|
|
510
|
+
function Ro(o) {
|
|
493
511
|
const t = String(o ?? "").trim().split(/[?#]/, 1)[0] ?? "";
|
|
494
512
|
return ((t.split("/").at(-1) ?? t).split(".").at(-1) ?? "").toLowerCase();
|
|
495
513
|
}
|
|
@@ -503,307 +521,307 @@ function at(o) {
|
|
|
503
521
|
return e;
|
|
504
522
|
}
|
|
505
523
|
}
|
|
506
|
-
function
|
|
507
|
-
const t =
|
|
524
|
+
function Le(o) {
|
|
525
|
+
const t = Mo(o);
|
|
508
526
|
if (t)
|
|
509
|
-
return Ge[t] ? Ge[t] :
|
|
527
|
+
return Ge[t] ? Ge[t] : Eo.find(([e]) => e.test(t))?.[1];
|
|
510
528
|
}
|
|
511
|
-
function
|
|
512
|
-
const n =
|
|
529
|
+
function Oo(o, t, e) {
|
|
530
|
+
const n = Le(e);
|
|
513
531
|
if (n) return n;
|
|
514
|
-
const
|
|
515
|
-
return
|
|
532
|
+
const f = typeof File < "u" && o instanceof File || typeof Blob < "u" && o instanceof Blob ? Le(o.type) : void 0;
|
|
533
|
+
return f || (Le(Ro(t || at(o))) ?? "unsupported");
|
|
516
534
|
}
|
|
517
|
-
function
|
|
535
|
+
function Vo(o) {
|
|
518
536
|
return typeof Blob < "u" && o instanceof Blob || o instanceof ArrayBuffer;
|
|
519
537
|
}
|
|
520
538
|
function Ke(o) {
|
|
521
539
|
return o instanceof Blob ? o : new Blob([o]);
|
|
522
540
|
}
|
|
523
|
-
const
|
|
524
|
-
function
|
|
525
|
-
const n =
|
|
526
|
-
function
|
|
541
|
+
const zo = 50 * 1024 * 1024, Po = 200, No = 50;
|
|
542
|
+
function Ho(o, t, e) {
|
|
543
|
+
const n = O("idle"), f = O(""), _ = O(""), h = O(""), v = O(""), C = O(""), y = O([]), T = O([]), S = O(""), R = O(""), p = O(!1), c = O({ kind: "unsupported", fileName: "" }), N = O(), $ = O(0), j = O(), q = r(() => o.source ?? o.url), B = r(() => String(o.fileName ?? "").trim() || at(q.value) || "未命名文件"), u = r(() => c.value.kind), V = r(() => n.value === "loading"), I = r(() => n.value === "ready"), G = r(() => n.value === "error"), k = r(() => n.value === "unsupported");
|
|
544
|
+
function A() {
|
|
527
545
|
N.value && (URL.revokeObjectURL(N.value), N.value = void 0);
|
|
528
546
|
}
|
|
529
|
-
function
|
|
530
|
-
|
|
547
|
+
function m() {
|
|
548
|
+
j.value?.abort(), j.value = void 0;
|
|
531
549
|
}
|
|
532
|
-
function
|
|
533
|
-
|
|
550
|
+
function d() {
|
|
551
|
+
m(), A(), n.value = "idle", f.value = "", _.value = "", h.value = "", v.value = "", C.value = "", y.value = [], T.value = [], S.value = "", R.value = "", p.value = !1, c.value = { kind: "unsupported", fileName: B.value };
|
|
534
552
|
}
|
|
535
|
-
function
|
|
536
|
-
const
|
|
537
|
-
return N.value =
|
|
553
|
+
function E(l) {
|
|
554
|
+
const b = URL.createObjectURL(Ke(l));
|
|
555
|
+
return N.value = b, b;
|
|
538
556
|
}
|
|
539
|
-
function
|
|
540
|
-
const
|
|
541
|
-
return typeof
|
|
557
|
+
function X() {
|
|
558
|
+
const l = q.value;
|
|
559
|
+
return typeof l == "string" ? l.trim() : Vo(l) ? E(l) : "";
|
|
542
560
|
}
|
|
543
|
-
function
|
|
544
|
-
const
|
|
545
|
-
return Number.isFinite(
|
|
561
|
+
function oe() {
|
|
562
|
+
const l = Number(o.maxFileSize);
|
|
563
|
+
return Number.isFinite(l) && l > 0 ? l : zo;
|
|
546
564
|
}
|
|
547
|
-
function
|
|
548
|
-
const
|
|
549
|
-
return Number.isFinite(
|
|
565
|
+
function re() {
|
|
566
|
+
const l = Number(o.maxRows);
|
|
567
|
+
return Number.isFinite(l) && l > 0 ? Math.floor(l) : Po;
|
|
550
568
|
}
|
|
551
|
-
function
|
|
552
|
-
const
|
|
553
|
-
return Number.isFinite(
|
|
569
|
+
function we() {
|
|
570
|
+
const l = Number(o.maxColumns);
|
|
571
|
+
return Number.isFinite(l) && l > 0 ? Math.floor(l) : No;
|
|
554
572
|
}
|
|
555
|
-
function
|
|
556
|
-
if (
|
|
557
|
-
throw new Error(`文件超过 ${Math.round(
|
|
573
|
+
function _e(l) {
|
|
574
|
+
if (l > oe())
|
|
575
|
+
throw new Error(`文件超过 ${Math.round(oe() / 1024 / 1024)}MB 限制`);
|
|
558
576
|
}
|
|
559
|
-
function
|
|
560
|
-
|
|
561
|
-
const
|
|
562
|
-
return
|
|
577
|
+
function Be() {
|
|
578
|
+
m(), $.value += 1;
|
|
579
|
+
const l = typeof AbortController == "function" ? new AbortController() : void 0;
|
|
580
|
+
return j.value = l, { token: $.value, signal: l?.signal };
|
|
563
581
|
}
|
|
564
|
-
function
|
|
565
|
-
return
|
|
582
|
+
function Q(l) {
|
|
583
|
+
return l === $.value;
|
|
566
584
|
}
|
|
567
|
-
async function
|
|
568
|
-
if (!
|
|
569
|
-
const
|
|
570
|
-
Number.isFinite(
|
|
571
|
-
const
|
|
572
|
-
return
|
|
585
|
+
async function ee(l) {
|
|
586
|
+
if (!l.ok) throw new Error(`文件加载失败(${l.status})`);
|
|
587
|
+
const b = Number(l.headers.get("content-length"));
|
|
588
|
+
Number.isFinite(b) && _e(b);
|
|
589
|
+
const x = await l.arrayBuffer();
|
|
590
|
+
return _e(x.byteLength), x;
|
|
573
591
|
}
|
|
574
|
-
async function
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const
|
|
578
|
-
return
|
|
579
|
-
}
|
|
580
|
-
const
|
|
581
|
-
if (!
|
|
582
|
-
const
|
|
583
|
-
return
|
|
592
|
+
async function a(l) {
|
|
593
|
+
const b = q.value;
|
|
594
|
+
if (b instanceof Blob || b instanceof ArrayBuffer) {
|
|
595
|
+
const U = Ke(b);
|
|
596
|
+
return _e(U.size), U.arrayBuffer();
|
|
597
|
+
}
|
|
598
|
+
const x = typeof b == "string" ? b.trim() : "";
|
|
599
|
+
if (!x) throw new Error("未提供文件地址或文件内容");
|
|
600
|
+
const P = {};
|
|
601
|
+
return l && (P.signal = l), ee(await fetch(x, P));
|
|
584
602
|
}
|
|
585
|
-
async function
|
|
586
|
-
const
|
|
587
|
-
return new TextDecoder().decode(
|
|
603
|
+
async function w(l) {
|
|
604
|
+
const b = await a(l);
|
|
605
|
+
return new TextDecoder().decode(b).replace(/^\uFEFF/, "");
|
|
588
606
|
}
|
|
589
|
-
async function
|
|
590
|
-
const
|
|
591
|
-
return (typeof
|
|
607
|
+
async function H(l) {
|
|
608
|
+
const b = await import("./purify.es-HJ4qIUVZ.js");
|
|
609
|
+
return (typeof b.default == "function" ? b.default(typeof window > "u" ? void 0 : window) : b.default).sanitize(l);
|
|
592
610
|
}
|
|
593
|
-
async function
|
|
594
|
-
const
|
|
611
|
+
async function te(l) {
|
|
612
|
+
const b = await w(l), [x, P] = await Promise.all([
|
|
595
613
|
import("./marked.esm-DaHdfxOj.js"),
|
|
596
614
|
import("./purify.es-HJ4qIUVZ.js")
|
|
597
|
-
]),
|
|
598
|
-
|
|
615
|
+
]), U = x.marked.parse(b, { breaks: !0, gfm: !0 }), K = typeof P.default == "function" ? P.default(typeof window > "u" ? void 0 : window) : P.default;
|
|
616
|
+
h.value = K.sanitize(U);
|
|
599
617
|
}
|
|
600
|
-
async function
|
|
601
|
-
|
|
618
|
+
async function ae(l) {
|
|
619
|
+
v.value = await H(await w(l));
|
|
602
620
|
}
|
|
603
|
-
function
|
|
604
|
-
let
|
|
605
|
-
for (let
|
|
606
|
-
|
|
607
|
-
return btoa(
|
|
621
|
+
function ue(l) {
|
|
622
|
+
let b = "";
|
|
623
|
+
for (let P = 0; P < l.length; P += 32768)
|
|
624
|
+
b += String.fromCharCode(...l.subarray(P, P + 32768));
|
|
625
|
+
return btoa(b);
|
|
608
626
|
}
|
|
609
|
-
function
|
|
610
|
-
let
|
|
611
|
-
if (typeof
|
|
612
|
-
|
|
627
|
+
function xe(l) {
|
|
628
|
+
let b;
|
|
629
|
+
if (typeof l.content == "string")
|
|
630
|
+
b = l.encoding === "base64" ? l.content.replace(/\s/g, "") : ue(new TextEncoder().encode(l.content));
|
|
613
631
|
else {
|
|
614
|
-
const
|
|
615
|
-
|
|
632
|
+
const x = l.content instanceof Uint8Array ? l.content : new Uint8Array(l.content);
|
|
633
|
+
b = ue(x);
|
|
616
634
|
}
|
|
617
|
-
return `data:${
|
|
635
|
+
return `data:${l.mimeType || "application/octet-stream"};base64,${b}`;
|
|
618
636
|
}
|
|
619
|
-
function
|
|
620
|
-
const
|
|
637
|
+
function J(l) {
|
|
638
|
+
const b = l.trim().replace(/^cid:/i, "").replace(/^<|>$/g, "");
|
|
621
639
|
try {
|
|
622
|
-
return decodeURIComponent(
|
|
640
|
+
return decodeURIComponent(b).toLowerCase();
|
|
623
641
|
} catch {
|
|
624
|
-
return
|
|
642
|
+
return b.toLowerCase();
|
|
625
643
|
}
|
|
626
644
|
}
|
|
627
|
-
function st(
|
|
628
|
-
const
|
|
629
|
-
for (const
|
|
630
|
-
if (!/^image\//i.test(
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
}
|
|
634
|
-
if (!
|
|
635
|
-
const
|
|
636
|
-
return
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
}),
|
|
645
|
+
function st(l, b) {
|
|
646
|
+
const x = /* @__PURE__ */ new Map();
|
|
647
|
+
for (const U of b) {
|
|
648
|
+
if (!/^image\//i.test(U.mimeType)) continue;
|
|
649
|
+
const K = xe(U);
|
|
650
|
+
U.contentId && x.set(J(U.contentId), K), U.filename && x.set(J(U.filename), K);
|
|
651
|
+
}
|
|
652
|
+
if (!x.size || typeof DOMParser > "u") return l;
|
|
653
|
+
const P = new DOMParser().parseFromString(l, "text/html");
|
|
654
|
+
return P.querySelectorAll("[src]").forEach((U) => {
|
|
655
|
+
const K = U.getAttribute("src") ?? "", W = J(/^cid:/i.test(K) ? K.slice(4) : K), Z = x.get(W);
|
|
656
|
+
Z && U.setAttribute("src", Z);
|
|
657
|
+
}), P.body.innerHTML;
|
|
640
658
|
}
|
|
641
|
-
function rt(
|
|
659
|
+
function rt(l) {
|
|
642
660
|
try {
|
|
643
|
-
return JSON.stringify(JSON.parse(
|
|
661
|
+
return JSON.stringify(JSON.parse(l), null, 2);
|
|
644
662
|
} catch {
|
|
645
|
-
return
|
|
663
|
+
return l;
|
|
646
664
|
}
|
|
647
665
|
}
|
|
648
|
-
function ut(
|
|
649
|
-
const
|
|
650
|
-
let W = [],
|
|
651
|
-
for (let
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
` ||
|
|
655
|
-
` && (
|
|
656
|
-
}
|
|
657
|
-
return (
|
|
666
|
+
function ut(l) {
|
|
667
|
+
const b = l.replace(/^\uFEFF/, ""), x = b.split(/\r?\n/, 1)[0] ?? "", U = [" ", ",", ";"].map((ne) => ({ candidate: ne, count: x.split(ne).length - 1 })).sort((ne, ve) => ve.count - ne.count)[0]?.candidate ?? ",", K = [];
|
|
668
|
+
let W = [], Z = "", me = !1;
|
|
669
|
+
for (let ne = 0; ne < b.length; ne += 1) {
|
|
670
|
+
const ve = b[ne], We = b[ne + 1];
|
|
671
|
+
ve === '"' ? me && We === '"' ? (Z += '"', ne += 1) : me = !me : ve === U && !me ? (W.push(Z), Z = "") : (ve === `
|
|
672
|
+
` || ve === "\r") && !me ? (ve === "\r" && We === `
|
|
673
|
+
` && (ne += 1), W.push(Z), K.push(W), W = [], Z = "") : Z += ve;
|
|
674
|
+
}
|
|
675
|
+
return (Z || W.length) && (W.push(Z), K.push(W)), K;
|
|
658
676
|
}
|
|
659
|
-
async function ct(
|
|
660
|
-
const
|
|
661
|
-
if (!
|
|
662
|
-
const
|
|
677
|
+
async function ct(l) {
|
|
678
|
+
const b = await import("./xlsx-CF422ARu.js"), x = b.read(await a(l), { type: "array" }), P = x.SheetNames[0], U = P ? x.Sheets[P] : void 0;
|
|
679
|
+
if (!U) throw new Error("Excel 文件没有可展示的工作表");
|
|
680
|
+
const K = b.utils.sheet_to_json(U, {
|
|
663
681
|
defval: "",
|
|
664
682
|
header: 1,
|
|
665
683
|
raw: !1
|
|
666
|
-
}), W =
|
|
667
|
-
|
|
668
|
-
cells:
|
|
684
|
+
}), W = re(), Z = we();
|
|
685
|
+
p.value = K.length > W || K.some((me) => me.length > Z), y.value = K.slice(0, W).map((me) => ({
|
|
686
|
+
cells: me.slice(0, Z).map((ne) => String(ne ?? ""))
|
|
669
687
|
}));
|
|
670
688
|
}
|
|
671
|
-
async function dt(
|
|
672
|
-
const
|
|
673
|
-
if (Array.isArray(W)) return W.map(
|
|
689
|
+
async function dt(l) {
|
|
690
|
+
const x = await (await import("./postal-mime-CPJ2QXsD.js")).default.parse(await a(l)), P = (W) => {
|
|
691
|
+
if (Array.isArray(W)) return W.map(P).filter(Boolean).join("; ");
|
|
674
692
|
if (!W || typeof W != "object") return String(W ?? "");
|
|
675
|
-
const
|
|
676
|
-
return [
|
|
693
|
+
const Z = W;
|
|
694
|
+
return [Z.name, Z.address].filter(Boolean).join(" ");
|
|
677
695
|
};
|
|
678
696
|
T.value = [
|
|
679
|
-
{ label: "发件人", value:
|
|
680
|
-
{ label: "收件人", value:
|
|
681
|
-
{ label: "主题", value:
|
|
682
|
-
{ label: "时间", value:
|
|
683
|
-
],
|
|
684
|
-
const
|
|
685
|
-
|
|
697
|
+
{ label: "发件人", value: P(x.from) || "-" },
|
|
698
|
+
{ label: "收件人", value: P(x.to) || "-" },
|
|
699
|
+
{ label: "主题", value: x.subject || "-" },
|
|
700
|
+
{ label: "时间", value: x.date || "-" }
|
|
701
|
+
], R.value = x.text || "";
|
|
702
|
+
const U = x.attachments, K = x.html ? await H(x.html) : "";
|
|
703
|
+
S.value = K ? st(K, U) : "";
|
|
686
704
|
}
|
|
687
|
-
async function ft(
|
|
688
|
-
if (await Te(), !
|
|
689
|
-
const
|
|
690
|
-
if (!
|
|
691
|
-
const
|
|
692
|
-
|
|
705
|
+
async function ft(l, b) {
|
|
706
|
+
if (await Te(), !Q(l)) return;
|
|
707
|
+
const x = t.docxContainer.value;
|
|
708
|
+
if (!x) throw new Error("DOCX 预览容器未就绪");
|
|
709
|
+
const P = await import("./docx-preview.min-lCFRKxYn.js").then((U) => U.d);
|
|
710
|
+
x.replaceChildren(), await P.renderAsync(await a(b), x, void 0, {
|
|
693
711
|
breakPages: !0,
|
|
694
712
|
ignoreWidth: !1,
|
|
695
713
|
inWrapper: !0
|
|
696
714
|
});
|
|
697
715
|
}
|
|
698
|
-
async function pt(
|
|
699
|
-
if (
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
cells: W.slice(0,
|
|
716
|
+
async function pt(l, b, x) {
|
|
717
|
+
if (l === "text" && (C.value = await w(x)), l === "json" && (C.value = rt(await w(x))), l === "xml" && (C.value = await w(x)), l === "csv") {
|
|
718
|
+
const P = ut(await w(x)), U = re(), K = we();
|
|
719
|
+
p.value = P.length > U || P.some((W) => W.length > K), y.value = P.slice(0, U).map((W) => ({
|
|
720
|
+
cells: W.slice(0, K)
|
|
703
721
|
}));
|
|
704
722
|
}
|
|
705
|
-
|
|
723
|
+
l === "markdown" && await te(x), l === "html" && await ae(x), l === "spreadsheet" && await ct(x), l === "eml" && await dt(x), l === "docx" && await ft(b, x);
|
|
706
724
|
}
|
|
707
725
|
async function Ye() {
|
|
708
|
-
|
|
709
|
-
const
|
|
710
|
-
if (
|
|
711
|
-
const
|
|
712
|
-
if (
|
|
726
|
+
d();
|
|
727
|
+
const l = q.value;
|
|
728
|
+
if (l === void 0 || l === "") return;
|
|
729
|
+
const b = Oo(l, o.fileName, o.fileType);
|
|
730
|
+
if (c.value = { kind: b, fileName: B.value }, _.value = X(), b === "unsupported") {
|
|
713
731
|
n.value = "unsupported", e("unsupported", {
|
|
714
|
-
kind:
|
|
732
|
+
kind: b,
|
|
715
733
|
message: "该文件类型暂不支持在线预览"
|
|
716
734
|
});
|
|
717
735
|
return;
|
|
718
736
|
}
|
|
719
|
-
const
|
|
737
|
+
const x = Be();
|
|
720
738
|
n.value = "loading";
|
|
721
739
|
try {
|
|
722
|
-
if (["image", "pdf", "video", "audio"].includes(
|
|
740
|
+
if (["image", "pdf", "video", "audio"].includes(b))
|
|
723
741
|
n.value = "ready";
|
|
724
742
|
else {
|
|
725
|
-
if (await pt(
|
|
743
|
+
if (await pt(b, x.token, x.signal), !Q(x.token)) return;
|
|
726
744
|
n.value = "ready";
|
|
727
745
|
}
|
|
728
|
-
e("load", { kind:
|
|
729
|
-
} catch (
|
|
730
|
-
if (!
|
|
731
|
-
n.value = "error",
|
|
746
|
+
e("load", { kind: b, fileName: B.value });
|
|
747
|
+
} catch (P) {
|
|
748
|
+
if (!Q(x.token)) return;
|
|
749
|
+
n.value = "error", f.value = P instanceof Error ? P.message : "文件预览失败", e("error", { kind: b, message: f.value, cause: P });
|
|
732
750
|
}
|
|
733
751
|
}
|
|
734
|
-
return
|
|
752
|
+
return Ce(
|
|
735
753
|
() => [o.source, o.url, o.fileName, o.fileType],
|
|
736
754
|
() => {
|
|
737
755
|
Ye();
|
|
738
756
|
},
|
|
739
757
|
{ immediate: !0 }
|
|
740
|
-
),
|
|
741
|
-
|
|
758
|
+
), Se(() => {
|
|
759
|
+
$.value += 1, m(), A();
|
|
742
760
|
}), {
|
|
743
|
-
displayUrl:
|
|
744
|
-
emailHtml:
|
|
761
|
+
displayUrl: _,
|
|
762
|
+
emailHtml: S,
|
|
745
763
|
emailMeta: T,
|
|
746
|
-
emailText:
|
|
747
|
-
errorMessage:
|
|
748
|
-
fileName:
|
|
749
|
-
htmlContent:
|
|
750
|
-
isError:
|
|
751
|
-
isLoading:
|
|
752
|
-
isReady:
|
|
753
|
-
isUnsupported:
|
|
754
|
-
kind:
|
|
764
|
+
emailText: R,
|
|
765
|
+
errorMessage: f,
|
|
766
|
+
fileName: B,
|
|
767
|
+
htmlContent: v,
|
|
768
|
+
isError: G,
|
|
769
|
+
isLoading: V,
|
|
770
|
+
isReady: I,
|
|
771
|
+
isUnsupported: k,
|
|
772
|
+
kind: u,
|
|
755
773
|
load: Ye,
|
|
756
|
-
markdownHtml:
|
|
774
|
+
markdownHtml: h,
|
|
757
775
|
status: n,
|
|
758
|
-
tableRows:
|
|
776
|
+
tableRows: y,
|
|
759
777
|
textContent: C,
|
|
760
|
-
truncated:
|
|
778
|
+
truncated: p
|
|
761
779
|
};
|
|
762
780
|
}
|
|
763
|
-
const
|
|
781
|
+
const Lo = ["aria-busy"], Ao = {
|
|
764
782
|
key: 0,
|
|
765
783
|
class: "yee-ui-file-preview__header"
|
|
766
|
-
},
|
|
784
|
+
}, jo = ["title"], Io = { class: "yee-ui-file-preview__header-actions" }, Uo = ["aria-label", "aria-pressed"], Do = ["aria-label", "aria-busy", "disabled"], Yo = {
|
|
767
785
|
key: 1,
|
|
768
786
|
class: "yee-ui-file-preview__download-error",
|
|
769
787
|
role: "alert"
|
|
770
|
-
},
|
|
788
|
+
}, Wo = {
|
|
771
789
|
key: 2,
|
|
772
790
|
class: "yee-ui-file-preview__empty"
|
|
773
|
-
},
|
|
791
|
+
}, qo = {
|
|
774
792
|
key: 3,
|
|
775
793
|
class: "yee-ui-file-preview__loading"
|
|
776
|
-
},
|
|
794
|
+
}, Go = {
|
|
777
795
|
key: 4,
|
|
778
796
|
class: "yee-ui-file-preview__empty"
|
|
779
|
-
},
|
|
797
|
+
}, Ko = {
|
|
780
798
|
key: 5,
|
|
781
799
|
class: "yee-ui-file-preview__empty"
|
|
782
|
-
},
|
|
800
|
+
}, Jo = ["src", "alt"], Qo = ["src", "title"], Xo = ["src"], Zo = ["src"], en = {
|
|
783
801
|
key: 4,
|
|
784
802
|
class: "yee-ui-file-preview__text"
|
|
785
|
-
},
|
|
803
|
+
}, tn = ["innerHTML"], on = ["srcdoc", "title"], nn = {
|
|
786
804
|
key: 8,
|
|
787
805
|
class: "yee-ui-file-preview__table-wrap"
|
|
788
|
-
},
|
|
806
|
+
}, an = {
|
|
789
807
|
key: 0,
|
|
790
808
|
class: "yee-ui-file-preview__table"
|
|
791
|
-
},
|
|
809
|
+
}, ln = {
|
|
792
810
|
key: 1,
|
|
793
811
|
class: "yee-ui-file-preview__empty-inline"
|
|
794
|
-
},
|
|
812
|
+
}, sn = {
|
|
795
813
|
key: 2,
|
|
796
814
|
class: "yee-ui-file-preview__tip"
|
|
797
|
-
},
|
|
815
|
+
}, rn = {
|
|
798
816
|
key: 9,
|
|
799
817
|
class: "yee-ui-file-preview__email"
|
|
800
|
-
},
|
|
818
|
+
}, un = {
|
|
801
819
|
key: 0,
|
|
802
820
|
class: "yee-ui-file-preview__email-meta"
|
|
803
|
-
},
|
|
821
|
+
}, cn = ["srcdoc", "title"], dn = {
|
|
804
822
|
key: 2,
|
|
805
823
|
class: "yee-ui-file-preview__text"
|
|
806
|
-
},
|
|
824
|
+
}, fn = /* @__PURE__ */ se({
|
|
807
825
|
name: "YeeFilePreview",
|
|
808
826
|
__name: "YeeFilePreview",
|
|
809
827
|
props: {
|
|
@@ -819,79 +837,79 @@ const bo = ["aria-busy"], wo = {
|
|
|
819
837
|
showDownload: { type: Boolean, default: !0 },
|
|
820
838
|
alt: { default: "文件预览" }
|
|
821
839
|
},
|
|
822
|
-
emits: ["
|
|
840
|
+
emits: ["download", "error", "load", "unsupported"],
|
|
823
841
|
setup(o, { emit: t }) {
|
|
824
|
-
const e = o, n = t,
|
|
825
|
-
displayUrl:
|
|
842
|
+
const e = o, n = t, f = be("previewContainer"), _ = be("docxContainer"), h = O(!1), v = O(""), C = O(!1), {
|
|
843
|
+
displayUrl: y,
|
|
826
844
|
emailHtml: T,
|
|
827
|
-
emailMeta:
|
|
828
|
-
emailText:
|
|
829
|
-
errorMessage:
|
|
830
|
-
fileName:
|
|
845
|
+
emailMeta: S,
|
|
846
|
+
emailText: R,
|
|
847
|
+
errorMessage: p,
|
|
848
|
+
fileName: c,
|
|
831
849
|
htmlContent: N,
|
|
832
|
-
isError:
|
|
833
|
-
isLoading:
|
|
834
|
-
isReady:
|
|
835
|
-
isUnsupported:
|
|
836
|
-
kind:
|
|
837
|
-
markdownHtml:
|
|
838
|
-
tableRows:
|
|
839
|
-
textContent:
|
|
840
|
-
truncated:
|
|
841
|
-
} =
|
|
850
|
+
isError: $,
|
|
851
|
+
isLoading: j,
|
|
852
|
+
isReady: q,
|
|
853
|
+
isUnsupported: B,
|
|
854
|
+
kind: u,
|
|
855
|
+
markdownHtml: V,
|
|
856
|
+
tableRows: I,
|
|
857
|
+
textContent: G,
|
|
858
|
+
truncated: k
|
|
859
|
+
} = Ho(e, { docxContainer: _ }, n), A = r(() => e.height === void 0 || e.height === null || e.height === "" ? {} : {
|
|
842
860
|
height: typeof e.height == "number" ? `${e.height}px` : e.height
|
|
843
|
-
}),
|
|
844
|
-
|
|
861
|
+
}), m = r(() => !!y.value), d = r(() => ["image", "pdf", "video", "audio"].includes(u.value)), E = r(() => u.value === "csv" || u.value === "spreadsheet"), X = r(() => u.value === "eml");
|
|
862
|
+
Ce(
|
|
845
863
|
() => [e.source, e.url, e.fileName, e.fileType],
|
|
846
864
|
() => {
|
|
847
|
-
|
|
865
|
+
v.value = "";
|
|
848
866
|
}
|
|
849
867
|
);
|
|
850
|
-
function
|
|
868
|
+
function oe() {
|
|
851
869
|
n("error", {
|
|
852
|
-
kind:
|
|
870
|
+
kind: u.value,
|
|
853
871
|
message: "文件预览失败"
|
|
854
872
|
});
|
|
855
873
|
}
|
|
856
|
-
async function
|
|
857
|
-
if (!
|
|
858
|
-
|
|
859
|
-
let
|
|
874
|
+
async function re() {
|
|
875
|
+
if (!y.value || C.value) return;
|
|
876
|
+
v.value = "", C.value = !0;
|
|
877
|
+
let Q = y.value, ee = !1;
|
|
860
878
|
try {
|
|
861
|
-
if (!/^(?:blob:|data:)/i.test(
|
|
862
|
-
const
|
|
863
|
-
if (!
|
|
864
|
-
|
|
879
|
+
if (!/^(?:blob:|data:)/i.test(Q)) {
|
|
880
|
+
const w = await fetch(Q);
|
|
881
|
+
if (!w.ok) throw new Error(`文件下载失败(${w.status})`);
|
|
882
|
+
Q = URL.createObjectURL(await w.blob()), ee = !0;
|
|
865
883
|
}
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
} catch (
|
|
869
|
-
|
|
870
|
-
kind:
|
|
871
|
-
message:
|
|
872
|
-
cause:
|
|
884
|
+
const a = document.createElement("a");
|
|
885
|
+
a.href = Q, a.download = c.value, a.rel = "noopener noreferrer", document.body.appendChild(a), a.click(), a.remove(), ee && window.setTimeout(() => URL.revokeObjectURL(Q), 0), n("download");
|
|
886
|
+
} catch (a) {
|
|
887
|
+
v.value = a instanceof Error ? a.message : "文件下载失败", n("error", {
|
|
888
|
+
kind: u.value,
|
|
889
|
+
message: v.value,
|
|
890
|
+
cause: a
|
|
873
891
|
});
|
|
874
892
|
} finally {
|
|
875
893
|
C.value = !1;
|
|
876
894
|
}
|
|
877
895
|
}
|
|
878
|
-
function
|
|
879
|
-
|
|
896
|
+
function we() {
|
|
897
|
+
h.value = document.fullscreenElement === f.value;
|
|
880
898
|
}
|
|
881
|
-
async function
|
|
882
|
-
const
|
|
883
|
-
if (
|
|
899
|
+
async function _e() {
|
|
900
|
+
const Q = f.value;
|
|
901
|
+
if (Q)
|
|
884
902
|
try {
|
|
885
|
-
document.fullscreenElement ===
|
|
886
|
-
} catch (
|
|
903
|
+
document.fullscreenElement === Q ? await document.exitFullscreen() : Q.requestFullscreen ? await Q.requestFullscreen() : h.value = !h.value;
|
|
904
|
+
} catch (ee) {
|
|
887
905
|
n("error", {
|
|
888
|
-
kind:
|
|
906
|
+
kind: u.value,
|
|
889
907
|
message: "无法切换全屏",
|
|
890
|
-
cause:
|
|
908
|
+
cause: ee
|
|
891
909
|
});
|
|
892
910
|
}
|
|
893
911
|
}
|
|
894
|
-
function
|
|
912
|
+
function Be(Q) {
|
|
895
913
|
return {
|
|
896
914
|
audio: "音频",
|
|
897
915
|
csv: "CSV",
|
|
@@ -907,159 +925,187 @@ const bo = ["aria-busy"], wo = {
|
|
|
907
925
|
unsupported: "文件",
|
|
908
926
|
video: "视频",
|
|
909
927
|
xml: "XML"
|
|
910
|
-
}[
|
|
928
|
+
}[Q];
|
|
911
929
|
}
|
|
912
|
-
return
|
|
913
|
-
document.addEventListener("fullscreenchange",
|
|
914
|
-
}),
|
|
915
|
-
document.removeEventListener("fullscreenchange",
|
|
930
|
+
return Oe(() => {
|
|
931
|
+
document.addEventListener("fullscreenchange", we);
|
|
932
|
+
}), Se(() => {
|
|
933
|
+
document.removeEventListener("fullscreenchange", we), document.fullscreenElement === f.value && document.exitFullscreen().catch(() => {
|
|
916
934
|
});
|
|
917
|
-
}), (
|
|
935
|
+
}), (Q, ee) => (i(), g("section", {
|
|
918
936
|
ref_key: "previewContainer",
|
|
919
|
-
ref:
|
|
920
|
-
class: ye([{ "yee-ui-file-preview--fullscreen":
|
|
921
|
-
style:
|
|
922
|
-
"aria-busy": s(
|
|
937
|
+
ref: f,
|
|
938
|
+
class: ye([{ "yee-ui-file-preview--fullscreen": h.value }, "yee-ui-file-preview"]),
|
|
939
|
+
style: ge(A.value),
|
|
940
|
+
"aria-busy": s(j)
|
|
923
941
|
}, [
|
|
924
|
-
o.showHeader &&
|
|
925
|
-
|
|
942
|
+
o.showHeader && m.value ? (i(), g("header", Ao, [
|
|
943
|
+
M("div", {
|
|
926
944
|
class: "yee-ui-file-preview__name",
|
|
927
|
-
title: s(
|
|
928
|
-
}, D(s(
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
title:
|
|
945
|
+
title: s(c)
|
|
946
|
+
}, D(s(c)), 9, jo),
|
|
947
|
+
M("div", Io, [
|
|
948
|
+
le(s(fe), {
|
|
949
|
+
title: h.value ? "退出全屏" : "进入全屏"
|
|
932
950
|
}, {
|
|
933
|
-
default:
|
|
934
|
-
|
|
935
|
-
"aria-label":
|
|
936
|
-
"aria-pressed":
|
|
951
|
+
default: F(() => [
|
|
952
|
+
M("button", {
|
|
953
|
+
"aria-label": h.value ? "退出全屏" : "进入全屏",
|
|
954
|
+
"aria-pressed": h.value,
|
|
937
955
|
class: "yee-ui-file-preview__header-action",
|
|
938
956
|
type: "button",
|
|
939
|
-
onClick:
|
|
957
|
+
onClick: _e
|
|
940
958
|
}, [
|
|
941
|
-
|
|
942
|
-
], 8,
|
|
959
|
+
h.value ? (i(), L(s(tt), { key: 0 })) : (i(), L(s(ot), { key: 1 }))
|
|
960
|
+
], 8, Uo)
|
|
943
961
|
]),
|
|
944
962
|
_: 1
|
|
945
963
|
}, 8, ["title"]),
|
|
946
|
-
o.showDownload ? (
|
|
964
|
+
o.showDownload ? (i(), L(s(fe), {
|
|
947
965
|
key: 0,
|
|
948
966
|
title: C.value ? "下载中..." : "下载"
|
|
949
967
|
}, {
|
|
950
|
-
default:
|
|
951
|
-
|
|
968
|
+
default: F(() => [
|
|
969
|
+
M("button", {
|
|
952
970
|
"aria-label": C.value ? "下载中" : "下载",
|
|
953
971
|
"aria-busy": C.value,
|
|
954
972
|
class: "yee-ui-file-preview__header-action",
|
|
955
973
|
disabled: C.value,
|
|
956
974
|
type: "button",
|
|
957
|
-
onClick:
|
|
958
|
-
|
|
975
|
+
onClick: ee[0] || (ee[0] = (a) => {
|
|
976
|
+
re();
|
|
959
977
|
})
|
|
960
978
|
}, [
|
|
961
|
-
|
|
962
|
-
], 8,
|
|
979
|
+
le(s(Xt))
|
|
980
|
+
], 8, Do)
|
|
963
981
|
]),
|
|
964
982
|
_: 1
|
|
965
983
|
}, 8, ["title"])) : z("", !0)
|
|
966
984
|
])
|
|
967
985
|
])) : z("", !0),
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
o.showDownload ? (
|
|
986
|
+
v.value ? (i(), g("div", Yo, D(v.value), 1)) : z("", !0),
|
|
987
|
+
m.value ? s(j) && !d.value && s(u) !== "docx" ? (i(), g("div", qo, "文件加载中...")) : s($) ? (i(), g("div", Go, [
|
|
988
|
+
M("span", null, D(s(p) || "文件预览失败"), 1),
|
|
989
|
+
o.showDownload ? (i(), g("button", {
|
|
972
990
|
key: 0,
|
|
973
991
|
class: "yee-ui-file-preview__retry",
|
|
974
992
|
type: "button",
|
|
975
|
-
onClick:
|
|
976
|
-
|
|
993
|
+
onClick: ee[1] || (ee[1] = (a) => {
|
|
994
|
+
re();
|
|
977
995
|
})
|
|
978
996
|
}, " 下载查看 ")) : z("", !0)
|
|
979
|
-
])) : s(
|
|
980
|
-
|
|
981
|
-
o.showDownload ? (
|
|
997
|
+
])) : s(B) ? (i(), g("div", Ko, [
|
|
998
|
+
M("span", null, "暂不支持预览 " + D(Be(s(u))) + " 文件", 1),
|
|
999
|
+
o.showDownload ? (i(), g("button", {
|
|
982
1000
|
key: 0,
|
|
983
1001
|
class: "yee-ui-file-preview__retry",
|
|
984
1002
|
type: "button",
|
|
985
|
-
onClick:
|
|
986
|
-
|
|
1003
|
+
onClick: ee[2] || (ee[2] = (a) => {
|
|
1004
|
+
re();
|
|
987
1005
|
})
|
|
988
1006
|
}, " 下载查看 ")) : z("", !0)
|
|
989
|
-
])) : s(
|
|
990
|
-
s(
|
|
1007
|
+
])) : s(q) || d.value || s(u) === "docx" ? (i(), g(ke, { key: 6 }, [
|
|
1008
|
+
s(u) === "image" ? (i(), g("img", {
|
|
991
1009
|
key: 0,
|
|
992
1010
|
class: "yee-ui-file-preview__image",
|
|
993
|
-
src: s(
|
|
1011
|
+
src: s(y),
|
|
994
1012
|
alt: o.alt,
|
|
995
|
-
onError:
|
|
996
|
-
}, null, 40,
|
|
1013
|
+
onError: oe
|
|
1014
|
+
}, null, 40, Jo)) : s(u) === "pdf" ? (i(), g("iframe", {
|
|
997
1015
|
key: 1,
|
|
998
1016
|
class: "yee-ui-file-preview__frame",
|
|
999
|
-
src: s(
|
|
1017
|
+
src: s(y),
|
|
1000
1018
|
title: o.alt,
|
|
1001
|
-
onError:
|
|
1002
|
-
}, null, 40,
|
|
1019
|
+
onError: oe
|
|
1020
|
+
}, null, 40, Qo)) : s(u) === "video" ? (i(), g("video", {
|
|
1003
1021
|
key: 2,
|
|
1004
1022
|
class: "yee-ui-file-preview__video",
|
|
1005
|
-
src: s(
|
|
1023
|
+
src: s(y),
|
|
1006
1024
|
controls: "",
|
|
1007
1025
|
preload: "metadata",
|
|
1008
|
-
onError:
|
|
1009
|
-
}, " 您的浏览器不支持视频预览,请下载查看。 ", 40,
|
|
1026
|
+
onError: oe
|
|
1027
|
+
}, " 您的浏览器不支持视频预览,请下载查看。 ", 40, Xo)) : s(u) === "audio" ? (i(), g("audio", {
|
|
1010
1028
|
key: 3,
|
|
1011
1029
|
class: "yee-ui-file-preview__audio",
|
|
1012
|
-
src: s(
|
|
1030
|
+
src: s(y),
|
|
1013
1031
|
controls: "",
|
|
1014
1032
|
preload: "metadata",
|
|
1015
|
-
onError:
|
|
1016
|
-
}, null, 40,
|
|
1033
|
+
onError: oe
|
|
1034
|
+
}, null, 40, Zo)) : s(u) === "text" || s(u) === "json" || s(u) === "xml" ? (i(), g("pre", en, D(s(G)), 1)) : s(u) === "markdown" ? (i(), g("article", {
|
|
1017
1035
|
key: 5,
|
|
1018
1036
|
class: "yee-ui-file-preview__markdown",
|
|
1019
|
-
innerHTML: s(
|
|
1020
|
-
}, null, 8,
|
|
1037
|
+
innerHTML: s(V)
|
|
1038
|
+
}, null, 8, tn)) : s(u) === "html" ? (i(), g("iframe", {
|
|
1021
1039
|
key: 6,
|
|
1022
1040
|
class: "yee-ui-file-preview__frame yee-ui-file-preview__frame--html",
|
|
1023
1041
|
srcdoc: s(N),
|
|
1024
1042
|
sandbox: "",
|
|
1025
1043
|
title: o.alt
|
|
1026
|
-
}, null, 8,
|
|
1044
|
+
}, null, 8, on)) : s(u) === "docx" ? (i(), g("div", {
|
|
1027
1045
|
key: 7,
|
|
1028
1046
|
ref_key: "docxContainer",
|
|
1029
|
-
ref:
|
|
1047
|
+
ref: _,
|
|
1030
1048
|
class: "yee-ui-file-preview__docx"
|
|
1031
|
-
}, null, 512)) :
|
|
1032
|
-
s(
|
|
1033
|
-
|
|
1034
|
-
(
|
|
1035
|
-
(
|
|
1036
|
-
key: `${
|
|
1037
|
-
}, D(
|
|
1049
|
+
}, null, 512)) : E.value ? (i(), g("div", nn, [
|
|
1050
|
+
s(I).length ? (i(), g("table", an, [
|
|
1051
|
+
M("tbody", null, [
|
|
1052
|
+
(i(!0), g(ke, null, he(s(I), (a, w) => (i(), g("tr", { key: w }, [
|
|
1053
|
+
(i(!0), g(ke, null, he(a.cells, (H, te) => (i(), g("td", {
|
|
1054
|
+
key: `${w}-${te}`
|
|
1055
|
+
}, D(H), 1))), 128))
|
|
1038
1056
|
]))), 128))
|
|
1039
1057
|
])
|
|
1040
|
-
])) : (
|
|
1041
|
-
s(
|
|
1042
|
-
])) :
|
|
1043
|
-
s(
|
|
1044
|
-
(
|
|
1045
|
-
key:
|
|
1058
|
+
])) : (i(), g("div", ln, "暂无可展示的数据")),
|
|
1059
|
+
s(k) ? (i(), g("div", sn, "预览内容已截断,可下载查看完整文件。")) : z("", !0)
|
|
1060
|
+
])) : X.value ? (i(), g("div", rn, [
|
|
1061
|
+
s(S).length ? (i(), g("dl", un, [
|
|
1062
|
+
(i(!0), g(ke, null, he(s(S), (a) => (i(), g(ke, {
|
|
1063
|
+
key: a.label
|
|
1046
1064
|
}, [
|
|
1047
|
-
|
|
1048
|
-
|
|
1065
|
+
M("dt", null, D(a.label), 1),
|
|
1066
|
+
M("dd", null, D(a.value), 1)
|
|
1049
1067
|
], 64))), 128))
|
|
1050
1068
|
])) : z("", !0),
|
|
1051
|
-
s(T) ? (
|
|
1069
|
+
s(T) ? (i(), g("iframe", {
|
|
1052
1070
|
key: 1,
|
|
1053
1071
|
class: "yee-ui-file-preview__frame yee-ui-file-preview__frame--email",
|
|
1054
1072
|
srcdoc: s(T),
|
|
1055
1073
|
sandbox: "",
|
|
1056
1074
|
title: o.alt
|
|
1057
|
-
}, null, 8,
|
|
1075
|
+
}, null, 8, cn)) : (i(), g("pre", dn, D(s(R) || "暂无可展示的邮件正文"), 1))
|
|
1058
1076
|
])) : z("", !0)
|
|
1059
|
-
], 64)) : z("", !0) : (
|
|
1060
|
-
], 14,
|
|
1077
|
+
], 64)) : z("", !0) : (i(), g("div", Wo, "请选择文件"))
|
|
1078
|
+
], 14, Lo));
|
|
1061
1079
|
}
|
|
1062
|
-
}),
|
|
1080
|
+
}), ua = /* @__PURE__ */ pe(fn, [["__scopeId", "data-v-49411d1f"]]), pn = {
|
|
1081
|
+
AutoComplete: Yt,
|
|
1082
|
+
Cascader: Dt,
|
|
1083
|
+
Checkbox: Ut,
|
|
1084
|
+
CheckboxGroup: It,
|
|
1085
|
+
DatePicker: jt,
|
|
1086
|
+
Input: At,
|
|
1087
|
+
InputNumber: Lt,
|
|
1088
|
+
InputPassword: Ht,
|
|
1089
|
+
Mentions: Nt,
|
|
1090
|
+
Radio: Pt,
|
|
1091
|
+
RadioGroup: zt,
|
|
1092
|
+
RangePicker: Vt,
|
|
1093
|
+
Rate: Ot,
|
|
1094
|
+
Segmented: Rt,
|
|
1095
|
+
Select: De,
|
|
1096
|
+
Slider: Mt,
|
|
1097
|
+
Switch: Et,
|
|
1098
|
+
Textarea: Ft,
|
|
1099
|
+
TimePicker: Bt,
|
|
1100
|
+
TimeRangePicker: $t,
|
|
1101
|
+
TreeSelect: Tt,
|
|
1102
|
+
Upload: Fo
|
|
1103
|
+
}, mn = {
|
|
1104
|
+
Checkbox: "checked",
|
|
1105
|
+
Radio: "checked",
|
|
1106
|
+
Switch: "checked",
|
|
1107
|
+
Upload: "fileList"
|
|
1108
|
+
}, vn = { class: "yee-ui-form__fields" }, yn = { class: "yee-ui-form__label" }, hn = { class: "yee-ui-form__actions" }, gn = /* @__PURE__ */ se({
|
|
1063
1109
|
name: "YeeForm",
|
|
1064
1110
|
__name: "YeeForm",
|
|
1065
1111
|
props: {
|
|
@@ -1069,121 +1115,137 @@ const bo = ["aria-busy"], wo = {
|
|
|
1069
1115
|
options: {}
|
|
1070
1116
|
},
|
|
1071
1117
|
setup(o) {
|
|
1072
|
-
const t = o, e =
|
|
1118
|
+
const t = o, e = O(t.options.collapsed ?? !0);
|
|
1073
1119
|
t.api.configure(t.options);
|
|
1074
|
-
const
|
|
1075
|
-
function
|
|
1076
|
-
return t.api.getFieldValue(
|
|
1120
|
+
const n = r(() => t.api.schema.value.filter((c) => !c.hide));
|
|
1121
|
+
function f(c) {
|
|
1122
|
+
return t.api.getFieldValue(c.fieldName);
|
|
1123
|
+
}
|
|
1124
|
+
function _(c) {
|
|
1125
|
+
return c !== "Custom";
|
|
1077
1126
|
}
|
|
1078
|
-
function
|
|
1079
|
-
|
|
1127
|
+
function h(c) {
|
|
1128
|
+
return _(c.component) ? pn[c.component] : void 0;
|
|
1129
|
+
}
|
|
1130
|
+
function v(c) {
|
|
1131
|
+
return _(c.component) ? mn[c.component] ?? "value" : "value";
|
|
1132
|
+
}
|
|
1133
|
+
function C(c) {
|
|
1134
|
+
const N = f(c), $ = v(c);
|
|
1080
1135
|
return {
|
|
1081
|
-
...
|
|
1082
|
-
...
|
|
1136
|
+
...c.componentProps,
|
|
1137
|
+
...N === void 0 ? {} : { [$]: N },
|
|
1138
|
+
[`onUpdate:${$}`]: (j) => y(c, j)
|
|
1083
1139
|
};
|
|
1084
1140
|
}
|
|
1085
|
-
function
|
|
1086
|
-
t.api.setFieldValue(
|
|
1141
|
+
function y(c, N) {
|
|
1142
|
+
t.api.setFieldValue(
|
|
1143
|
+
c.fieldName,
|
|
1144
|
+
N
|
|
1145
|
+
), t.options.submitOnChange && S();
|
|
1087
1146
|
}
|
|
1088
|
-
async function
|
|
1147
|
+
async function T() {
|
|
1089
1148
|
t.api.resetForm(), await t.onReset?.();
|
|
1090
1149
|
}
|
|
1091
|
-
async function
|
|
1150
|
+
async function S() {
|
|
1092
1151
|
await t.onSubmit?.(t.api.getValues());
|
|
1093
1152
|
}
|
|
1094
|
-
function
|
|
1095
|
-
|
|
1153
|
+
function R(c) {
|
|
1154
|
+
c.key === "Enter" && t.options.submitOnEnter && (c.preventDefault(), S());
|
|
1096
1155
|
}
|
|
1097
|
-
function
|
|
1098
|
-
|
|
1156
|
+
function p() {
|
|
1157
|
+
e.value = !e.value, t.options.handleCollapsedChange?.(e.value);
|
|
1099
1158
|
}
|
|
1100
|
-
return (
|
|
1159
|
+
return (c, N) => (i(), g("form", {
|
|
1101
1160
|
class: "yee-ui-form",
|
|
1102
|
-
onKeydown:
|
|
1103
|
-
onSubmit: yt(
|
|
1161
|
+
onKeydown: R,
|
|
1162
|
+
onSubmit: yt(S, ["prevent"])
|
|
1104
1163
|
}, [
|
|
1105
|
-
|
|
1106
|
-
(
|
|
1107
|
-
key:
|
|
1164
|
+
M("div", vn, [
|
|
1165
|
+
(i(!0), g(ke, null, he(n.value, ($) => (i(), g("label", {
|
|
1166
|
+
key: $.fieldName,
|
|
1108
1167
|
class: "yee-ui-form__field"
|
|
1109
1168
|
}, [
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
key: 2,
|
|
1123
|
-
ref_for: !0
|
|
1124
|
-
}, p(w), {
|
|
1125
|
-
"onUpdate:value": (N) => m(w, N)
|
|
1126
|
-
}), null, 16, ["onUpdate:value"]))
|
|
1169
|
+
M("span", yn, D($.label), 1),
|
|
1170
|
+
Y(c.$slots, $.fieldName, {
|
|
1171
|
+
field: $,
|
|
1172
|
+
setValue: (j) => y($, j),
|
|
1173
|
+
value: f($),
|
|
1174
|
+
values: o.api.getValues()
|
|
1175
|
+
}, () => [
|
|
1176
|
+
$.component !== "Custom" ? (i(), L(ht(h($)), ie({
|
|
1177
|
+
key: 0,
|
|
1178
|
+
ref_for: !0
|
|
1179
|
+
}, C($)), null, 16)) : z("", !0)
|
|
1180
|
+
], !0)
|
|
1127
1181
|
]))), 128))
|
|
1128
1182
|
]),
|
|
1129
|
-
|
|
1130
|
-
|
|
1183
|
+
M("div", hn, [
|
|
1184
|
+
le(s(de), {
|
|
1131
1185
|
"html-type": "button",
|
|
1132
|
-
onClick:
|
|
1186
|
+
onClick: T
|
|
1133
1187
|
}, {
|
|
1134
|
-
default:
|
|
1135
|
-
|
|
1188
|
+
default: F(() => [...N[0] || (N[0] = [
|
|
1189
|
+
ce(" 重置 ", -1)
|
|
1136
1190
|
])]),
|
|
1137
1191
|
_: 1
|
|
1138
1192
|
}),
|
|
1139
|
-
|
|
1193
|
+
le(s(de), {
|
|
1140
1194
|
type: "primary",
|
|
1141
1195
|
"html-type": "submit"
|
|
1142
1196
|
}, {
|
|
1143
|
-
default:
|
|
1144
|
-
|
|
1197
|
+
default: F(() => [...N[1] || (N[1] = [
|
|
1198
|
+
ce(" 查询 ", -1)
|
|
1145
1199
|
])]),
|
|
1146
1200
|
_: 1
|
|
1147
1201
|
}),
|
|
1148
|
-
o.options.showCollapseButton ? (
|
|
1202
|
+
o.options.showCollapseButton ? (i(), L(s(de), {
|
|
1149
1203
|
key: 0,
|
|
1150
1204
|
type: "link",
|
|
1151
1205
|
"html-type": "button",
|
|
1152
|
-
onClick:
|
|
1206
|
+
onClick: p
|
|
1153
1207
|
}, {
|
|
1154
|
-
default:
|
|
1155
|
-
|
|
1208
|
+
default: F(() => [
|
|
1209
|
+
ce(D(e.value ? "展开" : "收起"), 1)
|
|
1156
1210
|
]),
|
|
1157
1211
|
_: 1
|
|
1158
1212
|
})) : z("", !0)
|
|
1159
1213
|
])
|
|
1160
1214
|
], 32));
|
|
1161
1215
|
}
|
|
1162
|
-
}),
|
|
1163
|
-
class
|
|
1164
|
-
|
|
1216
|
+
}), bn = /* @__PURE__ */ pe(gn, [["__scopeId", "data-v-5bc69f74"]]);
|
|
1217
|
+
class wn {
|
|
1218
|
+
/** 当前表单 Schema,由组件初始化,可通过 updateSchema 动态更新。 */
|
|
1219
|
+
schema = O([]);
|
|
1165
1220
|
initialValues = {};
|
|
1166
|
-
values =
|
|
1221
|
+
values = Ue({});
|
|
1222
|
+
/** @internal 使用配置初始化 Schema 和字段值。 */
|
|
1167
1223
|
configure(t) {
|
|
1168
1224
|
this.schema.value = t.schema.map((e) => ({ ...e })), this.initialValues = { ...t.initialValues }, this.resetForm();
|
|
1169
1225
|
}
|
|
1226
|
+
/** 获取指定字段值,并保留 TValues 中声明的字段类型。 */
|
|
1170
1227
|
getFieldValue(t) {
|
|
1171
1228
|
return this.values[t];
|
|
1172
1229
|
}
|
|
1230
|
+
/** 获取当前全部字段值的浅拷贝。 */
|
|
1173
1231
|
getValues() {
|
|
1174
1232
|
return { ...this.values };
|
|
1175
1233
|
}
|
|
1234
|
+
/** 将字段值恢复为 initialValues。 */
|
|
1176
1235
|
resetForm() {
|
|
1177
1236
|
for (const t of Object.keys(this.values))
|
|
1178
1237
|
delete this.values[t];
|
|
1179
1238
|
Object.assign(this.values, this.initialValues);
|
|
1180
1239
|
}
|
|
1240
|
+
/** 设置指定字段值,字段名和值必须与 TValues 保持一致。 */
|
|
1181
1241
|
setFieldValue(t, e) {
|
|
1182
1242
|
this.values[t] = e;
|
|
1183
1243
|
}
|
|
1244
|
+
/** 批量更新已声明字段的值。 */
|
|
1184
1245
|
setValues(t) {
|
|
1185
1246
|
Object.assign(this.values, t);
|
|
1186
1247
|
}
|
|
1248
|
+
/** 按字段名动态更新 Schema。 */
|
|
1187
1249
|
updateSchema(t) {
|
|
1188
1250
|
const e = new Map(t.map((n) => [n.fieldName, n]));
|
|
1189
1251
|
this.schema.value = this.schema.value.map((n) => ({
|
|
@@ -1192,19 +1254,26 @@ class Qo {
|
|
|
1192
1254
|
}));
|
|
1193
1255
|
}
|
|
1194
1256
|
}
|
|
1195
|
-
class
|
|
1196
|
-
|
|
1257
|
+
class _n {
|
|
1258
|
+
/** 查询表单控制器。 */
|
|
1259
|
+
formApi = new wn();
|
|
1260
|
+
/** 查询表单当前是否可见。 */
|
|
1197
1261
|
searchFormVisible;
|
|
1262
|
+
/** 当前 Grid 初始化配置。 */
|
|
1198
1263
|
state;
|
|
1199
1264
|
grid;
|
|
1200
1265
|
constructor(t) {
|
|
1201
|
-
this.state =
|
|
1266
|
+
this.state = O(t), this.searchFormVisible = O(t.showSearchForm ?? !0);
|
|
1202
1267
|
}
|
|
1268
|
+
/** @internal 由 YeeGrid 挂载底层 VXE Grid 实例。 */
|
|
1203
1269
|
mount(t) {
|
|
1204
1270
|
this.grid = t;
|
|
1205
1271
|
}
|
|
1272
|
+
/** 保留当前页码并执行查询,可在查询前合并表单值。 */
|
|
1206
1273
|
query = async (t) => (t && this.formApi.setValues(t), this.grid?.commitProxy("query"));
|
|
1274
|
+
/** 回到第一页并重新查询,可在查询前合并表单值。 */
|
|
1207
1275
|
reload = async (t) => (t && this.formApi.setValues(t), this.grid?.commitProxy("reload"));
|
|
1276
|
+
/** 合并更新 VXE Grid 配置。 */
|
|
1208
1277
|
setGridOptions(t) {
|
|
1209
1278
|
this.setState({
|
|
1210
1279
|
gridOptions: {
|
|
@@ -1213,23 +1282,27 @@ class Xo {
|
|
|
1213
1282
|
}
|
|
1214
1283
|
});
|
|
1215
1284
|
}
|
|
1285
|
+
/** 设置表格加载状态。 */
|
|
1216
1286
|
setLoading(t) {
|
|
1217
1287
|
this.setGridOptions({ loading: t });
|
|
1218
1288
|
}
|
|
1289
|
+
/** 合并更新 useYeeGrid 初始化配置。 */
|
|
1219
1290
|
setState(t) {
|
|
1220
1291
|
this.state.value = {
|
|
1221
1292
|
...this.state.value,
|
|
1222
1293
|
...t
|
|
1223
1294
|
};
|
|
1224
1295
|
}
|
|
1296
|
+
/** 切换查询表单显隐,并返回切换后的状态。 */
|
|
1225
1297
|
toggleSearchForm(t) {
|
|
1226
1298
|
return this.searchFormVisible.value = t ?? !this.searchFormVisible.value, this.searchFormVisible.value;
|
|
1227
1299
|
}
|
|
1300
|
+
/** @internal 清理底层 VXE Grid 实例引用。 */
|
|
1228
1301
|
unmount() {
|
|
1229
1302
|
this.grid = void 0;
|
|
1230
1303
|
}
|
|
1231
1304
|
}
|
|
1232
|
-
const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"),
|
|
1305
|
+
const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), xn = /* @__PURE__ */ se({
|
|
1233
1306
|
inheritAttrs: !1,
|
|
1234
1307
|
name: "VxeTooltip",
|
|
1235
1308
|
__name: "YeeGridTooltip",
|
|
@@ -1255,114 +1328,114 @@ const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), Zo = /* @__PU
|
|
|
1255
1328
|
},
|
|
1256
1329
|
emits: ["update:modelValue"],
|
|
1257
1330
|
setup(o, { expose: t, emit: e }) {
|
|
1258
|
-
const n = o,
|
|
1259
|
-
let
|
|
1260
|
-
function
|
|
1261
|
-
if (!(
|
|
1262
|
-
return typeof
|
|
1263
|
-
}
|
|
1264
|
-
const
|
|
1265
|
-
const
|
|
1266
|
-
return !
|
|
1267
|
-
height: `${Math.max(
|
|
1268
|
-
left: `${
|
|
1331
|
+
const n = o, f = e, _ = fe, h = Ue({ visible: !1 }), v = be("tooltip"), C = O(), y = O(""), T = O(), S = O(!1);
|
|
1332
|
+
let R;
|
|
1333
|
+
function p(d) {
|
|
1334
|
+
if (!(d === void 0 || d === ""))
|
|
1335
|
+
return typeof d == "number" ? `${d}px` : d;
|
|
1336
|
+
}
|
|
1337
|
+
const c = r(() => {
|
|
1338
|
+
const d = C.value;
|
|
1339
|
+
return !d || !h.visible ? { display: "none" } : {
|
|
1340
|
+
height: `${Math.max(d.height, 1)}px`,
|
|
1341
|
+
left: `${d.left}px`,
|
|
1269
1342
|
pointerEvents: "none",
|
|
1270
1343
|
position: "fixed",
|
|
1271
|
-
top: `${
|
|
1272
|
-
width: `${Math.max(
|
|
1344
|
+
top: `${d.top}px`,
|
|
1345
|
+
width: `${Math.max(d.width, 1)}px`
|
|
1273
1346
|
};
|
|
1274
|
-
}), N =
|
|
1347
|
+
}), N = r(() => ({
|
|
1275
1348
|
cursor: n.enterable ? "text" : void 0,
|
|
1276
|
-
height:
|
|
1277
|
-
maxHeight:
|
|
1278
|
-
maxWidth:
|
|
1279
|
-
minHeight:
|
|
1280
|
-
minWidth:
|
|
1349
|
+
height: p(n.height),
|
|
1350
|
+
maxHeight: p(n.maxHeight),
|
|
1351
|
+
maxWidth: p(n.maxWidth),
|
|
1352
|
+
minHeight: p(n.minHeight),
|
|
1353
|
+
minWidth: p(n.minWidth),
|
|
1281
1354
|
userSelect: n.enterable ? "text" : void 0,
|
|
1282
|
-
width:
|
|
1283
|
-
})),
|
|
1355
|
+
width: p(n.width)
|
|
1356
|
+
})), $ = r(() => ({
|
|
1284
1357
|
...n.popupClassName ? { overlayClassName: n.popupClassName } : {},
|
|
1285
1358
|
...n.zIndex === void 0 ? {} : { zIndex: Number(n.zIndex) }
|
|
1286
1359
|
}));
|
|
1287
|
-
function
|
|
1288
|
-
return
|
|
1360
|
+
function j(d) {
|
|
1361
|
+
return d.closest("body") ?? document.body;
|
|
1289
1362
|
}
|
|
1290
|
-
function
|
|
1291
|
-
return
|
|
1363
|
+
function q(d) {
|
|
1364
|
+
return d || (typeof n.selector == "string" ? document.querySelector(n.selector) ?? void 0 : n.selector);
|
|
1292
1365
|
}
|
|
1293
|
-
function
|
|
1294
|
-
const
|
|
1295
|
-
if (!
|
|
1296
|
-
return
|
|
1297
|
-
const
|
|
1366
|
+
function B() {
|
|
1367
|
+
const d = T.value;
|
|
1368
|
+
if (!d?.isConnected)
|
|
1369
|
+
return I();
|
|
1370
|
+
const E = d.getBoundingClientRect();
|
|
1298
1371
|
return C.value = {
|
|
1299
|
-
height:
|
|
1300
|
-
left:
|
|
1301
|
-
top:
|
|
1302
|
-
width:
|
|
1303
|
-
}, Te(() =>
|
|
1372
|
+
height: E.height,
|
|
1373
|
+
left: E.left,
|
|
1374
|
+
top: E.top,
|
|
1375
|
+
width: E.width
|
|
1376
|
+
}, Te(() => v.value?.forcePopupAlign?.());
|
|
1304
1377
|
}
|
|
1305
|
-
function
|
|
1306
|
-
const
|
|
1307
|
-
return
|
|
1378
|
+
function u(d, E) {
|
|
1379
|
+
const X = q(d);
|
|
1380
|
+
return X ? (T.value = X, y.value = E ?? n.content ?? "", S.value = !0, h.visible = !0, f("update:modelValue", !0), B()) : Te();
|
|
1308
1381
|
}
|
|
1309
|
-
function
|
|
1310
|
-
const
|
|
1311
|
-
return
|
|
1382
|
+
function V(d, E, X) {
|
|
1383
|
+
const oe = d.currentTarget instanceof HTMLElement ? d.currentTarget : void 0;
|
|
1384
|
+
return u(E ?? oe, X);
|
|
1312
1385
|
}
|
|
1313
|
-
function
|
|
1314
|
-
return
|
|
1386
|
+
function I() {
|
|
1387
|
+
return S.value = !1, T.value = void 0, C.value = void 0, h.visible = !1, f("update:modelValue", !1), Te();
|
|
1315
1388
|
}
|
|
1316
|
-
function
|
|
1317
|
-
|
|
1389
|
+
function G(d) {
|
|
1390
|
+
d && R && (clearTimeout(R), R = void 0), S.value = d;
|
|
1318
1391
|
}
|
|
1319
|
-
function
|
|
1320
|
-
return
|
|
1392
|
+
function k() {
|
|
1393
|
+
return S.value;
|
|
1321
1394
|
}
|
|
1322
|
-
function
|
|
1323
|
-
|
|
1395
|
+
function A() {
|
|
1396
|
+
h.visible && B();
|
|
1324
1397
|
}
|
|
1325
|
-
function
|
|
1326
|
-
|
|
1327
|
-
|
|
1398
|
+
function m() {
|
|
1399
|
+
G(!1), n.enterable && (R = setTimeout(() => {
|
|
1400
|
+
R = void 0, S.value || I();
|
|
1328
1401
|
}, n.leaveDelay ?? 0));
|
|
1329
1402
|
}
|
|
1330
|
-
return
|
|
1331
|
-
window.addEventListener("resize",
|
|
1332
|
-
}),
|
|
1333
|
-
|
|
1403
|
+
return Oe(() => {
|
|
1404
|
+
window.addEventListener("resize", A), window.addEventListener("scroll", A, !0), n.modelValue && u(void 0, n.content);
|
|
1405
|
+
}), Se(() => {
|
|
1406
|
+
R && clearTimeout(R), window.removeEventListener("resize", A), window.removeEventListener("scroll", A, !0);
|
|
1334
1407
|
}), t({
|
|
1335
|
-
close:
|
|
1336
|
-
isActived:
|
|
1337
|
-
open:
|
|
1338
|
-
openByEvent:
|
|
1339
|
-
reactData:
|
|
1340
|
-
setActived:
|
|
1341
|
-
toVisible:
|
|
1342
|
-
updatePlacement:
|
|
1343
|
-
}), (
|
|
1408
|
+
close: I,
|
|
1409
|
+
isActived: k,
|
|
1410
|
+
open: u,
|
|
1411
|
+
openByEvent: V,
|
|
1412
|
+
reactData: h,
|
|
1413
|
+
setActived: G,
|
|
1414
|
+
toVisible: u,
|
|
1415
|
+
updatePlacement: B
|
|
1416
|
+
}), (d, E) => (i(), L(s(_), ie({ ref: "tooltip" }, $.value, {
|
|
1344
1417
|
arrow: n.isArrow !== !1,
|
|
1345
|
-
"get-popup-container":
|
|
1346
|
-
open:
|
|
1418
|
+
"get-popup-container": j,
|
|
1419
|
+
open: h.visible,
|
|
1347
1420
|
"overlay-inner-style": N.value,
|
|
1348
1421
|
placement: "top"
|
|
1349
1422
|
}), {
|
|
1350
|
-
title:
|
|
1351
|
-
|
|
1423
|
+
title: F(() => [
|
|
1424
|
+
M("div", {
|
|
1352
1425
|
class: "yee-ui-grid-tooltip-content",
|
|
1353
|
-
onMouseenter:
|
|
1354
|
-
onMouseleave:
|
|
1426
|
+
onMouseenter: E[0] || (E[0] = (X) => n.enterable && G(!0)),
|
|
1427
|
+
onMouseleave: m
|
|
1355
1428
|
}, [
|
|
1356
|
-
|
|
1357
|
-
|
|
1429
|
+
Y(d.$slots, "content", {}, () => [
|
|
1430
|
+
ce(D(y.value), 1)
|
|
1358
1431
|
])
|
|
1359
1432
|
], 32)
|
|
1360
1433
|
]),
|
|
1361
|
-
default:
|
|
1362
|
-
|
|
1434
|
+
default: F(() => [
|
|
1435
|
+
M("span", {
|
|
1363
1436
|
"aria-hidden": "true",
|
|
1364
1437
|
class: "yee-ui-grid-tooltip-anchor",
|
|
1365
|
-
style:
|
|
1438
|
+
style: ge(c.value)
|
|
1366
1439
|
}, null, 4)
|
|
1367
1440
|
]),
|
|
1368
1441
|
_: 3
|
|
@@ -1370,52 +1443,52 @@ const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), Zo = /* @__PU
|
|
|
1370
1443
|
}
|
|
1371
1444
|
});
|
|
1372
1445
|
let Je = !1;
|
|
1373
|
-
const
|
|
1374
|
-
function
|
|
1375
|
-
const o =
|
|
1376
|
-
|
|
1377
|
-
const
|
|
1378
|
-
if ((typeof
|
|
1379
|
-
const
|
|
1380
|
-
if (
|
|
1381
|
-
const C = typeof
|
|
1382
|
-
return
|
|
1446
|
+
const Ie = /* @__PURE__ */ new Set();
|
|
1447
|
+
function kn() {
|
|
1448
|
+
const o = Me.modal.confirm.bind(Me.modal);
|
|
1449
|
+
Me.modal.confirm = ((t, e, n) => {
|
|
1450
|
+
const f = typeof t == "object" && t !== null ? t : typeof n == "object" && n !== null ? n : void 0;
|
|
1451
|
+
if ((typeof f?.className == "string" ? f.className.split(/\s+/) : []).includes("vxe-table--ignore-clear")) {
|
|
1452
|
+
const h = [...Ie], v = h[h.length - 1];
|
|
1453
|
+
if (v) {
|
|
1454
|
+
const C = typeof f?.content == "string" ? f.content : String(f?.content ?? t);
|
|
1455
|
+
return v(C);
|
|
1383
1456
|
}
|
|
1384
1457
|
}
|
|
1385
1458
|
return o(t, e, n);
|
|
1386
1459
|
});
|
|
1387
1460
|
}
|
|
1388
|
-
function
|
|
1389
|
-
return
|
|
1461
|
+
function Cn(o) {
|
|
1462
|
+
return Ie.add(o), () => Ie.delete(o);
|
|
1390
1463
|
}
|
|
1391
1464
|
function it() {
|
|
1392
1465
|
if (Je) return;
|
|
1393
1466
|
[
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1467
|
+
eo,
|
|
1468
|
+
to,
|
|
1469
|
+
oo,
|
|
1397
1470
|
nt,
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
].forEach((t) =>
|
|
1471
|
+
no,
|
|
1472
|
+
ao,
|
|
1473
|
+
lo,
|
|
1474
|
+
io,
|
|
1475
|
+
so,
|
|
1476
|
+
ro,
|
|
1477
|
+
uo,
|
|
1478
|
+
co,
|
|
1479
|
+
fo,
|
|
1480
|
+
po,
|
|
1481
|
+
mo,
|
|
1482
|
+
xn
|
|
1483
|
+
].forEach((t) => Me.component(t)), kn(), Je = !0;
|
|
1411
1484
|
}
|
|
1412
|
-
const
|
|
1485
|
+
const Sn = {
|
|
1413
1486
|
key: 1,
|
|
1414
1487
|
class: "yee-ui-grid__separator"
|
|
1415
|
-
},
|
|
1488
|
+
}, Tn = { class: "yee-ui-grid__table-container" }, $n = {
|
|
1416
1489
|
key: 0,
|
|
1417
1490
|
class: "yee-ui-grid__title"
|
|
1418
|
-
},
|
|
1491
|
+
}, Bn = /* @__PURE__ */ se({
|
|
1419
1492
|
name: "YeeGrid",
|
|
1420
1493
|
__name: "YeeGrid",
|
|
1421
1494
|
props: {
|
|
@@ -1424,28 +1497,28 @@ const on = {
|
|
|
1424
1497
|
tableTitleHelp: {}
|
|
1425
1498
|
},
|
|
1426
1499
|
setup(o) {
|
|
1427
|
-
const t = o, e = ze(), n =
|
|
1500
|
+
const t = o, e = ze(), n = be("gridRef"), f = Ve(Pe), _ = Ve(lt, void 0), [h, v] = et.useModal();
|
|
1428
1501
|
it();
|
|
1429
|
-
const C =
|
|
1430
|
-
|
|
1502
|
+
const C = Cn((B) => new Promise((u) => {
|
|
1503
|
+
h.confirm({
|
|
1431
1504
|
title: "恢复默认列配置",
|
|
1432
|
-
content:
|
|
1505
|
+
content: B,
|
|
1433
1506
|
centered: !0,
|
|
1434
1507
|
okText: "确认",
|
|
1435
1508
|
cancelText: "取消",
|
|
1436
1509
|
keyboard: !0,
|
|
1437
1510
|
wrapClassName: "vxe-table--ignore-clear",
|
|
1438
|
-
onOk: () =>
|
|
1439
|
-
onCancel: () =>
|
|
1511
|
+
onOk: () => u("confirm"),
|
|
1512
|
+
onCancel: () => u("cancel")
|
|
1440
1513
|
});
|
|
1441
|
-
})),
|
|
1514
|
+
})), y = r(() => t.api.state.value), T = r(() => y.value.formOptions), S = r(() => !!(t.tableTitle || e["table-title"] || e["toolbar-actions"] || e["toolbar-tools"])), R = r(() => Object.keys(e).filter((B) => ![
|
|
1442
1515
|
"empty",
|
|
1443
1516
|
"loading",
|
|
1444
1517
|
"table-title",
|
|
1445
1518
|
"toolbar-actions",
|
|
1446
1519
|
"toolbar-tools"
|
|
1447
|
-
].includes(
|
|
1448
|
-
const
|
|
1520
|
+
].includes(B))), p = r(() => _?.value ?? !1), c = r(() => {
|
|
1521
|
+
const B = y.value.gridOptions, u = B.proxyConfig, V = u?.ajax?.query, I = B.toolbarConfig, G = B.pagerConfig;
|
|
1449
1522
|
return {
|
|
1450
1523
|
align: "left",
|
|
1451
1524
|
border: "inner",
|
|
@@ -1453,111 +1526,111 @@ const on = {
|
|
|
1453
1526
|
showHeaderOverflow: "tooltip",
|
|
1454
1527
|
showOverflow: "tooltip",
|
|
1455
1528
|
size: "medium",
|
|
1456
|
-
...
|
|
1457
|
-
...
|
|
1529
|
+
...p.value ? { height: "auto" } : {},
|
|
1530
|
+
...B,
|
|
1458
1531
|
columnConfig: {
|
|
1459
1532
|
resizable: !0,
|
|
1460
|
-
...
|
|
1533
|
+
...B.columnConfig
|
|
1461
1534
|
},
|
|
1462
1535
|
tooltipConfig: {
|
|
1463
1536
|
enterable: !0,
|
|
1464
1537
|
leaveDelay: 300,
|
|
1465
|
-
...
|
|
1538
|
+
...B.tooltipConfig
|
|
1466
1539
|
},
|
|
1467
|
-
...
|
|
1540
|
+
...G ? {
|
|
1468
1541
|
pagerConfig: {
|
|
1469
1542
|
pageSize: 20,
|
|
1470
1543
|
pageSizes: [10, 20, 30, 50, 100, 200],
|
|
1471
1544
|
layouts: ["Total", "Sizes", "Home", "PrevPage", "Number", "NextPage", "End"],
|
|
1472
|
-
...
|
|
1545
|
+
...G,
|
|
1473
1546
|
slots: {
|
|
1474
1547
|
sizes: "pagerSizes",
|
|
1475
|
-
...
|
|
1548
|
+
...G.slots
|
|
1476
1549
|
}
|
|
1477
1550
|
}
|
|
1478
1551
|
} : {},
|
|
1479
|
-
...
|
|
1552
|
+
...u ? {
|
|
1480
1553
|
proxyConfig: {
|
|
1481
1554
|
autoLoad: !0,
|
|
1482
1555
|
showResponseMsg: !1,
|
|
1483
|
-
...
|
|
1556
|
+
...u,
|
|
1484
1557
|
response: {
|
|
1485
1558
|
list: "items",
|
|
1486
1559
|
result: "items",
|
|
1487
1560
|
total: "total",
|
|
1488
|
-
...
|
|
1561
|
+
...u.response
|
|
1489
1562
|
},
|
|
1490
|
-
...
|
|
1563
|
+
...u.ajax ? {
|
|
1491
1564
|
ajax: {
|
|
1492
|
-
...
|
|
1493
|
-
...
|
|
1494
|
-
query: (
|
|
1565
|
+
...u.ajax,
|
|
1566
|
+
...V ? {
|
|
1567
|
+
query: (k) => V(k, t.api.formApi.getValues())
|
|
1495
1568
|
} : {}
|
|
1496
1569
|
}
|
|
1497
1570
|
} : {}
|
|
1498
1571
|
}
|
|
1499
1572
|
} : {},
|
|
1500
|
-
...
|
|
1573
|
+
...I || S.value ? {
|
|
1501
1574
|
toolbarConfig: {
|
|
1502
1575
|
custom: !0,
|
|
1503
1576
|
refresh: !0,
|
|
1504
1577
|
zoom: !0,
|
|
1505
|
-
...
|
|
1578
|
+
...I,
|
|
1506
1579
|
slots: {
|
|
1507
1580
|
...t.tableTitle || e["table-title"] || e["toolbar-actions"] ? { buttons: "toolbarActions" } : {},
|
|
1508
|
-
...e["toolbar-tools"] ||
|
|
1581
|
+
...e["toolbar-tools"] || I?.search ? { tools: "toolbarTools" } : {}
|
|
1509
1582
|
}
|
|
1510
1583
|
}
|
|
1511
1584
|
} : {}
|
|
1512
1585
|
};
|
|
1513
|
-
}), N =
|
|
1514
|
-
|
|
1515
|
-
() =>
|
|
1516
|
-
(
|
|
1586
|
+
}), N = r(() => y.value.gridEvents ?? {});
|
|
1587
|
+
Ce(
|
|
1588
|
+
() => f?.value.mode ?? "light",
|
|
1589
|
+
(B) => Me.setTheme(B),
|
|
1517
1590
|
{ immediate: !0 }
|
|
1518
1591
|
);
|
|
1519
|
-
async function
|
|
1592
|
+
async function $() {
|
|
1520
1593
|
await t.api.reload();
|
|
1521
1594
|
}
|
|
1522
|
-
async function
|
|
1595
|
+
async function j() {
|
|
1523
1596
|
await t.api.reload();
|
|
1524
1597
|
}
|
|
1525
|
-
function
|
|
1526
|
-
typeof
|
|
1598
|
+
function q(B, u) {
|
|
1599
|
+
typeof u != "number" && typeof u != "string" || B.setPageSizeByEvent(new Event("change"), u);
|
|
1527
1600
|
}
|
|
1528
|
-
return
|
|
1601
|
+
return Oe(() => {
|
|
1529
1602
|
n.value && t.api.mount(n.value);
|
|
1530
|
-
}),
|
|
1603
|
+
}), gt(() => {
|
|
1531
1604
|
C(), t.api.unmount();
|
|
1532
|
-
}), (
|
|
1533
|
-
class: ye(["yee-ui-grid", { "yee-ui-grid--fill-page-content":
|
|
1605
|
+
}), (B, u) => (i(), g("section", {
|
|
1606
|
+
class: ye(["yee-ui-grid", { "yee-ui-grid--fill-page-content": p.value }])
|
|
1534
1607
|
}, [
|
|
1535
|
-
T.value ?
|
|
1608
|
+
T.value ? bt((i(), L(bn, {
|
|
1536
1609
|
key: 0,
|
|
1537
1610
|
api: o.api.formApi,
|
|
1538
1611
|
options: T.value,
|
|
1539
|
-
"on-reset":
|
|
1540
|
-
"on-submit":
|
|
1612
|
+
"on-reset": j,
|
|
1613
|
+
"on-submit": $
|
|
1541
1614
|
}, null, 8, ["api", "options"])), [
|
|
1542
|
-
[
|
|
1615
|
+
[wt, o.api.searchFormVisible.value]
|
|
1543
1616
|
]) : z("", !0),
|
|
1544
|
-
T.value &&
|
|
1545
|
-
|
|
1546
|
-
|
|
1617
|
+
T.value && y.value.separator !== !1 ? (i(), g("div", Sn)) : z("", !0),
|
|
1618
|
+
M("div", Tn, [
|
|
1619
|
+
le(s(nt), ie({
|
|
1547
1620
|
ref_key: "gridRef",
|
|
1548
1621
|
ref: n,
|
|
1549
1622
|
class: "yee-ui-grid__table"
|
|
1550
|
-
},
|
|
1551
|
-
toolbarActions:
|
|
1552
|
-
|
|
1553
|
-
o.tableTitle ? (
|
|
1554
|
-
|
|
1555
|
-
o.tableTitleHelp ? (
|
|
1623
|
+
}, c.value, _t(N.value)), Re({
|
|
1624
|
+
toolbarActions: F((V) => [
|
|
1625
|
+
Y(B.$slots, "table-title", {}, () => [
|
|
1626
|
+
o.tableTitle ? (i(), g("div", $n, [
|
|
1627
|
+
ce(D(o.tableTitle) + " ", 1),
|
|
1628
|
+
o.tableTitleHelp ? (i(), L(s(fe), {
|
|
1556
1629
|
key: 0,
|
|
1557
1630
|
title: o.tableTitleHelp
|
|
1558
1631
|
}, {
|
|
1559
|
-
default:
|
|
1560
|
-
|
|
1632
|
+
default: F(() => [...u[0] || (u[0] = [
|
|
1633
|
+
M("span", {
|
|
1561
1634
|
class: "yee-ui-grid__help",
|
|
1562
1635
|
tabindex: "0"
|
|
1563
1636
|
}, "?", -1)
|
|
@@ -1566,62 +1639,62 @@ const on = {
|
|
|
1566
1639
|
}, 8, ["title"])) : z("", !0)
|
|
1567
1640
|
])) : z("", !0)
|
|
1568
1641
|
], !0),
|
|
1569
|
-
|
|
1642
|
+
Y(B.$slots, "toolbar-actions", Fe(Ee(V)), void 0, !0)
|
|
1570
1643
|
]),
|
|
1571
|
-
toolbarTools:
|
|
1572
|
-
|
|
1644
|
+
toolbarTools: F((V) => [
|
|
1645
|
+
Y(B.$slots, "toolbar-tools", Fe(Ee(V)), void 0, !0)
|
|
1573
1646
|
]),
|
|
1574
|
-
pagerSizes:
|
|
1575
|
-
|
|
1647
|
+
pagerSizes: F(({ $pager: V, options: I, pageSize: G }) => [
|
|
1648
|
+
le(s(De), {
|
|
1576
1649
|
class: "yee-ui-grid__page-size",
|
|
1577
|
-
options:
|
|
1578
|
-
value:
|
|
1579
|
-
onChange: (
|
|
1650
|
+
options: I,
|
|
1651
|
+
value: G,
|
|
1652
|
+
onChange: (k) => q(V, k)
|
|
1580
1653
|
}, null, 8, ["options", "value", "onChange"])
|
|
1581
1654
|
]),
|
|
1582
|
-
empty:
|
|
1583
|
-
|
|
1584
|
-
|
|
1655
|
+
empty: F(() => [
|
|
1656
|
+
Y(B.$slots, "empty", {}, () => [
|
|
1657
|
+
u[1] || (u[1] = M("div", { class: "yee-ui-grid__empty" }, "暂无数据", -1))
|
|
1585
1658
|
], !0)
|
|
1586
1659
|
]),
|
|
1587
1660
|
_: 2
|
|
1588
1661
|
}, [
|
|
1589
|
-
|
|
1590
|
-
name:
|
|
1591
|
-
fn:
|
|
1592
|
-
|
|
1662
|
+
he(R.value, (V) => ({
|
|
1663
|
+
name: V,
|
|
1664
|
+
fn: F((I) => [
|
|
1665
|
+
Y(B.$slots, V, Fe(Ee(I)), void 0, !0)
|
|
1593
1666
|
])
|
|
1594
1667
|
}))
|
|
1595
1668
|
]), 1040)
|
|
1596
1669
|
]),
|
|
1597
|
-
|
|
1670
|
+
le(s(v))
|
|
1598
1671
|
], 2));
|
|
1599
1672
|
}
|
|
1600
|
-
}),
|
|
1601
|
-
function
|
|
1673
|
+
}), Fn = /* @__PURE__ */ pe(Bn, [["__scopeId", "data-v-69df784f"]]);
|
|
1674
|
+
function ca(o) {
|
|
1602
1675
|
it();
|
|
1603
|
-
const t = new
|
|
1604
|
-
return [
|
|
1676
|
+
const t = new _n(o), e = Fn;
|
|
1677
|
+
return [se({
|
|
1605
1678
|
name: "YeeGrid",
|
|
1606
1679
|
inheritAttrs: !1,
|
|
1607
1680
|
props: {
|
|
1608
1681
|
tableTitle: String,
|
|
1609
1682
|
tableTitleHelp: String
|
|
1610
1683
|
},
|
|
1611
|
-
setup(
|
|
1612
|
-
return
|
|
1613
|
-
...
|
|
1684
|
+
setup(f, { attrs: _, slots: h }) {
|
|
1685
|
+
return Se(() => t.unmount()), () => Xe(e, {
|
|
1686
|
+
..._,
|
|
1614
1687
|
api: t,
|
|
1615
|
-
...
|
|
1616
|
-
...
|
|
1617
|
-
},
|
|
1688
|
+
...f.tableTitle ? { tableTitle: f.tableTitle } : {},
|
|
1689
|
+
...f.tableTitleHelp ? { tableTitleHelp: f.tableTitleHelp } : {}
|
|
1690
|
+
}, h);
|
|
1618
1691
|
}
|
|
1619
1692
|
}), t];
|
|
1620
1693
|
}
|
|
1621
|
-
const
|
|
1694
|
+
const En = { class: "yee-ui-modal__header" }, Mn = ["id"], Rn = { class: "yee-ui-modal__title" }, On = {
|
|
1622
1695
|
key: 1,
|
|
1623
1696
|
class: "yee-ui-modal__header-actions"
|
|
1624
|
-
},
|
|
1697
|
+
}, Vn = { class: "yee-ui-modal__body" }, zn = { class: "yee-ui-modal__footer" }, Pn = { class: "yee-ui-modal__header" }, Nn = ["id"], Hn = { class: "yee-ui-modal__title" }, Ln = { class: "yee-ui-modal__header-actions" }, An = { class: "yee-ui-modal__body" }, jn = { class: "yee-ui-modal__footer" }, In = /* @__PURE__ */ se({
|
|
1625
1698
|
inheritAttrs: !1,
|
|
1626
1699
|
name: "YeeModal",
|
|
1627
1700
|
__name: "YeeModal",
|
|
@@ -1636,6 +1709,7 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1636
1709
|
fullscreenButton: { type: Boolean, default: !0 },
|
|
1637
1710
|
keyboard: { type: Boolean, default: !1 },
|
|
1638
1711
|
maskClosable: { type: Boolean, default: !1 },
|
|
1712
|
+
open: { type: Boolean },
|
|
1639
1713
|
showCancelButton: { type: Boolean, default: !0 },
|
|
1640
1714
|
showConfirmButton: { type: Boolean, default: !0 },
|
|
1641
1715
|
style: { type: [Boolean, null, String, Object, Array] },
|
|
@@ -1649,13 +1723,13 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1649
1723
|
}),
|
|
1650
1724
|
emits: /* @__PURE__ */ je(["cancel", "close", "confirm", "update:fullscreen"], ["update:open"]),
|
|
1651
1725
|
setup(o, { emit: t }) {
|
|
1652
|
-
const e = o, n = t,
|
|
1653
|
-
const
|
|
1726
|
+
const e = o, n = t, f = Ae(o, "open"), _ = Ae(e, "fullscreen"), h = Ze(), v = ze(), C = xt(), y = r(() => e.type === "drawer"), T = r(() => !y.value && _.value), S = r(() => !!(e.title || v.header)), R = r(() => S.value || e.closable), p = r(() => S.value || e.fullscreenButton || e.closable), c = r(() => T.value ? "退出全屏" : "进入全屏"), N = r(() => {
|
|
1727
|
+
const A = Object.prototype.hasOwnProperty.call(e.wrapProps ?? {}, "aria-labelledby");
|
|
1654
1728
|
return {
|
|
1655
1729
|
...e.wrapProps,
|
|
1656
|
-
"aria-labelledby":
|
|
1730
|
+
"aria-labelledby": A ? e.wrapProps?.["aria-labelledby"] : S.value ? C : void 0
|
|
1657
1731
|
};
|
|
1658
|
-
}),
|
|
1732
|
+
}), $ = r(() => {
|
|
1659
1733
|
if (T.value)
|
|
1660
1734
|
return {
|
|
1661
1735
|
height: "100%",
|
|
@@ -1666,97 +1740,97 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1666
1740
|
width: "100vw"
|
|
1667
1741
|
};
|
|
1668
1742
|
});
|
|
1669
|
-
function
|
|
1670
|
-
const { style:
|
|
1671
|
-
return
|
|
1743
|
+
function j() {
|
|
1744
|
+
const { style: A, ...m } = h;
|
|
1745
|
+
return m;
|
|
1672
1746
|
}
|
|
1673
|
-
function
|
|
1674
|
-
return [
|
|
1747
|
+
function q() {
|
|
1748
|
+
return [h.style, e.style].filter(Boolean);
|
|
1675
1749
|
}
|
|
1676
|
-
function
|
|
1677
|
-
return [
|
|
1750
|
+
function B() {
|
|
1751
|
+
return [h.style, e.style, $.value].filter(Boolean);
|
|
1678
1752
|
}
|
|
1679
|
-
const
|
|
1680
|
-
function
|
|
1681
|
-
n("cancel",
|
|
1753
|
+
const u = () => v.closeIcon?.() ?? h.closeIcon ?? Xe(Zt);
|
|
1754
|
+
function V(A) {
|
|
1755
|
+
n("cancel", A), f.value = !1;
|
|
1682
1756
|
}
|
|
1683
|
-
function
|
|
1684
|
-
n("confirm",
|
|
1757
|
+
function I(A) {
|
|
1758
|
+
n("confirm", A);
|
|
1685
1759
|
}
|
|
1686
|
-
function
|
|
1760
|
+
function G() {
|
|
1687
1761
|
n("close");
|
|
1688
1762
|
}
|
|
1689
|
-
function
|
|
1690
|
-
|
|
1763
|
+
function k() {
|
|
1764
|
+
_.value = !_.value;
|
|
1691
1765
|
}
|
|
1692
|
-
return (
|
|
1766
|
+
return (A, m) => y.value ? (i(), L(s(Wt), ie({ key: 0 }, j(), {
|
|
1693
1767
|
class: "yee-ui-modal-drawer",
|
|
1694
1768
|
closable: !1,
|
|
1695
1769
|
"destroy-on-close": e.destroyOnClose,
|
|
1696
1770
|
keyboard: e.keyboard,
|
|
1697
1771
|
"mask-closable": e.maskClosable,
|
|
1698
|
-
open:
|
|
1699
|
-
style:
|
|
1772
|
+
open: f.value,
|
|
1773
|
+
style: q(),
|
|
1700
1774
|
width: e.width,
|
|
1701
|
-
onAfterOpenChange:
|
|
1702
|
-
onClose:
|
|
1703
|
-
}),
|
|
1704
|
-
footer:
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
e.showCancelButton ? (
|
|
1775
|
+
onAfterOpenChange: m[0] || (m[0] = (d) => !d && G()),
|
|
1776
|
+
onClose: V
|
|
1777
|
+
}), Re({
|
|
1778
|
+
footer: F(() => [
|
|
1779
|
+
M("div", zn, [
|
|
1780
|
+
Y(A.$slots, "footer", {}, () => [
|
|
1781
|
+
e.showCancelButton ? (i(), L(s(de), {
|
|
1708
1782
|
key: 0,
|
|
1709
|
-
onClick:
|
|
1783
|
+
onClick: V
|
|
1710
1784
|
}, {
|
|
1711
|
-
default:
|
|
1712
|
-
|
|
1785
|
+
default: F(() => [
|
|
1786
|
+
ce(D(e.cancelButtonText), 1)
|
|
1713
1787
|
]),
|
|
1714
1788
|
_: 1
|
|
1715
1789
|
})) : z("", !0),
|
|
1716
|
-
e.showConfirmButton ? (
|
|
1790
|
+
e.showConfirmButton ? (i(), L(s(de), {
|
|
1717
1791
|
key: 1,
|
|
1718
1792
|
loading: e.confirmButtonLoading,
|
|
1719
1793
|
type: "primary",
|
|
1720
|
-
onClick:
|
|
1794
|
+
onClick: I
|
|
1721
1795
|
}, {
|
|
1722
|
-
default:
|
|
1723
|
-
|
|
1796
|
+
default: F(() => [
|
|
1797
|
+
ce(D(e.confirmButtonText), 1)
|
|
1724
1798
|
]),
|
|
1725
1799
|
_: 1
|
|
1726
1800
|
}, 8, ["loading"])) : z("", !0)
|
|
1727
1801
|
], !0)
|
|
1728
1802
|
])
|
|
1729
1803
|
]),
|
|
1730
|
-
default:
|
|
1731
|
-
|
|
1732
|
-
|
|
1804
|
+
default: F(() => [
|
|
1805
|
+
M("div", Vn, [
|
|
1806
|
+
Y(A.$slots, "default", {}, void 0, !0)
|
|
1733
1807
|
])
|
|
1734
1808
|
]),
|
|
1735
1809
|
_: 2
|
|
1736
1810
|
}, [
|
|
1737
|
-
|
|
1811
|
+
R.value ? {
|
|
1738
1812
|
name: "title",
|
|
1739
|
-
fn:
|
|
1740
|
-
|
|
1741
|
-
|
|
1813
|
+
fn: F(() => [
|
|
1814
|
+
M("div", En, [
|
|
1815
|
+
S.value ? (i(), g("div", {
|
|
1742
1816
|
key: 0,
|
|
1743
1817
|
id: s(C),
|
|
1744
1818
|
class: "yee-ui-modal__heading"
|
|
1745
1819
|
}, [
|
|
1746
|
-
|
|
1747
|
-
|
|
1820
|
+
Y(A.$slots, "header", {}, () => [
|
|
1821
|
+
M("span", Rn, D(e.title), 1)
|
|
1748
1822
|
], !0)
|
|
1749
|
-
], 8,
|
|
1750
|
-
e.closable ? (
|
|
1751
|
-
|
|
1823
|
+
], 8, Mn)) : z("", !0),
|
|
1824
|
+
e.closable ? (i(), g("div", On, [
|
|
1825
|
+
le(s(de), {
|
|
1752
1826
|
"aria-label": "关闭",
|
|
1753
1827
|
class: "yee-ui-modal__header-action",
|
|
1754
1828
|
size: "small",
|
|
1755
1829
|
type: "text",
|
|
1756
|
-
onClick:
|
|
1830
|
+
onClick: V
|
|
1757
1831
|
}, {
|
|
1758
|
-
default:
|
|
1759
|
-
|
|
1832
|
+
default: F(() => [
|
|
1833
|
+
le(u)
|
|
1760
1834
|
]),
|
|
1761
1835
|
_: 1
|
|
1762
1836
|
})
|
|
@@ -1765,7 +1839,7 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1765
1839
|
]),
|
|
1766
1840
|
key: "0"
|
|
1767
1841
|
} : void 0
|
|
1768
|
-
]), 1040, ["destroy-on-close", "keyboard", "mask-closable", "open", "style", "width"])) : (
|
|
1842
|
+
]), 1040, ["destroy-on-close", "keyboard", "mask-closable", "open", "style", "width"])) : (i(), L(s(et), ie({ key: 1 }, j(), {
|
|
1769
1843
|
centered: T.value ? !1 : e.centered,
|
|
1770
1844
|
class: {
|
|
1771
1845
|
"yee-ui-modal": !0,
|
|
@@ -1775,91 +1849,91 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1775
1849
|
"destroy-on-close": e.destroyOnClose,
|
|
1776
1850
|
keyboard: e.keyboard,
|
|
1777
1851
|
"mask-closable": e.maskClosable,
|
|
1778
|
-
open:
|
|
1779
|
-
style:
|
|
1852
|
+
open: f.value,
|
|
1853
|
+
style: B(),
|
|
1780
1854
|
width: T.value ? "100vw" : e.width,
|
|
1781
1855
|
"wrap-props": N.value,
|
|
1782
|
-
onAfterClose:
|
|
1783
|
-
onCancel:
|
|
1784
|
-
}),
|
|
1785
|
-
footer:
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
e.showCancelButton ? (
|
|
1856
|
+
onAfterClose: G,
|
|
1857
|
+
onCancel: V
|
|
1858
|
+
}), Re({
|
|
1859
|
+
footer: F(() => [
|
|
1860
|
+
M("div", jn, [
|
|
1861
|
+
Y(A.$slots, "footer", {}, () => [
|
|
1862
|
+
e.showCancelButton ? (i(), L(s(de), {
|
|
1789
1863
|
key: 0,
|
|
1790
|
-
onClick:
|
|
1864
|
+
onClick: V
|
|
1791
1865
|
}, {
|
|
1792
|
-
default:
|
|
1793
|
-
|
|
1866
|
+
default: F(() => [
|
|
1867
|
+
ce(D(e.cancelButtonText), 1)
|
|
1794
1868
|
]),
|
|
1795
1869
|
_: 1
|
|
1796
1870
|
})) : z("", !0),
|
|
1797
|
-
e.showConfirmButton ? (
|
|
1871
|
+
e.showConfirmButton ? (i(), L(s(de), {
|
|
1798
1872
|
key: 1,
|
|
1799
1873
|
loading: e.confirmButtonLoading,
|
|
1800
1874
|
type: "primary",
|
|
1801
|
-
onClick:
|
|
1875
|
+
onClick: I
|
|
1802
1876
|
}, {
|
|
1803
|
-
default:
|
|
1804
|
-
|
|
1877
|
+
default: F(() => [
|
|
1878
|
+
ce(D(e.confirmButtonText), 1)
|
|
1805
1879
|
]),
|
|
1806
1880
|
_: 1
|
|
1807
1881
|
}, 8, ["loading"])) : z("", !0)
|
|
1808
1882
|
], !0)
|
|
1809
1883
|
])
|
|
1810
1884
|
]),
|
|
1811
|
-
default:
|
|
1812
|
-
|
|
1813
|
-
|
|
1885
|
+
default: F(() => [
|
|
1886
|
+
M("div", An, [
|
|
1887
|
+
Y(A.$slots, "default", {}, void 0, !0)
|
|
1814
1888
|
])
|
|
1815
1889
|
]),
|
|
1816
1890
|
_: 2
|
|
1817
1891
|
}, [
|
|
1818
|
-
|
|
1892
|
+
p.value ? {
|
|
1819
1893
|
name: "title",
|
|
1820
|
-
fn:
|
|
1821
|
-
|
|
1822
|
-
|
|
1894
|
+
fn: F(() => [
|
|
1895
|
+
M("div", Pn, [
|
|
1896
|
+
S.value ? (i(), g("div", {
|
|
1823
1897
|
key: 0,
|
|
1824
1898
|
id: s(C),
|
|
1825
1899
|
class: "yee-ui-modal__heading"
|
|
1826
1900
|
}, [
|
|
1827
|
-
|
|
1828
|
-
|
|
1901
|
+
Y(A.$slots, "header", {}, () => [
|
|
1902
|
+
M("span", Hn, D(e.title), 1)
|
|
1829
1903
|
], !0)
|
|
1830
|
-
], 8,
|
|
1831
|
-
|
|
1832
|
-
e.fullscreenButton ? (
|
|
1904
|
+
], 8, Nn)) : z("", !0),
|
|
1905
|
+
M("div", Ln, [
|
|
1906
|
+
e.fullscreenButton ? (i(), L(s(fe), {
|
|
1833
1907
|
key: 0,
|
|
1834
|
-
title:
|
|
1908
|
+
title: c.value
|
|
1835
1909
|
}, {
|
|
1836
|
-
default:
|
|
1837
|
-
|
|
1838
|
-
"aria-label":
|
|
1910
|
+
default: F(() => [
|
|
1911
|
+
le(s(de), {
|
|
1912
|
+
"aria-label": c.value,
|
|
1839
1913
|
"aria-pressed": T.value,
|
|
1840
1914
|
class: "yee-ui-modal__header-action",
|
|
1841
1915
|
size: "small",
|
|
1842
1916
|
type: "text",
|
|
1843
|
-
onClick:
|
|
1917
|
+
onClick: k
|
|
1844
1918
|
}, {
|
|
1845
|
-
default:
|
|
1846
|
-
T.value ? (
|
|
1919
|
+
default: F(() => [
|
|
1920
|
+
T.value ? (i(), L(s(tt), { key: 0 })) : (i(), L(s(ot), { key: 1 }))
|
|
1847
1921
|
]),
|
|
1848
1922
|
_: 1
|
|
1849
1923
|
}, 8, ["aria-label", "aria-pressed"])
|
|
1850
1924
|
]),
|
|
1851
1925
|
_: 1
|
|
1852
1926
|
}, 8, ["title"])) : z("", !0),
|
|
1853
|
-
e.closable ? (
|
|
1927
|
+
e.closable ? (i(), L(s(de), {
|
|
1854
1928
|
key: 1,
|
|
1855
1929
|
"aria-label": "关闭",
|
|
1856
1930
|
class: "yee-ui-modal__header-action",
|
|
1857
1931
|
size: "small",
|
|
1858
1932
|
type: "text",
|
|
1859
|
-
onClick:
|
|
1933
|
+
onClick: V
|
|
1860
1934
|
}, {
|
|
1861
|
-
default:
|
|
1862
|
-
|
|
1935
|
+
default: F(() => [
|
|
1936
|
+
le(u)
|
|
1863
1937
|
]),
|
|
1864
1938
|
_: 1
|
|
1865
1939
|
})) : z("", !0)
|
|
@@ -1870,16 +1944,16 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1870
1944
|
} : void 0
|
|
1871
1945
|
]), 1040, ["centered", "class", "destroy-on-close", "keyboard", "mask-closable", "open", "style", "width", "wrap-props"]));
|
|
1872
1946
|
}
|
|
1873
|
-
}),
|
|
1947
|
+
}), Un = /* @__PURE__ */ pe(In, [["__scopeId", "data-v-7424b0ee"]]), da = Un, Dn = { class: "yee-ui-page__heading" }, Yn = {
|
|
1874
1948
|
key: 0,
|
|
1875
1949
|
class: "yee-ui-page__title"
|
|
1876
|
-
},
|
|
1950
|
+
}, Wn = {
|
|
1877
1951
|
key: 0,
|
|
1878
1952
|
class: "yee-ui-page__description"
|
|
1879
|
-
},
|
|
1953
|
+
}, qn = {
|
|
1880
1954
|
key: 0,
|
|
1881
1955
|
class: "yee-ui-page__extra"
|
|
1882
|
-
},
|
|
1956
|
+
}, Gn = /* @__PURE__ */ se({
|
|
1883
1957
|
name: "YeePage",
|
|
1884
1958
|
__name: "YeePage",
|
|
1885
1959
|
props: {
|
|
@@ -1892,77 +1966,77 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1892
1966
|
title: {}
|
|
1893
1967
|
},
|
|
1894
1968
|
setup(o) {
|
|
1895
|
-
const t = o, e = ze(), n =
|
|
1896
|
-
Qe(lt,
|
|
1897
|
-
const
|
|
1969
|
+
const t = o, e = ze(), n = r(() => !!(t.description || t.title || e.description || e.extra || e.title)), f = r(() => t.autoContentHeight);
|
|
1970
|
+
Qe(lt, f);
|
|
1971
|
+
const _ = O(0), h = O(0), v = O(!1), C = be("headerRef"), y = be("footerRef");
|
|
1898
1972
|
let T;
|
|
1899
|
-
function
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1973
|
+
function S() {
|
|
1974
|
+
const $ = C.value?.offsetHeight ?? 0, j = y.value?.offsetHeight ?? 0;
|
|
1975
|
+
_.value !== $ && (_.value = $), h.value !== j && (h.value = j);
|
|
1902
1976
|
}
|
|
1903
|
-
function
|
|
1904
|
-
T?.disconnect(), T = void 0, !(typeof ResizeObserver > "u") && (T = new ResizeObserver(
|
|
1977
|
+
function R() {
|
|
1978
|
+
T?.disconnect(), T = void 0, !(typeof ResizeObserver > "u") && (T = new ResizeObserver(S), C.value && T.observe(C.value), y.value && T.observe(y.value));
|
|
1905
1979
|
}
|
|
1906
|
-
async function
|
|
1980
|
+
async function p() {
|
|
1907
1981
|
if (T?.disconnect(), T = void 0, !t.autoContentHeight) {
|
|
1908
|
-
|
|
1982
|
+
v.value = !1;
|
|
1909
1983
|
return;
|
|
1910
1984
|
}
|
|
1911
|
-
await Te(),
|
|
1985
|
+
await Te(), S(), v.value = !0, R();
|
|
1912
1986
|
}
|
|
1913
|
-
const
|
|
1987
|
+
const c = r(() => ({
|
|
1914
1988
|
"--yee-page-height-offset": typeof t.heightOffset == "number" ? `${t.heightOffset}px` : t.heightOffset
|
|
1915
|
-
})), N =
|
|
1916
|
-
height: `calc(100% - ${
|
|
1917
|
-
overflowY:
|
|
1989
|
+
})), N = r(() => t.autoContentHeight ? {
|
|
1990
|
+
height: `calc(100% - ${_.value}px - ${h.value}px)`,
|
|
1991
|
+
overflowY: v.value ? "auto" : "hidden"
|
|
1918
1992
|
} : {});
|
|
1919
|
-
return
|
|
1993
|
+
return Ce(
|
|
1920
1994
|
[() => t.autoContentHeight, n, () => !!e.footer],
|
|
1921
1995
|
() => {
|
|
1922
|
-
|
|
1996
|
+
p();
|
|
1923
1997
|
},
|
|
1924
1998
|
{ flush: "post" }
|
|
1925
|
-
),
|
|
1926
|
-
|
|
1927
|
-
}),
|
|
1999
|
+
), Oe(() => {
|
|
2000
|
+
p();
|
|
2001
|
+
}), Se(() => T?.disconnect()), ($, j) => (i(), g("section", {
|
|
1928
2002
|
class: ye(["yee-ui-page", { "yee-ui-page--auto-height": o.autoContentHeight }]),
|
|
1929
|
-
style:
|
|
2003
|
+
style: ge(c.value)
|
|
1930
2004
|
}, [
|
|
1931
|
-
n.value ? (
|
|
2005
|
+
n.value ? (i(), g("header", {
|
|
1932
2006
|
key: 0,
|
|
1933
2007
|
ref_key: "headerRef",
|
|
1934
2008
|
ref: C,
|
|
1935
2009
|
class: ye(["yee-ui-page__header", o.headerClass])
|
|
1936
2010
|
}, [
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
o.title ? (
|
|
2011
|
+
M("div", Dn, [
|
|
2012
|
+
Y($.$slots, "title", {}, () => [
|
|
2013
|
+
o.title ? (i(), g("h1", Yn, D(o.title), 1)) : z("", !0)
|
|
1940
2014
|
], !0),
|
|
1941
|
-
|
|
1942
|
-
o.description ? (
|
|
2015
|
+
Y($.$slots, "description", {}, () => [
|
|
2016
|
+
o.description ? (i(), g("p", Wn, D(o.description), 1)) : z("", !0)
|
|
1943
2017
|
], !0)
|
|
1944
2018
|
]),
|
|
1945
|
-
|
|
1946
|
-
|
|
2019
|
+
$.$slots.extra ? (i(), g("div", qn, [
|
|
2020
|
+
Y($.$slots, "extra", {}, void 0, !0)
|
|
1947
2021
|
])) : z("", !0)
|
|
1948
2022
|
], 2)) : z("", !0),
|
|
1949
|
-
|
|
2023
|
+
M("main", {
|
|
1950
2024
|
class: ye(["yee-ui-page__content", o.contentClass]),
|
|
1951
|
-
style:
|
|
2025
|
+
style: ge(N.value)
|
|
1952
2026
|
}, [
|
|
1953
|
-
|
|
2027
|
+
Y($.$slots, "default", {}, void 0, !0)
|
|
1954
2028
|
], 6),
|
|
1955
|
-
|
|
2029
|
+
$.$slots.footer ? (i(), g("footer", {
|
|
1956
2030
|
key: 1,
|
|
1957
2031
|
ref_key: "footerRef",
|
|
1958
|
-
ref:
|
|
2032
|
+
ref: y,
|
|
1959
2033
|
class: ye(["yee-ui-page__footer", o.footerClass])
|
|
1960
2034
|
}, [
|
|
1961
|
-
|
|
2035
|
+
Y($.$slots, "footer", {}, void 0, !0)
|
|
1962
2036
|
], 2)) : z("", !0)
|
|
1963
2037
|
], 6));
|
|
1964
2038
|
}
|
|
1965
|
-
}),
|
|
2039
|
+
}), fa = /* @__PURE__ */ pe(Gn, [["__scopeId", "data-v-ba7ea0ff"]]), Kn = { class: "yee-ui-select__option-label" }, Jn = /* @__PURE__ */ se({
|
|
1966
2040
|
inheritAttrs: !1,
|
|
1967
2041
|
name: "YeeSelect",
|
|
1968
2042
|
__name: "YeeSelect",
|
|
@@ -1974,148 +2048,139 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1974
2048
|
valueModifiers: {}
|
|
1975
2049
|
}),
|
|
1976
2050
|
emits: ["update:value"],
|
|
1977
|
-
setup(o) {
|
|
1978
|
-
const
|
|
1979
|
-
label:
|
|
1980
|
-
options:
|
|
1981
|
-
value:
|
|
1982
|
-
})),
|
|
1983
|
-
const
|
|
1984
|
-
for (const [d,
|
|
1985
|
-
d !== "class" && d !== "style" && d !== "onDropdownVisibleChange" && (
|
|
1986
|
-
return
|
|
1987
|
-
}),
|
|
1988
|
-
|
|
1989
|
-
|
|
2051
|
+
setup(o, { expose: t }) {
|
|
2052
|
+
const e = De, n = o, f = Ae(o, "value"), _ = ze(), h = Ze(), v = be("select"), C = O(!1), y = r(() => ({
|
|
2053
|
+
label: n.fieldNames?.label ?? "label",
|
|
2054
|
+
options: n.fieldNames?.options ?? "options",
|
|
2055
|
+
value: n.fieldNames?.value ?? "value"
|
|
2056
|
+
})), T = r(() => h.class), S = r(() => h.style), R = r(() => {
|
|
2057
|
+
const m = {};
|
|
2058
|
+
for (const [d, E] of Object.entries(h))
|
|
2059
|
+
d !== "class" && d !== "style" && d !== "onDropdownVisibleChange" && (m[d] = E);
|
|
2060
|
+
return m;
|
|
2061
|
+
}), p = r(() => !_.default && !_.option), c = r(() => Object.keys(_)), N = r(() => c.value.filter(
|
|
2062
|
+
(m) => m !== "default" && m !== "option"
|
|
2063
|
+
));
|
|
2064
|
+
function $(m) {
|
|
2065
|
+
const d = h.onDropdownVisibleChange;
|
|
1990
2066
|
if (typeof d == "function") {
|
|
1991
|
-
d(
|
|
2067
|
+
d(m);
|
|
1992
2068
|
return;
|
|
1993
2069
|
}
|
|
1994
|
-
d?.forEach((
|
|
2070
|
+
d?.forEach((E) => E?.(m));
|
|
1995
2071
|
}
|
|
1996
|
-
function
|
|
1997
|
-
|
|
2072
|
+
function j(m) {
|
|
2073
|
+
C.value = m, $(m);
|
|
1998
2074
|
}
|
|
1999
|
-
function
|
|
2000
|
-
return typeof
|
|
2075
|
+
function q(m) {
|
|
2076
|
+
return typeof m == "number" || typeof m == "string" ? String(m) : "";
|
|
2001
2077
|
}
|
|
2002
|
-
function
|
|
2003
|
-
if (
|
|
2004
|
-
for (const
|
|
2005
|
-
const
|
|
2006
|
-
if (
|
|
2007
|
-
const
|
|
2008
|
-
if (
|
|
2078
|
+
function B(m, d) {
|
|
2079
|
+
if (m)
|
|
2080
|
+
for (const E of m) {
|
|
2081
|
+
const X = E[y.value.options], oe = B(X, d);
|
|
2082
|
+
if (oe) return oe;
|
|
2083
|
+
const re = E[y.value.value];
|
|
2084
|
+
if (re === d || String(re) === String(d)) return E;
|
|
2009
2085
|
}
|
|
2010
2086
|
}
|
|
2011
|
-
function
|
|
2012
|
-
return
|
|
2087
|
+
function u(m) {
|
|
2088
|
+
return m ? q(m[y.value.label]) || q(m.title) || q(m[y.value.value]) : "";
|
|
2013
2089
|
}
|
|
2014
|
-
const
|
|
2015
|
-
const
|
|
2016
|
-
if (!(
|
|
2017
|
-
return Array.isArray(
|
|
2090
|
+
const V = r(() => {
|
|
2091
|
+
const m = f.value;
|
|
2092
|
+
if (!(m == null || m === ""))
|
|
2093
|
+
return Array.isArray(m) ? m.map((d) => u(B(n.options, d)) || q(d)).filter(Boolean).join("、") || void 0 : u(B(n.options, m)) || q(m) || void 0;
|
|
2018
2094
|
});
|
|
2019
|
-
function I(
|
|
2020
|
-
return
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2095
|
+
function I(m) {
|
|
2096
|
+
return u(m);
|
|
2097
|
+
}
|
|
2098
|
+
function G() {
|
|
2099
|
+
v.value?.blur();
|
|
2100
|
+
}
|
|
2101
|
+
function k() {
|
|
2102
|
+
v.value?.focus();
|
|
2103
|
+
}
|
|
2104
|
+
function A(...m) {
|
|
2105
|
+
v.value?.scrollTo(...m);
|
|
2106
|
+
}
|
|
2107
|
+
return t({ blur: G, focus: k, scrollTo: A }), (m, d) => (i(), L(s(fe), ie(C.value ? { open: !1 } : {}, { title: V.value }), {
|
|
2108
|
+
default: F(() => [
|
|
2109
|
+
M("div", {
|
|
2110
|
+
class: ye(["yee-ui-select", T.value]),
|
|
2111
|
+
style: ge(S.value)
|
|
2027
2112
|
}, [
|
|
2028
|
-
|
|
2113
|
+
p.value ? (i(), L(s(e), ie({
|
|
2029
2114
|
key: 0,
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2115
|
+
ref: "select",
|
|
2116
|
+
value: f.value,
|
|
2117
|
+
"onUpdate:value": d[0] || (d[0] = (E) => f.value = E)
|
|
2118
|
+
}, R.value, {
|
|
2119
|
+
"field-names": y.value,
|
|
2034
2120
|
options: o.options,
|
|
2035
|
-
onDropdownVisibleChange:
|
|
2036
|
-
}), {
|
|
2037
|
-
option:
|
|
2038
|
-
|
|
2039
|
-
title: I(
|
|
2121
|
+
onDropdownVisibleChange: j
|
|
2122
|
+
}), Re({
|
|
2123
|
+
option: F((E) => [
|
|
2124
|
+
le(s(fe), {
|
|
2125
|
+
title: I(E),
|
|
2040
2126
|
placement: "left"
|
|
2041
2127
|
}, {
|
|
2042
|
-
default:
|
|
2043
|
-
|
|
2128
|
+
default: F(() => [
|
|
2129
|
+
M("span", Kn, D(I(E)), 1)
|
|
2044
2130
|
]),
|
|
2045
2131
|
_: 2
|
|
2046
2132
|
}, 1032, ["title"])
|
|
2047
2133
|
]),
|
|
2048
|
-
_:
|
|
2049
|
-
},
|
|
2134
|
+
_: 2
|
|
2135
|
+
}, [
|
|
2136
|
+
he(N.value, (E) => ({
|
|
2137
|
+
name: E,
|
|
2138
|
+
fn: F((X) => [
|
|
2139
|
+
Y(m.$slots, E, Fe(Ee(X)), void 0, !0)
|
|
2140
|
+
])
|
|
2141
|
+
}))
|
|
2142
|
+
]), 1040, ["value", "field-names", "options"])) : (i(), L(s(e), ie({
|
|
2050
2143
|
key: 1,
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2144
|
+
ref: "select",
|
|
2145
|
+
value: f.value,
|
|
2146
|
+
"onUpdate:value": d[1] || (d[1] = (E) => f.value = E)
|
|
2147
|
+
}, R.value, {
|
|
2148
|
+
"field-names": y.value,
|
|
2055
2149
|
options: o.options,
|
|
2056
|
-
onDropdownVisibleChange:
|
|
2057
|
-
}),
|
|
2058
|
-
|
|
2059
|
-
name:
|
|
2060
|
-
fn:
|
|
2061
|
-
|
|
2062
|
-
])
|
|
2063
|
-
|
|
2064
|
-
} : void 0,
|
|
2065
|
-
f.$slots.option ? {
|
|
2066
|
-
name: "option",
|
|
2067
|
-
fn: S((l) => [
|
|
2068
|
-
U(f.$slots, "option", ve(me(l)), void 0, !0)
|
|
2069
|
-
]),
|
|
2070
|
-
key: "1"
|
|
2071
|
-
} : void 0,
|
|
2072
|
-
f.$slots.tagRender ? {
|
|
2073
|
-
name: "tagRender",
|
|
2074
|
-
fn: S((l) => [
|
|
2075
|
-
U(f.$slots, "tagRender", ve(me(l)), void 0, !0)
|
|
2076
|
-
]),
|
|
2077
|
-
key: "2"
|
|
2078
|
-
} : void 0,
|
|
2079
|
-
f.$slots.dropdownRender ? {
|
|
2080
|
-
name: "dropdownRender",
|
|
2081
|
-
fn: S((l) => [
|
|
2082
|
-
U(f.$slots, "dropdownRender", ve(me(l)), void 0, !0)
|
|
2083
|
-
]),
|
|
2084
|
-
key: "3"
|
|
2085
|
-
} : void 0,
|
|
2086
|
-
f.$slots.notFoundContent ? {
|
|
2087
|
-
name: "notFoundContent",
|
|
2088
|
-
fn: S((l) => [
|
|
2089
|
-
U(f.$slots, "notFoundContent", ve(me(l)), void 0, !0)
|
|
2090
|
-
]),
|
|
2091
|
-
key: "4"
|
|
2092
|
-
} : void 0
|
|
2150
|
+
onDropdownVisibleChange: j
|
|
2151
|
+
}), Re({ _: 2 }, [
|
|
2152
|
+
he(c.value, (E) => ({
|
|
2153
|
+
name: E,
|
|
2154
|
+
fn: F((X) => [
|
|
2155
|
+
Y(m.$slots, E, Fe(Ee(X)), void 0, !0)
|
|
2156
|
+
])
|
|
2157
|
+
}))
|
|
2093
2158
|
]), 1040, ["value", "field-names", "options"]))
|
|
2094
2159
|
], 6)
|
|
2095
2160
|
]),
|
|
2096
2161
|
_: 3
|
|
2097
2162
|
}, 16, ["title"]));
|
|
2098
2163
|
}
|
|
2099
|
-
}),
|
|
2164
|
+
}), Qn = /* @__PURE__ */ pe(Jn, [["__scopeId", "data-v-8acc9d8f"]]), pa = Qn;
|
|
2100
2165
|
export {
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2166
|
+
aa as CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT,
|
|
2167
|
+
ia as PlatformConfigProvider,
|
|
2168
|
+
sa as YeeDescriptions,
|
|
2169
|
+
ra as YeeEllipsisText,
|
|
2170
|
+
ua as YeeFilePreview,
|
|
2171
|
+
Fo as YeeFileUpload,
|
|
2172
|
+
bn as YeeForm,
|
|
2173
|
+
wn as YeeFormApi,
|
|
2174
|
+
_n as YeeGridApi,
|
|
2175
|
+
da as YeeModal,
|
|
2176
|
+
fa as YeePage,
|
|
2177
|
+
pa as YeeSelect,
|
|
2178
|
+
ya as darkThemeTokens,
|
|
2179
|
+
ha as lightThemeTokens,
|
|
2180
|
+
Pe as platformThemeKey,
|
|
2181
|
+
qt as resolvePlatformTheme,
|
|
2182
|
+
Gt as toAntDesignTheme,
|
|
2183
|
+
Kt as toPlatformCssVariables,
|
|
2184
|
+
la as usePlatformTheme,
|
|
2185
|
+
ca as useYeeGrid
|
|
2121
2186
|
};
|