@hybridcore/ui 1.6.24 → 1.6.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.
- package/dist/{AccordionSummary-c6-Buzbq.js → AccordionSummary-B6-hHjCC.js} +3 -3
- package/dist/{Add-CB4mPrke.js → Add-eXYPgCCB.js} +1 -1
- package/dist/{Alert-BsT46Tgd.js → Alert-OoSOUjZM.js} +2 -2
- package/dist/{Button-BMUZn0cT.js → Button-gZFgy23t.js} +1 -1
- package/dist/{ButtonBase-DG5J0YgP.js → ButtonBase-Dgg9dzM8.js} +2 -2
- package/dist/{Delete-ofipLwkd.js → Delete-B8COyxKI.js} +1 -1
- package/dist/{IconButton-SJfF1cr9.js → IconButton-CQwROBzr.js} +1 -1
- package/dist/{MenuItem-BjnnhDbD.js → MenuItem-BAKBPyZx.js} +3 -3
- package/dist/{Modal-Djf5pMjD.js → Modal-DVdqH5dj.js} +1 -1
- package/dist/{Select-nL91eUH9.js → Select-B4zhu5G_.js} +2 -2
- package/dist/{SwitchBase-BcJAJYsB.js → SwitchBase-BqUrfIHp.js} +1 -1
- package/dist/{TextField-Db63_GNb.js → TextField-Cx5T7iJn.js} +4 -3
- package/dist/components/button/styled.js +1 -1
- package/dist/components/charts/forecast-cone/index.js +1 -1
- package/dist/components/collapsible-card/index.js +1 -1
- package/dist/components/collapsible-card/styled.js +1 -1
- package/dist/components/color-picker/index.js +2 -2
- package/dist/components/color-picker/styled.js +1 -1
- package/dist/components/confirm/dialog.js +2 -2
- package/dist/components/confirm/index.js +1 -1
- package/dist/components/duration-select/index.js +1 -1
- package/dist/components/duration-select/styled.js +1 -1
- package/dist/components/instance-form/components/composite-list/index.js +1 -1
- package/dist/components/instance-form/components/variable/index.js +3 -2
- package/dist/components/instance-form/components/variables/index.js +1 -1
- package/dist/components/instance-hierarchy-table/styled.js +1 -1
- package/dist/components/property-mapping/index.js +1 -1
- package/dist/components/simple-pivot-table/index.js +46 -50
- package/dist/components/simple-pivot-table/styled.js +43 -28
- package/dist/components/template-form/components/default-value-input/index.js +120 -0
- package/dist/components/template-form/components/default-value-input/logic.js +76 -0
- package/dist/components/template-form/components/property-list/index.js +5 -5
- package/dist/components/template-form/components/property-list/property-list-columns.js +2 -2
- package/dist/components/template-form/components/property-list/property-list-form.js +245 -240
- package/dist/components/template-form/components/property-list/property-list-logic.js +59 -42
- package/dist/components/template-form/components/recognition-property-list/index.js +5 -5
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +2 -2
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +5 -5
- package/dist/components/template-form/index.js +39 -37
- package/dist/components/template-form/logic.js +24 -23
- package/dist/components/template-property-filters/property.js +23 -20
- package/dist/createSvgIcon-Bi-IzY8I.js +83 -0
- package/dist/{dialog-CNxZ7uox.js → dialog-DwmnOp5c.js} +2 -2
- package/dist/{index-BQ4_OA4b.js → index-Dvh8D1yM.js} +26 -25
- package/dist/isMuiElement-CxT3_ACP.js +13 -0
- package/dist/main.d.ts +27 -1
- package/dist/{styled-DObpn_Bi.js → styled-C5WQOj4E.js} +1 -1
- package/dist/{useIsFocusVisible-BHPF-Pml.js → useIsFocusVisible-CVnvB5M2.js} +1 -1
- package/dist/{useSlot-gpKOd92R.js → useSlot-BOHuz6Wu.js} +1 -1
- package/dist/{useTimeout-CM6EsHyp.js → useTimeout-D5vWrF1x.js} +2 -2
- package/dist/utils/ontology.js +49 -43
- package/package.json +1 -1
- package/dist/createSvgIcon-jKAqRXE2.js +0 -93
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { DateTimePicker as I } from "../../../date-time-picker/index.js";
|
|
3
|
+
import { PhoneInput as B } from "../../../phone-input/index.js";
|
|
4
|
+
import { useDefaultValueInputLogic as D } from "./logic.js";
|
|
5
|
+
import { F as E, a as L, B as b, T as c } from "../../../../TextField-Cx5T7iJn.js";
|
|
6
|
+
import { I as P } from "../../../../InputLabel-jPm6Xuco.js";
|
|
7
|
+
import { S as A } from "../../../../Select-B4zhu5G_.js";
|
|
8
|
+
import { M as u } from "../../../../MenuItem-BAKBPyZx.js";
|
|
9
|
+
import { B as S } from "../../../../Button-gZFgy23t.js";
|
|
10
|
+
const o = "Default Value", C = "No default", H = (x) => {
|
|
11
|
+
const { state: d, actions: n } = D(x), {
|
|
12
|
+
editor: a,
|
|
13
|
+
value: t,
|
|
14
|
+
booleanValue: V,
|
|
15
|
+
enumOptions: p,
|
|
16
|
+
inputVariant: s,
|
|
17
|
+
labelPosition: T,
|
|
18
|
+
disabled: f,
|
|
19
|
+
helperText: v
|
|
20
|
+
} = d, r = T === "default", m = {
|
|
21
|
+
label: r ? o : void 0,
|
|
22
|
+
name: "defaultValue",
|
|
23
|
+
variant: s,
|
|
24
|
+
disabled: f,
|
|
25
|
+
fullWidth: !0,
|
|
26
|
+
sx: { mb: 2 },
|
|
27
|
+
helperText: v
|
|
28
|
+
};
|
|
29
|
+
if (a === "boolean" || a === "enum") {
|
|
30
|
+
const i = a === "enum", g = i && p.length === 0, F = (l) => l ? i ? l : l === "true" ? "True" : "False" : C;
|
|
31
|
+
return /* @__PURE__ */ h(
|
|
32
|
+
E,
|
|
33
|
+
{
|
|
34
|
+
fullWidth: !0,
|
|
35
|
+
variant: s,
|
|
36
|
+
sx: { mb: 2 },
|
|
37
|
+
disabled: f || g,
|
|
38
|
+
children: [
|
|
39
|
+
r && /* @__PURE__ */ e(P, { id: "default-value-select-label", children: o }),
|
|
40
|
+
/* @__PURE__ */ h(
|
|
41
|
+
A,
|
|
42
|
+
{
|
|
43
|
+
label: r ? o : void 0,
|
|
44
|
+
name: "defaultValue",
|
|
45
|
+
labelId: "default-value-select-label",
|
|
46
|
+
id: "default-value-select",
|
|
47
|
+
value: i ? t : V,
|
|
48
|
+
displayEmpty: !r,
|
|
49
|
+
renderValue: r ? void 0 : (l) => F(l),
|
|
50
|
+
onChange: n.handleSelectChange,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ e(u, { value: "", children: C }),
|
|
53
|
+
i ? p.map((l) => /* @__PURE__ */ e(u, { value: l, children: l }, l)) : [
|
|
54
|
+
/* @__PURE__ */ e(u, { value: "true", children: "True" }, "true"),
|
|
55
|
+
/* @__PURE__ */ e(u, { value: "false", children: "False" }, "false")
|
|
56
|
+
]
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
g && /* @__PURE__ */ e(L, { children: "Add the enum values above to pick a default." })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return a === "date" ? /* @__PURE__ */ h(b, { sx: { mb: 2 }, children: [
|
|
66
|
+
/* @__PURE__ */ e(
|
|
67
|
+
I,
|
|
68
|
+
{
|
|
69
|
+
label: r ? o : void 0,
|
|
70
|
+
labelPosition: r ? "default" : "top",
|
|
71
|
+
name: "defaultValue",
|
|
72
|
+
value: t || void 0,
|
|
73
|
+
variant: s,
|
|
74
|
+
size: "medium",
|
|
75
|
+
onChange: n.handleValueChange
|
|
76
|
+
},
|
|
77
|
+
t ? "date-set" : "date-empty"
|
|
78
|
+
),
|
|
79
|
+
!!t && /* @__PURE__ */ e(S, { size: "small", onClick: n.handleClear, sx: { mt: 0.5 }, children: "Clear" })
|
|
80
|
+
] }) : a === "integer" || a === "decimal" ? /* @__PURE__ */ e(
|
|
81
|
+
c,
|
|
82
|
+
{
|
|
83
|
+
...m,
|
|
84
|
+
value: t,
|
|
85
|
+
onChange: a === "integer" ? n.handleIntegerChange : n.handleDecimalChange,
|
|
86
|
+
inputProps: {
|
|
87
|
+
inputMode: a === "integer" ? "numeric" : "decimal"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
) : a === "phone" ? /* @__PURE__ */ e(b, { sx: { mb: 2 }, children: /* @__PURE__ */ e(
|
|
91
|
+
B,
|
|
92
|
+
{
|
|
93
|
+
label: r ? o : void 0,
|
|
94
|
+
placeholder: "Enter phone number",
|
|
95
|
+
value: t,
|
|
96
|
+
onChange: n.handleValueChange
|
|
97
|
+
}
|
|
98
|
+
) }) : a === "list" ? /* @__PURE__ */ e(
|
|
99
|
+
c,
|
|
100
|
+
{
|
|
101
|
+
...m,
|
|
102
|
+
value: t,
|
|
103
|
+
onChange: n.handleTextChange,
|
|
104
|
+
helperText: v ?? "Add list values with the comma (,) separated string"
|
|
105
|
+
}
|
|
106
|
+
) : /* @__PURE__ */ e(
|
|
107
|
+
c,
|
|
108
|
+
{
|
|
109
|
+
...m,
|
|
110
|
+
value: t,
|
|
111
|
+
onChange: n.handleTextChange,
|
|
112
|
+
multiline: a === "multiline",
|
|
113
|
+
minRows: a === "multiline" ? 2 : void 0,
|
|
114
|
+
placeholder: d.coordinateFormat ? `e.g. ${d.coordinateFormat}` : void 0
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
export {
|
|
119
|
+
H as DefaultValueInput
|
|
120
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import V from "react";
|
|
2
|
+
import { toBooleanText as v } from "../../../../utils/ontology.js";
|
|
3
|
+
const f = {
|
|
4
|
+
boolean: "boolean",
|
|
5
|
+
enum: "enum",
|
|
6
|
+
date: "date",
|
|
7
|
+
integer: "integer",
|
|
8
|
+
long: "integer",
|
|
9
|
+
byte: "integer",
|
|
10
|
+
double: "decimal",
|
|
11
|
+
decimal: "decimal",
|
|
12
|
+
list: "list",
|
|
13
|
+
"phone-number": "phone",
|
|
14
|
+
text: "multiline"
|
|
15
|
+
}, D = (e) => {
|
|
16
|
+
const n = e.trimStart().startsWith("-"), t = e.replace(/[^\d]/g, "");
|
|
17
|
+
return n ? `-${t}` : t;
|
|
18
|
+
}, E = (e) => {
|
|
19
|
+
const n = e.trimStart().startsWith("-"), [t, ...a] = e.replace(/,/g, ".").replace(/[^\d.]/g, "").split("."), r = a.length > 0 ? `${t}.${a.join("")}` : t;
|
|
20
|
+
return n ? `-${r}` : r;
|
|
21
|
+
}, _ = (e, n) => {
|
|
22
|
+
var r;
|
|
23
|
+
const a = ((e == null ? void 0 : e.enumValues) ?? ((r = e == null ? void 0 : e.innerType) == null ? void 0 : r.enumValues) ?? []).map((i) => i.trim()).filter((i) => i.length > 0);
|
|
24
|
+
return n && !a.includes(n) ? [...a, n] : a;
|
|
25
|
+
}, S = (e) => {
|
|
26
|
+
var u;
|
|
27
|
+
const {
|
|
28
|
+
property: n,
|
|
29
|
+
value: t,
|
|
30
|
+
inputVariant: a = "outlined",
|
|
31
|
+
labelPosition: r = "default",
|
|
32
|
+
disabled: i = !1,
|
|
33
|
+
helperText: g,
|
|
34
|
+
onChange: l
|
|
35
|
+
} = e, s = f[n.type] ?? "text", d = _(n.dataTypeInfo, t), c = s === "boolean" ? v(t) : "";
|
|
36
|
+
V.useEffect(() => {
|
|
37
|
+
s !== "boolean" || t === c || l(c);
|
|
38
|
+
}, [s, t, c, l]);
|
|
39
|
+
const m = (o) => {
|
|
40
|
+
l(o.target.value);
|
|
41
|
+
}, h = (o) => {
|
|
42
|
+
l(D(o.target.value));
|
|
43
|
+
}, p = (o) => {
|
|
44
|
+
l(E(o.target.value));
|
|
45
|
+
}, b = (o) => {
|
|
46
|
+
l(o.target.value);
|
|
47
|
+
}, C = (o) => {
|
|
48
|
+
l(o);
|
|
49
|
+
}, x = () => {
|
|
50
|
+
l("");
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
state: {
|
|
54
|
+
editor: s,
|
|
55
|
+
value: t,
|
|
56
|
+
booleanValue: c,
|
|
57
|
+
enumOptions: d,
|
|
58
|
+
inputVariant: a,
|
|
59
|
+
labelPosition: r,
|
|
60
|
+
disabled: i,
|
|
61
|
+
helperText: g,
|
|
62
|
+
coordinateFormat: (u = n.dataTypeInfo) == null ? void 0 : u.coordinateFormat
|
|
63
|
+
},
|
|
64
|
+
actions: {
|
|
65
|
+
handleTextChange: m,
|
|
66
|
+
handleIntegerChange: h,
|
|
67
|
+
handleDecimalChange: p,
|
|
68
|
+
handleSelectChange: b,
|
|
69
|
+
handleValueChange: C,
|
|
70
|
+
handleClear: x
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
S as useDefaultValueInputLogic
|
|
76
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { DataGrid as d } from "@mui/x-data-grid";
|
|
3
|
-
import { A as n, d as m } from "../../../../Add-
|
|
3
|
+
import { A as n, d as m } from "../../../../Add-eXYPgCCB.js";
|
|
4
4
|
import s from "./property-list-columns.js";
|
|
5
5
|
import p from "./property-list-form.js";
|
|
6
6
|
import c from "./property-list-logic.js";
|
|
7
|
-
import { B as u } from "../../../../TextField-
|
|
7
|
+
import { B as u } from "../../../../TextField-Cx5T7iJn.js";
|
|
8
8
|
import { T as y } from "../../../../Typography-B_LKrxyI.js";
|
|
9
|
-
import { A as h } from "../../../../Alert-
|
|
10
|
-
import { B as f } from "../../../../Button-
|
|
11
|
-
import { a as g, b, c as I } from "../../../../dialog-
|
|
9
|
+
import { A as h } from "../../../../Alert-OoSOUjZM.js";
|
|
10
|
+
import { B as f } from "../../../../Button-gZFgy23t.js";
|
|
11
|
+
import { a as g, b, c as I } from "../../../../dialog-DwmnOp5c.js";
|
|
12
12
|
const v = (e) => {
|
|
13
13
|
var l;
|
|
14
14
|
const { state: r, action: o } = c(e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as o, Fragment as c } from "react/jsx-runtime";
|
|
2
|
-
import { d as w, a as b } from "../../../../Delete-
|
|
2
|
+
import { d as w, a as b } from "../../../../Delete-B8COyxKI.js";
|
|
3
3
|
import { T as d } from "../../../../Typography-B_LKrxyI.js";
|
|
4
|
-
import { I as s } from "../../../../IconButton-
|
|
4
|
+
import { I as s } from "../../../../IconButton-CQwROBzr.js";
|
|
5
5
|
const I = (n) => [
|
|
6
6
|
{ field: "name", headerName: "Name", flex: 1 },
|
|
7
7
|
{ field: "propertyId", headerName: "Property ID", flex: 1 },
|