@hybridcore/ui 1.6.25 → 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/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 +25 -0
- 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
|
@@ -1,66 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { confirm as
|
|
4
|
-
import { PropertyFormTypeDefaults as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import h from "react";
|
|
2
|
+
import F from "../../../../hooks/useToggle.js";
|
|
3
|
+
import { confirm as g } from "../../../confirm/index.js";
|
|
4
|
+
import { PropertyFormTypeDefaults as f } from "./types.js";
|
|
5
|
+
const w = (e, o) => {
|
|
6
|
+
var r, n;
|
|
7
|
+
return !!((r = e.inheritedFrom) != null && r.templateId) && ((n = e.inheritedFrom) == null ? void 0 : n.templateId) !== o;
|
|
8
|
+
}, v = (e) => ({
|
|
9
|
+
propertyId: e.propertyId,
|
|
10
|
+
defaultValue: e.defaultValue ?? null,
|
|
11
|
+
required: e.required,
|
|
12
|
+
description: e.description ?? null
|
|
13
|
+
}), A = (e, o) => {
|
|
14
|
+
const r = v(o), n = e.findIndex((c) => c.propertyId === o.propertyId);
|
|
15
|
+
if (n === -1) return [...e, r];
|
|
16
|
+
const l = [...e];
|
|
17
|
+
return l[n] = r, l;
|
|
18
|
+
};
|
|
19
|
+
function V({
|
|
20
|
+
list: e,
|
|
21
|
+
onChange: o,
|
|
22
|
+
templateId: r,
|
|
23
|
+
overrides: n,
|
|
24
|
+
onOverridesChange: l
|
|
8
25
|
}) {
|
|
9
|
-
const { state:
|
|
10
|
-
|
|
11
|
-
),
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
const
|
|
15
|
-
(
|
|
26
|
+
const { state: c, action: p } = F(!1), [i, u] = h.useState(
|
|
27
|
+
f
|
|
28
|
+
), y = async () => {
|
|
29
|
+
i.type !== "add" && u(f), p.open();
|
|
30
|
+
}, a = (t) => {
|
|
31
|
+
const d = e.findIndex(
|
|
32
|
+
(s) => s.id === t.id && s.name === t.name
|
|
16
33
|
);
|
|
17
|
-
|
|
34
|
+
u({
|
|
18
35
|
title: "Edit Property",
|
|
19
|
-
defaultValues:
|
|
36
|
+
defaultValues: t,
|
|
20
37
|
type: "edit",
|
|
21
|
-
index:
|
|
22
|
-
}),
|
|
23
|
-
},
|
|
24
|
-
if (await
|
|
38
|
+
index: d
|
|
39
|
+
}), p.open();
|
|
40
|
+
}, x = async (t) => {
|
|
41
|
+
if (await g(
|
|
25
42
|
"Are you sure?",
|
|
26
|
-
`"${
|
|
43
|
+
`"${t.name}" will be removed permanently!`
|
|
27
44
|
)) {
|
|
28
|
-
const
|
|
29
|
-
(
|
|
45
|
+
const d = e.findIndex(
|
|
46
|
+
(m) => m.id === t.id && m.name === t.name
|
|
30
47
|
);
|
|
31
|
-
let
|
|
32
|
-
|
|
48
|
+
let s = [...e];
|
|
49
|
+
s.splice(d, 1), o(s);
|
|
33
50
|
}
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
let
|
|
38
|
-
|
|
51
|
+
}, I = (t) => {
|
|
52
|
+
o([...e, t]), p.close();
|
|
53
|
+
}, P = (t) => {
|
|
54
|
+
let d = [...e];
|
|
55
|
+
i.index !== void 0 && (d[i.index] = t), o(d), w(t, r) && l && l(A(n ?? [], t)), p.close();
|
|
39
56
|
};
|
|
40
57
|
return {
|
|
41
58
|
state: {
|
|
42
|
-
propertyForm:
|
|
43
|
-
dialog:
|
|
59
|
+
propertyForm: i,
|
|
60
|
+
dialog: c
|
|
44
61
|
},
|
|
45
62
|
action: {
|
|
46
|
-
handleOnAddClick:
|
|
47
|
-
handleOnEditClick:
|
|
48
|
-
handleOnDeleteClick:
|
|
49
|
-
handleSubmit: (
|
|
50
|
-
if (
|
|
51
|
-
|
|
63
|
+
handleOnAddClick: y,
|
|
64
|
+
handleOnEditClick: a,
|
|
65
|
+
handleOnDeleteClick: x,
|
|
66
|
+
handleSubmit: (t) => {
|
|
67
|
+
if (i.type === "add") {
|
|
68
|
+
I(t);
|
|
52
69
|
return;
|
|
53
70
|
}
|
|
54
|
-
if (
|
|
55
|
-
|
|
71
|
+
if (i.type === "edit") {
|
|
72
|
+
P(t);
|
|
56
73
|
return;
|
|
57
74
|
}
|
|
58
75
|
console.warn("Unrecognized form type value!");
|
|
59
76
|
},
|
|
60
|
-
dialog:
|
|
77
|
+
dialog: p
|
|
61
78
|
}
|
|
62
79
|
};
|
|
63
80
|
}
|
|
64
81
|
export {
|
|
65
|
-
|
|
82
|
+
V as default
|
|
66
83
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { DataGrid as a } from "@mui/x-data-grid";
|
|
3
|
-
import { A as n, d } from "../../../../Add-
|
|
3
|
+
import { A as n, d } from "../../../../Add-eXYPgCCB.js";
|
|
4
4
|
import s from "./recognition-property-list-columns.js";
|
|
5
5
|
import m from "./recognition-property-list-form.js";
|
|
6
6
|
import c from "./recognition-property-list-logic.js";
|
|
7
|
-
import { B as p } from "../../../../TextField-
|
|
7
|
+
import { B as p } from "../../../../TextField-Cx5T7iJn.js";
|
|
8
8
|
import { T as g } from "../../../../Typography-B_LKrxyI.js";
|
|
9
|
-
import { A as h } from "../../../../Alert-
|
|
10
|
-
import { B as u } from "../../../../Button-
|
|
11
|
-
import { a as f, b as y, c as b } from "../../../../dialog-
|
|
9
|
+
import { A as h } from "../../../../Alert-OoSOUjZM.js";
|
|
10
|
+
import { B as u } from "../../../../Button-gZFgy23t.js";
|
|
11
|
+
import { a as f, b as y, c as b } from "../../../../dialog-DwmnOp5c.js";
|
|
12
12
|
const L = (i) => {
|
|
13
13
|
const { state: l, action: t } = c(i);
|
|
14
14
|
return /* @__PURE__ */ r(p, { children: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, Fragment as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { d as o, a as l } from "../../../../Delete-
|
|
3
|
-
import { I as d } from "../../../../IconButton-
|
|
2
|
+
import { d as o, a as l } from "../../../../Delete-B8COyxKI.js";
|
|
3
|
+
import { I as d } from "../../../../IconButton-CQwROBzr.js";
|
|
4
4
|
const h = (r) => [
|
|
5
5
|
{ field: "ownerType", headerName: "Owner Type", width: 120 },
|
|
6
6
|
{ field: "owner", headerName: "Owner", width: 120 },
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import V, { jsxs as i, Fragment as S, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import o from "react";
|
|
3
3
|
import { i as C } from "../../../../styled-Ckq8ALHh.js";
|
|
4
|
-
import { r as g } from "../../../../createSvgIcon-
|
|
4
|
+
import { r as g } from "../../../../createSvgIcon-Bi-IzY8I.js";
|
|
5
5
|
import { RECOGNITION_PROPERTY_OWNER_TYPE as h, RECOGNITION_PROPERTY_TYPE as T, RECOGNITION_PROPERTY_TERM_MATCH as v } from "../../../../constants/index.js";
|
|
6
|
-
import { F as c, T as b, B as M } from "../../../../TextField-
|
|
6
|
+
import { F as c, T as b, B as M } from "../../../../TextField-Cx5T7iJn.js";
|
|
7
7
|
import { I as u } from "../../../../InputLabel-jPm6Xuco.js";
|
|
8
|
-
import { S as d } from "../../../../Select-
|
|
9
|
-
import { M as m } from "../../../../MenuItem-
|
|
10
|
-
import { B as y } from "../../../../Button-
|
|
8
|
+
import { S as d } from "../../../../Select-B4zhu5G_.js";
|
|
9
|
+
import { M as m } from "../../../../MenuItem-BAKBPyZx.js";
|
|
10
|
+
import { B as y } from "../../../../Button-gZFgy23t.js";
|
|
11
11
|
var p = {}, q = C;
|
|
12
12
|
Object.defineProperty(p, "__esModule", {
|
|
13
13
|
value: !0
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs as g, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import S from "lodash";
|
|
3
3
|
import p from "react";
|
|
4
|
-
import { Controller as
|
|
5
|
-
import { FormControlLabel as c, Checkbox as m, FormLabel as
|
|
6
|
-
import { CatalogueInstanceSelector as
|
|
7
|
-
import { PropertyList as
|
|
8
|
-
import { RecognitionPropertyList as
|
|
9
|
-
import { SelectIcon as
|
|
10
|
-
import { TreeSelect as
|
|
4
|
+
import { Controller as r } from "react-hook-form";
|
|
5
|
+
import { FormControlLabel as c, Checkbox as m, FormLabel as C } from "@mui/material";
|
|
6
|
+
import { CatalogueInstanceSelector as I } from "./components/catalogue-instance-selector/index.js";
|
|
7
|
+
import { PropertyList as V } from "./components/property-list/index.js";
|
|
8
|
+
import { RecognitionPropertyList as k } from "./components/recognition-property-list/index.js";
|
|
9
|
+
import { SelectIcon as x } from "./components/select-icon/index.js";
|
|
10
|
+
import { TreeSelect as M } from "../tree-select/index.js";
|
|
11
11
|
import { LabeledField as d } from "./helpers.js";
|
|
12
|
-
import { useTemplateFormLogic as
|
|
13
|
-
import { TemplateFormRoot as
|
|
12
|
+
import { useTemplateFormLogic as L } from "./logic.js";
|
|
13
|
+
import { TemplateFormRoot as O, TemplateFormField as s, TemplateFormFieldGroup as v, TemplateFormCheckboxesRow as R, TemplateFormActionsRow as j, TemplateFormCancelButton as w, TemplateFormActionsRight as A, TemplateFormExtraSaveButton as D, TemplateFormSaveButton as K } from "./styled.js";
|
|
14
14
|
function B(t, P) {
|
|
15
|
-
const { refs: F, state: n, form:
|
|
15
|
+
const { refs: F, state: n, form: y, actions: b } = L(t), { control: l, register: u, getValues: h, setValue: T } = y;
|
|
16
16
|
return p.useImperativeHandle(P, () => ({
|
|
17
17
|
getValues: h,
|
|
18
18
|
resetForm: b.resetForm
|
|
19
19
|
})), /* @__PURE__ */ g(
|
|
20
|
-
|
|
20
|
+
O,
|
|
21
21
|
{
|
|
22
22
|
ref: F.rootRef,
|
|
23
23
|
sx: n.sx,
|
|
@@ -65,13 +65,13 @@ function B(t, P) {
|
|
|
65
65
|
}
|
|
66
66
|
) }),
|
|
67
67
|
/* @__PURE__ */ e(d, { label: "Parent", labelPosition: n.labelPosition, children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(
|
|
68
|
-
|
|
68
|
+
r,
|
|
69
69
|
{
|
|
70
70
|
name: "parent",
|
|
71
71
|
control: l,
|
|
72
72
|
render: ({ field: { value: a, onChange: i } }) => {
|
|
73
73
|
if (t.disableParent) {
|
|
74
|
-
const
|
|
74
|
+
const o = a ? t.templates.get(a) : void 0;
|
|
75
75
|
return /* @__PURE__ */ e(
|
|
76
76
|
s,
|
|
77
77
|
{
|
|
@@ -79,19 +79,19 @@ function B(t, P) {
|
|
|
79
79
|
variant: n.inputVariant,
|
|
80
80
|
fullWidth: !0,
|
|
81
81
|
disabled: !0,
|
|
82
|
-
value: (
|
|
82
|
+
value: (o == null ? void 0 : o.name) || "-"
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
return /* @__PURE__ */ e(
|
|
87
|
-
|
|
87
|
+
M,
|
|
88
88
|
{
|
|
89
89
|
label: n.labelPosition === "default" ? "Parent" : void 0,
|
|
90
90
|
idKey: "templateKey",
|
|
91
91
|
data: n.parents,
|
|
92
92
|
selected: a ? [a] : "",
|
|
93
|
-
onChange: (
|
|
94
|
-
i({ target: { value: f ?
|
|
93
|
+
onChange: (o, f) => {
|
|
94
|
+
i({ target: { value: f ? o : "" } }), b.refreshParents();
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
);
|
|
@@ -99,12 +99,12 @@ function B(t, P) {
|
|
|
99
99
|
}
|
|
100
100
|
) }) }),
|
|
101
101
|
"agentReferenceIds" in t.values && /* @__PURE__ */ e(
|
|
102
|
-
|
|
102
|
+
r,
|
|
103
103
|
{
|
|
104
104
|
name: "agentReferenceIds",
|
|
105
105
|
control: l,
|
|
106
106
|
render: ({ field: { onChange: a } }) => /* @__PURE__ */ e(
|
|
107
|
-
|
|
107
|
+
I,
|
|
108
108
|
{
|
|
109
109
|
templates: t.agentTemplates ?? /* @__PURE__ */ new Map(),
|
|
110
110
|
data: t.agentsData,
|
|
@@ -133,7 +133,7 @@ function B(t, P) {
|
|
|
133
133
|
c,
|
|
134
134
|
{
|
|
135
135
|
control: /* @__PURE__ */ e(
|
|
136
|
-
|
|
136
|
+
r,
|
|
137
137
|
{
|
|
138
138
|
name: "creatable",
|
|
139
139
|
control: l,
|
|
@@ -147,7 +147,7 @@ function B(t, P) {
|
|
|
147
147
|
c,
|
|
148
148
|
{
|
|
149
149
|
control: /* @__PURE__ */ e(
|
|
150
|
-
|
|
150
|
+
r,
|
|
151
151
|
{
|
|
152
152
|
name: "editable",
|
|
153
153
|
control: l,
|
|
@@ -161,7 +161,7 @@ function B(t, P) {
|
|
|
161
161
|
c,
|
|
162
162
|
{
|
|
163
163
|
control: /* @__PURE__ */ e(
|
|
164
|
-
|
|
164
|
+
r,
|
|
165
165
|
{
|
|
166
166
|
name: "stationary",
|
|
167
167
|
control: l,
|
|
@@ -175,7 +175,7 @@ function B(t, P) {
|
|
|
175
175
|
c,
|
|
176
176
|
{
|
|
177
177
|
control: /* @__PURE__ */ e(
|
|
178
|
-
|
|
178
|
+
r,
|
|
179
179
|
{
|
|
180
180
|
name: "livingObject",
|
|
181
181
|
control: l,
|
|
@@ -189,7 +189,7 @@ function B(t, P) {
|
|
|
189
189
|
c,
|
|
190
190
|
{
|
|
191
191
|
control: /* @__PURE__ */ e(
|
|
192
|
-
|
|
192
|
+
r,
|
|
193
193
|
{
|
|
194
194
|
name: "storeFile",
|
|
195
195
|
control: l,
|
|
@@ -201,22 +201,22 @@ function B(t, P) {
|
|
|
201
201
|
)
|
|
202
202
|
] }),
|
|
203
203
|
/* @__PURE__ */ e(d, { label: "Icon", labelPosition: n.labelPosition, children: /* @__PURE__ */ g(v, { children: [
|
|
204
|
-
n.labelPosition === "default" && /* @__PURE__ */ e(
|
|
204
|
+
n.labelPosition === "default" && /* @__PURE__ */ e(C, { children: "Icon" }),
|
|
205
205
|
/* @__PURE__ */ e(
|
|
206
|
-
|
|
206
|
+
r,
|
|
207
207
|
{
|
|
208
208
|
name: "icon",
|
|
209
209
|
control: l,
|
|
210
210
|
render: ({ field: { value: a, onChange: i } }) => /* @__PURE__ */ e(
|
|
211
|
-
|
|
211
|
+
x,
|
|
212
212
|
{
|
|
213
213
|
list: t.iconList ?? [],
|
|
214
214
|
value: a ?? "",
|
|
215
215
|
newIcon: t.newIcon ?? null,
|
|
216
216
|
loading: t.iconUploading,
|
|
217
|
-
onFileUpload: (
|
|
217
|
+
onFileUpload: (o) => {
|
|
218
218
|
var f;
|
|
219
|
-
return (f = t.onIconUpload) == null ? void 0 : f.call(t,
|
|
219
|
+
return (f = t.onIconUpload) == null ? void 0 : f.call(t, o);
|
|
220
220
|
},
|
|
221
221
|
onChange: i
|
|
222
222
|
}
|
|
@@ -225,30 +225,32 @@ function B(t, P) {
|
|
|
225
225
|
)
|
|
226
226
|
] }) }),
|
|
227
227
|
/* @__PURE__ */ e(
|
|
228
|
-
|
|
228
|
+
r,
|
|
229
229
|
{
|
|
230
230
|
name: "properties",
|
|
231
231
|
control: l,
|
|
232
232
|
render: ({ field: { value: a, onChange: i } }) => /* @__PURE__ */ e(
|
|
233
|
-
|
|
233
|
+
V,
|
|
234
234
|
{
|
|
235
235
|
list: a || [],
|
|
236
236
|
inputVariant: n.inputVariant,
|
|
237
237
|
labelPosition: n.labelPosition,
|
|
238
238
|
templateId: S.get(t.values, "id"),
|
|
239
239
|
disablePropertyId: t.disablePropertyId,
|
|
240
|
-
onChange: i
|
|
240
|
+
onChange: i,
|
|
241
|
+
overrides: h("localPropertyOverrides") ?? [],
|
|
242
|
+
onOverridesChange: (o) => T("localPropertyOverrides", o, { shouldDirty: !0 })
|
|
241
243
|
}
|
|
242
244
|
)
|
|
243
245
|
}
|
|
244
246
|
),
|
|
245
247
|
"recognitionPropertyList" in t.values && /* @__PURE__ */ e(
|
|
246
|
-
|
|
248
|
+
r,
|
|
247
249
|
{
|
|
248
250
|
name: "recognitionPropertyList",
|
|
249
251
|
control: l,
|
|
250
252
|
render: ({ field: { value: a, onChange: i } }) => /* @__PURE__ */ e(
|
|
251
|
-
|
|
253
|
+
k,
|
|
252
254
|
{
|
|
253
255
|
list: a || [],
|
|
254
256
|
getFormValues: h,
|
|
@@ -269,7 +271,7 @@ function B(t, P) {
|
|
|
269
271
|
}
|
|
270
272
|
),
|
|
271
273
|
/* @__PURE__ */ e(A, { children: t.saveButtons ? t.saveButtons.map((a, i) => /* @__PURE__ */ e(
|
|
272
|
-
|
|
274
|
+
D,
|
|
273
275
|
{
|
|
274
276
|
type: "submit",
|
|
275
277
|
color: "primary",
|
|
@@ -295,7 +297,7 @@ function B(t, P) {
|
|
|
295
297
|
}
|
|
296
298
|
);
|
|
297
299
|
}
|
|
298
|
-
const
|
|
300
|
+
const $ = p.forwardRef(B);
|
|
299
301
|
export {
|
|
300
|
-
|
|
302
|
+
$ as TemplateForm
|
|
301
303
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { useThemeProps as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useForm as
|
|
4
|
-
import { getNestedChildrenFromMap as
|
|
5
|
-
const
|
|
6
|
-
const s =
|
|
1
|
+
import { useThemeProps as M } from "@mui/material";
|
|
2
|
+
import { useRef as N, useState as R, useEffect as D } from "react";
|
|
3
|
+
import { useForm as E } from "react-hook-form";
|
|
4
|
+
import { getNestedChildrenFromMap as H } from "../../utils/ontology.js";
|
|
5
|
+
const A = (f) => {
|
|
6
|
+
const s = M({ props: f, name: "HCTemplateForm" }), {
|
|
7
7
|
values: i,
|
|
8
8
|
inputVariant: a = "outlined",
|
|
9
9
|
labelPosition: n = "default",
|
|
10
10
|
loading: l = !1,
|
|
11
11
|
templates: m,
|
|
12
|
-
onCancel:
|
|
12
|
+
onCancel: u,
|
|
13
13
|
onSubmit: d
|
|
14
|
-
} = s, h =
|
|
14
|
+
} = s, h = N(null), S = E({ defaultValues: i }), { control: g, formState: F, getValues: c, handleSubmit: b, register: T, reset: x, setValue: C } = S, [P, V] = R([]), w = (e) => {
|
|
15
15
|
const o = new Map(e);
|
|
16
16
|
for (const [r, t] of o)
|
|
17
17
|
o.set(r, {
|
|
18
18
|
...t,
|
|
19
19
|
label: t.name,
|
|
20
20
|
value: t.templateKey,
|
|
21
|
-
checked:
|
|
21
|
+
checked: c("parent") === t.templateKey
|
|
22
22
|
});
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
|
|
23
|
+
return H(o, !1);
|
|
24
|
+
}, p = () => {
|
|
25
|
+
V(w(m));
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
D(() => (p(), () => {
|
|
28
28
|
}), [m]);
|
|
29
29
|
const y = () => {
|
|
30
|
-
|
|
31
|
-
},
|
|
30
|
+
u && u();
|
|
31
|
+
}, k = (e, o) => {
|
|
32
32
|
var r;
|
|
33
33
|
(r = e == null ? void 0 : e.preventDefault) == null || r.call(e), b((t) => {
|
|
34
34
|
d(t, o);
|
|
35
35
|
})();
|
|
36
|
-
},
|
|
36
|
+
}, K = () => {
|
|
37
37
|
x();
|
|
38
38
|
};
|
|
39
39
|
return {
|
|
@@ -44,7 +44,7 @@ const z = (f) => {
|
|
|
44
44
|
labelPosition: n,
|
|
45
45
|
loading: l
|
|
46
46
|
},
|
|
47
|
-
parents:
|
|
47
|
+
parents: P,
|
|
48
48
|
inputVariant: a,
|
|
49
49
|
labelPosition: n,
|
|
50
50
|
loading: l,
|
|
@@ -53,17 +53,18 @@ const z = (f) => {
|
|
|
53
53
|
},
|
|
54
54
|
form: {
|
|
55
55
|
control: g,
|
|
56
|
-
getValues:
|
|
57
|
-
register: T
|
|
56
|
+
getValues: c,
|
|
57
|
+
register: T,
|
|
58
|
+
setValue: C
|
|
58
59
|
},
|
|
59
60
|
actions: {
|
|
60
|
-
refreshParents:
|
|
61
|
+
refreshParents: p,
|
|
61
62
|
handleOnCancel: y,
|
|
62
|
-
handleFormSubmit:
|
|
63
|
-
resetForm:
|
|
63
|
+
handleFormSubmit: k,
|
|
64
|
+
resetForm: K
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
A as useTemplateFormLogic
|
|
69
70
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { KeyboardArrowUp as D, KeyboardArrowDown as F } from "@mui/icons-material";
|
|
3
|
-
import { TextField as y, FormControlLabel as R, Checkbox as E, FormControl as A, FormGroup as
|
|
3
|
+
import { TextField as y, FormControlLabel as R, Checkbox as E, FormControl as A, FormGroup as W } from "@mui/material";
|
|
4
4
|
import { DatePicker as S } from "@mui/x-date-pickers";
|
|
5
5
|
import d from "dayjs";
|
|
6
|
-
import { useState as
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { useState as z } from "react";
|
|
7
|
+
import { parseBooleanValue as B } from "../../utils/ontology.js";
|
|
8
|
+
import { PropertyContainer as m, PropertyLabel as f, INPUT_FONT_SX as O, PropertyRangeRow as V, PropertyRangeSeparator as T, DATE_PICKER_SLOT_PROPS as _, PropertyEnumLabel as N, PropertyEnumItem as j, PropertyEnumCheckbox as K, PropertyShowMoreButton as H, SHOW_MORE_ICON_SX as M } from "./styled.js";
|
|
9
|
+
const v = 10, U = {
|
|
9
10
|
typography: { variant: "body2", fontSize: 13 }
|
|
10
|
-
},
|
|
11
|
+
}, X = {
|
|
11
12
|
typography: { fontSize: 13 }
|
|
12
|
-
},
|
|
13
|
+
}, ne = (w) => {
|
|
13
14
|
var P, b, g, I, C;
|
|
14
15
|
const {
|
|
15
16
|
property: e,
|
|
@@ -52,7 +53,7 @@ const v = 10, H = {
|
|
|
52
53
|
if (["integer", "double", "long", "byte"].includes(e.type))
|
|
53
54
|
return /* @__PURE__ */ i(m, { children: [
|
|
54
55
|
/* @__PURE__ */ t(f, { variant: "caption", children: e.name }),
|
|
55
|
-
/* @__PURE__ */ i(
|
|
56
|
+
/* @__PURE__ */ i(V, { children: [
|
|
56
57
|
/* @__PURE__ */ t(
|
|
57
58
|
y,
|
|
58
59
|
{
|
|
@@ -67,7 +68,7 @@ const v = 10, H = {
|
|
|
67
68
|
InputProps: { placeholder: "Min", sx: O }
|
|
68
69
|
}
|
|
69
70
|
),
|
|
70
|
-
/* @__PURE__ */ t(
|
|
71
|
+
/* @__PURE__ */ t(T, { children: "-" }),
|
|
71
72
|
/* @__PURE__ */ t(
|
|
72
73
|
y,
|
|
73
74
|
{
|
|
@@ -96,7 +97,7 @@ const v = 10, H = {
|
|
|
96
97
|
};
|
|
97
98
|
return /* @__PURE__ */ i(m, { children: [
|
|
98
99
|
/* @__PURE__ */ t(f, { variant: "caption", children: e.name }),
|
|
99
|
-
/* @__PURE__ */ i(
|
|
100
|
+
/* @__PURE__ */ i(V, { children: [
|
|
100
101
|
/* @__PURE__ */ t(
|
|
101
102
|
S,
|
|
102
103
|
{
|
|
@@ -108,7 +109,7 @@ const v = 10, H = {
|
|
|
108
109
|
onChange: x("min")
|
|
109
110
|
}
|
|
110
111
|
),
|
|
111
|
-
/* @__PURE__ */ t(
|
|
112
|
+
/* @__PURE__ */ t(T, { children: "-" }),
|
|
112
113
|
/* @__PURE__ */ t(
|
|
113
114
|
S,
|
|
114
115
|
{
|
|
@@ -134,25 +135,27 @@ const v = 10, H = {
|
|
|
134
135
|
{
|
|
135
136
|
size: s,
|
|
136
137
|
name: e.propertyId,
|
|
137
|
-
checked:
|
|
138
|
+
checked: B(
|
|
139
|
+
r.exact ?? e.defaultValue ?? !1
|
|
140
|
+
),
|
|
138
141
|
onChange: c("exact")
|
|
139
142
|
}
|
|
140
143
|
),
|
|
141
|
-
slotProps:
|
|
144
|
+
slotProps: X
|
|
142
145
|
}
|
|
143
146
|
) });
|
|
144
147
|
if (e.type === "enum" || e.type === "composite-list" && ((b = (P = e.dataTypeInfo) == null ? void 0 : P.innerType) == null ? void 0 : b.type) === "enum") {
|
|
145
|
-
const [o, n] =
|
|
148
|
+
const [o, n] = z(!1);
|
|
146
149
|
let a = [];
|
|
147
150
|
return (g = e.dataTypeInfo) != null && g.enumValues && (a = e.dataTypeInfo.enumValues), (C = (I = e.dataTypeInfo) == null ? void 0 : I.innerType) != null && C.enumValues && (a = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ i(m, { children: [
|
|
148
151
|
/* @__PURE__ */ i(A, { fullWidth: !0, component: "fieldset", variant: u, children: [
|
|
149
|
-
/* @__PURE__ */ t(
|
|
150
|
-
/* @__PURE__ */ t(
|
|
151
|
-
|
|
152
|
+
/* @__PURE__ */ t(N, { children: e.name }),
|
|
153
|
+
/* @__PURE__ */ t(W, { children: a.slice(0, o ? 9999 : v).map((l, p) => /* @__PURE__ */ t(
|
|
154
|
+
j,
|
|
152
155
|
{
|
|
153
156
|
label: l,
|
|
154
157
|
control: /* @__PURE__ */ t(
|
|
155
|
-
|
|
158
|
+
K,
|
|
156
159
|
{
|
|
157
160
|
name: e.propertyId,
|
|
158
161
|
value: l,
|
|
@@ -161,13 +164,13 @@ const v = 10, H = {
|
|
|
161
164
|
onChange: Y
|
|
162
165
|
}
|
|
163
166
|
),
|
|
164
|
-
componentsProps:
|
|
167
|
+
componentsProps: U
|
|
165
168
|
},
|
|
166
169
|
p
|
|
167
170
|
)) })
|
|
168
171
|
] }),
|
|
169
172
|
a.length > v && /* @__PURE__ */ i(
|
|
170
|
-
|
|
173
|
+
H,
|
|
171
174
|
{
|
|
172
175
|
size: "small",
|
|
173
176
|
endIcon: o ? /* @__PURE__ */ t(D, { sx: M }) : /* @__PURE__ */ t(F, { sx: M }),
|
|
@@ -183,5 +186,5 @@ const v = 10, H = {
|
|
|
183
186
|
return null;
|
|
184
187
|
};
|
|
185
188
|
export {
|
|
186
|
-
|
|
189
|
+
ne as Property
|
|
187
190
|
};
|