@hybridcore/ui 1.6.0 → 1.6.2
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/CATALOG.md +179 -0
- package/README.md +1 -2
- package/dist/AccordionSummary-CJppWeqF.js +781 -0
- package/dist/Add-CqcD1PWb.js +403 -0
- package/dist/Box-DqUMmZjL.js +31 -0
- package/dist/{Button-CvE2gnly.js → Button-C5yquWAB.js} +120 -133
- package/dist/ButtonBase-BEF7oTOe.js +887 -0
- package/dist/{Delete-CW0UZv1m.js → Delete-BdyYpINH.js} +9 -8
- package/dist/{DialogContent-B3nbEbuv.js → DialogContent-BvVjD9z3.js} +127 -124
- package/dist/FormGroup-CpBsIyYR.js +89 -0
- package/dist/{IconButton-CHwRQF-g.js → IconButton-BoGwbvrP.js} +41 -43
- package/dist/InputLabel-Dd8RrneV.js +341 -0
- package/dist/{MenuItem-xZx_w7zA.js → MenuItem-DwqJqzuM.js} +51 -53
- package/dist/Modal-MUZygjmQ.js +1158 -0
- package/dist/Paper-BkQLdsCI.js +582 -0
- package/dist/Select-DHUl_uG3.js +3916 -0
- package/dist/SwitchBase-DTndTqI8.js +235 -0
- package/dist/TextField-e2oKaUN1.js +669 -0
- package/dist/TransitionGroupContext-BDAp2T0O.js +96 -0
- package/dist/{Typography-CxbneZy_.js → Typography-DgsSLCFC.js} +53 -53
- package/dist/assertThisInitialized-C1dAyb4j.js +7 -0
- package/dist/assets/index4.css +1 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/access/helpers.js +1 -1
- package/dist/components/access/index.js +8 -15
- package/dist/components/access/logic.js +25 -0
- package/dist/components/button/index.js +10 -0
- package/dist/components/button/logic.js +26 -0
- package/dist/components/button/styled.js +9 -0
- package/dist/components/card/index.js +158 -498
- package/dist/components/card/logic.js +24 -0
- package/dist/components/card/styled.js +226 -51
- package/dist/components/card-alternate/index.js +111 -139
- package/dist/components/card-alternate/logic.js +17 -0
- package/dist/components/card-alternate/styled.js +113 -19
- package/dist/components/charts/_common/chart-error.js +19 -0
- package/dist/components/charts/candlestick/index.js +3 -3
- package/dist/components/charts/candlestick/logic.js +123 -113
- package/dist/components/charts/chart-wrapper/index.js +5 -5
- package/dist/components/charts/column-line-mix/index.js +9 -8
- package/dist/components/charts/column-line-mix/logic.js +68 -71
- package/dist/components/charts/drill-down-treemap/index.js +8 -7
- package/dist/components/charts/drill-down-treemap/logic.js +138 -144
- package/dist/components/charts/drill-down-voronoi-treemap/index.js +9 -8
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +222 -228
- package/dist/components/charts/heatmap/index.js +9 -8
- package/dist/components/charts/heatmap/logic.js +167 -173
- package/dist/components/charts/highlighting-line-data/index.js +3 -3
- package/dist/components/charts/line/index.js +9 -8
- package/dist/components/charts/line/logic.js +74 -79
- package/dist/components/charts/logaritmic-scale/index.js +9 -8
- package/dist/components/charts/logaritmic-scale/logic.js +63 -69
- package/dist/components/charts/multiple-value-axes/index.js +9 -8
- package/dist/components/charts/multiple-value-axes/logic.js +101 -107
- package/dist/components/charts/nested-pie/index.js +9 -8
- package/dist/components/charts/nested-pie/logic.js +62 -68
- package/dist/components/charts/packed-circles/index.js +7 -6
- package/dist/components/charts/packed-circles/logic.js +50 -56
- package/dist/components/charts/pie-chart/index.js +9 -8
- package/dist/components/charts/pie-chart/logic.js +49 -54
- package/dist/components/charts/stacked-area-radar/index.js +8 -7
- package/dist/components/charts/stacked-area-radar/logic.js +113 -118
- package/dist/components/charts/stacked-column-chart/index.js +9 -8
- package/dist/components/charts/stacked-column-chart/logic.js +78 -84
- package/dist/components/charts/xy-chart/index.js +9 -8
- package/dist/components/charts/xy-chart/logic.js +56 -60
- package/dist/components/collapsible-card/index.js +11 -10
- package/dist/components/collapsible-card/styled.js +1 -1
- package/dist/components/color-picker/index.js +7120 -0
- package/dist/components/color-picker/logic.js +18 -0
- package/dist/components/color-picker/styled.js +7 -0
- package/dist/components/confirm/dialog.js +3 -3
- package/dist/components/confirm/index.js +1 -1
- package/dist/components/container/index.js +28 -269
- package/dist/components/container/logic.js +12 -0
- package/dist/components/container/styled.js +29 -0
- package/dist/components/context-menu/index.js +25 -457
- package/dist/components/context-menu/logic.js +14 -0
- package/dist/components/context-menu/styled.js +40 -0
- package/dist/components/data-grid/index.js +22 -0
- package/dist/components/data-grid/logic.js +15 -0
- package/dist/components/data-grid/styled.js +20 -0
- package/dist/components/data-map/components/controls/index.js +4 -6
- package/dist/components/data-map/index.js +11 -11
- package/dist/components/data-security-selectors/dissemination-list/index.js +192 -191
- package/dist/components/data-security-selectors/dissemination-list/styled.js +12 -12
- package/dist/components/data-security-selectors/security-level/index.js +39 -91
- package/dist/components/data-security-selectors/security-level/logic.js +28 -0
- package/dist/components/data-security-selectors/security-level/styled.js +53 -0
- package/dist/components/date-picker-with-custom-range/index.js +1 -1
- package/dist/components/date-range-picker/index.js +2748 -0
- package/dist/components/date-range-picker/styled.js +14 -0
- package/dist/components/date-time-picker/index.js +45 -46
- package/dist/components/divider/index.js +11 -11
- package/dist/components/document-viewer/components/action-buttons/index.js +15 -15
- package/dist/components/document-viewer/components/navigation/index.js +9 -9
- package/dist/components/document-viewer/components/viewer/index.js +31 -35
- package/dist/components/document-viewer/index.js +31 -39
- package/dist/components/document-viewer/logic.js +41 -34
- package/dist/components/document-viewer/styled.js +115 -27
- package/dist/components/duration-select/index.js +27 -0
- package/dist/components/duration-select/logic.js +21 -0
- package/dist/components/duration-select/styled.js +26 -0
- package/dist/components/editable-text/index.js +20 -0
- package/dist/components/editable-text/logic.js +18 -0
- package/dist/components/editable-text/styled.js +22 -0
- package/dist/components/geometry-picker/coordinate/index.js +29 -29
- package/dist/components/geometry-picker/edit/index.js +18 -18
- package/dist/components/geometry-picker/geometry/index.js +67 -67
- package/dist/components/geometry-picker/geometry/map-overlay.js +6 -6
- package/dist/components/geometry-picker/index.js +69 -85
- package/dist/components/geometry-picker/kml/index.js +16 -16
- package/dist/components/geometry-picker/logic.js +50 -57
- package/dist/components/geometry-picker/map/index.js +8 -8
- package/dist/components/geometry-picker/parser/coordinate-input/index.js +4 -4
- package/dist/components/geometry-picker/parser/index.js +46 -50
- package/dist/components/geometry-picker/parser/styled.js +22 -4
- package/dist/components/geometry-picker/styled.js +97 -37
- package/dist/components/geometry-picker/wkt/index.js +13 -13
- package/dist/components/heat-map/components/controls/index.js +4 -6
- package/dist/components/heat-map/components/legend/index.js +15 -17
- package/dist/components/heat-map/index.js +7 -7
- package/dist/components/instance-form/components/TopLabelWrapper.js +8 -48
- package/dist/components/instance-form/components/composite-list/index.js +5 -3
- package/dist/components/instance-form/components/composite-matrix/components/editable-table/index.js +83 -74
- package/dist/components/instance-form/components/composite-matrix/components/editor/index.js +45 -66
- package/dist/components/instance-form/components/composite-matrix/components/form/index.js +60 -75
- package/dist/components/instance-form/components/composite-matrix/components/json-editor/index.js +2425 -2422
- package/dist/components/instance-form/components/composite-matrix/components/table/index.js +33 -52
- package/dist/components/instance-form/components/composite-matrix/index.js +30 -36
- package/dist/components/instance-form/components/policy-list/index.js +47 -81
- package/dist/components/instance-form/components/variable/index.js +6 -11
- package/dist/components/instance-form/components/variables/index.js +48 -55
- package/dist/components/instance-form/helpers.js +9 -0
- package/dist/components/instance-form/index.js +402 -518
- package/dist/components/instance-form/logic.js +115 -0
- package/dist/components/instance-form/styled.js +487 -0
- package/dist/components/instance-hierarchy-table/index.js +32 -37
- package/dist/components/instance-hierarchy-table/logic.js +16 -0
- package/dist/components/instance-hierarchy-table/styled.js +53 -12
- package/dist/components/instance-table/index.js +30 -135
- package/dist/components/instance-table/logic.js +122 -0
- package/dist/components/instance-table/styled.js +53 -11
- package/dist/components/instance-variable-list/index.js +11 -11
- package/dist/components/loading/index.js +15 -9
- package/dist/components/loading/logic.js +15 -0
- package/dist/components/loading/styled.js +26 -19
- package/dist/components/map/index.js +28 -6
- package/dist/components/map/styled.js +1 -1
- package/dist/components/notification/index.js +67 -0
- package/dist/components/notification/logic.js +30 -0
- package/dist/components/notification/store.js +23 -0
- package/dist/components/notification/styled.js +52 -0
- package/dist/components/object-profile-card/components/avatar/index.js +9 -10
- package/dist/components/object-profile-card/index.js +19 -20
- package/dist/components/paginated-list/index.js +2 -3
- package/dist/components/phone-input/index.js +18 -22
- package/dist/components/phone-input/logic.js +14 -0
- package/dist/components/phone-input/styled.js +12 -4
- package/dist/components/placeholder/index.js +10 -0
- package/dist/components/placeholder/logic.js +12 -0
- package/dist/components/placeholder/styled.js +32 -0
- package/dist/components/positional-tooltip/index.js +24 -0
- package/dist/components/positional-tooltip/styled.js +17 -0
- package/dist/components/property-mapping/index.js +204 -423
- package/dist/components/property-mapping/logic.js +156 -0
- package/dist/components/property-mapping/styled.js +199 -0
- package/dist/components/prr-map/components/controls/index.js +4 -6
- package/dist/components/prr-map/components/legend/index.js +26 -28
- package/dist/components/prr-map/index.js +5 -5
- package/dist/components/range-selector/components/composite-list-range/index.js +42 -50
- package/dist/components/range-selector/components/date-range/index.js +87 -4221
- package/dist/components/range-selector/components/geometry-range/index.js +11 -17
- package/dist/components/range-selector/components/number-range/index.js +48 -53
- package/dist/components/range-selector/components/string-range/index.js +15 -17
- package/dist/components/range-selector/index.js +63 -57
- package/dist/components/range-selector/logic.js +12 -0
- package/dist/components/range-selector/styled.js +4294 -0
- package/dist/components/raster-grid-map/components/controls/index.js +4 -6
- package/dist/components/raster-grid-map/components/legend/index.js +4 -6
- package/dist/components/raster-grid-map/index.js +5 -5
- package/dist/components/scroll-drag/index.js +22 -0
- package/dist/components/scroll-drag/logic.js +39 -0
- package/dist/components/scroll-drag/styled.js +17 -0
- package/dist/components/search-input/logic.js +35 -33
- package/dist/components/simple-pivot-table/index.js +12 -12
- package/dist/components/sortable-list/index.js +599 -0
- package/dist/components/sortable-list/logic.js +18 -0
- package/dist/components/sortable-list/styled.js +38 -0
- package/dist/components/static-text/index.js +6 -6
- package/dist/components/stats-box/index.js +12 -0
- package/dist/components/stats-box/styled.js +36 -0
- package/dist/components/template-filters/components/filter/index.js +13 -18
- package/dist/components/template-filters/components/tab-panel/index.js +8 -16
- package/dist/components/template-filters/index.js +21 -29
- package/dist/components/template-filters/logic.js +18 -0
- package/dist/components/template-filters/styled.js +44 -1
- package/dist/components/template-form/components/property-list/index.js +27 -26
- package/dist/components/template-form/components/property-list/property-list-columns.js +3 -3
- package/dist/components/template-form/components/property-list/property-list-form.js +758 -14
- package/dist/components/template-form/components/recognition-property-list/index.js +11 -11
- 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 +24 -23
- package/dist/components/template-form/components/select-icon/index.js +24 -24
- package/dist/components/template-form/helpers.js +17 -0
- package/dist/components/template-form/index.js +270 -309
- package/dist/components/template-form/logic.js +69 -0
- package/dist/components/template-form/styled.js +84 -0
- package/dist/components/template-property-filters/index.js +45 -95
- package/dist/components/template-property-filters/logic.js +27 -0
- package/dist/components/template-property-filters/property.js +105 -165
- package/dist/components/template-property-filters/styled.js +121 -20
- package/dist/components/text-overflow/index.js +6 -0
- package/dist/components/text-overflow/styled.js +13 -0
- package/dist/components/timeline/index.js +12 -12
- package/dist/components/toggle-view-button/index.js +35 -0
- package/dist/components/toggle-view-button/logic.js +22 -0
- package/dist/components/toggle-view-button/styled.js +11 -0
- package/dist/components/tree-select/index.js +52 -67
- package/dist/components/tree-select/logic.js +59 -0
- package/dist/components/tree-select/styled.js +45 -62
- package/dist/components/treeview-filter/index.js +43 -65
- package/dist/components/treeview-filter/item/index.js +43 -42
- package/dist/components/treeview-filter/item-label/index.js +17 -37
- package/dist/components/treeview-filter/logic.js +28 -0
- package/dist/components/treeview-filter/styled.js +86 -0
- package/dist/components/uploader/index.js +532 -567
- package/dist/components/uploader/logic.js +74 -0
- package/dist/components/uploader/styled.js +93 -46
- package/dist/components/visually-hidden-input/index.js +4 -0
- package/dist/components/visually-hidden-input/styled.js +18 -0
- package/dist/createChainedFunction-C0nujS3O.js +9 -0
- package/dist/{createSvgIcon-DrtgaibK.js → createSvgIcon-Ch_cT8az.js} +69 -68
- package/dist/createSvgIcon-DuDuASu1.js +62 -0
- package/dist/{dialog-DcwXug9J.js → dialog-BYRnCztH.js} +18 -18
- package/dist/formControlState-vgaj2ksH.js +10 -0
- package/dist/generateUtilityClasses-C3ivN9Ie.js +2973 -0
- package/dist/{helpers-B4UL9NMD.js → helpers-D4uXfBfO.js} +2 -2
- package/dist/index-BtlzPygz.js +470 -0
- package/dist/index-DH6qsPBn.js +153 -0
- package/dist/{index-syTc6m_V.js → index-e9xTIYWt.js} +87 -87
- package/dist/main.d.ts +1722 -562
- package/dist/main.js +161 -128
- package/dist/ownerWindow-wg6foiOE.js +10 -0
- package/dist/setPrototypeOf-NPgp4cYc.js +8 -0
- package/dist/styled-Db1RdcPA.js +323 -0
- package/dist/unsupportedProp-DuqR2hj9.js +36 -0
- package/dist/useId-BW-oWmul.js +19 -0
- package/dist/useMobilePicker-CY8ndYRL.js +8279 -0
- package/dist/useSlot-B_Q4vnX5.js +42 -0
- package/package.json +15 -7
- package/dist/AccordionSummary-DgAwVTk8.js +0 -742
- package/dist/Add-DJLrrVHm.js +0 -382
- package/dist/Box-p6OtTUEo.js +0 -30
- package/dist/ButtonBase-2bPw77UP.js +0 -961
- package/dist/CardContent-CSHh-ZlM.js +0 -74
- package/dist/Checkbox-CWRMFTBp.js +0 -421
- package/dist/FormControl-BLbrq4C7.js +0 -1636
- package/dist/FormControlLabel-C8SPv14J.js +0 -195
- package/dist/InputAdornment-DLxWUE6H.js +0 -157
- package/dist/List-tqElle9C.js +0 -121
- package/dist/ListItem-CfjsIg4B.js +0 -430
- package/dist/Modal-DhPpOoGB.js +0 -1299
- package/dist/Paper-2B03OBmZ.js +0 -169
- package/dist/Select-BgYwkZgI.js +0 -2613
- package/dist/TextField-1yCesIbH.js +0 -457
- package/dist/assertThisInitialized-BUtkG-md.js +0 -13
- package/dist/capitalize-ciszXJ7R.js +0 -9
- package/dist/components/instance-form/components/composite-list/styled.js +0 -73
- package/dist/components/instance-form/components/composite-matrix/components/editor/styled.js +0 -1
- package/dist/components/instance-form/components/composite-matrix/styled.js +0 -69
- package/dist/components/key-protection/index.js +0 -4
- package/dist/components/key-protection/menu.js +0 -85
- package/dist/components/key-protection/utils.js +0 -10
- package/dist/components/treeview-filter/item/styled.js +0 -39
- package/dist/createSvgIcon-BjpIhJ30.js +0 -71
- package/dist/createTheme-DYxDnE9u.js +0 -612
- package/dist/index-BMS1Otro.js +0 -183
- package/dist/index-CcdvNlgr.js +0 -503
- package/dist/index-kCJ_Zvl8.js +0 -34
- package/dist/isHostComponent-kiaBvYVo.js +0 -6
- package/dist/isMuiElement-CxT3_ACP.js +0 -13
- package/dist/listItemTextClasses-C3lndiXO.js +0 -16
- package/dist/property-list-form-zZQfpR0X.js +0 -386
- package/dist/styled-eZwjUruw.js +0 -12
- package/dist/unsupportedProp-BND8AB6O.js +0 -25
- package/dist/useId-B4-oF9Mq.js +0 -34
- package/dist/useMobilePicker-BLg3Blg8.js +0 -7589
- package/dist/useThemeProps-BzzHcQyd.js +0 -58
- package/dist/utils-BDNynJcd.js +0 -365
- package/dist/utils-Bq0ye5vf.js +0 -115
|
@@ -1,340 +1,301 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { TreeSelect as
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, S = () => {
|
|
38
|
-
const t = I(e.mappedTemplates);
|
|
39
|
-
F(t);
|
|
40
|
-
}, M = () => {
|
|
41
|
-
if (e.onCancel) {
|
|
42
|
-
e.onCancel();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
return f.useImperativeHandle(x, () => ({
|
|
47
|
-
getValues: b,
|
|
48
|
-
resetForm() {
|
|
49
|
-
V();
|
|
50
|
-
}
|
|
51
|
-
})), f.useEffect(() => (S(), () => {
|
|
52
|
-
}), [e.mappedTemplates]), /* @__PURE__ */ u("form", { onSubmit: (t, a) => {
|
|
53
|
-
t == null || t.preventDefault(), T(((o) => (y) => {
|
|
54
|
-
e.onSubmit(y, o);
|
|
55
|
-
})(a))();
|
|
56
|
-
}, children: [
|
|
57
|
-
/* @__PURE__ */ n(
|
|
58
|
-
m,
|
|
59
|
-
{
|
|
60
|
-
label: "Name *",
|
|
61
|
-
variant: e.inputVariant,
|
|
62
|
-
fullWidth: !0,
|
|
63
|
-
sx: { mb: 2 },
|
|
64
|
-
...s("name", { required: !0 }),
|
|
65
|
-
...v.name && {
|
|
66
|
-
helperText: "This field is required!",
|
|
67
|
-
error: !0
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
/* @__PURE__ */ n(
|
|
72
|
-
m,
|
|
73
|
-
{
|
|
74
|
-
label: "Template Key",
|
|
75
|
-
variant: e.inputVariant,
|
|
76
|
-
fullWidth: !0,
|
|
77
|
-
disabled: e.disableTemlateKey,
|
|
78
|
-
sx: { mb: 2 },
|
|
79
|
-
...s("templateKey")
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
/* @__PURE__ */ n(
|
|
83
|
-
m,
|
|
84
|
-
{
|
|
85
|
-
label: "Description",
|
|
86
|
-
variant: e.inputVariant,
|
|
87
|
-
fullWidth: !0,
|
|
88
|
-
sx: { mb: 2 },
|
|
89
|
-
...s("description")
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
/* @__PURE__ */ n(
|
|
93
|
-
m,
|
|
94
|
-
{
|
|
95
|
-
label: "Version",
|
|
96
|
-
variant: e.inputVariant,
|
|
97
|
-
fullWidth: !0,
|
|
98
|
-
sx: { mb: 2 },
|
|
99
|
-
...s("version")
|
|
100
|
-
}
|
|
101
|
-
),
|
|
102
|
-
/* @__PURE__ */ n(h, { sx: { mb: 2 }, children: /* @__PURE__ */ n(
|
|
103
|
-
l,
|
|
104
|
-
{
|
|
105
|
-
name: "parent",
|
|
106
|
-
control: i,
|
|
107
|
-
render: ({ field: { value: t, onChange: a } }) => {
|
|
108
|
-
if (e.disableParent) {
|
|
109
|
-
const r = t ? e.mappedTemplates.get(t) : void 0;
|
|
110
|
-
return /* @__PURE__ */ n(
|
|
111
|
-
m,
|
|
112
|
-
{
|
|
113
|
-
label: "Parent",
|
|
114
|
-
variant: e.inputVariant,
|
|
115
|
-
fullWidth: !0,
|
|
116
|
-
disabled: !0,
|
|
117
|
-
value: (r == null ? void 0 : r.name) || "-"
|
|
118
|
-
}
|
|
119
|
-
);
|
|
1
|
+
import { jsxs as g, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import S from "lodash";
|
|
3
|
+
import p from "react";
|
|
4
|
+
import { Controller as o } from "react-hook-form";
|
|
5
|
+
import { FormControlLabel as c, Checkbox as m, FormLabel as y } from "@mui/material";
|
|
6
|
+
import { CatalogueInstanceSelector as C } from "./components/catalogue-instance-selector/index.js";
|
|
7
|
+
import { PropertyList as I } from "./components/property-list/index.js";
|
|
8
|
+
import { RecognitionPropertyList as V } from "./components/recognition-property-list/index.js";
|
|
9
|
+
import { SelectIcon as k } from "./components/select-icon/index.js";
|
|
10
|
+
import { TreeSelect as x } from "../tree-select/index.js";
|
|
11
|
+
import { LabeledField as d } from "./helpers.js";
|
|
12
|
+
import { useTemplateFormLogic as M } from "./logic.js";
|
|
13
|
+
import { TemplateFormRoot as L, TemplateFormField as s, TemplateFormFieldGroup as v, TemplateFormCheckboxesRow as R, TemplateFormActionsRow as j, TemplateFormCancelButton as w, TemplateFormActionsRight as A, TemplateFormExtraSaveButton as O, TemplateFormSaveButton as K } from "./styled.js";
|
|
14
|
+
function B(t, P) {
|
|
15
|
+
const { refs: F, state: n, form: T, actions: b } = M(t), { control: l, register: u, getValues: h } = T;
|
|
16
|
+
return p.useImperativeHandle(P, () => ({
|
|
17
|
+
getValues: h,
|
|
18
|
+
resetForm: b.resetForm
|
|
19
|
+
})), /* @__PURE__ */ g(
|
|
20
|
+
L,
|
|
21
|
+
{
|
|
22
|
+
ref: F.rootRef,
|
|
23
|
+
sx: n.sx,
|
|
24
|
+
onSubmit: b.handleFormSubmit,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ e(d, { label: "Name", required: !0, labelPosition: n.labelPosition, children: /* @__PURE__ */ e(
|
|
27
|
+
s,
|
|
28
|
+
{
|
|
29
|
+
label: n.labelPosition === "default" ? "Name *" : void 0,
|
|
30
|
+
variant: n.inputVariant,
|
|
31
|
+
fullWidth: !0,
|
|
32
|
+
...u("name", { required: !0 }),
|
|
33
|
+
...n.errors.name && {
|
|
34
|
+
helperText: "This field is required!",
|
|
35
|
+
error: !0
|
|
36
|
+
}
|
|
120
37
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
38
|
+
) }),
|
|
39
|
+
/* @__PURE__ */ e(d, { label: "Template Key", labelPosition: n.labelPosition, children: /* @__PURE__ */ e(
|
|
40
|
+
s,
|
|
41
|
+
{
|
|
42
|
+
label: n.labelPosition === "default" ? "Template Key" : void 0,
|
|
43
|
+
variant: n.inputVariant,
|
|
44
|
+
fullWidth: !0,
|
|
45
|
+
disabled: t.disableTemplateKey,
|
|
46
|
+
...u("templateKey")
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
/* @__PURE__ */ e(d, { label: "Description", labelPosition: n.labelPosition, children: /* @__PURE__ */ e(
|
|
50
|
+
s,
|
|
51
|
+
{
|
|
52
|
+
label: n.labelPosition === "default" ? "Description" : void 0,
|
|
53
|
+
variant: n.inputVariant,
|
|
54
|
+
fullWidth: !0,
|
|
55
|
+
...u("description")
|
|
56
|
+
}
|
|
57
|
+
) }),
|
|
58
|
+
/* @__PURE__ */ e(d, { label: "Version", labelPosition: n.labelPosition, children: /* @__PURE__ */ e(
|
|
59
|
+
s,
|
|
60
|
+
{
|
|
61
|
+
label: n.labelPosition === "default" ? "Version" : void 0,
|
|
62
|
+
variant: n.inputVariant,
|
|
63
|
+
fullWidth: !0,
|
|
64
|
+
...u("version")
|
|
65
|
+
}
|
|
66
|
+
) }),
|
|
67
|
+
/* @__PURE__ */ e(d, { label: "Parent", labelPosition: n.labelPosition, children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(
|
|
68
|
+
o,
|
|
69
|
+
{
|
|
70
|
+
name: "parent",
|
|
71
|
+
control: l,
|
|
72
|
+
render: ({ field: { value: a, onChange: i } }) => {
|
|
73
|
+
if (t.disableParent) {
|
|
74
|
+
const r = a ? t.templates.get(a) : void 0;
|
|
75
|
+
return /* @__PURE__ */ e(
|
|
76
|
+
s,
|
|
77
|
+
{
|
|
78
|
+
label: n.labelPosition === "default" ? "Parent" : void 0,
|
|
79
|
+
variant: n.inputVariant,
|
|
80
|
+
fullWidth: !0,
|
|
81
|
+
disabled: !0,
|
|
82
|
+
value: (r == null ? void 0 : r.name) || "-"
|
|
132
83
|
}
|
|
133
|
-
|
|
84
|
+
);
|
|
134
85
|
}
|
|
86
|
+
return /* @__PURE__ */ e(
|
|
87
|
+
x,
|
|
88
|
+
{
|
|
89
|
+
label: n.labelPosition === "default" ? "Parent" : void 0,
|
|
90
|
+
idKey: "templateKey",
|
|
91
|
+
data: n.parents,
|
|
92
|
+
selected: a ? [a] : "",
|
|
93
|
+
onChange: (r, f) => {
|
|
94
|
+
i({ target: { value: f ? r : "" } }), b.refreshParents();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
);
|
|
135
98
|
}
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
"agentReferenceIds" in e.defaultValues && /* @__PURE__ */ n(
|
|
141
|
-
l,
|
|
142
|
-
{
|
|
143
|
-
name: "agentReferenceIds",
|
|
144
|
-
control: i,
|
|
145
|
-
render: ({ field: { onChange: t } }) => /* @__PURE__ */ n(
|
|
146
|
-
O,
|
|
99
|
+
}
|
|
100
|
+
) }) }),
|
|
101
|
+
"agentReferenceIds" in t.values && /* @__PURE__ */ e(
|
|
102
|
+
o,
|
|
147
103
|
{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
104
|
+
name: "agentReferenceIds",
|
|
105
|
+
control: l,
|
|
106
|
+
render: ({ field: { onChange: a } }) => /* @__PURE__ */ e(
|
|
107
|
+
C,
|
|
108
|
+
{
|
|
109
|
+
templates: t.agentTemplates ?? /* @__PURE__ */ new Map(),
|
|
110
|
+
data: t.agentsData,
|
|
111
|
+
inputVariant: n.inputVariant,
|
|
112
|
+
selectedInstances: t.selectedAgentInstances,
|
|
113
|
+
onSelect: (i) => {
|
|
114
|
+
a({ target: { value: i } }), t.onAgentSelect && t.onAgentSelect(i);
|
|
115
|
+
},
|
|
116
|
+
onSearchSubmit: t.onCatalogueInstanceSearchSubmit,
|
|
117
|
+
openMapping: t.openMapping ?? !1,
|
|
118
|
+
mappingData: t.mappingData ?? [],
|
|
119
|
+
objectTemplate: t.objectTemplate ?? {},
|
|
120
|
+
mapboxAccessToken: t.mapboxAccessToken ?? "",
|
|
121
|
+
onMappingSubmit: t.onMappingSubmit ? t.onMappingSubmit : () => {
|
|
122
|
+
},
|
|
123
|
+
onMappingOpen: t.onMappingOpen ? t.onMappingOpen : () => {
|
|
124
|
+
},
|
|
125
|
+
onMappingClose: t.onMappingClose ? t.onMappingClose : () => {
|
|
156
126
|
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
onSearchSubmit: e.onCatalogueInstanceSearchSubmit,
|
|
160
|
-
openMapping: e.openMapping ?? !1,
|
|
161
|
-
mappingData: e.mappingData ?? [],
|
|
162
|
-
objectTemplate: e.objectTemplate ?? {},
|
|
163
|
-
mapboxAccessToken: e.mapboxAccessToken ?? "",
|
|
164
|
-
onMappingSubmit: e.onMappingSubmit ? e.onMappingSubmit : () => {
|
|
165
|
-
},
|
|
166
|
-
onMappingOpen: e.onMappingOpen ? e.onMappingOpen : () => {
|
|
167
|
-
},
|
|
168
|
-
onMappingClose: e.onMappingClose ? e.onMappingClose : () => {
|
|
169
|
-
}
|
|
127
|
+
}
|
|
128
|
+
)
|
|
170
129
|
}
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
/* @__PURE__ */ n(
|
|
176
|
-
d,
|
|
177
|
-
{
|
|
178
|
-
control: /* @__PURE__ */ n(
|
|
179
|
-
l,
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ g(R, { row: !0, children: [
|
|
132
|
+
/* @__PURE__ */ e(
|
|
133
|
+
c,
|
|
180
134
|
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
135
|
+
control: /* @__PURE__ */ e(
|
|
136
|
+
o,
|
|
137
|
+
{
|
|
138
|
+
name: "creatable",
|
|
139
|
+
control: l,
|
|
140
|
+
render: ({ field: { value: a, ...i } }) => /* @__PURE__ */ e(m, { checked: a, ...i })
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
label: "Creatable"
|
|
184
144
|
}
|
|
185
145
|
),
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
),
|
|
189
|
-
/* @__PURE__ */ n(
|
|
190
|
-
d,
|
|
191
|
-
{
|
|
192
|
-
control: /* @__PURE__ */ n(
|
|
193
|
-
l,
|
|
146
|
+
/* @__PURE__ */ e(
|
|
147
|
+
c,
|
|
194
148
|
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
149
|
+
control: /* @__PURE__ */ e(
|
|
150
|
+
o,
|
|
151
|
+
{
|
|
152
|
+
name: "editable",
|
|
153
|
+
control: l,
|
|
154
|
+
render: ({ field: { value: a, ...i } }) => /* @__PURE__ */ e(m, { checked: a, ...i })
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
label: "Editable"
|
|
198
158
|
}
|
|
199
159
|
),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
),
|
|
203
|
-
"stationary" in e.defaultValues && /* @__PURE__ */ n(
|
|
204
|
-
d,
|
|
205
|
-
{
|
|
206
|
-
control: /* @__PURE__ */ n(
|
|
207
|
-
l,
|
|
160
|
+
"stationary" in t.values && /* @__PURE__ */ e(
|
|
161
|
+
c,
|
|
208
162
|
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
163
|
+
control: /* @__PURE__ */ e(
|
|
164
|
+
o,
|
|
165
|
+
{
|
|
166
|
+
name: "stationary",
|
|
167
|
+
control: l,
|
|
168
|
+
render: ({ field: { value: a, ...i } }) => /* @__PURE__ */ e(m, { checked: a, ...i })
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
label: "Stationary"
|
|
212
172
|
}
|
|
213
173
|
),
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
),
|
|
217
|
-
"livingObject" in e.defaultValues && /* @__PURE__ */ n(
|
|
218
|
-
d,
|
|
219
|
-
{
|
|
220
|
-
control: /* @__PURE__ */ n(
|
|
221
|
-
l,
|
|
174
|
+
"livingObject" in t.values && /* @__PURE__ */ e(
|
|
175
|
+
c,
|
|
222
176
|
{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
177
|
+
control: /* @__PURE__ */ e(
|
|
178
|
+
o,
|
|
179
|
+
{
|
|
180
|
+
name: "livingObject",
|
|
181
|
+
control: l,
|
|
182
|
+
render: ({ field: { value: a, ...i } }) => /* @__PURE__ */ e(m, { checked: a, ...i })
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
label: "Living Object"
|
|
226
186
|
}
|
|
227
187
|
),
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
),
|
|
231
|
-
"storeFile" in e.defaultValues && /* @__PURE__ */ n(
|
|
232
|
-
d,
|
|
233
|
-
{
|
|
234
|
-
control: /* @__PURE__ */ n(
|
|
235
|
-
l,
|
|
188
|
+
"storeFile" in t.values && /* @__PURE__ */ e(
|
|
189
|
+
c,
|
|
236
190
|
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
191
|
+
control: /* @__PURE__ */ e(
|
|
192
|
+
o,
|
|
193
|
+
{
|
|
194
|
+
name: "storeFile",
|
|
195
|
+
control: l,
|
|
196
|
+
render: ({ field: { value: a, ...i } }) => /* @__PURE__ */ e(m, { checked: a, ...i })
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
label: "Store File"
|
|
240
200
|
}
|
|
241
|
-
)
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
/* @__PURE__ */ n(L, { children: "Icon" }),
|
|
248
|
-
/* @__PURE__ */ n(
|
|
249
|
-
l,
|
|
250
|
-
{
|
|
251
|
-
name: "icon",
|
|
252
|
-
control: i,
|
|
253
|
-
render: ({ field: { value: t, onChange: a } }) => /* @__PURE__ */ n(
|
|
254
|
-
A,
|
|
201
|
+
)
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ e(d, { label: "Icon", labelPosition: n.labelPosition, children: /* @__PURE__ */ g(v, { children: [
|
|
204
|
+
n.labelPosition === "default" && /* @__PURE__ */ e(y, { children: "Icon" }),
|
|
205
|
+
/* @__PURE__ */ e(
|
|
206
|
+
o,
|
|
255
207
|
{
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
208
|
+
name: "icon",
|
|
209
|
+
control: l,
|
|
210
|
+
render: ({ field: { value: a, onChange: i } }) => /* @__PURE__ */ e(
|
|
211
|
+
k,
|
|
212
|
+
{
|
|
213
|
+
list: t.iconList ?? [],
|
|
214
|
+
value: a ?? "",
|
|
215
|
+
newIcon: t.newIcon ?? null,
|
|
216
|
+
loading: t.iconUploading,
|
|
217
|
+
onFileUpload: (r) => {
|
|
218
|
+
var f;
|
|
219
|
+
return (f = t.onIconUpload) == null ? void 0 : f.call(t, r);
|
|
220
|
+
},
|
|
221
|
+
onChange: i
|
|
222
|
+
}
|
|
223
|
+
)
|
|
261
224
|
}
|
|
262
225
|
)
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
/* @__PURE__ */ n(
|
|
267
|
-
l,
|
|
268
|
-
{
|
|
269
|
-
name: "properties",
|
|
270
|
-
control: i,
|
|
271
|
-
render: ({ field: { value: t, onChange: a } }) => /* @__PURE__ */ n(
|
|
272
|
-
j,
|
|
226
|
+
] }) }),
|
|
227
|
+
/* @__PURE__ */ e(
|
|
228
|
+
o,
|
|
273
229
|
{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
230
|
+
name: "properties",
|
|
231
|
+
control: l,
|
|
232
|
+
render: ({ field: { value: a, onChange: i } }) => /* @__PURE__ */ e(
|
|
233
|
+
I,
|
|
234
|
+
{
|
|
235
|
+
list: a || [],
|
|
236
|
+
inputVariant: n.inputVariant,
|
|
237
|
+
labelPosition: n.labelPosition,
|
|
238
|
+
templateId: S.get(t.values, "id"),
|
|
239
|
+
disablePropertyId: t.disablePropertyId,
|
|
240
|
+
onChange: i
|
|
241
|
+
}
|
|
242
|
+
)
|
|
279
243
|
}
|
|
280
|
-
)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
"recognitionPropertyList" in e.defaultValues && /* @__PURE__ */ n(
|
|
284
|
-
l,
|
|
285
|
-
{
|
|
286
|
-
name: "recognitionPropertyList",
|
|
287
|
-
control: i,
|
|
288
|
-
render: ({ field: { value: t, onChange: a } }) => /* @__PURE__ */ n(
|
|
289
|
-
K,
|
|
244
|
+
),
|
|
245
|
+
"recognitionPropertyList" in t.values && /* @__PURE__ */ e(
|
|
246
|
+
o,
|
|
290
247
|
{
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
onChange:
|
|
248
|
+
name: "recognitionPropertyList",
|
|
249
|
+
control: l,
|
|
250
|
+
render: ({ field: { value: a, onChange: i } }) => /* @__PURE__ */ e(
|
|
251
|
+
V,
|
|
252
|
+
{
|
|
253
|
+
list: a || [],
|
|
254
|
+
getFormValues: h,
|
|
255
|
+
onChange: i
|
|
256
|
+
}
|
|
257
|
+
)
|
|
294
258
|
}
|
|
295
|
-
)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
children:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
) })
|
|
334
|
-
] })
|
|
335
|
-
] });
|
|
259
|
+
),
|
|
260
|
+
/* @__PURE__ */ g(j, { children: [
|
|
261
|
+
/* @__PURE__ */ e(
|
|
262
|
+
w,
|
|
263
|
+
{
|
|
264
|
+
color: "primary",
|
|
265
|
+
variant: "text",
|
|
266
|
+
disabled: n.loading,
|
|
267
|
+
onClick: b.handleOnCancel,
|
|
268
|
+
children: "Cancel"
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
/* @__PURE__ */ e(A, { children: t.saveButtons ? t.saveButtons.map((a, i) => /* @__PURE__ */ e(
|
|
272
|
+
O,
|
|
273
|
+
{
|
|
274
|
+
type: "submit",
|
|
275
|
+
color: "primary",
|
|
276
|
+
variant: "contained",
|
|
277
|
+
disabled: n.loading,
|
|
278
|
+
startIcon: a.icon,
|
|
279
|
+
onClick: a.onClick,
|
|
280
|
+
children: a.label
|
|
281
|
+
},
|
|
282
|
+
i
|
|
283
|
+
)) : /* @__PURE__ */ e(
|
|
284
|
+
K,
|
|
285
|
+
{
|
|
286
|
+
type: "submit",
|
|
287
|
+
color: "primary",
|
|
288
|
+
variant: "contained",
|
|
289
|
+
disabled: n.loading,
|
|
290
|
+
children: n.loading ? "Saving..." : "Save"
|
|
291
|
+
}
|
|
292
|
+
) })
|
|
293
|
+
] })
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
);
|
|
336
297
|
}
|
|
337
|
-
const
|
|
298
|
+
const Z = p.forwardRef(B);
|
|
338
299
|
export {
|
|
339
|
-
|
|
300
|
+
Z as TemplateForm
|
|
340
301
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useThemeProps as K } from "@mui/material";
|
|
2
|
+
import { useRef as M, useState as N, useEffect as R } from "react";
|
|
3
|
+
import { useForm as D } from "react-hook-form";
|
|
4
|
+
import { getNestedChildrenFromMap as E } from "../../utils/ontology.js";
|
|
5
|
+
const z = (f) => {
|
|
6
|
+
const s = K({ props: f, name: "HCTemplateForm" }), {
|
|
7
|
+
values: i,
|
|
8
|
+
inputVariant: a = "outlined",
|
|
9
|
+
labelPosition: n = "default",
|
|
10
|
+
loading: l = !1,
|
|
11
|
+
templates: m,
|
|
12
|
+
onCancel: c,
|
|
13
|
+
onSubmit: d
|
|
14
|
+
} = s, h = M(null), S = D({ defaultValues: i }), { control: g, formState: F, getValues: p, handleSubmit: b, register: T, reset: x } = S, [C, P] = N([]), w = (e) => {
|
|
15
|
+
const o = new Map(e);
|
|
16
|
+
for (const [r, t] of o)
|
|
17
|
+
o.set(r, {
|
|
18
|
+
...t,
|
|
19
|
+
label: t.name,
|
|
20
|
+
value: t.templateKey,
|
|
21
|
+
checked: p("parent") === t.templateKey
|
|
22
|
+
});
|
|
23
|
+
return E(o, !1);
|
|
24
|
+
}, u = () => {
|
|
25
|
+
P(w(m));
|
|
26
|
+
};
|
|
27
|
+
R(() => (u(), () => {
|
|
28
|
+
}), [m]);
|
|
29
|
+
const y = () => {
|
|
30
|
+
c && c();
|
|
31
|
+
}, V = (e, o) => {
|
|
32
|
+
var r;
|
|
33
|
+
(r = e == null ? void 0 : e.preventDefault) == null || r.call(e), b((t) => {
|
|
34
|
+
d(t, o);
|
|
35
|
+
})();
|
|
36
|
+
}, k = () => {
|
|
37
|
+
x();
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
refs: { rootRef: h },
|
|
41
|
+
state: {
|
|
42
|
+
ownerState: {
|
|
43
|
+
inputVariant: a,
|
|
44
|
+
labelPosition: n,
|
|
45
|
+
loading: l
|
|
46
|
+
},
|
|
47
|
+
parents: C,
|
|
48
|
+
inputVariant: a,
|
|
49
|
+
labelPosition: n,
|
|
50
|
+
loading: l,
|
|
51
|
+
errors: F.errors,
|
|
52
|
+
sx: s.sx
|
|
53
|
+
},
|
|
54
|
+
form: {
|
|
55
|
+
control: g,
|
|
56
|
+
getValues: p,
|
|
57
|
+
register: T
|
|
58
|
+
},
|
|
59
|
+
actions: {
|
|
60
|
+
refreshParents: u,
|
|
61
|
+
handleOnCancel: y,
|
|
62
|
+
handleFormSubmit: V,
|
|
63
|
+
resetForm: k
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
z as useTemplateFormLogic
|
|
69
|
+
};
|