@flyto/farco 1.5.2 → 1.6.0

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.
@@ -0,0 +1,878 @@
1
+ import { defineComponent as R, computed as N, openBlock as y, createElementBlock as q, normalizeClass as de, normalizeStyle as z, createElementVNode as O, useSlots as le, ref as C, nextTick as ne, onMounted as _e, resolveComponent as ge, createBlock as F, createSlots as j, withCtx as m, renderSlot as h, Fragment as K, unref as t, createVNode as g, mergeProps as S, renderList as T, normalizeProps as w, guardReactiveProps as E, createTextVNode as W, toDisplayString as L, createCommentVNode as M, mergeModels as Q, useModel as oe, inject as ce, reactive as re, provide as me, toRef as te, resolveDynamicComponent as ie, h as ue } from "vue";
2
+ import { Space as he, Divider as H, Modal as ke, Input as $e, FormItem as Ce, Tooltip as Se, GridItem as Be, Form as qe, Grid as Fe } from "@arco-design/web-vue";
3
+ import { _ as Pe } from "./chunk-db179b28.js";
4
+ import { F as Oe } from "./chunk-f3768b0d.js";
5
+ import { _ as Ie } from "./chunk-2d4cc9ab.js";
6
+ import { _ as we } from "./chunk-3659754f.js";
7
+ import { _ as Ee } from "./chunk-867494bd.js";
8
+ import { _ as Te } from "./chunk-3e27c862.js";
9
+ import { _ as De } from "./chunk-18dd07f2.js";
10
+ import { _ as je } from "./chunk-8a4bafe4.js";
11
+ import { _ as Ne } from "./chunk-0f50b26a.js";
12
+ import { _ as Re } from "./chunk-995c23b4.js";
13
+ import { _ as G, x as Le, l as Me } from "./chunk-28ba1e67.js";
14
+ import { f as ye, a as be } from "./chunk-c9e8fc0f.js";
15
+ import { g as Ae, i as Ve, a as We, _ as xe, I as ze } from "./chunk-cf90d627.js";
16
+ import { _ as pe } from "./chunk-451afd44.js";
17
+ const Ke = {
18
+ contentClass: {
19
+ type: [String, Object, Array]
20
+ },
21
+ data: {
22
+ type: Object,
23
+ default: null
24
+ },
25
+ defaultData: {
26
+ type: Object,
27
+ default: null
28
+ },
29
+ gridProps: {
30
+ type: Object,
31
+ default: () => ({})
32
+ },
33
+ itemSpan: {
34
+ type: [Object, Number],
35
+ default: () => ({ span: { xxl: 6, xl: 8, lg: 8, md: 12, sm: 24, xs: 24 } })
36
+ },
37
+ labelWidth: {
38
+ type: [Number, String],
39
+ default: "80px"
40
+ },
41
+ items: {
42
+ type: Array,
43
+ default: () => [],
44
+ required: !0
45
+ }
46
+ }, Qe = R({
47
+ name: "IconSearch",
48
+ props: {
49
+ size: {
50
+ type: [Number, String]
51
+ },
52
+ strokeWidth: {
53
+ type: Number,
54
+ default: 4
55
+ },
56
+ strokeLinecap: {
57
+ type: String,
58
+ default: "butt",
59
+ validator: (e) => ["butt", "round", "square"].includes(e)
60
+ },
61
+ strokeLinejoin: {
62
+ type: String,
63
+ default: "miter",
64
+ validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
65
+ },
66
+ rotate: Number,
67
+ spin: Boolean
68
+ },
69
+ emits: {
70
+ click: (e) => !0
71
+ },
72
+ setup(e, { emit: u }) {
73
+ const o = Ae("icon"), d = N(() => [o, `${o}-search`, { [`${o}-spin`]: e.spin }]), a = N(() => {
74
+ const p = {};
75
+ return e.size && (p.fontSize = Ve(e.size) ? `${e.size}px` : e.size), e.rotate && (p.transform = `rotate(${e.rotate}deg)`), p;
76
+ });
77
+ return {
78
+ cls: d,
79
+ innerStyle: a,
80
+ onClick: (p) => {
81
+ u("click", p);
82
+ }
83
+ };
84
+ }
85
+ }), Ue = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
86
+ function He(e, u, o, d, a, k) {
87
+ return y(), q("svg", {
88
+ viewBox: "0 0 48 48",
89
+ fill: "none",
90
+ xmlns: "http://www.w3.org/2000/svg",
91
+ stroke: "currentColor",
92
+ class: de(e.cls),
93
+ style: z(e.innerStyle),
94
+ "stroke-width": e.strokeWidth,
95
+ "stroke-linecap": e.strokeLinecap,
96
+ "stroke-linejoin": e.strokeLinejoin,
97
+ onClick: u[0] || (u[0] = (...p) => e.onClick && e.onClick(...p))
98
+ }, u[1] || (u[1] = [
99
+ O("path", { d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485" }, null, -1)
100
+ ]), 14, Ue);
101
+ }
102
+ var X = /* @__PURE__ */ We(Qe, [["render", He]]);
103
+ const Ge = Object.assign(X, {
104
+ install: (e, u) => {
105
+ var o;
106
+ const d = (o = u == null ? void 0 : u.iconPrefix) != null ? o : "";
107
+ e.component(d + X.name, X);
108
+ }
109
+ }), Xe = {
110
+ defaultData: {
111
+ type: Object,
112
+ default: null
113
+ },
114
+ keyProp: {
115
+ required: !0,
116
+ type: String,
117
+ default: ""
118
+ },
119
+ textProp: {
120
+ required: !0,
121
+ type: String,
122
+ default: ""
123
+ },
124
+ placeholder: {
125
+ type: String,
126
+ default: ""
127
+ },
128
+ allowClear: {
129
+ type: Boolean,
130
+ default: !0
131
+ },
132
+ disabled: {
133
+ type: Boolean,
134
+ default: !1
135
+ },
136
+ queryListOptions: {
137
+ required: !0
138
+ },
139
+ popupProps: {
140
+ type: Object,
141
+ default: () => ({})
142
+ },
143
+ onBeforeOk: {
144
+ type: Function,
145
+ default: null
146
+ }
147
+ }, Ze = {
148
+ popupProps: {
149
+ type: Object,
150
+ default: () => ({
151
+ title: "\u8BF7\u9009\u62E9"
152
+ })
153
+ },
154
+ unmountOnClose: {
155
+ type: Boolean,
156
+ default: !0
157
+ },
158
+ queryListOptions: {
159
+ required: !0,
160
+ type: Object
161
+ },
162
+ defaultSelectedRows: {
163
+ type: Array,
164
+ default: null
165
+ },
166
+ onBeforeOk: {
167
+ type: Function
168
+ }
169
+ }, Z = {
170
+ id: {
171
+ type: String,
172
+ required: !0
173
+ },
174
+ simple: {
175
+ type: Boolean,
176
+ default: !1
177
+ },
178
+ title: {
179
+ type: [String, Boolean],
180
+ default: !1
181
+ },
182
+ filterCollapseable: {
183
+ type: Boolean,
184
+ default: !1
185
+ },
186
+ filterCollapseStatus: {
187
+ type: Boolean,
188
+ default: null
189
+ },
190
+ queryBtnText: {
191
+ type: String,
192
+ default: "\u67E5\u8BE2"
193
+ },
194
+ queryBtnProps: {
195
+ type: Object,
196
+ default: () => ({})
197
+ },
198
+ queryBtnLoading: {
199
+ type: Boolean,
200
+ default: !0
201
+ },
202
+ onBeforeQuery: {
203
+ type: Function,
204
+ default: null
205
+ },
206
+ resetBtnText: {
207
+ type: String,
208
+ default: "\u91CD\u7F6E"
209
+ },
210
+ resetBtnProps: {
211
+ type: Object,
212
+ default: () => ({})
213
+ },
214
+ tableData: {
215
+ type: Function,
216
+ default: null
217
+ },
218
+ autoQuery: {
219
+ type: Boolean,
220
+ default: !0
221
+ },
222
+ filterItems: {
223
+ type: [Array, Boolean],
224
+ default: []
225
+ },
226
+ fFormProps: {
227
+ type: Object,
228
+ default: () => ({})
229
+ },
230
+ tableCols: {
231
+ type: Array,
232
+ default: () => []
233
+ },
234
+ fTableProps: {
235
+ type: Object,
236
+ default: () => ({})
237
+ }
238
+ }, Je = { class: "f-query-list__filter-handle" }, Ye = {
239
+ key: 0,
240
+ class: "icon"
241
+ }, et = { class: "f-query-list__filter-handle" }, tt = { class: "f-query-list__table" }, x = "filter_", J = "table_", lt = /* @__PURE__ */ R({
242
+ __name: "fquery-list",
243
+ props: {
244
+ ...Z,
245
+ tableCols: {
246
+ ...Z.tableCols,
247
+ type: Array
248
+ },
249
+ tableData: {
250
+ ...Z.tableData,
251
+ type: Function
252
+ }
253
+ },
254
+ emits: [
255
+ "queryClick",
256
+ "resetClick",
257
+ "update:filterCollapseStatus",
258
+ "filterCollapseChange"
259
+ ],
260
+ setup(e, { expose: u, emit: o }) {
261
+ const d = o, a = e, k = le(), { filterSlotsNames: p, tableSlotNames: $ } = Object.keys(k).reduce(
262
+ (l, b) => (b.startsWith(x) && l.filterSlotsNames.push(
263
+ b.replace(new RegExp(`^${x}`), "")
264
+ ), b.startsWith(J) && l.tableSlotNames.push(
265
+ b.replace(new RegExp(`^${J}`), "")
266
+ ), l),
267
+ { filterSlotsNames: [], tableSlotNames: [] }
268
+ ), n = C(), i = C(), r = C(!1);
269
+ async function s() {
270
+ var b, D, _, B, A, V;
271
+ const l = Le({
272
+ ...(b = n.value) == null ? void 0 : b.data
273
+ });
274
+ if (d("queryClick", l), await ((D = a == null ? void 0 : a.onBeforeQuery) == null ? void 0 : D.call(a)) !== !1 && !await ((B = (_ = n.value) == null ? void 0 : _.ins) == null ? void 0 : B.validate()))
275
+ if (a.queryBtnLoading) {
276
+ r.value = !0;
277
+ try {
278
+ await ((A = i.value) == null ? void 0 : A.replayMethodData(l));
279
+ } finally {
280
+ r.value = !1;
281
+ }
282
+ } else
283
+ (V = i.value) == null || V.replayMethodData(l);
284
+ }
285
+ function f() {
286
+ var l, b;
287
+ d("resetClick"), (b = (l = n.value) == null ? void 0 : l.ins) == null || b.resetFields();
288
+ }
289
+ const c = a.filterCollapseStatus !== null ? N({
290
+ get() {
291
+ return v(a.filterCollapseStatus), a.filterCollapseStatus;
292
+ },
293
+ set(l) {
294
+ d("update:filterCollapseStatus", l);
295
+ }
296
+ }) : C(a.filterCollapseable);
297
+ function v(l = !c.value) {
298
+ !a.filterCollapseable || (c.value = l, ne(() => {
299
+ U(
300
+ c.value ? "shrink" : "closeAllCollapse"
301
+ ), d("filterCollapseChange", c.value);
302
+ }));
303
+ }
304
+ const P = C(), I = C(0), se = C(!1);
305
+ function U(l) {
306
+ var D, _, B;
307
+ const b = (D = n.value) == null ? void 0 : D.$el;
308
+ if (!b || l === "expand") {
309
+ I.value = 0;
310
+ return;
311
+ }
312
+ if (c.value)
313
+ I.value = ((_ = P == null ? void 0 : P.value) == null ? void 0 : _.scrollHeight) || 0;
314
+ else {
315
+ const A = b.scrollHeight, V = (((B = b.querySelector(".arco-grid-item")) == null ? void 0 : B.scrollHeight) || 0) * 2;
316
+ se.value = A > V, I.value = A - V;
317
+ }
318
+ setTimeout(() => {
319
+ P.value && (P.value.style.transition = "all 0.3s");
320
+ }, 100);
321
+ }
322
+ return _e(() => {
323
+ a.autoQuery && s(), ne(() => {
324
+ U("shrink");
325
+ });
326
+ }), u({
327
+ query: s,
328
+ filterIns: n,
329
+ tableIns: i
330
+ }), (l, b) => {
331
+ const D = ge("a-card");
332
+ return y(), F(D, {
333
+ class: "f-query-list",
334
+ bordered: !1
335
+ }, j({
336
+ default: m(() => [
337
+ h(l.$slots, "filter-prepend"),
338
+ l.filterItems !== !1 ? (y(), q(K, { key: 0 }, [
339
+ a.simple ? (y(), F(t(he), {
340
+ key: 0,
341
+ class: "f-query-list__filter--simple"
342
+ }, {
343
+ default: m(() => [
344
+ g(t(fe), S({
345
+ ref_key: "fFormIns",
346
+ ref: n,
347
+ class: "f-query-list__filter-form"
348
+ }, l.fFormProps, {
349
+ items: l.fFormProps.items || l.filterItems
350
+ }), j({ _: 2 }, [
351
+ T(t(p), (_) => ({
352
+ name: _,
353
+ fn: m((B) => [
354
+ h(l.$slots, `${x}${_}`, w(E(B)))
355
+ ])
356
+ }))
357
+ ]), 1040, ["items"]),
358
+ O("div", Je, [
359
+ g(t(G), S({ icon: "IconSearch" }, l.queryBtnProps, {
360
+ loading: r.value,
361
+ onClick: s
362
+ }), null, 16, ["loading"])
363
+ ])
364
+ ]),
365
+ _: 3
366
+ })) : (y(), q(K, { key: 1 }, [
367
+ a.filterCollapseable ? (y(), F(t(H), {
368
+ key: 0,
369
+ class: "f-query-list__top-divider-right-orientation",
370
+ orientation: "right",
371
+ margin: "15px",
372
+ style: { "margin-bottom": "2px" }
373
+ }, {
374
+ default: m(() => [
375
+ O("span", {
376
+ onClick: b[0] || (b[0] = (_) => c.value = !t(c))
377
+ }, [
378
+ g(t(pe), {
379
+ name: "IconDown",
380
+ rotate: t(c) ? 0 : 180,
381
+ pointer: !0
382
+ }, null, 8, ["rotate"]),
383
+ W(" " + L(t(c) ? "\u66F4\u591A\u6761\u4EF6" : "\u6536\u8D77\u6761\u4EF6"), 1)
384
+ ])
385
+ ]),
386
+ _: 1
387
+ })) : M("", !0),
388
+ O("div", {
389
+ style: z({
390
+ overflow: "hidden",
391
+ padding: t(c) ? "0" : "15px 0",
392
+ transition: "all 0.3s"
393
+ })
394
+ }, [
395
+ O("div", {
396
+ ref_key: "filterWarpRef",
397
+ ref: P,
398
+ class: de(["f-query-list__filter", {
399
+ "f-query-list__filter-collapseable": a.filterCollapseable
400
+ }]),
401
+ style: z({
402
+ marginBottom: `-${I.value}px`
403
+ })
404
+ }, [
405
+ g(t(fe), S({
406
+ ref_key: "fFormIns",
407
+ ref: n,
408
+ class: "f-query-list__filter-form"
409
+ }, l.fFormProps, {
410
+ items: l.fFormProps.items || l.filterItems
411
+ }), j({ _: 2 }, [
412
+ T(t(p), (_) => ({
413
+ name: _,
414
+ fn: m((B) => [
415
+ h(l.$slots, `${x}${_}`, w(E(B)))
416
+ ])
417
+ }))
418
+ ]), 1040, ["items"]),
419
+ O("div", {
420
+ class: "f-query-list__filter-divider",
421
+ style: z({
422
+ marginBottom: t(c) ? "0px" : `${I.value - 5}px`
423
+ })
424
+ }, [
425
+ se.value ? (y(), q("div", Ye, [
426
+ g(t(pe), {
427
+ name: "IconDownCircle",
428
+ size: 20,
429
+ rotate: I.value ? 0 : 180,
430
+ pointer: !0,
431
+ tooltip: I.value ? "\u5C55\u5F00\u6240\u6709\u7B5B\u9009\u6761\u4EF6" : "\u6536\u8D77",
432
+ onClick: b[1] || (b[1] = (_) => U(
433
+ I.value ? "expand" : "shrink"
434
+ ))
435
+ }, null, 8, ["rotate", "tooltip"])
436
+ ])) : M("", !0),
437
+ g(t(H), {
438
+ class: "divider",
439
+ direction: "vertical"
440
+ })
441
+ ], 4),
442
+ O("div", et, [
443
+ g(t(G), S({ icon: "IconSearch" }, l.queryBtnProps, {
444
+ loading: r.value,
445
+ onClick: s
446
+ }), {
447
+ default: m(() => [
448
+ W(L(l.queryBtnText), 1)
449
+ ]),
450
+ _: 1
451
+ }, 16, ["loading"]),
452
+ g(t(G), S({
453
+ type: "secondary",
454
+ icon: "IconRefresh"
455
+ }, l.resetBtnProps, { onClick: f }), {
456
+ default: m(() => [
457
+ W(L(l.resetBtnText), 1)
458
+ ]),
459
+ _: 1
460
+ }, 16)
461
+ ])
462
+ ], 6)
463
+ ], 4),
464
+ g(t(H), {
465
+ class: "f-query-list__divider",
466
+ style: { marginTop: "0px" }
467
+ })
468
+ ], 64))
469
+ ], 64)) : M("", !0),
470
+ h(l.$slots, "table-prepend"),
471
+ O("div", tt, [
472
+ g(t(xe), S({
473
+ id: `f-query-list__table-${l.id}`,
474
+ ref_key: "fTableIns",
475
+ ref: i
476
+ }, l.fTableProps, {
477
+ data: e.tableData,
478
+ cols: e.tableCols,
479
+ "no-immediately-method-data": !0
480
+ }), j({ _: 2 }, [
481
+ T(t($), (_) => ({
482
+ name: _,
483
+ fn: m((B) => [
484
+ h(l.$slots, `${J}${_}`, w(E(B)))
485
+ ])
486
+ }))
487
+ ]), 1040, ["id", "data", "cols"])
488
+ ])
489
+ ]),
490
+ _: 2
491
+ }, [
492
+ l.title || l.$slots.title ? {
493
+ name: "title",
494
+ fn: m(() => [
495
+ h(l.$slots, "title", {}, () => [
496
+ W(L(l.title), 1)
497
+ ])
498
+ ]),
499
+ key: "0"
500
+ } : void 0
501
+ ]), 1024);
502
+ };
503
+ }
504
+ }), ot = /* @__PURE__ */ R({
505
+ __name: "fpop-choice",
506
+ props: /* @__PURE__ */ Q(Ze, {
507
+ visible: { type: Boolean, default: !1 },
508
+ visibleModifiers: {}
509
+ }),
510
+ emits: /* @__PURE__ */ Q({
511
+ ok(e, u) {
512
+ return { data: e, e: u };
513
+ }
514
+ }, ["update:visible"]),
515
+ setup(e, { expose: u, emit: o }) {
516
+ const d = o, a = e, k = oe(e, "visible"), p = N(() => {
517
+ const r = a.queryListOptions || {};
518
+ return {
519
+ ...r,
520
+ fTableProps: {
521
+ ...r.fTableProps,
522
+ defaultSelectedRows: a.defaultSelectedRows
523
+ }
524
+ };
525
+ }), $ = C();
526
+ function n(...r) {
527
+ var s, f, c, v;
528
+ d(
529
+ "ok",
530
+ {
531
+ keys: (f = (s = $.value) == null ? void 0 : s.tableIns) == null ? void 0 : f.selectedRowKeys,
532
+ list: (v = (c = $.value) == null ? void 0 : c.tableIns) == null ? void 0 : v.selectedRows
533
+ },
534
+ ...r
535
+ );
536
+ }
537
+ function i(...r) {
538
+ var s, f, c, v;
539
+ a.onBeforeOk ? a.onBeforeOk(
540
+ {
541
+ keys: ((f = (s = $.value) == null ? void 0 : s.tableIns) == null ? void 0 : f.selectedRowKeys) || [],
542
+ list: ((v = (c = $.value) == null ? void 0 : c.tableIns) == null ? void 0 : v.selectedRows) || []
543
+ },
544
+ ...r
545
+ ) : r[0](!0);
546
+ }
547
+ return u({
548
+ qlIns: $,
549
+ open() {
550
+ k.value = !0;
551
+ },
552
+ close() {
553
+ k.value = !1;
554
+ }
555
+ }), (r, s) => (y(), F(t(ke), S({
556
+ visible: k.value,
557
+ "onUpdate:visible": s[0] || (s[0] = (f) => k.value = f),
558
+ "body-style": { paddingTop: 0, paddingBottom: 0 },
559
+ draggable: "",
560
+ width: "80%"
561
+ }, r.popupProps, {
562
+ "mask-closable": !1,
563
+ "unmount-on-close": a.unmountOnClose,
564
+ "on-before-ok": i,
565
+ onOk: n
566
+ }), {
567
+ default: m(() => [
568
+ g(t(lt), S({
569
+ ref_key: "qlIns",
570
+ ref: $,
571
+ class: "f-choice-query"
572
+ }, p.value), null, 16)
573
+ ]),
574
+ _: 1
575
+ }, 16, ["visible", "unmount-on-close"]));
576
+ }
577
+ }), rt = { class: "f-search" }, at = /* @__PURE__ */ R({
578
+ __name: "fsearch",
579
+ props: /* @__PURE__ */ Q(Xe, {
580
+ modelValue: {
581
+ default: []
582
+ },
583
+ modelModifiers: {}
584
+ }),
585
+ emits: ["update:modelValue"],
586
+ setup(e, { expose: u }) {
587
+ const o = e, d = C(), a = oe(e, "modelValue"), k = N(
588
+ () => a.value.map((f) => f[o.textProp || ""]).join(",")
589
+ ), p = C(), $ = N(() => {
590
+ const f = {
591
+ fTableProps: {
592
+ selectionConfig: {
593
+ type: "radio",
594
+ tagLabelKey: o.textProp
595
+ },
596
+ rowKey: o.keyProp
597
+ }
598
+ };
599
+ return Me.exports.merge(f, o.queryListOptions), f;
600
+ });
601
+ function n(f) {
602
+ var v, P;
603
+ (v = d.value) == null || v.blur(), f.target.tagName.toLocaleUpperCase() !== "SVG" ? (P = p.value) == null || P.open() : a.value = [];
604
+ }
605
+ const i = (f, c) => {
606
+ o.onBeforeOk ? o.onBeforeOk(f, (v) => {
607
+ v && (a.value = f.list), c(v);
608
+ }) : (a.value = f.list, c(!0));
609
+ }, r = ce(ye, null), s = N(
610
+ () => o.placeholder || `\u8BF7\u9009\u62E9${((r == null ? void 0 : r.label) || "\u2026\u2026").replace(/[: | :]$/, "")}`
611
+ );
612
+ return o.defaultData && (a.value = o.defaultData), u(
613
+ re({
614
+ data: a,
615
+ openPopChoice: n
616
+ })
617
+ ), (f, c) => {
618
+ var v;
619
+ return y(), q("div", rt, [
620
+ g(t($e), {
621
+ ref_key: "inputRef",
622
+ ref: d,
623
+ "model-value": k.value,
624
+ placeholder: s.value,
625
+ "allow-clear": o.allowClear,
626
+ onClick: n
627
+ }, {
628
+ suffix: m(() => [
629
+ g(t(Ge))
630
+ ]),
631
+ _: 1
632
+ }, 8, ["model-value", "placeholder", "allow-clear"]),
633
+ g(t(ot), {
634
+ ref_key: "popChoiceRef",
635
+ ref: p,
636
+ "query-list-options": $.value,
637
+ "popup-props": {
638
+ title: `\u8BF7\u9009\u62E9${((v = t(r)) == null ? void 0 : v.label) || "\u2026\u2026"}`,
639
+ ...o.popupProps
640
+ },
641
+ "default-selected-rows": a.value,
642
+ "on-before-ok": i
643
+ }, null, 8, ["query-list-options", "popup-props", "default-selected-rows"])
644
+ ]);
645
+ };
646
+ }
647
+ }), ae = "custom", ve = {
648
+ [ae]: null,
649
+ input: Pe,
650
+ text: Oe,
651
+ select: Ie,
652
+ radio: we,
653
+ checkbox: Ee,
654
+ switch: Te,
655
+ date: De,
656
+ range: je,
657
+ "ml-input": Ne,
658
+ textarea: Re,
659
+ search: at
660
+ }, st = {
661
+ prop: {
662
+ type: String,
663
+ default: null
664
+ },
665
+ comp: {
666
+ required: !0,
667
+ type: String,
668
+ default: null,
669
+ validator: (e) => Object.keys(ve).includes(e)
670
+ },
671
+ render: {
672
+ type: Function,
673
+ default: null,
674
+ validator: (e, u) => u.comp === ae
675
+ },
676
+ compProps: {
677
+ type: Object,
678
+ default: null
679
+ },
680
+ label: {
681
+ type: String,
682
+ default: ""
683
+ },
684
+ hideLabel: {
685
+ type: Boolean,
686
+ default: (e) => !e.label
687
+ },
688
+ tooltip: {
689
+ type: String,
690
+ default: null
691
+ },
692
+ required: {
693
+ type: Boolean,
694
+ default: !1
695
+ },
696
+ rules: {
697
+ type: [Object, Array],
698
+ default(e) {
699
+ return e.required ? [{ required: !0, message: `${e.label}\u4E0D\u80FD\u4E3A\u7A7A` }] : null;
700
+ }
701
+ }
702
+ }, nt = {
703
+ key: 0,
704
+ class: "f-form-item__prepend"
705
+ }, it = {
706
+ key: 3,
707
+ class: "f-form-item__append"
708
+ }, Y = "comp_", ut = /* @__PURE__ */ R({
709
+ __name: "fform-item",
710
+ props: /* @__PURE__ */ Q(st, {
711
+ modelValue: {},
712
+ modelModifiers: {}
713
+ }),
714
+ emits: ["update:modelValue"],
715
+ setup(e) {
716
+ const u = ce(be, { data: {} }), o = e, d = oe(e, "modelValue"), a = le(), { curSlotKeys: k, compSlotKeys: p } = Object.keys(a).reduce(
717
+ (n, i) => (i.startsWith(Y) ? n.compSlotKeys.push(i.replace(Y, "")) : i !== "default" && n.curSlotKeys.push(i), n),
718
+ {
719
+ curSlotKeys: [],
720
+ compSlotKeys: []
721
+ }
722
+ ), $ = o.comp ? ve[o.comp] : null;
723
+ return me(
724
+ ye,
725
+ re({
726
+ prop: te(o, "prop"),
727
+ label: te(o, "label")
728
+ })
729
+ ), (n, i) => (y(), F(t(Ce), {
730
+ "row-class": "f-form-item",
731
+ label: o.label,
732
+ "hide-label": o.hideLabel,
733
+ required: n.required,
734
+ rules: n.rules
735
+ }, j({
736
+ label: m((r) => [
737
+ h(n.$slots, "label", w(E(r)), () => [
738
+ O("span", null, L(o.label), 1),
739
+ o.tooltip || n.$slots.tooltip ? (y(), F(t(Se), { key: 0 }, {
740
+ content: m(() => [
741
+ h(n.$slots, "tooltip", {}, () => [
742
+ (y(!0), q(K, null, T(o.tooltip.split(`
743
+ `) || [], (s) => (y(), q("div", null, L(s), 1))), 256))
744
+ ])
745
+ ]),
746
+ default: m(() => [
747
+ g(t(ze), { style: { "margin-left": "3px" } })
748
+ ]),
749
+ _: 3
750
+ })) : M("", !0)
751
+ ])
752
+ ]),
753
+ default: m(() => [
754
+ n.$slots.prepend ? (y(), q("div", nt, [
755
+ h(n.$slots, "prepend", w(E(t(u).data)))
756
+ ])) : M("", !0),
757
+ o.comp === t(ae) ? h(n.$slots, "default", {
758
+ key: 1,
759
+ data: t(u).data
760
+ }, () => [
761
+ (y(), F(ie(o.render), {
762
+ data: t(u).data
763
+ }, null, 8, ["data"]))
764
+ ]) : (y(), F(ie(t($)), S({ key: 2 }, o.compProps, {
765
+ modelValue: d.value,
766
+ "onUpdate:modelValue": i[0] || (i[0] = (r) => d.value = r)
767
+ }), j({ _: 2 }, [
768
+ T(t(p), (r) => ({
769
+ name: r,
770
+ fn: m((s) => [
771
+ h(n.$slots, `${Y}${r}`, w(E(s)))
772
+ ])
773
+ }))
774
+ ]), 1040, ["modelValue"])),
775
+ n.$slots.append ? (y(), q("div", it, [
776
+ h(n.$slots, "append", w(E(t(u).data)))
777
+ ])) : M("", !0)
778
+ ]),
779
+ _: 2
780
+ }, [
781
+ T(t(k), (r) => ({
782
+ name: r,
783
+ fn: m((s) => [
784
+ h(n.$slots, r, w(E(s)))
785
+ ])
786
+ }))
787
+ ]), 1032, ["label", "hide-label", "required", "rules"]));
788
+ }
789
+ }), ee = "item-", fe = /* @__PURE__ */ R({
790
+ __name: "fform",
791
+ props: Ke,
792
+ setup(e, { expose: u }) {
793
+ const o = R({
794
+ inheritAttrs: !1,
795
+ props: {
796
+ gridItemProps: {
797
+ type: Object,
798
+ default: () => ({})
799
+ }
800
+ },
801
+ setup(i, { attrs: r, slots: s }) {
802
+ return () => ue(
803
+ Be,
804
+ i.gridItemProps,
805
+ () => ue(
806
+ ut,
807
+ {
808
+ ...r,
809
+ field: r.prop
810
+ },
811
+ s
812
+ )
813
+ );
814
+ }
815
+ }), d = e, a = le();
816
+ function k(i) {
817
+ return i ? Object.keys(a).reduce((r, s) => (s.startsWith(`${ee}${i}`) && r.push(
818
+ s.replace(new RegExp(`^${ee}${i}_`), "")
819
+ ), r), []) : [];
820
+ }
821
+ const p = d.data ? te(d, "data") : C({ ...d.defaultData }), $ = typeof d.itemSpan == "number" ? { span: d.itemSpan } : d.itemSpan, n = C();
822
+ return me(be, re({ data: p })), u({
823
+ data: p,
824
+ setFieldValue: (i, r) => {
825
+ if (d.data)
826
+ throw new Error("\u5728\u975E\u53D7\u63A7\u6A21\u5F0F\u4E0B\uFF0C\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E");
827
+ p.value[i] = r;
828
+ },
829
+ ins: n
830
+ }), (i, r) => (y(), F(t(qe), {
831
+ ref_key: "formRef",
832
+ ref: n,
833
+ class: "f-form",
834
+ model: t(p),
835
+ "auto-label-width": !0
836
+ }, {
837
+ default: m(() => [
838
+ h(i.$slots, "prepend", { data: t(p) }),
839
+ g(t(Fe), S(i.gridProps, { class: i.contentClass }), {
840
+ default: m(() => [
841
+ (y(!0), q(K, null, T(i.items, (s) => (y(), F(t(o), S({
842
+ key: s.prop,
843
+ modelValue: t(p)[s.prop],
844
+ "onUpdate:modelValue": (f) => t(p)[s.prop] = f
845
+ }, { ref_for: !0 }, s, {
846
+ "grid-item-props": s.gridItemProps || t($),
847
+ "label-col-flex": s.labelColFlex || i.labelWidth
848
+ }), j({ _: 2 }, [
849
+ T(k(s.slotName || ""), (f) => ({
850
+ name: f,
851
+ fn: m((c) => [
852
+ h(i.$slots, `${ee}${s.slotName}_${f}`, S({ ref_for: !0 }, c))
853
+ ])
854
+ }))
855
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "grid-item-props", "label-col-flex"]))), 128))
856
+ ]),
857
+ _: 3
858
+ }, 16, ["class"]),
859
+ h(i.$slots, "append", { data: t(p) })
860
+ ]),
861
+ _: 3
862
+ }, 8, ["model"]));
863
+ }
864
+ });
865
+ export {
866
+ ae as C,
867
+ fe as _,
868
+ ut as a,
869
+ lt as b,
870
+ ot as c,
871
+ at as d,
872
+ ve as e,
873
+ Ke as f,
874
+ st as g,
875
+ Z as h,
876
+ Ze as i,
877
+ Xe as j
878
+ };