@hybridcore/ui 1.3.5 → 1.3.7

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,74 +1,74 @@
1
- import { jsxs as h, Fragment as P, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as C, Fragment as P, jsx as n } from "react/jsx-runtime";
2
2
  import T from "lodash";
3
- import v from "dayjs";
4
- import { Typography as F, Chip as B, Dialog as S, DialogTitle as j, DialogContent as N, DialogActions as W, Button as w, InputAdornment as Y, Tooltip as O, Stack as _ } from "@mui/material";
5
- import { Container as y, Values as E, MiniButton as G } from "./components/data-management/instance-form/components/composite-list/styled.js";
6
- import { Add as H, LockOutlined as R } from "@mui/icons-material";
7
- import $ from "./hooks/useToggle.js";
8
- import { GeometryPicker as q } from "./components/geometry-picker/index.js";
9
- import { PhoneInput as J } from "./components/phone-input/index.js";
10
- import { DateTimePicker as K } from "./components/date-time-picker/index.js";
11
- import { T as D, F as Q } from "./FormControlLabel-DENNVXWL.js";
12
- import { B as x, C as U } from "./Checkbox-BFWhj3s-.js";
13
- import { F as X, I as Z } from "./FormControl-BMRUQKHh.js";
14
- import { S as M } from "./Select-NDq3WyLt.js";
15
- import { M as z } from "./MenuItem-DstAFfik.js";
16
- import { useState as ee } from "react";
17
- function ne({
3
+ import F from "dayjs";
4
+ import { Typography as B, Chip as j, Dialog as N, DialogTitle as S, DialogContent as W, DialogActions as Y, Button as w, InputAdornment as v, Tooltip as O } from "@mui/material";
5
+ import { Container as _, Values as y, MiniButton as E } from "./components/data-management/instance-form/components/composite-list/styled.js";
6
+ import { Add as G, LockOutlined as H } from "@mui/icons-material";
7
+ import R from "./hooks/useToggle.js";
8
+ import { GeometryPicker as $ } from "./components/geometry-picker/index.js";
9
+ import { PhoneInput as q } from "./components/phone-input/index.js";
10
+ import { DateTimePicker as J } from "./components/date-time-picker/index.js";
11
+ import { T as D, F as K } from "./FormControlLabel-DENNVXWL.js";
12
+ import { B as b, C as Q } from "./Checkbox-BFWhj3s-.js";
13
+ import { F as U, I as X } from "./FormControl-BMRUQKHh.js";
14
+ import { S as Z } from "./Select-NDq3WyLt.js";
15
+ import { M } from "./MenuItem-DstAFfik.js";
16
+ import { useState as z } from "react";
17
+ function ee({
18
18
  property: m,
19
19
  mapboxAccessToken: e,
20
20
  value: l,
21
- variant: u = "standard",
22
- size: o = "medium",
21
+ variant: c = "outlined",
22
+ size: i = "medium",
23
23
  onChange: a
24
24
  }) {
25
- var V;
26
- const s = $(!1), [d, C] = ee(), g = (c) => {
27
- C(T.get(c, m.propertyId));
25
+ var x;
26
+ const s = R(!1), [d, g] = z(), V = (u) => {
27
+ g(T.get(u, m.propertyId));
28
28
  }, k = () => {
29
- a([...l || [], d]), C(""), s.action.close();
30
- }, A = (c) => () => {
29
+ a([...l || [], d]), g(""), s.action.close();
30
+ }, A = (u) => () => {
31
31
  if (l) {
32
- let r = [...l];
33
- r.splice(c, 1), a(r);
32
+ let h = [...l];
33
+ h.splice(u, 1), a(h);
34
34
  }
35
35
  };
36
- return /* @__PURE__ */ h(P, { children: [
37
- /* @__PURE__ */ h(y, { variant: u, children: [
38
- /* @__PURE__ */ n(F, { children: m.name }),
39
- /* @__PURE__ */ n(E, { children: T.isArray(l) && l.map((c, r) => {
40
- var f, t;
36
+ return /* @__PURE__ */ C(P, { children: [
37
+ /* @__PURE__ */ C(_, { variant: c, children: [
38
+ /* @__PURE__ */ n(B, { children: m.name }),
39
+ /* @__PURE__ */ n(y, { children: T.isArray(l) && l.map((u, h) => {
40
+ var r, t;
41
41
  return /* @__PURE__ */ n(
42
- B,
42
+ j,
43
43
  {
44
- label: ((t = (f = m.dataTypeInfo) == null ? void 0 : f.innerType) == null ? void 0 : t.type) === "date" ? v(c).format("DD/MM/YYYY HH:mm:ss") : c,
45
- size: o,
46
- onDelete: A(r)
44
+ label: ((t = (r = m.dataTypeInfo) == null ? void 0 : r.innerType) == null ? void 0 : t.type) === "date" ? F(u).format("DD/MM/YYYY HH:mm:ss") : u,
45
+ size: i,
46
+ onDelete: A(h)
47
47
  },
48
- r
48
+ h
49
49
  );
50
50
  }) }),
51
51
  /* @__PURE__ */ n(
52
- G,
52
+ E,
53
53
  {
54
- startIcon: /* @__PURE__ */ n(H, {}),
54
+ startIcon: /* @__PURE__ */ n(G, {}),
55
55
  variant: "text",
56
56
  onClick: s.action.open,
57
57
  children: "Add"
58
58
  }
59
59
  )
60
60
  ] }),
61
- /* @__PURE__ */ h(
62
- S,
61
+ /* @__PURE__ */ C(
62
+ N,
63
63
  {
64
64
  open: s.state.isOpen,
65
65
  onClose: s.action.close,
66
66
  maxWidth: "sm",
67
67
  fullWidth: !0,
68
68
  children: [
69
- /* @__PURE__ */ n(j, { children: "Add List Value" }),
70
- /* @__PURE__ */ n(N, { children: (V = m.dataTypeInfo) != null && V.innerType ? /* @__PURE__ */ n(
71
- te,
69
+ /* @__PURE__ */ n(S, { children: "Add List Value" }),
70
+ /* @__PURE__ */ n(W, { children: (x = m.dataTypeInfo) != null && x.innerType ? /* @__PURE__ */ n(
71
+ ne,
72
72
  {
73
73
  mapboxAccessToken: e,
74
74
  property: {
@@ -77,10 +77,10 @@ function ne({
77
77
  type: m.dataTypeInfo.innerType.type
78
78
  },
79
79
  value: d,
80
- onChange: g
80
+ onChange: V
81
81
  }
82
82
  ) : null }),
83
- /* @__PURE__ */ h(W, { children: [
83
+ /* @__PURE__ */ C(Y, { children: [
84
84
  /* @__PURE__ */ n(
85
85
  w,
86
86
  {
@@ -97,28 +97,28 @@ function ne({
97
97
  )
98
98
  ] });
99
99
  }
100
- function te({
100
+ function ne({
101
101
  mapboxAccessToken: m,
102
102
  property: e,
103
103
  value: l,
104
- variant: u = "standard",
105
- size: o = "medium",
104
+ variant: c = "standard",
105
+ size: i = "medium",
106
106
  disableMargin: a = !1,
107
107
  defaultExtent: s,
108
108
  // keyAuth,
109
109
  onChange: d
110
110
  }) {
111
- var f;
112
- const C = (t) => {
113
- const I = t.target.value.split(",").map((p) => p.trimStart());
111
+ var r;
112
+ const g = (t) => {
113
+ const f = t.target.value.split(",").map((p) => p.trimStart());
114
114
  d({
115
- [e.propertyId]: I
115
+ [e.propertyId]: f
116
116
  });
117
- }, g = (t) => {
118
- const { name: i, type: I, checked: p, value: L } = t.target;
119
- let b = L;
120
- e.type === "double" && (b = b.replace(",", "."), b = b.replace(/[^\d.-]+/g, "")), d({
121
- [i]: I === "checkbox" ? p : b
117
+ }, V = (t) => {
118
+ const { name: o, type: f, checked: p, value: L } = t.target;
119
+ let I = L;
120
+ e.type === "double" && (I = I.replace(",", "."), I = I.replace(/[^\d.-]+/g, "")), d({
121
+ [o]: f === "checkbox" ? p : I
122
122
  });
123
123
  }, k = (t) => {
124
124
  d({
@@ -128,17 +128,17 @@ function te({
128
128
  d({
129
129
  [e.propertyId]: t.target.value
130
130
  });
131
- }, V = (t) => (i) => {
131
+ }, x = (t) => (o) => {
132
132
  d({
133
- [t]: i
133
+ [t]: o
134
134
  });
135
- }, c = (t) => (i) => {
135
+ }, u = (t) => (o) => {
136
136
  d({
137
- [t]: i
137
+ [t]: o
138
138
  });
139
- }, r = (t) => (i) => {
139
+ }, h = (t) => (o) => {
140
140
  d({
141
- [t]: i
141
+ [t]: o
142
142
  });
143
143
  };
144
144
  if ([
@@ -157,36 +157,34 @@ function te({
157
157
  name: e.propertyId,
158
158
  value: l ?? e.defaultValue ?? "",
159
159
  defaultValue: l,
160
- onChange: g,
161
- variant: u,
160
+ onChange: V,
161
+ variant: c,
162
162
  type: "text",
163
163
  multiline: e.type === "text",
164
164
  disabled: !e.editable,
165
165
  fullWidth: !0,
166
166
  sx: { mb: a ? 0 : 2 },
167
167
  InputProps: {
168
- size: o,
168
+ size: i,
169
169
  ...e.privacyPreservationMethod === "ENCRYPTION" ? {
170
- endAdornment: /* @__PURE__ */ n(Y, { position: "end", children: /* @__PURE__ */ n(O, { title: "Encrypted Field", children: /* @__PURE__ */ n(R, {}) }) })
170
+ endAdornment: /* @__PURE__ */ n(v, { position: "end", children: /* @__PURE__ */ n(O, { title: "Encrypted Field", children: /* @__PURE__ */ n(H, {}) }) })
171
171
  } : {}
172
172
  }
173
173
  }
174
174
  );
175
175
  if (e.type === "date") {
176
- const t = l !== void 0 ? v(l).format() : "";
177
- return /* @__PURE__ */ h(_, { mb: a ? 0 : 2, children: [
178
- /* @__PURE__ */ n(F, { variant: "subtitle2", children: e.name }),
179
- /* @__PURE__ */ n(
180
- K,
181
- {
182
- value: t,
183
- variant: u,
184
- size: o,
185
- name: e.propertyId,
186
- onChange: k
187
- }
188
- )
189
- ] });
176
+ const t = l !== void 0 ? F(l).format() : l;
177
+ return /* @__PURE__ */ n(b, { mb: a ? 0 : 2, children: /* @__PURE__ */ n(
178
+ J,
179
+ {
180
+ label: e.name,
181
+ value: t,
182
+ variant: c,
183
+ size: i,
184
+ name: e.propertyId,
185
+ onChange: k
186
+ }
187
+ ) });
190
188
  }
191
189
  if (e.type === "list") {
192
190
  let t = "";
@@ -196,30 +194,30 @@ function te({
196
194
  label: e.name,
197
195
  name: e.propertyId,
198
196
  value: t,
199
- onChange: C,
200
- variant: u,
197
+ onChange: g,
198
+ variant: c,
201
199
  disabled: !e.editable,
202
200
  fullWidth: !0,
203
- helperText: o === "small" ? null : "Add list values with the comma (,) separated string",
201
+ helperText: i === "small" ? null : "Add list values with the comma (,) separated string",
204
202
  sx: { mb: a ? 0 : 2 },
205
203
  InputProps: {
206
- size: o,
207
- placeholder: o === "small" ? "Add list values with the comma (,) separated string" : ""
204
+ size: i,
205
+ placeholder: i === "small" ? "Add list values with the comma (,) separated string" : ""
208
206
  }
209
207
  }
210
208
  );
211
209
  }
212
210
  if (e.type === "boolean")
213
- return /* @__PURE__ */ n(x, { mb: a ? 0 : 2, children: /* @__PURE__ */ n(
214
- Q,
211
+ return /* @__PURE__ */ n(b, { mb: a ? 0 : 2, children: /* @__PURE__ */ n(
212
+ K,
215
213
  {
216
214
  control: /* @__PURE__ */ n(
217
- U,
215
+ Q,
218
216
  {
219
217
  name: e.propertyId,
220
218
  checked: !!l,
221
- onChange: g,
222
- size: o
219
+ onChange: V,
220
+ size: i
223
221
  }
224
222
  ),
225
223
  label: e.name
@@ -227,17 +225,17 @@ function te({
227
225
  ) });
228
226
  if (e.type === "enum") {
229
227
  let t = [];
230
- return (f = e.dataTypeInfo) != null && f.enumValues && (t = e.dataTypeInfo.enumValues), /* @__PURE__ */ h(
231
- X,
228
+ return (r = e.dataTypeInfo) != null && r.enumValues && (t = e.dataTypeInfo.enumValues), /* @__PURE__ */ C(
229
+ U,
232
230
  {
233
231
  fullWidth: !0,
234
- variant: u,
232
+ variant: c,
235
233
  sx: { mb: a ? 0 : 2 },
236
- size: o,
234
+ size: i,
237
235
  children: [
238
- /* @__PURE__ */ n(Z, { id: `${e.propertyId}-label`, children: e.name }),
236
+ /* @__PURE__ */ n(X, { id: `${e.propertyId}-label`, children: e.name }),
239
237
  /* @__PURE__ */ n(
240
- M,
238
+ Z,
241
239
  {
242
240
  label: e.name,
243
241
  name: e.name,
@@ -245,43 +243,44 @@ function te({
245
243
  id: e.propertyId,
246
244
  value: l ?? "",
247
245
  onChange: A,
248
- children: t.map((i, I) => /* @__PURE__ */ n(z, { value: i, children: i }, I))
246
+ children: t.map((o, f) => /* @__PURE__ */ n(M, { value: o, children: o }, f))
249
247
  }
250
248
  )
251
249
  ]
252
250
  }
253
251
  );
254
252
  }
255
- return e.type === "geometry" ? /* @__PURE__ */ n(x, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
256
- q,
253
+ return e.type === "geometry" ? /* @__PURE__ */ n(b, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
254
+ $,
257
255
  {
258
256
  mapboxAccessToken: m,
259
257
  label: e.name,
260
258
  value: l ?? e.defaultValue ?? "",
261
259
  defaultExtent: s,
262
- onChange: V(e.propertyId)
260
+ variant: c,
261
+ onChange: x(e.propertyId)
263
262
  }
264
- ) }) : e.type === "phone-number" ? /* @__PURE__ */ n(x, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
265
- J,
263
+ ) }) : e.type === "phone-number" ? /* @__PURE__ */ n(b, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
264
+ q,
266
265
  {
267
266
  label: e.name,
268
267
  placeholder: "Enter phone number",
269
268
  value: l ?? e.defaultValue ?? "",
270
- onChange: c(e.propertyId)
269
+ onChange: u(e.propertyId)
271
270
  }
272
- ) }) : e.type === "composite-list" ? /* @__PURE__ */ n(x, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
273
- ne,
271
+ ) }) : e.type === "composite-list" ? /* @__PURE__ */ n(b, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
272
+ ee,
274
273
  {
275
274
  property: e,
276
275
  value: l ?? e.defaultValue ?? "",
277
- variant: u,
278
- size: o,
276
+ variant: c,
277
+ size: i,
279
278
  mapboxAccessToken: m,
280
- onChange: r(e.propertyId)
279
+ onChange: h(e.propertyId)
281
280
  }
282
281
  ) }) : /* @__PURE__ */ n(P, {});
283
282
  }
284
283
  export {
285
- ne as C,
286
- te as V
284
+ ee as C,
285
+ ne as V
287
286
  };
package/dist/main.d.ts CHANGED
@@ -166,7 +166,7 @@ declare interface DisseminationListProps {
166
166
  /**
167
167
  *
168
168
  */
169
- variant?: "standart" | "outlined";
169
+ variant?: "standard" | "outlined" | "filled";
170
170
  /**
171
171
  *
172
172
  */
@@ -235,6 +235,7 @@ K extends
235
235
  *
236
236
  */
237
237
  variant?: "inline" | "dialog";
238
+ inputVariant?: "standard" | "outlined" | "filled";
238
239
  /**
239
240
  *
240
241
  */
@@ -501,7 +502,7 @@ declare interface Props_3 {
501
502
  /**
502
503
  *
503
504
  */
504
- value: string;
505
+ value?: string;
505
506
  /**
506
507
  *
507
508
  */
@@ -509,6 +510,8 @@ declare interface Props_3 {
509
510
  /**
510
511
  *
511
512
  */
513
+ label?: string;
514
+
512
515
  name?: string;
513
516
  /**
514
517
  *
@@ -553,6 +556,7 @@ declare interface Props_4 {
553
556
  *
554
557
  */
555
558
  defaultExtent?: Extent;
559
+ variant?: "standard" | "outlined" | "filled";
556
560
  /**
557
561
  *
558
562
  */
@@ -671,7 +675,7 @@ declare interface SecurityLevelProps {
671
675
  /**
672
676
  *
673
677
  */
674
- variant?: "standard" | "outlined";
678
+ variant?: "standard" | "outlined" | "filled";
675
679
  /**
676
680
  *
677
681
  */
@@ -719,6 +723,7 @@ declare interface TreeSelectProps {
719
723
  *
720
724
  */
721
725
  selected: "" | string[] | undefined;
726
+ variant?: "standard" | "outlined" | "filled";
722
727
  disabled?: string[];
723
728
  label?: string;
724
729
  idKey?: string;
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.3.5",
4
+ "version": "1.3.7",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",