@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.
Files changed (39) hide show
  1. package/README.md +245 -17
  2. package/dist/components/PlatformConfigProvider.vue.d.ts +4 -9
  3. package/dist/components/descriptions/YeeDescriptions.vue.d.ts +5 -7
  4. package/dist/components/descriptions/index.d.ts +1 -1
  5. package/dist/components/descriptions/types.d.ts +25 -1
  6. package/dist/components/ellipsis-text/YeeEllipsisText.vue.d.ts +2 -8
  7. package/dist/components/ellipsis-text/index.d.ts +1 -1
  8. package/dist/components/ellipsis-text/types.d.ts +12 -1
  9. package/dist/components/file-preview/YeeFilePreview.vue.d.ts +3 -3
  10. package/dist/components/file-preview/index.d.ts +1 -1
  11. package/dist/components/file-preview/types.d.ts +38 -0
  12. package/dist/components/file-upload/YeeFileUpload.vue.d.ts +5 -14
  13. package/dist/components/file-upload/index.d.ts +1 -1
  14. package/dist/components/file-upload/types.d.ts +51 -0
  15. package/dist/components/form/YeeForm.vue.d.ts +2 -2
  16. package/dist/components/form/component-map.d.ts +9 -0
  17. package/dist/components/form/form-api.d.ts +10 -4
  18. package/dist/components/form/index.d.ts +1 -1
  19. package/dist/components/form/types.d.ts +114 -5
  20. package/dist/components/grid/YeeGrid.vue.d.ts +4 -110
  21. package/dist/components/grid/index.d.ts +2 -2
  22. package/dist/components/grid/types.d.ts +40 -3
  23. package/dist/components/grid/use-yee-grid.d.ts +6 -3
  24. package/dist/components/grid/yee-grid-api.d.ts +11 -3
  25. package/dist/components/modal/YeeModal.vue.d.ts +3 -14
  26. package/dist/components/modal/index.d.ts +3 -2
  27. package/dist/components/modal/types.d.ts +64 -2
  28. package/dist/components/page/YeePage.vue.d.ts +2 -8
  29. package/dist/components/page/index.d.ts +1 -1
  30. package/dist/components/page/types.d.ts +22 -0
  31. package/dist/components/platform-config-provider/types.d.ts +12 -0
  32. package/dist/components/select/YeeSelect.vue.d.ts +15 -13
  33. package/dist/components/select/index.d.ts +3 -2
  34. package/dist/components/select/types.d.ts +115 -13
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +1172 -1085
  37. package/dist/style.css +1 -1
  38. package/dist/theme/types.d.ts +65 -0
  39. package/package.json +4 -3
package/dist/index.js CHANGED
@@ -1,48 +1,48 @@
1
- import { inject as Oe, defineComponent as oe, computed as u, provide as Qe, openBlock as a, createBlock as M, unref as s, withCtx as S, createElementVNode as E, normalizeStyle as he, renderSlot as U, reactive as Ie, onBeforeUnmount as Ce, mergeProps as Z, createElementBlock as h, Fragment as _e, renderList as Se, createTextVNode as ie, toDisplayString as D, normalizeClass as ye, createCommentVNode as z, useTemplateRef as xe, shallowRef as R, onMounted as Re, onUpdated as vt, watch as ke, nextTick as Te, ref as mt, createVNode as te, withModifiers as yt, useSlots as ze, onUnmounted as ht, withDirectives as gt, vShow as bt, toHandlers as wt, createSlots as Me, normalizeProps as ve, guardReactiveProps as me, h as Xe, useModel as Ue, useAttrs as Ze, useId as _t, mergeModels as je } from "vue";
2
- import { ConfigProvider as xt, message as He, Descriptions as qe, Tooltip as re, Upload as kt, Image as Ct, DatePicker as $t, Input as St, Select as Ve, Button as se, Modal as et, Drawer as Tt } from "ant-design-vue";
3
- import { r as Bt, t as Ft, a as Et } from "./tokens-Dw6w0SSs.js";
4
- import { d as qn, l as Gn } from "./tokens-Dw6w0SSs.js";
5
- import { CheckOutlined as Rt, CopyOutlined as Ot, FullscreenExitOutlined as tt, FullscreenOutlined as ot, DownloadOutlined as Mt, CloseOutlined as Vt } from "@ant-design/icons-vue";
6
- import { VxeTable as zt, VxeColumn as Nt, VxeColgroup as Pt, VxeGrid as nt, VxeToolbar as Ht, VxeUI as Ee } from "vxe-table";
7
- import { VxeButton as Lt, VxeCheckbox as At, VxeIcon as Ut, VxeInput as jt, VxeLoading as Dt, VxeModal as It, VxeNumberInput as Yt, VxePager as Wt, VxeRadioGroup as qt, VxeSelect as Gt } from "vxe-pc-ui";
8
- const Vn = "--yee-content-height", Ne = /* @__PURE__ */ Symbol("platform-theme");
9
- function zn() {
10
- const o = Oe(Ne);
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 Kt = ["data-theme"], Jt = /* @__PURE__ */ oe({
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(() => Bt(t.theme)), n = u(() => Ft(e.value)), v = u(() => Et(e.value));
23
- return Qe(Ne, e), (x, p) => (a(), M(s(xt), {
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: S(() => [
28
- E("div", {
27
+ default: R(() => [
28
+ M("div", {
29
29
  class: "yee-ui-platform-theme",
30
30
  "data-theme": e.value.mode,
31
- style: he(v.value)
31
+ style: we(c.value)
32
32
  }, [
33
- U(x.$slots, "default", {}, void 0, !0)
34
- ], 12, Kt)
33
+ W(b.$slots, "default", {}, void 0, !0)
34
+ ], 12, vo)
35
35
  ]),
36
36
  _: 3
37
37
  }, 8, ["theme"]));
38
38
  }
39
- }), ue = (o, t) => {
39
+ }), me = (o, t) => {
40
40
  const e = o.__vccOpts || o;
41
- for (const [n, v] of t)
42
- e[n] = v;
41
+ for (const [n, c] of t)
42
+ e[n] = c;
43
43
  return e;
44
- }, Nn = /* @__PURE__ */ ue(Jt, [["__scopeId", "data-v-0b569e8c"]]);
45
- async function Qt(o) {
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
- }, Xt = { class: "yee-ui-descriptions__item" }, Zt = { class: "yee-ui-descriptions__content-row" }, eo = { class: "yee-ui-descriptions__value yee-ui-descriptions__value--ellipsis" }, to = {
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
- }, oo = ["aria-label", "disabled", "onClick"], no = /* @__PURE__ */ oe({
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 ?? !0), v = u(() => t.column ?? 3), x = u(() => t.layout ?? "horizontal"), p = u(() => t.size ?? "default"), m = Ie(/* @__PURE__ */ new Set()), C = /* @__PURE__ */ new Set();
95
- function b(B, k) {
96
- return B.name ?? `${B.label}-${k}`;
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(B, k) {
99
- const c = String(B.value ?? "");
100
- if (!c.trim()) {
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 Qt(c)) {
104
+ if (!await ho(p)) {
105
105
  Be.error("复制失败");
106
106
  return;
107
107
  }
108
- m.add(k), Be.success("已复制");
109
- const w = setTimeout(() => {
110
- m.delete(k), C.delete(w);
108
+ d.add(z), Be.success("已复制");
109
+ const F = setTimeout(() => {
110
+ d.delete(z), x.delete(F);
111
111
  }, 1500);
112
- C.add(w);
112
+ x.add(F);
113
113
  }
114
- return Ce(() => {
115
- C.forEach((B) => clearTimeout(B)), C.clear();
116
- }), (B, k) => (a(), M(s(qe), Z({
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: v.value,
121
- layout: x.value,
122
- size: p.value
120
+ column: c.value,
121
+ layout: b.value,
122
+ size: v.value
123
123
  }, t.title === void 0 ? {} : { title: t.title }), {
124
- default: S(() => [
125
- (a(!0), h(_e, null, Se(o.items, (c, w) => (a(), M(s(qe).Item, {
126
- key: b(c, w),
127
- label: c.label,
128
- span: c.span ?? 1
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: S(() => [
131
- E("div", Xt, [
132
- E("div", Zt, [
133
- c.ellipsis ? (a(), M(s(re), {
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(c.value ?? "")
135
+ title: String(p.value ?? "")
136
136
  }, {
137
- default: S(() => [
138
- E("span", eo, [
139
- U(B.$slots, `content-${c.name ?? c.label}`, { item: c }, () => [
140
- ie(D(c.value), 1)
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"])) : (a(), h("span", to, [
146
- U(B.$slots, `content-${c.name ?? c.label}`, { item: c }, () => [
147
- ie(D(c.value), 1)
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
- c.copyable ? (a(), M(s(re), {
150
+ p.copyable ? (i(), A(r(pe), {
151
151
  key: 2,
152
- title: m.has(b(c, w)) ? "已复制" : "复制"
152
+ title: d.has(y(p, F)) ? "已复制" : "复制"
153
153
  }, {
154
- default: S(() => [
155
- E("button", {
156
- class: ye(["yee-ui-descriptions__copy", { "yee-ui-descriptions__copy--copied": m.has(b(c, w)) }]),
157
- "aria-label": m.has(b(c, w)) ? "已复制" : "复制",
158
- disabled: m.has(b(c, w)),
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: (N) => T(c, b(c, w))
160
+ onClick: (q) => T(p, y(p, F))
161
161
  }, [
162
- m.has(b(c, w)) ? (a(), M(s(Rt), { key: 0 })) : (a(), M(s(Ot), { key: 1 }))
163
- ], 10, oo)
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"])) : z("", !0)
166
+ }, 1032, ["title"])) : V("", !0)
167
167
  ]),
168
- c.info ? (a(), h("span", {
168
+ p.info ? (i(), h("span", {
169
169
  key: 0,
170
170
  class: "yee-ui-descriptions__info",
171
- style: he(c.infoStyle)
172
- }, D(c.info), 5)) : z("", !0)
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
- }), Pn = /* @__PURE__ */ ue(no, [["__scopeId", "data-v-91a3a5f3"]]), ao = ["aria-expanded", "role", "tabindex"], lo = /* @__PURE__ */ oe({
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, v = Oe(Ne, void 0), x = xe("text"), p = R(!1), m = R(!1), C = R(0), b = 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), B = u(() => typeof e.maxWidth == "number" ? `${e.maxWidth}px` : e.maxWidth), k = u(() => {
202
- const $ = { maxWidth: B.value };
203
- return !m.value && b.value > 1 && ($.webkitLineClamp = b.value), $;
204
- }), c = u(() => ({
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": m.value,
207
- "yee-ui-ellipsis-text--multi-line": !m.value && b.value > 1,
208
- "yee-ui-ellipsis-text--single-line": !m.value && b.value === 1
209
- })), w = u(() => e.tooltipMaxWidth !== void 0 ? e.tooltipMaxWidth : C.value > 0 ? C.value + 24 : void 0), N = u(() => {
210
- const $ = {};
211
- return w.value !== void 0 && ($.maxWidth = `${w.value}px`), $;
212
- }), P = u(() => {
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: I.value,
216
- color: e.tooltipColor || v?.value.tokens.popoverForeground || "var(--yee-popover-foreground)",
217
- fontSize: e.tooltipFontSize === void 0 ? v ? `${v.value.tokens.fontSize}px` : "var(--yee-font-size)" : `${e.tooltipFontSize}px`
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 w.value !== void 0 && ($.maxWidth = `${w.value}px`), $;
220
- }), I = u(() => e.tooltipBackgroundColor || v?.value.tokens.popover || "var(--yee-popover)"), f = u(() => e.tooltip && !m.value && (!e.tooltipWhenEllipsis || p.value)), d = u(() => f.value ? {} : { open: !1 });
221
- let l;
222
- function O() {
223
- const $ = x.value;
224
- if (!$) return;
225
- const L = $.getBoundingClientRect().width || $.clientWidth;
226
- if (C.value = Math.ceil(L), !e.tooltipWhenEllipsis || m.value || !$.textContent?.trim()) {
227
- p.value = !1;
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 K = b.value === 1 ? $.scrollWidth - $.clientWidth : $.scrollHeight - $.clientHeight;
231
- p.value = K > T.value;
230
+ const m = y.value === 1 ? _.scrollWidth - _.clientWidth : _.scrollHeight - _.clientHeight;
231
+ v.value = m > T.value;
232
232
  }
233
- function H() {
234
- e.expand && (m.value = !m.value, n("expandChange", m.value), Te(O));
235
- }
236
- function Y($) {
237
- !e.expand || $.key !== "Enter" && $.key !== " " || ($.preventDefault(), H());
238
- }
239
- return Re(() => {
240
- const $ = x.value;
241
- $ && typeof ResizeObserver < "u" && (l = new ResizeObserver(O), l.observe($)), O();
242
- }), vt(O), ke(() => e.expand, ($) => {
243
- $ || (m.value = !1);
244
- }), Ce(() => {
245
- l?.disconnect(), l = void 0;
246
- }), ($, L) => (a(), M(s(re), Z(d.value, {
247
- color: I.value,
248
- "overlay-inner-style": P.value,
249
- "overlay-style": N.value,
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: S(() => [
253
- U($.$slots, "tooltip", {}, () => [
254
- U($.$slots, "default", {}, void 0, !0)
252
+ title: R(() => [
253
+ W(_.$slots, "tooltip", {}, () => [
254
+ W(_.$slots, "default", {}, void 0, !0)
255
255
  ], !0)
256
256
  ]),
257
- default: S(() => [
258
- E("div", Z({ ref: "text" }, $.$attrs, {
259
- "aria-expanded": e.expand ? m.value : void 0,
260
- class: ["yee-ui-ellipsis-text", c.value],
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: k.value,
262
+ style: z.value,
263
263
  tabindex: e.expand ? 0 : void 0,
264
- onClick: H,
265
- onKeydown: Y
264
+ onClick: B,
265
+ onKeydown: j
266
266
  }), [
267
- U($.$slots, "default", {}, void 0, !0)
268
- ], 16, ao)
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
- }), Hn = /* @__PURE__ */ ue(lo, [["__scopeId", "data-v-ce34466f"]]), io = { class: "yee-ui-file-upload" }, so = {
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
- }, ro = /* @__PURE__ */ oe({
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, v = e, x = mt([]), p = R(!1), m = R(""), C = u(() => n.fileList ?? []), b = u(() => n.height ?? 100), T = u(() => n.manual ?? !1), B = u(() => n.maxCount ?? 10), k = u(() => n.maxSize ?? 20), c = u(() => n.multiple ?? !1), w = u(() => n.readonly ?? !1), N = u(() => n.uploadText ?? "上传文件"), P = u(() => n.width ?? 100), I = u(() => ({
295
- height: d(b.value),
296
- width: d(P.value)
297
- })), f = u(() => x.value.some((r) => r.status === "uploading"));
298
- ke(
299
- C,
300
- (r) => {
301
- x.value = r.map((y) => ({ ...y }));
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
- ), ke(f, (r) => v("uploadingChange", r), { immediate: !0 });
305
- function d(r) {
306
- return typeof r == "number" ? `${r}px` : r;
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 l() {
309
- v("update:fileList", x.value.map((r) => ({ ...r })));
311
+ function a() {
312
+ c("update:fileList", b.value.map((s) => ({ ...s })));
310
313
  }
311
- function O(r) {
312
- return r < 1024 ? `${r}B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(2)}KB` : `${(r / (1024 * 1024)).toFixed(2)}MB`;
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 H(r) {
315
- return r.size <= k.value * 1024 * 1024 ? !1 : (Be.error(`文件大小不能超过 ${k.value}MB,当前为 ${O(r.size)}`), !0);
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 Y(r) {
318
- return r.type?.startsWith("image/") ?? /\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(r.url ?? "");
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 $(r) {
321
- if (r.url) {
322
- if (Y(r)) {
323
- m.value = r.url, p.value = !0;
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(r.url, "_blank", "noopener,noreferrer");
330
+ window.open(L, "_blank", "noopener,noreferrer");
327
331
  }
328
332
  }
329
- function L(r) {
330
- p.value = r;
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 K(r, y, A) {
333
- r.status = "done", r.percent = 100, y?.name && (r.name = y.name), y?.url && (r.url = y.url), l(), A(y), v("uploadSuccess");
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 F(r, y, A) {
336
- r.status = "error", l(), A(y);
342
+ function E(s, k, L) {
343
+ s.status = "error", a(), L(k);
337
344
  }
338
- function Q(r, y, A, ce) {
339
- const le = x.value.find((J) => J.uid === y);
340
- if (!le) return;
341
- if (le.status = "uploading", le.percent = 0, l(), !n.customRequest) {
342
- const J = new Error("未配置 customRequest");
343
- Be.error(J.message), F(le, J, ce);
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 we = !1;
347
- const $e = {
348
- file: r,
349
- onError: (J) => {
350
- we || (we = !0, F(le, J, ce));
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: (J) => {
353
- we || (le.percent = Math.min(100, Math.max(0, J)), l());
359
+ onProgress: (X) => {
360
+ de || (ae.percent = Math.min(100, Math.max(0, X)), a());
354
361
  },
355
- onSuccess: (J) => {
356
- we || (we = !0, K(le, J, A));
362
+ onSuccess: (X) => {
363
+ de || (de = !0, f(ae, X, L));
357
364
  },
358
- uid: y
365
+ uid: k
359
366
  };
360
367
  try {
361
- Promise.resolve(n.customRequest($e)).catch((J) => {
362
- $e.onError(J instanceof Error ? J : new Error("上传失败"));
368
+ Promise.resolve(n.customRequest(ve)).catch((X) => {
369
+ ve.onError(X instanceof Error ? X : new Error("上传失败"));
363
370
  });
364
- } catch (J) {
365
- $e.onError(J instanceof Error ? J : new Error("上传失败"));
371
+ } catch (X) {
372
+ ve.onError(X instanceof Error ? X : new Error("上传失败"));
366
373
  }
367
374
  }
368
- const ne = (r) => H(r) || T.value ? !1 : n.customRequest ? !0 : (Be.error("未配置 customRequest"), !1);
369
- function ae(r) {
370
- const y = r.file instanceof File ? r.file : void 0;
371
- if (!y || H(y)) {
372
- r.onError?.(new Error("文件大小超过限制"));
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 A = y.uid ?? String(Date.now());
376
- Q(y, A, r.onSuccess ?? (() => {
377
- }), r.onError ?? (() => {
382
+ const L = k.uid ?? String(Date.now());
383
+ Z(k, L, s.onSuccess ?? (() => {
384
+ }), s.onError ?? (() => {
378
385
  }));
379
386
  }
380
- function fe(r) {
381
- if (x.value = r.fileList.map((A) => ({ ...A })), l(), !T.value) return;
382
- const y = x.value.at(-1);
383
- y?.originFileObj instanceof File && v("fileSelect", { file: y.originFileObj, uid: y.uid });
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 ge(r) {
386
- v("fileRemoved", r);
409
+ function Ee(s) {
410
+ (s.url === d.value || s.thumbUrl === d.value) && m(), c("fileRemoved", s);
387
411
  }
388
- function be(r, y) {
389
- const A = x.value.find((ce) => ce.uid === r);
390
- A && K(A, y, () => {
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 Fe(r) {
394
- const y = x.value.find((A) => A.uid === r);
395
- y && F(y, new Error("上传失败"), () => {
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 G() {
399
- return x.value.flatMap((r) => r.originFileObj instanceof File ? [r.originFileObj] : []);
400
- }
401
- return t({ addError: Fe, addResult: be, getFiles: G }), (r, y) => (a(), h("div", io, [
402
- !w.value || x.value.length > 0 ? (a(), M(s(kt), Z({ key: 0 }, o.accept ? { accept: o.accept } : {}, {
403
- "before-upload": ne,
404
- "custom-request": ae,
405
- "file-list": x.value,
406
- "max-count": B.value,
407
- multiple: c.value,
408
- "show-upload-list": { showRemoveIcon: !w.value },
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: fe,
411
- onPreview: $,
412
- onRemove: ge
434
+ onChange: ke,
435
+ onPreview: _,
436
+ onRemove: Ee
413
437
  }), {
414
- default: S(() => [
415
- !w.value && x.value.length < B.value ? (a(), h("div", {
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: he(I.value)
442
+ style: we(U.value)
419
443
  }, [
420
- y[0] || (y[0] = E("span", {
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
- E("span", null, D(N.value), 1)
425
- ], 4)) : z("", !0)
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"])) : (a(), h("span", so, "暂无文件")),
429
- m.value ? (a(), M(s(Ct), {
430
- key: 2,
431
- class: "yee-ui-file-upload__preview",
432
- preview: { visible: p.value, onVisibleChange: L },
433
- src: m.value
434
- }, null, 8, ["preview", "src"])) : z("", !0)
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
- }), Ln = /* @__PURE__ */ ue(ro, [["__scopeId", "data-v-43728986"]]), Ge = {
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
- }, uo = [
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 co(o) {
513
+ function Mo(o) {
490
514
  return String(o ?? "").trim().toLowerCase().split(";", 1)[0] ?? "";
491
515
  }
492
- function fo(o) {
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 at(o) {
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 = co(o);
531
+ const t = Mo(o);
508
532
  if (t)
509
- return Ge[t] ? Ge[t] : uo.find(([e]) => e.test(t))?.[1];
533
+ return Ke[t] ? Ke[t] : Ro.find(([e]) => e.test(t))?.[1];
510
534
  }
511
- function po(o, t, e) {
535
+ function zo(o, t, e) {
512
536
  const n = Ae(e);
513
537
  if (n) return n;
514
- const v = typeof File < "u" && o instanceof File || typeof Blob < "u" && o instanceof Blob ? Ae(o.type) : void 0;
515
- return v || (Ae(fo(t || at(o))) ?? "unsupported");
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 vo(o) {
541
+ function Vo(o) {
518
542
  return typeof Blob < "u" && o instanceof Blob || o instanceof ArrayBuffer;
519
543
  }
520
- function Ke(o) {
544
+ function Je(o) {
521
545
  return o instanceof Blob ? o : new Blob([o]);
522
546
  }
523
- const mo = 50 * 1024 * 1024, yo = 200, ho = 50;
524
- function go(o, t, e) {
525
- const n = R("idle"), v = R(""), x = R(""), p = R(""), m = R(""), C = R(""), b = R([]), T = R([]), B = R(""), k = R(""), c = R(!1), w = R({ kind: "unsupported", fileName: "" }), N = R(), P = R(0), I = R(), f = u(() => o.source ?? o.url), d = u(() => String(o.fileName ?? "").trim() || at(f.value) || "未命名文件"), l = u(() => w.value.kind), O = u(() => n.value === "loading"), H = u(() => n.value === "ready"), Y = u(() => n.value === "error"), $ = u(() => n.value === "unsupported");
526
- function L() {
527
- N.value && (URL.revokeObjectURL(N.value), N.value = void 0);
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 K() {
530
- I.value?.abort(), I.value = void 0;
553
+ function m() {
554
+ U.value?.abort(), U.value = void 0;
531
555
  }
532
- function F() {
533
- K(), L(), n.value = "idle", v.value = "", x.value = "", p.value = "", m.value = "", C.value = "", b.value = [], T.value = [], B.value = "", k.value = "", c.value = !1, w.value = { kind: "unsupported", fileName: d.value };
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 Q(i) {
536
- const g = URL.createObjectURL(Ke(i));
537
- return N.value = g, g;
559
+ function E(l) {
560
+ const g = URL.createObjectURL(Je(l));
561
+ return q.value = g, g;
538
562
  }
539
- function ne() {
540
- const i = f.value;
541
- return typeof i == "string" ? i.trim() : vo(i) ? Q(i) : "";
563
+ function Z() {
564
+ const l = G.value;
565
+ return typeof l == "string" ? l.trim() : Vo(l) ? E(l) : "";
542
566
  }
543
- function ae() {
544
- const i = Number(o.maxFileSize);
545
- return Number.isFinite(i) && i > 0 ? i : mo;
567
+ function oe() {
568
+ const l = Number(o.maxFileSize);
569
+ return Number.isFinite(l) && l > 0 ? l : Po;
546
570
  }
547
- function fe() {
548
- const i = Number(o.maxRows);
549
- return Number.isFinite(i) && i > 0 ? Math.floor(i) : yo;
571
+ function ue() {
572
+ const l = Number(o.maxRows);
573
+ return Number.isFinite(l) && l > 0 ? Math.floor(l) : No;
550
574
  }
551
- function ge() {
552
- const i = Number(o.maxColumns);
553
- return Number.isFinite(i) && i > 0 ? Math.floor(i) : ho;
575
+ function Ce() {
576
+ const l = Number(o.maxColumns);
577
+ return Number.isFinite(l) && l > 0 ? Math.floor(l) : Ho;
554
578
  }
555
- function be(i) {
556
- if (i > ae())
557
- throw new Error(`文件超过 ${Math.round(ae() / 1024 / 1024)}MB 限制`);
579
+ function ke(l) {
580
+ if (l > oe())
581
+ throw new Error(`文件超过 ${Math.round(oe() / 1024 / 1024)}MB 限制`);
558
582
  }
559
- function Fe() {
560
- K(), P.value += 1;
561
- const i = typeof AbortController == "function" ? new AbortController() : void 0;
562
- return I.value = i, { token: P.value, signal: i?.signal };
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 G(i) {
565
- return i === P.value;
588
+ function Q(l) {
589
+ return l === N.value;
566
590
  }
567
- async function r(i) {
568
- if (!i.ok) throw new Error(`文件加载失败(${i.status})`);
569
- const g = Number(i.headers.get("content-length"));
570
- Number.isFinite(g) && be(g);
571
- const _ = await i.arrayBuffer();
572
- return be(_.byteLength), _;
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 y(i) {
575
- const g = f.value;
598
+ async function I(l) {
599
+ const g = G.value;
576
600
  if (g instanceof Blob || g instanceof ArrayBuffer) {
577
- const j = Ke(g);
578
- return be(j.size), j.arrayBuffer();
601
+ const D = Je(g);
602
+ return ke(D.size), D.arrayBuffer();
579
603
  }
580
- const _ = typeof g == "string" ? g.trim() : "";
581
- if (!_) throw new Error("未提供文件地址或文件内容");
582
- const V = {};
583
- return i && (V.signal = i), r(await fetch(_, V));
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 A(i) {
586
- const g = await y(i);
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 ce(i) {
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(i);
615
+ return (typeof g.default == "function" ? g.default(typeof window > "u" ? void 0 : window) : g.default).sanitize(l);
592
616
  }
593
- async function le(i) {
594
- const g = await A(i), [_, V] = await Promise.all([
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
- ]), j = _.marked.parse(g, { breaks: !0, gfm: !0 }), q = typeof V.default == "function" ? V.default(typeof window > "u" ? void 0 : window) : V.default;
598
- p.value = q.sanitize(j);
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 we(i) {
601
- m.value = await ce(await A(i));
624
+ async function ne(l) {
625
+ d.value = await k(await s(l));
602
626
  }
603
- function $e(i) {
627
+ function ae(l) {
604
628
  let g = "";
605
- for (let V = 0; V < i.length; V += 32768)
606
- g += String.fromCharCode(...i.subarray(V, V + 32768));
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 J(i) {
633
+ function de(l) {
610
634
  let g;
611
- if (typeof i.content == "string")
612
- g = i.encoding === "base64" ? i.content.replace(/\s/g, "") : $e(new TextEncoder().encode(i.content));
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 _ = i.content instanceof Uint8Array ? i.content : new Uint8Array(i.content);
615
- g = $e(_);
638
+ const w = l.content instanceof Uint8Array ? l.content : new Uint8Array(l.content);
639
+ g = ae(w);
616
640
  }
617
- return `data:${i.mimeType || "application/octet-stream"};base64,${g}`;
641
+ return `data:${l.mimeType || "application/octet-stream"};base64,${g}`;
618
642
  }
619
- function Pe(i) {
620
- const g = i.trim().replace(/^cid:/i, "").replace(/^<|>$/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 st(i, g) {
628
- const _ = /* @__PURE__ */ new Map();
629
- for (const j of g) {
630
- if (!/^image\//i.test(j.mimeType)) continue;
631
- const q = J(j);
632
- j.contentId && _.set(Pe(j.contentId), q), j.filename && _.set(Pe(j.filename), q);
633
- }
634
- if (!_.size || typeof DOMParser > "u") return i;
635
- const V = new DOMParser().parseFromString(i, "text/html");
636
- return V.querySelectorAll("[src]").forEach((j) => {
637
- const q = j.getAttribute("src") ?? "", W = Pe(/^cid:/i.test(q) ? q.slice(4) : q), X = _.get(W);
638
- X && j.setAttribute("src", X);
639
- }), V.body.innerHTML;
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(i) {
665
+ function rt(l) {
642
666
  try {
643
- return JSON.stringify(JSON.parse(i), null, 2);
667
+ return JSON.stringify(JSON.parse(l), null, 2);
644
668
  } catch {
645
- return i;
669
+ return l;
646
670
  }
647
671
  }
648
- function ut(i) {
649
- const g = i.replace(/^\uFEFF/, ""), _ = g.split(/\r?\n/, 1)[0] ?? "", j = [" ", ",", ";"].map((ee) => ({ candidate: ee, count: _.split(ee).length - 1 })).sort((ee, pe) => pe.count - ee.count)[0]?.candidate ?? ",", q = [];
650
- let W = [], X = "", de = !1;
651
- for (let ee = 0; ee < g.length; ee += 1) {
652
- const pe = g[ee], We = g[ee + 1];
653
- pe === '"' ? de && We === '"' ? (X += '"', ee += 1) : de = !de : pe === j && !de ? (W.push(X), X = "") : (pe === `
654
- ` || pe === "\r") && !de ? (pe === "\r" && We === `
655
- ` && (ee += 1), W.push(X), q.push(W), W = [], X = "") : X += pe;
656
- }
657
- return (X || W.length) && (W.push(X), q.push(W)), q;
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(i) {
660
- const g = await import("./xlsx-CF422ARu.js"), _ = g.read(await y(i), { type: "array" }), V = _.SheetNames[0], j = V ? _.Sheets[V] : void 0;
661
- if (!j) throw new Error("Excel 文件没有可展示的工作表");
662
- const q = g.utils.sheet_to_json(j, {
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
- }), W = fe(), X = ge();
667
- c.value = q.length > W || q.some((de) => de.length > X), b.value = q.slice(0, W).map((de) => ({
668
- cells: de.slice(0, X).map((ee) => String(ee ?? ""))
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(i) {
672
- const _ = await (await import("./postal-mime-CPJ2QXsD.js")).default.parse(await y(i)), V = (W) => {
673
- if (Array.isArray(W)) return W.map(V).filter(Boolean).join("; ");
674
- if (!W || typeof W != "object") return String(W ?? "");
675
- const X = W;
676
- return [X.name, X.address].filter(Boolean).join(" ");
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: V(_.from) || "-" },
680
- { label: "收件人", value: V(_.to) || "-" },
681
- { label: "主题", value: _.subject || "-" },
682
- { label: "时间", value: _.date || "-" }
683
- ], k.value = _.text || "";
684
- const j = _.attachments, q = _.html ? await ce(_.html) : "";
685
- B.value = q ? st(q, j) : "";
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(i, g) {
688
- if (await Te(), !G(i)) return;
689
- const _ = t.docxContainer.value;
690
- if (!_) throw new Error("DOCX 预览容器未就绪");
691
- const V = await import("./docx-preview.min-lCFRKxYn.js").then((j) => j.d);
692
- _.replaceChildren(), await V.renderAsync(await y(g), _, void 0, {
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(i, g, _) {
699
- if (i === "text" && (C.value = await A(_)), i === "json" && (C.value = rt(await A(_))), i === "xml" && (C.value = await A(_)), i === "csv") {
700
- const V = ut(await A(_)), j = fe(), q = ge();
701
- c.value = V.length > j || V.some((W) => W.length > q), b.value = V.slice(0, j).map((W) => ({
702
- cells: W.slice(0, q)
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
- i === "markdown" && await le(_), i === "html" && await we(_), i === "spreadsheet" && await ct(_), i === "eml" && await dt(_), i === "docx" && await ft(g, _);
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 Ye() {
708
- F();
709
- const i = f.value;
710
- if (i === void 0 || i === "") return;
711
- const g = po(i, o.fileName, o.fileType);
712
- if (w.value = { kind: g, fileName: d.value }, x.value = ne(), g === "unsupported") {
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 _ = Fe();
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, _.token, _.signal), !G(_.token)) return;
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: d.value });
729
- } catch (V) {
730
- if (!G(_.token)) return;
731
- n.value = "error", v.value = V instanceof Error ? V.message : "文件预览失败", e("error", { kind: g, message: v.value, cause: V });
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 ke(
758
+ return $e(
735
759
  () => [o.source, o.url, o.fileName, o.fileType],
736
760
  () => {
737
- Ye();
761
+ We();
738
762
  },
739
763
  { immediate: !0 }
740
- ), Ce(() => {
741
- P.value += 1, K(), L();
764
+ ), xe(() => {
765
+ N.value += 1, m(), H();
742
766
  }), {
743
- displayUrl: x,
744
- emailHtml: B,
767
+ displayUrl: b,
768
+ emailHtml: $,
745
769
  emailMeta: T,
746
- emailText: k,
747
- errorMessage: v,
748
- fileName: d,
749
- htmlContent: m,
750
- isError: Y,
751
- isLoading: O,
752
- isReady: H,
753
- isUnsupported: $,
754
- kind: l,
755
- load: Ye,
756
- markdownHtml: p,
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: b,
759
- textContent: C,
760
- truncated: c
782
+ tableRows: y,
783
+ textContent: x,
784
+ truncated: p
761
785
  };
762
786
  }
763
- const bo = ["aria-busy"], wo = {
787
+ const Ao = ["aria-busy"], Uo = {
764
788
  key: 0,
765
789
  class: "yee-ui-file-preview__header"
766
- }, _o = ["title"], xo = { class: "yee-ui-file-preview__header-actions" }, ko = ["aria-label", "aria-pressed"], Co = ["aria-label", "aria-busy", "disabled"], $o = {
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
- }, So = {
794
+ }, qo = {
771
795
  key: 2,
772
796
  class: "yee-ui-file-preview__empty"
773
- }, To = {
797
+ }, Go = {
774
798
  key: 3,
775
799
  class: "yee-ui-file-preview__loading"
776
- }, Bo = {
800
+ }, Ko = {
777
801
  key: 4,
778
802
  class: "yee-ui-file-preview__empty"
779
- }, Fo = {
803
+ }, Jo = {
780
804
  key: 5,
781
805
  class: "yee-ui-file-preview__empty"
782
- }, Eo = ["src", "alt"], Ro = ["src", "title"], Oo = ["src"], Mo = ["src"], Vo = {
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
- }, zo = ["innerHTML"], No = ["srcdoc", "title"], Po = {
809
+ }, on = ["innerHTML"], nn = ["srcdoc", "title"], an = {
786
810
  key: 8,
787
811
  class: "yee-ui-file-preview__table-wrap"
788
- }, Ho = {
812
+ }, ln = {
789
813
  key: 0,
790
814
  class: "yee-ui-file-preview__table"
791
- }, Lo = {
815
+ }, sn = {
792
816
  key: 1,
793
817
  class: "yee-ui-file-preview__empty-inline"
794
- }, Ao = {
818
+ }, rn = {
795
819
  key: 2,
796
820
  class: "yee-ui-file-preview__tip"
797
- }, Uo = {
821
+ }, un = {
798
822
  key: 9,
799
823
  class: "yee-ui-file-preview__email"
800
- }, jo = {
824
+ }, cn = {
801
825
  key: 0,
802
826
  class: "yee-ui-file-preview__email-meta"
803
- }, Do = ["srcdoc", "title"], Io = {
827
+ }, dn = ["srcdoc", "title"], fn = {
804
828
  key: 2,
805
829
  class: "yee-ui-file-preview__text"
806
- }, Yo = /* @__PURE__ */ oe({
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: ["load", "error", "unsupported", "download"],
846
+ emits: ["download", "error", "load", "unsupported"],
823
847
  setup(o, { emit: t }) {
824
- const e = o, n = t, v = xe("previewContainer"), x = xe("docxContainer"), p = R(!1), m = R(""), C = R(!1), {
825
- displayUrl: b,
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: B,
828
- emailText: k,
829
- errorMessage: c,
830
- fileName: w,
831
- htmlContent: N,
832
- isError: P,
833
- isLoading: I,
834
- isReady: f,
835
- isUnsupported: d,
836
- kind: l,
837
- markdownHtml: O,
838
- tableRows: H,
839
- textContent: Y,
840
- truncated: $
841
- } = go(e, { docxContainer: x }, n), L = u(() => e.height === void 0 || e.height === null || e.height === "" ? {} : {
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
- }), K = u(() => !!b.value), F = u(() => ["image", "pdf", "video", "audio"].includes(l.value)), Q = u(() => l.value === "csv" || l.value === "spreadsheet"), ne = u(() => l.value === "eml");
844
- ke(
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
- m.value = "";
871
+ d.value = "";
848
872
  }
849
873
  );
850
- function ae() {
874
+ function oe() {
851
875
  n("error", {
852
- kind: l.value,
876
+ kind: a.value,
853
877
  message: "文件预览失败"
854
878
  });
855
879
  }
856
- async function fe() {
857
- if (!b.value || C.value) return;
858
- m.value = "", C.value = !0;
859
- let G = b.value, r = !1;
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(G)) {
862
- const A = await fetch(G);
863
- if (!A.ok) throw new Error(`文件下载失败(${A.status})`);
864
- G = URL.createObjectURL(await A.blob()), r = !0;
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 y = document.createElement("a");
867
- y.href = G, y.download = w.value, y.rel = "noopener noreferrer", document.body.appendChild(y), y.click(), y.remove(), r && window.setTimeout(() => URL.revokeObjectURL(G), 0), n("download");
868
- } catch (y) {
869
- m.value = y instanceof Error ? y.message : "文件下载失败", n("error", {
870
- kind: l.value,
871
- message: m.value,
872
- cause: y
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
- C.value = !1;
899
+ x.value = !1;
876
900
  }
877
901
  }
878
- function ge() {
879
- p.value = document.fullscreenElement === v.value;
902
+ function Ce() {
903
+ v.value = document.fullscreenElement === c.value;
880
904
  }
881
- async function be() {
882
- const G = v.value;
883
- if (G)
905
+ async function ke() {
906
+ const Q = c.value;
907
+ if (Q)
884
908
  try {
885
- document.fullscreenElement === G ? await document.exitFullscreen() : G.requestFullscreen ? await G.requestFullscreen() : p.value = !p.value;
886
- } catch (r) {
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: l.value,
912
+ kind: a.value,
889
913
  message: "无法切换全屏",
890
- cause: r
914
+ cause: te
891
915
  });
892
916
  }
893
917
  }
894
- function Fe(G) {
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
- }[G];
934
+ }[Q];
911
935
  }
912
- return Re(() => {
913
- document.addEventListener("fullscreenchange", ge);
914
- }), Ce(() => {
915
- document.removeEventListener("fullscreenchange", ge), document.fullscreenElement === v.value && document.exitFullscreen().catch(() => {
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
- }), (G, r) => (a(), h("section", {
941
+ }), (Q, te) => (i(), h("section", {
918
942
  ref_key: "previewContainer",
919
- ref: v,
920
- class: ye([{ "yee-ui-file-preview--fullscreen": p.value }, "yee-ui-file-preview"]),
921
- style: he(L.value),
922
- "aria-busy": s(I)
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 && K.value ? (a(), h("header", wo, [
925
- E("div", {
948
+ o.showHeader && m.value ? (i(), h("header", Uo, [
949
+ M("div", {
926
950
  class: "yee-ui-file-preview__name",
927
- title: s(w)
928
- }, D(s(w)), 9, _o),
929
- E("div", xo, [
930
- te(s(re), {
931
- title: p.value ? "退出全屏" : "进入全屏"
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: S(() => [
934
- E("button", {
935
- "aria-label": p.value ? "退出全屏" : "进入全屏",
936
- "aria-pressed": p.value,
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: be
963
+ onClick: ke
940
964
  }, [
941
- p.value ? (a(), M(s(tt), { key: 0 })) : (a(), M(s(ot), { key: 1 }))
942
- ], 8, ko)
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 ? (a(), M(s(re), {
970
+ o.showDownload ? (i(), A(r(pe), {
947
971
  key: 0,
948
- title: C.value ? "下载中..." : "下载"
972
+ title: x.value ? "下载中..." : "下载"
949
973
  }, {
950
- default: S(() => [
951
- E("button", {
952
- "aria-label": C.value ? "下载中" : "下载",
953
- "aria-busy": C.value,
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: C.value,
979
+ disabled: x.value,
956
980
  type: "button",
957
- onClick: r[0] || (r[0] = (y) => {
958
- fe();
981
+ onClick: te[0] || (te[0] = (I) => {
982
+ ue();
959
983
  })
960
984
  }, [
961
- te(s(Mt))
962
- ], 8, Co)
985
+ ie(r(Xt))
986
+ ], 8, Yo)
963
987
  ]),
964
988
  _: 1
965
- }, 8, ["title"])) : z("", !0)
989
+ }, 8, ["title"])) : V("", !0)
966
990
  ])
967
- ])) : z("", !0),
968
- m.value ? (a(), h("div", $o, D(m.value), 1)) : z("", !0),
969
- K.value ? s(I) && !F.value && s(l) !== "docx" ? (a(), h("div", To, "文件加载中...")) : s(P) ? (a(), h("div", Bo, [
970
- E("span", null, D(s(c) || "文件预览失败"), 1),
971
- o.showDownload ? (a(), h("button", {
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: r[1] || (r[1] = (y) => {
976
- fe();
999
+ onClick: te[1] || (te[1] = (I) => {
1000
+ ue();
977
1001
  })
978
- }, " 下载查看 ")) : z("", !0)
979
- ])) : s(d) ? (a(), h("div", Fo, [
980
- E("span", null, "暂不支持预览 " + D(Fe(s(l))) + " 文件", 1),
981
- o.showDownload ? (a(), h("button", {
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: r[2] || (r[2] = (y) => {
986
- fe();
1009
+ onClick: te[2] || (te[2] = (I) => {
1010
+ ue();
987
1011
  })
988
- }, " 下载查看 ")) : z("", !0)
989
- ])) : s(f) || F.value || s(l) === "docx" ? (a(), h(_e, { key: 6 }, [
990
- s(l) === "image" ? (a(), h("img", {
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: s(b),
1017
+ src: r(y),
994
1018
  alt: o.alt,
995
- onError: ae
996
- }, null, 40, Eo)) : s(l) === "pdf" ? (a(), h("iframe", {
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: s(b),
1023
+ src: r(y),
1000
1024
  title: o.alt,
1001
- onError: ae
1002
- }, null, 40, Ro)) : s(l) === "video" ? (a(), h("video", {
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: s(b),
1029
+ src: r(y),
1006
1030
  controls: "",
1007
1031
  preload: "metadata",
1008
- onError: ae
1009
- }, " 您的浏览器不支持视频预览,请下载查看。 ", 40, Oo)) : s(l) === "audio" ? (a(), h("audio", {
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: s(b),
1036
+ src: r(y),
1013
1037
  controls: "",
1014
1038
  preload: "metadata",
1015
- onError: ae
1016
- }, null, 40, Mo)) : s(l) === "text" || s(l) === "json" || s(l) === "xml" ? (a(), h("pre", Vo, D(s(Y)), 1)) : s(l) === "markdown" ? (a(), h("article", {
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: s(O)
1020
- }, null, 8, zo)) : s(l) === "html" ? (a(), h("iframe", {
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: s(N),
1047
+ srcdoc: r(q),
1024
1048
  sandbox: "",
1025
1049
  title: o.alt
1026
- }, null, 8, No)) : s(l) === "docx" ? (a(), h("div", {
1050
+ }, null, 8, nn)) : r(a) === "docx" ? (i(), h("div", {
1027
1051
  key: 7,
1028
1052
  ref_key: "docxContainer",
1029
- ref: x,
1053
+ ref: b,
1030
1054
  class: "yee-ui-file-preview__docx"
1031
- }, null, 512)) : Q.value ? (a(), h("div", Po, [
1032
- s(H).length ? (a(), h("table", Ho, [
1033
- E("tbody", null, [
1034
- (a(!0), h(_e, null, Se(s(H), (y, A) => (a(), h("tr", { key: A }, [
1035
- (a(!0), h(_e, null, Se(y.cells, (ce, le) => (a(), h("td", {
1036
- key: `${A}-${le}`
1037
- }, D(ce), 1))), 128))
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
- ])) : (a(), h("div", Lo, "暂无可展示的数据")),
1041
- s($) ? (a(), h("div", Ao, "预览内容已截断,可下载查看完整文件。")) : z("", !0)
1042
- ])) : ne.value ? (a(), h("div", Uo, [
1043
- s(B).length ? (a(), h("dl", jo, [
1044
- (a(!0), h(_e, null, Se(s(B), (y) => (a(), h(_e, {
1045
- key: y.label
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
- E("dt", null, D(y.label), 1),
1048
- E("dd", null, D(y.value), 1)
1071
+ M("dt", null, Y(I.label), 1),
1072
+ M("dd", null, Y(I.value), 1)
1049
1073
  ], 64))), 128))
1050
- ])) : z("", !0),
1051
- s(T) ? (a(), h("iframe", {
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: s(T),
1078
+ srcdoc: r(T),
1055
1079
  sandbox: "",
1056
1080
  title: o.alt
1057
- }, null, 8, Do)) : (a(), h("pre", Io, D(s(k) || "暂无可展示的邮件正文"), 1))
1058
- ])) : z("", !0)
1059
- ], 64)) : z("", !0) : (a(), h("div", So, "请选择文件"))
1060
- ], 14, bo));
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
- }), An = /* @__PURE__ */ ue(Yo, [["__scopeId", "data-v-2a474289"]]), Wo = { class: "yee-ui-form__fields" }, qo = { class: "yee-ui-form__label" }, Go = { class: "yee-ui-form__actions" }, Ko = /* @__PURE__ */ oe({
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 = $t.RangePicker, n = R(t.options.collapsed ?? !0);
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((k) => !k.hide));
1075
- function x(k) {
1076
- return t.api.getFieldValue(k.fieldName);
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 p(k) {
1079
- const c = x(k);
1151
+ function F(a) {
1152
+ const C = T(a), B = p(a);
1080
1153
  return {
1081
- ...k.componentProps,
1082
- ...c === void 0 ? {} : { value: c }
1154
+ ...a.componentProps,
1155
+ ...C === void 0 ? {} : { [B]: C },
1156
+ [`onUpdate:${B}`]: (j) => q(a, j)
1083
1157
  };
1084
1158
  }
1085
- function m(k, c) {
1086
- t.api.setFieldValue(k.fieldName, c), t.options.submitOnChange && b();
1159
+ function q(a, C) {
1160
+ t.api.setFieldValue(
1161
+ a.fieldName,
1162
+ C
1163
+ ), t.options.submitOnChange && U();
1087
1164
  }
1088
- async function C() {
1165
+ async function N() {
1089
1166
  t.api.resetForm(), await t.onReset?.();
1090
1167
  }
1091
- async function b() {
1168
+ async function U() {
1092
1169
  await t.onSubmit?.(t.api.getValues());
1093
1170
  }
1094
- function T(k) {
1095
- k.key === "Enter" && t.options.submitOnEnter && (k.preventDefault(), b());
1171
+ function G(a) {
1172
+ a.key === "Enter" && t.options.submitOnEnter && (a.preventDefault(), U());
1096
1173
  }
1097
- function B() {
1098
- n.value = !n.value, t.options.handleCollapsedChange?.(n.value);
1174
+ function S() {
1175
+ e.value = !e.value, t.options.handleCollapsedChange?.(e.value);
1099
1176
  }
1100
- return (k, c) => (a(), h("form", {
1177
+ return (a, C) => (i(), h("form", {
1101
1178
  class: "yee-ui-form",
1102
- onKeydown: T,
1103
- onSubmit: yt(b, ["prevent"])
1179
+ onKeydown: G,
1180
+ onSubmit: yt(U, ["prevent"])
1104
1181
  }, [
1105
- E("div", Wo, [
1106
- (a(!0), h(_e, null, Se(v.value, (w) => (a(), h("label", {
1107
- key: w.fieldName,
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
- E("span", qo, D(w.label), 1),
1111
- w.component === "Input" ? (a(), M(s(St), Z({
1112
- key: 0,
1113
- ref_for: !0
1114
- }, p(w), {
1115
- "onUpdate:value": (N) => m(w, N)
1116
- }), null, 16, ["onUpdate:value"])) : w.component === "Select" ? (a(), M(s(Ve), Z({
1117
- key: 1,
1118
- ref_for: !0
1119
- }, p(w), {
1120
- "onUpdate:value": (N) => m(w, N)
1121
- }), null, 16, ["onUpdate:value"])) : (a(), M(s(e), Z({
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
- E("div", Go, [
1130
- te(s(se), {
1204
+ ], 512),
1205
+ M("div", hn, [
1206
+ ie(r(fe), {
1131
1207
  "html-type": "button",
1132
- onClick: C
1208
+ onClick: N
1133
1209
  }, {
1134
- default: S(() => [...c[0] || (c[0] = [
1135
- ie(" 重置 ", -1)
1210
+ default: R(() => [...C[0] || (C[0] = [
1211
+ ce(" 重置 ", -1)
1136
1212
  ])]),
1137
1213
  _: 1
1138
1214
  }),
1139
- te(s(se), {
1215
+ ie(r(fe), {
1140
1216
  type: "primary",
1141
1217
  "html-type": "submit"
1142
1218
  }, {
1143
- default: S(() => [...c[1] || (c[1] = [
1144
- ie(" 查询 ", -1)
1219
+ default: R(() => [...C[1] || (C[1] = [
1220
+ ce(" 查询 ", -1)
1145
1221
  ])]),
1146
1222
  _: 1
1147
1223
  }),
1148
- o.options.showCollapseButton ? (a(), M(s(se), {
1224
+ o.options.showCollapseButton ? (i(), A(r(fe), {
1149
1225
  key: 0,
1150
1226
  type: "link",
1151
1227
  "html-type": "button",
1152
- onClick: B
1228
+ onClick: S
1153
1229
  }, {
1154
- default: S(() => [
1155
- ie(D(n.value ? "展开" : "收起"), 1)
1230
+ default: R(() => [
1231
+ ce(Y(e.value ? "展开" : "收起"), 1)
1156
1232
  ]),
1157
1233
  _: 1
1158
- })) : z("", !0)
1234
+ })) : V("", !0)
1159
1235
  ])
1160
1236
  ], 32));
1161
1237
  }
1162
- }), Jo = /* @__PURE__ */ ue(Ko, [["__scopeId", "data-v-92583f28"]]);
1163
- class Qo {
1164
- schema = R([]);
1238
+ }), bn = /* @__PURE__ */ me(gn, [["__scopeId", "data-v-13cadc25"]]);
1239
+ class wn {
1240
+ /** 当前表单 Schema,由组件初始化,可通过 updateSchema 动态更新。 */
1241
+ schema = O([]);
1165
1242
  initialValues = {};
1166
- values = Ie({});
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 Xo {
1196
- formApi = new Qo();
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 = R(t), this.searchFormVisible = R(t.showSearchForm ?? !0);
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 lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), Zo = /* @__PURE__ */ oe({
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, v = e, x = re, p = Ie({ visible: !1 }), m = xe("tooltip"), C = R(), b = R(""), T = R(), B = R(!1);
1259
- let k;
1260
- function c(F) {
1261
- if (!(F === void 0 || F === ""))
1262
- return typeof F == "number" ? `${F}px` : F;
1263
- }
1264
- const w = u(() => {
1265
- const F = C.value;
1266
- return !F || !p.visible ? { display: "none" } : {
1267
- height: `${Math.max(F.height, 1)}px`,
1268
- left: `${F.left}px`,
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: `${F.top}px`,
1272
- width: `${Math.max(F.width, 1)}px`
1366
+ top: `${f.top}px`,
1367
+ width: `${Math.max(f.width, 1)}px`
1273
1368
  };
1274
- }), N = u(() => ({
1369
+ }), q = u(() => ({
1275
1370
  cursor: n.enterable ? "text" : void 0,
1276
- height: c(n.height),
1277
- maxHeight: c(n.maxHeight),
1278
- maxWidth: c(n.maxWidth),
1279
- minHeight: c(n.minHeight),
1280
- minWidth: c(n.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: c(n.width)
1283
- })), P = u(() => ({
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 I(F) {
1288
- return F.closest("body") ?? document.body;
1289
- }
1290
- function f(F) {
1291
- return F || (typeof n.selector == "string" ? document.querySelector(n.selector) ?? void 0 : n.selector);
1292
- }
1293
- function d() {
1294
- const F = T.value;
1295
- if (!F?.isConnected)
1296
- return H();
1297
- const Q = F.getBoundingClientRect();
1298
- return C.value = {
1299
- height: Q.height,
1300
- left: Q.left,
1301
- top: Q.top,
1302
- width: Q.width
1303
- }, Te(() => m.value?.forcePopupAlign?.());
1304
- }
1305
- function l(F, Q) {
1306
- const ne = f(F);
1307
- return ne ? (T.value = ne, b.value = Q ?? n.content ?? "", B.value = !0, p.visible = !0, v("update:modelValue", !0), d()) : Te();
1308
- }
1309
- function O(F, Q, ne) {
1310
- const ae = F.currentTarget instanceof HTMLElement ? F.currentTarget : void 0;
1311
- return l(Q ?? ae, ne);
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 H() {
1314
- return B.value = !1, T.value = void 0, C.value = void 0, p.visible = !1, v("update:modelValue", !1), Te();
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 Y(F) {
1317
- F && k && (clearTimeout(k), k = void 0), B.value = F;
1411
+ function j(f) {
1412
+ f && z && (clearTimeout(z), z = void 0), $.value = f;
1318
1413
  }
1319
- function $() {
1320
- return B.value;
1414
+ function _() {
1415
+ return $.value;
1321
1416
  }
1322
- function L() {
1323
- p.visible && d();
1417
+ function H() {
1418
+ v.visible && S();
1324
1419
  }
1325
- function K() {
1326
- Y(!1), n.enterable && (k = setTimeout(() => {
1327
- k = void 0, B.value || H();
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 Re(() => {
1331
- window.addEventListener("resize", L), window.addEventListener("scroll", L, !0), n.modelValue && l(void 0, n.content);
1332
- }), Ce(() => {
1333
- k && clearTimeout(k), window.removeEventListener("resize", L), window.removeEventListener("scroll", L, !0);
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: H,
1336
- isActived: $,
1337
- open: l,
1338
- openByEvent: O,
1339
- reactData: p,
1340
- setActived: Y,
1341
- toVisible: l,
1342
- updatePlacement: d
1343
- }), (F, Q) => (a(), M(s(x), Z({ ref: "tooltip" }, P.value, {
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": I,
1346
- open: p.visible,
1347
- "overlay-inner-style": N.value,
1440
+ "get-popup-container": U,
1441
+ open: v.visible,
1442
+ "overlay-inner-style": q.value,
1348
1443
  placement: "top"
1349
1444
  }), {
1350
- title: S(() => [
1351
- E("div", {
1445
+ title: R(() => [
1446
+ M("div", {
1352
1447
  class: "yee-ui-grid-tooltip-content",
1353
- onMouseenter: Q[0] || (Q[0] = (ne) => n.enterable && Y(!0)),
1354
- onMouseleave: K
1448
+ onMouseenter: E[0] || (E[0] = (Z) => n.enterable && j(!0)),
1449
+ onMouseleave: m
1355
1450
  }, [
1356
- U(F.$slots, "content", {}, () => [
1357
- ie(D(b.value), 1)
1451
+ W(f.$slots, "content", {}, () => [
1452
+ ce(Y(y.value), 1)
1358
1453
  ])
1359
1454
  ], 32)
1360
1455
  ]),
1361
- default: S(() => [
1362
- E("span", {
1456
+ default: R(() => [
1457
+ M("span", {
1363
1458
  "aria-hidden": "true",
1364
1459
  class: "yee-ui-grid-tooltip-anchor",
1365
- style: he(w.value)
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 Je = !1;
1373
- const De = /* @__PURE__ */ new Set();
1374
- function en() {
1375
- const o = Ee.modal.confirm.bind(Ee.modal);
1376
- Ee.modal.confirm = ((t, e, n) => {
1377
- const v = typeof t == "object" && t !== null ? t : typeof n == "object" && n !== null ? n : void 0;
1378
- if ((typeof v?.className == "string" ? v.className.split(/\s+/) : []).includes("vxe-table--ignore-clear")) {
1379
- const p = [...De], m = p[p.length - 1];
1380
- if (m) {
1381
- const C = typeof v?.content == "string" ? v.content : String(v?.content ?? t);
1382
- return m(C);
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 tn(o) {
1389
- return De.add(o), () => De.delete(o);
1483
+ function kn(o) {
1484
+ return Ie.add(o), () => Ie.delete(o);
1390
1485
  }
1391
- function it() {
1392
- if (Je) return;
1486
+ function st() {
1487
+ if (Qe) return;
1393
1488
  [
1394
- zt,
1395
- Nt,
1396
- Pt,
1397
- nt,
1398
- Ht,
1399
- Lt,
1400
- At,
1401
- Ut,
1402
- jt,
1403
- Dt,
1404
- It,
1405
- Yt,
1406
- Wt,
1407
- qt,
1408
- Gt,
1409
- Zo
1410
- ].forEach((t) => Ee.component(t)), en(), Je = !0;
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 on = {
1507
+ const Sn = {
1413
1508
  key: 1,
1414
1509
  class: "yee-ui-grid__separator"
1415
- }, nn = { class: "yee-ui-grid__table-container" }, an = {
1510
+ }, Tn = { class: "yee-ui-grid__table-container" }, $n = {
1416
1511
  key: 0,
1417
1512
  class: "yee-ui-grid__title"
1418
- }, ln = /* @__PURE__ */ oe({
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 = ze(), n = xe("gridRef"), v = Oe(Ne), x = Oe(lt, void 0), [p, m] = et.useModal();
1428
- it();
1429
- const C = tn((d) => new Promise((l) => {
1430
- p.confirm({
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: d,
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: () => l("confirm"),
1439
- onCancel: () => l("cancel")
1533
+ onOk: () => a("confirm"),
1534
+ onCancel: () => a("cancel")
1440
1535
  });
1441
- })), b = u(() => t.api.state.value), T = u(() => b.value.formOptions), B = u(() => !!(t.tableTitle || e["table-title"] || e["toolbar-actions"] || e["toolbar-tools"])), k = u(() => Object.keys(e).filter((d) => ![
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(d))), c = u(() => x?.value ?? !1), w = u(() => {
1448
- const d = b.value.gridOptions, l = d.proxyConfig, O = l?.ajax?.query, H = d.toolbarConfig, Y = d.pagerConfig;
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
- ...c.value ? { height: "auto" } : {},
1457
- ...d,
1551
+ ...p.value ? { height: "auto" } : {},
1552
+ ...S,
1458
1553
  columnConfig: {
1459
1554
  resizable: !0,
1460
- ...d.columnConfig
1555
+ ...S.columnConfig
1461
1556
  },
1462
1557
  tooltipConfig: {
1463
1558
  enterable: !0,
1464
1559
  leaveDelay: 300,
1465
- ...d.tooltipConfig
1560
+ ...S.tooltipConfig
1466
1561
  },
1467
- ...Y ? {
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
- ...Y,
1567
+ ...j,
1473
1568
  slots: {
1474
1569
  sizes: "pagerSizes",
1475
- ...Y.slots
1570
+ ...j.slots
1476
1571
  }
1477
1572
  }
1478
1573
  } : {},
1479
- ...l ? {
1574
+ ...a ? {
1480
1575
  proxyConfig: {
1481
1576
  autoLoad: !0,
1482
1577
  showResponseMsg: !1,
1483
- ...l,
1578
+ ...a,
1484
1579
  response: {
1485
1580
  list: "items",
1486
1581
  result: "items",
1487
1582
  total: "total",
1488
- ...l.response
1583
+ ...a.response
1489
1584
  },
1490
- ...l.ajax ? {
1585
+ ...a.ajax ? {
1491
1586
  ajax: {
1492
- ...l.ajax,
1493
- ...O ? {
1494
- query: ($) => O($, t.api.formApi.getValues())
1587
+ ...a.ajax,
1588
+ ...C ? {
1589
+ query: (_) => C(_, t.api.formApi.getValues())
1495
1590
  } : {}
1496
1591
  }
1497
1592
  } : {}
1498
1593
  }
1499
1594
  } : {},
1500
- ...H || B.value ? {
1595
+ ...B || $.value ? {
1501
1596
  toolbarConfig: {
1502
1597
  custom: !0,
1503
1598
  refresh: !0,
1504
1599
  zoom: !0,
1505
- ...H,
1600
+ ...B,
1506
1601
  slots: {
1507
1602
  ...t.tableTitle || e["table-title"] || e["toolbar-actions"] ? { buttons: "toolbarActions" } : {},
1508
- ...e["toolbar-tools"] || H?.search ? { tools: "toolbarTools" } : {}
1603
+ ...e["toolbar-tools"] || B?.search ? { tools: "toolbarTools" } : {}
1509
1604
  }
1510
1605
  }
1511
1606
  } : {}
1512
1607
  };
1513
- }), N = u(() => b.value.gridEvents ?? {});
1514
- ke(
1515
- () => v?.value.mode ?? "light",
1516
- (d) => Ee.setTheme(d),
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 P() {
1614
+ async function N() {
1520
1615
  await t.api.reload();
1521
1616
  }
1522
- async function I() {
1617
+ async function U() {
1523
1618
  await t.api.reload();
1524
1619
  }
1525
- function f(d, l) {
1526
- typeof l != "number" && typeof l != "string" || d.setPageSizeByEvent(new Event("change"), l);
1620
+ function G(S, a) {
1621
+ typeof a != "number" && typeof a != "string" || S.setPageSizeByEvent(new Event("change"), a);
1527
1622
  }
1528
- return Re(() => {
1623
+ return Fe(() => {
1529
1624
  n.value && t.api.mount(n.value);
1530
- }), ht(() => {
1531
- C(), t.api.unmount();
1532
- }), (d, l) => (a(), h("section", {
1533
- class: ye(["yee-ui-grid", { "yee-ui-grid--fill-page-content": c.value }])
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 ? gt((a(), M(Jo, {
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": I,
1540
- "on-submit": P
1634
+ "on-reset": U,
1635
+ "on-submit": N
1541
1636
  }, null, 8, ["api", "options"])), [
1542
- [bt, o.api.searchFormVisible.value]
1543
- ]) : z("", !0),
1544
- T.value && b.value.separator !== !1 ? (a(), h("div", on)) : z("", !0),
1545
- E("div", nn, [
1546
- te(s(nt), Z({
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
- }, w.value, wt(N.value)), Me({
1551
- toolbarActions: S((O) => [
1552
- U(d.$slots, "table-title", {}, () => [
1553
- o.tableTitle ? (a(), h("div", an, [
1554
- ie(D(o.tableTitle) + " ", 1),
1555
- o.tableTitleHelp ? (a(), M(s(re), {
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: S(() => [...l[0] || (l[0] = [
1560
- E("span", {
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"])) : z("", !0)
1567
- ])) : z("", !0)
1661
+ }, 8, ["title"])) : V("", !0)
1662
+ ])) : V("", !0)
1568
1663
  ], !0),
1569
- U(d.$slots, "toolbar-actions", ve(me(O)), void 0, !0)
1664
+ W(S.$slots, "toolbar-actions", Re(Me(C)), void 0, !0)
1570
1665
  ]),
1571
- toolbarTools: S((O) => [
1572
- U(d.$slots, "toolbar-tools", ve(me(O)), void 0, !0)
1666
+ toolbarTools: R((C) => [
1667
+ W(S.$slots, "toolbar-tools", Re(Me(C)), void 0, !0)
1573
1668
  ]),
1574
- pagerSizes: S(({ $pager: O, options: H, pageSize: Y }) => [
1575
- te(s(Ve), {
1669
+ pagerSizes: R(({ $pager: C, options: B, pageSize: j }) => [
1670
+ ie(r(Ye), {
1576
1671
  class: "yee-ui-grid__page-size",
1577
- options: H,
1578
- value: Y,
1579
- onChange: ($) => f(O, $)
1672
+ options: B,
1673
+ value: j,
1674
+ onChange: (_) => G(C, _)
1580
1675
  }, null, 8, ["options", "value", "onChange"])
1581
1676
  ]),
1582
- empty: S(() => [
1583
- U(d.$slots, "empty", {}, () => [
1584
- l[1] || (l[1] = E("div", { class: "yee-ui-grid__empty" }, "暂无数据", -1))
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
- Se(k.value, (O) => ({
1590
- name: O,
1591
- fn: S((H) => [
1592
- U(d.$slots, O, ve(me(H)), void 0, !0)
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
- te(s(m))
1692
+ ie(r(d))
1598
1693
  ], 2));
1599
1694
  }
1600
- }), sn = /* @__PURE__ */ ue(ln, [["__scopeId", "data-v-efa010c8"]]);
1601
- function Un(o) {
1602
- it();
1603
- const t = new Xo(o), e = sn;
1604
- return [oe({
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(v, { attrs: x, slots: p }) {
1612
- return Ce(() => t.unmount()), () => Xe(e, {
1613
- ...x,
1706
+ setup(c, { attrs: b, slots: v }) {
1707
+ return xe(() => t.unmount()), () => Ze(e, {
1708
+ ...b,
1614
1709
  api: t,
1615
- ...v.tableTitle ? { tableTitle: v.tableTitle } : {},
1616
- ...v.tableTitleHelp ? { tableTitleHelp: v.tableTitleHelp } : {}
1617
- }, p);
1710
+ ...c.tableTitle ? { tableTitle: c.tableTitle } : {},
1711
+ ...c.tableTitleHelp ? { tableTitleHelp: c.tableTitleHelp } : {}
1712
+ }, v);
1618
1713
  }
1619
1714
  }), t];
1620
1715
  }
1621
- const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui-modal__title" }, dn = {
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
- }, fn = { class: "yee-ui-modal__body" }, pn = { class: "yee-ui-modal__footer" }, vn = { class: "yee-ui-modal__header" }, mn = ["id"], yn = { class: "yee-ui-modal__title" }, hn = { class: "yee-ui-modal__header-actions" }, gn = { class: "yee-ui-modal__body" }, bn = { class: "yee-ui-modal__footer" }, wn = /* @__PURE__ */ oe({
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, v = Ue(o, "open"), x = Ue(e, "fullscreen"), p = Ze(), m = ze(), C = _t(), b = u(() => e.type === "drawer"), T = u(() => !b.value && x.value), B = u(() => !!(e.title || m.header)), k = u(() => B.value || e.closable), c = u(() => B.value || e.fullscreenButton || e.closable), w = u(() => T.value ? "退出全屏" : "进入全屏"), N = u(() => {
1653
- const L = Object.prototype.hasOwnProperty.call(e.wrapProps ?? {}, "aria-labelledby");
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": L ? e.wrapProps?.["aria-labelledby"] : B.value ? C : void 0
1752
+ "aria-labelledby": H ? e.wrapProps?.["aria-labelledby"] : $.value ? x : void 0
1657
1753
  };
1658
- }), P = u(() => {
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 I() {
1670
- const { style: L, ...K } = p;
1671
- return K;
1765
+ function U() {
1766
+ const { style: H, ...m } = v;
1767
+ return m;
1672
1768
  }
1673
- function f() {
1674
- return [p.style, e.style].filter(Boolean);
1769
+ function G() {
1770
+ return [v.style, e.style].filter(Boolean);
1675
1771
  }
1676
- function d() {
1677
- return [p.style, e.style, P.value].filter(Boolean);
1772
+ function S() {
1773
+ return [v.style, e.style, N.value].filter(Boolean);
1678
1774
  }
1679
- const l = () => m.closeIcon?.() ?? p.closeIcon ?? Xe(Vt);
1680
- function O(L) {
1681
- n("cancel", L), v.value = !1;
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(L) {
1684
- n("confirm", L);
1779
+ function B(H) {
1780
+ n("confirm", H);
1685
1781
  }
1686
- function Y() {
1782
+ function j() {
1687
1783
  n("close");
1688
1784
  }
1689
- function $() {
1690
- x.value = !x.value;
1785
+ function _() {
1786
+ b.value = !b.value;
1691
1787
  }
1692
- return (L, K) => b.value ? (a(), M(s(Tt), Z({ key: 0 }, I(), {
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: v.value,
1699
- style: f(),
1794
+ open: c.value,
1795
+ style: G(),
1700
1796
  width: e.width,
1701
- onAfterOpenChange: K[0] || (K[0] = (F) => !F && Y()),
1702
- onClose: O
1703
- }), Me({
1704
- footer: S(() => [
1705
- E("div", pn, [
1706
- U(L.$slots, "footer", {}, () => [
1707
- e.showCancelButton ? (a(), M(s(se), {
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: O
1805
+ onClick: C
1710
1806
  }, {
1711
- default: S(() => [
1712
- ie(D(e.cancelButtonText), 1)
1807
+ default: R(() => [
1808
+ ce(Y(e.cancelButtonText), 1)
1713
1809
  ]),
1714
1810
  _: 1
1715
- })) : z("", !0),
1716
- e.showConfirmButton ? (a(), M(s(se), {
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: H
1816
+ onClick: B
1721
1817
  }, {
1722
- default: S(() => [
1723
- ie(D(e.confirmButtonText), 1)
1818
+ default: R(() => [
1819
+ ce(Y(e.confirmButtonText), 1)
1724
1820
  ]),
1725
1821
  _: 1
1726
- }, 8, ["loading"])) : z("", !0)
1822
+ }, 8, ["loading"])) : V("", !0)
1727
1823
  ], !0)
1728
1824
  ])
1729
1825
  ]),
1730
- default: S(() => [
1731
- E("div", fn, [
1732
- U(L.$slots, "default", {}, void 0, !0)
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
- k.value ? {
1833
+ z.value ? {
1738
1834
  name: "title",
1739
- fn: S(() => [
1740
- E("div", rn, [
1741
- B.value ? (a(), h("div", {
1835
+ fn: R(() => [
1836
+ M("div", En, [
1837
+ $.value ? (i(), h("div", {
1742
1838
  key: 0,
1743
- id: s(C),
1839
+ id: r(x),
1744
1840
  class: "yee-ui-modal__heading"
1745
1841
  }, [
1746
- U(L.$slots, "header", {}, () => [
1747
- E("span", cn, D(e.title), 1)
1842
+ W(H.$slots, "header", {}, () => [
1843
+ M("span", Mn, Y(e.title), 1)
1748
1844
  ], !0)
1749
- ], 8, un)) : z("", !0),
1750
- e.closable ? (a(), h("div", dn, [
1751
- te(s(se), {
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: O
1852
+ onClick: C
1757
1853
  }, {
1758
- default: S(() => [
1759
- te(l)
1854
+ default: R(() => [
1855
+ ie(a)
1760
1856
  ]),
1761
1857
  _: 1
1762
1858
  })
1763
- ])) : z("", !0)
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"])) : (a(), M(s(et), Z({ key: 1 }, I(), {
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: v.value,
1779
- style: d(),
1874
+ open: c.value,
1875
+ style: S(),
1780
1876
  width: T.value ? "100vw" : e.width,
1781
- "wrap-props": N.value,
1782
- onAfterClose: Y,
1783
- onCancel: O
1784
- }), Me({
1785
- footer: S(() => [
1786
- E("div", bn, [
1787
- U(L.$slots, "footer", {}, () => [
1788
- e.showCancelButton ? (a(), M(s(se), {
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: O
1886
+ onClick: C
1791
1887
  }, {
1792
- default: S(() => [
1793
- ie(D(e.cancelButtonText), 1)
1888
+ default: R(() => [
1889
+ ce(Y(e.cancelButtonText), 1)
1794
1890
  ]),
1795
1891
  _: 1
1796
- })) : z("", !0),
1797
- e.showConfirmButton ? (a(), M(s(se), {
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: H
1897
+ onClick: B
1802
1898
  }, {
1803
- default: S(() => [
1804
- ie(D(e.confirmButtonText), 1)
1899
+ default: R(() => [
1900
+ ce(Y(e.confirmButtonText), 1)
1805
1901
  ]),
1806
1902
  _: 1
1807
- }, 8, ["loading"])) : z("", !0)
1903
+ }, 8, ["loading"])) : V("", !0)
1808
1904
  ], !0)
1809
1905
  ])
1810
1906
  ]),
1811
- default: S(() => [
1812
- E("div", gn, [
1813
- U(L.$slots, "default", {}, void 0, !0)
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
- c.value ? {
1914
+ p.value ? {
1819
1915
  name: "title",
1820
- fn: S(() => [
1821
- E("div", vn, [
1822
- B.value ? (a(), h("div", {
1916
+ fn: R(() => [
1917
+ M("div", Pn, [
1918
+ $.value ? (i(), h("div", {
1823
1919
  key: 0,
1824
- id: s(C),
1920
+ id: r(x),
1825
1921
  class: "yee-ui-modal__heading"
1826
1922
  }, [
1827
- U(L.$slots, "header", {}, () => [
1828
- E("span", yn, D(e.title), 1)
1923
+ W(H.$slots, "header", {}, () => [
1924
+ M("span", Hn, Y(e.title), 1)
1829
1925
  ], !0)
1830
- ], 8, mn)) : z("", !0),
1831
- E("div", hn, [
1832
- e.fullscreenButton ? (a(), M(s(re), {
1926
+ ], 8, Nn)) : V("", !0),
1927
+ M("div", Ln, [
1928
+ e.fullscreenButton ? (i(), A(r(pe), {
1833
1929
  key: 0,
1834
- title: w.value
1930
+ title: F.value
1835
1931
  }, {
1836
- default: S(() => [
1837
- te(s(se), {
1838
- "aria-label": w.value,
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: S(() => [
1846
- T.value ? (a(), M(s(tt), { key: 0 })) : (a(), M(s(ot), { key: 1 }))
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"])) : z("", !0),
1853
- e.closable ? (a(), M(s(se), {
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: O
1955
+ onClick: C
1860
1956
  }, {
1861
- default: S(() => [
1862
- te(l)
1957
+ default: R(() => [
1958
+ ie(a)
1863
1959
  ]),
1864
1960
  _: 1
1865
- })) : z("", !0)
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
- }), jn = /* @__PURE__ */ ue(wn, [["__scopeId", "data-v-6cb12c49"]]), _n = { class: "yee-ui-page__heading" }, xn = {
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
- }, kn = {
1972
+ }, Wn = {
1877
1973
  key: 0,
1878
1974
  class: "yee-ui-page__description"
1879
- }, Cn = {
1975
+ }, qn = {
1880
1976
  key: 0,
1881
1977
  class: "yee-ui-page__extra"
1882
- }, $n = /* @__PURE__ */ oe({
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 = ze(), n = u(() => !!(t.description || t.title || e.description || e.extra || e.title)), v = u(() => t.autoContentHeight);
1896
- Qe(lt, v);
1897
- const x = R(0), p = R(0), m = R(!1), C = xe("headerRef"), b = xe("footerRef");
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 B() {
1900
- const P = C.value?.offsetHeight ?? 0, I = b.value?.offsetHeight ?? 0;
1901
- x.value !== P && (x.value = P), p.value !== I && (p.value = I);
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 k() {
1904
- T?.disconnect(), T = void 0, !(typeof ResizeObserver > "u") && (T = new ResizeObserver(B), C.value && T.observe(C.value), b.value && T.observe(b.value));
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 c() {
2002
+ async function p() {
1907
2003
  if (T?.disconnect(), T = void 0, !t.autoContentHeight) {
1908
- m.value = !1;
2004
+ d.value = !1;
1909
2005
  return;
1910
2006
  }
1911
- await Te(), B(), m.value = !0, k();
2007
+ await Te(), $(), d.value = !0, z();
1912
2008
  }
1913
- const w = u(() => ({
2009
+ const F = u(() => ({
1914
2010
  "--yee-page-height-offset": typeof t.heightOffset == "number" ? `${t.heightOffset}px` : t.heightOffset
1915
- })), N = u(() => t.autoContentHeight ? {
1916
- height: `calc(100% - ${x.value}px - ${p.value}px)`,
1917
- overflowY: m.value ? "auto" : "hidden"
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 ke(
2015
+ return $e(
1920
2016
  [() => t.autoContentHeight, n, () => !!e.footer],
1921
2017
  () => {
1922
- c();
2018
+ p();
1923
2019
  },
1924
2020
  { flush: "post" }
1925
- ), Re(() => {
1926
- c();
1927
- }), Ce(() => T?.disconnect()), (P, I) => (a(), h("section", {
1928
- class: ye(["yee-ui-page", { "yee-ui-page--auto-height": o.autoContentHeight }]),
1929
- style: he(w.value)
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 ? (a(), h("header", {
2027
+ n.value ? (i(), h("header", {
1932
2028
  key: 0,
1933
2029
  ref_key: "headerRef",
1934
- ref: C,
1935
- class: ye(["yee-ui-page__header", o.headerClass])
2030
+ ref: x,
2031
+ class: ge(["yee-ui-page__header", o.headerClass])
1936
2032
  }, [
1937
- E("div", _n, [
1938
- U(P.$slots, "title", {}, () => [
1939
- o.title ? (a(), h("h1", xn, D(o.title), 1)) : z("", !0)
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
- U(P.$slots, "description", {}, () => [
1942
- o.description ? (a(), h("p", kn, D(o.description), 1)) : z("", !0)
2037
+ W(N.$slots, "description", {}, () => [
2038
+ o.description ? (i(), h("p", Wn, Y(o.description), 1)) : V("", !0)
1943
2039
  ], !0)
1944
2040
  ]),
1945
- P.$slots.extra ? (a(), h("div", Cn, [
1946
- U(P.$slots, "extra", {}, void 0, !0)
1947
- ])) : z("", !0)
1948
- ], 2)) : z("", !0),
1949
- E("main", {
1950
- class: ye(["yee-ui-page__content", o.contentClass]),
1951
- style: he(N.value)
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
- U(P.$slots, "default", {}, void 0, !0)
2049
+ W(N.$slots, "default", {}, void 0, !0)
1954
2050
  ], 6),
1955
- P.$slots.footer ? (a(), h("footer", {
2051
+ N.$slots.footer ? (i(), h("footer", {
1956
2052
  key: 1,
1957
2053
  ref_key: "footerRef",
1958
- ref: b,
1959
- class: ye(["yee-ui-page__footer", o.footerClass])
2054
+ ref: y,
2055
+ class: ge(["yee-ui-page__footer", o.footerClass])
1960
2056
  }, [
1961
- U(P.$slots, "footer", {}, void 0, !0)
1962
- ], 2)) : z("", !0)
2057
+ W(N.$slots, "footer", {}, void 0, !0)
2058
+ ], 2)) : V("", !0)
1963
2059
  ], 6));
1964
2060
  }
1965
- }), Dn = /* @__PURE__ */ ue($n, [["__scopeId", "data-v-ff8fc3a1"]]), Sn = { class: "yee-ui-select__option-label" }, Tn = /* @__PURE__ */ oe({
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 t = o, e = Ue(o, "value"), n = Ze(), v = ze(), x = R(!1), p = u(() => ({
1979
- label: t.fieldNames?.label ?? "label",
1980
- options: t.fieldNames?.options ?? "options",
1981
- value: t.fieldNames?.value ?? "value"
1982
- })), m = u(() => n.class), C = u(() => n.style), b = u(() => {
1983
- const f = {};
1984
- for (const [d, l] of Object.entries(n))
1985
- d !== "class" && d !== "style" && d !== "onDropdownVisibleChange" && (f[d] = l);
1986
- return f;
1987
- }), T = u(() => !v.default && !v.option);
1988
- function B(f) {
1989
- const d = n.onDropdownVisibleChange;
1990
- if (typeof d == "function") {
1991
- d(f);
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
- d?.forEach((l) => l?.(f));
2092
+ f?.forEach((E) => E?.(m));
1995
2093
  }
1996
- function k(f) {
1997
- x.value = f, B(f);
2094
+ function U(m) {
2095
+ x.value = m, N(m);
1998
2096
  }
1999
- function c(f) {
2000
- return typeof f == "number" || typeof f == "string" ? String(f) : "";
2097
+ function G(m) {
2098
+ return typeof m == "number" || typeof m == "string" ? String(m) : "";
2001
2099
  }
2002
- function w(f, d) {
2003
- if (f)
2004
- for (const l of f) {
2005
- const O = l[p.value.options], H = w(O, d);
2006
- if (H) return H;
2007
- const Y = l[p.value.value];
2008
- if (Y === d || String(Y) === String(d)) return l;
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 N(f) {
2012
- return f ? c(f[p.value.label]) || c(f.title) || c(f[p.value.value]) : "";
2109
+ function a(m) {
2110
+ return m ? G(m[y.value.label]) || G(m.title) || G(m[y.value.value]) : "";
2013
2111
  }
2014
- const P = u(() => {
2015
- const f = e.value;
2016
- if (!(f == null || f === ""))
2017
- return Array.isArray(f) ? f.map((d) => N(w(t.options, d)) || c(d)).filter(Boolean).join("、") || void 0 : N(w(t.options, f)) || c(f) || void 0;
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 I(f) {
2020
- return N(f);
2021
- }
2022
- return (f, d) => (a(), M(s(re), Z(x.value ? { open: !1 } : {}, { title: P.value }), {
2023
- default: S(() => [
2024
- E("div", {
2025
- class: ye(["yee-ui-select", m.value]),
2026
- style: he(C.value)
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
- T.value ? (a(), M(s(Ve), Z({
2135
+ p.value ? (i(), A(r(e), se({
2029
2136
  key: 0,
2030
- value: e.value,
2031
- "onUpdate:value": d[0] || (d[0] = (l) => e.value = l)
2032
- }, b.value, {
2033
- "field-names": p.value,
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: k
2036
- }), {
2037
- option: S((l) => [
2038
- te(s(re), {
2039
- title: I(l),
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: S(() => [
2043
- E("span", Sn, D(I(l)), 1)
2150
+ default: R(() => [
2151
+ M("span", Kn, Y(B(E)), 1)
2044
2152
  ]),
2045
2153
  _: 2
2046
2154
  }, 1032, ["title"])
2047
2155
  ]),
2048
- _: 1
2049
- }, 16, ["value", "field-names", "options"])) : (a(), M(s(Ve), Z({
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
- value: e.value,
2052
- "onUpdate:value": d[1] || (d[1] = (l) => e.value = l)
2053
- }, b.value, {
2054
- "field-names": p.value,
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: k
2057
- }), Me({ _: 2 }, [
2058
- f.$slots.default ? {
2059
- name: "default",
2060
- fn: S((l) => [
2061
- U(f.$slots, "default", ve(me(l)), void 0, !0)
2062
- ]),
2063
- key: "0"
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
- }), In = /* @__PURE__ */ ue(Tn, [["__scopeId", "data-v-028e2b2a"]]);
2186
+ }), Qn = /* @__PURE__ */ me(Jn, [["__scopeId", "data-v-8acc9d8f"]]), pa = Qn;
2100
2187
  export {
2101
- Vn as CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT,
2102
- Nn as PlatformConfigProvider,
2103
- Pn as YeeDescriptions,
2104
- Hn as YeeEllipsisText,
2105
- An as YeeFilePreview,
2106
- Ln as YeeFileUpload,
2107
- Jo as YeeForm,
2108
- Qo as YeeFormApi,
2109
- Xo as YeeGridApi,
2110
- jn as YeeModal,
2111
- Dn as YeePage,
2112
- In as YeeSelect,
2113
- qn as darkThemeTokens,
2114
- Gn as lightThemeTokens,
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
- Bt as resolvePlatformTheme,
2117
- Ft as toAntDesignTheme,
2118
- Et as toPlatformCssVariables,
2119
- zn as usePlatformTheme,
2120
- Un as useYeeGrid
2203
+ qt as resolvePlatformTheme,
2204
+ Gt as toAntDesignTheme,
2205
+ Kt as toPlatformCssVariables,
2206
+ la as usePlatformTheme,
2207
+ ca as useYeeGrid
2121
2208
  };