@yeepay/yee-boss-ui 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,43 +1,318 @@
1
- import { inject as I, defineComponent as P, computed as c, provide as K, openBlock as i, createBlock as b, unref as g, withCtx as v, createElementVNode as V, normalizeStyle as j, renderSlot as f, shallowRef as w, createElementBlock as d, withModifiers as Q, Fragment as J, renderList as E, toDisplayString as T, mergeProps as $, createVNode as N, createTextVNode as x, createCommentVNode as h, reactive as W, useSlots as U, useTemplateRef as X, watch as Z, onMounted as ee, onUnmounted as te, withDirectives as oe, vShow as ae, toHandlers as se, createSlots as ie, normalizeProps as R, guardReactiveProps as H, onBeforeUnmount as le, h as re, normalizeClass as S } from "vue";
2
- import { ConfigProvider as ne, DatePicker as ue, Input as ce, Select as me, Button as F, Tooltip as de } from "ant-design-vue";
3
- import { r as pe, t as fe, a as he } from "./tokens-Dj_CxJpe.js";
4
- import { d as rt, l as nt } from "./tokens-Dj_CxJpe.js";
5
- import { VxeTable as ge, VxeColumn as ve, VxeColgroup as ye, VxeGrid as D, VxeToolbar as be, VxeUI as M } from "vxe-table";
6
- import { VxeButton as Ve, VxeCheckbox as _e, VxeIcon as Te, VxeInput as Ce, VxeLoading as ke, VxeModal as xe, VxeNumberInput as Pe, VxePager as Se, VxeRadioGroup as $e, VxeSelect as Fe, VxeTooltip as we } from "vxe-pc-ui";
7
- const z = /* @__PURE__ */ Symbol("platform-theme");
8
- function tt() {
9
- const t = I(z);
10
- if (!t)
1
+ import { inject as ve, defineComponent as j, computed as r, provide as Oe, openBlock as s, createBlock as b, unref as p, withCtx as f, createElementVNode as w, normalizeStyle as ee, renderSlot as C, reactive as ye, onBeforeUnmount as he, mergeProps as M, createElementBlock as S, Fragment as ge, renderList as de, createTextVNode as A, toDisplayString as B, createCommentVNode as k, ref as Re, shallowRef as K, watch as re, withModifiers as ze, createVNode as I, useSlots as se, useTemplateRef as Ee, onMounted as Ye, onUnmounted as Ae, withDirectives as Me, vShow as Ie, toHandlers as je, createSlots as ae, normalizeProps as U, guardReactiveProps as H, h as be, useModel as ue, useAttrs as _e, useId as Le, mergeModels as ce, normalizeClass as X } from "vue";
2
+ import { ConfigProvider as Ue, Descriptions as pe, Tooltip as Z, message as q, Upload as He, Image as Ne, DatePicker as De, Input as Ge, Select as le, Button as Y, Drawer as qe, Modal as Ke } from "ant-design-vue";
3
+ import { r as Qe, t as We, a as Je } from "./tokens-CHaQtlyD.js";
4
+ import { d as Co, l as $o } from "./tokens-CHaQtlyD.js";
5
+ import { FullscreenExitOutlined as Xe, FullscreenOutlined as Ze, CloseOutlined as et } from "@ant-design/icons-vue";
6
+ import { VxeTable as tt, VxeColumn as ot, VxeColgroup as at, VxeGrid as we, VxeToolbar as lt, VxeUI as ke } from "vxe-table";
7
+ import { VxeButton as st, VxeCheckbox as nt, VxeIcon as it, VxeInput as rt, VxeLoading as ut, VxeModal as ct, VxeNumberInput as dt, VxePager as ft, VxeRadioGroup as pt, VxeSelect as mt, VxeTooltip as vt } from "vxe-pc-ui";
8
+ const fe = /* @__PURE__ */ Symbol("platform-theme");
9
+ function po() {
10
+ const l = ve(fe);
11
+ if (!l)
11
12
  throw new Error("usePlatformTheme 必须在 PlatformConfigProvider 内使用。");
12
- return t;
13
+ return l;
13
14
  }
14
- const Oe = ["data-theme"], Ye = /* @__PURE__ */ P({
15
+ const yt = ["data-theme"], ht = /* @__PURE__ */ j({
15
16
  name: "PlatformConfigProvider",
16
17
  __name: "PlatformConfigProvider",
17
18
  props: {
18
19
  theme: { default: () => ({}) }
19
20
  },
20
- setup(t) {
21
- const e = t, o = c(() => pe(e.theme)), s = c(() => fe(o.value)), n = c(() => he(o.value));
22
- return K(z, o), (l, m) => (i(), b(g(ne), { theme: s.value }, {
23
- default: v(() => [
24
- V("div", {
21
+ setup(l) {
22
+ const e = l, t = r(() => Qe(e.theme)), i = r(() => We(t.value)), v = r(() => Je(t.value));
23
+ return Oe(fe, t), (n, _) => (s(), b(p(Ue), { theme: i.value }, {
24
+ default: f(() => [
25
+ w("div", {
25
26
  class: "yee-platform-theme",
26
- "data-theme": o.value.mode,
27
- style: j(n.value)
27
+ "data-theme": t.value.mode,
28
+ style: ee(v.value)
28
29
  }, [
29
- f(l.$slots, "default", {}, void 0, !0)
30
- ], 12, Oe)
30
+ C(n.$slots, "default", {}, void 0, !0)
31
+ ], 12, yt)
31
32
  ]),
32
33
  _: 3
33
34
  }, 8, ["theme"]));
34
35
  }
35
- }), O = (t, e) => {
36
- const o = t.__vccOpts || t;
37
- for (const [s, n] of e)
38
- o[s] = n;
39
- return o;
40
- }, ot = /* @__PURE__ */ O(Ye, [["__scopeId", "data-v-36f21f18"]]), Ae = { class: "yee-form__fields" }, Ge = { class: "yee-form__label" }, Re = { class: "yee-form__actions" }, He = /* @__PURE__ */ P({
36
+ }), N = (l, e) => {
37
+ const t = l.__vccOpts || l;
38
+ for (const [i, v] of e)
39
+ t[i] = v;
40
+ return t;
41
+ }, mo = /* @__PURE__ */ N(ht, [["__scopeId", "data-v-36f21f18"]]);
42
+ async function gt(l) {
43
+ if (!l) return !1;
44
+ try {
45
+ return await navigator.clipboard.writeText(l), !0;
46
+ } catch {
47
+ const e = document.createElement("textarea");
48
+ e.value = l, e.style.position = "fixed", e.style.opacity = "0", document.body.append(e), e.focus(), e.select();
49
+ try {
50
+ return document.execCommand("copy");
51
+ } catch {
52
+ return !1;
53
+ } finally {
54
+ e.remove();
55
+ }
56
+ }
57
+ }
58
+ const bt = { class: "yee-descriptions__item" }, _t = { class: "yee-descriptions__content-row" }, wt = { class: "yee-descriptions__value yee-descriptions__value--ellipsis" }, kt = {
59
+ key: 1,
60
+ class: "yee-descriptions__value"
61
+ }, Ct = ["disabled", "onClick"], $t = /* @__PURE__ */ j({
62
+ name: "YeeDescriptions",
63
+ __name: "YeeDescriptions",
64
+ props: {
65
+ bordered: { type: Boolean },
66
+ colon: { type: Boolean },
67
+ column: {},
68
+ items: {},
69
+ layout: {},
70
+ size: {},
71
+ title: {}
72
+ },
73
+ setup(l) {
74
+ const e = l, t = r(() => e.bordered ?? !1), i = r(() => e.colon ?? !0), v = r(() => e.column ?? 3), n = r(() => e.layout ?? "horizontal"), _ = r(() => e.size ?? "default"), T = ye(/* @__PURE__ */ new Set()), F = /* @__PURE__ */ new Set();
75
+ function V(g, y) {
76
+ return g.name ?? `${g.label}-${y}`;
77
+ }
78
+ async function $(g, y) {
79
+ const u = String(g.value ?? "");
80
+ if (!u.trim()) {
81
+ q.warning("没有可复制的内容");
82
+ return;
83
+ }
84
+ if (!await gt(u)) {
85
+ q.error("复制失败");
86
+ return;
87
+ }
88
+ T.add(y), q.success("已复制");
89
+ const m = setTimeout(() => {
90
+ T.delete(y), F.delete(m);
91
+ }, 1500);
92
+ F.add(m);
93
+ }
94
+ return he(() => {
95
+ F.forEach((g) => clearTimeout(g)), F.clear();
96
+ }), (g, y) => (s(), b(p(pe), M({
97
+ class: "yee-descriptions",
98
+ bordered: t.value,
99
+ colon: i.value,
100
+ column: v.value,
101
+ layout: n.value,
102
+ size: _.value
103
+ }, e.title === void 0 ? {} : { title: e.title }), {
104
+ default: f(() => [
105
+ (s(!0), S(ge, null, de(l.items, (u, m) => (s(), b(p(pe).Item, {
106
+ key: V(u, m),
107
+ label: u.label,
108
+ span: u.span ?? 1
109
+ }, {
110
+ default: f(() => [
111
+ w("div", bt, [
112
+ w("div", _t, [
113
+ u.ellipsis ? (s(), b(p(Z), {
114
+ key: 0,
115
+ title: String(u.value ?? "")
116
+ }, {
117
+ default: f(() => [
118
+ w("span", wt, [
119
+ C(g.$slots, `content-${u.name ?? u.label}`, { item: u }, () => [
120
+ A(B(u.value), 1)
121
+ ], !0)
122
+ ])
123
+ ]),
124
+ _: 2
125
+ }, 1032, ["title"])) : (s(), S("span", kt, [
126
+ C(g.$slots, `content-${u.name ?? u.label}`, { item: u }, () => [
127
+ A(B(u.value), 1)
128
+ ], !0)
129
+ ])),
130
+ u.copyable ? (s(), S("button", {
131
+ key: 2,
132
+ class: "yee-descriptions__copy",
133
+ disabled: T.has(V(u, m)),
134
+ type: "button",
135
+ onClick: (o) => $(u, V(u, m))
136
+ }, B(T.has(V(u, m)) ? "已复制" : "复制"), 9, Ct)) : k("", !0)
137
+ ]),
138
+ u.info ? (s(), S("span", {
139
+ key: 0,
140
+ class: "yee-descriptions__info",
141
+ style: ee(u.infoStyle)
142
+ }, B(u.info), 5)) : k("", !0)
143
+ ])
144
+ ]),
145
+ _: 2
146
+ }, 1032, ["label", "span"]))), 128))
147
+ ]),
148
+ _: 3
149
+ }, 16, ["bordered", "colon", "column", "layout", "size"]));
150
+ }
151
+ }), vo = /* @__PURE__ */ N($t, [["__scopeId", "data-v-2297b86c"]]), St = { class: "yee-file-upload" }, Tt = {
152
+ key: 1,
153
+ class: "yee-file-upload__empty"
154
+ }, Bt = /* @__PURE__ */ j({
155
+ name: "YeeFileUpload",
156
+ __name: "YeeFileUpload",
157
+ props: {
158
+ accept: {},
159
+ customRequest: { type: Function },
160
+ fileList: {},
161
+ height: {},
162
+ manual: { type: Boolean },
163
+ maxCount: {},
164
+ maxSize: {},
165
+ multiple: { type: Boolean },
166
+ readonly: { type: Boolean },
167
+ uploadText: {},
168
+ width: {}
169
+ },
170
+ emits: ["fileRemoved", "fileSelect", "update:fileList", "uploadSuccess", "uploadingChange"],
171
+ setup(l, { expose: e, emit: t }) {
172
+ const i = l, v = t, n = Re([]), _ = K(!1), T = K(""), F = r(() => i.fileList ?? []), V = r(() => i.height ?? 100), $ = r(() => i.manual ?? !1), g = r(() => i.maxCount ?? 10), y = r(() => i.maxSize ?? 20), u = r(() => i.multiple ?? !1), m = r(() => i.readonly ?? !1), o = r(() => i.uploadText ?? "上传文件"), d = r(() => i.width ?? 100), c = r(() => ({
173
+ height: E(V.value),
174
+ width: E(d.value)
175
+ })), R = r(() => n.value.some((a) => a.status === "uploading"));
176
+ re(
177
+ F,
178
+ (a) => {
179
+ n.value = a.map((h) => ({ ...h }));
180
+ },
181
+ { immediate: !0 }
182
+ ), re(R, (a) => v("uploadingChange", a), { immediate: !0 });
183
+ function E(a) {
184
+ return typeof a == "number" ? `${a}px` : a;
185
+ }
186
+ function P() {
187
+ v("update:fileList", n.value.map((a) => ({ ...a })));
188
+ }
189
+ function L(a) {
190
+ return a < 1024 ? `${a}B` : a < 1024 * 1024 ? `${(a / 1024).toFixed(2)}KB` : `${(a / (1024 * 1024)).toFixed(2)}MB`;
191
+ }
192
+ function Q(a) {
193
+ return a.size <= y.value * 1024 * 1024 ? !1 : (q.error(`文件大小不能超过 ${y.value}MB,当前为 ${L(a.size)}`), !0);
194
+ }
195
+ function te(a) {
196
+ return a.type?.startsWith("image/") ?? /\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(a.url ?? "");
197
+ }
198
+ function ne(a) {
199
+ if (a.url) {
200
+ if (te(a)) {
201
+ T.value = a.url, _.value = !0;
202
+ return;
203
+ }
204
+ window.open(a.url, "_blank", "noopener,noreferrer");
205
+ }
206
+ }
207
+ function O(a) {
208
+ _.value = a;
209
+ }
210
+ function D(a, h, z) {
211
+ a.status = "done", a.percent = 100, h?.name && (a.name = h.name), h?.url && (a.url = h.url), P(), z(h), v("uploadSuccess");
212
+ }
213
+ function W(a, h, z) {
214
+ a.status = "error", P(), z(h);
215
+ }
216
+ function $e(a, h, z, oe) {
217
+ const G = n.value.find((x) => x.uid === h);
218
+ if (!G) return;
219
+ if (G.status = "uploading", G.percent = 0, P(), !i.customRequest) {
220
+ const x = new Error("未配置 customRequest");
221
+ q.error(x.message), W(G, x, oe);
222
+ return;
223
+ }
224
+ let J = !1;
225
+ const ie = {
226
+ file: a,
227
+ onError: (x) => {
228
+ J || (J = !0, W(G, x, oe));
229
+ },
230
+ onProgress: (x) => {
231
+ J || (G.percent = Math.min(100, Math.max(0, x)), P());
232
+ },
233
+ onSuccess: (x) => {
234
+ J || (J = !0, D(G, x, z));
235
+ },
236
+ uid: h
237
+ };
238
+ try {
239
+ Promise.resolve(i.customRequest(ie)).catch((x) => {
240
+ ie.onError(x instanceof Error ? x : new Error("上传失败"));
241
+ });
242
+ } catch (x) {
243
+ ie.onError(x instanceof Error ? x : new Error("上传失败"));
244
+ }
245
+ }
246
+ const Se = (a) => Q(a) || $.value ? !1 : i.customRequest ? !0 : (q.error("未配置 customRequest"), !1);
247
+ function Te(a) {
248
+ const h = a.file instanceof File ? a.file : void 0;
249
+ if (!h || Q(h)) {
250
+ a.onError?.(new Error("文件大小超过限制"));
251
+ return;
252
+ }
253
+ const z = h.uid ?? String(Date.now());
254
+ $e(h, z, a.onSuccess ?? (() => {
255
+ }), a.onError ?? (() => {
256
+ }));
257
+ }
258
+ function Be(a) {
259
+ if (n.value = a.fileList.map((z) => ({ ...z })), P(), !$.value) return;
260
+ const h = n.value.at(-1);
261
+ h?.originFileObj instanceof File && v("fileSelect", { file: h.originFileObj, uid: h.uid });
262
+ }
263
+ function Fe(a) {
264
+ v("fileRemoved", a);
265
+ }
266
+ function Ve(a, h) {
267
+ const z = n.value.find((oe) => oe.uid === a);
268
+ z && D(z, h, () => {
269
+ });
270
+ }
271
+ function xe(a) {
272
+ const h = n.value.find((z) => z.uid === a);
273
+ h && W(h, new Error("上传失败"), () => {
274
+ });
275
+ }
276
+ function Pe() {
277
+ return n.value.flatMap((a) => a.originFileObj instanceof File ? [a.originFileObj] : []);
278
+ }
279
+ return e({ addError: xe, addResult: Ve, getFiles: Pe }), (a, h) => (s(), S("div", St, [
280
+ !m.value || n.value.length > 0 ? (s(), b(p(He), M({ key: 0 }, l.accept ? { accept: l.accept } : {}, {
281
+ "before-upload": Se,
282
+ "custom-request": Te,
283
+ "file-list": n.value,
284
+ "max-count": g.value,
285
+ multiple: u.value,
286
+ "show-upload-list": { showRemoveIcon: !m.value },
287
+ "list-type": "picture-card",
288
+ onChange: Be,
289
+ onPreview: ne,
290
+ onRemove: Fe
291
+ }), {
292
+ default: f(() => [
293
+ !m.value && n.value.length < g.value ? (s(), S("div", {
294
+ key: 0,
295
+ class: "yee-file-upload__trigger",
296
+ style: ee(c.value)
297
+ }, [
298
+ h[0] || (h[0] = w("span", {
299
+ class: "yee-file-upload__trigger-sign",
300
+ "aria-hidden": "true"
301
+ }, "+", -1)),
302
+ w("span", null, B(o.value), 1)
303
+ ], 4)) : k("", !0)
304
+ ]),
305
+ _: 1
306
+ }, 16, ["file-list", "max-count", "multiple", "show-upload-list"])) : (s(), S("span", Tt, "暂无文件")),
307
+ T.value ? (s(), b(p(Ne), {
308
+ key: 2,
309
+ class: "yee-file-upload__preview",
310
+ preview: { visible: _.value, onVisibleChange: O },
311
+ src: T.value
312
+ }, null, 8, ["preview", "src"])) : k("", !0)
313
+ ]));
314
+ }
315
+ }), yo = /* @__PURE__ */ N(Bt, [["__scopeId", "data-v-9d1ac9cf"]]), Ft = { class: "yee-form__fields" }, Vt = { class: "yee-form__label" }, xt = { class: "yee-form__actions" }, Pt = /* @__PURE__ */ j({
41
316
  name: "YeeForm",
42
317
  __name: "YeeForm",
43
318
  props: {
@@ -46,104 +321,104 @@ const Oe = ["data-theme"], Ye = /* @__PURE__ */ P({
46
321
  onSubmit: { type: Function },
47
322
  options: {}
48
323
  },
49
- setup(t) {
50
- const e = t, o = ue.RangePicker, s = w(e.options.collapsed ?? !0);
324
+ setup(l) {
325
+ const e = l, t = De.RangePicker, i = K(e.options.collapsed ?? !0);
51
326
  e.api.configure(e.options);
52
- const n = c(() => e.api.schema.value.filter((u) => !u.hide));
53
- function l(u) {
54
- return e.api.getFieldValue(u.fieldName);
327
+ const v = r(() => e.api.schema.value.filter((y) => !y.hide));
328
+ function n(y) {
329
+ return e.api.getFieldValue(y.fieldName);
55
330
  }
56
- function m(u) {
57
- const p = l(u);
331
+ function _(y) {
332
+ const u = n(y);
58
333
  return {
59
- ...u.componentProps,
60
- ...p === void 0 ? {} : { value: p }
334
+ ...y.componentProps,
335
+ ...u === void 0 ? {} : { value: u }
61
336
  };
62
337
  }
63
- function C(u, p) {
64
- e.api.setFieldValue(u.fieldName, p), e.options.submitOnChange && k();
338
+ function T(y, u) {
339
+ e.api.setFieldValue(y.fieldName, u), e.options.submitOnChange && V();
65
340
  }
66
- async function Y() {
341
+ async function F() {
67
342
  e.api.resetForm(), await e.onReset?.();
68
343
  }
69
- async function k() {
344
+ async function V() {
70
345
  await e.onSubmit?.(e.api.getValues());
71
346
  }
72
- function A(u) {
73
- u.key === "Enter" && e.options.submitOnEnter && (u.preventDefault(), k());
347
+ function $(y) {
348
+ y.key === "Enter" && e.options.submitOnEnter && (y.preventDefault(), V());
74
349
  }
75
- function G() {
76
- s.value = !s.value, e.options.handleCollapsedChange?.(s.value);
350
+ function g() {
351
+ i.value = !i.value, e.options.handleCollapsedChange?.(i.value);
77
352
  }
78
- return (u, p) => (i(), d("form", {
353
+ return (y, u) => (s(), S("form", {
79
354
  class: "yee-form",
80
- onKeydown: A,
81
- onSubmit: Q(k, ["prevent"])
355
+ onKeydown: $,
356
+ onSubmit: ze(V, ["prevent"])
82
357
  }, [
83
- V("div", Ae, [
84
- (i(!0), d(J, null, E(n.value, (a) => (i(), d("label", {
85
- key: a.fieldName,
358
+ w("div", Ft, [
359
+ (s(!0), S(ge, null, de(v.value, (m) => (s(), S("label", {
360
+ key: m.fieldName,
86
361
  class: "yee-form__field"
87
362
  }, [
88
- V("span", Ge, T(a.label), 1),
89
- a.component === "Input" ? (i(), b(g(ce), $({
363
+ w("span", Vt, B(m.label), 1),
364
+ m.component === "Input" ? (s(), b(p(Ge), M({
90
365
  key: 0,
91
366
  ref_for: !0
92
- }, m(a), {
93
- "onUpdate:value": (r) => C(a, r)
94
- }), null, 16, ["onUpdate:value"])) : a.component === "Select" ? (i(), b(g(me), $({
367
+ }, _(m), {
368
+ "onUpdate:value": (o) => T(m, o)
369
+ }), null, 16, ["onUpdate:value"])) : m.component === "Select" ? (s(), b(p(le), M({
95
370
  key: 1,
96
371
  ref_for: !0
97
- }, m(a), {
98
- "onUpdate:value": (r) => C(a, r)
99
- }), null, 16, ["onUpdate:value"])) : (i(), b(g(o), $({
372
+ }, _(m), {
373
+ "onUpdate:value": (o) => T(m, o)
374
+ }), null, 16, ["onUpdate:value"])) : (s(), b(p(t), M({
100
375
  key: 2,
101
376
  ref_for: !0
102
- }, m(a), {
103
- "onUpdate:value": (r) => C(a, r)
377
+ }, _(m), {
378
+ "onUpdate:value": (o) => T(m, o)
104
379
  }), null, 16, ["onUpdate:value"]))
105
380
  ]))), 128))
106
381
  ]),
107
- V("div", Re, [
108
- N(g(F), {
382
+ w("div", xt, [
383
+ I(p(Y), {
109
384
  "html-type": "button",
110
- onClick: Y
385
+ onClick: F
111
386
  }, {
112
- default: v(() => [...p[0] || (p[0] = [
113
- x(" 重置 ", -1)
387
+ default: f(() => [...u[0] || (u[0] = [
388
+ A(" 重置 ", -1)
114
389
  ])]),
115
390
  _: 1
116
391
  }),
117
- N(g(F), {
392
+ I(p(Y), {
118
393
  type: "primary",
119
394
  "html-type": "submit"
120
395
  }, {
121
- default: v(() => [...p[1] || (p[1] = [
122
- x(" 查询 ", -1)
396
+ default: f(() => [...u[1] || (u[1] = [
397
+ A(" 查询 ", -1)
123
398
  ])]),
124
399
  _: 1
125
400
  }),
126
- t.options.showCollapseButton ? (i(), b(g(F), {
401
+ l.options.showCollapseButton ? (s(), b(p(Y), {
127
402
  key: 0,
128
403
  type: "link",
129
404
  "html-type": "button",
130
- onClick: G
405
+ onClick: g
131
406
  }, {
132
- default: v(() => [
133
- x(T(s.value ? "展开" : "收起"), 1)
407
+ default: f(() => [
408
+ A(B(i.value ? "展开" : "收起"), 1)
134
409
  ]),
135
410
  _: 1
136
- })) : h("", !0)
411
+ })) : k("", !0)
137
412
  ])
138
413
  ], 32));
139
414
  }
140
- }), Ne = /* @__PURE__ */ O(He, [["__scopeId", "data-v-12e77340"]]);
141
- class ze {
142
- schema = w([]);
415
+ }), Ot = /* @__PURE__ */ N(Pt, [["__scopeId", "data-v-12e77340"]]);
416
+ class Rt {
417
+ schema = K([]);
143
418
  initialValues = {};
144
- values = W({});
419
+ values = ye({});
145
420
  configure(e) {
146
- this.schema.value = e.schema.map((o) => ({ ...o })), this.initialValues = { ...e.initialValues }, this.resetForm();
421
+ this.schema.value = e.schema.map((t) => ({ ...t })), this.initialValues = { ...e.initialValues }, this.resetForm();
147
422
  }
148
423
  getFieldValue(e) {
149
424
  return this.values[e];
@@ -156,27 +431,27 @@ class ze {
156
431
  delete this.values[e];
157
432
  Object.assign(this.values, this.initialValues);
158
433
  }
159
- setFieldValue(e, o) {
160
- this.values[e] = o;
434
+ setFieldValue(e, t) {
435
+ this.values[e] = t;
161
436
  }
162
437
  setValues(e) {
163
438
  Object.assign(this.values, e);
164
439
  }
165
440
  updateSchema(e) {
166
- const o = new Map(e.map((s) => [s.fieldName, s]));
167
- this.schema.value = this.schema.value.map((s) => ({
168
- ...s,
169
- ...o.get(s.fieldName)
441
+ const t = new Map(e.map((i) => [i.fieldName, i]));
442
+ this.schema.value = this.schema.value.map((i) => ({
443
+ ...i,
444
+ ...t.get(i.fieldName)
170
445
  }));
171
446
  }
172
447
  }
173
- class Be {
174
- formApi = new ze();
448
+ class zt {
449
+ formApi = new Rt();
175
450
  searchFormVisible;
176
451
  state;
177
452
  grid;
178
453
  constructor(e) {
179
- this.state = w(e), this.searchFormVisible = w(e.showSearchForm ?? !0);
454
+ this.state = K(e), this.searchFormVisible = K(e.showSearchForm ?? !0);
180
455
  }
181
456
  mount(e) {
182
457
  this.grid = e;
@@ -207,35 +482,35 @@ class Be {
207
482
  this.grid = void 0;
208
483
  }
209
484
  }
210
- let B = !1;
211
- function q() {
212
- if (B) return;
485
+ let me = !1;
486
+ function Ce() {
487
+ if (me) return;
213
488
  [
214
- ge,
215
- ve,
216
- ye,
217
- D,
218
- be,
219
- Ve,
220
- _e,
221
- Te,
222
- Ce,
223
- ke,
224
- xe,
225
- Pe,
226
- Se,
227
- $e,
228
- Fe,
229
- we
230
- ].forEach((e) => M.component(e)), B = !0;
489
+ tt,
490
+ ot,
491
+ at,
492
+ we,
493
+ lt,
494
+ st,
495
+ nt,
496
+ it,
497
+ rt,
498
+ ut,
499
+ ct,
500
+ dt,
501
+ ft,
502
+ pt,
503
+ mt,
504
+ vt
505
+ ].forEach((e) => ke.component(e)), me = !0;
231
506
  }
232
- const Ie = { class: "yee-grid" }, je = {
507
+ const Et = { class: "yee-grid" }, Yt = {
233
508
  key: 1,
234
509
  class: "yee-grid__separator"
235
- }, Ee = {
510
+ }, At = {
236
511
  key: 0,
237
512
  class: "yee-grid__title"
238
- }, Ue = /* @__PURE__ */ P({
513
+ }, Mt = /* @__PURE__ */ j({
239
514
  name: "YeeGrid",
240
515
  __name: "YeeGrid",
241
516
  props: {
@@ -243,176 +518,443 @@ const Ie = { class: "yee-grid" }, je = {
243
518
  tableTitle: {},
244
519
  tableTitleHelp: {}
245
520
  },
246
- setup(t) {
247
- const e = t, o = U(), s = X("gridRef"), n = I(z);
248
- q();
249
- const l = c(() => e.api.state.value), m = c(() => l.value.formOptions), C = c(() => !!(e.tableTitle || o["table-title"] || o["toolbar-actions"] || o["toolbar-tools"])), Y = c(() => Object.keys(o).filter((a) => ![
521
+ setup(l) {
522
+ const e = l, t = se(), i = Ee("gridRef"), v = ve(fe);
523
+ Ce();
524
+ const n = r(() => e.api.state.value), _ = r(() => n.value.formOptions), T = r(() => !!(e.tableTitle || t["table-title"] || t["toolbar-actions"] || t["toolbar-tools"])), F = r(() => Object.keys(t).filter((o) => ![
250
525
  "empty",
251
526
  "loading",
252
527
  "table-title",
253
528
  "toolbar-actions",
254
529
  "toolbar-tools"
255
- ].includes(a))), k = c(() => !!l.value.gridOptions.toolbarConfig?.search), A = c(() => {
256
- const a = l.value.gridOptions, r = a.proxyConfig, y = r?.ajax?.query, _ = a.toolbarConfig;
530
+ ].includes(o))), V = r(() => !!n.value.gridOptions.toolbarConfig?.search), $ = r(() => {
531
+ const o = n.value.gridOptions, d = o.proxyConfig, c = d?.ajax?.query, R = o.toolbarConfig, E = o.pagerConfig;
257
532
  return {
258
533
  align: "left",
259
534
  border: "inner",
260
535
  minHeight: 180,
261
536
  showOverflow: "tooltip",
262
537
  size: "medium",
263
- ...a,
264
- ...a.pagerConfig ? {
538
+ ...o,
539
+ ...E ? {
265
540
  pagerConfig: {
266
541
  pageSize: 20,
267
542
  pageSizes: [10, 20, 30, 50, 100, 200],
268
- layouts: ["Total", "Sizes", "PrevPage", "Number", "NextPage"],
269
- ...a.pagerConfig
543
+ layouts: ["Total", "Sizes", "Home", "PrevPage", "Number", "NextPage", "End"],
544
+ ...E,
545
+ slots: {
546
+ sizes: "pagerSizes",
547
+ ...E.slots
548
+ }
270
549
  }
271
550
  } : {},
272
- ...r ? {
551
+ ...d ? {
273
552
  proxyConfig: {
274
553
  autoLoad: !0,
275
554
  showResponseMsg: !1,
276
- ...r,
555
+ ...d,
277
556
  response: {
278
557
  list: "items",
279
558
  result: "items",
280
559
  total: "total",
281
- ...r.response
560
+ ...d.response
282
561
  },
283
- ...r.ajax ? {
562
+ ...d.ajax ? {
284
563
  ajax: {
285
- ...r.ajax,
286
- ...y ? {
287
- query: (L) => y(L, e.api.formApi.getValues())
564
+ ...d.ajax,
565
+ ...c ? {
566
+ query: (P) => c(P, e.api.formApi.getValues())
288
567
  } : {}
289
568
  }
290
569
  } : {}
291
570
  }
292
571
  } : {},
293
- ..._ || C.value ? {
572
+ ...R || T.value ? {
294
573
  toolbarConfig: {
295
574
  custom: !0,
296
575
  refresh: !0,
297
576
  zoom: !0,
298
- ..._,
577
+ ...R,
299
578
  slots: {
300
- ...e.tableTitle || o["table-title"] || o["toolbar-actions"] ? { buttons: "toolbarActions" } : {},
301
- ...o["toolbar-tools"] || _?.search ? { tools: "toolbarTools" } : {}
579
+ ...e.tableTitle || t["table-title"] || t["toolbar-actions"] ? { buttons: "toolbarActions" } : {},
580
+ ...t["toolbar-tools"] || R?.search ? { tools: "toolbarTools" } : {}
302
581
  }
303
582
  }
304
583
  } : {}
305
584
  };
306
- }), G = c(() => l.value.gridEvents ?? {});
307
- Z(
308
- () => n?.value.mode ?? "light",
309
- (a) => M.setTheme(a),
585
+ }), g = r(() => n.value.gridEvents ?? {});
586
+ re(
587
+ () => v?.value.mode ?? "light",
588
+ (o) => ke.setTheme(o),
310
589
  { immediate: !0 }
311
590
  );
312
- async function u() {
591
+ async function y() {
313
592
  await e.api.reload();
314
593
  }
315
- async function p() {
594
+ async function u() {
316
595
  await e.api.reload();
317
596
  }
318
- return ee(() => {
319
- s.value && e.api.mount(s.value);
320
- }), te(() => e.api.unmount()), (a, r) => (i(), d("section", Ie, [
321
- m.value ? oe((i(), b(Ne, {
597
+ function m(o, d) {
598
+ typeof d != "number" && typeof d != "string" || o.setPageSizeByEvent(new Event("change"), d);
599
+ }
600
+ return Ye(() => {
601
+ i.value && e.api.mount(i.value);
602
+ }), Ae(() => e.api.unmount()), (o, d) => (s(), S("section", Et, [
603
+ _.value ? Me((s(), b(Ot, {
322
604
  key: 0,
323
- api: t.api.formApi,
324
- options: m.value,
325
- "on-reset": p,
326
- "on-submit": u
605
+ api: l.api.formApi,
606
+ options: _.value,
607
+ "on-reset": u,
608
+ "on-submit": y
327
609
  }, null, 8, ["api", "options"])), [
328
- [ae, t.api.searchFormVisible.value]
329
- ]) : h("", !0),
330
- m.value && l.value.separator !== !1 ? (i(), d("div", je)) : h("", !0),
331
- N(g(D), $({
610
+ [Ie, l.api.searchFormVisible.value]
611
+ ]) : k("", !0),
612
+ _.value && n.value.separator !== !1 ? (s(), S("div", Yt)) : k("", !0),
613
+ I(p(we), M({
332
614
  ref_key: "gridRef",
333
- ref: s,
615
+ ref: i,
334
616
  class: "yee-grid__table"
335
- }, A.value, se(G.value)), ie({
336
- toolbarActions: v((y) => [
337
- f(a.$slots, "table-title", {}, () => [
338
- t.tableTitle ? (i(), d("div", Ee, [
339
- x(T(t.tableTitle) + " ", 1),
340
- t.tableTitleHelp ? (i(), b(g(de), {
617
+ }, $.value, je(g.value)), ae({
618
+ toolbarActions: f((c) => [
619
+ C(o.$slots, "table-title", {}, () => [
620
+ l.tableTitle ? (s(), S("div", At, [
621
+ A(B(l.tableTitle) + " ", 1),
622
+ l.tableTitleHelp ? (s(), b(p(Z), {
341
623
  key: 0,
342
- title: t.tableTitleHelp
624
+ title: l.tableTitleHelp
343
625
  }, {
344
- default: v(() => [...r[1] || (r[1] = [
345
- V("span", {
626
+ default: f(() => [...d[1] || (d[1] = [
627
+ w("span", {
346
628
  class: "yee-grid__help",
347
629
  tabindex: "0"
348
630
  }, "?", -1)
349
631
  ])]),
350
632
  _: 1
351
- }, 8, ["title"])) : h("", !0)
352
- ])) : h("", !0)
633
+ }, 8, ["title"])) : k("", !0)
634
+ ])) : k("", !0)
353
635
  ], !0),
354
- f(a.$slots, "toolbar-actions", R(H(y)), void 0, !0)
636
+ C(o.$slots, "toolbar-actions", U(H(c)), void 0, !0)
355
637
  ]),
356
- toolbarTools: v((y) => [
357
- f(a.$slots, "toolbar-tools", R(H(y)), void 0, !0),
358
- k.value && m.value ? (i(), b(g(F), {
638
+ toolbarTools: f((c) => [
639
+ C(o.$slots, "toolbar-tools", U(H(c)), void 0, !0),
640
+ V.value && _.value ? (s(), b(p(Y), {
359
641
  key: 0,
360
642
  size: "small",
361
- onClick: r[0] || (r[0] = (_) => t.api.toggleSearchForm())
643
+ onClick: d[0] || (d[0] = (R) => l.api.toggleSearchForm())
362
644
  }, {
363
- default: v(() => [
364
- x(T(t.api.searchFormVisible.value ? "隐藏查询" : "显示查询"), 1)
645
+ default: f(() => [
646
+ A(B(l.api.searchFormVisible.value ? "隐藏查询" : "显示查询"), 1)
365
647
  ]),
366
648
  _: 1
367
- })) : h("", !0)
649
+ })) : k("", !0)
650
+ ]),
651
+ pagerSizes: f(({ $pager: c, options: R, pageSize: E }) => [
652
+ I(p(le), {
653
+ class: "yee-grid__page-size",
654
+ options: R,
655
+ value: E,
656
+ onChange: (P) => m(c, P)
657
+ }, null, 8, ["options", "value", "onChange"])
368
658
  ]),
369
- empty: v(() => [
370
- f(a.$slots, "empty", {}, () => [
371
- r[2] || (r[2] = V("div", { class: "yee-grid__empty" }, "暂无数据", -1))
659
+ empty: f(() => [
660
+ C(o.$slots, "empty", {}, () => [
661
+ d[2] || (d[2] = w("div", { class: "yee-grid__empty" }, "暂无数据", -1))
372
662
  ], !0)
373
663
  ]),
374
664
  _: 2
375
665
  }, [
376
- E(Y.value, (y) => ({
377
- name: y,
378
- fn: v((_) => [
379
- f(a.$slots, y, R(H(_)), void 0, !0)
666
+ de(F.value, (c) => ({
667
+ name: c,
668
+ fn: f((R) => [
669
+ C(o.$slots, c, U(H(R)), void 0, !0)
380
670
  ])
381
671
  }))
382
672
  ]), 1040)
383
673
  ]));
384
674
  }
385
- }), De = /* @__PURE__ */ O(Ue, [["__scopeId", "data-v-d97be924"]]);
386
- function at(t) {
387
- q();
388
- const e = new Be(t), o = De;
389
- return [P({
675
+ }), It = /* @__PURE__ */ N(Mt, [["__scopeId", "data-v-dd189ec9"]]);
676
+ function ho(l) {
677
+ Ce();
678
+ const e = new zt(l), t = It;
679
+ return [j({
390
680
  name: "YeeGrid",
391
681
  inheritAttrs: !1,
392
682
  props: {
393
683
  tableTitle: String,
394
684
  tableTitleHelp: String
395
685
  },
396
- setup(n, { attrs: l, slots: m }) {
397
- return le(() => e.unmount()), () => re(o, {
398
- ...l,
686
+ setup(v, { attrs: n, slots: _ }) {
687
+ return he(() => e.unmount()), () => be(t, {
688
+ ...n,
399
689
  api: e,
400
- ...n.tableTitle ? { tableTitle: n.tableTitle } : {},
401
- ...n.tableTitleHelp ? { tableTitleHelp: n.tableTitleHelp } : {}
402
- }, m);
690
+ ...v.tableTitle ? { tableTitle: v.tableTitle } : {},
691
+ ...v.tableTitleHelp ? { tableTitleHelp: v.tableTitleHelp } : {}
692
+ }, _);
403
693
  }
404
694
  }), e];
405
695
  }
406
- const Me = { class: "yee-page__heading" }, qe = {
696
+ const jt = { class: "yee-modal__header" }, Lt = ["id"], Ut = { class: "yee-modal__title" }, Ht = {
697
+ key: 1,
698
+ class: "yee-modal__header-actions"
699
+ }, Nt = { class: "yee-modal__body" }, Dt = { class: "yee-modal__footer" }, Gt = { class: "yee-modal__header" }, qt = ["id"], Kt = { class: "yee-modal__title" }, Qt = { class: "yee-modal__header-actions" }, Wt = { class: "yee-modal__body" }, Jt = { class: "yee-modal__footer" }, Xt = /* @__PURE__ */ j({
700
+ inheritAttrs: !1,
701
+ name: "YeeModal",
702
+ __name: "YeeModal",
703
+ props: /* @__PURE__ */ ce({
704
+ cancelButtonText: { default: "取消" },
705
+ centered: { type: Boolean, default: !1 },
706
+ closable: { type: Boolean, default: !0 },
707
+ confirmButtonLoading: { type: Boolean, default: !1 },
708
+ confirmButtonText: { default: "确认" },
709
+ destroyOnClose: { type: Boolean, default: !0 },
710
+ fullscreen: { type: Boolean, default: !1 },
711
+ fullscreenButton: { type: Boolean, default: !0 },
712
+ keyboard: { type: Boolean, default: !1 },
713
+ maskClosable: { type: Boolean, default: !1 },
714
+ showCancelButton: { type: Boolean, default: !0 },
715
+ showConfirmButton: { type: Boolean, default: !0 },
716
+ style: { type: [Boolean, null, String, Object, Array] },
717
+ title: { default: "" },
718
+ type: { default: "modal" },
719
+ width: { default: 520 },
720
+ wrapProps: {}
721
+ }, {
722
+ open: { type: Boolean, default: !1 },
723
+ openModifiers: {}
724
+ }),
725
+ emits: /* @__PURE__ */ ce(["cancel", "close", "confirm", "update:fullscreen"], ["update:open"]),
726
+ setup(l, { emit: e }) {
727
+ const t = l, i = e, v = ue(l, "open"), n = ue(t, "fullscreen"), _ = _e(), T = se(), F = Le(), V = r(() => t.type === "drawer"), $ = r(() => !V.value && n.value), g = r(() => !!(t.title || T.header)), y = r(() => g.value || t.closable), u = r(() => g.value || t.fullscreenButton || t.closable), m = r(() => $.value ? "退出全屏" : "进入全屏"), o = r(() => {
728
+ const O = Object.prototype.hasOwnProperty.call(t.wrapProps ?? {}, "aria-labelledby");
729
+ return {
730
+ ...t.wrapProps,
731
+ "aria-labelledby": O ? t.wrapProps?.["aria-labelledby"] : g.value ? F : void 0
732
+ };
733
+ }), d = r(() => {
734
+ if ($.value)
735
+ return {
736
+ height: "100%",
737
+ margin: 0,
738
+ maxWidth: "100vw",
739
+ paddingBottom: 0,
740
+ top: 0,
741
+ width: "100vw"
742
+ };
743
+ });
744
+ function c() {
745
+ const { style: O, ...D } = _;
746
+ return D;
747
+ }
748
+ function R() {
749
+ return [_.style, t.style].filter(Boolean);
750
+ }
751
+ function E() {
752
+ return [_.style, t.style, d.value].filter(Boolean);
753
+ }
754
+ const P = () => T.closeIcon?.() ?? _.closeIcon ?? be(et);
755
+ function L(O) {
756
+ i("cancel", O), v.value = !1;
757
+ }
758
+ function Q(O) {
759
+ i("confirm", O);
760
+ }
761
+ function te() {
762
+ i("close");
763
+ }
764
+ function ne() {
765
+ n.value = !n.value;
766
+ }
767
+ return (O, D) => V.value ? (s(), b(p(qe), M({ key: 0 }, c(), {
768
+ class: "yee-modal-drawer",
769
+ closable: !1,
770
+ "destroy-on-close": t.destroyOnClose,
771
+ keyboard: t.keyboard,
772
+ "mask-closable": t.maskClosable,
773
+ open: v.value,
774
+ style: R(),
775
+ width: t.width,
776
+ onAfterOpenChange: D[0] || (D[0] = (W) => !W && te()),
777
+ onClose: L
778
+ }), ae({
779
+ footer: f(() => [
780
+ w("div", Dt, [
781
+ C(O.$slots, "footer", {}, () => [
782
+ t.showCancelButton ? (s(), b(p(Y), {
783
+ key: 0,
784
+ onClick: L
785
+ }, {
786
+ default: f(() => [
787
+ A(B(t.cancelButtonText), 1)
788
+ ]),
789
+ _: 1
790
+ })) : k("", !0),
791
+ t.showConfirmButton ? (s(), b(p(Y), {
792
+ key: 1,
793
+ loading: t.confirmButtonLoading,
794
+ type: "primary",
795
+ onClick: Q
796
+ }, {
797
+ default: f(() => [
798
+ A(B(t.confirmButtonText), 1)
799
+ ]),
800
+ _: 1
801
+ }, 8, ["loading"])) : k("", !0)
802
+ ], !0)
803
+ ])
804
+ ]),
805
+ default: f(() => [
806
+ w("div", Nt, [
807
+ C(O.$slots, "default", {}, void 0, !0)
808
+ ])
809
+ ]),
810
+ _: 2
811
+ }, [
812
+ y.value ? {
813
+ name: "title",
814
+ fn: f(() => [
815
+ w("div", jt, [
816
+ g.value ? (s(), S("div", {
817
+ key: 0,
818
+ id: p(F),
819
+ class: "yee-modal__heading"
820
+ }, [
821
+ C(O.$slots, "header", {}, () => [
822
+ w("span", Ut, B(t.title), 1)
823
+ ], !0)
824
+ ], 8, Lt)) : k("", !0),
825
+ t.closable ? (s(), S("div", Ht, [
826
+ I(p(Y), {
827
+ "aria-label": "关闭",
828
+ class: "yee-modal__header-action",
829
+ size: "small",
830
+ type: "text",
831
+ onClick: L
832
+ }, {
833
+ default: f(() => [
834
+ I(P)
835
+ ]),
836
+ _: 1
837
+ })
838
+ ])) : k("", !0)
839
+ ])
840
+ ]),
841
+ key: "0"
842
+ } : void 0
843
+ ]), 1040, ["destroy-on-close", "keyboard", "mask-closable", "open", "style", "width"])) : (s(), b(p(Ke), M({ key: 1 }, c(), {
844
+ centered: $.value ? !1 : t.centered,
845
+ class: {
846
+ "yee-modal": !0,
847
+ "yee-modal--fullscreen": $.value
848
+ },
849
+ closable: !1,
850
+ "destroy-on-close": t.destroyOnClose,
851
+ keyboard: t.keyboard,
852
+ "mask-closable": t.maskClosable,
853
+ open: v.value,
854
+ style: E(),
855
+ width: $.value ? "100vw" : t.width,
856
+ "wrap-props": o.value,
857
+ onAfterClose: te,
858
+ onCancel: L
859
+ }), ae({
860
+ footer: f(() => [
861
+ w("div", Jt, [
862
+ C(O.$slots, "footer", {}, () => [
863
+ t.showCancelButton ? (s(), b(p(Y), {
864
+ key: 0,
865
+ onClick: L
866
+ }, {
867
+ default: f(() => [
868
+ A(B(t.cancelButtonText), 1)
869
+ ]),
870
+ _: 1
871
+ })) : k("", !0),
872
+ t.showConfirmButton ? (s(), b(p(Y), {
873
+ key: 1,
874
+ loading: t.confirmButtonLoading,
875
+ type: "primary",
876
+ onClick: Q
877
+ }, {
878
+ default: f(() => [
879
+ A(B(t.confirmButtonText), 1)
880
+ ]),
881
+ _: 1
882
+ }, 8, ["loading"])) : k("", !0)
883
+ ], !0)
884
+ ])
885
+ ]),
886
+ default: f(() => [
887
+ w("div", Wt, [
888
+ C(O.$slots, "default", {}, void 0, !0)
889
+ ])
890
+ ]),
891
+ _: 2
892
+ }, [
893
+ u.value ? {
894
+ name: "title",
895
+ fn: f(() => [
896
+ w("div", Gt, [
897
+ g.value ? (s(), S("div", {
898
+ key: 0,
899
+ id: p(F),
900
+ class: "yee-modal__heading"
901
+ }, [
902
+ C(O.$slots, "header", {}, () => [
903
+ w("span", Kt, B(t.title), 1)
904
+ ], !0)
905
+ ], 8, qt)) : k("", !0),
906
+ w("div", Qt, [
907
+ t.fullscreenButton ? (s(), b(p(Z), {
908
+ key: 0,
909
+ title: m.value
910
+ }, {
911
+ default: f(() => [
912
+ I(p(Y), {
913
+ "aria-label": m.value,
914
+ "aria-pressed": $.value,
915
+ class: "yee-modal__header-action",
916
+ size: "small",
917
+ type: "text",
918
+ onClick: ne
919
+ }, {
920
+ default: f(() => [
921
+ $.value ? (s(), b(p(Xe), { key: 0 })) : (s(), b(p(Ze), { key: 1 }))
922
+ ]),
923
+ _: 1
924
+ }, 8, ["aria-label", "aria-pressed"])
925
+ ]),
926
+ _: 1
927
+ }, 8, ["title"])) : k("", !0),
928
+ t.closable ? (s(), b(p(Y), {
929
+ key: 1,
930
+ "aria-label": "关闭",
931
+ class: "yee-modal__header-action",
932
+ size: "small",
933
+ type: "text",
934
+ onClick: L
935
+ }, {
936
+ default: f(() => [
937
+ I(P)
938
+ ]),
939
+ _: 1
940
+ })) : k("", !0)
941
+ ])
942
+ ])
943
+ ]),
944
+ key: "0"
945
+ } : void 0
946
+ ]), 1040, ["centered", "class", "destroy-on-close", "keyboard", "mask-closable", "open", "style", "width", "wrap-props"]));
947
+ }
948
+ }), go = /* @__PURE__ */ N(Xt, [["__scopeId", "data-v-2419e7df"]]), Zt = { class: "yee-page__heading" }, eo = {
407
949
  key: 0,
408
950
  class: "yee-page__title"
409
- }, Le = {
951
+ }, to = {
410
952
  key: 0,
411
953
  class: "yee-page__description"
412
- }, Ke = {
954
+ }, oo = {
413
955
  key: 0,
414
956
  class: "yee-page__extra"
415
- }, Qe = /* @__PURE__ */ P({
957
+ }, ao = /* @__PURE__ */ j({
416
958
  name: "YeePage",
417
959
  __name: "YeePage",
418
960
  props: {
@@ -424,56 +966,181 @@ const Me = { class: "yee-page__heading" }, qe = {
424
966
  heightOffset: { default: 0 },
425
967
  title: {}
426
968
  },
427
- setup(t) {
428
- const e = t, o = U(), s = c(() => !!(e.description || e.title || o.description || o.extra || o.title)), n = c(() => ({
969
+ setup(l) {
970
+ const e = l, t = se(), i = r(() => !!(e.description || e.title || t.description || t.extra || t.title)), v = r(() => ({
429
971
  "--yee-page-height-offset": typeof e.heightOffset == "number" ? `${e.heightOffset}px` : e.heightOffset
430
972
  }));
431
- return (l, m) => (i(), d("section", {
432
- class: S(["yee-page", { "yee-page--auto-height": t.autoContentHeight }]),
433
- style: j(n.value)
973
+ return (n, _) => (s(), S("section", {
974
+ class: X(["yee-page", { "yee-page--auto-height": l.autoContentHeight }]),
975
+ style: ee(v.value)
434
976
  }, [
435
- s.value ? (i(), d("header", {
977
+ i.value ? (s(), S("header", {
436
978
  key: 0,
437
- class: S(["yee-page__header", t.headerClass])
979
+ class: X(["yee-page__header", l.headerClass])
438
980
  }, [
439
- V("div", Me, [
440
- f(l.$slots, "title", {}, () => [
441
- t.title ? (i(), d("h1", qe, T(t.title), 1)) : h("", !0)
981
+ w("div", Zt, [
982
+ C(n.$slots, "title", {}, () => [
983
+ l.title ? (s(), S("h1", eo, B(l.title), 1)) : k("", !0)
442
984
  ], !0),
443
- f(l.$slots, "description", {}, () => [
444
- t.description ? (i(), d("p", Le, T(t.description), 1)) : h("", !0)
985
+ C(n.$slots, "description", {}, () => [
986
+ l.description ? (s(), S("p", to, B(l.description), 1)) : k("", !0)
445
987
  ], !0)
446
988
  ]),
447
- l.$slots.extra ? (i(), d("div", Ke, [
448
- f(l.$slots, "extra", {}, void 0, !0)
449
- ])) : h("", !0)
450
- ], 2)) : h("", !0),
451
- V("main", {
452
- class: S(["yee-page__content", t.contentClass])
989
+ n.$slots.extra ? (s(), S("div", oo, [
990
+ C(n.$slots, "extra", {}, void 0, !0)
991
+ ])) : k("", !0)
992
+ ], 2)) : k("", !0),
993
+ w("main", {
994
+ class: X(["yee-page__content", l.contentClass])
453
995
  }, [
454
- f(l.$slots, "default", {}, void 0, !0)
996
+ C(n.$slots, "default", {}, void 0, !0)
455
997
  ], 2),
456
- l.$slots.footer ? (i(), d("footer", {
998
+ n.$slots.footer ? (s(), S("footer", {
457
999
  key: 1,
458
- class: S(["yee-page__footer", t.footerClass])
1000
+ class: X(["yee-page__footer", l.footerClass])
459
1001
  }, [
460
- f(l.$slots, "footer", {}, void 0, !0)
461
- ], 2)) : h("", !0)
1002
+ C(n.$slots, "footer", {}, void 0, !0)
1003
+ ], 2)) : k("", !0)
462
1004
  ], 6));
463
1005
  }
464
- }), st = /* @__PURE__ */ O(Qe, [["__scopeId", "data-v-23464940"]]);
1006
+ }), bo = /* @__PURE__ */ N(ao, [["__scopeId", "data-v-23464940"]]), lo = { class: "yee-select__option-label" }, so = /* @__PURE__ */ j({
1007
+ inheritAttrs: !1,
1008
+ name: "YeeSelect",
1009
+ __name: "YeeSelect",
1010
+ props: /* @__PURE__ */ ce({
1011
+ fieldNames: {},
1012
+ options: {}
1013
+ }, {
1014
+ value: {},
1015
+ valueModifiers: {}
1016
+ }),
1017
+ emits: ["update:value"],
1018
+ setup(l) {
1019
+ const e = l, t = ue(l, "value"), i = _e(), v = se(), n = r(() => ({
1020
+ label: e.fieldNames?.label ?? "label",
1021
+ options: e.fieldNames?.options ?? "options",
1022
+ value: e.fieldNames?.value ?? "value"
1023
+ })), _ = r(() => i.class), T = r(() => i.style), F = r(() => {
1024
+ const o = {};
1025
+ for (const [d, c] of Object.entries(i))
1026
+ d !== "class" && d !== "style" && (o[d] = c);
1027
+ return o;
1028
+ }), V = r(() => !v.default && !v.option);
1029
+ function $(o) {
1030
+ return typeof o == "number" || typeof o == "string" ? String(o) : "";
1031
+ }
1032
+ function g(o, d) {
1033
+ if (o)
1034
+ for (const c of o) {
1035
+ const R = c[n.value.options], E = g(R, d);
1036
+ if (E) return E;
1037
+ const P = c[n.value.value];
1038
+ if (P === d || String(P) === String(d)) return c;
1039
+ }
1040
+ }
1041
+ function y(o) {
1042
+ return o ? $(o[n.value.label]) || $(o.title) || $(o[n.value.value]) : "";
1043
+ }
1044
+ const u = r(() => {
1045
+ const o = t.value;
1046
+ if (!(o == null || o === ""))
1047
+ return Array.isArray(o) ? o.map((d) => y(g(e.options, d)) || $(d)).filter(Boolean).join("、") || void 0 : y(g(e.options, o)) || $(o) || void 0;
1048
+ });
1049
+ function m(o) {
1050
+ return y(o);
1051
+ }
1052
+ return (o, d) => (s(), b(p(Z), { title: u.value }, {
1053
+ default: f(() => [
1054
+ w("div", {
1055
+ class: X(["yee-select", _.value]),
1056
+ style: ee(T.value)
1057
+ }, [
1058
+ V.value ? (s(), b(p(le), M({
1059
+ key: 0,
1060
+ value: t.value,
1061
+ "onUpdate:value": d[0] || (d[0] = (c) => t.value = c)
1062
+ }, F.value, {
1063
+ "field-names": n.value,
1064
+ options: l.options
1065
+ }), {
1066
+ option: f((c) => [
1067
+ I(p(Z), {
1068
+ title: m(c),
1069
+ placement: "left"
1070
+ }, {
1071
+ default: f(() => [
1072
+ w("span", lo, B(m(c)), 1)
1073
+ ]),
1074
+ _: 2
1075
+ }, 1032, ["title"])
1076
+ ]),
1077
+ _: 1
1078
+ }, 16, ["value", "field-names", "options"])) : (s(), b(p(le), M({
1079
+ key: 1,
1080
+ value: t.value,
1081
+ "onUpdate:value": d[1] || (d[1] = (c) => t.value = c)
1082
+ }, F.value, {
1083
+ "field-names": n.value,
1084
+ options: l.options
1085
+ }), ae({ _: 2 }, [
1086
+ o.$slots.default ? {
1087
+ name: "default",
1088
+ fn: f((c) => [
1089
+ C(o.$slots, "default", U(H(c)), void 0, !0)
1090
+ ]),
1091
+ key: "0"
1092
+ } : void 0,
1093
+ o.$slots.option ? {
1094
+ name: "option",
1095
+ fn: f((c) => [
1096
+ C(o.$slots, "option", U(H(c)), void 0, !0)
1097
+ ]),
1098
+ key: "1"
1099
+ } : void 0,
1100
+ o.$slots.tagRender ? {
1101
+ name: "tagRender",
1102
+ fn: f((c) => [
1103
+ C(o.$slots, "tagRender", U(H(c)), void 0, !0)
1104
+ ]),
1105
+ key: "2"
1106
+ } : void 0,
1107
+ o.$slots.dropdownRender ? {
1108
+ name: "dropdownRender",
1109
+ fn: f((c) => [
1110
+ C(o.$slots, "dropdownRender", U(H(c)), void 0, !0)
1111
+ ]),
1112
+ key: "3"
1113
+ } : void 0,
1114
+ o.$slots.notFoundContent ? {
1115
+ name: "notFoundContent",
1116
+ fn: f((c) => [
1117
+ C(o.$slots, "notFoundContent", U(H(c)), void 0, !0)
1118
+ ]),
1119
+ key: "4"
1120
+ } : void 0
1121
+ ]), 1040, ["value", "field-names", "options"]))
1122
+ ], 6)
1123
+ ]),
1124
+ _: 3
1125
+ }, 8, ["title"]));
1126
+ }
1127
+ }), _o = /* @__PURE__ */ N(so, [["__scopeId", "data-v-64282659"]]);
465
1128
  export {
466
- ot as PlatformConfigProvider,
467
- Ne as YeeForm,
468
- ze as YeeFormApi,
469
- Be as YeeGridApi,
470
- st as YeePage,
471
- rt as darkThemeTokens,
472
- nt as lightThemeTokens,
473
- z as platformThemeKey,
474
- pe as resolvePlatformTheme,
475
- fe as toAntDesignTheme,
476
- he as toPlatformCssVariables,
477
- tt as usePlatformTheme,
478
- at as useYeeGrid
1129
+ mo as PlatformConfigProvider,
1130
+ vo as YeeDescriptions,
1131
+ yo as YeeFileUpload,
1132
+ Ot as YeeForm,
1133
+ Rt as YeeFormApi,
1134
+ zt as YeeGridApi,
1135
+ go as YeeModal,
1136
+ bo as YeePage,
1137
+ _o as YeeSelect,
1138
+ Co as darkThemeTokens,
1139
+ $o as lightThemeTokens,
1140
+ fe as platformThemeKey,
1141
+ Qe as resolvePlatformTheme,
1142
+ We as toAntDesignTheme,
1143
+ Je as toPlatformCssVariables,
1144
+ po as usePlatformTheme,
1145
+ ho as useYeeGrid
479
1146
  };