@yeepay/yee-boss-ui 0.1.13 → 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 +1104 -1032
  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 Me, defineComponent as ae, computed as u, provide as Qe, openBlock as a, createBlock as M, unref as s, withCtx as $, createElementVNode as F, normalizeStyle as he, renderSlot as L, reactive as De, onBeforeUnmount as Ce, mergeProps as ee, createElementBlock as h, Fragment as _e, renderList as $e, createTextVNode as ie, toDisplayString as j, normalizeClass as ye, createCommentVNode as z, useTemplateRef as xe, shallowRef as O, onMounted as Re, onUpdated as vt, watch as ke, nextTick as Te, ref as mt, createVNode as ne, withModifiers as yt, useSlots as Oe, onUnmounted as ht, withDirectives as gt, vShow as bt, toHandlers as wt, createSlots as Ve, 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 ue, Upload as kt, Image as Ct, DatePicker as St, Input as $t, Select as ze, Button as re, 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 It, VxeModal as Dt, 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 = Me(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__ */ ae({
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)), m = u(() => Et(e.value));
23
- return Qe(Ne, e), (x, g) => (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: $(() => [
28
- F("div", {
27
+ default: F(() => [
28
+ M("div", {
29
29
  class: "yee-ui-platform-theme",
30
30
  "data-theme": e.value.mode,
31
- style: he(m.value)
31
+ style: ge(f.value)
32
32
  }, [
33
- L(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
- }), ce = (o, t) => {
39
+ }), pe = (o, t) => {
40
40
  const e = o.__vccOpts || o;
41
- for (const [n, m] of t)
42
- e[n] = m;
41
+ for (const [n, f] of t)
42
+ e[n] = f;
43
43
  return e;
44
- }, Nn = /* @__PURE__ */ ce(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__ */ ae({
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), m = u(() => t.column ?? 3), x = u(() => t.layout ?? "horizontal"), g = u(() => t.size ?? "default"), d = De(/* @__PURE__ */ new Set()), S = /* @__PURE__ */ new Set();
95
- function b(B, C) {
96
- return B.name ?? `${B.label}-${C}`;
97
- }
98
- async function T(B, C) {
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
- d.add(C), Be.success("已复制");
109
- const p = setTimeout(() => {
110
- d.delete(C), S.delete(p);
108
+ v.add(R), $e.success("已复制");
109
+ const c = setTimeout(() => {
110
+ v.delete(R), C.delete(c);
111
111
  }, 1500);
112
- S.add(p);
112
+ C.add(c);
113
113
  }
114
- return Ce(() => {
115
- S.forEach((B) => clearTimeout(B)), S.clear();
116
- }), (B, C) => (a(), M(s(qe), ee({
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: m.value,
121
- layout: x.value,
122
- size: g.value
120
+ column: f.value,
121
+ layout: _.value,
122
+ size: h.value
123
123
  }, t.title === void 0 ? {} : { title: t.title }), {
124
- default: $(() => [
125
- (a(!0), h(_e, null, $e(o.items, (c, p) => (a(), M(s(qe).Item, {
126
- key: b(c, p),
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: $(() => [
131
- F("div", Xt, [
132
- F("div", Zt, [
133
- c.ellipsis ? (a(), M(s(ue), {
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: $(() => [
138
- F("span", eo, [
139
- L(B.$slots, `content-${c.name ?? c.label}`, { item: c }, () => [
140
- ie(j(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
- L(B.$slots, `content-${c.name ?? c.label}`, { item: c }, () => [
147
- ie(j(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(ue), {
150
+ p.copyable ? (i(), L(s(fe), {
151
151
  key: 2,
152
- title: d.has(b(c, p)) ? "已复制" : "复制"
152
+ title: v.has(y(p, c)) ? "已复制" : "复制"
153
153
  }, {
154
- default: $(() => [
155
- F("button", {
156
- class: ye(["yee-ui-descriptions__copy", { "yee-ui-descriptions__copy--copied": d.has(b(c, p)) }]),
157
- "aria-label": d.has(b(c, p)) ? "已复制" : "复制",
158
- disabled: d.has(b(c, p)),
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, p))
160
+ onClick: (N) => T(p, y(p, c))
161
161
  }, [
162
- d.has(b(c, p)) ? (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
- }, j(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__ */ ce(no, [["__scopeId", "data-v-91a3a5f3"]]), ao = ["aria-expanded", "role", "tabindex"], lo = /* @__PURE__ */ ae({
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, m = Me(Ne, void 0), x = xe("text"), g = O(!1), d = O(!1), S = O(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), C = u(() => {
202
- const k = { maxWidth: B.value };
203
- return !d.value && b.value > 1 && (k.webkitLineClamp = b.value), k;
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": d.value,
207
- "yee-ui-ellipsis-text--multi-line": !d.value && b.value > 1,
208
- "yee-ui-ellipsis-text--single-line": !d.value && b.value === 1
209
- })), p = u(() => e.tooltipMaxWidth !== void 0 ? e.tooltipMaxWidth : S.value > 0 ? S.value + 24 : void 0), N = u(() => {
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
210
  const k = {};
211
- return p.value !== void 0 && (k.maxWidth = `${p.value}px`), k;
212
- }), P = u(() => {
211
+ return c.value !== void 0 && (k.maxWidth = `${c.value}px`), k;
212
+ }), $ = r(() => {
213
213
  const k = {
214
214
  ...e.tooltipOverlayStyle,
215
- backgroundColor: I.value,
216
- color: e.tooltipColor || m?.value.tokens.popoverForeground || "var(--yee-popover-foreground)",
217
- fontSize: e.tooltipFontSize === void 0 ? m ? `${m.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 p.value !== void 0 && (k.maxWidth = `${p.value}px`), k;
220
- }), I = u(() => e.tooltipBackgroundColor || m?.value.tokens.popover || "var(--yee-popover)"), f = u(() => e.tooltip && !d.value && (!e.tooltipWhenEllipsis || g.value)), v = u(() => f.value ? {} : { open: !1 });
221
- let l;
222
- function E() {
223
- const k = x.value;
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
224
  if (!k) return;
225
- const D = k.getBoundingClientRect().width || k.clientWidth;
226
- if (S.value = Math.ceil(D), !e.tooltipWhenEllipsis || d.value || !k.textContent?.trim()) {
227
- g.value = !1;
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 G = b.value === 1 ? k.scrollWidth - k.clientWidth : k.scrollHeight - k.clientHeight;
231
- g.value = G > T.value;
230
+ const m = y.value === 1 ? k.scrollWidth - k.clientWidth : k.scrollHeight - k.clientHeight;
231
+ h.value = m > T.value;
232
232
  }
233
- function A() {
234
- e.expand && (d.value = !d.value, n("expandChange", d.value), Te(E));
235
- }
236
- function Y(k) {
237
- !e.expand || k.key !== "Enter" && k.key !== " " || (k.preventDefault(), A());
238
- }
239
- return Re(() => {
240
- const k = x.value;
241
- k && typeof ResizeObserver < "u" && (l = new ResizeObserver(E), l.observe(k)), E();
242
- }), vt(E), ke(() => e.expand, (k) => {
243
- k || (d.value = !1);
244
- }), Ce(() => {
245
- l?.disconnect(), l = void 0;
246
- }), (k, D) => (a(), M(s(ue), ee(v.value, {
247
- color: I.value,
248
- "overlay-inner-style": P.value,
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: $(() => [
253
- L(k.$slots, "tooltip", {}, () => [
254
- L(k.$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: $(() => [
258
- F("div", ee({ ref: "text" }, k.$attrs, {
259
- "aria-expanded": e.expand ? d.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: C.value,
262
+ style: R.value,
263
263
  tabindex: e.expand ? 0 : void 0,
264
- onClick: A,
265
- onKeydown: Y
264
+ onClick: I,
265
+ onKeydown: G
266
266
  }), [
267
- L(k.$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__ */ ce(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__ */ ae({
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, m = e, x = mt([]), g = O(!1), d = O(""), S = u(() => n.fileList ?? []), b = u(() => n.height ?? 100), T = u(() => n.manual ?? !1), B = u(() => n.maxCount ?? 10), C = u(() => n.maxSize ?? 20), c = u(() => n.multiple ?? !1), p = u(() => n.readonly ?? !1), N = u(() => n.uploadText ?? "上传文件"), P = u(() => n.width ?? 100), I = u(() => ({
295
- height: v(b.value),
296
- width: v(P.value)
297
- })), f = u(() => x.value.some((r) => r.status === "uploading"));
298
- ke(
299
- S,
300
- (r) => {
301
- x.value = r.map((y) => ({ ...y }));
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
+ C,
300
+ (a) => {
301
+ _.value = a.map((w) => ({ ...w }));
302
302
  },
303
303
  { immediate: !0 }
304
- ), ke(f, (r) => m("uploadingChange", r), { immediate: !0 });
305
- function v(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
- m("update:fileList", x.value.map((r) => ({ ...r })));
308
+ function u() {
309
+ f("update:fileList", _.value.map((a) => ({ ...a })));
310
310
  }
311
- function E(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 A(r) {
315
- return r.size <= C.value * 1024 * 1024 ? !1 : (Be.error(`文件大小不能超过 ${C.value}MB,当前为 ${E(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 k(r) {
321
- if (r.url) {
322
- if (Y(r)) {
323
- d.value = r.url, g.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 D(r) {
330
- g.value = r;
330
+ function A(a) {
331
+ h.value = a;
331
332
  }
332
- function G(r, y, H) {
333
- r.status = "done", r.percent = 100, y?.name && (r.name = y.name), y?.url && (r.url = y.url), l(), H(y), m("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 oe(r, y, H) {
336
- r.status = "error", l(), H(y);
336
+ function d(a, w, H) {
337
+ a.status = "error", u(), H(w);
337
338
  }
338
- function R(r, y, H, de) {
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), oe(le, J, de);
344
+ $e.error(J.message), d(ae, J, te);
344
345
  return;
345
346
  }
346
- let we = !1;
347
- const Se = {
348
- file: r,
347
+ let ue = !1;
348
+ const xe = {
349
+ file: a,
349
350
  onError: (J) => {
350
- we || (we = !0, oe(le, J, de));
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, G(le, J, H));
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(Se)).catch((J) => {
362
- Se.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
- Se.onError(J instanceof Error ? J : new Error("上传失败"));
366
+ xe.onError(J instanceof Error ? J : new Error("上传失败"));
366
367
  }
367
368
  }
368
- const Q = (r) => A(r) || T.value ? !1 : n.customRequest ? !0 : (Be.error("未配置 customRequest"), !1);
369
- function Z(r) {
370
- const y = r.file instanceof File ? r.file : void 0;
371
- if (!y || A(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 H = y.uid ?? String(Date.now());
376
- R(y, H, 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 se(r) {
381
- if (x.value = r.fileList.map((H) => ({ ...H })), l(), !T.value) return;
382
- const y = x.value.at(-1);
383
- y?.originFileObj instanceof File && m("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
- m("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 });
387
402
  }
388
- function be(r, y) {
389
- const H = x.value.find((de) => de.uid === r);
390
- H && G(H, y, () => {
403
+ function _e(a) {
404
+ f("fileRemoved", a);
405
+ }
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((H) => H.uid === r);
395
- y && oe(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 K() {
399
- return x.value.flatMap((r) => r.originFileObj instanceof File ? [r.originFileObj] : []);
400
- }
401
- return t({ addError: Fe, addResult: be, getFiles: K }), (r, y) => (a(), h("div", io, [
402
- !p.value || x.value.length > 0 ? (a(), M(s(kt), ee({ key: 0 }, o.accept ? { accept: o.accept } : {}, {
403
- "before-upload": Q,
404
- "custom-request": Z,
405
- "file-list": x.value,
406
- "max-count": B.value,
407
- multiple: c.value,
408
- "show-upload-list": { showRemoveIcon: !p.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: se,
428
+ onChange: we,
411
429
  onPreview: k,
412
- onRemove: ge
430
+ onRemove: _e
413
431
  }), {
414
- default: $(() => [
415
- !p.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] = F("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
- F("span", null, j(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
- d.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: g.value, onVisibleChange: D },
433
- src: d.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__ */ ce(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 m = typeof File < "u" && o instanceof File || typeof Blob < "u" && o instanceof Blob ? Ae(o.type) : void 0;
515
- return m || (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 = O("idle"), m = O(""), x = O(""), g = O(""), d = O(""), S = O(""), b = O([]), T = O([]), B = O(""), C = O(""), c = O(!1), p = O({ kind: "unsupported", fileName: "" }), N = O(), P = O(0), I = O(), f = u(() => o.source ?? o.url), v = u(() => String(o.fileName ?? "").trim() || at(f.value) || "未命名文件"), l = u(() => p.value.kind), E = u(() => n.value === "loading"), A = u(() => n.value === "ready"), Y = u(() => n.value === "error"), k = u(() => n.value === "unsupported");
526
- function D() {
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 G() {
530
- I.value?.abort(), I.value = void 0;
547
+ function m() {
548
+ j.value?.abort(), j.value = void 0;
531
549
  }
532
- function oe() {
533
- G(), D(), n.value = "idle", m.value = "", x.value = "", g.value = "", d.value = "", S.value = "", b.value = [], T.value = [], B.value = "", C.value = "", c.value = !1, p.value = { kind: "unsupported", fileName: v.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 R(i) {
536
- const w = URL.createObjectURL(Ke(i));
537
- return N.value = w, w;
553
+ function E(l) {
554
+ const b = URL.createObjectURL(Ke(l));
555
+ return N.value = b, b;
538
556
  }
539
- function Q() {
540
- const i = f.value;
541
- return typeof i == "string" ? i.trim() : vo(i) ? R(i) : "";
557
+ function X() {
558
+ const l = q.value;
559
+ return typeof l == "string" ? l.trim() : Vo(l) ? E(l) : "";
542
560
  }
543
- function Z() {
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 se() {
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 > Z())
557
- throw new Error(`文件超过 ${Math.round(Z() / 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
- G(), 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 K(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 w = Number(i.headers.get("content-length"));
570
- Number.isFinite(w) && be(w);
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 w = f.value;
576
- if (w instanceof Blob || w instanceof ArrayBuffer) {
577
- const U = Ke(w);
578
- return be(U.size), U.arrayBuffer();
579
- }
580
- const _ = typeof w == "string" ? w.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 H(i) {
586
- const w = await y(i);
587
- return new TextDecoder().decode(w).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 de(i) {
590
- const w = await import("./purify.es-HJ4qIUVZ.js");
591
- return (typeof w.default == "function" ? w.default(typeof window > "u" ? void 0 : window) : w.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 w = await H(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
- ]), U = _.marked.parse(w, { breaks: !0, gfm: !0 }), q = typeof V.default == "function" ? V.default(typeof window > "u" ? void 0 : window) : V.default;
598
- g.value = q.sanitize(U);
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
- d.value = await de(await H(i));
618
+ async function ae(l) {
619
+ v.value = await H(await w(l));
602
620
  }
603
- function Se(i) {
604
- let w = "";
605
- for (let V = 0; V < i.length; V += 32768)
606
- w += String.fromCharCode(...i.subarray(V, V + 32768));
607
- return btoa(w);
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 w;
611
- if (typeof i.content == "string")
612
- w = i.encoding === "base64" ? i.content.replace(/\s/g, "") : Se(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
- w = Se(_);
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,${w}`;
635
+ return `data:${l.mimeType || "application/octet-stream"};base64,${b}`;
618
636
  }
619
- function Pe(i) {
620
- const w = 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(w).toLowerCase();
640
+ return decodeURIComponent(b).toLowerCase();
623
641
  } catch {
624
- return w.toLowerCase();
642
+ return b.toLowerCase();
625
643
  }
626
644
  }
627
- function st(i, w) {
628
- const _ = /* @__PURE__ */ new Map();
629
- for (const U of w) {
645
+ function st(l, b) {
646
+ const x = /* @__PURE__ */ new Map();
647
+ for (const U of b) {
630
648
  if (!/^image\//i.test(U.mimeType)) continue;
631
- const q = J(U);
632
- U.contentId && _.set(Pe(U.contentId), q), U.filename && _.set(Pe(U.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((U) => {
637
- const q = U.getAttribute("src") ?? "", W = Pe(/^cid:/i.test(q) ? q.slice(4) : q), X = _.get(W);
638
- X && U.setAttribute("src", X);
639
- }), V.body.innerHTML;
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 w = i.replace(/^\uFEFF/, ""), _ = w.split(/\r?\n/, 1)[0] ?? "", U = [" ", ",", ";"].map((te) => ({ candidate: te, count: _.split(te).length - 1 })).sort((te, pe) => pe.count - te.count)[0]?.candidate ?? ",", q = [];
650
- let W = [], X = "", fe = !1;
651
- for (let te = 0; te < w.length; te += 1) {
652
- const pe = w[te], We = w[te + 1];
653
- pe === '"' ? fe && We === '"' ? (X += '"', te += 1) : fe = !fe : pe === U && !fe ? (W.push(X), X = "") : (pe === `
654
- ` || pe === "\r") && !fe ? (pe === "\r" && We === `
655
- ` && (te += 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 w = await import("./xlsx-CF422ARu.js"), _ = w.read(await y(i), { type: "array" }), V = _.SheetNames[0], U = V ? _.Sheets[V] : void 0;
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;
661
679
  if (!U) throw new Error("Excel 文件没有可展示的工作表");
662
- const q = w.utils.sheet_to_json(U, {
680
+ const K = b.utils.sheet_to_json(U, {
663
681
  defval: "",
664
682
  header: 1,
665
683
  raw: !1
666
- }), W = se(), X = ge();
667
- c.value = q.length > W || q.some((fe) => fe.length > X), b.value = q.slice(0, W).map((fe) => ({
668
- cells: fe.slice(0, X).map((te) => String(te ?? ""))
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
- ], C.value = _.text || "";
684
- const U = _.attachments, q = _.html ? await de(_.html) : "";
685
- B.value = q ? st(q, U) : "";
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, w) {
688
- if (await Te(), !K(i)) return;
689
- const _ = t.docxContainer.value;
690
- if (!_) throw new Error("DOCX 预览容器未就绪");
691
- const V = await import("./docx-preview.min-lCFRKxYn.js").then((U) => U.d);
692
- _.replaceChildren(), await V.renderAsync(await y(w), _, 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, w, _) {
699
- if (i === "text" && (S.value = await H(_)), i === "json" && (S.value = rt(await H(_))), i === "xml" && (S.value = await H(_)), i === "csv") {
700
- const V = ut(await H(_)), U = se(), q = ge();
701
- c.value = V.length > U || V.some((W) => W.length > q), b.value = V.slice(0, U).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(w, _);
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
- oe();
709
- const i = f.value;
710
- if (i === void 0 || i === "") return;
711
- const w = po(i, o.fileName, o.fileType);
712
- if (p.value = { kind: w, fileName: v.value }, x.value = Q(), w === "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: w,
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(w))
740
+ if (["image", "pdf", "video", "audio"].includes(b))
723
741
  n.value = "ready";
724
742
  else {
725
- if (await pt(w, _.token, _.signal), !K(_.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: w, fileName: v.value });
729
- } catch (V) {
730
- if (!K(_.token)) return;
731
- n.value = "error", m.value = V instanceof Error ? V.message : "文件预览失败", e("error", { kind: w, message: m.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, G(), D();
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: C,
747
- errorMessage: m,
748
- fileName: v,
749
- htmlContent: d,
750
- isError: Y,
751
- isLoading: E,
752
- isReady: A,
764
+ emailText: R,
765
+ errorMessage: f,
766
+ fileName: B,
767
+ htmlContent: v,
768
+ isError: G,
769
+ isLoading: V,
770
+ isReady: I,
753
771
  isUnsupported: k,
754
- kind: l,
772
+ kind: u,
755
773
  load: Ye,
756
- markdownHtml: g,
774
+ markdownHtml: h,
757
775
  status: n,
758
- tableRows: b,
759
- textContent: S,
760
- truncated: c
776
+ tableRows: y,
777
+ textContent: 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"], So = {
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
- }, $o = {
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
- }, Io = ["srcdoc", "title"], Do = {
821
+ }, cn = ["srcdoc", "title"], dn = {
804
822
  key: 2,
805
823
  class: "yee-ui-file-preview__text"
806
- }, Yo = /* @__PURE__ */ ae({
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, m = xe("previewContainer"), x = xe("docxContainer"), g = O(!1), d = O(""), S = O(!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: C,
829
- errorMessage: c,
830
- fileName: p,
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: v,
836
- kind: l,
837
- markdownHtml: E,
838
- tableRows: A,
839
- textContent: Y,
850
+ isError: $,
851
+ isLoading: j,
852
+ isReady: q,
853
+ isUnsupported: B,
854
+ kind: u,
855
+ markdownHtml: V,
856
+ tableRows: I,
857
+ textContent: G,
840
858
  truncated: k
841
- } = go(e, { docxContainer: x }, n), D = u(() => e.height === void 0 || e.height === null || e.height === "" ? {} : {
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
- }), G = u(() => !!b.value), oe = u(() => ["image", "pdf", "video", "audio"].includes(l.value)), R = u(() => l.value === "csv" || l.value === "spreadsheet"), Q = 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
- d.value = "";
865
+ v.value = "";
848
866
  }
849
867
  );
850
- function Z() {
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 se() {
857
- if (!b.value || S.value) return;
858
- d.value = "", S.value = !0;
859
- let K = 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(K)) {
862
- const H = await fetch(K);
863
- if (!H.ok) throw new Error(`文件下载失败(${H.status})`);
864
- K = URL.createObjectURL(await H.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 = K, y.download = p.value, y.rel = "noopener noreferrer", document.body.appendChild(y), y.click(), y.remove(), r && window.setTimeout(() => URL.revokeObjectURL(K), 0), n("download");
868
- } catch (y) {
869
- d.value = y instanceof Error ? y.message : "文件下载失败", n("error", {
870
- kind: l.value,
871
- message: d.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
- S.value = !1;
893
+ C.value = !1;
876
894
  }
877
895
  }
878
- function ge() {
879
- g.value = document.fullscreenElement === m.value;
896
+ function we() {
897
+ h.value = document.fullscreenElement === f.value;
880
898
  }
881
- async function be() {
882
- const K = m.value;
883
- if (K)
899
+ async function _e() {
900
+ const Q = f.value;
901
+ if (Q)
884
902
  try {
885
- document.fullscreenElement === K ? await document.exitFullscreen() : K.requestFullscreen ? await K.requestFullscreen() : g.value = !g.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(K) {
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
- }[K];
928
+ }[Q];
911
929
  }
912
- return Re(() => {
913
- document.addEventListener("fullscreenchange", ge);
914
- }), Ce(() => {
915
- document.removeEventListener("fullscreenchange", ge), document.fullscreenElement === m.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
- }), (K, r) => (a(), h("section", {
935
+ }), (Q, ee) => (i(), g("section", {
918
936
  ref_key: "previewContainer",
919
- ref: m,
920
- class: ye([{ "yee-ui-file-preview--fullscreen": g.value }, "yee-ui-file-preview"]),
921
- style: he(D.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 && G.value ? (a(), h("header", wo, [
925
- F("div", {
942
+ o.showHeader && m.value ? (i(), g("header", Ao, [
943
+ M("div", {
926
944
  class: "yee-ui-file-preview__name",
927
- title: s(p)
928
- }, j(s(p)), 9, _o),
929
- F("div", xo, [
930
- ne(s(ue), {
931
- title: g.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: $(() => [
934
- F("button", {
935
- "aria-label": g.value ? "退出全屏" : "进入全屏",
936
- "aria-pressed": g.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
- g.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(ue), {
964
+ o.showDownload ? (i(), L(s(fe), {
947
965
  key: 0,
948
- title: S.value ? "下载中..." : "下载"
966
+ title: C.value ? "下载中..." : "下载"
949
967
  }, {
950
- default: $(() => [
951
- F("button", {
952
- "aria-label": S.value ? "下载中" : "下载",
953
- "aria-busy": S.value,
968
+ default: F(() => [
969
+ M("button", {
970
+ "aria-label": C.value ? "下载中" : "下载",
971
+ "aria-busy": C.value,
954
972
  class: "yee-ui-file-preview__header-action",
955
- disabled: S.value,
973
+ disabled: C.value,
956
974
  type: "button",
957
- onClick: r[0] || (r[0] = (y) => {
958
- se();
975
+ onClick: ee[0] || (ee[0] = (a) => {
976
+ re();
959
977
  })
960
978
  }, [
961
- ne(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
- d.value ? (a(), h("div", So, j(d.value), 1)) : z("", !0),
969
- G.value ? s(I) && !oe.value && s(l) !== "docx" ? (a(), h("div", To, "文件加载中...")) : s(P) ? (a(), h("div", Bo, [
970
- F("span", null, j(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
- se();
993
+ onClick: ee[1] || (ee[1] = (a) => {
994
+ re();
977
995
  })
978
996
  }, " 下载查看 ")) : z("", !0)
979
- ])) : s(v) ? (a(), h("div", Fo, [
980
- F("span", null, "暂不支持预览 " + j(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
- se();
1003
+ onClick: ee[2] || (ee[2] = (a) => {
1004
+ re();
987
1005
  })
988
1006
  }, " 下载查看 ")) : z("", !0)
989
- ])) : s(f) || oe.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: Z
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: Z
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: Z
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: Z
1016
- }, null, 40, Mo)) : s(l) === "text" || s(l) === "json" || s(l) === "xml" ? (a(), h("pre", Vo, j(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(E)
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)) : R.value ? (a(), h("div", Po, [
1032
- s(A).length ? (a(), h("table", Ho, [
1033
- F("tbody", null, [
1034
- (a(!0), h(_e, null, $e(s(A), (y, H) => (a(), h("tr", { key: H }, [
1035
- (a(!0), h(_e, null, $e(y.cells, (de, le) => (a(), h("td", {
1036
- key: `${H}-${le}`
1037
- }, j(de), 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(k) ? (a(), h("div", Ao, "预览内容已截断,可下载查看完整文件。")) : z("", !0)
1042
- ])) : Q.value ? (a(), h("div", Uo, [
1043
- s(B).length ? (a(), h("dl", jo, [
1044
- (a(!0), h(_e, null, $e(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
- F("dt", null, j(y.label), 1),
1048
- F("dd", null, j(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, Io)) : (a(), h("pre", Do, j(s(C) || "暂无可展示的邮件正文"), 1))
1075
+ }, null, 8, cn)) : (i(), g("pre", dn, D(s(R) || "暂无可展示的邮件正文"), 1))
1058
1076
  ])) : z("", !0)
1059
- ], 64)) : z("", !0) : (a(), h("div", $o, "请选择文件"))
1060
- ], 14, bo));
1077
+ ], 64)) : z("", !0) : (i(), g("div", Wo, "请选择文件"))
1078
+ ], 14, Lo));
1061
1079
  }
1062
- }), An = /* @__PURE__ */ ce(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__ */ ae({
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 = St.RangePicker, n = O(t.options.collapsed ?? !0);
1118
+ const t = o, e = O(t.options.collapsed ?? !0);
1073
1119
  t.api.configure(t.options);
1074
- const m = u(() => t.api.schema.value.filter((C) => !C.hide));
1075
- function x(C) {
1076
- return t.api.getFieldValue(C.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 g(C) {
1079
- const c = x(C);
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
- ...C.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 d(C, c) {
1086
- t.api.setFieldValue(C.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 S() {
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(C) {
1095
- C.key === "Enter" && t.options.submitOnEnter && (C.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 (C, 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
- F("div", Wo, [
1106
- (a(!0), h(_e, null, $e(m.value, (p) => (a(), h("label", {
1107
- key: p.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
- F("span", qo, j(p.label), 1),
1111
- p.component === "Input" ? (a(), M(s($t), ee({
1112
- key: 0,
1113
- ref_for: !0
1114
- }, g(p), {
1115
- "onUpdate:value": (N) => d(p, N)
1116
- }), null, 16, ["onUpdate:value"])) : p.component === "Select" ? (a(), M(s(ze), ee({
1117
- key: 1,
1118
- ref_for: !0
1119
- }, g(p), {
1120
- "onUpdate:value": (N) => d(p, N)
1121
- }), null, 16, ["onUpdate:value"])) : (a(), M(s(e), ee({
1122
- key: 2,
1123
- ref_for: !0
1124
- }, g(p), {
1125
- "onUpdate:value": (N) => d(p, 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
- F("div", Go, [
1130
- ne(s(re), {
1183
+ M("div", hn, [
1184
+ le(s(de), {
1131
1185
  "html-type": "button",
1132
- onClick: S
1186
+ onClick: T
1133
1187
  }, {
1134
- default: $(() => [...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
- ne(s(re), {
1193
+ le(s(de), {
1140
1194
  type: "primary",
1141
1195
  "html-type": "submit"
1142
1196
  }, {
1143
- default: $(() => [...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(re), {
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: $(() => [
1155
- ie(j(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__ */ ce(Ko, [["__scopeId", "data-v-92583f28"]]);
1163
- class Qo {
1216
+ }), bn = /* @__PURE__ */ pe(gn, [["__scopeId", "data-v-5bc69f74"]]);
1217
+ class wn {
1218
+ /** 当前表单 Schema,由组件初始化,可通过 updateSchema 动态更新。 */
1164
1219
  schema = O([]);
1165
1220
  initialValues = {};
1166
- values = De({});
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
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__ */ ae({
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,112 +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, m = Oe(), x = e, g = ue, d = De({ visible: !1 }), S = xe("tooltip"), b = O(), T = O(""), B = O(), C = O(!1);
1259
- let c;
1260
- function p(R) {
1261
- if (!(R === void 0 || R === ""))
1262
- return typeof R == "number" ? `${R}px` : R;
1263
- }
1264
- const N = u(() => {
1265
- const R = b.value;
1266
- return !R || !d.visible ? { display: "none" } : {
1267
- height: `${Math.max(R.height, 1)}px`,
1268
- left: `${R.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: `${R.top}px`,
1272
- width: `${Math.max(R.width, 1)}px`
1344
+ top: `${d.top}px`,
1345
+ width: `${Math.max(d.width, 1)}px`
1273
1346
  };
1274
- }), P = u(() => ({
1347
+ }), N = r(() => ({
1348
+ cursor: n.enterable ? "text" : void 0,
1275
1349
  height: p(n.height),
1276
1350
  maxHeight: p(n.maxHeight),
1277
1351
  maxWidth: p(n.maxWidth),
1278
1352
  minHeight: p(n.minHeight),
1279
1353
  minWidth: p(n.minWidth),
1354
+ userSelect: n.enterable ? "text" : void 0,
1280
1355
  width: p(n.width)
1281
- })), I = u(() => ({
1356
+ })), $ = r(() => ({
1282
1357
  ...n.popupClassName ? { overlayClassName: n.popupClassName } : {},
1283
- ...m.content ? {} : { title: String(T.value) },
1284
1358
  ...n.zIndex === void 0 ? {} : { zIndex: Number(n.zIndex) }
1285
1359
  }));
1286
- function f(R) {
1287
- return R.closest("body") ?? document.body;
1360
+ function j(d) {
1361
+ return d.closest("body") ?? document.body;
1288
1362
  }
1289
- function v(R) {
1290
- return R || (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);
1291
1365
  }
1292
- function l() {
1293
- const R = B.value;
1294
- if (!R?.isConnected)
1295
- return Y();
1296
- const Q = R.getBoundingClientRect();
1297
- return b.value = {
1298
- height: Q.height,
1299
- left: Q.left,
1300
- top: Q.top,
1301
- width: Q.width
1302
- }, Te(() => S.value?.forcePopupAlign?.());
1303
- }
1304
- function E(R, Q) {
1305
- const Z = v(R);
1306
- return Z ? (B.value = Z, T.value = Q ?? n.content ?? "", C.value = !0, d.visible = !0, x("update:modelValue", !0), l()) : Te();
1307
- }
1308
- function A(R, Q, Z) {
1309
- const se = R.currentTarget instanceof HTMLElement ? R.currentTarget : void 0;
1310
- return E(Q ?? se, Z);
1366
+ function B() {
1367
+ const d = T.value;
1368
+ if (!d?.isConnected)
1369
+ return I();
1370
+ const E = d.getBoundingClientRect();
1371
+ return C.value = {
1372
+ height: E.height,
1373
+ left: E.left,
1374
+ top: E.top,
1375
+ width: E.width
1376
+ }, Te(() => v.value?.forcePopupAlign?.());
1377
+ }
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();
1381
+ }
1382
+ function V(d, E, X) {
1383
+ const oe = d.currentTarget instanceof HTMLElement ? d.currentTarget : void 0;
1384
+ return u(E ?? oe, X);
1311
1385
  }
1312
- function Y() {
1313
- return C.value = !1, B.value = void 0, b.value = void 0, d.visible = !1, x("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();
1314
1388
  }
1315
- function k(R) {
1316
- R && c && (clearTimeout(c), c = void 0), C.value = R;
1389
+ function G(d) {
1390
+ d && R && (clearTimeout(R), R = void 0), S.value = d;
1317
1391
  }
1318
- function D() {
1319
- return C.value;
1392
+ function k() {
1393
+ return S.value;
1320
1394
  }
1321
- function G() {
1322
- d.visible && l();
1395
+ function A() {
1396
+ h.visible && B();
1323
1397
  }
1324
- function oe() {
1325
- k(!1), n.enterable && (c = setTimeout(() => {
1326
- c = void 0, C.value || Y();
1398
+ function m() {
1399
+ G(!1), n.enterable && (R = setTimeout(() => {
1400
+ R = void 0, S.value || I();
1327
1401
  }, n.leaveDelay ?? 0));
1328
1402
  }
1329
- return Re(() => {
1330
- window.addEventListener("resize", G), window.addEventListener("scroll", G, !0), n.modelValue && E(void 0, n.content);
1331
- }), Ce(() => {
1332
- c && clearTimeout(c), window.removeEventListener("resize", G), window.removeEventListener("scroll", G, !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);
1333
1407
  }), t({
1334
- close: Y,
1335
- isActived: D,
1336
- open: E,
1337
- openByEvent: A,
1338
- reactData: d,
1339
- setActived: k,
1340
- toVisible: E,
1341
- updatePlacement: l
1342
- }), (R, Q) => (a(), M(s(g), ee({ ref: "tooltip" }, I.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, {
1343
1417
  arrow: n.isArrow !== !1,
1344
- "get-popup-container": f,
1345
- open: d.visible,
1346
- "overlay-inner-style": P.value,
1418
+ "get-popup-container": j,
1419
+ open: h.visible,
1420
+ "overlay-inner-style": N.value,
1347
1421
  placement: "top"
1348
1422
  }), {
1349
- title: $(() => [
1350
- F("div", {
1351
- onMouseenter: Q[0] || (Q[0] = (Z) => n.enterable && k(!0)),
1352
- onMouseleave: oe
1423
+ title: F(() => [
1424
+ M("div", {
1425
+ class: "yee-ui-grid-tooltip-content",
1426
+ onMouseenter: E[0] || (E[0] = (X) => n.enterable && G(!0)),
1427
+ onMouseleave: m
1353
1428
  }, [
1354
- L(R.$slots, "content", {}, () => [
1355
- ie(j(T.value), 1)
1429
+ Y(d.$slots, "content", {}, () => [
1430
+ ce(D(y.value), 1)
1356
1431
  ])
1357
1432
  ], 32)
1358
1433
  ]),
1359
- default: $(() => [
1360
- F("span", {
1434
+ default: F(() => [
1435
+ M("span", {
1361
1436
  "aria-hidden": "true",
1362
1437
  class: "yee-ui-grid-tooltip-anchor",
1363
- style: he(N.value)
1438
+ style: ge(c.value)
1364
1439
  }, null, 4)
1365
1440
  ]),
1366
1441
  _: 3
@@ -1369,51 +1444,51 @@ const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), Zo = /* @__PU
1369
1444
  });
1370
1445
  let Je = !1;
1371
1446
  const Ie = /* @__PURE__ */ new Set();
1372
- function en() {
1373
- const o = Ee.modal.confirm.bind(Ee.modal);
1374
- Ee.modal.confirm = ((t, e, n) => {
1375
- const m = typeof t == "object" && t !== null ? t : typeof n == "object" && n !== null ? n : void 0;
1376
- if ((typeof m?.className == "string" ? m.className.split(/\s+/) : []).includes("vxe-table--ignore-clear")) {
1377
- const g = [...Ie], d = g[g.length - 1];
1378
- if (d) {
1379
- const S = typeof m?.content == "string" ? m.content : String(m?.content ?? t);
1380
- return d(S);
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);
1381
1456
  }
1382
1457
  }
1383
1458
  return o(t, e, n);
1384
1459
  });
1385
1460
  }
1386
- function tn(o) {
1461
+ function Cn(o) {
1387
1462
  return Ie.add(o), () => Ie.delete(o);
1388
1463
  }
1389
1464
  function it() {
1390
1465
  if (Je) return;
1391
1466
  [
1392
- zt,
1393
- Nt,
1394
- Pt,
1467
+ eo,
1468
+ to,
1469
+ oo,
1395
1470
  nt,
1396
- Ht,
1397
- Lt,
1398
- At,
1399
- Ut,
1400
- jt,
1401
- It,
1402
- Dt,
1403
- Yt,
1404
- Wt,
1405
- qt,
1406
- Gt,
1407
- Zo
1408
- ].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;
1409
1484
  }
1410
- const on = {
1485
+ const Sn = {
1411
1486
  key: 1,
1412
1487
  class: "yee-ui-grid__separator"
1413
- }, nn = { class: "yee-ui-grid__table-container" }, an = {
1488
+ }, Tn = { class: "yee-ui-grid__table-container" }, $n = {
1414
1489
  key: 0,
1415
1490
  class: "yee-ui-grid__title"
1416
- }, ln = /* @__PURE__ */ ae({
1491
+ }, Bn = /* @__PURE__ */ se({
1417
1492
  name: "YeeGrid",
1418
1493
  __name: "YeeGrid",
1419
1494
  props: {
@@ -1422,28 +1497,28 @@ const on = {
1422
1497
  tableTitleHelp: {}
1423
1498
  },
1424
1499
  setup(o) {
1425
- const t = o, e = Oe(), n = xe("gridRef"), m = Me(Ne), x = Me(lt, void 0), [g, d] = et.useModal();
1500
+ const t = o, e = ze(), n = be("gridRef"), f = Ve(Pe), _ = Ve(lt, void 0), [h, v] = et.useModal();
1426
1501
  it();
1427
- const S = tn((v) => new Promise((l) => {
1428
- g.confirm({
1502
+ const C = Cn((B) => new Promise((u) => {
1503
+ h.confirm({
1429
1504
  title: "恢复默认列配置",
1430
- content: v,
1505
+ content: B,
1431
1506
  centered: !0,
1432
1507
  okText: "确认",
1433
1508
  cancelText: "取消",
1434
1509
  keyboard: !0,
1435
1510
  wrapClassName: "vxe-table--ignore-clear",
1436
- onOk: () => l("confirm"),
1437
- onCancel: () => l("cancel")
1511
+ onOk: () => u("confirm"),
1512
+ onCancel: () => u("cancel")
1438
1513
  });
1439
- })), b = u(() => t.api.state.value), T = u(() => b.value.formOptions), B = u(() => !!(t.tableTitle || e["table-title"] || e["toolbar-actions"] || e["toolbar-tools"])), C = u(() => Object.keys(e).filter((v) => ![
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) => ![
1440
1515
  "empty",
1441
1516
  "loading",
1442
1517
  "table-title",
1443
1518
  "toolbar-actions",
1444
1519
  "toolbar-tools"
1445
- ].includes(v))), c = u(() => x?.value ?? !1), p = u(() => {
1446
- const v = b.value.gridOptions, l = v.proxyConfig, E = l?.ajax?.query, A = v.toolbarConfig, Y = v.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;
1447
1522
  return {
1448
1523
  align: "left",
1449
1524
  border: "inner",
@@ -1451,106 +1526,111 @@ const on = {
1451
1526
  showHeaderOverflow: "tooltip",
1452
1527
  showOverflow: "tooltip",
1453
1528
  size: "medium",
1454
- ...c.value ? { height: "auto" } : {},
1455
- ...v,
1529
+ ...p.value ? { height: "auto" } : {},
1530
+ ...B,
1456
1531
  columnConfig: {
1457
1532
  resizable: !0,
1458
- ...v.columnConfig
1533
+ ...B.columnConfig
1534
+ },
1535
+ tooltipConfig: {
1536
+ enterable: !0,
1537
+ leaveDelay: 300,
1538
+ ...B.tooltipConfig
1459
1539
  },
1460
- ...Y ? {
1540
+ ...G ? {
1461
1541
  pagerConfig: {
1462
1542
  pageSize: 20,
1463
1543
  pageSizes: [10, 20, 30, 50, 100, 200],
1464
1544
  layouts: ["Total", "Sizes", "Home", "PrevPage", "Number", "NextPage", "End"],
1465
- ...Y,
1545
+ ...G,
1466
1546
  slots: {
1467
1547
  sizes: "pagerSizes",
1468
- ...Y.slots
1548
+ ...G.slots
1469
1549
  }
1470
1550
  }
1471
1551
  } : {},
1472
- ...l ? {
1552
+ ...u ? {
1473
1553
  proxyConfig: {
1474
1554
  autoLoad: !0,
1475
1555
  showResponseMsg: !1,
1476
- ...l,
1556
+ ...u,
1477
1557
  response: {
1478
1558
  list: "items",
1479
1559
  result: "items",
1480
1560
  total: "total",
1481
- ...l.response
1561
+ ...u.response
1482
1562
  },
1483
- ...l.ajax ? {
1563
+ ...u.ajax ? {
1484
1564
  ajax: {
1485
- ...l.ajax,
1486
- ...E ? {
1487
- query: (k) => E(k, t.api.formApi.getValues())
1565
+ ...u.ajax,
1566
+ ...V ? {
1567
+ query: (k) => V(k, t.api.formApi.getValues())
1488
1568
  } : {}
1489
1569
  }
1490
1570
  } : {}
1491
1571
  }
1492
1572
  } : {},
1493
- ...A || B.value ? {
1573
+ ...I || S.value ? {
1494
1574
  toolbarConfig: {
1495
1575
  custom: !0,
1496
1576
  refresh: !0,
1497
1577
  zoom: !0,
1498
- ...A,
1578
+ ...I,
1499
1579
  slots: {
1500
1580
  ...t.tableTitle || e["table-title"] || e["toolbar-actions"] ? { buttons: "toolbarActions" } : {},
1501
- ...e["toolbar-tools"] || A?.search ? { tools: "toolbarTools" } : {}
1581
+ ...e["toolbar-tools"] || I?.search ? { tools: "toolbarTools" } : {}
1502
1582
  }
1503
1583
  }
1504
1584
  } : {}
1505
1585
  };
1506
- }), N = u(() => b.value.gridEvents ?? {});
1507
- ke(
1508
- () => m?.value.mode ?? "light",
1509
- (v) => Ee.setTheme(v),
1586
+ }), N = r(() => y.value.gridEvents ?? {});
1587
+ Ce(
1588
+ () => f?.value.mode ?? "light",
1589
+ (B) => Me.setTheme(B),
1510
1590
  { immediate: !0 }
1511
1591
  );
1512
- async function P() {
1592
+ async function $() {
1513
1593
  await t.api.reload();
1514
1594
  }
1515
- async function I() {
1595
+ async function j() {
1516
1596
  await t.api.reload();
1517
1597
  }
1518
- function f(v, l) {
1519
- typeof l != "number" && typeof l != "string" || v.setPageSizeByEvent(new Event("change"), l);
1598
+ function q(B, u) {
1599
+ typeof u != "number" && typeof u != "string" || B.setPageSizeByEvent(new Event("change"), u);
1520
1600
  }
1521
- return Re(() => {
1601
+ return Oe(() => {
1522
1602
  n.value && t.api.mount(n.value);
1523
- }), ht(() => {
1524
- S(), t.api.unmount();
1525
- }), (v, l) => (a(), h("section", {
1526
- class: ye(["yee-ui-grid", { "yee-ui-grid--fill-page-content": c.value }])
1603
+ }), gt(() => {
1604
+ C(), t.api.unmount();
1605
+ }), (B, u) => (i(), g("section", {
1606
+ class: ye(["yee-ui-grid", { "yee-ui-grid--fill-page-content": p.value }])
1527
1607
  }, [
1528
- T.value ? gt((a(), M(Jo, {
1608
+ T.value ? bt((i(), L(bn, {
1529
1609
  key: 0,
1530
1610
  api: o.api.formApi,
1531
1611
  options: T.value,
1532
- "on-reset": I,
1533
- "on-submit": P
1612
+ "on-reset": j,
1613
+ "on-submit": $
1534
1614
  }, null, 8, ["api", "options"])), [
1535
- [bt, o.api.searchFormVisible.value]
1615
+ [wt, o.api.searchFormVisible.value]
1536
1616
  ]) : z("", !0),
1537
- T.value && b.value.separator !== !1 ? (a(), h("div", on)) : z("", !0),
1538
- F("div", nn, [
1539
- ne(s(nt), ee({
1617
+ T.value && y.value.separator !== !1 ? (i(), g("div", Sn)) : z("", !0),
1618
+ M("div", Tn, [
1619
+ le(s(nt), ie({
1540
1620
  ref_key: "gridRef",
1541
1621
  ref: n,
1542
1622
  class: "yee-ui-grid__table"
1543
- }, p.value, wt(N.value)), Ve({
1544
- toolbarActions: $((E) => [
1545
- L(v.$slots, "table-title", {}, () => [
1546
- o.tableTitle ? (a(), h("div", an, [
1547
- ie(j(o.tableTitle) + " ", 1),
1548
- o.tableTitleHelp ? (a(), M(s(ue), {
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), {
1549
1629
  key: 0,
1550
1630
  title: o.tableTitleHelp
1551
1631
  }, {
1552
- default: $(() => [...l[0] || (l[0] = [
1553
- F("span", {
1632
+ default: F(() => [...u[0] || (u[0] = [
1633
+ M("span", {
1554
1634
  class: "yee-ui-grid__help",
1555
1635
  tabindex: "0"
1556
1636
  }, "?", -1)
@@ -1559,62 +1639,62 @@ const on = {
1559
1639
  }, 8, ["title"])) : z("", !0)
1560
1640
  ])) : z("", !0)
1561
1641
  ], !0),
1562
- L(v.$slots, "toolbar-actions", ve(me(E)), void 0, !0)
1642
+ Y(B.$slots, "toolbar-actions", Fe(Ee(V)), void 0, !0)
1563
1643
  ]),
1564
- toolbarTools: $((E) => [
1565
- L(v.$slots, "toolbar-tools", ve(me(E)), void 0, !0)
1644
+ toolbarTools: F((V) => [
1645
+ Y(B.$slots, "toolbar-tools", Fe(Ee(V)), void 0, !0)
1566
1646
  ]),
1567
- pagerSizes: $(({ $pager: E, options: A, pageSize: Y }) => [
1568
- ne(s(ze), {
1647
+ pagerSizes: F(({ $pager: V, options: I, pageSize: G }) => [
1648
+ le(s(De), {
1569
1649
  class: "yee-ui-grid__page-size",
1570
- options: A,
1571
- value: Y,
1572
- onChange: (k) => f(E, k)
1650
+ options: I,
1651
+ value: G,
1652
+ onChange: (k) => q(V, k)
1573
1653
  }, null, 8, ["options", "value", "onChange"])
1574
1654
  ]),
1575
- empty: $(() => [
1576
- L(v.$slots, "empty", {}, () => [
1577
- l[1] || (l[1] = F("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))
1578
1658
  ], !0)
1579
1659
  ]),
1580
1660
  _: 2
1581
1661
  }, [
1582
- $e(C.value, (E) => ({
1583
- name: E,
1584
- fn: $((A) => [
1585
- L(v.$slots, E, ve(me(A)), 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)
1586
1666
  ])
1587
1667
  }))
1588
1668
  ]), 1040)
1589
1669
  ]),
1590
- ne(s(d))
1670
+ le(s(v))
1591
1671
  ], 2));
1592
1672
  }
1593
- }), sn = /* @__PURE__ */ ce(ln, [["__scopeId", "data-v-3c8e165d"]]);
1594
- function Un(o) {
1673
+ }), Fn = /* @__PURE__ */ pe(Bn, [["__scopeId", "data-v-69df784f"]]);
1674
+ function ca(o) {
1595
1675
  it();
1596
- const t = new Xo(o), e = sn;
1597
- return [ae({
1676
+ const t = new _n(o), e = Fn;
1677
+ return [se({
1598
1678
  name: "YeeGrid",
1599
1679
  inheritAttrs: !1,
1600
1680
  props: {
1601
1681
  tableTitle: String,
1602
1682
  tableTitleHelp: String
1603
1683
  },
1604
- setup(m, { attrs: x, slots: g }) {
1605
- return Ce(() => t.unmount()), () => Xe(e, {
1606
- ...x,
1684
+ setup(f, { attrs: _, slots: h }) {
1685
+ return Se(() => t.unmount()), () => Xe(e, {
1686
+ ..._,
1607
1687
  api: t,
1608
- ...m.tableTitle ? { tableTitle: m.tableTitle } : {},
1609
- ...m.tableTitleHelp ? { tableTitleHelp: m.tableTitleHelp } : {}
1610
- }, g);
1688
+ ...f.tableTitle ? { tableTitle: f.tableTitle } : {},
1689
+ ...f.tableTitleHelp ? { tableTitleHelp: f.tableTitleHelp } : {}
1690
+ }, h);
1611
1691
  }
1612
1692
  }), t];
1613
1693
  }
1614
- 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 = {
1615
1695
  key: 1,
1616
1696
  class: "yee-ui-modal__header-actions"
1617
- }, 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__ */ ae({
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({
1618
1698
  inheritAttrs: !1,
1619
1699
  name: "YeeModal",
1620
1700
  __name: "YeeModal",
@@ -1629,6 +1709,7 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
1629
1709
  fullscreenButton: { type: Boolean, default: !0 },
1630
1710
  keyboard: { type: Boolean, default: !1 },
1631
1711
  maskClosable: { type: Boolean, default: !1 },
1712
+ open: { type: Boolean },
1632
1713
  showCancelButton: { type: Boolean, default: !0 },
1633
1714
  showConfirmButton: { type: Boolean, default: !0 },
1634
1715
  style: { type: [Boolean, null, String, Object, Array] },
@@ -1642,13 +1723,13 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
1642
1723
  }),
1643
1724
  emits: /* @__PURE__ */ je(["cancel", "close", "confirm", "update:fullscreen"], ["update:open"]),
1644
1725
  setup(o, { emit: t }) {
1645
- const e = o, n = t, m = Ue(o, "open"), x = Ue(e, "fullscreen"), g = Ze(), d = Oe(), S = _t(), b = u(() => e.type === "drawer"), T = u(() => !b.value && x.value), B = u(() => !!(e.title || d.header)), C = u(() => B.value || e.closable), c = u(() => B.value || e.fullscreenButton || e.closable), p = u(() => T.value ? "退出全屏" : "进入全屏"), N = u(() => {
1646
- const D = 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");
1647
1728
  return {
1648
1729
  ...e.wrapProps,
1649
- "aria-labelledby": D ? e.wrapProps?.["aria-labelledby"] : B.value ? S : void 0
1730
+ "aria-labelledby": A ? e.wrapProps?.["aria-labelledby"] : S.value ? C : void 0
1650
1731
  };
1651
- }), P = u(() => {
1732
+ }), $ = r(() => {
1652
1733
  if (T.value)
1653
1734
  return {
1654
1735
  height: "100%",
@@ -1659,97 +1740,97 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
1659
1740
  width: "100vw"
1660
1741
  };
1661
1742
  });
1662
- function I() {
1663
- const { style: D, ...G } = g;
1664
- return G;
1743
+ function j() {
1744
+ const { style: A, ...m } = h;
1745
+ return m;
1665
1746
  }
1666
- function f() {
1667
- return [g.style, e.style].filter(Boolean);
1747
+ function q() {
1748
+ return [h.style, e.style].filter(Boolean);
1668
1749
  }
1669
- function v() {
1670
- return [g.style, e.style, P.value].filter(Boolean);
1750
+ function B() {
1751
+ return [h.style, e.style, $.value].filter(Boolean);
1671
1752
  }
1672
- const l = () => d.closeIcon?.() ?? g.closeIcon ?? Xe(Vt);
1673
- function E(D) {
1674
- n("cancel", D), m.value = !1;
1753
+ const u = () => v.closeIcon?.() ?? h.closeIcon ?? Xe(Zt);
1754
+ function V(A) {
1755
+ n("cancel", A), f.value = !1;
1675
1756
  }
1676
- function A(D) {
1677
- n("confirm", D);
1757
+ function I(A) {
1758
+ n("confirm", A);
1678
1759
  }
1679
- function Y() {
1760
+ function G() {
1680
1761
  n("close");
1681
1762
  }
1682
1763
  function k() {
1683
- x.value = !x.value;
1764
+ _.value = !_.value;
1684
1765
  }
1685
- return (D, G) => b.value ? (a(), M(s(Tt), ee({ key: 0 }, I(), {
1766
+ return (A, m) => y.value ? (i(), L(s(Wt), ie({ key: 0 }, j(), {
1686
1767
  class: "yee-ui-modal-drawer",
1687
1768
  closable: !1,
1688
1769
  "destroy-on-close": e.destroyOnClose,
1689
1770
  keyboard: e.keyboard,
1690
1771
  "mask-closable": e.maskClosable,
1691
- open: m.value,
1692
- style: f(),
1772
+ open: f.value,
1773
+ style: q(),
1693
1774
  width: e.width,
1694
- onAfterOpenChange: G[0] || (G[0] = (oe) => !oe && Y()),
1695
- onClose: E
1696
- }), Ve({
1697
- footer: $(() => [
1698
- F("div", pn, [
1699
- L(D.$slots, "footer", {}, () => [
1700
- e.showCancelButton ? (a(), M(s(re), {
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), {
1701
1782
  key: 0,
1702
- onClick: E
1783
+ onClick: V
1703
1784
  }, {
1704
- default: $(() => [
1705
- ie(j(e.cancelButtonText), 1)
1785
+ default: F(() => [
1786
+ ce(D(e.cancelButtonText), 1)
1706
1787
  ]),
1707
1788
  _: 1
1708
1789
  })) : z("", !0),
1709
- e.showConfirmButton ? (a(), M(s(re), {
1790
+ e.showConfirmButton ? (i(), L(s(de), {
1710
1791
  key: 1,
1711
1792
  loading: e.confirmButtonLoading,
1712
1793
  type: "primary",
1713
- onClick: A
1794
+ onClick: I
1714
1795
  }, {
1715
- default: $(() => [
1716
- ie(j(e.confirmButtonText), 1)
1796
+ default: F(() => [
1797
+ ce(D(e.confirmButtonText), 1)
1717
1798
  ]),
1718
1799
  _: 1
1719
1800
  }, 8, ["loading"])) : z("", !0)
1720
1801
  ], !0)
1721
1802
  ])
1722
1803
  ]),
1723
- default: $(() => [
1724
- F("div", fn, [
1725
- L(D.$slots, "default", {}, void 0, !0)
1804
+ default: F(() => [
1805
+ M("div", Vn, [
1806
+ Y(A.$slots, "default", {}, void 0, !0)
1726
1807
  ])
1727
1808
  ]),
1728
1809
  _: 2
1729
1810
  }, [
1730
- C.value ? {
1811
+ R.value ? {
1731
1812
  name: "title",
1732
- fn: $(() => [
1733
- F("div", rn, [
1734
- B.value ? (a(), h("div", {
1813
+ fn: F(() => [
1814
+ M("div", En, [
1815
+ S.value ? (i(), g("div", {
1735
1816
  key: 0,
1736
- id: s(S),
1817
+ id: s(C),
1737
1818
  class: "yee-ui-modal__heading"
1738
1819
  }, [
1739
- L(D.$slots, "header", {}, () => [
1740
- F("span", cn, j(e.title), 1)
1820
+ Y(A.$slots, "header", {}, () => [
1821
+ M("span", Rn, D(e.title), 1)
1741
1822
  ], !0)
1742
- ], 8, un)) : z("", !0),
1743
- e.closable ? (a(), h("div", dn, [
1744
- ne(s(re), {
1823
+ ], 8, Mn)) : z("", !0),
1824
+ e.closable ? (i(), g("div", On, [
1825
+ le(s(de), {
1745
1826
  "aria-label": "关闭",
1746
1827
  class: "yee-ui-modal__header-action",
1747
1828
  size: "small",
1748
1829
  type: "text",
1749
- onClick: E
1830
+ onClick: V
1750
1831
  }, {
1751
- default: $(() => [
1752
- ne(l)
1832
+ default: F(() => [
1833
+ le(u)
1753
1834
  ]),
1754
1835
  _: 1
1755
1836
  })
@@ -1758,7 +1839,7 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
1758
1839
  ]),
1759
1840
  key: "0"
1760
1841
  } : void 0
1761
- ]), 1040, ["destroy-on-close", "keyboard", "mask-closable", "open", "style", "width"])) : (a(), M(s(et), ee({ key: 1 }, I(), {
1842
+ ]), 1040, ["destroy-on-close", "keyboard", "mask-closable", "open", "style", "width"])) : (i(), L(s(et), ie({ key: 1 }, j(), {
1762
1843
  centered: T.value ? !1 : e.centered,
1763
1844
  class: {
1764
1845
  "yee-ui-modal": !0,
@@ -1768,91 +1849,91 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
1768
1849
  "destroy-on-close": e.destroyOnClose,
1769
1850
  keyboard: e.keyboard,
1770
1851
  "mask-closable": e.maskClosable,
1771
- open: m.value,
1772
- style: v(),
1852
+ open: f.value,
1853
+ style: B(),
1773
1854
  width: T.value ? "100vw" : e.width,
1774
1855
  "wrap-props": N.value,
1775
- onAfterClose: Y,
1776
- onCancel: E
1777
- }), Ve({
1778
- footer: $(() => [
1779
- F("div", bn, [
1780
- L(D.$slots, "footer", {}, () => [
1781
- e.showCancelButton ? (a(), M(s(re), {
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), {
1782
1863
  key: 0,
1783
- onClick: E
1864
+ onClick: V
1784
1865
  }, {
1785
- default: $(() => [
1786
- ie(j(e.cancelButtonText), 1)
1866
+ default: F(() => [
1867
+ ce(D(e.cancelButtonText), 1)
1787
1868
  ]),
1788
1869
  _: 1
1789
1870
  })) : z("", !0),
1790
- e.showConfirmButton ? (a(), M(s(re), {
1871
+ e.showConfirmButton ? (i(), L(s(de), {
1791
1872
  key: 1,
1792
1873
  loading: e.confirmButtonLoading,
1793
1874
  type: "primary",
1794
- onClick: A
1875
+ onClick: I
1795
1876
  }, {
1796
- default: $(() => [
1797
- ie(j(e.confirmButtonText), 1)
1877
+ default: F(() => [
1878
+ ce(D(e.confirmButtonText), 1)
1798
1879
  ]),
1799
1880
  _: 1
1800
1881
  }, 8, ["loading"])) : z("", !0)
1801
1882
  ], !0)
1802
1883
  ])
1803
1884
  ]),
1804
- default: $(() => [
1805
- F("div", gn, [
1806
- L(D.$slots, "default", {}, void 0, !0)
1885
+ default: F(() => [
1886
+ M("div", An, [
1887
+ Y(A.$slots, "default", {}, void 0, !0)
1807
1888
  ])
1808
1889
  ]),
1809
1890
  _: 2
1810
1891
  }, [
1811
- c.value ? {
1892
+ p.value ? {
1812
1893
  name: "title",
1813
- fn: $(() => [
1814
- F("div", vn, [
1815
- B.value ? (a(), h("div", {
1894
+ fn: F(() => [
1895
+ M("div", Pn, [
1896
+ S.value ? (i(), g("div", {
1816
1897
  key: 0,
1817
- id: s(S),
1898
+ id: s(C),
1818
1899
  class: "yee-ui-modal__heading"
1819
1900
  }, [
1820
- L(D.$slots, "header", {}, () => [
1821
- F("span", yn, j(e.title), 1)
1901
+ Y(A.$slots, "header", {}, () => [
1902
+ M("span", Hn, D(e.title), 1)
1822
1903
  ], !0)
1823
- ], 8, mn)) : z("", !0),
1824
- F("div", hn, [
1825
- e.fullscreenButton ? (a(), M(s(ue), {
1904
+ ], 8, Nn)) : z("", !0),
1905
+ M("div", Ln, [
1906
+ e.fullscreenButton ? (i(), L(s(fe), {
1826
1907
  key: 0,
1827
- title: p.value
1908
+ title: c.value
1828
1909
  }, {
1829
- default: $(() => [
1830
- ne(s(re), {
1831
- "aria-label": p.value,
1910
+ default: F(() => [
1911
+ le(s(de), {
1912
+ "aria-label": c.value,
1832
1913
  "aria-pressed": T.value,
1833
1914
  class: "yee-ui-modal__header-action",
1834
1915
  size: "small",
1835
1916
  type: "text",
1836
1917
  onClick: k
1837
1918
  }, {
1838
- default: $(() => [
1839
- 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 }))
1840
1921
  ]),
1841
1922
  _: 1
1842
1923
  }, 8, ["aria-label", "aria-pressed"])
1843
1924
  ]),
1844
1925
  _: 1
1845
1926
  }, 8, ["title"])) : z("", !0),
1846
- e.closable ? (a(), M(s(re), {
1927
+ e.closable ? (i(), L(s(de), {
1847
1928
  key: 1,
1848
1929
  "aria-label": "关闭",
1849
1930
  class: "yee-ui-modal__header-action",
1850
1931
  size: "small",
1851
1932
  type: "text",
1852
- onClick: E
1933
+ onClick: V
1853
1934
  }, {
1854
- default: $(() => [
1855
- ne(l)
1935
+ default: F(() => [
1936
+ le(u)
1856
1937
  ]),
1857
1938
  _: 1
1858
1939
  })) : z("", !0)
@@ -1863,16 +1944,16 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
1863
1944
  } : void 0
1864
1945
  ]), 1040, ["centered", "class", "destroy-on-close", "keyboard", "mask-closable", "open", "style", "width", "wrap-props"]));
1865
1946
  }
1866
- }), jn = /* @__PURE__ */ ce(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 = {
1867
1948
  key: 0,
1868
1949
  class: "yee-ui-page__title"
1869
- }, kn = {
1950
+ }, Wn = {
1870
1951
  key: 0,
1871
1952
  class: "yee-ui-page__description"
1872
- }, Cn = {
1953
+ }, qn = {
1873
1954
  key: 0,
1874
1955
  class: "yee-ui-page__extra"
1875
- }, Sn = /* @__PURE__ */ ae({
1956
+ }, Gn = /* @__PURE__ */ se({
1876
1957
  name: "YeePage",
1877
1958
  __name: "YeePage",
1878
1959
  props: {
@@ -1885,77 +1966,77 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
1885
1966
  title: {}
1886
1967
  },
1887
1968
  setup(o) {
1888
- const t = o, e = Oe(), n = u(() => !!(t.description || t.title || e.description || e.extra || e.title)), m = u(() => t.autoContentHeight);
1889
- Qe(lt, m);
1890
- const x = O(0), g = O(0), d = O(!1), S = 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");
1891
1972
  let T;
1892
- function B() {
1893
- const P = S.value?.offsetHeight ?? 0, I = b.value?.offsetHeight ?? 0;
1894
- x.value !== P && (x.value = P), g.value !== I && (g.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);
1895
1976
  }
1896
- function C() {
1897
- T?.disconnect(), T = void 0, !(typeof ResizeObserver > "u") && (T = new ResizeObserver(B), S.value && T.observe(S.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));
1898
1979
  }
1899
- async function c() {
1980
+ async function p() {
1900
1981
  if (T?.disconnect(), T = void 0, !t.autoContentHeight) {
1901
- d.value = !1;
1982
+ v.value = !1;
1902
1983
  return;
1903
1984
  }
1904
- await Te(), B(), d.value = !0, C();
1985
+ await Te(), S(), v.value = !0, R();
1905
1986
  }
1906
- const p = u(() => ({
1987
+ const c = r(() => ({
1907
1988
  "--yee-page-height-offset": typeof t.heightOffset == "number" ? `${t.heightOffset}px` : t.heightOffset
1908
- })), N = u(() => t.autoContentHeight ? {
1909
- height: `calc(100% - ${x.value}px - ${g.value}px)`,
1910
- overflowY: d.value ? "auto" : "hidden"
1989
+ })), N = r(() => t.autoContentHeight ? {
1990
+ height: `calc(100% - ${_.value}px - ${h.value}px)`,
1991
+ overflowY: v.value ? "auto" : "hidden"
1911
1992
  } : {});
1912
- return ke(
1993
+ return Ce(
1913
1994
  [() => t.autoContentHeight, n, () => !!e.footer],
1914
1995
  () => {
1915
- c();
1996
+ p();
1916
1997
  },
1917
1998
  { flush: "post" }
1918
- ), Re(() => {
1919
- c();
1920
- }), Ce(() => T?.disconnect()), (P, I) => (a(), h("section", {
1999
+ ), Oe(() => {
2000
+ p();
2001
+ }), Se(() => T?.disconnect()), ($, j) => (i(), g("section", {
1921
2002
  class: ye(["yee-ui-page", { "yee-ui-page--auto-height": o.autoContentHeight }]),
1922
- style: he(p.value)
2003
+ style: ge(c.value)
1923
2004
  }, [
1924
- n.value ? (a(), h("header", {
2005
+ n.value ? (i(), g("header", {
1925
2006
  key: 0,
1926
2007
  ref_key: "headerRef",
1927
- ref: S,
2008
+ ref: C,
1928
2009
  class: ye(["yee-ui-page__header", o.headerClass])
1929
2010
  }, [
1930
- F("div", _n, [
1931
- L(P.$slots, "title", {}, () => [
1932
- o.title ? (a(), h("h1", xn, j(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)
1933
2014
  ], !0),
1934
- L(P.$slots, "description", {}, () => [
1935
- o.description ? (a(), h("p", kn, j(o.description), 1)) : z("", !0)
2015
+ Y($.$slots, "description", {}, () => [
2016
+ o.description ? (i(), g("p", Wn, D(o.description), 1)) : z("", !0)
1936
2017
  ], !0)
1937
2018
  ]),
1938
- P.$slots.extra ? (a(), h("div", Cn, [
1939
- L(P.$slots, "extra", {}, void 0, !0)
2019
+ $.$slots.extra ? (i(), g("div", qn, [
2020
+ Y($.$slots, "extra", {}, void 0, !0)
1940
2021
  ])) : z("", !0)
1941
2022
  ], 2)) : z("", !0),
1942
- F("main", {
2023
+ M("main", {
1943
2024
  class: ye(["yee-ui-page__content", o.contentClass]),
1944
- style: he(N.value)
2025
+ style: ge(N.value)
1945
2026
  }, [
1946
- L(P.$slots, "default", {}, void 0, !0)
2027
+ Y($.$slots, "default", {}, void 0, !0)
1947
2028
  ], 6),
1948
- P.$slots.footer ? (a(), h("footer", {
2029
+ $.$slots.footer ? (i(), g("footer", {
1949
2030
  key: 1,
1950
2031
  ref_key: "footerRef",
1951
- ref: b,
2032
+ ref: y,
1952
2033
  class: ye(["yee-ui-page__footer", o.footerClass])
1953
2034
  }, [
1954
- L(P.$slots, "footer", {}, void 0, !0)
2035
+ Y($.$slots, "footer", {}, void 0, !0)
1955
2036
  ], 2)) : z("", !0)
1956
2037
  ], 6));
1957
2038
  }
1958
- }), In = /* @__PURE__ */ ce(Sn, [["__scopeId", "data-v-ff8fc3a1"]]), $n = { class: "yee-ui-select__option-label" }, Tn = /* @__PURE__ */ ae({
2039
+ }), fa = /* @__PURE__ */ pe(Gn, [["__scopeId", "data-v-ba7ea0ff"]]), Kn = { class: "yee-ui-select__option-label" }, Jn = /* @__PURE__ */ se({
1959
2040
  inheritAttrs: !1,
1960
2041
  name: "YeeSelect",
1961
2042
  __name: "YeeSelect",
@@ -1967,148 +2048,139 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
1967
2048
  valueModifiers: {}
1968
2049
  }),
1969
2050
  emits: ["update:value"],
1970
- setup(o) {
1971
- const t = o, e = Ue(o, "value"), n = Ze(), m = Oe(), x = O(!1), g = u(() => ({
1972
- label: t.fieldNames?.label ?? "label",
1973
- options: t.fieldNames?.options ?? "options",
1974
- value: t.fieldNames?.value ?? "value"
1975
- })), d = u(() => n.class), S = u(() => n.style), b = u(() => {
1976
- const f = {};
1977
- for (const [v, l] of Object.entries(n))
1978
- v !== "class" && v !== "style" && v !== "onDropdownVisibleChange" && (f[v] = l);
1979
- return f;
1980
- }), T = u(() => !m.default && !m.option);
1981
- function B(f) {
1982
- const v = n.onDropdownVisibleChange;
1983
- if (typeof v == "function") {
1984
- v(f);
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;
2066
+ if (typeof d == "function") {
2067
+ d(m);
1985
2068
  return;
1986
2069
  }
1987
- v?.forEach((l) => l?.(f));
2070
+ d?.forEach((E) => E?.(m));
1988
2071
  }
1989
- function C(f) {
1990
- x.value = f, B(f);
2072
+ function j(m) {
2073
+ C.value = m, $(m);
1991
2074
  }
1992
- function c(f) {
1993
- return typeof f == "number" || typeof f == "string" ? String(f) : "";
2075
+ function q(m) {
2076
+ return typeof m == "number" || typeof m == "string" ? String(m) : "";
1994
2077
  }
1995
- function p(f, v) {
1996
- if (f)
1997
- for (const l of f) {
1998
- const E = l[g.value.options], A = p(E, v);
1999
- if (A) return A;
2000
- const Y = l[g.value.value];
2001
- if (Y === v || String(Y) === String(v)) 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;
2002
2085
  }
2003
2086
  }
2004
- function N(f) {
2005
- return f ? c(f[g.value.label]) || c(f.title) || c(f[g.value.value]) : "";
2087
+ function u(m) {
2088
+ return m ? q(m[y.value.label]) || q(m.title) || q(m[y.value.value]) : "";
2006
2089
  }
2007
- const P = u(() => {
2008
- const f = e.value;
2009
- if (!(f == null || f === ""))
2010
- return Array.isArray(f) ? f.map((v) => N(p(t.options, v)) || c(v)).filter(Boolean).join("、") || void 0 : N(p(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;
2011
2094
  });
2012
- function I(f) {
2013
- return N(f);
2014
- }
2015
- return (f, v) => (a(), M(s(ue), ee(x.value ? { open: !1 } : {}, { title: P.value }), {
2016
- default: $(() => [
2017
- F("div", {
2018
- class: ye(["yee-ui-select", d.value]),
2019
- style: he(S.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)
2020
2112
  }, [
2021
- T.value ? (a(), M(s(ze), ee({
2113
+ p.value ? (i(), L(s(e), ie({
2022
2114
  key: 0,
2023
- value: e.value,
2024
- "onUpdate:value": v[0] || (v[0] = (l) => e.value = l)
2025
- }, b.value, {
2026
- "field-names": g.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,
2027
2120
  options: o.options,
2028
- onDropdownVisibleChange: C
2029
- }), {
2030
- option: $((l) => [
2031
- ne(s(ue), {
2032
- title: I(l),
2121
+ onDropdownVisibleChange: j
2122
+ }), Re({
2123
+ option: F((E) => [
2124
+ le(s(fe), {
2125
+ title: I(E),
2033
2126
  placement: "left"
2034
2127
  }, {
2035
- default: $(() => [
2036
- F("span", $n, j(I(l)), 1)
2128
+ default: F(() => [
2129
+ M("span", Kn, D(I(E)), 1)
2037
2130
  ]),
2038
2131
  _: 2
2039
2132
  }, 1032, ["title"])
2040
2133
  ]),
2041
- _: 1
2042
- }, 16, ["value", "field-names", "options"])) : (a(), M(s(ze), ee({
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({
2043
2143
  key: 1,
2044
- value: e.value,
2045
- "onUpdate:value": v[1] || (v[1] = (l) => e.value = l)
2046
- }, b.value, {
2047
- "field-names": g.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,
2048
2149
  options: o.options,
2049
- onDropdownVisibleChange: C
2050
- }), Ve({ _: 2 }, [
2051
- f.$slots.default ? {
2052
- name: "default",
2053
- fn: $((l) => [
2054
- L(f.$slots, "default", ve(me(l)), void 0, !0)
2055
- ]),
2056
- key: "0"
2057
- } : void 0,
2058
- f.$slots.option ? {
2059
- name: "option",
2060
- fn: $((l) => [
2061
- L(f.$slots, "option", ve(me(l)), void 0, !0)
2062
- ]),
2063
- key: "1"
2064
- } : void 0,
2065
- f.$slots.tagRender ? {
2066
- name: "tagRender",
2067
- fn: $((l) => [
2068
- L(f.$slots, "tagRender", ve(me(l)), void 0, !0)
2069
- ]),
2070
- key: "2"
2071
- } : void 0,
2072
- f.$slots.dropdownRender ? {
2073
- name: "dropdownRender",
2074
- fn: $((l) => [
2075
- L(f.$slots, "dropdownRender", ve(me(l)), void 0, !0)
2076
- ]),
2077
- key: "3"
2078
- } : void 0,
2079
- f.$slots.notFoundContent ? {
2080
- name: "notFoundContent",
2081
- fn: $((l) => [
2082
- L(f.$slots, "notFoundContent", ve(me(l)), void 0, !0)
2083
- ]),
2084
- key: "4"
2085
- } : 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
+ }))
2086
2158
  ]), 1040, ["value", "field-names", "options"]))
2087
2159
  ], 6)
2088
2160
  ]),
2089
2161
  _: 3
2090
2162
  }, 16, ["title"]));
2091
2163
  }
2092
- }), Dn = /* @__PURE__ */ ce(Tn, [["__scopeId", "data-v-028e2b2a"]]);
2164
+ }), Qn = /* @__PURE__ */ pe(Jn, [["__scopeId", "data-v-8acc9d8f"]]), pa = Qn;
2093
2165
  export {
2094
- Vn as CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT,
2095
- Nn as PlatformConfigProvider,
2096
- Pn as YeeDescriptions,
2097
- Hn as YeeEllipsisText,
2098
- An as YeeFilePreview,
2099
- Ln as YeeFileUpload,
2100
- Jo as YeeForm,
2101
- Qo as YeeFormApi,
2102
- Xo as YeeGridApi,
2103
- jn as YeeModal,
2104
- In as YeePage,
2105
- Dn as YeeSelect,
2106
- qn as darkThemeTokens,
2107
- Gn as lightThemeTokens,
2108
- Ne as platformThemeKey,
2109
- Bt as resolvePlatformTheme,
2110
- Ft as toAntDesignTheme,
2111
- Et as toPlatformCssVariables,
2112
- zn as usePlatformTheme,
2113
- 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
2114
2186
  };