asiaint-lowcode 3.1.14 → 3.1.16
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/README.md +31 -31
- package/dist/asiaint-lowcode.js +1 -1
- package/dist/asiaint-lowcode.umd.cjs +40 -40
- package/dist/index.d.ts +6 -4
- package/dist/lazy/{Card-C3tLOVjH.js → Card-Cow_zpSf.js} +2 -2
- package/dist/lazy/{Cascader-C3CX1x9i.js → Cascader-CSkCF9DP.js} +1 -1
- package/dist/lazy/{Checkbox-BpBiXuBR.js → Checkbox-DR1XRXSJ.js} +2 -2
- package/dist/lazy/{Collapse-DxGtf-Rb.js → Collapse-CmfaSD2X.js} +1 -1
- package/dist/lazy/{Component-DB3T2Up4.js → Component-BPhkDIEo.js} +2 -2
- package/dist/lazy/{Component-DFOa2uIv.js → Component-CUpFYJ_b.js} +2 -2
- package/dist/lazy/{Component-CcNDQBof.js → Component-D3TFYEJM.js} +1 -1
- package/dist/lazy/{Component-hTCUS_wi.js → Component-DW8HGDiM.js} +1 -1
- package/dist/lazy/{Component-cOOPuJ9a.js → Component-DeIsCrm1.js} +1 -1
- package/dist/lazy/{Component-B_d6xnsS.js → Component-Dfa5LE-C.js} +2 -2
- package/dist/lazy/{CurdCard-VJm521ed.js → CurdCard-DhWtGzk5.js} +2 -2
- package/dist/lazy/{Custom-zeUDBX2P.js → Custom-Dy7scYxi.js} +7 -7
- package/dist/lazy/{DatePicker-B_jXdn9f.js → DatePicker-BPLq5XnB.js} +1 -1
- package/dist/lazy/{DragList-BqW7rAvT.js → DragList-BjQnVy7r.js} +2 -2
- package/dist/lazy/{FilterSearch-C8jsRRi9.js → FilterSearch-DIzEPTWm.js} +2 -2
- package/dist/lazy/{FormList-BC9wJOak.js → FormList-CumjG4m2.js} +1 -1
- package/dist/lazy/{Grid-TTxnHt2i.js → Grid-BP1q5Cyw.js} +1 -1
- package/dist/lazy/{Inline-Dc21MdcR.js → Inline-IaNWNLSe.js} +3 -3
- package/dist/lazy/{JsonEdit-DL09Qz4t.js → JsonEdit-BFHcb1Fu.js} +3 -3
- package/dist/lazy/{LogList-KyzWTXTG.js → LogList-D4bqjc6E.js} +7 -7
- package/dist/lazy/{ObjGroup-B4XtMzOy.js → ObjGroup-DX1X9rBM.js} +1 -1
- package/dist/lazy/{OfferDetails-Cxd87l5s.js → OfferDetails-Cp1nSNWI.js} +11 -11
- package/dist/lazy/{Pagination-C5QGCJcd.js → Pagination-D-eCDOe9.js} +7 -7
- package/dist/lazy/{Progress-DA-Dd5UL.js → Progress-BdCV77ll.js} +5 -5
- package/dist/lazy/{Radio-TiUteW46.js → Radio-BK5qu9LR.js} +3 -3
- package/dist/lazy/{SearchSelect-Dhu6paSW.js → SearchSelect-DpvLp1oC.js} +11 -11
- package/dist/lazy/{Select-CSRhfIrD.js → Select-BHZuWU-Q.js} +2 -2
- package/dist/lazy/{Table-DlcwlWIw.js → Table-DX3g374y.js} +2 -2
- package/dist/lazy/{Tabs-7Dhrr4Kd.js → Tabs-D-eD11Du.js} +1 -1
- package/dist/lazy/{Wrapper-BiT3q9Nd.js → Wrapper-BQMU2bE_.js} +6 -6
- package/dist/lazy/{index-0WXv5Q1Q.js → index-CSwaWW-4.js} +2501 -2482
- package/dist/lazy/useSelect-Bxv91nYW.js +78 -0
- package/dist/style.css +2 -2
- package/global.d.ts +10 -10
- package/package.json +36 -36
- package/dist/lazy/useSelect-As_zhxlt.js +0 -77
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { inject as A, ref as h, toRaw as y, onMounted as O, watch as o } from "vue";
|
|
2
|
+
import { $ as S, u as V, l as F, i as I } from "./index-CSwaWW-4.js";
|
|
3
|
+
import "element-plus";
|
|
4
|
+
const D = () => {
|
|
5
|
+
const { fetchOptionsFn: e } = A(S);
|
|
6
|
+
return e;
|
|
7
|
+
}, x = (e) => {
|
|
8
|
+
const i = V(), m = D(), a = h([]), c = h(!1);
|
|
9
|
+
let d = 0;
|
|
10
|
+
const s = F.debounce(async () => {
|
|
11
|
+
if (!m || !e.apiParams || Object.values(e.apiParams).some((l) => l === void 0))
|
|
12
|
+
return;
|
|
13
|
+
c.value = !0;
|
|
14
|
+
const t = ++d;
|
|
15
|
+
try {
|
|
16
|
+
const l = await m({
|
|
17
|
+
formItemProps: y(e),
|
|
18
|
+
formSchema: y(i.schema)
|
|
19
|
+
});
|
|
20
|
+
if (t !== d)
|
|
21
|
+
return;
|
|
22
|
+
const r = e.defaultOptions || [];
|
|
23
|
+
if (a.value = [...r, ...l], e.filters && (a.value = a.value.filter((n) => Array.isArray(e.filters) ? !e.filters.includes(n[e.valueKey || "value"]) : !0)), e.name) {
|
|
24
|
+
const n = I(i.schema.items, e.name);
|
|
25
|
+
n && n.props && (n.props.options = a.value);
|
|
26
|
+
}
|
|
27
|
+
const f = i.formValues[e.name], u = a.value.findIndex((n) => n[e.valueKey || "value"] === f) !== -1;
|
|
28
|
+
if (e.refreshFlag && a.value.length > 0 && !u) {
|
|
29
|
+
i.updateFormValues(
|
|
30
|
+
{
|
|
31
|
+
[`${e.name}`]: a.value[0][e.valueKey || "value"]
|
|
32
|
+
},
|
|
33
|
+
!0
|
|
34
|
+
);
|
|
35
|
+
const n = I(i.schema.items, e.name);
|
|
36
|
+
n && n.props && (n.props.refreshFlag = !1);
|
|
37
|
+
}
|
|
38
|
+
} finally {
|
|
39
|
+
c.value = !1;
|
|
40
|
+
}
|
|
41
|
+
}, 300);
|
|
42
|
+
O(() => {
|
|
43
|
+
const { mode: t, options: l = [] } = e;
|
|
44
|
+
t === "static" && (a.value = l), t === "remote" && s();
|
|
45
|
+
}), o(
|
|
46
|
+
() => e.apiParams,
|
|
47
|
+
(t, l) => {
|
|
48
|
+
F.isEqual(t, l) || (a.value = [], s());
|
|
49
|
+
}
|
|
50
|
+
), o(
|
|
51
|
+
() => e.options,
|
|
52
|
+
(t = []) => {
|
|
53
|
+
e.mode === "static" && (a.value = t);
|
|
54
|
+
}
|
|
55
|
+
), o(
|
|
56
|
+
() => e.mode,
|
|
57
|
+
(t) => {
|
|
58
|
+
t === "static" && (a.value = e.options || []), t === "remote" && (a.value = [], s());
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
const { mode: g, dependentFields: v } = e;
|
|
62
|
+
if (g === "remote" && Array.isArray(v))
|
|
63
|
+
for (const t of v)
|
|
64
|
+
o(
|
|
65
|
+
() => i.formValues[t],
|
|
66
|
+
(l, r) => {
|
|
67
|
+
s();
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
return { selectChange: (t) => {
|
|
71
|
+
const { valueKey: l = "value", multiple: r, name: f } = e;
|
|
72
|
+
let u = {};
|
|
73
|
+
r && Array.isArray(t) ? u = a.value.filter((n) => t.includes(n[l])) : u = a.value.find((n) => n[l] === t) || {}, i.selectData && f && i.updateSelectData(f, u);
|
|
74
|
+
}, currentOptions: a, loading: c, fetchData: s };
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
x as u
|
|
78
|
+
};
|