@hybridcore/ui 1.4.24 → 1.4.26
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.
|
@@ -54,7 +54,7 @@ function Te(e, j) {
|
|
|
54
54
|
for (let i = 0; i < r.length; i++) {
|
|
55
55
|
const l = r[i], d = ee.get(t, `variables.${l.propertyId}`);
|
|
56
56
|
if (d && e.keyAuth) {
|
|
57
|
-
const c = await ae(ye), u = await ie(c, d);
|
|
57
|
+
const c = await ae(ye), u = await ie(c, String(d));
|
|
58
58
|
u.data && (b(`variables.${l.propertyId}`, u.data), Q((f) => f + 1));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1,88 +1,107 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { CollapsibleCard as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import s from "lodash";
|
|
3
|
+
import { CollapsibleCard as I } from "../collapsible-card/index.js";
|
|
4
|
+
import p from "./property.js";
|
|
5
|
+
import { Box as c } from "@mui/material";
|
|
6
|
+
const b = ({
|
|
7
|
+
values: a,
|
|
8
|
+
templates: m,
|
|
9
|
+
inputVariant: h,
|
|
10
|
+
fieldOptions: i,
|
|
10
11
|
onChange: g
|
|
11
12
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
let e =
|
|
13
|
+
const y = (o) => (t) => {
|
|
14
|
+
if (o) {
|
|
15
|
+
let e = a.find((r) => r.templateKey === o);
|
|
15
16
|
if (e) {
|
|
16
|
-
const r =
|
|
17
|
-
let
|
|
18
|
-
(
|
|
17
|
+
const r = s.keys(t)[0];
|
|
18
|
+
let l = e.filters.findIndex(
|
|
19
|
+
(n) => n.fieldName === r
|
|
19
20
|
);
|
|
20
|
-
const
|
|
21
|
-
|
|
21
|
+
const f = s.get(t, r);
|
|
22
|
+
s.values(f).filter((n) => !(s.isArray(n) && n.length === 0 || n === "")).length === 0 && l !== -1 ? e.filters.splice(l, 1) : l !== -1 ? e.filters[l] = {
|
|
22
23
|
fieldName: r,
|
|
23
|
-
value:
|
|
24
|
+
value: f
|
|
24
25
|
} : e.filters.push({
|
|
25
26
|
fieldName: r,
|
|
26
|
-
value:
|
|
27
|
+
value: f
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
g(
|
|
30
|
+
g(a);
|
|
30
31
|
} else console.warn("Template could not be found!");
|
|
31
32
|
};
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
return /* @__PURE__ */
|
|
33
|
+
if (a.length === 1) {
|
|
34
|
+
const o = a[0], t = m.get(o.templateKey);
|
|
35
|
+
return /* @__PURE__ */ d(c, { display: "flex", flexDirection: "column", children: t == null ? void 0 : t.properties.filter((e) => {
|
|
35
36
|
var r;
|
|
36
|
-
return
|
|
37
|
+
return i ? !((r = i[e.propertyId]) != null && r.hidden) : !0;
|
|
37
38
|
}).map((e, r) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
var n;
|
|
40
|
+
let l = {};
|
|
41
|
+
const f = o.filters.find(
|
|
42
|
+
(u) => u.fieldName === e.propertyId
|
|
41
43
|
);
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
+
return f && (l = f.value), /* @__PURE__ */ d(
|
|
45
|
+
c,
|
|
44
46
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
...i && ((n = i[e.propertyId]) == null ? void 0 : n.order) && {
|
|
48
|
+
order: i[e.propertyId].order
|
|
49
|
+
},
|
|
50
|
+
children: /* @__PURE__ */ d(
|
|
51
|
+
p,
|
|
52
|
+
{
|
|
53
|
+
property: e,
|
|
54
|
+
value: l,
|
|
55
|
+
size: "small",
|
|
56
|
+
variant: h,
|
|
57
|
+
onChange: y(t == null ? void 0 : t.templateKey)
|
|
58
|
+
},
|
|
59
|
+
r
|
|
60
|
+
)
|
|
61
|
+
}
|
|
52
62
|
);
|
|
53
63
|
}) });
|
|
54
64
|
}
|
|
55
|
-
return
|
|
56
|
-
const e =
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
65
|
+
return a.map((o, t) => {
|
|
66
|
+
const e = m.get(o.templateKey);
|
|
67
|
+
return /* @__PURE__ */ d(
|
|
68
|
+
I,
|
|
59
69
|
{
|
|
60
70
|
header: e == null ? void 0 : e.name,
|
|
61
|
-
content: /* @__PURE__ */
|
|
62
|
-
var
|
|
63
|
-
return
|
|
64
|
-
}).map((r,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
content: /* @__PURE__ */ d(c, { display: "flex", flexDirection: "column", children: e == null ? void 0 : e.properties.filter((r) => {
|
|
72
|
+
var l;
|
|
73
|
+
return i ? !((l = i[r.propertyId]) != null && l.hidden) : !0;
|
|
74
|
+
}).map((r, l) => {
|
|
75
|
+
var u;
|
|
76
|
+
let f = {};
|
|
77
|
+
const n = o.filters.find(
|
|
78
|
+
(x) => x.fieldName === r.propertyId
|
|
68
79
|
);
|
|
69
|
-
return
|
|
70
|
-
|
|
80
|
+
return n && (f = n.value), /* @__PURE__ */ d(
|
|
81
|
+
c,
|
|
71
82
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
...i && ((u = i[r.propertyId]) == null ? void 0 : u.order) && {
|
|
84
|
+
order: i[r.propertyId].order
|
|
85
|
+
},
|
|
86
|
+
children: /* @__PURE__ */ d(
|
|
87
|
+
p,
|
|
88
|
+
{
|
|
89
|
+
property: r,
|
|
90
|
+
value: f,
|
|
91
|
+
size: "small",
|
|
92
|
+
variant: h,
|
|
93
|
+
onChange: y(e == null ? void 0 : e.templateKey)
|
|
94
|
+
},
|
|
95
|
+
l
|
|
96
|
+
)
|
|
97
|
+
}
|
|
79
98
|
);
|
|
80
99
|
}) })
|
|
81
100
|
},
|
|
82
|
-
|
|
101
|
+
t
|
|
83
102
|
);
|
|
84
103
|
});
|
|
85
104
|
};
|
|
86
105
|
export {
|
|
87
|
-
|
|
106
|
+
b as TemplatePropertyFilters
|
|
88
107
|
};
|
package/dist/main.d.ts
CHANGED