@hybridcore/ui 1.0.2 → 1.1.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.
Files changed (105) hide show
  1. package/dist/ButtonBase-BYmh3G5j.js +967 -0
  2. package/dist/CardContent-C8PxkJz4.js +73 -0
  3. package/dist/Checkbox-DostZSwR.js +673 -0
  4. package/dist/DialogContent-2aPOjKE7.js +2025 -0
  5. package/dist/FormControl-BiAFm76F.js +1491 -0
  6. package/dist/IconButton-CQJ8wZE8.js +183 -0
  7. package/dist/Input-Bf5G3tFN.js +324 -0
  8. package/dist/OutlinedInput-BEVE8VZQ.js +452 -0
  9. package/dist/Paper-CaiWdndQ.js +162 -0
  10. package/dist/Select-DxpxZbJp.js +2526 -0
  11. package/dist/Source-CnCcu5UP.js +4374 -0
  12. package/dist/Text-BT5kPHOo.js +2192 -0
  13. package/dist/Typography-XIiVCSto.js +178 -0
  14. package/dist/assertThisInitialized-BUtkG-md.js +13 -0
  15. package/dist/assets/index.css +1 -0
  16. package/dist/assets/index2.css +1 -0
  17. package/dist/chainPropTypes-DtBfUj5o.js +96 -0
  18. package/dist/components/access/helpers.js +32 -0
  19. package/dist/components/access/index.js +15 -0
  20. package/dist/components/card/index.js +159 -469
  21. package/dist/components/card/styled.js +75 -7
  22. package/dist/components/conditional-wrapper/index.js +9 -0
  23. package/dist/components/confirm/dialog.js +151 -0
  24. package/dist/components/confirm/index.js +23 -0
  25. package/dist/components/container/index.js +270 -0
  26. package/dist/components/context-menu/index.js +973 -0
  27. package/dist/components/data-management/instance-form/components/composite-list/index.js +12 -0
  28. package/dist/components/data-management/instance-form/components/composite-list/styled.js +64 -0
  29. package/dist/components/data-management/instance-form/components/policy-list/index.js +86 -0
  30. package/dist/components/data-management/instance-form/components/variable/index.js +15 -0
  31. package/dist/components/data-management/instance-form/components/variables/index.js +39 -0
  32. package/dist/components/data-management/instance-form/index.js +437 -0
  33. package/dist/components/data-security-selectors/dissemination-list/index.js +3201 -0
  34. package/dist/components/data-security-selectors/security-level/index.js +81 -0
  35. package/dist/components/date-time-picker/index.js +103 -0
  36. package/dist/components/geometry-picker/coordinate/index.js +93 -0
  37. package/dist/components/geometry-picker/edit/index.js +71 -0
  38. package/dist/components/geometry-picker/geometry/index.js +160 -0
  39. package/dist/components/geometry-picker/geometry/map-overlay.js +22 -0
  40. package/dist/components/geometry-picker/index.js +140 -0
  41. package/dist/components/geometry-picker/kml/index.js +62 -0
  42. package/dist/components/geometry-picker/kml/select-input-method.js +75 -0
  43. package/dist/components/geometry-picker/logic.js +69 -0
  44. package/dist/components/geometry-picker/map/index.js +42 -0
  45. package/dist/components/geometry-picker/map/logic.js +2360 -0
  46. package/dist/components/geometry-picker/map/style.js +88 -0
  47. package/dist/components/geometry-picker/parser/coordinate-input/index.js +78 -0
  48. package/dist/components/geometry-picker/parser/coordinate-input/logic.js +1305 -0
  49. package/dist/components/geometry-picker/parser/index.js +179 -0
  50. package/dist/components/geometry-picker/parser/logic.js +84 -0
  51. package/dist/components/geometry-picker/parser/styled.js +25 -0
  52. package/dist/components/geometry-picker/styled.js +48 -0
  53. package/dist/components/geometry-picker/wkt/index.js +59 -0
  54. package/dist/components/geometry-picker/wkt/select-input-method.js +75 -0
  55. package/dist/components/icon-button/index.js +18 -0
  56. package/dist/components/icon-button/styled.js +51 -0
  57. package/dist/components/key-protection/index.js +4 -0
  58. package/dist/components/key-protection/menu.js +85 -0
  59. package/dist/components/key-protection/utils.js +10 -0
  60. package/dist/components/loading/index.js +7 -0
  61. package/dist/components/loading/styled.js +16 -0
  62. package/dist/components/map/helpers/kml.js +45 -0
  63. package/dist/components/map/helpers/mapbox.js +48 -0
  64. package/dist/components/map/helpers/ol.js +25 -0
  65. package/dist/components/map/helpers/wkt.js +29 -0
  66. package/dist/components/map/index.js +8 -0
  67. package/dist/components/map/logic.js +140 -0
  68. package/dist/components/map/styled.js +8 -0
  69. package/dist/components/phone-input/index.js +25 -0
  70. package/dist/components/phone-input/styled.js +26 -0
  71. package/dist/components/search-input/index.js +76 -0
  72. package/dist/components/tree-select/index.js +70 -0
  73. package/dist/components/tree-select/styled.js +64 -0
  74. package/dist/components/treeview-filter/index.js +621 -0
  75. package/dist/components/treeview-filter/item/index.js +7 -0
  76. package/dist/components/treeview-filter/item-label/index.js +44 -0
  77. package/dist/createTheme-agWfFD64.js +2392 -0
  78. package/dist/exactProp-CI8dagM-.js +36 -0
  79. package/dist/extends-C3382pL0.js +22 -0
  80. package/dist/has-9_asnBxn.js +688 -0
  81. package/dist/hooks/useMenuLogic.js +21 -0
  82. package/dist/hooks/useToggle.js +23 -0
  83. package/dist/index-Bw_m9ult.js +1105 -0
  84. package/dist/index-IvOfmM1F.js +34 -0
  85. package/dist/index-wW2D1aTG.js +957 -0
  86. package/dist/isHostComponent-kiaBvYVo.js +6 -0
  87. package/dist/isMuiElement-CxT3_ACP.js +13 -0
  88. package/dist/listItemTextClasses-BvXFz-Oc.js +132 -0
  89. package/dist/main.d.ts +1317 -0
  90. package/dist/main.js +41 -2
  91. package/dist/ol-DXmSLlWv.js +15041 -0
  92. package/dist/ownerDocument-CUrv0DIK.js +6 -0
  93. package/dist/ownerWindow-niciwP7I.js +7 -0
  94. package/dist/styled-C43K9x7T.js +229 -0
  95. package/dist/styled-Iq9jsO4F.js +1033 -0
  96. package/dist/useFormControl-CatNKXAi.js +10 -0
  97. package/dist/useId-BHG98T5I.js +26 -0
  98. package/dist/useTheme-C0Dky5rV.js +17 -0
  99. package/dist/useTheme-CeyGVuQP.js +10 -0
  100. package/dist/useThemeProps-CzAjOL6F.js +26 -0
  101. package/dist/utils/ontology.js +37 -0
  102. package/dist/utils-Bq0ye5vf.js +115 -0
  103. package/dist/utils-DLpkeyhZ.js +365 -0
  104. package/package.json +26 -5
  105. package/dist/styled-BG5UIpPU.js +0 -3459
@@ -0,0 +1,81 @@
1
+ import { jsxs as m, Fragment as A, jsx as n } from "react/jsx-runtime";
2
+ import { useMemo as C } from "react";
3
+ import { FormControl as D, InputLabel as F, Select as I, MenuItem as $, FormHelperText as j } from "@mui/material";
4
+ import { hasDataAccess as a } from "../../access/helpers.js";
5
+ const p = ({
6
+ ontologyId: s,
7
+ appRoles: f,
8
+ templateKeys: e,
9
+ templateType: o,
10
+ securityLevels: l,
11
+ value: g,
12
+ minLevel: i = 99,
13
+ minLevelId: c,
14
+ minLevelRoles: t,
15
+ showError: h,
16
+ variant: d = "standard",
17
+ onChange: S
18
+ }) => {
19
+ const b = C(() => {
20
+ if (t && t.length > 0) {
21
+ for (let r of t)
22
+ if (a(r, "SUPER_ADMIN", f))
23
+ return i;
24
+ }
25
+ if (e && e.length > 0 && o) {
26
+ for (let r of e)
27
+ if (a(
28
+ `${s}.${o}.${r}`,
29
+ "SUPER_ADMIN",
30
+ f
31
+ ))
32
+ return i;
33
+ }
34
+ if (c && l.length > 0) {
35
+ const r = l.find(
36
+ (u) => u.id === c
37
+ );
38
+ if (r) return r.level;
39
+ }
40
+ return i;
41
+ }, [
42
+ i,
43
+ c,
44
+ l,
45
+ t,
46
+ e,
47
+ o
48
+ ]), x = (r) => {
49
+ S(r.target.value);
50
+ };
51
+ return /* @__PURE__ */ m(A, { children: [
52
+ /* @__PURE__ */ m(
53
+ D,
54
+ {
55
+ fullWidth: !0,
56
+ variant: d,
57
+ error: h,
58
+ size: d === "outlined" ? "small" : "medium",
59
+ sx: { ...d === "outlined" && { mt: 1 } },
60
+ children: [
61
+ /* @__PURE__ */ n(F, { id: "security-level-label", children: "Security Level *" }),
62
+ /* @__PURE__ */ n(
63
+ I,
64
+ {
65
+ label: "Security Level *",
66
+ labelId: "security-level-label",
67
+ id: "demo-simple-select",
68
+ value: g,
69
+ onChange: x,
70
+ children: l.filter((r) => r.level <= b).map((r, u) => /* @__PURE__ */ n($, { value: r.id, children: r.name }, u))
71
+ }
72
+ )
73
+ ]
74
+ }
75
+ ),
76
+ h && /* @__PURE__ */ n(j, { error: !0, children: "This field is required!" })
77
+ ] });
78
+ };
79
+ export {
80
+ p as SecurityLevel
81
+ };
@@ -0,0 +1,103 @@
1
+ import { jsxs as l, Fragment as w, jsx as e } from "react/jsx-runtime";
2
+ import { useState as T, useMemo as y } from "react";
3
+ import { Stack as d, IconButton as F, Menu as P, MenuItem as E } from "@mui/material";
4
+ import { DatePicker as B } from "@mui/x-date-pickers";
5
+ import h from "dayjs";
6
+ import f from "lodash";
7
+ import { PatternFormat as I } from "react-number-format";
8
+ import { Schedule as Z } from "@mui/icons-material";
9
+ import $ from "../../hooks/useMenuLogic.js";
10
+ const K = ({
11
+ value: g,
12
+ name: Y,
13
+ minDate: D,
14
+ variant: M,
15
+ size: H = "small",
16
+ minuteStep: m = 30,
17
+ pattern: S = "##:##:##",
18
+ onChange: c
19
+ }) => {
20
+ const r = $(), [o, p] = T(h(g)), v = y(() => {
21
+ let t = [];
22
+ for (let n = 0; n < 24; n++)
23
+ for (let i = 0; i < 60 / m; i++) {
24
+ const a = f.padStart(n.toString(), 2, "0"), s = f.padStart(
25
+ (i * m).toString(),
26
+ 2,
27
+ "0"
28
+ ), k = `${a}:${s}`;
29
+ t.push(k);
30
+ }
31
+ return t;
32
+ }, [m]), x = (t) => {
33
+ t && (p(t), c(t.format("YYYY-MM-DDTHH:mm:ssZ")));
34
+ }, u = (t) => {
35
+ const [n, i, a] = t.target.value.split(":");
36
+ let s = h(o).set("hour", n ?? 0).set("m", i ?? 0).set("s", a ?? 0);
37
+ p(s), c(s.format("YYYY-MM-DDTHH:mm:ssZ"));
38
+ }, C = (t) => () => {
39
+ u({
40
+ target: {
41
+ value: t
42
+ }
43
+ }), r.action.close();
44
+ };
45
+ return /* @__PURE__ */ l(w, { children: [
46
+ /* @__PURE__ */ l(d, { direction: "row", spacing: 2, children: [
47
+ /* @__PURE__ */ e(
48
+ B,
49
+ {
50
+ value: o,
51
+ format: "DD/MM/YYYY",
52
+ minDate: D,
53
+ onChange: x,
54
+ slotProps: {
55
+ textField: {
56
+ variant: M,
57
+ size: H
58
+ }
59
+ }
60
+ }
61
+ ),
62
+ /* @__PURE__ */ l(d, { direction: "row", position: "relative", children: [
63
+ /* @__PURE__ */ e(
64
+ I,
65
+ {
66
+ format: S,
67
+ allowEmptyFormatting: !0,
68
+ value: o == null ? void 0 : o.format("HH:mm:ss"),
69
+ onChange: u,
70
+ style: {
71
+ border: 0,
72
+ borderBottom: "1px solid #333",
73
+ fontSize: 16,
74
+ width: 120
75
+ }
76
+ }
77
+ ),
78
+ /* @__PURE__ */ e(
79
+ F,
80
+ {
81
+ onClick: r.action.open,
82
+ sx: { position: "absolute", top: -4, right: 0 },
83
+ children: /* @__PURE__ */ e(Z, {})
84
+ }
85
+ )
86
+ ] })
87
+ ] }),
88
+ /* @__PURE__ */ e(
89
+ P,
90
+ {
91
+ id: "time-menu",
92
+ anchorEl: r.state.anchorEl,
93
+ open: r.state.isOpen,
94
+ onClose: r.action.close,
95
+ children: v.map((t) => /* @__PURE__ */ e(E, { onClick: C(t), children: t }, t))
96
+ }
97
+ ),
98
+ /* @__PURE__ */ e("input", { type: "hidden", name: Y, value: (o == null ? void 0 : o.format()) ?? "" })
99
+ ] });
100
+ };
101
+ export {
102
+ K as DateTimePicker
103
+ };
@@ -0,0 +1,93 @@
1
+ import { jsxs as l, Fragment as p, jsx as o } from "react/jsx-runtime";
2
+ import { Button as a, Box as f } from "@mui/material";
3
+ import u from "../map/index.js";
4
+ import C from "../parser/index.js";
5
+ import { g as y, c as g } from "../../../ol-DXmSLlWv.js";
6
+ import { useState as h } from "react";
7
+ import { Add as P } from "@mui/icons-material";
8
+ import { parse as v, convert as x } from "../../map/helpers/wkt.js";
9
+ import T from "lodash";
10
+ function M({
11
+ mapboxAccessToken: d,
12
+ value: c = "POINT(0 0)",
13
+ defaultExtent: r,
14
+ onCancel: m,
15
+ onSubmit: s
16
+ }) {
17
+ const [t, n] = h(
18
+ r ? y(r) : c
19
+ );
20
+ return /* @__PURE__ */ l(p, { children: [
21
+ /* @__PURE__ */ o(
22
+ u,
23
+ {
24
+ id: "add-coordinate",
25
+ mapboxAccessToken: d,
26
+ drawingWKTData: t,
27
+ disableContextMenu: !0,
28
+ defaultExtent: r,
29
+ onDrawEnd: (e) => {
30
+ const i = g({ features: e });
31
+ n(i);
32
+ }
33
+ }
34
+ ),
35
+ /* @__PURE__ */ o(C, { value: t, onChange: (e) => {
36
+ n(e);
37
+ } }),
38
+ /* @__PURE__ */ o(
39
+ a,
40
+ {
41
+ startIcon: /* @__PURE__ */ o(P, {}),
42
+ fullWidth: !0,
43
+ sx: { textTransform: "none", mt: 1 },
44
+ onClick: () => {
45
+ let e = v(t);
46
+ if (T.isArray(e))
47
+ e = {
48
+ type: "GeometryCollection",
49
+ geometries: [
50
+ ...e,
51
+ {
52
+ type: "Point",
53
+ coordinates: [0, 0]
54
+ }
55
+ ]
56
+ };
57
+ else if (e.type === "Point")
58
+ e = {
59
+ type: "GeometryCollection",
60
+ geometries: [
61
+ e,
62
+ {
63
+ type: "Point",
64
+ coordinates: [0, 0]
65
+ }
66
+ ]
67
+ };
68
+ else if (e.type === "GeometryCollection")
69
+ e.geometries.push({
70
+ type: "Point",
71
+ coordinates: [0, 0]
72
+ });
73
+ else {
74
+ console.log("undefined value geojson type!");
75
+ return;
76
+ }
77
+ const i = x(e);
78
+ n(i);
79
+ },
80
+ children: "Add Coordinate"
81
+ }
82
+ ),
83
+ /* @__PURE__ */ l(f, { display: "flex", justifyContent: "space-between", mt: 3, children: [
84
+ /* @__PURE__ */ o(a, { color: "primary", onClick: m, children: "Cancel" }),
85
+ /* @__PURE__ */ o(a, { color: "primary", variant: "contained", onClick: () => {
86
+ s && s(t);
87
+ }, children: "Ok" })
88
+ ] })
89
+ ] });
90
+ }
91
+ export {
92
+ M as default
93
+ };
@@ -0,0 +1,71 @@
1
+ import { jsxs as a, jsx as e, Fragment as x } from "react/jsx-runtime";
2
+ import E, { useState as F, useEffect as T } from "react";
3
+ import { Dialog as w, DialogContent as K, DialogActions as j, Button as c, Box as O } from "@mui/material";
4
+ import C from "../map/index.js";
5
+ import { c as P, a as R } from "../../../ol-DXmSLlWv.js";
6
+ import { parse as S } from "../../map/helpers/wkt.js";
7
+ import _ from "lodash";
8
+ import { t as B } from "../../../Source-CnCcu5UP.js";
9
+ function z({
10
+ value: g,
11
+ disableActions: y,
12
+ mapboxAccessToken: s,
13
+ variant: D = "inline",
14
+ mapId: f,
15
+ onCancel: l,
16
+ onSubmit: u,
17
+ onChange: d
18
+ }) {
19
+ const r = E.useRef(null), [t, W] = F(g), m = () => {
20
+ u && u(t);
21
+ }, p = (n) => {
22
+ const o = P({ features: n });
23
+ W(o), d && d(o);
24
+ }, k = () => {
25
+ var o, h, v;
26
+ const n = S(t);
27
+ if (!_.isArray(n))
28
+ if (n.type === "Point") {
29
+ const i = B(n.coordinates, "EPSG:4326", "EPSG:3857");
30
+ (o = r.current) == null || o.setCenter(i), (h = r.current) == null || h.setZoomLevel(10);
31
+ } else {
32
+ const i = R(t);
33
+ i && ((v = r.current) == null || v.centerToFeature(i[0], [100, 100, 100, 100]));
34
+ }
35
+ };
36
+ return T(() => (k(), () => {
37
+ }), []), D === "dialog" ? /* @__PURE__ */ a(w, { open: !0, maxWidth: "sm", fullWidth: !0, onClose: l, children: [
38
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
39
+ C,
40
+ {
41
+ id: f,
42
+ ref: r,
43
+ drawingWKTData: t,
44
+ mapboxAccessToken: s,
45
+ onDrawEnd: p
46
+ }
47
+ ) }),
48
+ /* @__PURE__ */ a(j, { children: [
49
+ /* @__PURE__ */ e(c, { color: "inherit", variant: "contained", onClick: l, children: "Cancel" }),
50
+ /* @__PURE__ */ e(c, { variant: "contained", onClick: m, children: "Ok" })
51
+ ] })
52
+ ] }) : /* @__PURE__ */ a(x, { children: [
53
+ /* @__PURE__ */ e(
54
+ C,
55
+ {
56
+ id: f,
57
+ ref: r,
58
+ drawingWKTData: t,
59
+ mapboxAccessToken: s,
60
+ onDrawEnd: p
61
+ }
62
+ ),
63
+ !y && /* @__PURE__ */ a(O, { display: "flex", justifyContent: "space-between", mt: 3, children: [
64
+ /* @__PURE__ */ e(c, { color: "primary", onClick: l, children: "Cancel" }),
65
+ /* @__PURE__ */ e(c, { color: "primary", variant: "contained", onClick: m, children: "Ok" })
66
+ ] })
67
+ ] });
68
+ }
69
+ export {
70
+ z as default
71
+ };
@@ -0,0 +1,160 @@
1
+ import { jsxs as r, jsx as n, Fragment as M } from "react/jsx-runtime";
2
+ import D, { useState as k } from "react";
3
+ import { Dialog as R, DialogContent as K, Box as t, Typography as x, DialogActions as F, Button as d } from "@mui/material";
4
+ import P from "../map/index.js";
5
+ import b from "../parser/index.js";
6
+ import { c as _ } from "../../../ol-DXmSLlWv.js";
7
+ import { Button as l } from "../styled.js";
8
+ import { HorizontalRule as j, ShowChart as O, CircleOutlined as I } from "@mui/icons-material";
9
+ import L from "./map-overlay.js";
10
+ function N({
11
+ mapId: u,
12
+ mapboxAccessToken: p,
13
+ value: S,
14
+ disableActions: T = !1,
15
+ variant: W = "inline",
16
+ defaultExtent: C,
17
+ onCancel: s,
18
+ onSubmit: m,
19
+ onChange: v
20
+ }) {
21
+ const h = D.useRef(null), [i, f] = k(S), [e, B] = k(), y = () => {
22
+ m && i && m(i);
23
+ }, g = (o) => {
24
+ if (o.length > 0) {
25
+ const c = _({ features: o });
26
+ f(c);
27
+ } else f(void 0);
28
+ }, w = (o) => {
29
+ f(o);
30
+ }, a = (o) => () => {
31
+ var c;
32
+ B(o), (c = h.current) == null || c.addInteractions(o);
33
+ };
34
+ return D.useEffect(() => (i !== void 0 && v !== void 0 && v(i), () => {
35
+ }), [i]), W === "dialog" ? /* @__PURE__ */ r(R, { open: !0, maxWidth: "sm", fullWidth: !0, onClose: s, children: [
36
+ /* @__PURE__ */ r(K, { children: [
37
+ /* @__PURE__ */ r(t, { display: "flex", justifyContent: "space-between", children: [
38
+ /* @__PURE__ */ n(x, { variant: "subtitle2", children: "Draw On Map" }),
39
+ /* @__PURE__ */ r(t, { display: "flex", justifyContent: "flex-end", mb: 1, children: [
40
+ /* @__PURE__ */ n(
41
+ l,
42
+ {
43
+ color: "inherit",
44
+ startIcon: /* @__PURE__ */ n(j, {}),
45
+ onClick: a("LineString"),
46
+ ...e === "LineString" && { variant: "contained" },
47
+ children: "Draw Line"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ n(
51
+ l,
52
+ {
53
+ color: "inherit",
54
+ startIcon: /* @__PURE__ */ n(O, {}),
55
+ onClick: a("Polygon"),
56
+ ...e === "Polygon" && { variant: "contained" },
57
+ children: "Draw Polygon"
58
+ }
59
+ ),
60
+ /* @__PURE__ */ n(
61
+ l,
62
+ {
63
+ color: "inherit",
64
+ startIcon: /* @__PURE__ */ n(I, {}),
65
+ onClick: a("Circle"),
66
+ ...e === "Circle" && { variant: "contained" },
67
+ children: "Draw Circle"
68
+ }
69
+ )
70
+ ] })
71
+ ] }),
72
+ /* @__PURE__ */ r(t, { position: "relative", children: [
73
+ /* @__PURE__ */ n(
74
+ P,
75
+ {
76
+ id: u,
77
+ ref: h,
78
+ mapboxAccessToken: p,
79
+ drawingWKTData: i,
80
+ defaultExtent: C,
81
+ onDrawEnd: g
82
+ }
83
+ ),
84
+ /* @__PURE__ */ n(L, { show: e === void 0 })
85
+ ] }),
86
+ i !== void 0 && /* @__PURE__ */ n(b, { value: i, onChange: w })
87
+ ] }),
88
+ /* @__PURE__ */ r(F, { children: [
89
+ /* @__PURE__ */ n(d, { color: "inherit", variant: "contained", onClick: s, children: "Cancel" }),
90
+ /* @__PURE__ */ n(d, { variant: "contained", onClick: y, children: "Ok" })
91
+ ] })
92
+ ] }) : /* @__PURE__ */ r(M, { children: [
93
+ /* @__PURE__ */ r(t, { display: "flex", justifyContent: "space-between", children: [
94
+ /* @__PURE__ */ n(x, { variant: "subtitle2", children: "Draw On Map" }),
95
+ /* @__PURE__ */ r(t, { display: "flex", justifyContent: "flex-end", mb: 1, children: [
96
+ /* @__PURE__ */ n(
97
+ l,
98
+ {
99
+ color: "inherit",
100
+ startIcon: /* @__PURE__ */ n(j, {}),
101
+ onClick: a("LineString"),
102
+ ...e === "LineString" && { variant: "contained" },
103
+ children: "Draw Line"
104
+ }
105
+ ),
106
+ /* @__PURE__ */ n(
107
+ l,
108
+ {
109
+ color: "inherit",
110
+ startIcon: /* @__PURE__ */ n(O, {}),
111
+ onClick: a("Polygon"),
112
+ ...e === "Polygon" && { variant: "contained" },
113
+ children: "Draw Polygon"
114
+ }
115
+ ),
116
+ /* @__PURE__ */ n(
117
+ l,
118
+ {
119
+ color: "inherit",
120
+ startIcon: /* @__PURE__ */ n(I, {}),
121
+ onClick: a("Circle"),
122
+ ...e === "Circle" && { variant: "contained" },
123
+ children: "Draw Circle"
124
+ }
125
+ )
126
+ ] })
127
+ ] }),
128
+ /* @__PURE__ */ r(t, { position: "relative", children: [
129
+ /* @__PURE__ */ n(
130
+ P,
131
+ {
132
+ id: u,
133
+ ref: h,
134
+ mapboxAccessToken: p,
135
+ drawingWKTData: i,
136
+ defaultExtent: C,
137
+ onDrawEnd: g
138
+ }
139
+ ),
140
+ /* @__PURE__ */ n(L, { show: e === void 0 })
141
+ ] }),
142
+ i !== void 0 && /* @__PURE__ */ n(b, { value: i, onChange: w }),
143
+ !T && /* @__PURE__ */ r(t, { display: "flex", justifyContent: "space-between", mt: 3, children: [
144
+ /* @__PURE__ */ n(d, { color: "primary", onClick: s, children: "Cancel" }),
145
+ /* @__PURE__ */ n(
146
+ d,
147
+ {
148
+ color: "primary",
149
+ variant: "contained",
150
+ onClick: y,
151
+ disabled: i === void 0,
152
+ children: "Ok"
153
+ }
154
+ )
155
+ ] })
156
+ ] });
157
+ }
158
+ export {
159
+ N as default
160
+ };
@@ -0,0 +1,22 @@
1
+ import { jsx as t, Fragment as o, jsxs as a } from "react/jsx-runtime";
2
+ import { Box as e, Typography as i } from "@mui/material";
3
+ const n = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='544.605'%20height='568.76'%20viewBox='0%200%20544.605%20568.76'%3e%3cg%20id='Group_160607'%20data-name='Group%20160607'%20transform='translate(-1185.395%20-688.133)'%3e%3cpath%20id='Polygon_2'%20data-name='Polygon%202'%20d='M34.5,0,69,59H0Z'%20transform='translate(1661%20688.133)'%20fill='%23fff'/%3e%3cpath%20id='Path_84395'%20data-name='Path%2084395'%20d='M914.667,851.733s-51.2-206.933,182.4-264.533,308.266-52.267,317.867-145.067,0-121.6,0-121.6'%20transform='translate(278%20402.133)'%20fill='none'%20stroke='%23fff'%20stroke-linecap='round'%20stroke-width='5'/%3e%3c/g%3e%3c/svg%3e";
4
+ function d({ show: r }) {
5
+ return r ? /* @__PURE__ */ a(e, { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, children: [
6
+ /* @__PURE__ */ t(
7
+ e,
8
+ {
9
+ display: "flex",
10
+ height: "100%",
11
+ justifyContent: "center",
12
+ alignItems: "center",
13
+ sx: { backgroundColor: "rgba(0,0,0,0.85)" },
14
+ children: /* @__PURE__ */ t(i, { color: "white", children: "Select drawing type to start drawing" })
15
+ }
16
+ ),
17
+ /* @__PURE__ */ t(e, { position: "absolute", top: 10, right: 0, width: "50%", children: /* @__PURE__ */ t("img", { src: n, width: "75%", height: 220 }) })
18
+ ] }) : /* @__PURE__ */ t(o, {});
19
+ }
20
+ export {
21
+ d as default
22
+ };
@@ -0,0 +1,140 @@
1
+ import { jsxs as i, Fragment as m, jsx as o } from "react/jsx-runtime";
2
+ import { AddLocationOutlined as u, DrawOutlined as C, LayersOutlined as a, EditOutlined as f, DeleteOutline as D } from "@mui/icons-material";
3
+ import { Container as I, Actions as A, Button as l } from "./styled.js";
4
+ import S from "./logic.js";
5
+ import k from "./coordinate/index.js";
6
+ import O from "./edit/index.js";
7
+ import y from "./geometry/index.js";
8
+ import b from "./kml/index.js";
9
+ import g from "./wkt/index.js";
10
+ import { IconButton as s, Dialog as E, DialogTitle as W, DialogContent as K } from "@mui/material";
11
+ import { F as L, I as z, a as G } from "../../FormControl-BiAFm76F.js";
12
+ import { I as w } from "../../Input-Bf5G3tFN.js";
13
+ const J = ({
14
+ label: c,
15
+ mapboxAccessToken: r,
16
+ value: e = "",
17
+ disableAddCoordinate: p = !1,
18
+ defaultExtent: d,
19
+ onChange: h
20
+ }) => {
21
+ const { state: t, action: n } = S({
22
+ label: c,
23
+ value: e,
24
+ mapboxAccessToken: r,
25
+ onChange: h
26
+ });
27
+ return /* @__PURE__ */ i(m, { children: [
28
+ /* @__PURE__ */ i(I, { children: [
29
+ /* @__PURE__ */ i(A, { children: [
30
+ p === !1 && /* @__PURE__ */ o(
31
+ l,
32
+ {
33
+ color: "inherit",
34
+ startIcon: /* @__PURE__ */ o(u, {}),
35
+ onClick: n.onAddCoordinate,
36
+ children: "Add Coordinate"
37
+ }
38
+ ),
39
+ /* @__PURE__ */ o(
40
+ l,
41
+ {
42
+ color: "inherit",
43
+ startIcon: /* @__PURE__ */ o(C, {}),
44
+ onClick: n.onDraw,
45
+ children: "Draw"
46
+ }
47
+ ),
48
+ /* @__PURE__ */ o(
49
+ l,
50
+ {
51
+ color: "inherit",
52
+ startIcon: /* @__PURE__ */ o(a, {}),
53
+ onClick: n.onAddKml,
54
+ children: "Add KML"
55
+ }
56
+ ),
57
+ /* @__PURE__ */ o(
58
+ l,
59
+ {
60
+ color: "inherit",
61
+ startIcon: /* @__PURE__ */ o(a, {}),
62
+ onClick: n.onAddWkt,
63
+ children: "Add WKT"
64
+ }
65
+ )
66
+ ] }),
67
+ /* @__PURE__ */ i(
68
+ L,
69
+ {
70
+ fullWidth: !0,
71
+ variant: "standard",
72
+ contentEditable: !1,
73
+ onClick: n.onClick,
74
+ children: [
75
+ /* @__PURE__ */ o(z, { shrink: !0, children: c }),
76
+ /* @__PURE__ */ o(
77
+ w,
78
+ {
79
+ value: e,
80
+ readOnly: !0,
81
+ endAdornment: /* @__PURE__ */ o(G, { position: "end", children: e !== "" && /* @__PURE__ */ i(m, { children: [
82
+ /* @__PURE__ */ o(s, { size: "small", onClick: n.onEdit, children: /* @__PURE__ */ o(f, { fontSize: "small" }) }),
83
+ /* @__PURE__ */ o(s, { size: "small", onClick: n.onDelete, children: /* @__PURE__ */ o(D, { fontSize: "small" }) })
84
+ ] }) })
85
+ }
86
+ )
87
+ ]
88
+ }
89
+ )
90
+ ] }),
91
+ /* @__PURE__ */ i(
92
+ E,
93
+ {
94
+ open: t.modal.isOpen,
95
+ onClose: n.modal.close,
96
+ fullWidth: !0,
97
+ maxWidth: "md",
98
+ children: [
99
+ /* @__PURE__ */ o(W, { children: t.content.title }),
100
+ /* @__PURE__ */ i(K, { children: [
101
+ t.content.action === "ADD" && t.content.type === "COORDINATE" && /* @__PURE__ */ o(
102
+ k,
103
+ {
104
+ mapboxAccessToken: r,
105
+ defaultExtent: d,
106
+ onCancel: n.modal.close,
107
+ onSubmit: n.onSubmit
108
+ }
109
+ ),
110
+ t.content.action === "ADD" && t.content.type === "GEOMETRY" && /* @__PURE__ */ o(
111
+ y,
112
+ {
113
+ mapId: "map-geo-picker-001",
114
+ mapboxAccessToken: r,
115
+ defaultExtent: d,
116
+ onCancel: n.modal.close,
117
+ onSubmit: n.onSubmit
118
+ }
119
+ ),
120
+ t.content.action === "ADD" && t.content.type === "KML" && /* @__PURE__ */ o(b, { onCancel: n.modal.close, onSubmit: n.onSubmit }),
121
+ t.content.action === "ADD" && t.content.type === "WKT" && /* @__PURE__ */ o(g, { onCancel: n.modal.close, onSubmit: n.onSubmit }),
122
+ t.content.action === "EDIT" && !!e && /* @__PURE__ */ o(
123
+ O,
124
+ {
125
+ mapId: "map-geo-edit-001",
126
+ value: e,
127
+ mapboxAccessToken: r,
128
+ onCancel: n.modal.close,
129
+ onSubmit: n.onSubmit
130
+ }
131
+ )
132
+ ] })
133
+ ]
134
+ }
135
+ )
136
+ ] });
137
+ };
138
+ export {
139
+ J as GeometryPicker
140
+ };