@yeepay/yee-boss-ui 0.1.6 → 0.1.8

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