@m4l/gclick 0.3.7 → 0.3.8
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.
- package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.d.ts +3 -2
- package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.d.ts.map +1 -1
- package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.js +16 -20
- package/components/index.d.ts +1 -0
- package/components/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/constants.d.ts +1 -0
- package/components/maps/components/GpsMap/constants.d.ts.map +1 -1
- package/components/maps/components/GpsMap/constants.js +16 -14
- package/components/maps/components/GpsMap/contexts/MapContext/MapContext.d.ts +2 -1
- package/components/maps/components/GpsMap/contexts/MapContext/MapContext.d.ts.map +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.d.ts +28 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.d.ts.map +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.js +111 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.d.ts +9 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.d.ts.map +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.js +183 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.d.ts +112 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.d.ts.map +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.js +87 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.d.ts +10 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.d.ts.map +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.js +12 -0
- package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts +2 -1
- package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/store.d.ts +6 -2
- package/components/maps/components/GpsMap/contexts/MapContext/store.d.ts.map +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/store.js +301 -123
- package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts +191 -20
- package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts.map +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/types.js +8 -0
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.js +93 -124
- package/components/maps/components/GpsMap/hooks/index.d.ts +3 -0
- package/components/maps/components/GpsMap/hooks/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.d.ts +12 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.d.ts.map +1 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.js +29 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.d.ts +1 -4
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.js +32 -59
- package/components/maps/components/GpsMap/hooks/useAutoFocus/types.d.ts +4 -13
- package/components/maps/components/GpsMap/hooks/useAutoFocus/types.d.ts.map +1 -1
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.d.ts +7 -0
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.d.ts.map +1 -0
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.js +42 -0
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.types.d.ts +19 -0
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.types.d.ts.map +1 -0
- package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.d.ts +12 -0
- package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.d.ts.map +1 -0
- package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.js +43 -0
- package/components/maps/components/GpsMap/index.d.ts +1 -0
- package/components/maps/components/GpsMap/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.js +20 -13
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts +4 -3
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.js +175 -120
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.js +26 -12
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/Layer/Layer.js +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.d.ts +6 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.js +38 -26
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useDatagridFiltered.js +26 -26
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useFilterAndSort.js +27 -27
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useMaster.js +4 -4
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.d.ts +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.js +34 -28
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useRowActionsGetter.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useRowActionsGetter.js +41 -36
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabFiltered.js +17 -17
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.js +16 -18
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.d.ts +3 -2
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.js +136 -92
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/GeneralData.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/GeneralData.js +29 -23
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.d.ts +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.js +60 -95
- package/components/maps/index.d.ts +1 -0
- package/components/maps/index.d.ts.map +1 -1
- package/index.js +143 -136
- package/package.json +3 -4
|
@@ -1,157 +1,212 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useMap as
|
|
3
|
-
import * as
|
|
4
|
-
import { useFormContext as
|
|
5
|
-
import { useFormReadyForUpdate as
|
|
6
|
-
import { useModuleDictionary as
|
|
7
|
-
import { STYLE_MEASURE_OPTIONS as
|
|
8
|
-
import { MAP_ZINDEX_DEFAULT as
|
|
9
|
-
import { getMagnitudeFactor as
|
|
10
|
-
import { mapClasses as
|
|
11
|
-
import { useTheme as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { useState as V, useRef as X, useCallback as s, useEffect as g } from "react";
|
|
2
|
+
import { useMap as Y } from "react-leaflet";
|
|
3
|
+
import * as _ from "leaflet";
|
|
4
|
+
import { useFormContext as Z, useWatch as $ } from "react-hook-form";
|
|
5
|
+
import { useFormReadyForUpdate as j } from "@m4l/components";
|
|
6
|
+
import { useModuleDictionary as q } from "@m4l/core";
|
|
7
|
+
import { MEASURE_TOOL_INTERACTION_OWNER_ID as G, MEASURE_TOOL_REQUIRED_INTERACTION_CHANNELS as J, STYLE_MEASURE_OPTIONS as K, MEASURE_TOOL_DUPLICATE_POINT_WINDOW_MS as ee, MEASURE_TOOL_DUPLICATE_POINT_EPSILON as F } from "../../constants.js";
|
|
8
|
+
import { MAP_ZINDEX_DEFAULT as N } from "../../../../../../../../constants.js";
|
|
9
|
+
import { getMagnitudeFactor as R, getMarkerPointIcon2 as re, getMarkerPointLabel as te } from "./helpers.js";
|
|
10
|
+
import { mapClasses as ne } from "../../../../../../../../classes/index.js";
|
|
11
|
+
import { useTheme as oe } from "@mui/material";
|
|
12
|
+
import { shallow as ae } from "zustand/shallow";
|
|
13
|
+
import { useMapStore as se } from "../../../../../../../../hooks/useMapStore/index.js";
|
|
14
|
+
import { useMapInteractionCapture as ie } from "../../../../../../../../hooks/useMapInteractionCapture.js";
|
|
15
|
+
function Ee() {
|
|
16
|
+
const { getLabel: u } = q(), o = Y(), A = j(), { control: S, setValue: l } = Z(), { subscribeObservableFeatureEvents: I, unsubscribeObservableFeatureEvents: O, resolveObservableFeaturePick: T } = se(
|
|
17
|
+
(n) => n.mapActions,
|
|
18
|
+
ae
|
|
19
|
+
), x = oe(), k = $({
|
|
20
|
+
control: S,
|
|
15
21
|
name: ["statusEdition", "value", "magnitude"]
|
|
16
|
-
}),
|
|
22
|
+
}), m = k[0], U = k[1], c = k[2], w = u(R(c).dictionarySymbolId), [W, H] = V(c), {
|
|
23
|
+
hasCapture: v,
|
|
24
|
+
releaseAllCapture: y
|
|
25
|
+
} = ie({
|
|
26
|
+
ownerId: G,
|
|
27
|
+
channels: J
|
|
28
|
+
}), t = X({
|
|
17
29
|
measurePoints: [],
|
|
18
30
|
addMarker: !1,
|
|
19
31
|
magnitude: c,
|
|
20
32
|
dragging: !1
|
|
21
|
-
}),
|
|
33
|
+
}), C = s(() => {
|
|
22
34
|
t.current.measurePoints.forEach((n) => {
|
|
23
35
|
n.marker.remove(), n.labelMarker.remove();
|
|
24
|
-
}), t.current.measurePoints = [],
|
|
25
|
-
}, []),
|
|
26
|
-
(n,
|
|
36
|
+
}), t.current.measurePoints = [], t.current.recentPointPlacement = void 0, l("value", f());
|
|
37
|
+
}, []), P = s(
|
|
38
|
+
(n, r = !1) => {
|
|
27
39
|
if (n === void 0)
|
|
28
40
|
return;
|
|
29
|
-
const
|
|
30
|
-
return (
|
|
41
|
+
const e = R(t.current.magnitude);
|
|
42
|
+
return (e.factor_x0 + n * e.factor_x1 + e.factor_x2 * (n ^ 2)).toFixed(e.decimalDigits) + (r ? ` ${u(e.dictionarySymbolId)}` : "");
|
|
31
43
|
},
|
|
32
|
-
[
|
|
33
|
-
),
|
|
44
|
+
[u]
|
|
45
|
+
), f = s(() => {
|
|
34
46
|
let n = 0;
|
|
35
|
-
const
|
|
36
|
-
t.current.layerLine ?
|
|
37
|
-
|
|
38
|
-
) :
|
|
39
|
-
|
|
47
|
+
const r = t.current.measurePoints;
|
|
48
|
+
t.current.layerLine ? r.length < 2 ? (t.current.layerLine.remove(), t.current.layerLine = void 0) : t.current.layerLine.setLatLngs(
|
|
49
|
+
r.map((e) => e.marker.getLatLng())
|
|
50
|
+
) : r.length > 1 && (t.current.layerLine = _.polyline(
|
|
51
|
+
r.map((e) => e.marker.getLatLng()),
|
|
40
52
|
{
|
|
41
|
-
color:
|
|
53
|
+
color: x.palette.primary.main,
|
|
42
54
|
//STYLE_MEASURE_OPTIONS.strokeLineColor,
|
|
43
|
-
weight:
|
|
55
|
+
weight: K.strokeLineWeight,
|
|
44
56
|
interactive: !1
|
|
45
|
-
//
|
|
57
|
+
// Editing stays disabled for the measurement polyline.
|
|
46
58
|
}
|
|
47
59
|
).addTo(o));
|
|
48
|
-
for (let
|
|
49
|
-
n += e
|
|
50
|
-
|
|
51
|
-
for (let
|
|
52
|
-
const a =
|
|
53
|
-
e
|
|
60
|
+
for (let e = 0; e < r.length - 1; e++)
|
|
61
|
+
n += r[e].marker.getLatLng().distanceTo(r[e + 1].marker.getLatLng()) / 1e3;
|
|
62
|
+
r.length > 0 && r[0].formatDistanceFromPrevious !== void 0 && (r[0].formatDistanceFromPrevious = void 0, r[0].labelMarker.setIcon(p(void 0, u)), M(r[0].labelMarker));
|
|
63
|
+
for (let e = 1; e < r.length; e++) {
|
|
64
|
+
const a = P(
|
|
65
|
+
r[e - 1].marker.getLatLng().distanceTo(r[e].marker.getLatLng()) / 1e3,
|
|
54
66
|
!0
|
|
55
67
|
);
|
|
56
|
-
e
|
|
57
|
-
|
|
58
|
-
), M(e
|
|
68
|
+
r[e].formatDistanceFromPrevious !== a && (r[e].formatDistanceFromPrevious = a, r[e].labelMarker.setIcon(
|
|
69
|
+
p(a, u)
|
|
70
|
+
), M(r[e].labelMarker));
|
|
59
71
|
}
|
|
60
|
-
return
|
|
61
|
-
}, [o,
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
72
|
+
return P(n);
|
|
73
|
+
}, [o, u]), E = s(re, []), p = s(te, [u]), z = s((n) => (r) => {
|
|
74
|
+
if (r.stopPropagation(), !t.current.dragging) {
|
|
75
|
+
const e = t.current.measurePoints.findIndex(
|
|
64
76
|
(a) => a.labelMarker === n
|
|
65
77
|
);
|
|
66
|
-
if (
|
|
67
|
-
const a = t.current.measurePoints[
|
|
68
|
-
a.marker.remove(), a.labelMarker.remove(), t.current.measurePoints.splice(
|
|
78
|
+
if (e !== -1) {
|
|
79
|
+
const a = t.current.measurePoints[e];
|
|
80
|
+
a.marker.remove(), a.labelMarker.remove(), t.current.measurePoints.splice(e, 1), l("value", f()), t.current.addMarker = !0;
|
|
69
81
|
}
|
|
70
|
-
t.current.measurePoints.forEach((a,
|
|
71
|
-
a.marker.setIcon(
|
|
82
|
+
t.current.measurePoints.forEach((a, i) => {
|
|
83
|
+
a.marker.setIcon(E(i + 1));
|
|
72
84
|
});
|
|
73
85
|
}
|
|
74
86
|
}, []), M = s((n) => {
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)[0],
|
|
79
|
-
}, []),
|
|
87
|
+
let r = n.getElement();
|
|
88
|
+
r && (r = r.getElementsByClassName(
|
|
89
|
+
ne.measureLabelMarkerRemove
|
|
90
|
+
)[0], r && r.addEventListener("click", z(n)));
|
|
91
|
+
}, []), D = s((n, r) => {
|
|
92
|
+
const e = t.current.recentPointPlacement;
|
|
93
|
+
return e ? Date.now() - e.timestamp > ee ? (t.current.recentPointPlacement = void 0, !1) : Math.abs(e.lat - n) <= F && Math.abs(e.lng - r) <= F : !1;
|
|
94
|
+
}, []), L = s((n, r) => {
|
|
95
|
+
if (!Number.isFinite(n) || !Number.isFinite(r) || D(n, r))
|
|
96
|
+
return;
|
|
97
|
+
t.current.recentPointPlacement = {
|
|
98
|
+
lat: n,
|
|
99
|
+
lng: r,
|
|
100
|
+
timestamp: Date.now()
|
|
101
|
+
};
|
|
102
|
+
let e;
|
|
103
|
+
t.current.measurePoints.length > 0 && (e = P(
|
|
104
|
+
t.current.measurePoints[t.current.measurePoints.length - 1].marker.getLatLng().distanceTo({ lat: n, lng: r }) / 1e3
|
|
105
|
+
));
|
|
106
|
+
const a = _.marker([n, r], {
|
|
107
|
+
draggable: !0,
|
|
108
|
+
riseOnHover: !0,
|
|
109
|
+
autoPan: !0,
|
|
110
|
+
icon: E(t.current.measurePoints.length + 1),
|
|
111
|
+
zIndexOffset: N
|
|
112
|
+
}).addTo(o);
|
|
113
|
+
a.on("moveend", function(d) {
|
|
114
|
+
const h = a.getLatLng();
|
|
115
|
+
i.setLatLng(h), l("value", f());
|
|
116
|
+
}), a.on("mouseover", function() {
|
|
117
|
+
t.current.addMarker = !1;
|
|
118
|
+
}), a.on("mouseout", function() {
|
|
119
|
+
t.current.addMarker = !0;
|
|
120
|
+
});
|
|
121
|
+
var i = _.marker([n, r], {
|
|
122
|
+
draggable: !0,
|
|
123
|
+
riseOnHover: !0,
|
|
124
|
+
icon: p(e, u),
|
|
125
|
+
zIndexOffset: N
|
|
126
|
+
}).addTo(o);
|
|
127
|
+
i.on("moveend", function(d) {
|
|
128
|
+
const h = i.getLatLng();
|
|
129
|
+
a.setLatLng(h), l("value", f());
|
|
130
|
+
}), i.on("mouseover", function(d) {
|
|
131
|
+
t.current.addMarker = !1;
|
|
132
|
+
}), i.on("mouseout", function(d) {
|
|
133
|
+
t.current.addMarker = !0;
|
|
134
|
+
}), i.on("dragstart", function(d) {
|
|
135
|
+
t.current.dragging = !0;
|
|
136
|
+
}), i.on("dragend", function(d) {
|
|
137
|
+
setTimeout(function() {
|
|
138
|
+
t.current.dragging = !1;
|
|
139
|
+
}, 10);
|
|
140
|
+
}), M(i), t.current.measurePoints.push({
|
|
141
|
+
marker: a,
|
|
142
|
+
labelMarker: i,
|
|
143
|
+
formatDistanceFromPrevious: e
|
|
144
|
+
}), l("value", f());
|
|
145
|
+
}, [
|
|
146
|
+
M,
|
|
147
|
+
P,
|
|
148
|
+
u,
|
|
149
|
+
E,
|
|
150
|
+
p,
|
|
151
|
+
o,
|
|
152
|
+
f,
|
|
153
|
+
l,
|
|
154
|
+
D
|
|
155
|
+
]), b = s(
|
|
80
156
|
(n) => {
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
if (t.current.addMarker === !1)
|
|
84
|
-
return;
|
|
85
|
-
t.current.measurePoints.length > 0 && (a = v(
|
|
86
|
-
t.current.measurePoints[t.current.measurePoints.length - 1].marker.getLatLng().distanceTo(n.latlng) / 1e3
|
|
87
|
-
));
|
|
88
|
-
const l = y.marker([e, r], {
|
|
89
|
-
draggable: !0,
|
|
90
|
-
riseOnHover: !0,
|
|
91
|
-
//Se pone la marca encima de las otras cuando se hace over
|
|
92
|
-
autoPan: !0,
|
|
93
|
-
//Se corre el mapa si llega al extremo, solo para las marcas
|
|
94
|
-
icon: F(t.current.measurePoints.length + 1),
|
|
95
|
-
zIndexOffset: C
|
|
96
|
-
}).addTo(o);
|
|
97
|
-
l.on("moveend", function(f) {
|
|
98
|
-
const P = l.getLatLng();
|
|
99
|
-
u.setLatLng(P), m("value", g());
|
|
100
|
-
}), l.on("mouseover", function() {
|
|
101
|
-
t.current.addMarker = !1;
|
|
102
|
-
}), l.on("mouseout", function() {
|
|
103
|
-
t.current.addMarker = !0;
|
|
104
|
-
});
|
|
105
|
-
var u = y.marker([e, r], {
|
|
106
|
-
draggable: !0,
|
|
107
|
-
riseOnHover: !0,
|
|
108
|
-
//Se pone la marca encima de las otras cuando se hace over
|
|
109
|
-
icon: L(a, i),
|
|
110
|
-
zIndexOffset: C
|
|
111
|
-
}).addTo(o);
|
|
112
|
-
u.on("moveend", function(f) {
|
|
113
|
-
const P = u.getLatLng();
|
|
114
|
-
l.setLatLng(P), m("value", g());
|
|
115
|
-
}), u.on("mouseover", function(f) {
|
|
116
|
-
t.current.addMarker = !1;
|
|
117
|
-
}), u.on("mouseout", function(f) {
|
|
118
|
-
t.current.addMarker = !0;
|
|
119
|
-
}), u.on("dragstart", function(f) {
|
|
120
|
-
t.current.dragging = !0;
|
|
121
|
-
}), u.on("dragend", function(f) {
|
|
122
|
-
setTimeout(function() {
|
|
123
|
-
t.current.dragging = !1;
|
|
124
|
-
}, 10);
|
|
125
|
-
}), M(u), t.current.measurePoints.push({
|
|
126
|
-
marker: l,
|
|
127
|
-
labelMarker: u,
|
|
128
|
-
formatDistanceFromPrevious: a
|
|
129
|
-
}), m("value", g());
|
|
157
|
+
const r = n?.latlng?.lat, e = n?.latlng?.lng;
|
|
158
|
+
t.current.addMarker !== !1 && L(r, e);
|
|
130
159
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
), N = s(() => {
|
|
160
|
+
[L]
|
|
161
|
+
), B = s(() => {
|
|
134
162
|
o.getContainer().style.cursor = "crosshair";
|
|
135
|
-
}, [o]),
|
|
163
|
+
}, [o]), Q = s(() => {
|
|
136
164
|
o.getContainer().style.cursor = "default";
|
|
137
165
|
}, [o]);
|
|
138
|
-
return
|
|
166
|
+
return g(() => {
|
|
167
|
+
if (m === "initial" || !v)
|
|
168
|
+
return;
|
|
169
|
+
const n = I(
|
|
170
|
+
(r) => {
|
|
171
|
+
const e = T(r, {
|
|
172
|
+
purpose: "measure"
|
|
173
|
+
});
|
|
174
|
+
e && L(e.anchor.lat, e.anchor.lng);
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
captureOriginalEvent: !0,
|
|
178
|
+
eventTypes: ["click"]
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
return () => {
|
|
182
|
+
O(n);
|
|
183
|
+
};
|
|
184
|
+
}, [
|
|
185
|
+
L,
|
|
186
|
+
v,
|
|
187
|
+
T,
|
|
188
|
+
m,
|
|
189
|
+
I,
|
|
190
|
+
O
|
|
191
|
+
]), g(() => {
|
|
139
192
|
if (o)
|
|
140
|
-
if (
|
|
141
|
-
o.off("click",
|
|
193
|
+
if (m === "initial" || !v) {
|
|
194
|
+
o.off("click", b), C(), o.getContainer().style.cursor = "default";
|
|
142
195
|
return;
|
|
143
196
|
} else
|
|
144
|
-
t.current.addMarker = !0, o.getContainer().style.cursor = "crosshair", o.on("click",
|
|
145
|
-
}, [o,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
197
|
+
t.current.addMarker = !0, o.getContainer().style.cursor = "crosshair", o.on("click", b);
|
|
198
|
+
}, [v, o, m]), g(() => {
|
|
199
|
+
m === "initial" && y();
|
|
200
|
+
}, [y, m]), g(() => {
|
|
201
|
+
if (A && c !== W) {
|
|
202
|
+
H(c), t.current.magnitude = c;
|
|
203
|
+
const n = f();
|
|
204
|
+
l("value", n);
|
|
150
205
|
}
|
|
151
|
-
}, [c]),
|
|
152
|
-
o.off("mousemove",
|
|
153
|
-
}, []), { statusEdition:
|
|
206
|
+
}, [c]), g(() => () => {
|
|
207
|
+
o.off("mousemove", B), o.off("mouseout", Q), o.off("click", b), o.getContainer().style.cursor = "default", C();
|
|
208
|
+
}, []), { statusEdition: m, magnitude: c, symbol: w, value: U };
|
|
154
209
|
}
|
|
155
210
|
export {
|
|
156
|
-
|
|
211
|
+
Ee as useMeasure
|
|
157
212
|
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export type RecentMeasurePointPlacement = {
|
|
2
|
+
lat: number;
|
|
3
|
+
lng: number;
|
|
4
|
+
timestamp: number;
|
|
5
|
+
};
|
|
1
6
|
export type MeasurePoint = {
|
|
2
7
|
marker: L.Marker;
|
|
3
8
|
labelMarker: L.Marker;
|
|
@@ -9,5 +14,6 @@ export interface RefCurrentMeasure {
|
|
|
9
14
|
measurePoints: Array<MeasurePoint>;
|
|
10
15
|
layerLine?: L.Polyline;
|
|
11
16
|
magnitude: string;
|
|
17
|
+
recentPointPlacement?: RecentMeasurePointPlacement;
|
|
12
18
|
}
|
|
13
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;IACtB,0BAA0B,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD,CAAC;AACF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GAAG;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;IACtB,0BAA0B,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD,CAAC;AACF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,2BAA2B,CAAC;CACpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyActions.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MyActions.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.tsx"],"names":[],"mappings":"AAoBA;;GAEG;AACH,wBAAgB,SAAS,qDA8CxB"}
|
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useFormContext as
|
|
3
|
-
import { ActionsContainer as
|
|
1
|
+
import { jsx as o } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useFormContext as E, useWatch as c } from "react-hook-form";
|
|
3
|
+
import { ActionsContainer as u, Button as A } from "@m4l/components";
|
|
4
4
|
import { useModuleDictionary as m } from "@m4l/core";
|
|
5
|
-
import { MAP_DICCTIONARY as
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { MAP_DICCTIONARY as e } from "../../../../../../../../dictionary.js";
|
|
6
|
+
import { MEASURE_TOOL_INTERACTION_OWNER_ID as C, MEASURE_TOOL_REQUIRED_INTERACTION_CHANNELS as d } from "../../constants.js";
|
|
7
|
+
import { useMapInteractionCapture as f } from "../../../../../../../../hooks/useMapInteractionCapture.js";
|
|
8
|
+
function D() {
|
|
9
|
+
const { control: r, setValue: i } = E(), { getLabel: n } = m(), t = c({
|
|
8
10
|
control: r,
|
|
9
11
|
name: ["statusEdition", "reInits"]
|
|
10
|
-
})[0]
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
})[0], {
|
|
13
|
+
isAvailable: a,
|
|
14
|
+
releaseAllCapture: s,
|
|
15
|
+
requestCapture: l
|
|
16
|
+
} = f({
|
|
17
|
+
ownerId: C,
|
|
18
|
+
channels: d
|
|
19
|
+
});
|
|
20
|
+
return /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o(
|
|
21
|
+
A,
|
|
13
22
|
{
|
|
14
23
|
onClick: () => {
|
|
15
|
-
|
|
24
|
+
if (t === "initial") {
|
|
25
|
+
if (!l())
|
|
26
|
+
return;
|
|
27
|
+
i("statusEdition", "draw");
|
|
28
|
+
} else t === "draw" && (s(), i("statusEdition", "initial"));
|
|
16
29
|
},
|
|
17
|
-
|
|
30
|
+
disabled: t === "initial" && !a,
|
|
31
|
+
label: n(t === "initial" ? e.LABEL_MEASURE_START : e.LABEL_MEASURE_CANCEL)
|
|
18
32
|
}
|
|
19
33
|
) });
|
|
20
34
|
}
|
|
21
35
|
export {
|
|
22
|
-
|
|
36
|
+
D as MyActions
|
|
23
37
|
};
|
package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/Layer/Layer.js
CHANGED
|
@@ -4,10 +4,10 @@ import { LayerGroup as M } from "react-leaflet";
|
|
|
4
4
|
import C from "leaflet";
|
|
5
5
|
import { shallow as f } from "zustand/shallow";
|
|
6
6
|
import { deepShallow as g } from "@m4l/components";
|
|
7
|
-
import { useMapStore as u } from "../../../../hooks/useMapStore/index.js";
|
|
8
7
|
import { useFilterDecimation as L } from "../../../../hooks/useFilterDecimation/useFilterDecimation.js";
|
|
9
8
|
import { RenderByEachFeatureComponent as j, MemonizedRenderByEachFeatureComponent as b } from "./subcomponents/RenderByEachFeatureComponent/RenderByEachFeatureComponent.js";
|
|
10
9
|
import { MarkerClusterGroup as I } from "./subcomponents/MarkerClusterGroup/MarkerClusterGroup.js";
|
|
10
|
+
import { useMapStore as u } from "../../../../hooks/useMapStore/index.js";
|
|
11
11
|
const E = (v) => {
|
|
12
12
|
const { layerId: r } = v, n = u((o) => {
|
|
13
13
|
const e = o.hashLayers[r]?.geoJsonObject;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PositionMapTool } from '../../../GpsMap/types';
|
|
2
2
|
import { RNDDefaultPosition } from '@m4l/components';
|
|
3
3
|
import { StyleDashArray } from './model';
|
|
4
|
+
import { InteractionChannel } from '../../../GpsMap/contexts/MapContext/types';
|
|
4
5
|
export declare const ENDPOINT_GEOFENCES_GET = "geofences";
|
|
5
6
|
export declare const ENDPOINT_GEOFENCES_NEW_EDIT = "geofences";
|
|
6
7
|
export declare const ENDPOINT_DEVICES_LIST = "devices";
|
|
@@ -10,5 +11,10 @@ export declare enum GeofencesLayers {
|
|
|
10
11
|
}
|
|
11
12
|
export declare const GEOFENCES_TOOL: PositionMapTool;
|
|
12
13
|
export declare const GEOFENCES_TOOL_DEFAULT_POSITION: RNDDefaultPosition;
|
|
14
|
+
export declare const GEOFENCES_DRAW_INTERACTION_OWNER_ID = "geofences-draw";
|
|
15
|
+
export declare const GEOFENCES_DRAW_REQUIRED_INTERACTION_CHANNELS: InteractionChannel[];
|
|
16
|
+
export declare const GEOFENCES_ADD_EDIT_VISUAL_REQUIRED_INTERACTION_CHANNELS: InteractionChannel[];
|
|
17
|
+
export declare const GEOFENCES_ADD_EDIT_INTERACTION_OWNER_ID = "geofences-add-edit-entry";
|
|
18
|
+
export declare const GEOFENCES_ADD_EDIT_REQUIRED_INTERACTION_CHANNELS: InteractionChannel[];
|
|
13
19
|
export declare const STYLE_PATTERNS: StyleDashArray[];
|
|
14
20
|
//# sourceMappingURL=constants.d.ts.map
|
package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAGpF,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAClD,eAAO,MAAM,2BAA2B,cAAc,CAAC;AACvD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,eAAO,MAAM,4BAA4B,cAAc,CAAC;AAGxD,oBAAY,eAAe;IACzB,eAAe,cAA+B;CAG/C;AAGD,eAAO,MAAM,cAAc,EAAE,eAa5B,CAAC;AAGF,eAAO,MAAM,+BAA+B,EAAE,kBAG7C,CAAC;AAEF,eAAO,MAAM,mCAAmC,mBAAmB,CAAC;AACpE,eAAO,MAAM,4CAA4C,EAAE,kBAAkB,EAG5E,CAAC;AACF,eAAO,MAAM,uDAAuD,EAAE,kBAAkB,EAEvF,CAAC;AACF,eAAO,MAAM,uCAAuC,6BAA6B,CAAC;AAClF,eAAO,MAAM,gDAAgD,EAAE,kBAAkB,EAEhF,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,cAAc,EAa1C,CAAC"}
|
|
@@ -1,46 +1,58 @@
|
|
|
1
|
-
import { GPS_TOOLS_COMPONENT_PATH_ID as
|
|
2
|
-
import { MAP_GPSTOOLS_DICCTIONARY as
|
|
3
|
-
import { MAP_GPSTOOLS_ICONS as
|
|
4
|
-
import { GeofencesTool as
|
|
5
|
-
const
|
|
6
|
-
var
|
|
7
|
-
const
|
|
1
|
+
import { GPS_TOOLS_COMPONENT_PATH_ID as O } from "../../constants.js";
|
|
2
|
+
import { MAP_GPSTOOLS_DICCTIONARY as _ } from "../../dictionary.js";
|
|
3
|
+
import { MAP_GPSTOOLS_ICONS as o } from "../../icons.js";
|
|
4
|
+
import { GeofencesTool as N } from "./GeofencesTool.js";
|
|
5
|
+
const i = "geofences", r = "geofences", c = "devices", t = "geofences";
|
|
6
|
+
var T = /* @__PURE__ */ ((E) => (E[E.LAYER_GEOFENCES = t] = "LAYER_GEOFENCES", E))(T || {});
|
|
7
|
+
const A = {
|
|
8
8
|
position: "topright",
|
|
9
9
|
type: "popup",
|
|
10
10
|
isInternal: !0,
|
|
11
|
-
componentPathId:
|
|
12
|
-
iconId:
|
|
13
|
-
id:
|
|
14
|
-
dictionaryId:
|
|
11
|
+
componentPathId: O,
|
|
12
|
+
iconId: o.GEOFENCES_TOOL,
|
|
13
|
+
id: t,
|
|
14
|
+
dictionaryId: _.LABEL_GEOFENCES,
|
|
15
15
|
popupDefaultPosition: {
|
|
16
16
|
vertical: { top: 16, bottom: 50 },
|
|
17
17
|
horizontal: { right: -55, width: 380, magnetize: !0 }
|
|
18
18
|
},
|
|
19
|
-
PopupContentComponent:
|
|
20
|
-
},
|
|
19
|
+
PopupContentComponent: N
|
|
20
|
+
}, C = {
|
|
21
21
|
vertical: { top: 16, bottom: 50 },
|
|
22
22
|
horizontal: { right: -55, width: 380, magnetize: !0 }
|
|
23
|
-
},
|
|
23
|
+
}, D = "geofences-draw", R = [
|
|
24
|
+
"draw_geometry",
|
|
25
|
+
"viewport_control"
|
|
26
|
+
], s = [
|
|
27
|
+
"viewport_control"
|
|
28
|
+
], L = "geofences-add-edit-entry", d = [
|
|
29
|
+
"map_click"
|
|
30
|
+
], p = [
|
|
24
31
|
{
|
|
25
32
|
id: "solid",
|
|
26
|
-
dictionaryId:
|
|
27
|
-
iconId:
|
|
33
|
+
dictionaryId: _.LABEL_STROKE_PATTERN_SOLID,
|
|
34
|
+
iconId: o.GEOFENCES_STROKE_PATTERN_SOLID,
|
|
28
35
|
style: ""
|
|
29
36
|
},
|
|
30
37
|
{
|
|
31
38
|
id: "dash",
|
|
32
|
-
dictionaryId:
|
|
33
|
-
iconId:
|
|
39
|
+
dictionaryId: _.LABEL_STROKE_PATTERN_DASH,
|
|
40
|
+
iconId: o.GEOFENCES_STROKE_PATTERN_DASH,
|
|
34
41
|
style: "4 8"
|
|
35
42
|
}
|
|
36
43
|
];
|
|
37
44
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
c as ENDPOINT_DEVICES_LIST,
|
|
46
|
+
i as ENDPOINT_GEOFENCES_GET,
|
|
47
|
+
r as ENDPOINT_GEOFENCES_NEW_EDIT,
|
|
48
|
+
L as GEOFENCES_ADD_EDIT_INTERACTION_OWNER_ID,
|
|
49
|
+
d as GEOFENCES_ADD_EDIT_REQUIRED_INTERACTION_CHANNELS,
|
|
50
|
+
s as GEOFENCES_ADD_EDIT_VISUAL_REQUIRED_INTERACTION_CHANNELS,
|
|
51
|
+
D as GEOFENCES_DRAW_INTERACTION_OWNER_ID,
|
|
52
|
+
R as GEOFENCES_DRAW_REQUIRED_INTERACTION_CHANNELS,
|
|
53
|
+
A as GEOFENCES_TOOL,
|
|
54
|
+
C as GEOFENCES_TOOL_DEFAULT_POSITION,
|
|
55
|
+
t as GEOFENCES_TOOL_LIST_POPUP_ID,
|
|
56
|
+
T as GeofencesLayers,
|
|
57
|
+
p as STYLE_PATTERNS
|
|
46
58
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useWindowToolsMF as
|
|
3
|
-
import { usePaginate as
|
|
1
|
+
import { useState as D, useEffect as c, useMemo as H, useCallback as L } from "react";
|
|
2
|
+
import { useWindowToolsMF as Q, useDataGridPersistence as R } from "@m4l/components";
|
|
3
|
+
import { usePaginate as U } from "@m4l/graphics";
|
|
4
4
|
import { useGpsMapToolsStore as d } from "../../../hooks/useGpsMapToolsStore/index.js";
|
|
5
5
|
import { shallow as f } from "zustand/shallow";
|
|
6
|
-
import { useFilterAndSort as
|
|
7
|
-
function
|
|
8
|
-
const { goAdd: m, labelAdd: u, refreshCount: a } = l, { startProgress:
|
|
6
|
+
import { useFilterAndSort as q } from "./useFilterAndSort/useFilterAndSort.js";
|
|
7
|
+
function J(l) {
|
|
8
|
+
const { goAdd: m, labelAdd: u, enableAdd: h, refreshCount: a } = l, { startProgress: g, stopProgress: C } = Q(), [t] = d(
|
|
9
9
|
(e) => [
|
|
10
10
|
e.geofenceState.checkedGeofences
|
|
11
11
|
],
|
|
12
12
|
f
|
|
13
|
-
), { verifyAddOrChangedGeofenceFromList:
|
|
13
|
+
), { verifyAddOrChangedGeofenceFromList: p, setCheckedGeofences: i } = d(
|
|
14
14
|
(e) => e.geofenceActions,
|
|
15
15
|
f
|
|
16
|
-
), [
|
|
16
|
+
), [P, k] = D({}), { pagerState: A, rows: s, onPageChange: G, onRowsPerPageChange: S, Refresh: n } = U(
|
|
17
17
|
{
|
|
18
18
|
endPoint: "geofences",
|
|
19
19
|
fireOnChangeParms: !1,
|
|
20
20
|
fireOnFirstLoad: !1,
|
|
21
|
-
queryParams:
|
|
21
|
+
queryParams: P,
|
|
22
22
|
responseToCamelCase: !0,
|
|
23
|
-
startProgress:
|
|
24
|
-
stopProgress:
|
|
23
|
+
startProgress: g,
|
|
24
|
+
stopProgress: C
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
c(() => {
|
|
28
28
|
a > 0 && n();
|
|
29
29
|
}, [a, n]);
|
|
30
|
-
const
|
|
30
|
+
const F = H(() => new Set(Array.from(t).filter((e) => s.some((o) => o.id === e))), [t, s]), y = L((e) => {
|
|
31
31
|
const o = new Set(t);
|
|
32
32
|
s.forEach((r) => {
|
|
33
33
|
e.has(r.id) ? o.has(r.id) || o.add(r.id) : o.delete(r.id);
|
|
@@ -35,27 +35,27 @@ function I(l) {
|
|
|
35
35
|
}, [t, s, i]);
|
|
36
36
|
c(() => {
|
|
37
37
|
s.forEach((e) => {
|
|
38
|
-
|
|
38
|
+
p(e.id, e);
|
|
39
39
|
});
|
|
40
40
|
}, [s]);
|
|
41
|
-
const { onChangeUserColumns:
|
|
41
|
+
const { onChangeUserColumns: b, defaultUserColumns: x } = R({ prefixCookie: "master_all" }), { leftActions: O, rightActions: v, visibleCustomHeader: E, customHeaderComponent: M, externalFilterSettings: T, externalSortSettings: w } = q({ labelAdd: u, goAdd: m, enableAdd: h, setBackendQueryParams: k, refresh: n });
|
|
42
42
|
return {
|
|
43
|
-
pagerState:
|
|
43
|
+
pagerState: A,
|
|
44
44
|
onPageChange: G,
|
|
45
45
|
onRowsPerPageChange: S,
|
|
46
46
|
rows: s,
|
|
47
|
-
defaultUserColumns:
|
|
48
|
-
onChangeUserColumns:
|
|
49
|
-
leftActions:
|
|
50
|
-
rightActions:
|
|
51
|
-
visibleCustomHeader:
|
|
52
|
-
customHeaderComponent:
|
|
53
|
-
checkedGeofencesFiltered:
|
|
54
|
-
setCheckedGeofencesFiltered:
|
|
55
|
-
externalFilterSettings:
|
|
56
|
-
externalSortSettings:
|
|
47
|
+
defaultUserColumns: x,
|
|
48
|
+
onChangeUserColumns: b,
|
|
49
|
+
leftActions: O,
|
|
50
|
+
rightActions: v,
|
|
51
|
+
visibleCustomHeader: E,
|
|
52
|
+
customHeaderComponent: M,
|
|
53
|
+
checkedGeofencesFiltered: F,
|
|
54
|
+
setCheckedGeofencesFiltered: y,
|
|
55
|
+
externalFilterSettings: T,
|
|
56
|
+
externalSortSettings: w
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
J as useDatagridFiltered
|
|
61
61
|
};
|