@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.
Files changed (89) hide show
  1. package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.d.ts +3 -2
  2. package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.d.ts.map +1 -1
  3. package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.js +16 -20
  4. package/components/index.d.ts +1 -0
  5. package/components/index.d.ts.map +1 -1
  6. package/components/maps/components/GpsMap/constants.d.ts +1 -0
  7. package/components/maps/components/GpsMap/constants.d.ts.map +1 -1
  8. package/components/maps/components/GpsMap/constants.js +16 -14
  9. package/components/maps/components/GpsMap/contexts/MapContext/MapContext.d.ts +2 -1
  10. package/components/maps/components/GpsMap/contexts/MapContext/MapContext.d.ts.map +1 -1
  11. package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.d.ts +28 -0
  12. package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.d.ts.map +1 -0
  13. package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.js +111 -0
  14. package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.d.ts +9 -0
  15. package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.d.ts.map +1 -0
  16. package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.js +183 -0
  17. package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.d.ts +112 -0
  18. package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.d.ts.map +1 -0
  19. package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.js +87 -0
  20. package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.d.ts +10 -0
  21. package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.d.ts.map +1 -0
  22. package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.js +12 -0
  23. package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts +2 -1
  24. package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts.map +1 -1
  25. package/components/maps/components/GpsMap/contexts/MapContext/store.d.ts +6 -2
  26. package/components/maps/components/GpsMap/contexts/MapContext/store.d.ts.map +1 -1
  27. package/components/maps/components/GpsMap/contexts/MapContext/store.js +301 -123
  28. package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts +191 -20
  29. package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts.map +1 -1
  30. package/components/maps/components/GpsMap/contexts/MapContext/types.js +8 -0
  31. package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.d.ts.map +1 -1
  32. package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.js +93 -124
  33. package/components/maps/components/GpsMap/hooks/index.d.ts +3 -0
  34. package/components/maps/components/GpsMap/hooks/index.d.ts.map +1 -1
  35. package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.d.ts +12 -0
  36. package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.d.ts.map +1 -0
  37. package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.js +29 -0
  38. package/components/maps/components/GpsMap/hooks/useAutoFocus/index.d.ts +1 -4
  39. package/components/maps/components/GpsMap/hooks/useAutoFocus/index.d.ts.map +1 -1
  40. package/components/maps/components/GpsMap/hooks/useAutoFocus/index.js +32 -59
  41. package/components/maps/components/GpsMap/hooks/useAutoFocus/types.d.ts +4 -13
  42. package/components/maps/components/GpsMap/hooks/useAutoFocus/types.d.ts.map +1 -1
  43. package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.d.ts +7 -0
  44. package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.d.ts.map +1 -0
  45. package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.js +42 -0
  46. package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.types.d.ts +19 -0
  47. package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.types.d.ts.map +1 -0
  48. package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.d.ts +12 -0
  49. package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.d.ts.map +1 -0
  50. package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.js +43 -0
  51. package/components/maps/components/GpsMap/index.d.ts +1 -0
  52. package/components/maps/components/GpsMap/index.d.ts.map +1 -1
  53. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.d.ts +5 -0
  54. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.d.ts.map +1 -1
  55. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.js +20 -13
  56. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts +4 -3
  57. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts.map +1 -1
  58. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.js +175 -120
  59. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts +6 -0
  60. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts.map +1 -1
  61. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.d.ts.map +1 -1
  62. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.js +26 -12
  63. package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/Layer/Layer.js +1 -1
  64. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.d.ts +6 -0
  65. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.d.ts.map +1 -1
  66. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.js +38 -26
  67. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useDatagridFiltered.js +26 -26
  68. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useFilterAndSort.js +27 -27
  69. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useMaster.js +4 -4
  70. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.d.ts +1 -1
  71. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.d.ts.map +1 -1
  72. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.js +34 -28
  73. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useRowActionsGetter.d.ts.map +1 -1
  74. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useRowActionsGetter.js +41 -36
  75. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabFiltered.js +17 -17
  76. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.d.ts.map +1 -1
  77. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.js +16 -18
  78. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.d.ts +3 -2
  79. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.d.ts.map +1 -1
  80. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.js +136 -92
  81. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/GeneralData.d.ts.map +1 -1
  82. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/GeneralData.js +29 -23
  83. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.d.ts +1 -1
  84. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.d.ts.map +1 -1
  85. package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.js +60 -95
  86. package/components/maps/index.d.ts +1 -0
  87. package/components/maps/index.d.ts.map +1 -1
  88. package/index.js +143 -136
  89. package/package.json +3 -4
@@ -1,34 +1,34 @@
1
- import { jsx as g } from "@emotion/react/jsx-runtime";
2
- import { useCallback as k } from "react";
3
- import { useWindowToolsMF as w, getRawSortsForNetwork as O, getRawFiltersForNetwork as h, useDynamicFilterAndSort as v, IconButton as N } from "@m4l/components";
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 b } from "./useSortFields.js";
6
- import { useEnvironment as x } from "@m4l/core";
7
- import { MAP_GPSTOOLS_ICONS as E } from "../../../../icons.js";
8
- import { GPS_TOOLS_COMPONENT_PATH_ID as T } from "../../../../constants.js";
9
- function B(s) {
10
- const { goAdd: r, setBackendQueryParams: e, refresh: t, labelAdd: i } = s, n = P(), l = b(), { setCookie: a, getCookie: c } = w(), { environment_assets: m, host_static_assets: d } = x(), f = `${d}/${m}/frontend/components/${T}/assets/icons/${E.GEOFENCES_ADD}`, F = k((o) => {
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: h(o.eventFilters?.rawFilters, "snakeCase"),
13
- s: O(o.eventSorts?.rawSorts, "snakeCase")
12
+ f: v(o.eventFilters?.rawFilters, "snakeCase"),
13
+ s: h(o.eventSorts?.rawSorts, "snakeCase")
14
14
  }), t();
15
- }, [t, e]), { leftActions: S, visibleCustomHeader: u, customHeaderComponent: p, rightActions: C, externalFilterSettings: A, externalSortSettings: _ } = v({
15
+ }, [t, e]), { leftActions: u, visibleCustomHeader: p, customHeaderComponent: A, rightActions: C, externalFilterSettings: _, externalSortSettings: g } = b({
16
16
  prefixCookie: "geofences_all",
17
- onChangeFilterSort: F,
18
- fields: n,
19
- sorts: l,
17
+ onChangeFilterSort: S,
18
+ fields: l,
19
+ sorts: a,
20
20
  withAllField: !0,
21
- setCookie: a,
22
- getCookie: c,
21
+ setCookie: c,
22
+ getCookie: d,
23
23
  visibleRefresh: !1,
24
- rightActions: /* @__PURE__ */ g(
24
+ rightActions: /* @__PURE__ */ k(
25
25
  N,
26
26
  {
27
27
  variant: "contained",
28
28
  color: "primary",
29
- icon: f,
30
- disabled: !1,
31
- tooltip: i,
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: S,
39
+ leftActions: u,
40
40
  rightActions: C,
41
- visibleCustomHeader: u,
42
- customHeaderComponent: p,
43
- externalFilterSettings: A,
44
- externalSortSettings: _
41
+ visibleCustomHeader: p,
42
+ customHeaderComponent: A,
43
+ externalFilterSettings: _,
44
+ externalSortSettings: g
45
45
  };
46
46
  }
47
47
  export {
48
- B as useFilterAndSort
48
+ L as useFilterAndSort
49
49
  };
@@ -1,4 +1,4 @@
1
- import { useState as b, useCallback as A, useMemo as i, useEffect as G } from "react";
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(), [l, r] = b(0), { flushGeofences: s } = R((e) => e.geofenceActions), n = A(() => {
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 = i(() => (e) => e.id, []), { rowActionsGetter: c } = S({ fullRefresh: n }), { goAdd: m, labelAdd: f, enableAdd: d } = h({ fullRefresh: n });
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: l }), a = T({ goAdd: m, labelAdd: f, enableAdd: d, columns: t, rowActionsGetter: c, rowKeyGetter: u }), p = i(() => [o, a], [o, a]);
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 que se encarga de gestionar las acciones dinámicas del módulo que van en el header del WindowBase
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":"AAiBA,UAAU,4BAA4B;IACpC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AACD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B;;;;EAmD1E"}
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 A, useModulePrivileges as D } from "@m4l/core";
2
- import { useModule as P } from "@m4l/layouts";
3
- import { useMemo as d, useCallback as M, useEffect as N } from "react";
4
- import { MAP_GPSTOOLS_DICCTIONARY as a } from "../../../dictionary.js";
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 E } from "@m4l/components";
7
- import { shallow as u } from "zustand/shallow";
8
- import { GeofencesLayers as C, GEOFENCES_TOOL_DEFAULT_POSITION as L } from "../constants.js";
9
- import { Form as T } from "../subcomponents/GeofenceAddEdit/Form.js";
10
- import { GPS_TOOLS_COMPONENT_PATH_ID as G } from "../../../constants.js";
11
- function w(_) {
12
- const { fullRefresh: i } = _, { setDynamicActions: r } = P(), { host_static_assets: c, environment_assets: m } = f(), { addPopup: p } = E((n) => n.popupsActions, u), { hide: l } = E((n) => n.popupActions, u), { getLabel: o } = A(), { hasPrivilege: O } = D(), e = d(() => `${c}/${m}/frontend/components/${G}/assets/icons/${S.GEOFENCES_ADD}`, [c, m]), t = d(() => o(a.MODULE_NAME_GEOFENCE_ADD), [o]), s = M(() => {
13
- l(C.LAYER_GEOFENCES), p({
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: t,
17
- component: T,
21
+ title: n,
22
+ component: b,
18
23
  componentProps: {
19
- fullRefresh: i
24
+ fullRefresh: r
20
25
  },
21
- defaultPosition: L,
22
- iconUrl: e
23
- });
24
- }, [l, p, t, i, e]);
25
- return N(() => {
26
- r([
26
+ defaultPosition: G,
27
+ iconUrl: t
28
+ }));
29
+ }, [o, p, l, n, r, t]);
30
+ return T(() => {
31
+ E([
27
32
  {
28
- iconUrl: e,
33
+ iconUrl: t,
29
34
  onClick: s,
30
35
  visibility: "allways",
31
- label: o(a.MODULE_NAME_GEOFENCE_ADD),
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
- }, [O, o, r, e, s]), {
42
+ }, [A, o, e, E, t, s]), {
37
43
  goAdd: s,
38
- labelAdd: t,
39
- enableAdd: !0
44
+ labelAdd: n,
45
+ enableAdd: o
40
46
  };
41
47
  }
42
48
  export {
43
- w as useModuleDynamicActions
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;AAQ/C,UAAU,kBAAkB;IAC1B,WAAW,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AACD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB;4BAoHnD,mBAAmB,KAAG,UAAU,EAAE,GAAG,EAAE;EAwDhD"}
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 N, useModuleDictionary as h, useEnvironment as M, useHostTools as $ } from "@m4l/core";
3
- import { useState as A, useCallback as r } from "react";
4
- import { MAP_GPSTOOLS_ICONS as G } from "../../../icons.js";
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 g, usePopupsStore as L, WindowConfirm as F } from "@m4l/components";
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 E } from "zustand/shallow";
9
- import { Form as y } from "../subcomponents/GeofenceAddEdit/Form.js";
10
- import { GeofencesLayers as R, GEOFENCES_TOOL_DEFAULT_POSITION as w } from "../constants.js";
11
- import { GEOFENCES_TOOL_ADD_EDIT_POPUP_ID as b } from "../subcomponents/GeofenceAddEdit/constants.js";
12
- import { GPS_TOOLS_COMPONENT_PATH_ID as C } from "../../../constants.js";
13
- function X(S) {
14
- const { fullRefresh: s } = S, { networkOperation: c } = N(), { openModal: m, closeModal: p } = g(), { getLabel: e } = h(), { host_static_assets: l, environment_assets: _ } = M(), { addPopup: O } = L((o) => o.popupsActions, E), { hide: a } = L((o) => o.popupActions, E), { removeCheckedGeofence: u } = k((o) => o.geofenceActions, E), { toast: d } = $(), [i] = A(
15
- `${l}/${_}/frontend/components/${C}/assets/icons/${G.GEOFENCES_EDIT}`
16
- ), [f] = A(
17
- `${l}/${_}/frontend/components/${C}/assets/icons/${G.GEOFENCES_DELETE}`
18
- ), T = r((o, t) => {
19
- a(R.LAYER_GEOFENCES), O({
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: b,
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: y,
30
+ component: w,
26
31
  // onMouseDown,
27
- defaultPosition: w,
28
- iconUrl: i
29
- }), u(o);
30
- }, [s, O, e, a, u, i]), I = r((o) => {
31
- c({
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
- }), p();
37
- }, [c, d, s, p]), D = r(
41
+ }), _();
42
+ }, [m, d, s, _]), A = r(
38
43
  (o) => {
39
- m({
44
+ p({
40
45
  window: /* @__PURE__ */ P(
41
- F,
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: () => I(o)
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, I, m]
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: i,
65
+ startIcon: E,
61
66
  label: e(n.ROW_ACTION_GEO_EDIT),
62
67
  onClick: () => {
63
- T(o.id, o.name);
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: f,
75
+ startIcon: T,
71
76
  label: e(n.ROW_ACTION_GEO_DELETE),
72
77
  onClick: () => {
73
- D(o);
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
- [e, T, D, f, i]
86
+ [i, e, D, A, T, E]
82
87
  ) };
83
88
  }
84
89
  export {
85
- X as useRowActionsGetter
90
+ to as useRowActionsGetter
86
91
  };
@@ -1,14 +1,14 @@
1
- import { jsx as b } from "@emotion/react/jsx-runtime";
2
- import { useDatagridFiltered as A } from "./useDatagridFiltered.js";
3
- import { DataGrid as R } from "@m4l/components";
4
- import { useMemo as _ } from "react";
5
- import { useModuleDictionary as F } from "@m4l/core";
6
- import { MAP_GPSTOOLS_DICCTIONARY as G } from "../../../dictionary.js";
7
- function E(P) {
8
- const { goAdd: h, labelAdd: f, columns: r, rowActionsGetter: o, rowKeyGetter: s, refreshCount: w } = P, { getLabel: C } = F(), {
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: a,
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
- } = A({ goAdd: h, labelAdd: f, refreshCount: w });
21
+ } = R({ goAdd: h, labelAdd: f, enableAdd: w, refreshCount: b });
22
22
  return {
23
23
  unmountable: !1,
24
24
  value: "filtered",
25
- tabContent: _(() => /* @__PURE__ */ b(
26
- R,
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: s,
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: a,
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, a, n, e.page, e.rowsPerPage, e.totalRecords, l, o, s, t, m, c]),
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: `${C(G.LABEL_TAB_FILTERED)} (${t.length})`
59
+ label: `${A(L.LABEL_TAB_FILTERED)} (${t.length})`
60
60
  }
61
61
  };
62
62
  }
63
63
  export {
64
- E as useTabFiltered
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":"AAsBA,OAAO,KAAK,EAAG,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAgBrD;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,oBAAoB,oDA8C/C"}
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 c, 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 { loadModuleOutsideChromatic as F } from "../../../../../../../../internal/storybookRuntime.js";
4
- import { useSubmit as v } from "./hooks/useSubmit.js";
5
- import { ConfigData as x } from "./subcomponents/ConfigData/index.js";
6
- import { GeneralData as A } from "./subcomponents/GeneralData/GeneralData.js";
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 M } from "./subcomponents/AssignmentData/index.js";
11
- import { ChooseAssignmentData as B } from "./subcomponents/ChooseAssignmentData/index.js";
12
- F(() => import("@geoman-io/leaflet-geoman-free"));
13
- function V(o) {
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
- c,
14
+ p,
17
15
  {
18
16
  statusLoad: a,
19
17
  onSubmit: n,
20
18
  values: s,
21
- validationSchema: p,
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(B, {})
24
+ /* @__PURE__ */ e(v, {}),
25
+ /* @__PURE__ */ e(M, {})
28
26
  ] }) }, "basic-information"),
29
- /* @__PURE__ */ e(r, { stepKey: "assignment", children: /* @__PURE__ */ e(M, {}) }, "assignment"),
30
- /* @__PURE__ */ e(r, { stepKey: "style-information", children: /* @__PURE__ */ e(C, {}) }, "style-information")
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
- V as Form
43
+ N as Form
46
44
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * hook Encargado manejar los eventos de dibujo y setear en hook forms values,
3
- * los datos asociados a una geocerca
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":"AAsBA;;;;GAIG;AACH;;GAEG;AACH,wBAAgB,UAAU;;;;;EAkTzB"}
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"}