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