@flyto/farco 1.5.2 → 1.6.1

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