@m4l/components 1.0.0 → 1.0.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 (95) hide show
  1. package/components/AccountPopover/{index.efc74d5c.js → index.ec031003.js} +5 -3
  2. package/components/AppBar/{index.fc126a22.js → index.1499770b.js} +4 -4
  3. package/components/DragResizeWindow/{index.46b380e1.js → index.5e316291.js} +3 -3
  4. package/components/DynamicFilter/{index.d9168c12.js → index.05e15fb8.js} +28 -211
  5. package/components/FieldLabel/{index.f9cdcc27.js → index.400a46e0.js} +4 -4
  6. package/components/GridLayout/{index.bb3b7769.js → index.7156fbc9.js} +2 -2
  7. package/components/GridLayout/subcomponents/Griditem/{index.bb23f651.js → index.8946f18e.js} +4 -4
  8. package/components/GridLayout/subcomponents/Responsive/{index.b8a2a121.js → index.3c68f0cb.js} +2 -2
  9. package/components/GridLayout/subcomponents/SizeProvider/{index.094bc6b5.js → index.a5b2190d.js} +1 -1
  10. package/components/HamburgerMenu/{index.5997af31.js → index.d57bca4c.js} +3 -3
  11. package/components/HelperText/{index.be949cdf.js → index.651a9b4b.js} +1 -1
  12. package/components/Icon/index.2e8ec5a1.js +209 -0
  13. package/components/Image/index.0d32558e.js +168 -0
  14. package/components/LoadingError/{index.9f00c83c.js → index.d137be81.js} +5 -4
  15. package/components/MFLoader/{index.402c1acc.js → index.2038aa6c.js} +3 -3
  16. package/components/ModalDialog/{index.ea9189c3.js → index.85d30f10.js} +4 -4
  17. package/components/NavLink/{index.4e548cee.js → index.badec599.js} +2 -2
  18. package/components/NoItemSelected/{index.418c8316.js → index.008154ce.js} +2 -2
  19. package/components/ObjectLogs/{index.bfa7dad3.js → index.65a6b1bc.js} +8 -7
  20. package/components/PDFViewer/{index.bb2eca5a.js → index.9677b02a.js} +2 -2
  21. package/components/Page/index.7482cf60.js +98 -0
  22. package/components/PaperForm/{index.8121e3da.js → index.e04f9f1f.js} +2 -2
  23. package/components/Period/{index.5233694b.js → index.3d695534.js} +8 -103
  24. package/components/PrintingSystem/{index.fb176a93.js → index.89493ad6.js} +15 -14
  25. package/components/PrintingSystem/subcomponents/BodyNode/{index.c1d61038.js → index.fdd8cebb.js} +1 -1
  26. package/components/PrintingSystem/subcomponents/ChartNode/{index.18bd9bad.js → index.12293a60.js} +1 -1
  27. package/components/PrintingSystem/subcomponents/DividerNode/{index.67d9f1b4.js → index.7fdad1df.js} +1 -1
  28. package/components/PrintingSystem/subcomponents/FooterNode/{index.eaee152a.js → index.fcaf9b2f.js} +1 -1
  29. package/components/PrintingSystem/subcomponents/GridNode/{index.f5f63a2a.js → index.03148990.js} +1 -1
  30. package/components/PrintingSystem/subcomponents/HeaderNode/{index.7de4e411.js → index.691b5c38.js} +1 -1
  31. package/components/PrintingSystem/subcomponents/PaperNode/{index.f9ccf22b.js → index.3699b685.js} +1 -1
  32. package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.f2f2e903.js → index.bcc87da8.js} +1 -1
  33. package/components/PrintingSystem/subcomponents/SectionNode/{index.540a4b19.js → index.659f28e5.js} +1 -1
  34. package/components/PrintingSystem/subcomponents/TextBoxNode/{index.41e7fcb0.js → index.137ebb7a.js} +1 -1
  35. package/components/PropertyValue/{index.9572c347.js → index.e31d4282.js} +3 -3
  36. package/components/Resizeable/{index.1f0c1359.js → index.8c72e36a.js} +1 -1
  37. package/components/ScrollBar/{index.adf0eade.js → index.9bfcc74f.js} +1 -1
  38. package/components/SideBar/{index.629ba840.js → index.004a2de1.js} +7 -31
  39. package/components/SplitLayout/{index.74091a81.js → index.aed78a1f.js} +1 -1
  40. package/components/ToastContainer/{index.f9b507b9.js → index.586b1194.js} +3 -3
  41. package/components/areas/constants.630a4f42.js +293 -0
  42. package/components/areas/contexts/AreasContext/{index.bb316000.js → index.81b748ec.js} +4 -4
  43. package/components/areas/{dictionary.7e74022a.js → dictionary.19b25583.js} +26 -34
  44. package/components/areas/hooks/useAreas/{index.e24bd74d.js → index.b02d5bdc.js} +1 -1
  45. package/components/hook-form/HelperError/index.fd10c3ab.js +19 -0
  46. package/components/hook-form/RHFAutocompleteAsync/index.ea3ba7a7.js +160 -0
  47. package/components/hook-form/RHFCheckbox/index.9ac452cc.js +143 -0
  48. package/components/hook-form/RHFColorPicker/index.25e4e643.js +191 -0
  49. package/components/hook-form/RHFDateTime/index.31a0537d.js +190 -0
  50. package/components/hook-form/RHFMultiCheckbox/index.437e6ba3.js +34 -0
  51. package/components/hook-form/RHFPeriod/index.c8868100.js +105 -0
  52. package/components/hook-form/RHFRadioGroup/index.11c0add8.js +35 -0
  53. package/components/hook-form/RHFSelect/index.c6c60ecc.js +29 -0
  54. package/components/hook-form/RHFTextField/index.2ae1f130.js +326 -0
  55. package/components/{Image/index.36a3d440.js → hook-form/RHFUpload/index.9eeaee0f.js} +32 -232
  56. package/components/maps/components/GpsTools/index.ef751d28.js +251 -0
  57. package/components/maps/{index.8ec46ce4.js → index.ba1ccfad.js} +21 -555
  58. package/components/modal/{WindowBase.a3ac7adc.js → WindowBase.c1e879e4.js} +4 -3
  59. package/components/modal/{WindowConfirm.e35da619.js → WindowConfirm.1a123368.js} +6 -6
  60. package/components/modal/{index.a0e30c8b.js → index.7ca17f55.js} +1 -1
  61. package/components/mui_extended/Accordion/index.391679d1.js +143 -0
  62. package/components/mui_extended/Avatar/index.3ba36655.js +63 -0
  63. package/components/mui_extended/Badge/index.3465d7fb.js +31 -0
  64. package/components/mui_extended/BoxIcon/index.d61e7ac5.js +22 -0
  65. package/components/mui_extended/Breadcrumbs/index.4a44883c.js +87 -0
  66. package/components/mui_extended/Button/index.a7dc6ef0.js +289 -0
  67. package/components/mui_extended/CheckBox/index.c5c8721c.js +76 -0
  68. package/components/mui_extended/CircularProgress/index.967e70b7.js +8 -0
  69. package/components/mui_extended/IconButton/index.87f4726c.js +120 -0
  70. package/components/{LinearProgressIndeterminate/index.de9d447c.js → mui_extended/LinearProgress/index.52edc848.js} +11 -4
  71. package/components/mui_extended/LinkWithRoute/index.288c51f3.js +15 -0
  72. package/components/{Page/index.fdf04592.js → mui_extended/Pager/index.46aec921.js} +9 -98
  73. package/components/mui_extended/Popover/index.8e5ac765.js +1041 -0
  74. package/components/mui_extended/Stack/index.fe363ca5.js +31 -0
  75. package/components/{maps/components/GpsTools/index.75880ce0.js → mui_extended/Tab/index.ad88441e.js} +674 -239
  76. package/components/mui_extended/ToggleButton/index.38ca2330.js +18 -0
  77. package/components/mui_extended/ToggleIconButton/index.7fbece74.js +24 -0
  78. package/components/mui_extended/Tooltip/index.49bb5ee1.js +40 -0
  79. package/components/mui_extended/Typography/index.2a1c68f8.js +55 -0
  80. package/components/popups/PopupsProvider/{index.18669fb4.js → index.3b43e55f.js} +1 -1
  81. package/components/popups/PopupsViewer/{index.ba354267.js → index.fb3f0c48.js} +5 -4
  82. package/contexts/ModalContext/{index.cf02e6bd.js → index.82f61407.js} +1 -1
  83. package/contexts/RHFormContext/{index.dc955a09.js → index.e942a298.js} +1 -1
  84. package/hooks/useFormAddEdit/{index.f156a2cd.js → index.fa430551.js} +2 -2
  85. package/hooks/useModal/{index.ef54bcf2.js → index.9fe41bde.js} +3 -3
  86. package/index.js +266 -239
  87. package/package.json +1 -1
  88. package/{react-draggable.5331add7.js → react-draggable.2df3b71a.js} +1 -1
  89. package/{react-resizable.37bfb965.js → react-resizable.c60f3843.js} +2 -2
  90. package/utils/{index.9ee4c99a.js → index.0660ee9c.js} +9 -62
  91. package/{vendor.a1ce6777.js → vendor.3eadfa16.js} +746 -3011
  92. package/components/Icon/index.d5fed418.js +0 -420
  93. package/components/LanguagePopover/index.e6fa2336.js +0 -184
  94. package/components/areas/constants.5387d83e.js +0 -412
  95. package/hooks/useTab/index.bce8b99e.js +0 -12
@@ -1,26 +1,28 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
1
+ import React__default, { createContext, useRef, useEffect, useContext, useMemo, useState, useCallback } from "react";
2
2
  import { useMap, LayerGroup, MapContainer, Marker, Polyline, Circle, Polygon } from "react-leaflet";
3
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
4
  import { shallow } from "zustand/shallow";
4
- import React__default, { createContext, useRef, useEffect, useContext, useMemo, useState, useCallback } from "react";
5
5
  import * as L from "leaflet";
6
6
  import L__default from "leaflet";
7
7
  import { Loader } from "@googlemaps/js-api-loader";
8
8
  import { createPortal } from "react-dom";
9
- import { useModuleDictionary, useModuleSkeleton, useEnvironment, useModulePrivileges } from "@m4l/core";
9
+ import { useModuleDictionary, useModuleSkeleton, useEnvironment } from "@m4l/core";
10
10
  import clsx from "clsx";
11
11
  import { useFormContext, useWatch } from "react-hook-form";
12
- import { M as MAP_DICCTIONARY } from "../areas/dictionary.7e74022a.js";
13
- import { d as Actions, B as Button, c as RHFAutocompleteAsync, S as Stack, r as ColumnSetCheckFormatter, g as DataGrid, s as CheckBox, P as Popover } from "../../vendor.a1ce6777.js";
12
+ import { M as MAP_DICCTIONARY } from "../areas/dictionary.19b25583.js";
13
+ import { A as Actions } from "../../vendor.3eadfa16.js";
14
+ import { B as Button, Z as ZoomButtons } from "../mui_extended/Button/index.a7dc6ef0.js";
14
15
  import * as Yup from "yup";
15
- import { ao as COMPONENT_CLASS_NAME, ap as STYLE_MEASURE_OPTIONS, aq as MAP_ZINDEX_DEFAULT, ar as INITIAL_FORM_VALUES, as as GPS_TOOLS_POPUP_DEFAULT_POSITION, at as MESURE_POPUP_DEFAULT_POSITION, au as TIME_DOUBLE_CLICK, av as MARKER_COLOR_DEFAULT, L as LABEL_BK_COLOR_DEFAULT, u as LABEL_COLOR_DEFAULT, aw as SVG_ICON_DEFAULT } from "../areas/constants.5387d83e.js";
16
+ import { $ as COMPONENT_CLASS_NAME, a0 as STYLE_MEASURE_OPTIONS, a1 as MAP_ZINDEX_DEFAULT, a2 as INITIAL_FORM_VALUES, a3 as GPS_TOOLS_POPUP_DEFAULT_POSITION, a4 as MESURE_POPUP_DEFAULT_POSITION, a5 as TIME_DOUBLE_CLICK, a6 as MARKER_COLOR_DEFAULT, L as LABEL_BK_COLOR_DEFAULT, t as LABEL_COLOR_DEFAULT, a7 as SVG_ICON_DEFAULT } from "../areas/constants.630a4f42.js";
16
17
  import { u as useFormReadyForUpdate } from "../../hooks/useFormReadyForUpdate/index.f60f500e.js";
17
- import { R as RHFormProvider } from "../../contexts/RHFormContext/index.dc955a09.js";
18
+ import { R as RHFAutocompleteAsync } from "../hook-form/RHFAutocompleteAsync/index.ea3ba7a7.js";
19
+ import { S as Stack } from "../mui_extended/Stack/index.fe363ca5.js";
20
+ import { R as RHFormProvider } from "../../contexts/RHFormContext/index.e942a298.js";
18
21
  import { M as MAP_ICONS } from "../areas/icons.504ec098.js";
19
- import { a as IconButton, T as ToggleIconButton, I as Icon, M as MarkerIconLabel } from "../Icon/index.d5fed418.js";
20
- import { u as usePopupsStore, P as PopupsProvider } from "../popups/PopupsProvider/index.18669fb4.js";
21
- import { generateUtilityClasses, Tooltip, FormControl, RadioGroup, FormControlLabel, Radio, useTheme } from "@mui/material";
22
- import { u as useStateRef } from "../../hooks/useStateRef/index.538edb89.js";
23
- import { P as PopupsViewer } from "../popups/PopupsViewer/index.ba354267.js";
22
+ import { u as usePopupsStore, P as PopupsProvider } from "../popups/PopupsProvider/index.3b43e55f.js";
23
+ import { T as ToggleIconButton } from "../mui_extended/ToggleIconButton/index.7fbece74.js";
24
+ import { T as TILE_LAYER_OSM, c as TILE_LAYER_GOOGLE, d as TILE_LAYER_GOOGLE_SATELLITE, e as TILE_LAYER_GOOGLE_HYBRID, f as TILE_LAYER_BING, L as LayersButton } from "../mui_extended/Popover/index.8e5ac765.js";
25
+ import { P as PopupsViewer } from "../popups/PopupsViewer/index.fb3f0c48.js";
24
26
  import { createPathComponent } from "@react-leaflet/core";
25
27
  import "leaflet.markercluster";
26
28
  import { cloneDeep, throttle } from "lodash";
@@ -30,8 +32,10 @@ import { createStore, useStore } from "zustand";
30
32
  import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
31
33
  import { devtools } from "zustand/middleware";
32
34
  import { immer } from "zustand/middleware/immer";
35
+ import { generateUtilityClasses } from "@mui/material";
33
36
  import { unstable_composeClasses } from "@mui/base";
34
- import { g as getComponentUtilityClass } from "../../utils/index.9ee4c99a.js";
37
+ import { g as getComponentUtilityClass } from "../../utils/index.0660ee9c.js";
38
+ import { M as MarkerIconLabel } from "../Icon/index.2e8ec5a1.js";
35
39
  import "leaflet-polylinedecorator";
36
40
  const updateOwnerStateClasses = (_state) => {
37
41
  };
@@ -110,138 +114,6 @@ const useMapUtilityClasses = (_ownerState) => {
110
114
  };
111
115
  return unstable_composeClasses(slots, getComponentUtilityClass(COMPONENT_CLASS_NAME), {});
112
116
  };
113
- const TILE_LAYER_OSM = {
114
- id: "osm_roadmap",
115
- sourceType: "OSM",
116
- iconUrl: MAP_ICONS.MAP_SOURCE_OSM,
117
- mapTypeTile: "roadmap",
118
- dictionaryId: MAP_DICCTIONARY.LABEL_TILE_OSM,
119
- urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
120
- options: {
121
- minZoom: 0,
122
- maxZoom: 19,
123
- subdomains: ["a", "b", "c"],
124
- attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>',
125
- tms: false
126
- },
127
- roadSelectedOptions: {
128
- trafficLayer: false,
129
- transitLayer: false,
130
- bicyclingLayer: false
131
- }
132
- };
133
- const TILE_LAYER_GOOGLE = {
134
- id: "google_rodmap",
135
- sourceType: "Google",
136
- iconUrl: MAP_ICONS.MAP_SOURCE_GOOGLE_ROADS,
137
- mapTypeTile: "roadmap",
138
- dictionaryId: MAP_DICCTIONARY.LABEL_TILE_GOOGLE,
139
- urlTemplate: "http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&key=AIzaSyDfhTK9us4kuqPTeFIm89yB3uvk2_G5AMw",
140
- hasBicyclingLayer: true,
141
- hasTrafficLayer: true,
142
- hasTransitLayer: true,
143
- options: {
144
- minZoom: 0,
145
- maxZoom: 22,
146
- subdomains: ["mt0", "mt1", "mt2", "mt3"],
147
- attribution: "Map data \xA9 Google",
148
- tms: false
149
- },
150
- roadSelectedOptions: {
151
- trafficLayer: false,
152
- transitLayer: false,
153
- bicyclingLayer: false
154
- }
155
- };
156
- const TILE_LAYER_GOOGLE_SATELLITE = {
157
- id: "google_satellite",
158
- sourceType: "Google",
159
- iconUrl: MAP_ICONS.MAP_SOURCE_GOOGLE_SATELLITE,
160
- mapTypeTile: "satellite",
161
- dictionaryId: MAP_DICCTIONARY.LABEL_TILE_GOOGLE_SATELLITE,
162
- urlTemplate: "http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&key=AIzaSyDfhTK9us4kuqPTeFIm89yB3uvk2_G5AMw",
163
- options: {
164
- minZoom: 0,
165
- maxZoom: 22,
166
- subdomains: ["mt0", "mt1", "mt2", "mt3"],
167
- attribution: "Map data \xA9 Google",
168
- tms: false
169
- },
170
- roadSelectedOptions: {
171
- trafficLayer: false,
172
- transitLayer: false,
173
- bicyclingLayer: false
174
- }
175
- };
176
- const TILE_LAYER_GOOGLE_HYBRID = {
177
- id: "google_hybrid",
178
- sourceType: "Google",
179
- iconUrl: MAP_ICONS.MAP_SOURCE_GOOGLE_HYBRID,
180
- mapTypeTile: "hybrid",
181
- dictionaryId: MAP_DICCTIONARY.LABEL_TILE_GOOGLE_HYBRID,
182
- urlTemplate: "http://{s}.google.com/vt/lyrs=y&x={x}&y={y}&z={z}&key=AIzaSyDfhTK9us4kuqPTeFIm89yB3uvk2_G5AMw",
183
- hasBicyclingLayer: true,
184
- hasTrafficLayer: true,
185
- hasTransitLayer: true,
186
- options: {
187
- minZoom: 0,
188
- maxZoom: 22,
189
- subdomains: ["mt0", "mt1", "mt2", "mt3"],
190
- attribution: "Map data \xA9 Google",
191
- tms: false
192
- },
193
- roadSelectedOptions: {
194
- trafficLayer: false,
195
- transitLayer: false,
196
- bicyclingLayer: false
197
- }
198
- };
199
- function toQuadKey(x, y, z) {
200
- let quadKey = "";
201
- for (let i = z; i > 0; i--) {
202
- let digit = 0;
203
- const mask = 1 << i - 1;
204
- if ((x & mask) !== 0) {
205
- digit++;
206
- }
207
- if ((y & mask) !== 0) {
208
- digit++;
209
- digit++;
210
- }
211
- quadKey += digit.toString();
212
- }
213
- return quadKey;
214
- }
215
- const BING_URL_TEMPLATE = "https://{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/|QK|?mkt=en-us&it=G,VE,BX,L,LA&shading=hill&og=22&n=z";
216
- const BING_SUB_DOMAINS = ["t2", "t3"];
217
- const TILE_LAYER_BING = {
218
- id: "bing_rodmap",
219
- sourceType: "Bing",
220
- mapTypeTile: "roadmap",
221
- dictionaryId: MAP_DICCTIONARY.LABEL_TILE_BING,
222
- iconUrl: MAP_ICONS.MAP_SOURCE_BING,
223
- urlTemplate: BING_URL_TEMPLATE,
224
- options: {
225
- minZoom: 0,
226
- maxZoom: 21,
227
- subdomains: BING_SUB_DOMAINS,
228
- attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>',
229
- tms: true
230
- },
231
- roadSelectedOptions: {
232
- trafficLayer: false,
233
- transitLayer: false,
234
- bicyclingLayer: false
235
- },
236
- getTileUrl: (tileCoord) => {
237
- const i = Math.abs(tileCoord.x + tileCoord.y) % BING_SUB_DOMAINS.length;
238
- const z = tileCoord.z;
239
- const x = tileCoord.x;
240
- const y = tileCoord.y;
241
- const gk = toQuadKey(x, y, z);
242
- return BING_URL_TEMPLATE.replace("|QK|", gk).replace("{s}", BING_SUB_DOMAINS[i]);
243
- }
244
- };
245
117
  const createMapStore = (initProps) => {
246
118
  const startProps = {
247
119
  classes: useMapUtilityClasses(initProps.ownerState),
@@ -1010,48 +882,6 @@ function MeasureTool() {
1010
882
  }
1011
883
  );
1012
884
  }
1013
- function ZoomButtons() {
1014
- const map = useMap();
1015
- const { host_static_assets, environment_assets } = useEnvironment();
1016
- const [, setZoomInDisabled] = useState(false);
1017
- const [, setZoomOutDisabled] = useState(false);
1018
- useEffect(() => {
1019
- const updateButtonState = () => {
1020
- const currentZoom = map.getZoom();
1021
- const maxZoom = map.getMaxZoom();
1022
- const minZoom = map.getMinZoom();
1023
- setZoomInDisabled(currentZoom === maxZoom);
1024
- setZoomOutDisabled(currentZoom === minZoom);
1025
- };
1026
- map.on("zoomend", updateButtonState);
1027
- updateButtonState();
1028
- return () => {
1029
- map.off("zoomend", updateButtonState);
1030
- };
1031
- }, [map]);
1032
- const handleZoomIn = () => {
1033
- map.zoomIn();
1034
- };
1035
- const handleZoomOut = () => {
1036
- map.zoomOut();
1037
- };
1038
- return /* @__PURE__ */ jsxs("div", { className: mapClasses.zoomButtons, children: [
1039
- /* @__PURE__ */ jsx(
1040
- IconButton,
1041
- {
1042
- onClick: handleZoomIn,
1043
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_ZOOM_IN}`
1044
- }
1045
- ),
1046
- /* @__PURE__ */ jsx(
1047
- IconButton,
1048
- {
1049
- onClick: handleZoomOut,
1050
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_ZOOM_OUT}`
1051
- }
1052
- )
1053
- ] });
1054
- }
1055
885
  function TopRightTools(props) {
1056
886
  const { gpsTools } = props;
1057
887
  const { addPopup, closePopup } = usePopupsStore((state) => state.popupsActions);
@@ -1137,191 +967,6 @@ function TopRightTools(props) {
1137
967
  /* @__PURE__ */ jsx(ZoomButtons, {})
1138
968
  ] });
1139
969
  }
1140
- function useColumns(props) {
1141
- const {
1142
- rowKeyGetter,
1143
- visibleLayers,
1144
- setVisibleLayers,
1145
- autoFocusLayers,
1146
- setAutoFocusLayers,
1147
- clusterLayers,
1148
- setClusterLayers
1149
- } = props;
1150
- const { getLabel } = useModuleDictionary();
1151
- const { host_static_assets, environment_assets } = useEnvironment();
1152
- const useHook = useCallback(
1153
- (field) => {
1154
- if (field === "visible") {
1155
- return [visibleLayers, setVisibleLayers];
1156
- } else if (field === "autoFocus") {
1157
- return [autoFocusLayers, setAutoFocusLayers];
1158
- } else {
1159
- return [clusterLayers, setClusterLayers];
1160
- }
1161
- },
1162
- [visibleLayers, autoFocusLayers, clusterLayers]
1163
- );
1164
- const columns = useMemo(
1165
- () => [
1166
- {
1167
- key: "name",
1168
- name: getLabel(MAP_DICCTIONARY.LABEL_NAME),
1169
- type: "string",
1170
- width: 150,
1171
- frozen: true
1172
- },
1173
- {
1174
- key: "visible",
1175
- name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_VISIBLE),
1176
- width: 50,
1177
- minWidth: 20,
1178
- type: "boolean",
1179
- formatter: ColumnSetCheckFormatter({
1180
- field: "visible",
1181
- rowKeyGetter,
1182
- useHook
1183
- }),
1184
- cellClass: "rdg-cell-align-center",
1185
- headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_VISIBLE), children: /* @__PURE__ */ jsx(
1186
- Icon,
1187
- {
1188
- size: "medium",
1189
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_VISIBLE}`
1190
- }
1191
- ) })
1192
- },
1193
- {
1194
- key: "autoFocus",
1195
- name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_AUTOFOCUS),
1196
- minWidth: 20,
1197
- width: 50,
1198
- type: "boolean",
1199
- formatter: ColumnSetCheckFormatter({
1200
- field: "autoFocus",
1201
- rowKeyGetter,
1202
- useHook
1203
- }),
1204
- cellClass: "rdg-cell-align-center",
1205
- headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_AUTOFOCUS), children: /* @__PURE__ */ jsx(
1206
- Icon,
1207
- {
1208
- size: "medium",
1209
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_AUTOFOCUS}`
1210
- }
1211
- ) })
1212
- },
1213
- {
1214
- key: "cluster",
1215
- name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_CLUSTER),
1216
- minWidth: 20,
1217
- width: 50,
1218
- type: "boolean",
1219
- formatter: ColumnSetCheckFormatter({
1220
- field: "cluster",
1221
- disabledGetter: (row) => !row.clusterAble,
1222
- rowKeyGetter,
1223
- useHook
1224
- }),
1225
- cellClass: "rdg-cell-align-center",
1226
- headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_CLUSTER), children: /* @__PURE__ */ jsx(
1227
- Icon,
1228
- {
1229
- size: "medium",
1230
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_CLUSTER}`
1231
- }
1232
- ) })
1233
- }
1234
- ],
1235
- [getLabel, useHook]
1236
- );
1237
- return { columns };
1238
- }
1239
- function useCheckedLayers(checkedNameSet) {
1240
- const [checkedLayers, setCheckedLayers] = useMapStore(
1241
- (state) => [
1242
- state[`${checkedNameSet}CheckedLayers`],
1243
- (newSet) => {
1244
- state.mapActions.setCheckedLayers(checkedNameSet, newSet);
1245
- }
1246
- ],
1247
- shallow
1248
- );
1249
- return [checkedLayers, setCheckedLayers];
1250
- }
1251
- function useRowActionsGetter() {
1252
- const { getLabel } = useModuleDictionary();
1253
- const { hasPrivilege } = useModulePrivileges();
1254
- const { host_static_assets, environment_assets } = useEnvironment();
1255
- const { removeLayer } = useMapStore((state) => state.mapActions, shallow);
1256
- const [urlIconDelete] = useState(
1257
- `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_DELETE}`
1258
- );
1259
- const onDelete = useCallback(
1260
- (row) => {
1261
- removeLayer(row.id);
1262
- },
1263
- [getLabel]
1264
- );
1265
- const rowActionsGetter = useCallback(
1266
- (row) => {
1267
- const conditionalItems = [];
1268
- conditionalItems.push({
1269
- urlIcon: urlIconDelete,
1270
- dictionaryId: MAP_DICCTIONARY.ROW_ACTION_LAYER_DELETE,
1271
- onClick: () => {
1272
- onDelete(row);
1273
- },
1274
- disabled: !row.deleteAble
1275
- });
1276
- return conditionalItems;
1277
- },
1278
- [hasPrivilege, onDelete, urlIconDelete]
1279
- );
1280
- return { rowActionsGetter };
1281
- }
1282
- function useMaster() {
1283
- const [hashLayers, layersIds] = useMapStore(
1284
- (state) => [state.hashLayers, state.layersIds],
1285
- shallow
1286
- );
1287
- const rowKeyGetter = useCallback((row) => row.id, []);
1288
- const [visibleLayers, setVisibleLayers] = useCheckedLayers("visible");
1289
- const [autoFocusLayers, setAutoFocusLayers] = useCheckedLayers("autoFocus");
1290
- const [clusterLayers, setClusterLayers] = useCheckedLayers("cluster");
1291
- const rows = useMemo(() => {
1292
- const rows2 = [];
1293
- layersIds.forEach((layerId) => {
1294
- if (hashLayers[layerId]) {
1295
- rows2.push({
1296
- id: layerId,
1297
- name: hashLayers[layerId].name || `*${layerId}`,
1298
- active: hashLayers[layerId].visible,
1299
- clusterAble: hashLayers[layerId].clusterAble || false,
1300
- deleteAble: hashLayers[layerId].deleteAble || false
1301
- });
1302
- }
1303
- });
1304
- return rows2;
1305
- }, [hashLayers, layersIds]);
1306
- const { rowActionsGetter } = useRowActionsGetter();
1307
- const { columns } = useColumns({
1308
- rowKeyGetter,
1309
- visibleLayers,
1310
- setVisibleLayers,
1311
- autoFocusLayers,
1312
- setAutoFocusLayers,
1313
- clusterLayers,
1314
- setClusterLayers
1315
- });
1316
- return {
1317
- rowKeyGetter,
1318
- columns,
1319
- rows,
1320
- checkedRows: visibleLayers,
1321
- onCheckedRowsChange: setVisibleLayers,
1322
- rowActionsGetter
1323
- };
1324
- }
1325
970
  function useDisableZoomEvents(node) {
1326
971
  const map = useMap();
1327
972
  useEffect(() => {
@@ -1337,186 +982,6 @@ function useDisableZoomEvents(node) {
1337
982
  });
1338
983
  }, [map, node]);
1339
984
  }
1340
- function LayersTool() {
1341
- const { columns, rows, rowKeyGetter, rowActionsGetter } = useMaster();
1342
- const [divRef, setDivRef] = useStateRef(null);
1343
- useDisableZoomEvents(divRef);
1344
- return /* @__PURE__ */ jsx("div", { ref: setDivRef, style: { position: "relative", height: "100%" }, children: /* @__PURE__ */ jsx(
1345
- DataGrid,
1346
- {
1347
- id: "layers",
1348
- columns,
1349
- rows,
1350
- rowActionsGetter,
1351
- rowKeyGetter,
1352
- withActions: true,
1353
- actionsProps: {
1354
- withRowsCount: false,
1355
- withSettings: false,
1356
- withPager: false,
1357
- withLocalFilters: false
1358
- }
1359
- }
1360
- ) });
1361
- }
1362
- function MapSourcesTool() {
1363
- const { getLabel } = useModuleDictionary();
1364
- const { host_static_assets, environment_assets } = useEnvironment();
1365
- const currentMapSourceId = useMapStore((state) => state.currentMapSourceId, shallow);
1366
- const mapSources = useMapStore((state) => {
1367
- return state.mapSourcesIds.map((id) => ({
1368
- id,
1369
- dictionaryId: state.hashMapSources[id].dictionaryId,
1370
- iconUrl: state.hashMapSources[id].iconUrl,
1371
- hasBicyclingLayer: state.hashMapSources[id].hasBicyclingLayer,
1372
- hasTrafficLayer: state.hashMapSources[id].hasTrafficLayer,
1373
- hasTransitLayer: state.hashMapSources[id].hasTransitLayer,
1374
- roadSeletedOptions: state.hashMapSources[id].roadSelectedOptions
1375
- }));
1376
- }, shallow);
1377
- const { setCurrentMapSource, setMapSourceRoadOptions: setMapSourceRoadMapOptions } = useMapStore(
1378
- (state) => state.mapActions,
1379
- shallow
1380
- );
1381
- const [divRef, setDivRef] = useStateRef(null);
1382
- useDisableZoomEvents(divRef);
1383
- const handleChange = (event) => {
1384
- setCurrentMapSource(event.target.value);
1385
- };
1386
- return /* @__PURE__ */ jsx("div", { className: mapClasses.mapSourcesRoot, ref: setDivRef, children: /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
1387
- RadioGroup,
1388
- {
1389
- "aria-labelledby": "demo-controlled-radio-buttons-group",
1390
- name: "controlled-radio-buttons-group",
1391
- value: currentMapSourceId,
1392
- onChange: handleChange,
1393
- children: mapSources.map((mapSourceOption) => /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOption, children: [
1394
- /* @__PURE__ */ jsx(
1395
- FormControlLabel,
1396
- {
1397
- className: "",
1398
- value: mapSourceOption.id,
1399
- control: /* @__PURE__ */ jsx(Radio, {}),
1400
- label: /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionIconLabel, children: [
1401
- /* @__PURE__ */ jsx(
1402
- Icon,
1403
- {
1404
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${mapSourceOption.iconUrl}`
1405
- }
1406
- ),
1407
- /* @__PURE__ */ jsx("span", { children: getLabel(mapSourceOption.dictionaryId) })
1408
- ] })
1409
- }
1410
- ),
1411
- (mapSourceOption.hasBicyclingLayer || mapSourceOption.hasTrafficLayer || mapSourceOption.hasTransitLayer) && /* @__PURE__ */ jsxs(
1412
- "div",
1413
- {
1414
- className: clsx(
1415
- mapClasses.mapSourcesOptionRoadOptions,
1416
- currentMapSourceId !== mapSourceOption.id ? mapClasses.disabled : mapClasses.active
1417
- ),
1418
- children: [
1419
- mapSourceOption.hasTrafficLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
1420
- /* @__PURE__ */ jsx(
1421
- CheckBox,
1422
- {
1423
- disabled: currentMapSourceId !== mapSourceOption.id,
1424
- checked: mapSourceOption.roadSeletedOptions?.trafficLayer || false,
1425
- onChange: (_e, checked) => {
1426
- setMapSourceRoadMapOptions({ trafficLayer: checked });
1427
- }
1428
- }
1429
- ),
1430
- /* @__PURE__ */ jsx(
1431
- Icon,
1432
- {
1433
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_TRAFFIC}`
1434
- }
1435
- )
1436
- ] }),
1437
- mapSourceOption.hasTransitLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
1438
- /* @__PURE__ */ jsx(
1439
- CheckBox,
1440
- {
1441
- disabled: currentMapSourceId !== mapSourceOption.id,
1442
- checked: mapSourceOption.roadSeletedOptions?.transitLayer || false,
1443
- onChange: (_e, checked) => {
1444
- setMapSourceRoadMapOptions({ transitLayer: checked });
1445
- }
1446
- }
1447
- ),
1448
- /* @__PURE__ */ jsx(
1449
- Icon,
1450
- {
1451
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_TRANSIT}`
1452
- }
1453
- )
1454
- ] }),
1455
- mapSourceOption.hasBicyclingLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
1456
- /* @__PURE__ */ jsx(
1457
- CheckBox,
1458
- {
1459
- disabled: currentMapSourceId !== mapSourceOption.id,
1460
- checked: mapSourceOption.roadSeletedOptions?.bicyclingLayer || false,
1461
- label: "Bycicle",
1462
- onChange: (_e, checked) => {
1463
- setMapSourceRoadMapOptions({ bicyclingLayer: checked });
1464
- }
1465
- }
1466
- ),
1467
- /* @__PURE__ */ jsx(
1468
- Icon,
1469
- {
1470
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_BICYCLING}`
1471
- }
1472
- )
1473
- ] })
1474
- ]
1475
- }
1476
- )
1477
- ] }, mapSourceOption.dictionaryId))
1478
- }
1479
- ) }) });
1480
- }
1481
- function LayersButton(props) {
1482
- const { type } = props;
1483
- const [open, setOpen] = useState(null);
1484
- const { host_static_assets, environment_assets } = useEnvironment();
1485
- const theme = useTheme();
1486
- const handleOpen = (event) => {
1487
- setOpen(event.currentTarget);
1488
- };
1489
- const handleClose = () => {
1490
- setOpen(null);
1491
- };
1492
- return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
1493
- /* @__PURE__ */ jsx(
1494
- IconButton,
1495
- {
1496
- onClick: handleOpen,
1497
- src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${type === "MapSources" ? MAP_ICONS.MAP_SOURCES_TOOL : MAP_ICONS.MAP_LAYERS_TOOL}`
1498
- }
1499
- ),
1500
- /* @__PURE__ */ jsx(
1501
- Popover,
1502
- {
1503
- className: type === "MapSources" ? mapClasses.mapSourcesPopoverRoot : mapClasses.layersPopoverRoot,
1504
- arrowType: "no-arrow",
1505
- open: Boolean(open),
1506
- anchorEl: open,
1507
- anchorOrigin: { vertical: "bottom", horizontal: "left" },
1508
- onClose: handleClose,
1509
- sx: {
1510
- ...type === "MapSources" ? theme.components?.M4LMapMapSources?.styleOverrides : theme.components?.M4LMapLayers?.styleOverrides
1511
- },
1512
- disableAutoFocus: true,
1513
- disableRestoreFocus: true,
1514
- disableEnforceFocus: true,
1515
- children: type === "MapSources" ? /* @__PURE__ */ jsx(MapSourcesTool, {}) : /* @__PURE__ */ jsx(LayersTool, {})
1516
- }
1517
- )
1518
- ] });
1519
- }
1520
985
  function TopLeftTools() {
1521
986
  return /* @__PURE__ */ jsxs(Control, { position: "topleft", prepend: true, className: mapClasses.topLeftToolsRoot, children: [
1522
987
  /* @__PURE__ */ jsx(LayersButton, { type: "MapSources" }),
@@ -2164,9 +1629,10 @@ const CommonFeatureRender = (props) => {
2164
1629
  export {
2165
1630
  CommonFeatureRender as C,
2166
1631
  Map$1 as M,
2167
- MapProvider as a,
2168
- MapContext as b,
2169
- MarkerFeatureRender as c,
1632
+ useDisableZoomEvents as a,
1633
+ MapProvider as b,
1634
+ MapContext as c,
1635
+ MarkerFeatureRender as d,
2170
1636
  mapClasses as m,
2171
1637
  useMapStore as u
2172
1638
  };
@@ -1,9 +1,10 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { m as modalUtilityClasses } from "./index.a0e30c8b.js";
2
+ import { m as modalUtilityClasses } from "./index.7ca17f55.js";
3
3
  import { useEnvironment } from "@m4l/core";
4
4
  import clsx from "clsx";
5
- import { I as Icon, a as IconButton } from "../Icon/index.d5fed418.js";
6
- import { u as useModal } from "../../hooks/useModal/index.ef54bcf2.js";
5
+ import { I as IconButton } from "../mui_extended/IconButton/index.87f4726c.js";
6
+ import { I as Icon } from "../Icon/index.2e8ec5a1.js";
7
+ import { u as useModal } from "../../hooks/useModal/index.9fe41bde.js";
7
8
  const Header = (props) => {
8
9
  const { title, onClickCancel, urlIcon, classes } = props;
9
10
  const { host_static_assets, environment_assets } = useEnvironment();
@@ -1,12 +1,12 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { d as Actions, e as ActionCancel, f as ActionIntro } from "../../vendor.a1ce6777.js";
2
+ import { A as Actions, d as ActionCancel, e as ActionIntro } from "../../vendor.3eadfa16.js";
3
3
  import { Typography } from "@mui/material";
4
4
  import { useModuleDictionary, useEnvironment } from "@m4l/core";
5
- import { e as dictionary } from "../areas/dictionary.7e74022a.js";
6
- import { u as useModal } from "../../hooks/useModal/index.ef54bcf2.js";
7
- import { I as Image } from "../Image/index.36a3d440.js";
8
- import { m as modalUtilityClasses } from "./index.a0e30c8b.js";
9
- import { W as WindowBase } from "./WindowBase.a3ac7adc.js";
5
+ import { f as dictionary } from "../areas/dictionary.19b25583.js";
6
+ import { u as useModal } from "../../hooks/useModal/index.9fe41bde.js";
7
+ import { I as Image } from "../Image/index.0d32558e.js";
8
+ import { m as modalUtilityClasses } from "./index.7ca17f55.js";
9
+ import { W as WindowBase } from "./WindowBase.c1e879e4.js";
10
10
  const MessageIlustration = (props) => {
11
11
  const { getLabel } = useModuleDictionary();
12
12
  const { variant } = useModal();
@@ -1,6 +1,6 @@
1
1
  import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
2
2
  import { unstable_composeClasses } from "@mui/base";
3
- import { ax as componentName } from "../areas/constants.5387d83e.js";
3
+ import { a8 as componentName } from "../areas/constants.630a4f42.js";
4
4
  generateUtilityClasses(componentName, [
5
5
  "root",
6
6
  "windowBaseRoot",