@yeepay/yee-boss-ui 0.1.14 → 0.1.15

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