asiaint-lowcode 3.1.14 → 3.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/asiaint-lowcode.js +1 -1
  2. package/dist/asiaint-lowcode.umd.cjs +35 -35
  3. package/dist/lazy/{Card-C3tLOVjH.js → Card-vmD3I9-j.js} +1 -1
  4. package/dist/lazy/{Cascader-C3CX1x9i.js → Cascader-hFRL1FW3.js} +1 -1
  5. package/dist/lazy/{Checkbox-BpBiXuBR.js → Checkbox-D2TDj_TR.js} +2 -2
  6. package/dist/lazy/{Collapse-DxGtf-Rb.js → Collapse-DG7__RLN.js} +1 -1
  7. package/dist/lazy/{Component-cOOPuJ9a.js → Component-B1h0Pd2f.js} +1 -1
  8. package/dist/lazy/{Component-B_d6xnsS.js → Component-Bd4HTi5E.js} +1 -1
  9. package/dist/lazy/{Component-DB3T2Up4.js → Component-BhShPxLr.js} +1 -1
  10. package/dist/lazy/{Component-DFOa2uIv.js → Component-C9vgVXl1.js} +1 -1
  11. package/dist/lazy/{Component-hTCUS_wi.js → Component-s1QCgYVc.js} +1 -1
  12. package/dist/lazy/{Component-CcNDQBof.js → Component-uGBpf8xa.js} +1 -1
  13. package/dist/lazy/{CurdCard-VJm521ed.js → CurdCard-DOvIo76P.js} +1 -1
  14. package/dist/lazy/{Custom-zeUDBX2P.js → Custom-Cnt4jYHK.js} +1 -1
  15. package/dist/lazy/{DatePicker-B_jXdn9f.js → DatePicker-ZjBTIbyE.js} +1 -1
  16. package/dist/lazy/{DragList-BqW7rAvT.js → DragList-D2uAhL8y.js} +1 -1
  17. package/dist/lazy/{FilterSearch-C8jsRRi9.js → FilterSearch-fZMKLSaX.js} +1 -1
  18. package/dist/lazy/{FormList-BC9wJOak.js → FormList-DWjzeNJW.js} +1 -1
  19. package/dist/lazy/{Grid-TTxnHt2i.js → Grid-BS-XRljD.js} +1 -1
  20. package/dist/lazy/{Inline-Dc21MdcR.js → Inline-CW0KfFbM.js} +1 -1
  21. package/dist/lazy/{JsonEdit-DL09Qz4t.js → JsonEdit-BDef953Z.js} +1 -1
  22. package/dist/lazy/{LogList-KyzWTXTG.js → LogList-COTdAxNy.js} +1 -1
  23. package/dist/lazy/{ObjGroup-B4XtMzOy.js → ObjGroup-B6LsHiHA.js} +1 -1
  24. package/dist/lazy/{OfferDetails-Cxd87l5s.js → OfferDetails-NaIOuP9k.js} +1 -1
  25. package/dist/lazy/{Pagination-C5QGCJcd.js → Pagination-BW9vH1f3.js} +1 -1
  26. package/dist/lazy/{Progress-DA-Dd5UL.js → Progress-KE-DI0NW.js} +1 -1
  27. package/dist/lazy/{Radio-TiUteW46.js → Radio-BgCNDKRx.js} +2 -2
  28. package/dist/lazy/{SearchSelect-Dhu6paSW.js → SearchSelect-CWbTKAII.js} +2 -2
  29. package/dist/lazy/{Select-CSRhfIrD.js → Select-Dt4VSGIj.js} +2 -2
  30. package/dist/lazy/{Table-DlcwlWIw.js → Table-3Au067wZ.js} +1 -1
  31. package/dist/lazy/{Tabs-7Dhrr4Kd.js → Tabs-CsB78dFG.js} +1 -1
  32. package/dist/lazy/{Wrapper-BiT3q9Nd.js → Wrapper-pbe-a8HN.js} +1 -1
  33. package/dist/lazy/{index-0WXv5Q1Q.js → index-DVCkxMS8.js} +592 -587
  34. package/dist/lazy/useSelect-7MjBwpDB.js +78 -0
  35. package/package.json +1 -1
  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-DVCkxMS8.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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asiaint-lowcode",
3
- "version": "3.1.14",
3
+ "version": "3.1.15",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,77 +0,0 @@
1
- import { inject as I, ref as h, toRaw as y, onMounted as O, watch as r } from "vue";
2
- import { $ as S, u as D, l as F, i as g } from "./index-0WXv5Q1Q.js";
3
- import "element-plus";
4
- const P = () => {
5
- const { fetchOptionsFn: e } = I(S);
6
- return e;
7
- }, $ = (e) => {
8
- const s = D(), m = P(), a = h([]), f = h(!1);
9
- let d = 0;
10
- const l = F.debounce(async () => {
11
- if (!m || !e.apiParams || Object.values(e.apiParams).some((n) => n === void 0))
12
- return;
13
- f.value = !0;
14
- const t = ++d;
15
- try {
16
- const n = await m({
17
- formItemProps: y(e),
18
- formSchema: y(s.schema)
19
- });
20
- if (t !== d)
21
- return;
22
- const u = e.defaultOptions || [];
23
- if (a.value = [...u, ...n], e.filters && (a.value = a.value.filter((i) => Array.isArray(e.filters) ? !e.filters.includes(i[e.valueKey || "value"]) : !0)), e.name) {
24
- const i = g(s.schema.items, e.name);
25
- i && i.props && (i.props.options = a.value);
26
- }
27
- if (e.refreshFlag && a.value.length >= 1) {
28
- s.updateFormValues(
29
- {
30
- [`${e.name}`]: a.value[0][e.valueKey || "value"]
31
- },
32
- !0
33
- );
34
- const i = g(s.schema.items, e.name);
35
- i && i.props && (i.props.refreshFlag = !1);
36
- }
37
- } finally {
38
- f.value = !1;
39
- }
40
- }, 300);
41
- O(() => {
42
- const { mode: t, options: n = [] } = e;
43
- t === "static" && (a.value = n), t === "remote" && l();
44
- }), r(
45
- () => e.apiParams,
46
- (t, n) => {
47
- F.isEqual(t, n) || (a.value = [], l());
48
- }
49
- ), r(
50
- () => e.options,
51
- (t = []) => {
52
- e.mode === "static" && (a.value = t);
53
- }
54
- ), r(
55
- () => e.mode,
56
- (t) => {
57
- t === "static" && (a.value = e.options || []), t === "remote" && (a.value = [], l());
58
- }
59
- );
60
- const { mode: A, dependentFields: v } = e;
61
- if (A === "remote" && Array.isArray(v))
62
- for (const t of v)
63
- r(
64
- () => s.formValues[t],
65
- (n, u) => {
66
- l();
67
- }
68
- );
69
- return { selectChange: (t) => {
70
- const { valueKey: n = "value", multiple: u, name: i } = e;
71
- let o = {};
72
- u && Array.isArray(t) ? o = a.value.filter((c) => t.includes(c[n])) : o = a.value.find((c) => c[n] === t) || {}, s.selectData && i && s.updateSelectData(i, o);
73
- }, currentOptions: a, loading: f, fetchData: l };
74
- };
75
- export {
76
- $ as u
77
- };