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