@hybridcore/ui 1.5.1 → 1.5.3

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.
@@ -3,7 +3,7 @@ import "react-confirm";
3
3
  import "@mui/material";
4
4
  import "@mui/icons-material";
5
5
  import "../../DialogContent-CtA2aNum.js";
6
- import { a as f } from "../../dialog-DrVArHYg.js";
6
+ import { a as f } from "../../dialog-BDt1r9fh.js";
7
7
  import "../../Button-jy67CcTH.js";
8
8
  export {
9
9
  f as default
@@ -1,5 +1,5 @@
1
1
  import { createConfirmation as r } from "react-confirm";
2
- import { a as i } from "../../dialog-DrVArHYg.js";
2
+ import { a as i } from "../../dialog-BDt1r9fh.js";
3
3
  const o = r(i);
4
4
  function f(t, n, e = {
5
5
  cancelButtonText: "Cancel",
@@ -3,7 +3,7 @@ import "@mui/material";
3
3
  import "./styled.js";
4
4
  import "@mui/icons-material";
5
5
  import "../../../../hooks/useToggle.js";
6
- import { C as l } from "../../../../index-D2tF2-ya.js";
6
+ import { C as l } from "../../../../index-JgBxaIU2.js";
7
7
  import "react";
8
8
  import "lodash";
9
9
  import "dayjs";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "lodash";
3
3
  import "dayjs";
4
- import { V as g } from "../../../../index-D2tF2-ya.js";
4
+ import { V as g } from "../../../../index-JgBxaIU2.js";
5
5
  import "@mui/material";
6
6
  import "@mui/icons-material";
7
7
  import "../../../geometry-picker/index.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx as t, Fragment as h } from "react/jsx-runtime";
2
2
  import p from "react";
3
- import { V as x } from "../../../../index-D2tF2-ya.js";
3
+ import { V as x } from "../../../../index-JgBxaIU2.js";
4
4
  import _ from "lodash";
5
5
  import { Box as d } from "@mui/material";
6
6
  function V({
@@ -5,7 +5,7 @@ import { DataGrid as fe } from "@mui/x-data-grid";
5
5
  import { useState as H, useEffect as ue } from "react";
6
6
  import h from "lodash";
7
7
  import { e as ye } from "../../ol-9hySGI6D.js";
8
- import { V as he } from "../../index-D2tF2-ya.js";
8
+ import { V as he } from "../../index-JgBxaIU2.js";
9
9
  import { RangeSelector as me } from "../range-selector/index.js";
10
10
  const $e = ({
11
11
  open: F,
@@ -8,7 +8,7 @@ import { B as f } from "../../../../Box-SSMZuKnS.js";
8
8
  import { T as y } from "../../../../Typography-CLq43OVQ.js";
9
9
  import { B as h } from "../../../../Button-jy67CcTH.js";
10
10
  import { D as g, a as b } from "../../../../DialogContent-CtA2aNum.js";
11
- import { D } from "../../../../dialog-DrVArHYg.js";
11
+ import { D } from "../../../../dialog-BDt1r9fh.js";
12
12
  function v(t) {
13
13
  var a;
14
14
  const { state: o, action: r } = u(t);
@@ -8,7 +8,7 @@ import { B as g } from "../../../../Box-SSMZuKnS.js";
8
8
  import { T as u } from "../../../../Typography-CLq43OVQ.js";
9
9
  import { B as h } from "../../../../Button-jy67CcTH.js";
10
10
  import { D as f, a as y } from "../../../../DialogContent-CtA2aNum.js";
11
- import { D as b } from "../../../../dialog-DrVArHYg.js";
11
+ import { D as b } from "../../../../dialog-BDt1r9fh.js";
12
12
  function L(i) {
13
13
  const { state: l, action: t } = p(i);
14
14
  return /* @__PURE__ */ r(g, { children: [
@@ -69,11 +69,11 @@ process.env.NODE_ENV !== "production" && (u.propTypes = {
69
69
  */
70
70
  sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
71
71
  });
72
- const A = {
72
+ const I = {
73
73
  confirmButtonText: "OK",
74
74
  cancelButtonText: "Cancel",
75
75
  disableCancelButton: !1
76
- }, I = ({
76
+ }, A = ({
77
77
  show: a = !0,
78
78
  proceed: t = () => {
79
79
  },
@@ -81,7 +81,7 @@ const A = {
81
81
  description: i,
82
82
  options: e
83
83
  }) => {
84
- e = { ...A, ...e };
84
+ e = { ...I, ...e };
85
85
  const n = () => {
86
86
  t(!1);
87
87
  }, l = () => {
@@ -97,6 +97,7 @@ const A = {
97
97
  "aria-labelledby": "dialog-title",
98
98
  "aria-describedby": "dialog-description",
99
99
  sx: {
100
+ zIndex: 9999,
100
101
  "& .MuiDialog-paper": {
101
102
  borderRadius: 3
102
103
  },
@@ -146,7 +147,7 @@ const A = {
146
147
  ]
147
148
  }
148
149
  );
149
- }, G = x(I);
150
+ }, G = x(A);
150
151
  export {
151
152
  u as D,
152
153
  G as a
@@ -1,9 +1,9 @@
1
- import { jsxs as h, Fragment as P, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as h, Fragment as p, jsx as a } from "react/jsx-runtime";
2
2
  import I from "lodash";
3
3
  import N from "dayjs";
4
- import { FormControl as W, FormLabel as j, FormGroup as Y, FormControlLabel as $, Checkbox as v, Typography as S, Button as D, Chip as _, Dialog as E, DialogTitle as G, DialogContent as M, DialogActions as H, InputAdornment as K, Tooltip as R } from "@mui/material";
4
+ import { FormControl as W, FormLabel as j, FormGroup as Y, FormControlLabel as $, Checkbox as v, Typography as S, Button as P, Chip as _, Dialog as E, DialogTitle as G, DialogContent as M, DialogActions as H, InputAdornment as K, Tooltip as R } from "@mui/material";
5
5
  import { Container as U, Values as J, MiniButton as Q } from "./components/instance-form/components/composite-list/styled.js";
6
- import { KeyboardArrowUp as X, KeyboardArrowDown as Z, Add as O, LockOutlined as z } from "@mui/icons-material";
6
+ import { KeyboardArrowUp as X, KeyboardArrowDown as Z, Add as z, LockOutlined as O } from "@mui/icons-material";
7
7
  import ee from "./hooks/useToggle.js";
8
8
  import { GeometryPicker as ne } from "./components/geometry-picker/index.js";
9
9
  import { PhoneInput as ae } from "./components/phone-input/index.js";
@@ -17,33 +17,33 @@ import { S as me } from "./Select-ush_fSWy.js";
17
17
  import { M as re } from "./MenuItem-Lcjh1XlV.js";
18
18
  import { useState as B } from "react";
19
19
  function ce({
20
- property: o,
20
+ property: d,
21
21
  mapboxAccessToken: e,
22
22
  value: l,
23
23
  variant: s = "outlined",
24
24
  size: c = "medium",
25
- onChange: d
25
+ onChange: i
26
26
  }) {
27
27
  var C, g, V;
28
- const f = ee(!1), [i, u] = B(), [b, k] = B(!1), w = 10, A = (n) => {
29
- u(I.get(n, o.propertyId));
28
+ const f = ee(!1), [o, u] = B(), [b, k] = B(!1), w = 10, A = (n) => {
29
+ u(I.get(n, d.propertyId));
30
30
  }, y = () => {
31
- d([...l || [], i]), u(""), f.action.close();
32
- }, p = (n) => () => {
31
+ i([...l || [], o]), u(""), f.action.close();
32
+ }, D = (n) => () => {
33
33
  if (l) {
34
34
  const t = [...l];
35
- t.splice(n, 1), d(t);
35
+ t.splice(n, 1), i(t);
36
36
  }
37
37
  }, F = (n) => {
38
38
  const { value: t, checked: m } = n.target;
39
39
  let r = I.isArray(l) ? l : [];
40
- m ? r.push(t) : r = r.filter((L) => L !== t), d(r);
40
+ m ? r.push(t) : r = r.filter((L) => L !== t), i(r);
41
41
  };
42
- if (((g = (C = o.dataTypeInfo) == null ? void 0 : C.innerType) == null ? void 0 : g.type) === "enum") {
43
- const { enumValues: n } = o.dataTypeInfo.innerType;
44
- return /* @__PURE__ */ h(P, { children: [
42
+ if (((g = (C = d.dataTypeInfo) == null ? void 0 : C.innerType) == null ? void 0 : g.type) === "enum") {
43
+ const { enumValues: n } = d.dataTypeInfo.innerType;
44
+ return /* @__PURE__ */ h(p, { children: [
45
45
  /* @__PURE__ */ h(W, { fullWidth: !0, component: "fieldset", variant: s, children: [
46
- /* @__PURE__ */ a(j, { component: "legend", sx: { mb: 1 }, children: o.name }),
46
+ /* @__PURE__ */ a(j, { component: "legend", sx: { mb: 1 }, children: d.name }),
47
47
  /* @__PURE__ */ a(Y, { children: n && n.length > 0 ? n.slice(0, b ? 9999 : w).map((t, m) => /* @__PURE__ */ a(
48
48
  $,
49
49
  {
@@ -51,7 +51,7 @@ function ce({
51
51
  control: /* @__PURE__ */ a(
52
52
  v,
53
53
  {
54
- name: o.propertyId,
54
+ name: d.propertyId,
55
55
  value: t,
56
56
  size: "small",
57
57
  checked: I.isArray(l) ? l.includes(t) : !1,
@@ -68,7 +68,7 @@ function ce({
68
68
  )) : /* @__PURE__ */ a(S, { variant: "caption", mb: 1, children: "No enum values!" }) })
69
69
  ] }),
70
70
  I.isArray(n) && n.length > w && /* @__PURE__ */ h(
71
- D,
71
+ P,
72
72
  {
73
73
  size: "small",
74
74
  sx: { p: 0, textTransform: "none" },
@@ -82,17 +82,17 @@ function ce({
82
82
  )
83
83
  ] });
84
84
  }
85
- return /* @__PURE__ */ h(P, { children: [
85
+ return /* @__PURE__ */ h(p, { children: [
86
86
  /* @__PURE__ */ h(U, { variant: s, children: [
87
- /* @__PURE__ */ a(S, { children: o.name }),
87
+ /* @__PURE__ */ a(S, { children: d.name }),
88
88
  /* @__PURE__ */ a(J, { children: I.isArray(l) && l.map((n, t) => {
89
89
  var m, r;
90
90
  return /* @__PURE__ */ a(
91
91
  _,
92
92
  {
93
- label: ((r = (m = o.dataTypeInfo) == null ? void 0 : m.innerType) == null ? void 0 : r.type) === "date" ? N(n).format("DD/MM/YYYY HH:mm:ss") : n,
93
+ label: ((r = (m = d.dataTypeInfo) == null ? void 0 : m.innerType) == null ? void 0 : r.type) === "date" ? N(n).format("DD/MM/YYYY HH:mm:ss") : n,
94
94
  size: c,
95
- onDelete: p(t)
95
+ onDelete: D(t)
96
96
  },
97
97
  t
98
98
  );
@@ -100,7 +100,7 @@ function ce({
100
100
  /* @__PURE__ */ a(
101
101
  Q,
102
102
  {
103
- startIcon: /* @__PURE__ */ a(O, {}),
103
+ startIcon: /* @__PURE__ */ a(z, {}),
104
104
  variant: "text",
105
105
  onClick: f.action.open,
106
106
  children: "Add"
@@ -116,22 +116,22 @@ function ce({
116
116
  fullWidth: !0,
117
117
  children: [
118
118
  /* @__PURE__ */ a(G, { children: "Add List Value" }),
119
- /* @__PURE__ */ a(M, { children: (V = o.dataTypeInfo) != null && V.innerType ? /* @__PURE__ */ a(
119
+ /* @__PURE__ */ a(M, { children: (V = d.dataTypeInfo) != null && V.innerType ? /* @__PURE__ */ a(
120
120
  ue,
121
121
  {
122
122
  mapboxAccessToken: e,
123
123
  property: {
124
- ...o,
124
+ ...d,
125
125
  name: "Value",
126
- type: o.dataTypeInfo.innerType.type
126
+ type: d.dataTypeInfo.innerType.type
127
127
  },
128
- value: i,
128
+ value: o,
129
129
  onChange: A
130
130
  }
131
131
  ) : null }),
132
132
  /* @__PURE__ */ h(H, { children: [
133
133
  /* @__PURE__ */ a(
134
- D,
134
+ P,
135
135
  {
136
136
  variant: "contained",
137
137
  color: "inherit",
@@ -139,7 +139,7 @@ function ce({
139
139
  children: "Cancel"
140
140
  }
141
141
  ),
142
- /* @__PURE__ */ a(D, { variant: "contained", color: "primary", onClick: y, children: "Ok" })
142
+ /* @__PURE__ */ a(P, { variant: "contained", color: "primary", onClick: y, children: "Ok" })
143
143
  ] })
144
144
  ]
145
145
  }
@@ -147,14 +147,14 @@ function ce({
147
147
  ] });
148
148
  }
149
149
  function ue({
150
- mapboxAccessToken: o,
150
+ mapboxAccessToken: d,
151
151
  property: e,
152
152
  value: l,
153
153
  variant: s = "standard",
154
154
  size: c = "medium",
155
- disableMargin: d = !1,
155
+ disableMargin: i = !1,
156
156
  defaultExtent: f,
157
- fieldOptions: i,
157
+ fieldOptions: o,
158
158
  // keyAuth,
159
159
  onChange: u
160
160
  }) {
@@ -182,7 +182,7 @@ function ue({
182
182
  u({
183
183
  [n]: t
184
184
  });
185
- }, p = (n) => (t) => {
185
+ }, D = (n) => (t) => {
186
186
  u({
187
187
  [n]: t
188
188
  });
@@ -214,21 +214,21 @@ function ue({
214
214
  multiline: e.type === "text",
215
215
  disabled: !e.editable,
216
216
  fullWidth: !0,
217
- sx: { mb: d ? 0 : 2 },
217
+ sx: { mb: i ? 0 : 2 },
218
218
  InputProps: {
219
219
  size: c,
220
- ...i && i[e.propertyId] && {
221
- tabIndex: i[e.propertyId].order
220
+ ...o && o[e.propertyId] && {
221
+ tabIndex: o[e.propertyId].order
222
222
  },
223
223
  ...e.privacyPreservationMethod === "ENCRYPTION" ? {
224
- endAdornment: /* @__PURE__ */ a(K, { position: "end", children: /* @__PURE__ */ a(R, { title: "Encrypted Field", children: /* @__PURE__ */ a(z, {}) }) })
224
+ endAdornment: /* @__PURE__ */ a(K, { position: "end", children: /* @__PURE__ */ a(R, { title: "Encrypted Field", children: /* @__PURE__ */ a(O, {}) }) })
225
225
  } : {}
226
226
  }
227
227
  }
228
228
  );
229
229
  if (e.type === "date") {
230
230
  const n = l !== void 0 ? N(l).format() : l;
231
- return /* @__PURE__ */ a(x, { mb: d ? 0 : 2, children: /* @__PURE__ */ a(
231
+ return /* @__PURE__ */ a(x, { mb: i ? 0 : 2, children: /* @__PURE__ */ a(
232
232
  le,
233
233
  {
234
234
  label: e.name,
@@ -236,7 +236,10 @@ function ue({
236
236
  variant: s,
237
237
  size: c,
238
238
  name: e.propertyId,
239
- onChange: w
239
+ onChange: w,
240
+ ...o && o[e.propertyId] && {
241
+ minDate: o[e.propertyId].minDate
242
+ }
240
243
  }
241
244
  ) });
242
245
  }
@@ -254,19 +257,19 @@ function ue({
254
257
  required: e.required,
255
258
  fullWidth: !0,
256
259
  helperText: c === "small" ? null : "Add list values with the comma (,) separated string",
257
- sx: { mb: d ? 0 : 2 },
260
+ sx: { mb: i ? 0 : 2 },
258
261
  InputProps: {
259
262
  size: c,
260
263
  placeholder: c === "small" ? "Add list values with the comma (,) separated string" : "",
261
- ...i && i[e.propertyId] && {
262
- tabIndex: i[e.propertyId].order
264
+ ...o && o[e.propertyId] && {
265
+ tabIndex: o[e.propertyId].order
263
266
  }
264
267
  }
265
268
  }
266
269
  );
267
270
  }
268
271
  if (e.type === "boolean")
269
- return /* @__PURE__ */ a(x, { mb: d ? 0 : 2, children: /* @__PURE__ */ a(
272
+ return /* @__PURE__ */ a(x, { mb: i ? 0 : 2, children: /* @__PURE__ */ a(
270
273
  te,
271
274
  {
272
275
  control: /* @__PURE__ */ a(
@@ -288,7 +291,7 @@ function ue({
288
291
  {
289
292
  fullWidth: !0,
290
293
  variant: s,
291
- sx: { mb: d ? 0 : 2 },
294
+ sx: { mb: i ? 0 : 2 },
292
295
  size: c,
293
296
  required: e.required,
294
297
  children: [
@@ -303,8 +306,8 @@ function ue({
303
306
  value: l ?? "",
304
307
  onChange: A,
305
308
  inputProps: {
306
- ...i && i[e.propertyId] && {
307
- tabIndex: i[e.propertyId].order
309
+ ...o && o[e.propertyId] && {
310
+ tabIndex: o[e.propertyId].order
308
311
  }
309
312
  },
310
313
  children: n.map((t, m) => /* @__PURE__ */ a(re, { value: t, children: t }, m))
@@ -314,35 +317,35 @@ function ue({
314
317
  }
315
318
  );
316
319
  }
317
- return e.type === "geometry" ? /* @__PURE__ */ a(x, { sx: { mb: d ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ a(
320
+ return e.type === "geometry" ? /* @__PURE__ */ a(x, { sx: { mb: i ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ a(
318
321
  ne,
319
322
  {
320
- mapboxAccessToken: o,
323
+ mapboxAccessToken: d,
321
324
  label: e.name,
322
325
  value: l ?? e.defaultValue ?? "",
323
326
  defaultExtent: f,
324
327
  variant: s,
325
328
  onChange: y(e.propertyId)
326
329
  }
327
- ) }) : e.type === "phone-number" ? /* @__PURE__ */ a(x, { sx: { mb: d ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ a(
330
+ ) }) : e.type === "phone-number" ? /* @__PURE__ */ a(x, { sx: { mb: i ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ a(
328
331
  ae,
329
332
  {
330
333
  label: e.name,
331
334
  placeholder: "Enter phone number",
332
335
  value: l ?? e.defaultValue ?? "",
333
- onChange: p(e.propertyId)
336
+ onChange: D(e.propertyId)
334
337
  }
335
- ) }) : e.type === "composite-list" ? /* @__PURE__ */ a(x, { sx: { mb: d ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ a(
338
+ ) }) : e.type === "composite-list" ? /* @__PURE__ */ a(x, { sx: { mb: i ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ a(
336
339
  ce,
337
340
  {
338
341
  property: e,
339
342
  value: l ?? e.defaultValue ?? "",
340
343
  variant: s,
341
344
  size: c,
342
- mapboxAccessToken: o,
345
+ mapboxAccessToken: d,
343
346
  onChange: F(e.propertyId)
344
347
  }
345
- ) }) : /* @__PURE__ */ a(P, {});
348
+ ) }) : /* @__PURE__ */ a(p, {});
346
349
  }
347
350
  export {
348
351
  ce as C,
package/dist/main.d.ts CHANGED
@@ -227,6 +227,7 @@ declare interface FieldOptions {
227
227
  order?: number;
228
228
  hidden?: boolean;
229
229
  disabled?: boolean;
230
+ minDate?: Dayjs;
230
231
  [key: string]: string | number | object | boolean;
231
232
  }
232
233
 
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.1",
4
+ "version": "1.5.3",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",