@m4l/gclick 0.2.0 → 0.2.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/maps/components/GpsMap/GpsMap.js +3 -3
- package/components/maps/components/GpsMap/GpsMap.styles.js +74 -4
- package/components/maps/components/GpsMap/constants.d.ts +3 -1
- package/components/maps/components/GpsMap/constants.js +9 -41
- package/components/maps/components/GpsMap/contexts/MapContext/store.js +5 -7
- package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts +6 -21
- package/components/maps/components/GpsMap/dictionary.js +0 -4
- package/components/maps/components/GpsMap/external/MapControl/types.d.ts +1 -2
- package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/index.d.ts +3 -1
- package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/index.js +13 -15
- package/components/maps/components/GpsMap/featureRenders/{FeatureDivIconLabel → MarkerIconLabel/subcomponents/FeatureDivIconLabel}/index.d.ts +1 -1
- package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/subcomponents/FeatureDivIconLabel/index.js +33 -0
- package/components/maps/components/GpsMap/featureRenders/{FeatureDivIconLabel → MarkerIconLabel/subcomponents/FeatureDivIconLabel}/types.d.ts +1 -1
- package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/types.d.ts +1 -2
- package/components/maps/components/GpsMap/featureRenders/index.d.ts +0 -1
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.js +5 -4
- package/components/maps/components/GpsMap/icons.js +0 -5
- package/components/maps/components/GpsMap/slots/slots.d.ts +2 -2
- package/components/maps/components/GpsMap/slots/slots.js +2 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/hooks/useControls.d.ts +23 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/hooks/useControls.js +32 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/index.d.ts +0 -12
- package/components/maps/components/GpsMap/subcomponents/Controls/index.js +7 -9
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/constants.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/constants.js +41 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/hooks/types.d.ts +2 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/hooks/useTool.js +9 -9
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/hooks/useZoomBottons.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/hooks/useZoomBottons.js +61 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/index.d.ts +7 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/index.js +38 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/ButtonPopupTool/index.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools/subcomponents/ButtonTool → ButtonsToolsList/subcomponents/ButtonPopupTool}/index.js +4 -6
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/hooks/useMeasure/index.js +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/types.d.ts +7 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/types.d.ts +1 -1
- package/components/maps/components/GpsMap/subcomponents/{LayersContainer → Layers}/index.js +2 -2
- package/components/maps/components/GpsMap/subcomponents/Layers/subcomponents/Layer/hooks/useClusterMarkers.d.ts +13 -0
- package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/index.d.ts +1 -1
- package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/index.js +3 -39
- package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/subcomponents/RenderByEachFeatureComponent/index.d.ts +1 -1
- package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/subcomponents/RenderByEachFeatureComponent/index.js +1 -1
- package/components/maps/components/GpsMap/types.d.ts +95 -8
- package/components/maps/components/GpsMapTools/constants.d.ts +1 -5
- package/components/maps/components/GpsMapTools/constants.js +2 -69
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/GpsMapToolsContext.d.ts +21 -0
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/GpsMapToolsContext.js +20 -0
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/index.d.ts +1 -21
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/index.js +1 -48
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/store.d.ts +1 -1
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/store.js +54 -58
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/types.d.ts +20 -79
- package/components/maps/components/GpsMapTools/dictionary.d.ts +67 -53
- package/components/maps/components/GpsMapTools/dictionary.js +58 -50
- package/components/maps/components/GpsMapTools/hooks/useGpsMapToolsStore/index.js +1 -1
- package/components/maps/components/GpsMapTools/icons.d.ts +58 -17
- package/components/maps/components/GpsMapTools/icons.js +45 -18
- package/components/maps/components/GpsMapTools/index.d.ts +4 -5
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/GeofencesTool.d.ts +4 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/GeofencesTool.js +16 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.d.ts +12 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.js +52 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/helpers.d.ts +9 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/helpers.js +17 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useColumns.d.ts +8 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useColumns.js +88 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useDatagridFiltered.d.ts +27 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useDatagridFiltered.js +79 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useDatagridSelected.d.ts +16 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useDatagridSelected.js +57 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useFilterAndSort.d.ts +19 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useFilterAndSort.js +57 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useFilterFields.d.ts +5 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useFilterFields.js +32 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useSortFields.d.ts +5 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useSortFields.js +20 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useLayers.js +32 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useLoadDrawGeometry.d.ts +8 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useLoadDrawGeometry.js +104 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useMaster.d.ts +7 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useMaster.js +39 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.d.ts +12 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.js +55 -0
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools/subcomponents/GeofencesList → GeofencesTool}/hooks/useRowActionsGetter.d.ts +2 -2
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools/subcomponents/GeofencesList → GeofencesTool}/hooks/useRowActionsGetter.js +30 -35
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabFiltered.d.ts +18 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabFiltered.js +70 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabSelected.d.ts +17 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabSelected.js +48 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/index.d.ts +1 -0
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools/subcomponents → GeofencesTool}/model.d.ts +40 -12
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.d.ts +5 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.js +45 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/constants.d.ts +3 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/constants.js +31 -0
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/helpers.d.ts +6 -15
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/helpers.js +32 -15
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/hooks/useDrawing.d.ts +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/hooks/useDrawing.js +108 -85
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useForm.d.ts +10 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useForm.js +98 -0
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/hooks/useSubmit.d.ts +1 -3
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/hooks/useSubmit.js +23 -24
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/hooks/useValidation.d.ts +6 -3
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/index.js +67 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/GeneralData.js +78 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/hooks/useGeneral.d.ts +8 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/hooks/useGeneral.js +43 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/types.d.ts +6 -0
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/validations.d.ts +3 -1
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/validations.js +6 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/MyActionFormCancel/MyActionFormCancel.d.ts +5 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/MyActionFormCancel/MyActionFormCancel.js +19 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/StyleData/constants.d.ts +9 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/StyleData/constants.js +64 -0
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/StyleData/index.js +2 -2
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/FillData/index.js +7 -10
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/StrokeData/hooks/useStrokePatternOptions.d.ts +11 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/StrokeData/hooks/useStrokePatternOptions.js +19 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/StrokeData/hooks/useStrokeWeightsOptions.d.ts +9 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/StrokeData/hooks/useStrokeWeightsOptions.js +17 -0
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/StrokeData/index.js +15 -22
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/StyleData/types.d.ts +9 -0
- package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/types.d.ts +17 -11
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.d.ts +5 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.js +163 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/constants.d.ts +1 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/helpers.d.ts +17 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/helpers.js +35 -0
- package/components/maps/components/GpsMapTools/types.d.ts +0 -18
- package/components/maps/index.d.ts +1 -1
- package/index.js +65 -66
- package/package.json +3 -2
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/constants.js +0 -4
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.js +0 -263
- package/components/maps/components/GpsMap/featureRenders/FeatureDivIconLabel/index.js +0 -33
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/index.d.ts +0 -10
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/index.js +0 -10
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/subcomponents/ZoomButtons/index.d.ts +0 -4
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/subcomponents/ZoomButtons/index.js +0 -52
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/types.d.ts +0 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/index.d.ts +0 -4
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/types.d.ts +0 -5
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/index.d.ts +0 -9
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/index.js +0 -58
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ButtonTool/index.d.ts +0 -9
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/types.d.ts +0 -4
- package/components/maps/components/GpsMapTools/GpsMapTools.d.ts +0 -5
- package/components/maps/components/GpsMapTools/GpsMapTools.js +0 -10
- package/components/maps/components/GpsMapTools/classes/index.d.ts +0 -7
- package/components/maps/components/GpsMapTools/classes/index.js +0 -21
- package/components/maps/components/GpsMapTools/classes/types.d.ts +0 -14
- package/components/maps/components/GpsMapTools/hooks/useLayers/index.js +0 -57
- package/components/maps/components/GpsMapTools/styles.d.ts +0 -1
- package/components/maps/components/GpsMapTools/styles.js +0 -18
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/index.d.ts +0 -9
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/index.js +0 -84
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/constants.d.ts +0 -20
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/constants.js +0 -40
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useSumbitErrorsFocus.js +0 -36
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/index.d.ts +0 -5
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/index.js +0 -71
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/styles.d.ts +0 -1
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/styles.js +0 -8
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/index.js +0 -51
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/index.js +0 -128
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/types.d.ts +0 -7
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/index.d.ts +0 -5
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/index.js +0 -55
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/index.d.ts +0 -4
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/index.js +0 -76
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/types.d.ts +0 -7
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/types.d.ts +0 -10
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useCheckedFeatures.d.ts +0 -9
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useCheckedFeatures.js +0 -86
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useCheckedGeofences.d.ts +0 -7
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useCheckedGeofences.js +0 -85
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useColumns.d.ts +0 -12
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useColumns.js +0 -111
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useMaster.d.ts +0 -22
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useMaster.js +0 -164
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/index.d.ts +0 -4
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/index.js +0 -73
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.d.ts +0 -1
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.js +0 -8
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/subcomponents/Filter/index.d.ts +0 -9
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/subcomponents/Filter/index.js +0 -49
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/constants.d.ts +0 -7
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/constants.js +0 -13
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/types.d.ts +0 -7
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/hooks/useTool.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools/subcomponents/ButtonTool → ButtonsToolsList/subcomponents/ButtonPopupTool}/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/MapLayersTool.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/MapLayersTool.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/MapLayersTool.styles.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/MapLayersTool.styles.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/hooks/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/hooks/useMapLayersTool.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/hooks/useMapLayersTool.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/slots/slots.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/slots/slots.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/slots/styled.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/slots/styled.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/subcomponents/MapLayerRow.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/subcomponents/MapLayerRow.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/subcomponents/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapLayersTool/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/MapSourcesTool.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/MapSourcesTool.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/MapSourcesTool.styles.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/MapSourcesTool.styles.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/hooks/useMapSourcesTool.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/hooks/useMapSourcesTool.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/slots/slots.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/slots/slots.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/slots/styled.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/slots/styled.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/sourceTypes/bing.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/sourceTypes/bing.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/sourceTypes/google.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/sourceTypes/google.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/sourceTypes/others.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/sourceTypes/others.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/subcomponents/MapSourceCard.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/subcomponents/MapSourceCard.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/subcomponents/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MapSourcesTool/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/MeasureTool.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/MeasureTool.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/MeasureTool.styles.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/MeasureTool.styles.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/constants.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/constants.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/hooks/useMeasure/helpers.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/hooks/useMeasure/helpers.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/hooks/useValidation.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/hooks/useValidation.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/model.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/slots/slots.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/slots/slots.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/slots/styled.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/slots/styled.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/subcomponents/MeasureData/index.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/subcomponents/MeasureData/index.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/subcomponents/MeasureData/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/subcomponents/MeasureData/validations.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/subcomponents/MeasureData/validations.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/subcomponents/MyActions/index.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/subcomponents/MyActions/index.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → ButtonsToolsList}/subcomponents/MeasureTool/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/{LayersContainer → Layers}/index.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/subcomponents/MarkerClusterGroup/index.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/subcomponents/MarkerClusterGroup/index.js +0 -0
- /package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/subcomponents/MarkerClusterGroup/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/subcomponents/RenderByEachFeatureComponent/types.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/{LayersContainer/subcomponents/MyLayer → Layers/subcomponents/Layer}/types.d.ts +0 -0
- /package/components/maps/components/GpsMapTools/{hooks/useLayers/index.d.ts → subcomponents/GeofencesTool/hooks/useLayers.d.ts} +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/hooks/useSumbitErrorsFocus.d.ts +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/hooks/useValidation.js +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/index.d.ts +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/types.d.ts +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/validations.d.ts +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/validations.js +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/index.d.ts → GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/GeneralData.d.ts} +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions → GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/MyActionFormCancel}/types.d.ts +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/StyleData/index.d.ts +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/FillData/index.d.ts +0 -0
- /package/components/maps/components/GpsMapTools/subcomponents/{TabsGpsTools → GeofencesTool}/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/StrokeData/index.d.ts +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { deepShallow, IconButton } from "@m4l/components";
|
|
4
|
+
import { u as useGpsMapToolsStore } from "../../../hooks/useGpsMapToolsStore/index.js";
|
|
5
|
+
import { M as MAP_GPSTOOLS_ICONS } from "../../../icons.js";
|
|
6
|
+
import { useEnvironment } from "@m4l/core";
|
|
7
|
+
function useDatagridSelected(props) {
|
|
8
|
+
const { goAdd, labelAdd, enableAdd } = props;
|
|
9
|
+
const { environment_assets, host_static_assets } = useEnvironment();
|
|
10
|
+
const iconAdd = `${environment_assets}/${host_static_assets}/icons/${MAP_GPSTOOLS_ICONS.GEOFENCES_ADD}`;
|
|
11
|
+
const rows = useGpsMapToolsStore(
|
|
12
|
+
(state) => {
|
|
13
|
+
const rowsSelected = [];
|
|
14
|
+
state.geofenceState.checkedGeofences.forEach((chkRow) => {
|
|
15
|
+
const geofence = state.geofenceState.hashGeofences[chkRow];
|
|
16
|
+
if (!geofence) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
rowsSelected.push({
|
|
20
|
+
id: geofence.id,
|
|
21
|
+
name: geofence.name,
|
|
22
|
+
type: geofence.type,
|
|
23
|
+
timeMinInSeconds: geofence.timeMinInSeconds,
|
|
24
|
+
timeMinOutSeconds: geofence.timeMinOutSeconds,
|
|
25
|
+
alias: geofence.alias,
|
|
26
|
+
customerId: geofence.customerId,
|
|
27
|
+
createdAt: geofence.createdAt,
|
|
28
|
+
updatedAt: geofence.updatedAt
|
|
29
|
+
});
|
|
30
|
+
}, []);
|
|
31
|
+
return rowsSelected;
|
|
32
|
+
},
|
|
33
|
+
deepShallow
|
|
34
|
+
);
|
|
35
|
+
const rightActions = useMemo(() => {
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
IconButton,
|
|
38
|
+
{
|
|
39
|
+
variant: "contained",
|
|
40
|
+
color: "primary",
|
|
41
|
+
icon: iconAdd,
|
|
42
|
+
disabled: !enableAdd,
|
|
43
|
+
tooltip: labelAdd,
|
|
44
|
+
onClick: () => {
|
|
45
|
+
goAdd();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}, [enableAdd, goAdd, labelAdd, iconAdd]);
|
|
50
|
+
return {
|
|
51
|
+
rows,
|
|
52
|
+
rightActions
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
useDatagridSelected as u
|
|
57
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type UseFilterAndSortProps = {
|
|
2
|
+
labelAdd: string;
|
|
3
|
+
goAdd: () => void;
|
|
4
|
+
enableAdd: boolean;
|
|
5
|
+
setBackendQueryParams: (params: Record<string, unknown>) => void;
|
|
6
|
+
refresh: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Hook para obtener DynamicFilter and Sort
|
|
10
|
+
*/
|
|
11
|
+
export declare function useFilterAndSort(props: UseFilterAndSortProps): {
|
|
12
|
+
leftActions: import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
rightActions: import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
visibleCustomHeader: boolean;
|
|
15
|
+
customHeaderComponent: import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
externalFilterSettings: import('@m4l/components/src/components/DataGrid/types').FilterSettings | undefined;
|
|
17
|
+
externalSortSettings: import('@m4l/components/src/components/DataGrid/types').SortSettings | undefined;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useWindowToolsMF, getRawSortsForNetwork, getRawFiltersForNetwork, useDynamicFilterAndSort, IconButton } from "@m4l/components";
|
|
4
|
+
import { u as useFilterFields } from "./useFilterFields.js";
|
|
5
|
+
import { u as useSortFields } from "./useSortFields.js";
|
|
6
|
+
import { useEnvironment } from "@m4l/core";
|
|
7
|
+
import { M as MAP_GPSTOOLS_ICONS } from "../../../../icons.js";
|
|
8
|
+
import { G as GPS_TOOLS_COMPONENT_PATH_ID } from "../../../../constants.js";
|
|
9
|
+
function useFilterAndSort(props) {
|
|
10
|
+
const { goAdd, setBackendQueryParams, refresh, labelAdd } = props;
|
|
11
|
+
const filterFields = useFilterFields();
|
|
12
|
+
const sortFields = useSortFields();
|
|
13
|
+
const { setCookie, getCookie } = useWindowToolsMF();
|
|
14
|
+
const { environment_assets, host_static_assets } = useEnvironment();
|
|
15
|
+
const iconAddUrl = `${host_static_assets}/${environment_assets}/frontend/components/${GPS_TOOLS_COMPONENT_PATH_ID}/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCES_ADD}`;
|
|
16
|
+
const onChangeFilterSort = useCallback((params) => {
|
|
17
|
+
setBackendQueryParams({
|
|
18
|
+
f: getRawFiltersForNetwork(params.eventFilters?.rawFilters, "snakeCase"),
|
|
19
|
+
s: getRawSortsForNetwork(params.eventSorts?.rawSorts, "snakeCase")
|
|
20
|
+
});
|
|
21
|
+
refresh();
|
|
22
|
+
}, [refresh, setBackendQueryParams]);
|
|
23
|
+
const { leftActions, visibleCustomHeader, customHeaderComponent, rightActions, externalFilterSettings, externalSortSettings } = useDynamicFilterAndSort({
|
|
24
|
+
prefixCookie: "geofences_all",
|
|
25
|
+
onChangeFilterSort,
|
|
26
|
+
fields: filterFields,
|
|
27
|
+
sorts: sortFields,
|
|
28
|
+
withAllField: true,
|
|
29
|
+
setCookie,
|
|
30
|
+
getCookie,
|
|
31
|
+
visibleRefresh: false,
|
|
32
|
+
rightActions: /* @__PURE__ */ jsx(
|
|
33
|
+
IconButton,
|
|
34
|
+
{
|
|
35
|
+
variant: "contained",
|
|
36
|
+
color: "primary",
|
|
37
|
+
icon: iconAddUrl,
|
|
38
|
+
disabled: false,
|
|
39
|
+
tooltip: labelAdd,
|
|
40
|
+
onClick: () => {
|
|
41
|
+
goAdd();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
leftActions,
|
|
48
|
+
rightActions,
|
|
49
|
+
visibleCustomHeader,
|
|
50
|
+
customHeaderComponent,
|
|
51
|
+
externalFilterSettings,
|
|
52
|
+
externalSortSettings
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
useFilterAndSort as u
|
|
57
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useEnvironment } from "@m4l/core";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../../dictionary.js";
|
|
4
|
+
import { G as GPS_TOOLS_COMPONENT_PATH_ID } from "../../../../constants.js";
|
|
5
|
+
import { M as MAP_GPSTOOLS_ICONS } from "../../../../icons.js";
|
|
6
|
+
function useFilterFields() {
|
|
7
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
8
|
+
const useMemoResult = useMemo(() => {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
name: "id",
|
|
12
|
+
dictionaryId: MAP_GPSTOOLS_DICCTIONARY.LABEL_ID,
|
|
13
|
+
type: "number",
|
|
14
|
+
multiple: true,
|
|
15
|
+
presence: "optional",
|
|
16
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/${GPS_TOOLS_COMPONENT_PATH_ID}/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCES_ID}`
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "name",
|
|
20
|
+
dictionaryId: MAP_GPSTOOLS_DICCTIONARY.LABEL_NAME,
|
|
21
|
+
type: "string",
|
|
22
|
+
multiple: true,
|
|
23
|
+
presence: "optional",
|
|
24
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/${GPS_TOOLS_COMPONENT_PATH_ID}/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCES_NAME}`
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
}, [host_static_assets, environment_assets]);
|
|
28
|
+
return useMemoResult;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
useFilterFields as u
|
|
32
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEnvironment } from "@m4l/core";
|
|
2
|
+
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../../dictionary.js";
|
|
3
|
+
import { M as MAP_GPSTOOLS_ICONS } from "../../../../icons.js";
|
|
4
|
+
import { G as GPS_TOOLS_COMPONENT_PATH_ID } from "../../../../constants.js";
|
|
5
|
+
const useSortFields = () => {
|
|
6
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
name: "name",
|
|
10
|
+
type: "string",
|
|
11
|
+
dictionaryId: MAP_GPSTOOLS_DICCTIONARY.LABEL_NAME,
|
|
12
|
+
presence: "initialized",
|
|
13
|
+
defaultOperator: "asc",
|
|
14
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/${GPS_TOOLS_COMPONENT_PATH_ID}/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCES_NAME}`
|
|
15
|
+
}
|
|
16
|
+
];
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
useSortFields as u
|
|
20
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { shallow } from "zustand/shallow";
|
|
3
|
+
import { u as useGpsMapToolsStore } from "../../../hooks/useGpsMapToolsStore/index.js";
|
|
4
|
+
import { G as GeofencesLayers } from "../constants.js";
|
|
5
|
+
import { G as GeofenceFeatureRender } from "../subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.js";
|
|
6
|
+
import { u as useMapStore } from "../../../../GpsMap/hooks/useMapStore/index.js";
|
|
7
|
+
function useLayers() {
|
|
8
|
+
const { addLayer, removeLayer } = useMapStore((state) => state.mapActions, shallow);
|
|
9
|
+
const { init } = useGpsMapToolsStore((state) => state.gpsToolsActions, shallow);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
addLayer({
|
|
12
|
+
layerId: GeofencesLayers.LAYER_GEOFENCES,
|
|
13
|
+
name: "Geocercas",
|
|
14
|
+
renderFeature: GeofenceFeatureRender,
|
|
15
|
+
geoJsonObject: {
|
|
16
|
+
object: {
|
|
17
|
+
type: "FeatureCollection",
|
|
18
|
+
features: []
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
autoFocusAble: true,
|
|
22
|
+
autoFocus: true
|
|
23
|
+
});
|
|
24
|
+
init();
|
|
25
|
+
return () => {
|
|
26
|
+
removeLayer(GeofencesLayers.LAYER_GEOFENCES);
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
useLayers as u
|
|
32
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook encargado de pintar o remover las geocercas chequeadas
|
|
3
|
+
* Adicionalmente, se encargar de cargar la geometría de las geocercas chequeadas cuando son diferentes de ciruclo o rectangulo.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useLoadDrawGeometry(): {
|
|
6
|
+
checkedGeofences: ReadonlySet<number>;
|
|
7
|
+
setCheckedGeofences: (newGeofences: ReadonlySet<import('../../../contexts/GpsMapToolsContext/types').GeofenceId>) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { shallow } from "zustand/shallow";
|
|
3
|
+
import { useNetwork } from "@m4l/core";
|
|
4
|
+
import { G as GeofencesLayers } from "../constants.js";
|
|
5
|
+
import { u as useGpsMapToolsStore } from "../../../hooks/useGpsMapToolsStore/index.js";
|
|
6
|
+
import { useWindowToolsMF } from "@m4l/components";
|
|
7
|
+
import { getContrastTextColor } from "@m4l/graphics";
|
|
8
|
+
import { u as useMapStore } from "../../../../GpsMap/hooks/useMapStore/index.js";
|
|
9
|
+
function useLoadDrawGeometry() {
|
|
10
|
+
const hasLayerGeofences = useMapStore((state) => state.layersIds.includes(GeofencesLayers.LAYER_GEOFENCES), shallow);
|
|
11
|
+
const [checkedGeofences] = useGpsMapToolsStore(
|
|
12
|
+
(state) => [state.geofenceState.checkedGeofences, state.geofenceState.hashGeofences],
|
|
13
|
+
shallow
|
|
14
|
+
);
|
|
15
|
+
const { setCheckedGeofences, setPartialValue, getGeofenceById } = useGpsMapToolsStore(
|
|
16
|
+
(state) => state.geofenceActions,
|
|
17
|
+
shallow
|
|
18
|
+
);
|
|
19
|
+
const { setFeatureData, removeFeature, getFeatureIds } = useMapStore(
|
|
20
|
+
(state) => state.mapActions,
|
|
21
|
+
shallow
|
|
22
|
+
);
|
|
23
|
+
const { networkOperation } = useNetwork();
|
|
24
|
+
const { startProgress, stopProgress } = useWindowToolsMF();
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!hasLayerGeofences) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const mapFeatureIds = getFeatureIds(GeofencesLayers.LAYER_GEOFENCES);
|
|
30
|
+
checkedGeofences.forEach((geofenceId) => {
|
|
31
|
+
const geofence = getGeofenceById(geofenceId);
|
|
32
|
+
if (!geofence) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (!mapFeatureIds.includes(geofenceId) || !geofence.mustPaintGeometry) {
|
|
36
|
+
if (!geofence.geometry) {
|
|
37
|
+
networkOperation({
|
|
38
|
+
method: "GET",
|
|
39
|
+
endPoint: `geofences/${geofence.id}`,
|
|
40
|
+
responseToCamelCase: true,
|
|
41
|
+
options: {
|
|
42
|
+
startProgress,
|
|
43
|
+
stopProgress
|
|
44
|
+
}
|
|
45
|
+
}).then((response) => {
|
|
46
|
+
const geoLoaded = {
|
|
47
|
+
geometry: response.data.geometry,
|
|
48
|
+
name: response.data.name,
|
|
49
|
+
properties: response.data.properties,
|
|
50
|
+
mustPaintGeometry: true
|
|
51
|
+
};
|
|
52
|
+
if (geoLoaded.geometry) {
|
|
53
|
+
if (checkedGeofences.has(geofence.id)) {
|
|
54
|
+
const extendedProperties = {
|
|
55
|
+
...geoLoaded.properties,
|
|
56
|
+
markerIconLabel: {
|
|
57
|
+
label: geoLoaded.name,
|
|
58
|
+
color: getContrastTextColor(geoLoaded.properties?.fillColor),
|
|
59
|
+
fillColor: geoLoaded.properties?.fillColor,
|
|
60
|
+
fillOpacity: geoLoaded.properties?.fillOpacity
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
setFeatureData("geofences", geofenceId, geoLoaded.geometry, extendedProperties);
|
|
64
|
+
geoLoaded.mustPaintGeometry = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
setPartialValue(geofence.id, geoLoaded);
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
const extendedProperties = {
|
|
71
|
+
...geofence.properties,
|
|
72
|
+
markerIconLabel: {
|
|
73
|
+
label: geofence.name,
|
|
74
|
+
color: getContrastTextColor(geofence.properties?.fillColor),
|
|
75
|
+
fillColor: geofence.properties?.fillColor,
|
|
76
|
+
fillOpacity: geofence.properties?.fillOpacity
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
setFeatureData(
|
|
80
|
+
GeofencesLayers.LAYER_GEOFENCES,
|
|
81
|
+
geofenceId,
|
|
82
|
+
geofence.geometry,
|
|
83
|
+
extendedProperties
|
|
84
|
+
);
|
|
85
|
+
setPartialValue(geofence.id, { mustPaintGeometry: false });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
mapFeatureIds.forEach((mapFeatureId) => {
|
|
90
|
+
if (!checkedGeofences.has(Number(mapFeatureId))) {
|
|
91
|
+
removeFeature(GeofencesLayers.LAYER_GEOFENCES, mapFeatureId);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return () => {
|
|
95
|
+
};
|
|
96
|
+
}, [checkedGeofences, getFeatureIds, getGeofenceById, hasLayerGeofences, networkOperation, removeFeature, setFeatureData, setPartialValue, startProgress, stopProgress]);
|
|
97
|
+
return {
|
|
98
|
+
checkedGeofences,
|
|
99
|
+
setCheckedGeofences
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
useLoadDrawGeometry as u
|
|
104
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useState, useCallback, useMemo, useEffect } from "react";
|
|
2
|
+
import { u as useModuleDynamicActions } from "./useModuleDynamicActions.js";
|
|
3
|
+
import { u as useTabFiltered } from "./useTabFiltered.js";
|
|
4
|
+
import { u as useLayers } from "./useLayers.js";
|
|
5
|
+
import { u as useLoadDrawGeometry } from "./useLoadDrawGeometry.js";
|
|
6
|
+
import { u as useColumns } from "./useColumns.js";
|
|
7
|
+
import { u as useRowActionsGetter } from "./useRowActionsGetter.js";
|
|
8
|
+
import { u as useTabSelected } from "./useTabSelected.js";
|
|
9
|
+
import { u as useGpsMapToolsStore } from "../../../hooks/useGpsMapToolsStore/index.js";
|
|
10
|
+
function useMaster() {
|
|
11
|
+
const { columns } = useColumns();
|
|
12
|
+
const [refreshCount, setRefreshCount] = useState(0);
|
|
13
|
+
const { flushGeofences } = useGpsMapToolsStore((state) => state.geofenceActions);
|
|
14
|
+
const fullRefresh = useCallback(() => {
|
|
15
|
+
setRefreshCount((prev) => prev + 1);
|
|
16
|
+
}, [setRefreshCount]);
|
|
17
|
+
const rowKeyGetter = useMemo(() => (row) => row.id, []);
|
|
18
|
+
const { rowActionsGetter } = useRowActionsGetter({ fullRefresh });
|
|
19
|
+
const { goAdd, labelAdd, enableAdd } = useModuleDynamicActions({ fullRefresh });
|
|
20
|
+
useLayers();
|
|
21
|
+
useLoadDrawGeometry();
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
return () => {
|
|
24
|
+
flushGeofences();
|
|
25
|
+
};
|
|
26
|
+
}, [flushGeofences]);
|
|
27
|
+
const tabFiltered = useTabFiltered({ goAdd, labelAdd, columns, rowActionsGetter, rowKeyGetter, refreshCount });
|
|
28
|
+
const tabSelected = useTabSelected({ goAdd, labelAdd, enableAdd, columns, rowActionsGetter, rowKeyGetter });
|
|
29
|
+
const tabs = useMemo(() => {
|
|
30
|
+
return [tabFiltered, tabSelected];
|
|
31
|
+
}, [tabFiltered, tabSelected]);
|
|
32
|
+
return {
|
|
33
|
+
defaultTab: tabFiltered.value,
|
|
34
|
+
tabs
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
useMaster as u
|
|
39
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface UseModuleDynamicActionsProps {
|
|
2
|
+
fullRefresh: () => void;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Hook que se encarga de gestionar las acciones dinámicas del módulo que van en el header del WindowBase
|
|
6
|
+
*/
|
|
7
|
+
export declare function useModuleDynamicActions(props: UseModuleDynamicActionsProps): {
|
|
8
|
+
goAdd: () => void;
|
|
9
|
+
labelAdd: string;
|
|
10
|
+
enableAdd: boolean;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useEnvironment, useModuleDictionary, useModulePrivileges } from "@m4l/core";
|
|
2
|
+
import { useModule } from "@m4l/layouts";
|
|
3
|
+
import { useMemo, useCallback, useEffect } from "react";
|
|
4
|
+
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../dictionary.js";
|
|
5
|
+
import { M as MAP_GPSTOOLS_ICONS } from "../../../icons.js";
|
|
6
|
+
import { usePopupsStore } from "@m4l/components";
|
|
7
|
+
import { shallow } from "zustand/shallow";
|
|
8
|
+
import { G as GeofencesLayers, a as GEOFENCES_TOOL_DEFAULT_POSITION } from "../constants.js";
|
|
9
|
+
import { F as Form } from "../subcomponents/GeofenceAddEdit/Form.js";
|
|
10
|
+
import { G as GPS_TOOLS_COMPONENT_PATH_ID } from "../../../constants.js";
|
|
11
|
+
function useModuleDynamicActions(props) {
|
|
12
|
+
const { fullRefresh } = props;
|
|
13
|
+
const { setDynamicActions } = useModule();
|
|
14
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
15
|
+
const { addPopup } = usePopupsStore((state) => state.popupsActions, shallow);
|
|
16
|
+
const { hide } = usePopupsStore((state) => state.popupActions, shallow);
|
|
17
|
+
const { getLabel } = useModuleDictionary();
|
|
18
|
+
const { hasPrivilege } = useModulePrivileges();
|
|
19
|
+
const addIconUrl = useMemo(() => `${host_static_assets}/${environment_assets}/frontend/components/${GPS_TOOLS_COMPONENT_PATH_ID}/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCES_ADD}`, [host_static_assets, environment_assets]);
|
|
20
|
+
const addLabel = useMemo(() => getLabel(MAP_GPSTOOLS_DICCTIONARY.MODULE_NAME_GEOFENCE_ADD), [getLabel]);
|
|
21
|
+
const goAdd = useCallback(() => {
|
|
22
|
+
hide(GeofencesLayers.LAYER_GEOFENCES);
|
|
23
|
+
addPopup({
|
|
24
|
+
popupId: "geofencesAddEdit",
|
|
25
|
+
winType: "component",
|
|
26
|
+
title: addLabel,
|
|
27
|
+
component: Form,
|
|
28
|
+
componentProps: {
|
|
29
|
+
fullRefresh
|
|
30
|
+
},
|
|
31
|
+
defaultPosition: GEOFENCES_TOOL_DEFAULT_POSITION,
|
|
32
|
+
iconUrl: addIconUrl
|
|
33
|
+
});
|
|
34
|
+
}, [hide, addPopup, addLabel, fullRefresh, addIconUrl]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setDynamicActions([
|
|
37
|
+
{
|
|
38
|
+
iconUrl: addIconUrl,
|
|
39
|
+
onClick: goAdd,
|
|
40
|
+
visibility: "allways",
|
|
41
|
+
label: getLabel(MAP_GPSTOOLS_DICCTIONARY.MODULE_NAME_GEOFENCE_ADD),
|
|
42
|
+
tag: "add",
|
|
43
|
+
key: "add"
|
|
44
|
+
}
|
|
45
|
+
]);
|
|
46
|
+
}, [hasPrivilege, getLabel, setDynamicActions, addIconUrl, goAdd]);
|
|
47
|
+
return {
|
|
48
|
+
goAdd,
|
|
49
|
+
labelAdd: addLabel,
|
|
50
|
+
enableAdd: true
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
useModuleDynamicActions as u
|
|
55
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MenuAction } from '@m4l/components';
|
|
2
|
-
import {
|
|
2
|
+
import { GeofenceListColumns } from '../model';
|
|
3
3
|
interface UseRowActionsProps {
|
|
4
4
|
fullRefresh: (id?: number) => void;
|
|
5
5
|
}
|
|
@@ -7,6 +7,6 @@ interface UseRowActionsProps {
|
|
|
7
7
|
* TODO: Documentar
|
|
8
8
|
*/
|
|
9
9
|
export declare function useRowActionsGetter(props: UseRowActionsProps): {
|
|
10
|
-
rowActionsGetter: (row:
|
|
10
|
+
rowActionsGetter: (row: GeofenceListColumns) => MenuAction[] | [];
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useNetwork, useModuleDictionary, useModulePrivileges, useEnvironment, useHostTools } from "@m4l/core";
|
|
3
3
|
import { useState, useCallback } from "react";
|
|
4
|
-
import { M as MAP_GPSTOOLS_ICONS } from "
|
|
5
|
-
import {
|
|
6
|
-
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../../../dictionary.js";
|
|
4
|
+
import { M as MAP_GPSTOOLS_ICONS } from "../../../icons.js";
|
|
5
|
+
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../dictionary.js";
|
|
7
6
|
import { useModal, usePopupsStore, WindowConfirm } from "@m4l/components";
|
|
7
|
+
import { u as useGpsMapToolsStore } from "../../../hooks/useGpsMapToolsStore/index.js";
|
|
8
8
|
import { shallow } from "zustand/shallow";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { F as Form } from "../subcomponents/GeofenceAddEdit/Form.js";
|
|
10
|
+
import { G as GeofencesLayers, a as GEOFENCES_TOOL_DEFAULT_POSITION } from "../constants.js";
|
|
11
|
+
import { G as GEOFENCES_TOOL_ADD_EDIT_POPUP_ID } from "../subcomponents/GeofenceAddEdit/constants.js";
|
|
12
|
+
import { G as GPS_TOOLS_COMPONENT_PATH_ID } from "../../../constants.js";
|
|
11
13
|
function useRowActionsGetter(props) {
|
|
12
14
|
const { fullRefresh } = props;
|
|
13
15
|
const { networkOperation } = useNetwork();
|
|
@@ -19,33 +21,37 @@ function useRowActionsGetter(props) {
|
|
|
19
21
|
const { hide } = usePopupsStore((state) => state.popupActions, shallow);
|
|
20
22
|
const { removeCheckedGeofence } = useGpsMapToolsStore((state) => state.geofenceActions, shallow);
|
|
21
23
|
const { toast } = useHostTools();
|
|
22
|
-
const isDesktop = useResponsiveDesktop();
|
|
23
24
|
const [urlIconEdit] = useState(
|
|
24
|
-
`${host_static_assets}/${environment_assets}/frontend/components/
|
|
25
|
+
`${host_static_assets}/${environment_assets}/frontend/components/${GPS_TOOLS_COMPONENT_PATH_ID}/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCES_EDIT}`
|
|
25
26
|
);
|
|
26
27
|
const [urlIconDelete] = useState(
|
|
27
|
-
`${host_static_assets}/${environment_assets}/frontend/components/
|
|
28
|
+
`${host_static_assets}/${environment_assets}/frontend/components/${GPS_TOOLS_COMPONENT_PATH_ID}/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCES_DELETE}`
|
|
28
29
|
);
|
|
29
30
|
const goEdit = (objectId, name) => {
|
|
30
|
-
hide(
|
|
31
|
+
hide(GeofencesLayers.LAYER_GEOFENCES);
|
|
31
32
|
addPopup({
|
|
32
33
|
winType: "component",
|
|
33
|
-
popupId:
|
|
34
|
+
popupId: GEOFENCES_TOOL_ADD_EDIT_POPUP_ID,
|
|
34
35
|
title: getLabel(MAP_GPSTOOLS_DICCTIONARY.MODULE_NAME_GEOFENCE_EDIT),
|
|
35
36
|
editionInfo: `${getLabel(MAP_GPSTOOLS_DICCTIONARY.LABEL_ID)}:${objectId} - ${name} `,
|
|
36
37
|
componentProps: { fullRefresh, geofenceId: objectId },
|
|
37
|
-
component:
|
|
38
|
+
component: Form,
|
|
38
39
|
// onMouseDown,
|
|
39
|
-
defaultPosition:
|
|
40
|
-
vertical: { top: 50, bottom: 50 },
|
|
41
|
-
horizontal: { right: 50, width: 380 }
|
|
42
|
-
// left:490,top:50,width:360, height:420},
|
|
43
|
-
// bounds:{top:5, left:5, right:-5, bottom:-5}
|
|
44
|
-
},
|
|
40
|
+
defaultPosition: GEOFENCES_TOOL_DEFAULT_POSITION,
|
|
45
41
|
iconUrl: urlIconEdit
|
|
46
42
|
});
|
|
47
43
|
removeCheckedGeofence(objectId);
|
|
48
44
|
};
|
|
45
|
+
const onConfirmDelete = useCallback((row) => {
|
|
46
|
+
networkOperation({
|
|
47
|
+
method: "DELETE",
|
|
48
|
+
endPoint: `geofences/${row.id}`
|
|
49
|
+
}).then((response) => {
|
|
50
|
+
toast({ title: response.message }, { type: "success" });
|
|
51
|
+
fullRefresh();
|
|
52
|
+
});
|
|
53
|
+
closeModal();
|
|
54
|
+
}, [networkOperation, toast, fullRefresh, closeModal]);
|
|
49
55
|
const onDelete = useCallback(
|
|
50
56
|
(row) => {
|
|
51
57
|
openModal({
|
|
@@ -53,7 +59,7 @@ function useRowActionsGetter(props) {
|
|
|
53
59
|
WindowConfirm,
|
|
54
60
|
{
|
|
55
61
|
title: getLabel(MAP_GPSTOOLS_DICCTIONARY.MODAL_DELETE_GEO_TITLE),
|
|
56
|
-
msg: getLabel(MAP_GPSTOOLS_DICCTIONARY.MODAL_DELETE_GEO_MESSAGE),
|
|
62
|
+
msg: getLabel(MAP_GPSTOOLS_DICCTIONARY.MODAL_DELETE_GEO_MESSAGE, row.name),
|
|
57
63
|
onClickIntro: () => onConfirmDelete(row)
|
|
58
64
|
}
|
|
59
65
|
),
|
|
@@ -62,19 +68,8 @@ function useRowActionsGetter(props) {
|
|
|
62
68
|
initialHeight: 350
|
|
63
69
|
});
|
|
64
70
|
},
|
|
65
|
-
|
|
66
|
-
[getLabel]
|
|
71
|
+
[getLabel, onConfirmDelete, openModal]
|
|
67
72
|
);
|
|
68
|
-
const onConfirmDelete = useCallback((row) => {
|
|
69
|
-
networkOperation({
|
|
70
|
-
method: "DELETE",
|
|
71
|
-
endPoint: `geofences/${row.id}`
|
|
72
|
-
}).then((response) => {
|
|
73
|
-
toast({ title: response.message }, { type: "success" });
|
|
74
|
-
fullRefresh();
|
|
75
|
-
});
|
|
76
|
-
closeModal();
|
|
77
|
-
}, []);
|
|
78
73
|
const rowActionsGetter = useCallback(
|
|
79
74
|
(row) => {
|
|
80
75
|
const conditionalItems = [];
|
|
@@ -84,10 +79,10 @@ function useRowActionsGetter(props) {
|
|
|
84
79
|
label: MAP_GPSTOOLS_DICCTIONARY.ROW_ACTION_GEO_EDIT,
|
|
85
80
|
onClick: () => {
|
|
86
81
|
goEdit(row.id, row.name);
|
|
87
|
-
}
|
|
82
|
+
}
|
|
88
83
|
// Solo se habilita si intenta editarse a él mismo, o si tiene permisos pero está en un nivel superior al usuario a editar
|
|
89
84
|
// disabled: !(itsMe || (hasPrivilege(PRIVILEGE_EDIT) && (loggedUserType > row.user_type.id)))
|
|
90
|
-
disabled: !row.authUserOptions
|
|
85
|
+
// disabled: !row.authUserOptions?.edit,
|
|
91
86
|
});
|
|
92
87
|
conditionalItems.push({
|
|
93
88
|
type: "menuItem",
|
|
@@ -96,15 +91,15 @@ function useRowActionsGetter(props) {
|
|
|
96
91
|
onClick: () => {
|
|
97
92
|
onDelete(row);
|
|
98
93
|
},
|
|
99
|
-
|
|
94
|
+
color: "error"
|
|
100
95
|
// Solo se habilita si intenta editarse a él mismo, o si tiene permisos pero está en un nivel superior al usuario a editar
|
|
101
96
|
// disabled: !(itsMe || (hasPrivilege(PRIVILEGE_EDIT) && (loggedUserType > row.user_type.id)))
|
|
102
|
-
disabled: !row.authUserOptions
|
|
97
|
+
// disabled: !row.authUserOptions?.edit,
|
|
103
98
|
});
|
|
104
99
|
return conditionalItems;
|
|
105
100
|
},
|
|
106
101
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
|
-
[hasPrivilege, goEdit, onDelete, urlIconDelete, urlIconEdit
|
|
102
|
+
[hasPrivilege, goEdit, onDelete, urlIconDelete, urlIconEdit]
|
|
108
103
|
);
|
|
109
104
|
return { rowActionsGetter };
|
|
110
105
|
}
|
package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabFiltered.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Column, RowActionsGetter, RowKeyGetter } from '@m4l/components';
|
|
2
|
+
import { DynamicTab } from '@m4l/layouts';
|
|
3
|
+
import { GeofenceListColumns } from '../model';
|
|
4
|
+
import { GeofenceId } from '../../../contexts/GpsMapToolsContext/types';
|
|
5
|
+
type UseTabProps = {
|
|
6
|
+
goAdd: () => void;
|
|
7
|
+
labelAdd: string;
|
|
8
|
+
enableAdd: boolean;
|
|
9
|
+
columns: Column<GeofenceListColumns>[];
|
|
10
|
+
refreshCount: number;
|
|
11
|
+
rowActionsGetter: RowActionsGetter<GeofenceListColumns>;
|
|
12
|
+
rowKeyGetter: RowKeyGetter<GeofenceListColumns, GeofenceId>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Master hook
|
|
16
|
+
*/
|
|
17
|
+
export declare function useTabFiltered(props: UseTabProps): DynamicTab;
|
|
18
|
+
export {};
|