@hybridcore/ui 1.0.2 → 1.1.0

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 (103) hide show
  1. package/dist/Button-BZR43NHz.js +2025 -0
  2. package/dist/ButtonBase-B6WYZgVU.js +967 -0
  3. package/dist/CardContent-C8PxkJz4.js +73 -0
  4. package/dist/Checkbox-CxbQ9tJ5.js +673 -0
  5. package/dist/FormControl-C4PmH1vh.js +1491 -0
  6. package/dist/IconButton-CKHPuOyh.js +183 -0
  7. package/dist/Input-CH_JyT5B.js +324 -0
  8. package/dist/List-BX_5LP1i.js +132 -0
  9. package/dist/Object-DBPgar-D.js +688 -0
  10. package/dist/OutlinedInput-gnp48tDo.js +452 -0
  11. package/dist/Paper-CaiWdndQ.js +162 -0
  12. package/dist/Select-DOyHt8I_.js +2526 -0
  13. package/dist/Source-Bo1Eq6y-.js +4374 -0
  14. package/dist/Text-DVP2PrYM.js +2192 -0
  15. package/dist/Typography-XIiVCSto.js +178 -0
  16. package/dist/assertThisInitialized-BUtkG-md.js +13 -0
  17. package/dist/assets/index.css +1 -0
  18. package/dist/assets/index2.css +1 -0
  19. package/dist/chainPropTypes-DtBfUj5o.js +96 -0
  20. package/dist/components/access/helpers.js +32 -0
  21. package/dist/components/access/index.js +15 -0
  22. package/dist/components/card/index.js +159 -469
  23. package/dist/components/card/styled.js +75 -7
  24. package/dist/components/conditional-wrapper/index.js +9 -0
  25. package/dist/components/confirm/dialog.js +151 -0
  26. package/dist/components/confirm/index.js +23 -0
  27. package/dist/components/container/index.js +270 -0
  28. package/dist/components/context-menu/index.js +973 -0
  29. package/dist/components/data-management/instance-form/components/composite-list/index.js +12 -0
  30. package/dist/components/data-management/instance-form/components/composite-list/styled.js +64 -0
  31. package/dist/components/data-management/instance-form/components/policy-list/index.js +86 -0
  32. package/dist/components/data-management/instance-form/components/variable/index.js +15 -0
  33. package/dist/components/data-management/instance-form/components/variables/index.js +39 -0
  34. package/dist/components/data-management/instance-form/index.js +437 -0
  35. package/dist/components/data-security-selectors/dissemination-list/index.js +3201 -0
  36. package/dist/components/data-security-selectors/security-level/index.js +81 -0
  37. package/dist/components/date-time-picker/index.js +103 -0
  38. package/dist/components/geometry-picker/coordinate/index.js +93 -0
  39. package/dist/components/geometry-picker/edit/index.js +71 -0
  40. package/dist/components/geometry-picker/geometry/index.js +160 -0
  41. package/dist/components/geometry-picker/geometry/map-overlay.js +22 -0
  42. package/dist/components/geometry-picker/index.js +140 -0
  43. package/dist/components/geometry-picker/kml/index.js +62 -0
  44. package/dist/components/geometry-picker/kml/select-input-method.js +75 -0
  45. package/dist/components/geometry-picker/logic.js +69 -0
  46. package/dist/components/geometry-picker/map/index.js +42 -0
  47. package/dist/components/geometry-picker/map/logic.js +2360 -0
  48. package/dist/components/geometry-picker/map/style.js +88 -0
  49. package/dist/components/geometry-picker/parser/coordinate-input/index.js +78 -0
  50. package/dist/components/geometry-picker/parser/coordinate-input/logic.js +1305 -0
  51. package/dist/components/geometry-picker/parser/index.js +179 -0
  52. package/dist/components/geometry-picker/parser/logic.js +84 -0
  53. package/dist/components/geometry-picker/parser/styled.js +25 -0
  54. package/dist/components/geometry-picker/styled.js +48 -0
  55. package/dist/components/geometry-picker/wkt/index.js +59 -0
  56. package/dist/components/geometry-picker/wkt/select-input-method.js +75 -0
  57. package/dist/components/icon-button/index.js +18 -0
  58. package/dist/components/icon-button/styled.js +51 -0
  59. package/dist/components/key-protection/index.js +4 -0
  60. package/dist/components/key-protection/menu.js +85 -0
  61. package/dist/components/key-protection/utils.js +10 -0
  62. package/dist/components/loading/index.js +7 -0
  63. package/dist/components/loading/styled.js +16 -0
  64. package/dist/components/map/helpers/kml.js +45 -0
  65. package/dist/components/map/helpers/mapbox.js +48 -0
  66. package/dist/components/map/helpers/ol.js +25 -0
  67. package/dist/components/map/helpers/wkt.js +29 -0
  68. package/dist/components/map/index.js +30 -0
  69. package/dist/components/map/logic.js +140 -0
  70. package/dist/components/map/styled.js +8 -0
  71. package/dist/components/phone-input/index.js +25 -0
  72. package/dist/components/phone-input/styled.js +26 -0
  73. package/dist/components/search-input/index.js +76 -0
  74. package/dist/components/tree-select/index.js +70 -0
  75. package/dist/components/tree-select/styled.js +64 -0
  76. package/dist/components/treeview-filter/index.js +621 -0
  77. package/dist/components/treeview-filter/item/index.js +7 -0
  78. package/dist/components/treeview-filter/item-label/index.js +44 -0
  79. package/dist/createTheme-agWfFD64.js +2392 -0
  80. package/dist/exactProp-CI8dagM-.js +36 -0
  81. package/dist/extends-C3382pL0.js +22 -0
  82. package/dist/hooks/useMenuLogic.js +21 -0
  83. package/dist/hooks/useToggle.js +23 -0
  84. package/dist/index-BQE8B4sc.js +957 -0
  85. package/dist/index-DHFb1Qpn.js +1105 -0
  86. package/dist/isHostComponent-kiaBvYVo.js +6 -0
  87. package/dist/isMuiElement-CxT3_ACP.js +13 -0
  88. package/dist/main.d.ts +646 -0
  89. package/dist/ol-CMEkXXLJ.js +15041 -0
  90. package/dist/ownerDocument-CUrv0DIK.js +6 -0
  91. package/dist/ownerWindow-niciwP7I.js +7 -0
  92. package/dist/styled-B22KrhDR.js +229 -0
  93. package/dist/styled-Iq9jsO4F.js +1033 -0
  94. package/dist/useFormControl-CatNKXAi.js +10 -0
  95. package/dist/useId-BHG98T5I.js +26 -0
  96. package/dist/useTheme-C0Dky5rV.js +17 -0
  97. package/dist/useTheme-CeyGVuQP.js +10 -0
  98. package/dist/useThemeProps-CzAjOL6F.js +26 -0
  99. package/dist/utils/ontology.js +37 -0
  100. package/dist/utils-Bq0ye5vf.js +115 -0
  101. package/dist/utils-C13eMoWa.js +365 -0
  102. package/package.json +26 -5
  103. package/dist/styled-BG5UIpPU.js +0 -3459
@@ -0,0 +1,45 @@
1
+ import n from "lodash";
2
+ import * as s from "@turf/turf";
3
+ import { XMLParser as u, XMLValidator as d, XMLBuilder as f } from "fast-xml-parser";
4
+ const P = (t, r) => new u({
5
+ ignoreAttributes: !1,
6
+ ...r
7
+ }).parse(t), b = (t, r) => d.validate(t, {
8
+ allowBooleanAttributes: !0,
9
+ ...r
10
+ }), h = (t) => new f({
11
+ ignoreAttributes: !1
12
+ }).build({ kml: t }), y = (t, r) => {
13
+ let e = { ...t.kml };
14
+ return n.has(e, "Document") && (e = e.Document), n.has(e, "Folder") && (e = e.Folder), r && (r.forEach((o) => {
15
+ n.has(e, "Placemark") && (n.isArray(e.Placemark) ? e.Placemark.forEach((i) => {
16
+ n.has(i, o) && delete i[o];
17
+ }) : n.has(e.Placemark, o) && delete e.Placemark);
18
+ }), n.keys(e).length === 0) ? null : e;
19
+ }, p = (t) => {
20
+ let r = [0, 0];
21
+ return t.forEach((e) => {
22
+ if (e.Point) {
23
+ r = l(e.Point.coordinates);
24
+ return;
25
+ }
26
+ if (e.Polygon) {
27
+ const o = e.Polygon.outerBoundaryIs.LinearRing.coordinates.split(" ").map((a) => l(a)), i = s.polygon([o]);
28
+ r = s.centerOfMass(i).geometry.coordinates;
29
+ return;
30
+ }
31
+ if (e.LineString) {
32
+ const o = e.LineString.coordinates.split(" ").map((a) => l(a)), i = s.lineString(o);
33
+ r = s.centerOfMass(i).geometry.coordinates;
34
+ return;
35
+ }
36
+ }), r;
37
+ }, l = (t) => t.split(",").map((r) => Number(r));
38
+ export {
39
+ h as build,
40
+ p as findPlacemarkCoordinates,
41
+ y as getGeometries,
42
+ l as getNumberCoordinates,
43
+ P as parse,
44
+ b as validate
45
+ };
@@ -0,0 +1,48 @@
1
+ import n from "mapbox-gl";
2
+ import { L as b, a as y, S as u } from "../../../Source-Bo1Eq6y-.js";
3
+ const v = ({
4
+ id: r = "map",
5
+ center: s,
6
+ style: c,
7
+ accessToken: i
8
+ }) => {
9
+ n.accessToken = i;
10
+ const e = new n.Map({
11
+ style: c,
12
+ attributionControl: !1,
13
+ boxZoom: !1,
14
+ center: s,
15
+ container: r,
16
+ doubleClickZoom: !1,
17
+ dragPan: !1,
18
+ dragRotate: !1,
19
+ interactive: !1,
20
+ keyboard: !1,
21
+ pitchWithRotate: !1,
22
+ scrollZoom: !1,
23
+ touchZoomRotate: !1
24
+ }), o = new b({
25
+ render: function(l) {
26
+ const a = e.getCanvas(), t = l.viewState, m = o.getVisible();
27
+ a.style.display = m ? "block" : "none", a.style.position = "absolute";
28
+ const f = o.getOpacity();
29
+ a.style.opacity = String(f);
30
+ const p = t.rotation;
31
+ return e.jumpTo({
32
+ // @ts-ignore
33
+ center: y(t.center),
34
+ zoom: t.zoom - 1,
35
+ bearing: -p * 180 / Math.PI,
36
+ animate: !1
37
+ }), e._frame && (e._frame.cancel(), e._frame = null), e._render(), a;
38
+ },
39
+ source: new u({})
40
+ });
41
+ return {
42
+ map: e,
43
+ layer: o
44
+ };
45
+ };
46
+ export {
47
+ v as createMapboxLayer
48
+ };
@@ -0,0 +1,25 @@
1
+ import "lodash";
2
+ import "../../../Source-Bo1Eq6y-.js";
3
+ import { x as K, a as n, D as T, E as i, d as p, b as u, z as M, y as L, c as l, w as k, B as W, g as f, J as g, A as x, H as C } from "../../../ol-CMEkXXLJ.js";
4
+ import "ol";
5
+ import "./kml.js";
6
+ import "../../../styled-B22KrhDR.js";
7
+ import "./wkt.js";
8
+ import "../../../Text-DVP2PrYM.js";
9
+ export {
10
+ K as convertFeaturesToKML,
11
+ n as convertFeaturesToWKT,
12
+ T as createClusterFromKMLMarkers,
13
+ i as createClusterFromWKTMarkers,
14
+ p as createFeaturesFromKML,
15
+ u as createFeaturesFromWKT,
16
+ M as createKMLFeature,
17
+ L as createKMLPlacemark,
18
+ l as createMap,
19
+ k as createTileLayer,
20
+ W as findCenterOfKMLPolygon,
21
+ f as getWKTCenterOfExtent,
22
+ g as getWKTExtent,
23
+ x as kmlToIconFeatures,
24
+ C as wktToIconFeatures
25
+ };
@@ -0,0 +1,29 @@
1
+ import i from "terraformer-wkt-parser";
2
+ import * as o from "@turf/turf";
3
+ const l = (e) => {
4
+ if (e.includes("GEOMETRYCOLLECTION")) {
5
+ let t = e.replace("GEOMETRYCOLLECTION(", "");
6
+ t = t.slice(0, -1);
7
+ let n = t.split("),");
8
+ return n = n.filter((r) => r !== "").map((r, s) => (s < n.length - 1 && (r += ")"), r)), n.map((r) => i.parse(r));
9
+ }
10
+ return i.parse(e);
11
+ }, p = (e) => i.convert(e), u = (e) => {
12
+ let t = [0, 0];
13
+ if (e.type === "Point")
14
+ return t = e.coordinates, t;
15
+ if (e.type === "Polygon") {
16
+ const n = o.polygon(e.coordinates);
17
+ return t = o.centerOfMass(n).geometry.coordinates, t;
18
+ }
19
+ if (e.type === "LineString") {
20
+ const n = o.lineString(e.coordinates);
21
+ return t = o.centerOfMass(n).geometry.coordinates, t;
22
+ }
23
+ return e.type === "MultiPoint" ? (t = o.multiPoint(e.coordinates).geometry.coordinates[0], t) : (console.log("Undefined geometry type!", e.type), t);
24
+ };
25
+ export {
26
+ p as convert,
27
+ u as findCoordinate,
28
+ l as parse
29
+ };
@@ -0,0 +1,30 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import t from "react";
3
+ import f from "./logic.js";
4
+ import { M as i } from "../../styled-B22KrhDR.js";
5
+ import '../../assets/index2.css';const p = (o, n) => {
6
+ var e, a;
7
+ const { refs: s, action: m } = f(o);
8
+ return t.useImperativeHandle(n, () => m), /* @__PURE__ */ r(
9
+ i.Container,
10
+ {
11
+ sx: {
12
+ position: "relative",
13
+ cursor: ((e = o.options) == null ? void 0 : e.cursor) || "default"
14
+ },
15
+ children: /* @__PURE__ */ r(
16
+ i.Container,
17
+ {
18
+ id: o.id || "map",
19
+ ref: s.mapContainer,
20
+ cssPosition: (a = o.options) == null ? void 0 : a.cssPosition,
21
+ onContextMenu: (c) => c.preventDefault(),
22
+ className: "map"
23
+ }
24
+ )
25
+ }
26
+ );
27
+ }, x = t.memo(t.forwardRef(p));
28
+ export {
29
+ x as default
30
+ };
@@ -0,0 +1,140 @@
1
+ import u from "react";
2
+ import { c as _ } from "../../ol-CMEkXXLJ.js";
3
+ import { t as b } from "../../Source-Bo1Eq6y-.js";
4
+ function W({
5
+ id: s = "map",
6
+ layers: c = [],
7
+ center: { latitude: l = 0, longitude: g = 0 } = {},
8
+ zoom: m = 6,
9
+ options: n,
10
+ onInit: a
11
+ }) {
12
+ const t = u.useRef(null), d = u.useRef(null);
13
+ u.useEffect(() => {
14
+ let e = setTimeout(y, 50);
15
+ return () => {
16
+ e ? clearTimeout(e) : f();
17
+ };
18
+ }, []), u.useEffect(() => (c.length > 0 && t.current.setLayers(c), () => {
19
+ }), [c]);
20
+ const y = () => {
21
+ t.current === null && (t.current = _(
22
+ c,
23
+ {
24
+ latitude: l,
25
+ longitude: g
26
+ },
27
+ m,
28
+ s,
29
+ n == null ? void 0 : n.interactions,
30
+ n == null ? void 0 : n.controls
31
+ ), a && a());
32
+ }, f = () => {
33
+ t.current !== null && (t.current.setTarget(null), t.current = null);
34
+ }, v = (e) => {
35
+ t.current.addLayer(e);
36
+ }, L = (e) => {
37
+ t.current.addOverlay(e);
38
+ }, x = (e) => {
39
+ t.current.removeOverlay(e);
40
+ }, E = (e) => {
41
+ let r = t.current.getOverlayById(e);
42
+ t.current.removeOverlay(r);
43
+ }, z = (e, r) => {
44
+ t.current.getLayers().insertAt(e, r);
45
+ }, w = () => t.current.getAllLayers(), V = () => t.current.getLayerGroup(), p = () => t.current.getLayers(), C = () => t.current.getView().getZoom(), O = (e) => t.current.getView().setZoom(e), P = (e) => {
46
+ t.current.removeLayer(e);
47
+ }, S = (e) => {
48
+ t.current.setLayerGroup(e);
49
+ }, F = (e) => {
50
+ t.current.setLayers(e);
51
+ }, G = (e) => {
52
+ t.current.addInteraction(e);
53
+ }, I = (e) => {
54
+ t.current.removeInteraction(e);
55
+ }, A = (e, r) => {
56
+ t.current.on(e, r);
57
+ }, T = () => t.current.getView(), Z = (e) => t.current.getEventPixel(e), h = (e) => t.current.getEventCoordinate(e), B = () => {
58
+ let e = t.current.getView().calculateExtent();
59
+ return e = b(e, "EPSG:3857", "EPSG:4326"), {
60
+ bottomLeft: {
61
+ latitude: e[1],
62
+ longitude: e[0]
63
+ },
64
+ topRight: {
65
+ latitude: e[3],
66
+ longitude: e[2]
67
+ }
68
+ };
69
+ }, M = (e) => t.current.forEachFeatureAtPixel(
70
+ e,
71
+ function(r) {
72
+ return r;
73
+ }
74
+ ), i = (e, r = 12, o = [0, 0, 0, 0]) => {
75
+ t.current.getView().fit(e, {
76
+ minResolution: r,
77
+ padding: o
78
+ });
79
+ };
80
+ return {
81
+ refs: {
82
+ map: t,
83
+ mapContainer: d
84
+ },
85
+ action: {
86
+ addInteraction: G,
87
+ addLayer: v,
88
+ centerToExtent: i,
89
+ centerToFeature: (e, r = [0, 0, 0, 0]) => {
90
+ const o = e.getGeometry();
91
+ if (o) {
92
+ const R = o.getExtent();
93
+ i(R, 12, r);
94
+ }
95
+ },
96
+ forEachFeatureAtPixel: M,
97
+ getAllLayers: w,
98
+ getBoundingBox: B,
99
+ getCoordinateFromPixel: (e) => t.current.getCoordinateFromPixel(e),
100
+ getEventCoordinate: h,
101
+ getEventPixel: Z,
102
+ getLayerGroup: V,
103
+ getLayers: p,
104
+ getSize: () => t.current.getSize(),
105
+ getView: T,
106
+ getZoomLevel: C,
107
+ insertLayerAt: z,
108
+ on: A,
109
+ removeInteraction: I,
110
+ removeLayer: P,
111
+ setLayerGroup: S,
112
+ setLayers: F,
113
+ setCenter: (e) => {
114
+ t.current.getView().setCenter(e);
115
+ },
116
+ setZoomLevel: O,
117
+ addOverlay: L,
118
+ updateSize: () => {
119
+ t.current.updateSize();
120
+ },
121
+ zoomIn: () => {
122
+ t.current.getView().animate({
123
+ zoom: t.current.getView().getZoom() + 1,
124
+ duration: 250
125
+ });
126
+ },
127
+ zoomOut: () => {
128
+ t.current.getView().animate({
129
+ zoom: t.current.getView().getZoom() - 1,
130
+ duration: 250
131
+ });
132
+ },
133
+ removeOverlay: x,
134
+ removeOverlayById: E
135
+ }
136
+ };
137
+ }
138
+ export {
139
+ W as default
140
+ };
@@ -0,0 +1,8 @@
1
+ import "../../Text-DVP2PrYM.js";
2
+ import { M as l, d as s, a as d, b as o } from "../../styled-B22KrhDR.js";
3
+ export {
4
+ l as default,
5
+ s as defaultStyle,
6
+ d as selectStyleFunction,
7
+ o as selectedStyle
8
+ };
@@ -0,0 +1,25 @@
1
+ import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
+ import p from "react-phone-number-input";
3
+ import { Typography as i } from "@mui/material";
4
+ import { Container as a } from "./styled.js";
5
+ import '../../assets/index.css';const l = ({
6
+ label: r,
7
+ value: o,
8
+ placeholder: e,
9
+ onChange: t
10
+ }) => /* @__PURE__ */ m(a, { children: [
11
+ /* @__PURE__ */ n(i, { children: r }),
12
+ /* @__PURE__ */ n(
13
+ p,
14
+ {
15
+ value: o,
16
+ placeholder: e,
17
+ onChange: (h) => {
18
+ t(String(h));
19
+ }
20
+ }
21
+ )
22
+ ] });
23
+ export {
24
+ l as PhoneInput
25
+ };
@@ -0,0 +1,26 @@
1
+ import { styled as n, Box as t } from "@mui/material";
2
+ const i = n(t)(({ theme: o }) => ({
3
+ marginBottom: o.spacing(2),
4
+ "& input.PhoneInputInput": {
5
+ border: "none",
6
+ borderBottom: "1px solid",
7
+ borderColor: o.palette.grey[500],
8
+ paddingTop: o.spacing(1),
9
+ paddingBottom: o.spacing(1),
10
+ fontSize: 16,
11
+ "&:focus, &:focus-visible": {
12
+ boxShadow: "none",
13
+ outline: 0
14
+ }
15
+ },
16
+ "& .PhoneInputCountryIcon": {
17
+ width: 32,
18
+ height: 22
19
+ },
20
+ "& .PhoneInputCountryIcon--border": {
21
+ boxShadow: "none"
22
+ }
23
+ }));
24
+ export {
25
+ i as Container
26
+ };
@@ -0,0 +1,76 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import m, { useState as O } from "react";
3
+ import { Close as k, Search as w } from "@mui/icons-material";
4
+ import { F, I as R, a as _ } from "../../FormControl-C4PmH1vh.js";
5
+ import { O as j } from "../../OutlinedInput-gnp48tDo.js";
6
+ import { I as h } from "../../IconButton-CKHPuOyh.js";
7
+ const z = ({
8
+ defaultValue: f = "",
9
+ label: l = "Search",
10
+ placeholder: p,
11
+ disableLabel: s = !1,
12
+ fullWidth: u = !1,
13
+ iconSize: t = "medium",
14
+ sx: I,
15
+ onChange: i,
16
+ onSubmit: r
17
+ }, g) => {
18
+ const [a, o] = O(f), C = (n) => {
19
+ o(n.target.value), i && i(n.target.value);
20
+ }, d = (n) => {
21
+ r && r(a);
22
+ }, v = (n) => {
23
+ n.key === "Enter" && d();
24
+ }, x = () => {
25
+ o("");
26
+ };
27
+ m.useImperativeHandle(g, () => ({
28
+ reset() {
29
+ x();
30
+ }
31
+ }));
32
+ const y = () => {
33
+ o(""), r && r("");
34
+ };
35
+ return /* @__PURE__ */ c(F, { sx: I, size: "small", variant: "outlined", fullWidth: u, children: [
36
+ !s && /* @__PURE__ */ e(R, { htmlFor: "search-input", children: l }),
37
+ /* @__PURE__ */ e(
38
+ j,
39
+ {
40
+ id: "search-input",
41
+ type: "text",
42
+ label: s ? "" : l,
43
+ value: a,
44
+ placeholder: p,
45
+ onChange: C,
46
+ onKeyDown: v,
47
+ endAdornment: /* @__PURE__ */ c(_, { position: "end", children: [
48
+ a.length > 0 && /* @__PURE__ */ e(
49
+ h,
50
+ {
51
+ "aria-label": "search",
52
+ onClick: y,
53
+ edge: "end",
54
+ size: t,
55
+ color: "error",
56
+ children: /* @__PURE__ */ e(k, { fontSize: t })
57
+ }
58
+ ),
59
+ /* @__PURE__ */ e(
60
+ h,
61
+ {
62
+ "aria-label": "search",
63
+ onClick: d,
64
+ edge: "end",
65
+ size: t,
66
+ children: /* @__PURE__ */ e(w, { fontSize: t })
67
+ }
68
+ )
69
+ ] })
70
+ }
71
+ )
72
+ ] });
73
+ }, H = m.forwardRef(z);
74
+ export {
75
+ H as SearchInput
76
+ };
@@ -0,0 +1,70 @@
1
+ import { jsxs as p, Fragment as W, jsx as n } from "react/jsx-runtime";
2
+ import f from "react";
3
+ import { TreeViewFilter as _ } from "../treeview-filter/index.js";
4
+ import r from "lodash";
5
+ import { flattenNestedTemplates as b } from "../../utils/ontology.js";
6
+ import { F as A, I as E } from "../../FormControl-C4PmH1vh.js";
7
+ import { S as M, M as j } from "../../Select-DOyHt8I_.js";
8
+ import { D as B, a as k, b as w, B as L } from "../../Button-BZR43NHz.js";
9
+ const J = ({
10
+ data: h,
11
+ label: s,
12
+ selected: a,
13
+ disabled: x,
14
+ idKey: o = "id",
15
+ onChange: v
16
+ }) => {
17
+ const [C, u] = f.useState(!1), [S, m] = f.useState([]), d = b(h), l = f.useMemo(() => r.isArray(a) ? a.map(
18
+ (e) => d.find((t) => String(r.get(t, o)) === e)
19
+ ) : [], [a, d]), D = (e, t) => {
20
+ v(e, t);
21
+ }, I = () => {
22
+ u(!0), F();
23
+ }, g = () => {
24
+ u(!1);
25
+ }, T = (e, t) => {
26
+ m(t);
27
+ }, F = () => {
28
+ let e = [];
29
+ l.length > 0 && l.forEach((t) => {
30
+ const i = t == null ? void 0 : t.parentKeys, O = d.filter((c) => i == null ? void 0 : i.includes(c.templateKey)).map((c) => String(r.get(c, o)));
31
+ e.push(...O);
32
+ }), m(e);
33
+ };
34
+ return /* @__PURE__ */ p(W, { children: [
35
+ /* @__PURE__ */ p(A, { variant: "standard", fullWidth: !0, children: [
36
+ s !== void 0 && /* @__PURE__ */ n(E, { id: "select-label", children: s }),
37
+ /* @__PURE__ */ n(
38
+ M,
39
+ {
40
+ label: s,
41
+ variant: "standard",
42
+ id: "select",
43
+ labelId: "select-label",
44
+ value: a,
45
+ open: !1,
46
+ onOpen: I,
47
+ children: l.length > 0 && l.map((e, t) => /* @__PURE__ */ n(j, { value: r.get(e, o) ?? "", children: e == null ? void 0 : e.name }, t))
48
+ }
49
+ )
50
+ ] }),
51
+ /* @__PURE__ */ p(B, { open: C, onClose: g, fullWidth: !0, maxWidth: "sm", children: [
52
+ /* @__PURE__ */ n(k, { sx: { p: 1, pt: 2 }, children: /* @__PURE__ */ n(
53
+ _,
54
+ {
55
+ data: h,
56
+ selected: r.isArray(a) ? a : void 0,
57
+ disabled: x,
58
+ expanded: S,
59
+ idKey: o,
60
+ onToggle: T,
61
+ onChange: D
62
+ }
63
+ ) }),
64
+ /* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(L, { onClick: g, variant: "contained", fullWidth: !0, children: "OK" }) })
65
+ ] })
66
+ ] });
67
+ };
68
+ export {
69
+ J as TreeSelect
70
+ };
@@ -0,0 +1,64 @@
1
+ import { styled as t, Box as e } from "@mui/material";
2
+ import r from "react-dropdown-tree-select";
3
+ const a = t(r)(({ theme: o }) => ({
4
+ ".dropdown": {
5
+ display: "block",
6
+ ".dropdown-trigger": {
7
+ display: "block",
8
+ minHeight: 30,
9
+ border: "none",
10
+ padding: "4px 0px",
11
+ borderBottom: `1px solid ${o.palette.text.disabled}`,
12
+ transition: "all 0.3s",
13
+ ".placeholder": {
14
+ color: o.palette.text.disabled
15
+ },
16
+ "&::after": {
17
+ position: "absolute",
18
+ right: 0,
19
+ top: 5,
20
+ color: o.palette.text.primary
21
+ },
22
+ ".tag-list .tag-item:last-child": {
23
+ display: "none"
24
+ },
25
+ ".tag-item": {
26
+ margin: 0,
27
+ fontSize: "1rem",
28
+ ".tag": {
29
+ padding: 0,
30
+ backgroundColor: "transparent",
31
+ border: "none",
32
+ ".tag-remove": {
33
+ display: "none"
34
+ }
35
+ }
36
+ }
37
+ },
38
+ ".dropdown-content": {
39
+ position: "fixed",
40
+ width: "50%",
41
+ backgroundColor: o.palette.background.paper,
42
+ zIndex: 99999,
43
+ ".toggle": {
44
+ padding: "0px 5px",
45
+ fontStyle: "normal",
46
+ fontSize: "1rem"
47
+ },
48
+ ".search": {
49
+ padding: 10,
50
+ boxSizing: "border-box",
51
+ backgroundColor: o.palette.background.paper,
52
+ color: o.palette.text.primary
53
+ }
54
+ }
55
+ }
56
+ })), d = t(e)(({}) => ({
57
+ display: "flex"
58
+ })), i = {
59
+ Container: a,
60
+ Placeholder: d
61
+ };
62
+ export {
63
+ i as default
64
+ };