@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,34 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { useWindowToolsMF as
|
|
1
|
+
import { jsx as k } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useCallback as w } from "react";
|
|
3
|
+
import { useWindowToolsMF as O, getRawSortsForNetwork as h, getRawFiltersForNetwork as v, useDynamicFilterAndSort as b, IconButton as N } from "@m4l/components";
|
|
4
4
|
import { useFilterFields as P } from "./useFilterFields.js";
|
|
5
|
-
import { useSortFields as
|
|
6
|
-
import { useEnvironment as
|
|
7
|
-
import { MAP_GPSTOOLS_ICONS as
|
|
8
|
-
import { GPS_TOOLS_COMPONENT_PATH_ID as
|
|
9
|
-
function
|
|
10
|
-
const { goAdd: r, setBackendQueryParams: e, refresh: t,
|
|
5
|
+
import { useSortFields as x } from "./useSortFields.js";
|
|
6
|
+
import { useEnvironment as E } from "@m4l/core";
|
|
7
|
+
import { MAP_GPSTOOLS_ICONS as T } from "../../../../icons.js";
|
|
8
|
+
import { GPS_TOOLS_COMPONENT_PATH_ID as D } from "../../../../constants.js";
|
|
9
|
+
function L(s) {
|
|
10
|
+
const { goAdd: r, setBackendQueryParams: e, refresh: t, enableAdd: i, labelAdd: n } = s, l = P(), a = x(), { setCookie: c, getCookie: d } = O(), { environment_assets: m, host_static_assets: f } = E(), F = `${f}/${m}/frontend/components/${D}/assets/icons/${T.GEOFENCES_ADD}`, S = w((o) => {
|
|
11
11
|
e({
|
|
12
|
-
f:
|
|
13
|
-
s:
|
|
12
|
+
f: v(o.eventFilters?.rawFilters, "snakeCase"),
|
|
13
|
+
s: h(o.eventSorts?.rawSorts, "snakeCase")
|
|
14
14
|
}), t();
|
|
15
|
-
}, [t, e]), { leftActions:
|
|
15
|
+
}, [t, e]), { leftActions: u, visibleCustomHeader: p, customHeaderComponent: A, rightActions: C, externalFilterSettings: _, externalSortSettings: g } = b({
|
|
16
16
|
prefixCookie: "geofences_all",
|
|
17
|
-
onChangeFilterSort:
|
|
18
|
-
fields:
|
|
19
|
-
sorts:
|
|
17
|
+
onChangeFilterSort: S,
|
|
18
|
+
fields: l,
|
|
19
|
+
sorts: a,
|
|
20
20
|
withAllField: !0,
|
|
21
|
-
setCookie:
|
|
22
|
-
getCookie:
|
|
21
|
+
setCookie: c,
|
|
22
|
+
getCookie: d,
|
|
23
23
|
visibleRefresh: !1,
|
|
24
|
-
rightActions: /* @__PURE__ */
|
|
24
|
+
rightActions: /* @__PURE__ */ k(
|
|
25
25
|
N,
|
|
26
26
|
{
|
|
27
27
|
variant: "contained",
|
|
28
28
|
color: "primary",
|
|
29
|
-
icon:
|
|
30
|
-
disabled: !
|
|
31
|
-
tooltip:
|
|
29
|
+
icon: F,
|
|
30
|
+
disabled: !i,
|
|
31
|
+
tooltip: n,
|
|
32
32
|
onClick: () => {
|
|
33
33
|
r();
|
|
34
34
|
}
|
|
@@ -36,14 +36,14 @@ function B(s) {
|
|
|
36
36
|
)
|
|
37
37
|
});
|
|
38
38
|
return {
|
|
39
|
-
leftActions:
|
|
39
|
+
leftActions: u,
|
|
40
40
|
rightActions: C,
|
|
41
|
-
visibleCustomHeader:
|
|
42
|
-
customHeaderComponent:
|
|
43
|
-
externalFilterSettings:
|
|
44
|
-
externalSortSettings:
|
|
41
|
+
visibleCustomHeader: p,
|
|
42
|
+
customHeaderComponent: A,
|
|
43
|
+
externalFilterSettings: _,
|
|
44
|
+
externalSortSettings: g
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
L as useFilterAndSort
|
|
49
49
|
};
|
package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useMaster.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState as b, useCallback as A, useMemo as
|
|
1
|
+
import { useState as b, useCallback as A, useMemo as l, useEffect as G } from "react";
|
|
2
2
|
import { useModuleDynamicActions as h } from "./useModuleDynamicActions.js";
|
|
3
3
|
import { useTabFiltered as w } from "./useTabFiltered.js";
|
|
4
4
|
import { useLayers as y } from "./useLayers.js";
|
|
@@ -8,13 +8,13 @@ import { useRowActionsGetter as S } from "./useRowActionsGetter.js";
|
|
|
8
8
|
import { useTabSelected as T } from "./useTabSelected.js";
|
|
9
9
|
import { useGpsMapToolsStore as R } from "../../../hooks/useGpsMapToolsStore/index.js";
|
|
10
10
|
function j() {
|
|
11
|
-
const { columns: t } = M(), [
|
|
11
|
+
const { columns: t } = M(), [d, r] = b(0), { flushGeofences: s } = R((e) => e.geofenceActions), n = A(() => {
|
|
12
12
|
r((e) => e + 1);
|
|
13
|
-
}, [r]), u =
|
|
13
|
+
}, [r]), u = l(() => (e) => e.id, []), { rowActionsGetter: c } = S({ fullRefresh: n }), { goAdd: m, labelAdd: f, enableAdd: a } = h({ fullRefresh: n });
|
|
14
14
|
y(), C(), G(() => () => {
|
|
15
15
|
s();
|
|
16
16
|
}, [s]);
|
|
17
|
-
const o = w({ goAdd: m, labelAdd: f, columns: t, rowActionsGetter: c, rowKeyGetter: u, refreshCount:
|
|
17
|
+
const o = w({ goAdd: m, labelAdd: f, enableAdd: a, columns: t, rowActionsGetter: c, rowKeyGetter: u, refreshCount: d }), i = T({ goAdd: m, labelAdd: f, enableAdd: a, columns: t, rowActionsGetter: c, rowKeyGetter: u }), p = l(() => [o, i], [o, i]);
|
|
18
18
|
return {
|
|
19
19
|
defaultTab: o.value,
|
|
20
20
|
tabs: p
|
|
@@ -2,7 +2,7 @@ interface UseModuleDynamicActionsProps {
|
|
|
2
2
|
fullRefresh: () => void;
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
5
|
-
* Hook
|
|
5
|
+
* Hook responsible for managing the module dynamic actions rendered in the `WindowBase` header.
|
|
6
6
|
*/
|
|
7
7
|
export declare function useModuleDynamicActions(props: UseModuleDynamicActionsProps): {
|
|
8
8
|
goAdd: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModuleDynamicActions.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useModuleDynamicActions.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.tsx"],"names":[],"mappings":"AAuBA,UAAU,4BAA4B;IACpC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AACD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B;;;;EA6D1E"}
|
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
import { useEnvironment as f, useModuleDictionary as
|
|
2
|
-
import { useModule as
|
|
3
|
-
import { useMemo as d, useCallback as
|
|
4
|
-
import { MAP_GPSTOOLS_DICCTIONARY as
|
|
1
|
+
import { useEnvironment as f, useModuleDictionary as D, useModulePrivileges as N } from "@m4l/core";
|
|
2
|
+
import { useModule as I } from "@m4l/layouts";
|
|
3
|
+
import { useMemo as d, useCallback as C, useEffect as T } from "react";
|
|
4
|
+
import { MAP_GPSTOOLS_DICCTIONARY as m } from "../../../dictionary.js";
|
|
5
5
|
import { MAP_GPSTOOLS_ICONS as S } from "../../../icons.js";
|
|
6
|
-
import { usePopupsStore as
|
|
7
|
-
import { shallow as
|
|
8
|
-
import { GeofencesLayers as
|
|
9
|
-
import { Form as
|
|
10
|
-
import { GPS_TOOLS_COMPONENT_PATH_ID as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { usePopupsStore as _ } from "@m4l/components";
|
|
7
|
+
import { shallow as O } from "zustand/shallow";
|
|
8
|
+
import { GEOFENCES_ADD_EDIT_INTERACTION_OWNER_ID as P, GEOFENCES_ADD_EDIT_REQUIRED_INTERACTION_CHANNELS as M, GeofencesLayers as L, GEOFENCES_TOOL_DEFAULT_POSITION as G } from "../constants.js";
|
|
9
|
+
import { Form as b } from "../subcomponents/GeofenceAddEdit/Form.js";
|
|
10
|
+
import { GPS_TOOLS_COMPONENT_PATH_ID as F } from "../../../constants.js";
|
|
11
|
+
import { useMapInteractionCapture as R } from "../../../../GpsMap/hooks/useMapInteractionCapture.js";
|
|
12
|
+
function Q(u) {
|
|
13
|
+
const { fullRefresh: r } = u, { setDynamicActions: E } = I(), { host_static_assets: a, environment_assets: c } = f(), { addPopup: l } = _((i) => i.popupsActions, O), { hide: p } = _((i) => i.popupActions, O), { getLabel: e } = D(), { hasPrivilege: A } = N(), { isAvailable: o } = R({
|
|
14
|
+
ownerId: P,
|
|
15
|
+
channels: M,
|
|
16
|
+
autoReleaseOnUnmount: !1
|
|
17
|
+
}), t = d(() => `${a}/${c}/frontend/components/${F}/assets/icons/${S.GEOFENCES_ADD}`, [a, c]), n = d(() => e(m.MODULE_NAME_GEOFENCE_ADD), [e]), s = C(() => {
|
|
18
|
+
o && (p(L.LAYER_GEOFENCES), l({
|
|
14
19
|
popupId: "geofencesAddEdit",
|
|
15
20
|
winType: "component",
|
|
16
|
-
title:
|
|
17
|
-
component:
|
|
21
|
+
title: n,
|
|
22
|
+
component: b,
|
|
18
23
|
componentProps: {
|
|
19
|
-
fullRefresh:
|
|
24
|
+
fullRefresh: r
|
|
20
25
|
},
|
|
21
|
-
defaultPosition:
|
|
22
|
-
iconUrl:
|
|
23
|
-
});
|
|
24
|
-
}, [
|
|
25
|
-
return
|
|
26
|
-
|
|
26
|
+
defaultPosition: G,
|
|
27
|
+
iconUrl: t
|
|
28
|
+
}));
|
|
29
|
+
}, [o, p, l, n, r, t]);
|
|
30
|
+
return T(() => {
|
|
31
|
+
E([
|
|
27
32
|
{
|
|
28
|
-
iconUrl:
|
|
33
|
+
iconUrl: t,
|
|
29
34
|
onClick: s,
|
|
30
35
|
visibility: "allways",
|
|
31
|
-
label:
|
|
36
|
+
label: e(m.MODULE_NAME_GEOFENCE_ADD),
|
|
32
37
|
tag: "add",
|
|
33
|
-
key: "add"
|
|
38
|
+
key: "add",
|
|
39
|
+
disabled: !o
|
|
34
40
|
}
|
|
35
41
|
]);
|
|
36
|
-
}, [
|
|
42
|
+
}, [A, o, e, E, t, s]), {
|
|
37
43
|
goAdd: s,
|
|
38
|
-
labelAdd:
|
|
39
|
-
enableAdd:
|
|
44
|
+
labelAdd: n,
|
|
45
|
+
enableAdd: o
|
|
40
46
|
};
|
|
41
47
|
}
|
|
42
48
|
export {
|
|
43
|
-
|
|
49
|
+
Q as useModuleDynamicActions
|
|
44
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRowActionsGetter.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useRowActionsGetter.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useRowActionsGetter.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useRowActionsGetter.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAa/C,UAAU,kBAAkB;IAC1B,WAAW,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AACD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB;4BA8HnD,mBAAmB,KAAG,UAAU,EAAE,GAAG,EAAE;EAwDhD"}
|
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
import { jsx as P } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useNetwork as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { MAP_GPSTOOLS_ICONS as
|
|
2
|
+
import { useNetwork as h, useModuleDictionary as M, useEnvironment as R, useHostTools as $ } from "@m4l/core";
|
|
3
|
+
import { useState as C, useCallback as r } from "react";
|
|
4
|
+
import { MAP_GPSTOOLS_ICONS as N } from "../../../icons.js";
|
|
5
5
|
import { MAP_GPSTOOLS_DICCTIONARY as n } from "../../../dictionary.js";
|
|
6
|
-
import { useModal as
|
|
6
|
+
import { useModal as F, usePopupsStore as G, WindowConfirm as g } from "@m4l/components";
|
|
7
7
|
import { useGpsMapToolsStore as k } from "../../../hooks/useGpsMapToolsStore/index.js";
|
|
8
|
-
import { shallow as
|
|
9
|
-
import { Form as
|
|
10
|
-
import { GeofencesLayers as
|
|
11
|
-
import { GEOFENCES_TOOL_ADD_EDIT_POPUP_ID as
|
|
12
|
-
import { GPS_TOOLS_COMPONENT_PATH_ID as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
import { shallow as c } from "zustand/shallow";
|
|
9
|
+
import { Form as w } from "../subcomponents/GeofenceAddEdit/Form.js";
|
|
10
|
+
import { GEOFENCES_ADD_EDIT_INTERACTION_OWNER_ID as y, GEOFENCES_ADD_EDIT_REQUIRED_INTERACTION_CHANNELS as U, GeofencesLayers as b, GEOFENCES_TOOL_DEFAULT_POSITION as v } from "../constants.js";
|
|
11
|
+
import { GEOFENCES_TOOL_ADD_EDIT_POPUP_ID as W } from "../subcomponents/GeofenceAddEdit/constants.js";
|
|
12
|
+
import { GPS_TOOLS_COMPONENT_PATH_ID as L } from "../../../constants.js";
|
|
13
|
+
import { useMapInteractionCapture as H } from "../../../../GpsMap/hooks/useMapInteractionCapture.js";
|
|
14
|
+
function to(S) {
|
|
15
|
+
const { fullRefresh: s } = S, { networkOperation: m } = h(), { openModal: p, closeModal: _ } = F(), { getLabel: e } = M(), { host_static_assets: a, environment_assets: l } = R(), { addPopup: O } = G((o) => o.popupsActions, c), { hide: u } = G((o) => o.popupActions, c), { removeCheckedGeofence: I } = k((o) => o.geofenceActions, c), { isAvailable: i } = H({
|
|
16
|
+
ownerId: y,
|
|
17
|
+
channels: U,
|
|
18
|
+
autoReleaseOnUnmount: !1
|
|
19
|
+
}), { toast: d } = $(), [E] = C(
|
|
20
|
+
`${a}/${l}/frontend/components/${L}/assets/icons/${N.GEOFENCES_EDIT}`
|
|
21
|
+
), [T] = C(
|
|
22
|
+
`${a}/${l}/frontend/components/${L}/assets/icons/${N.GEOFENCES_DELETE}`
|
|
23
|
+
), D = r((o, t) => {
|
|
24
|
+
i && (u(b.LAYER_GEOFENCES), O({
|
|
20
25
|
winType: "component",
|
|
21
|
-
popupId:
|
|
26
|
+
popupId: W,
|
|
22
27
|
title: e(n.MODULE_NAME_GEOFENCE_EDIT),
|
|
23
28
|
editionInfo: `${e(n.LABEL_ID)}:${o} - ${t} `,
|
|
24
29
|
componentProps: { fullRefresh: s, geofenceId: o },
|
|
25
|
-
component:
|
|
30
|
+
component: w,
|
|
26
31
|
// onMouseDown,
|
|
27
|
-
defaultPosition:
|
|
28
|
-
iconUrl:
|
|
29
|
-
}),
|
|
30
|
-
}, [s, O, e,
|
|
31
|
-
|
|
32
|
+
defaultPosition: v,
|
|
33
|
+
iconUrl: E
|
|
34
|
+
}), I(o));
|
|
35
|
+
}, [i, s, O, e, u, I, E]), f = r((o) => {
|
|
36
|
+
m({
|
|
32
37
|
method: "DELETE",
|
|
33
38
|
endPoint: `geofences/${o.id}`
|
|
34
39
|
}).then((t) => {
|
|
35
40
|
d({ title: t.message }, { type: "success" }), s();
|
|
36
|
-
}),
|
|
37
|
-
}, [
|
|
41
|
+
}), _();
|
|
42
|
+
}, [m, d, s, _]), A = r(
|
|
38
43
|
(o) => {
|
|
39
|
-
|
|
44
|
+
p({
|
|
40
45
|
window: /* @__PURE__ */ P(
|
|
41
|
-
|
|
46
|
+
g,
|
|
42
47
|
{
|
|
43
48
|
title: e(n.MODAL_DELETE_GEO_TITLE),
|
|
44
49
|
msg: e(n.MODAL_DELETE_GEO_MESSAGE, o.name),
|
|
45
|
-
onClickIntro: () =>
|
|
50
|
+
onClickIntro: () => f(o)
|
|
46
51
|
}
|
|
47
52
|
),
|
|
48
53
|
variant: "delete",
|
|
@@ -50,27 +55,27 @@ function X(S) {
|
|
|
50
55
|
initialHeight: 350
|
|
51
56
|
});
|
|
52
57
|
},
|
|
53
|
-
[e,
|
|
58
|
+
[e, f, p]
|
|
54
59
|
);
|
|
55
60
|
return { rowActionsGetter: r(
|
|
56
61
|
(o) => {
|
|
57
62
|
const t = [];
|
|
58
63
|
return t.push({
|
|
59
64
|
type: "menuItem",
|
|
60
|
-
startIcon:
|
|
65
|
+
startIcon: E,
|
|
61
66
|
label: e(n.ROW_ACTION_GEO_EDIT),
|
|
62
67
|
onClick: () => {
|
|
63
|
-
|
|
68
|
+
D(o.id, o.name);
|
|
64
69
|
},
|
|
65
70
|
// Solo se habilita si intenta editarse a él mismo, o si tiene permisos pero está en un nivel superior al usuario a editar
|
|
66
71
|
// disabled: !(itsMe || (hasPrivilege(PRIVILEGE_EDIT) && (loggedUserType > row.user_type.id)))
|
|
67
|
-
disabled: !o.userAuthOptions?.edit
|
|
72
|
+
disabled: !o.userAuthOptions?.edit || !i
|
|
68
73
|
}), t.push({
|
|
69
74
|
type: "menuItem",
|
|
70
|
-
startIcon:
|
|
75
|
+
startIcon: T,
|
|
71
76
|
label: e(n.ROW_ACTION_GEO_DELETE),
|
|
72
77
|
onClick: () => {
|
|
73
|
-
|
|
78
|
+
A(o);
|
|
74
79
|
},
|
|
75
80
|
color: "error",
|
|
76
81
|
// Solo se habilita si intenta editarse a él mismo, o si tiene permisos pero está en un nivel superior al usuario a editar
|
|
@@ -78,9 +83,9 @@ function X(S) {
|
|
|
78
83
|
disabled: !o.userAuthOptions?.delete
|
|
79
84
|
}), t;
|
|
80
85
|
},
|
|
81
|
-
[
|
|
86
|
+
[i, e, D, A, T, E]
|
|
82
87
|
) };
|
|
83
88
|
}
|
|
84
89
|
export {
|
|
85
|
-
|
|
90
|
+
to as useRowActionsGetter
|
|
86
91
|
};
|
package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabFiltered.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useDatagridFiltered as
|
|
3
|
-
import { DataGrid as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { useModuleDictionary as
|
|
6
|
-
import { MAP_GPSTOOLS_DICCTIONARY as
|
|
7
|
-
function
|
|
8
|
-
const { goAdd: h, labelAdd: f, columns: r, rowActionsGetter: o, rowKeyGetter:
|
|
1
|
+
import { jsx as C } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useDatagridFiltered as R } from "./useDatagridFiltered.js";
|
|
3
|
+
import { DataGrid as _ } from "@m4l/components";
|
|
4
|
+
import { useMemo as F } from "react";
|
|
5
|
+
import { useModuleDictionary as G } from "@m4l/core";
|
|
6
|
+
import { MAP_GPSTOOLS_DICCTIONARY as L } from "../../../dictionary.js";
|
|
7
|
+
function H(P) {
|
|
8
|
+
const { goAdd: h, labelAdd: f, enableAdd: w, columns: r, rowActionsGetter: o, rowKeyGetter: a, refreshCount: b } = P, { getLabel: A } = G(), {
|
|
9
9
|
rows: t,
|
|
10
10
|
pagerState: e,
|
|
11
|
-
onPageChange:
|
|
11
|
+
onPageChange: s,
|
|
12
12
|
onRowsPerPageChange: n,
|
|
13
13
|
leftActions: i,
|
|
14
14
|
rightActions: l,
|
|
@@ -18,18 +18,18 @@ function E(P) {
|
|
|
18
18
|
setCheckedGeofencesFiltered: m,
|
|
19
19
|
externalFilterSettings: u,
|
|
20
20
|
externalSortSettings: p
|
|
21
|
-
} =
|
|
21
|
+
} = R({ goAdd: h, labelAdd: f, enableAdd: w, refreshCount: b });
|
|
22
22
|
return {
|
|
23
23
|
unmountable: !1,
|
|
24
24
|
value: "filtered",
|
|
25
|
-
tabContent:
|
|
26
|
-
|
|
25
|
+
tabContent: F(() => /* @__PURE__ */ C(
|
|
26
|
+
_,
|
|
27
27
|
{
|
|
28
28
|
id: "master_list_all",
|
|
29
29
|
columns: r,
|
|
30
30
|
rows: t,
|
|
31
31
|
rowActionsGetter: o,
|
|
32
|
-
rowKeyGetter:
|
|
32
|
+
rowKeyGetter: a,
|
|
33
33
|
checkedRows: g,
|
|
34
34
|
onCheckedRowsChange: m,
|
|
35
35
|
visibleCustomHeader: c,
|
|
@@ -48,18 +48,18 @@ function E(P) {
|
|
|
48
48
|
rowsPerPageOptions: [1, 2, 3, 4, 5, 10, 25],
|
|
49
49
|
page: e.page,
|
|
50
50
|
rowsPerPage: e.rowsPerPage,
|
|
51
|
-
onPageChange:
|
|
51
|
+
onPageChange: s,
|
|
52
52
|
onRowsPerPageChange: n
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"master_list_all"
|
|
57
|
-
), [g, r, d, u, p, i,
|
|
57
|
+
), [g, r, d, u, p, i, s, n, e.page, e.rowsPerPage, e.totalRecords, l, o, a, t, m, c]),
|
|
58
58
|
tabProps: {
|
|
59
|
-
label: `${
|
|
59
|
+
label: `${A(L.LABEL_TAB_FILTERED)} (${t.length})`
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
H as useTabFiltered
|
|
65
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAG,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAcrD;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,oBAAoB,oDA8C/C"}
|
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { RHFormProvider as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { StyleData as C } from "./subcomponents/StyleData/index.js";
|
|
2
|
+
import { RHFormProvider as p, Stepper as l, StepperContent as f, Step as r, Stack as d, StepperFooter as u, StepperFooterLeftActions as S, StepperFooterRightActions as h, StepperPrevButton as b, StepperNextButton as g, StepperSubmitButton as y } from "@m4l/components";
|
|
3
|
+
import { useSubmit as F } from "./hooks/useSubmit.js";
|
|
4
|
+
import { ConfigData as v } from "./subcomponents/ConfigData/index.js";
|
|
5
|
+
import { GeneralData as x } from "./subcomponents/GeneralData/GeneralData.js";
|
|
6
|
+
import { StyleData as A } from "./subcomponents/StyleData/index.js";
|
|
8
7
|
import D from "./hooks/useForm.js";
|
|
9
8
|
import { MyActionFormCancel as I } from "./subcomponents/MyActionFormCancel/MyActionFormCancel.js";
|
|
10
|
-
import { AssignmentData as
|
|
11
|
-
import { ChooseAssignmentData as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const { geofenceId: i } = o, { onSubmit: n } = v(o), { steps: m, formValues: s, statusLoad: a, validationSchema: p } = D(o);
|
|
9
|
+
import { AssignmentData as C } from "./subcomponents/AssignmentData/index.js";
|
|
10
|
+
import { ChooseAssignmentData as M } from "./subcomponents/ChooseAssignmentData/index.js";
|
|
11
|
+
function N(o) {
|
|
12
|
+
const { geofenceId: i } = o, { onSubmit: n } = F(o), { steps: m, formValues: s, statusLoad: a, validationSchema: c } = D(o);
|
|
15
13
|
return /* @__PURE__ */ e(
|
|
16
|
-
|
|
14
|
+
p,
|
|
17
15
|
{
|
|
18
16
|
statusLoad: a,
|
|
19
17
|
onSubmit: n,
|
|
20
18
|
values: s,
|
|
21
|
-
validationSchema:
|
|
19
|
+
validationSchema: c,
|
|
22
20
|
children: /* @__PURE__ */ t(l, { indicatorType: "dot", storeId: "form-geofence-add-edit", steps: m, orientation: "vertical", visibleTitle: !1, children: [
|
|
23
21
|
/* @__PURE__ */ t(f, { children: [
|
|
24
22
|
/* @__PURE__ */ e(r, { stepKey: "basic-information", children: /* @__PURE__ */ t(d, { direction: "column", gap: "8px", children: [
|
|
25
|
-
/* @__PURE__ */ e(A, {}),
|
|
26
23
|
/* @__PURE__ */ e(x, {}),
|
|
27
|
-
/* @__PURE__ */ e(
|
|
24
|
+
/* @__PURE__ */ e(v, {}),
|
|
25
|
+
/* @__PURE__ */ e(M, {})
|
|
28
26
|
] }) }, "basic-information"),
|
|
29
|
-
/* @__PURE__ */ e(r, { stepKey: "assignment", children: /* @__PURE__ */ e(
|
|
30
|
-
/* @__PURE__ */ e(r, { stepKey: "style-information", children: /* @__PURE__ */ e(
|
|
27
|
+
/* @__PURE__ */ e(r, { stepKey: "assignment", children: /* @__PURE__ */ e(C, {}) }, "assignment"),
|
|
28
|
+
/* @__PURE__ */ e(r, { stepKey: "style-information", children: /* @__PURE__ */ e(A, {}) }, "style-information")
|
|
31
29
|
] }),
|
|
32
30
|
/* @__PURE__ */ t(u, { children: [
|
|
33
31
|
/* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(I, { geofenceId: i }) }),
|
|
@@ -42,5 +40,5 @@ function V(o) {
|
|
|
42
40
|
);
|
|
43
41
|
}
|
|
44
42
|
export {
|
|
45
|
-
|
|
43
|
+
N as Form
|
|
46
44
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Hook responsible for handling drawing events and syncing the associated geofence
|
|
3
|
+
* data into the hook-form values.
|
|
4
4
|
* @returns
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
@@ -11,5 +11,6 @@ export declare function useDrawing(): {
|
|
|
11
11
|
handleDraw: () => void;
|
|
12
12
|
handleFinish: () => void;
|
|
13
13
|
geometrTypeIdCached: "gt_polygon" | "gt_circle" | "gt_rectangle" | "gt_multipolygon" | null;
|
|
14
|
+
isInteractionAvailable: boolean;
|
|
14
15
|
};
|
|
15
16
|
//# sourceMappingURL=useDrawing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDrawing.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDrawing.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH;;GAEG;AACH,wBAAgB,UAAU;;;;;;EA2WzB"}
|