@hybridcore/ui 1.5.44 → 1.5.45

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.
@@ -1,53 +1,57 @@
1
- import { jsxs as i, Fragment as y, jsx as e } from "react/jsx-runtime";
2
- import { Box as t, TextField as I, InputAdornment as S, Button as a, Dialog as k, DialogTitle as w, Typography as s, IconButton as T, DialogContent as j, DialogActions as D } from "@mui/material";
3
- import { CloseOutlined as A } from "@mui/icons-material";
4
- import B from "../../../../hooks/useToggle.js";
5
- import { SearchInput as M } from "../../../search-input/index.js";
6
- import { InstanceHierarchyTable as O } from "../../../instance-hierarchy-table/index.js";
7
- import { PropertyMapping as P } from "../../../property-mapping/index.js";
8
- const R = ({
9
- inputVariant: r,
10
- templates: p,
11
- data: c,
1
+ import { jsxs as i, Fragment as S, jsx as e } from "react/jsx-runtime";
2
+ import { useMemo as T } from "react";
3
+ import { Box as t, TextField as k, InputAdornment as w, Button as a, Dialog as j, DialogTitle as A, Typography as p, IconButton as D, DialogContent as M, DialogActions as B } from "@mui/material";
4
+ import { CloseOutlined as O } from "@mui/icons-material";
5
+ import P from "../../../../hooks/useToggle.js";
6
+ import { SearchInput as W } from "../../../search-input/index.js";
7
+ import { InstanceHierarchyTable as F } from "../../../instance-hierarchy-table/index.js";
8
+ import { PropertyMapping as H } from "../../../property-mapping/index.js";
9
+ const K = ({
10
+ inputVariant: c,
11
+ templates: l,
12
+ data: d,
12
13
  onSelect: h,
13
14
  onSearchSubmit: m,
14
15
  openMapping: u,
15
16
  mappingData: g,
16
17
  objectTemplate: f,
17
- selectedInstances: l = [],
18
+ selectedInstances: r = [],
18
19
  mapboxAccessToken: x,
19
20
  onMappingSubmit: C,
20
- onMappingOpen: d,
21
- onMappingClose: b
21
+ onMappingOpen: s,
22
+ onMappingClose: y
22
23
  }) => {
23
- const o = B(!1), v = (n) => {
24
- o.action.close(), d(n);
24
+ const o = P(!1), b = T(
25
+ () => Array.from(l, ([n, I]) => I),
26
+ [l]
27
+ ), v = (n) => {
28
+ o.action.close(), s(n);
25
29
  };
26
- return /* @__PURE__ */ i(y, { children: [
30
+ return /* @__PURE__ */ i(S, { children: [
27
31
  /* @__PURE__ */ e(t, { mb: 2, position: "relative", children: /* @__PURE__ */ e(
28
- I,
32
+ k,
29
33
  {
30
34
  label: "Catalogue Instance(s)",
31
- variant: r,
35
+ variant: c,
32
36
  fullWidth: !0,
33
37
  InputProps: {
34
38
  readOnly: !0,
35
- endAdornment: /* @__PURE__ */ e(S, { position: "end", children: /* @__PURE__ */ e(
39
+ endAdornment: /* @__PURE__ */ e(w, { position: "end", children: /* @__PURE__ */ e(
36
40
  a,
37
41
  {
38
42
  variant: "contained",
39
43
  size: "small",
40
- onClick: d,
44
+ onClick: s,
41
45
  children: "Edit Mapping"
42
46
  }
43
47
  ) })
44
48
  },
45
- value: l.map((n) => n.title).join(", "),
49
+ value: r.map((n) => n.title).join(", "),
46
50
  onClick: o.action.open
47
51
  }
48
52
  ) }),
49
53
  /* @__PURE__ */ i(
50
- k,
54
+ j,
51
55
  {
52
56
  open: o.state.isOpen,
53
57
  fullWidth: !0,
@@ -55,7 +59,7 @@ const R = ({
55
59
  onClose: o.action.close,
56
60
  children: [
57
61
  /* @__PURE__ */ i(
58
- w,
62
+ A,
59
63
  {
60
64
  component: "div",
61
65
  lineHeight: 1,
@@ -63,8 +67,8 @@ const R = ({
63
67
  justifyContent: "space-between",
64
68
  children: [
65
69
  /* @__PURE__ */ i(t, { flex: 1, children: [
66
- /* @__PURE__ */ e(s, { variant: "h6", children: "Catalogue Instance" }),
67
- /* @__PURE__ */ e(s, { variant: "caption", children: "Search and select catalogue instance(s)" })
70
+ /* @__PURE__ */ e(p, { variant: "h6", children: "Catalogue Instance" }),
71
+ /* @__PURE__ */ e(p, { variant: "caption", children: "Search and select catalogue instance(s)" })
68
72
  ] }),
69
73
  /* @__PURE__ */ i(
70
74
  t,
@@ -76,19 +80,19 @@ const R = ({
76
80
  justifyContent: "flex-end",
77
81
  children: [
78
82
  /* @__PURE__ */ e(
79
- M,
83
+ W,
80
84
  {
81
- variant: r,
85
+ variant: c,
82
86
  sx: { width: 300 },
83
87
  onSubmit: m
84
88
  }
85
89
  ),
86
90
  /* @__PURE__ */ e(
87
- T,
91
+ D,
88
92
  {
89
93
  onClick: o.action.close,
90
94
  sx: { ml: 2 },
91
- children: /* @__PURE__ */ e(A, {})
95
+ children: /* @__PURE__ */ e(O, {})
92
96
  }
93
97
  )
94
98
  ]
@@ -97,26 +101,26 @@ const R = ({
97
101
  ]
98
102
  }
99
103
  ),
100
- /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
104
+ /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
101
105
  t,
102
106
  {
103
107
  boxShadow: (n) => n.shadows[1],
104
108
  mt: 0.1,
105
109
  overflow: "hidden",
106
110
  borderRadius: 1,
107
- children: c && /* @__PURE__ */ e(
108
- O,
111
+ children: d && /* @__PURE__ */ e(
112
+ F,
109
113
  {
110
- data: c,
111
- templates: p,
114
+ data: d,
115
+ templates: l,
112
116
  enableCheckboxSelection: !0,
113
- selectedIds: l.map((n) => n.id),
117
+ selectedIds: r.map((n) => n.id),
114
118
  onSelect: h
115
119
  }
116
120
  )
117
121
  }
118
122
  ) }),
119
- /* @__PURE__ */ i(D, { children: [
123
+ /* @__PURE__ */ i(B, { children: [
120
124
  /* @__PURE__ */ e(
121
125
  a,
122
126
  {
@@ -131,7 +135,7 @@ const R = ({
131
135
  {
132
136
  color: "primary",
133
137
  variant: "contained",
134
- disabled: l.length === 0,
138
+ disabled: r.length === 0,
135
139
  onClick: v,
136
140
  children: "Property Mapping"
137
141
  }
@@ -141,18 +145,19 @@ const R = ({
141
145
  }
142
146
  ),
143
147
  /* @__PURE__ */ e(
144
- P,
148
+ H,
145
149
  {
146
150
  data: g,
147
151
  objectTemplate: f,
152
+ agentTemplates: b,
148
153
  mapboxAccessToken: x,
149
154
  onSubmit: C,
150
155
  open: u,
151
- onClose: b
156
+ onClose: y
152
157
  }
153
158
  )
154
159
  ] });
155
160
  };
156
161
  export {
157
- R as CatalogueInstanceSelector
162
+ K as CatalogueInstanceSelector
158
163
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.5.44",
4
+ "version": "1.5.45",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",