@m4l/gclick 0.1.0 → 0.2.0-JAEBeta.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/@types/deviceData.d.ts +12 -9
- package/@types/general.d.ts +1 -1
- package/@types/index.d.ts +2 -2
- package/@types/types.d.ts +25 -1
- package/@types/vpts.d.ts +6 -3
- package/components/Device/Device.d.ts +6 -0
- package/components/Device/Device.js +32 -0
- package/components/Device/Device.styles.d.ts +2 -0
- package/components/Device/Device.styles.js +95 -0
- package/components/Device/constants.d.ts +14 -0
- package/components/Device/constants.js +4 -0
- package/components/Device/dictionary.d.ts +14 -0
- package/components/Device/dictionary.js +19 -0
- package/components/{DeviceStatus/hooks/helper.d.ts → Device/helpers/helperDeviceStatus.d.ts} +1 -1
- package/components/{DeviceStatus/hooks/helper.js → Device/helpers/helperDeviceStatus.js} +5 -5
- package/components/Device/helpers.d.ts +18 -0
- package/components/Device/helpers.js +27 -0
- package/components/Device/hooks/constants.d.ts +16 -0
- package/components/{DeviceStatus → Device}/hooks/constants.js +13 -15
- package/components/Device/hooks/useDevice.d.ts +12 -0
- package/components/Device/hooks/useDevice.js +23 -0
- package/components/{DeviceStatus → Device}/hooks/useDeviceStatus.d.ts +2 -2
- package/components/{DeviceStatus → Device}/hooks/useDeviceStatus.js +4 -4
- package/components/Device/icons.d.ts +11 -0
- package/components/{DeviceStatus → Device}/icons.js +2 -2
- package/components/Device/index.d.ts +6 -0
- package/components/Device/slots/DeviceSlots.d.ts +15 -0
- package/components/Device/slots/DeviceSlots.js +32 -0
- package/components/Device/slots/slots.d.ts +7 -0
- package/components/Device/slots/slots.js +11 -0
- package/components/Device/types.d.ts +30 -0
- package/components/DeviceLabel/DeviceLabel.js +1 -1
- package/components/DeviceLabel/slots/DeviceLabelSlots.d.ts +9 -3
- package/components/DeviceLabel/types.d.ts +2 -2
- package/components/DeviceStatus/DeviceStatus.js +3 -15
- package/components/DeviceStatus/DeviceStatus.styles.js +1 -13
- package/components/DeviceStatus/constants.js +1 -4
- package/components/DeviceStatus/dictionary.d.ts +10 -10
- package/components/DeviceStatus/dictionary.js +1 -12
- package/components/DeviceStatus/icons.d.ts +1 -1
- package/components/DeviceStatus/index.d.ts +3 -2
- package/components/DeviceStatus/slots/DeviceStatusSlots.js +1 -11
- package/components/DeviceStatus/slots/slots.js +1 -7
- package/components/index.d.ts +1 -1
- package/components/indicators/IndicatorBattery/IndicatorBattery.styles.js +2 -2
- package/components/indicators/IndicatorBattery/dictionary.js +5 -1
- package/components/indicators/IndicatorBattery/index.d.ts +1 -0
- package/components/indicators/IndicatorCSQ/IndicatorCSQ.js +7 -5
- package/components/indicators/IndicatorCSQ/constants.d.ts +2 -2
- package/components/indicators/IndicatorCSQ/constants.js +4 -3
- package/components/indicators/IndicatorCSQ/dictionary.d.ts +5 -2
- package/components/indicators/IndicatorCSQ/dictionary.js +15 -12
- package/components/indicators/IndicatorCSQ/helpers/getQualityLabel/getQualityLabel.d.ts +22 -2
- package/components/indicators/IndicatorCSQ/helpers/getQualityLabel/getQualityLabel.js +15 -29
- package/components/indicators/IndicatorCSQ/index.d.ts +3 -3
- package/components/indicators/IndicatorCSQ/slots/IndicatorCSQSlots.js +6 -6
- package/components/indicators/IndicatorCSQ/types.d.ts +6 -2
- package/components/indicators/IndicatorValueAndMagnitude/IndicatorValueAndMagnitude.d.ts +5 -0
- package/components/indicators/IndicatorValueAndMagnitude/IndicatorValueAndMagnitude.js +15 -0
- package/components/indicators/IndicatorValueAndMagnitude/IndicatorValueAndMagnitude.styles.d.ts +2 -0
- package/components/indicators/IndicatorValueAndMagnitude/IndicatorValueAndMagnitude.styles.js +41 -0
- package/components/indicators/IndicatorValueAndMagnitude/constants.d.ts +2 -0
- package/components/indicators/IndicatorValueAndMagnitude/constants.js +7 -0
- package/components/indicators/IndicatorValueAndMagnitude/index.d.ts +1 -0
- package/components/indicators/IndicatorValueAndMagnitude/index.js +1 -0
- package/components/indicators/IndicatorValueAndMagnitude/slots/slots.d.ts +6 -0
- package/components/indicators/IndicatorValueAndMagnitude/slots/slots.js +10 -0
- package/components/indicators/IndicatorValueAndMagnitude/slots/styled.d.ts +12 -0
- package/components/indicators/IndicatorValueAndMagnitude/slots/styled.js +27 -0
- package/components/indicators/IndicatorValueAndMagnitude/types.d.ts +14 -0
- package/components/indicators/IndicatorValueStatus/IndicatorValueStatus.js +25 -0
- package/components/indicators/IndicatorValueStatus/IndicatorValueStatus.styles.js +76 -0
- package/components/indicators/IndicatorValueStatus/constants.js +8 -0
- package/components/indicators/IndicatorValueStatus/index.js +1 -0
- package/components/indicators/IndicatorValueStatus/slots/IndicatorValueStatusEnum.js +11 -0
- package/components/indicators/IndicatorValueStatus/slots/IndicatorValueStatusSlots.js +32 -0
- package/components/indicators/IndicatorValueStatus/types.d.ts +4 -0
- package/components/indicators/index.d.ts +2 -0
- package/components/maps/components/GpsMap/GpsMap.js +26 -9
- package/components/maps/components/GpsMap/GpsMap.styles.js +81 -93
- package/components/maps/components/GpsMap/classes/index.d.ts +1 -1
- package/components/maps/components/GpsMap/classes/index.js +6 -76
- package/components/maps/components/GpsMap/classes/types.d.ts +5 -16
- package/components/maps/components/GpsMap/constants.d.ts +9 -3
- package/components/maps/components/GpsMap/constants.js +25 -13
- package/components/maps/components/GpsMap/contexts/MapContext/MapContext.js +4 -26
- package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/store.js +50 -75
- package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts +98 -87
- package/components/maps/components/GpsMap/dictionary.d.ts +19 -8
- package/components/maps/components/GpsMap/dictionary.js +30 -17
- package/components/maps/components/GpsMap/external/{Control → MapControl}/index.d.ts +3 -3
- package/components/maps/components/GpsMap/external/{Control → MapControl}/index.js +9 -7
- package/components/maps/components/GpsMap/external/MapControl/types.d.ts +26 -0
- package/components/maps/components/GpsMap/external/googleMutant/index.d.ts +1 -1
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.js +3 -3
- package/components/maps/components/GpsMap/featureRenders/FeatureDivIconLabel/index.js +1 -1
- package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/types.d.ts +3 -2
- package/components/maps/components/GpsMap/featureRenders/index.d.ts +0 -1
- package/components/maps/components/GpsMap/hooks/index.d.ts +3 -0
- package/components/maps/components/GpsMap/hooks/index.js +1 -0
- package/components/maps/components/GpsMap/hooks/useDisableMapEventsOnFlag/index.d.ts +6 -0
- package/components/maps/components/GpsMap/hooks/useDisableMapEventsOnFlag/index.js +31 -0
- package/components/maps/components/GpsMap/hooks/useDisableMapEventsOnMouseOver/index.d.ts +6 -0
- package/components/maps/components/GpsMap/hooks/{useDisableZoomEvents → useDisableMapEventsOnMouseOver}/index.js +10 -2
- package/components/maps/components/GpsMap/icons.d.ts +10 -7
- package/components/maps/components/GpsMap/icons.js +17 -16
- package/components/maps/components/GpsMap/index.d.ts +2 -1
- package/components/maps/components/GpsMap/leaflet.styles.d.ts +6 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/MapPopupDevice.js +9 -1
- package/components/maps/components/GpsMap/popups/index.d.ts +1 -0
- package/components/maps/components/GpsMap/slots/slots.d.ts +27 -4
- package/components/maps/components/GpsMap/slots/slots.js +16 -7
- package/components/maps/components/GpsMap/slots/styled.d.ts +18 -0
- package/components/maps/components/GpsMap/slots/styled.js +37 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/index.js +8 -7
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/index.d.ts +10 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/index.js +10 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → BottomRigthTools}/subcomponents/ZoomButtons/index.js +3 -3
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/types.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/hooks/types.d.ts +8 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/hooks/useTool.d.ts +13 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/hooks/useTool.js +64 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/index.d.ts +0 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/index.js +42 -87
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ButtonTool/index.d.ts +9 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ButtonTool/index.js +24 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ButtonTool/types.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/MapLayersTool.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/MapLayersTool.js +30 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/MapLayersTool.styles.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/MapLayersTool.styles.js +45 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/hooks/types.d.ts +11 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/hooks/useMapLayersTool.d.ts +9 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/hooks/useMapLayersTool.js +37 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/slots/slots.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/slots/slots.js +10 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/slots/styled.d.ts +12 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/slots/styled.js +26 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/subcomponents/MapLayerRow.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/subcomponents/MapLayerRow.js +71 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/subcomponents/types.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/types.d.ts +9 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.d.ts → TopRigthTools/subcomponents/MapSourcesTool/MapSourcesTool.d.ts} +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/MapSourcesTool.js +38 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/MapSourcesTool.styles.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/MapSourcesTool.styles.js +87 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/hooks/useMapSourcesTool.d.ts +12 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/hooks/useMapSourcesTool.js +22 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/slots/slots.d.ts +9 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/slots/slots.js +13 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/slots/styled.d.ts +21 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/slots/styled.js +41 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/bing.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/bing.js +47 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/google.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/google.js +107 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/others.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/others.js +33 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/subcomponents/MapSourceCard.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/subcomponents/MapSourceCard.js +88 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/subcomponents/types.d.ts +7 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/types.d.ts +9 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/MeasureTool.js +31 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/MeasureTool.styles.d.ts +7 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/MeasureTool.styles.js +154 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/constants.d.ts +25 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/constants.js +37 -14
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/helpers.d.ts +29 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/helpers.js +14 -6
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts +2 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/index.js +26 -20
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts +1 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/slots/slots.d.ts +8 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/slots/slots.js +12 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/slots/styled.d.ts +18 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/slots/styled.js +37 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/index.js +19 -17
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/types.d.ts +18 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/types.d.ts +9 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/types.d.ts +2 -5
- package/components/maps/components/GpsMap/subcomponents/Controls/types.d.ts +1 -1
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/index.js +2 -1
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/index.js +2 -1
- package/components/maps/components/GpsMap/subcomponents/MapEventController/MapEventController.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/MapEventController/MapEventController.js +8 -0
- package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerGoogle/darkStyles.d.ts +13 -0
- package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerGoogle/index.js +82 -59
- package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerOthers/index.js +25 -15
- package/components/maps/components/GpsMap/types.d.ts +24 -5
- package/components/maps/components/GpsMapTools/GpsMapTools.d.ts +1 -0
- package/components/maps/components/GpsMapTools/index.d.ts +1 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/index.js +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useColumns.js +29 -32
- package/components/maps/components/GpsMapTools/types.d.ts +0 -16
- package/components/maps/index.d.ts +1 -0
- package/components/maps/utils/coordsToQuadKey.d.ts +4 -0
- package/components/maps/{components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/utils.js → utils/coordsToQuadKey.js} +2 -2
- package/components/maps/utils/index.d.ts +1 -0
- package/contexts/RealTimeConsumerContext/RealTimeConsumerContext.js +1 -1
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/athmospherejs/index.d.ts +1 -1
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/athmospherejs/index.js +1 -1
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/constants.d.ts +67 -2
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/constants.js +115 -30
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/dummy.js +5 -38
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/group.d.ts +9 -36
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/group.js +27 -19
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/helpers.d.ts +3 -2
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/helpers.js +9 -2
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/factory.js +1 -1
- package/formatters/CourseFormatter/CourseFormatter.js +6 -4
- package/formatters/CourseFormatter/helper.d.ts +2 -1
- package/formatters/CourseFormatter/helper.js +2 -4
- package/formatters/CourseFormatter/index.d.ts +1 -0
- package/formatters/CourseFormatter/slots/CourseFormatterSlots.d.ts +1 -1
- package/formatters/CourseFormatter/slots/CourseFormatterSlots.js +2 -2
- package/formatters/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +94 -59
- package/package.json +16 -3
- package/utils/cssToCSSProperties.d.ts +37 -0
- package/utils/getPrecisionFromHdop/constants.d.ts +13 -0
- package/utils/getPrecisionFromHdop/constants.js +73 -0
- package/utils/getPrecisionFromHdop/getPrecisionFromHdop.d.ts +31 -0
- package/utils/getPrecisionFromHdop/getPrecisionFromHdop.js +59 -0
- package/utils/getPrecisionFromHdop/index.d.ts +3 -0
- package/utils/getPrecisionFromHdop/index.js +1 -0
- package/utils/getPrecisionFromHdop/types.d.ts +42 -0
- package/utils/getVptUpdatedAtWithGuard.d.ts +4 -0
- package/utils/getVptUpdatedAtWithGuard.js +13 -0
- package/utils/getVptValueWithGuard.d.ts +9 -0
- package/utils/getVptValueWithGuard.js +18 -0
- package/utils/index.d.ts +3 -0
- package/components/DeviceStatus/hooks/constants.d.ts +0 -11
- package/components/maps/components/GpsMap/external/Control/types.d.ts +0 -7
- package/components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/constants.js +0 -4
- package/components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/index.js +0 -112
- package/components/maps/components/GpsMap/hooks/useDisableZoomEvents/index.d.ts +0 -6
- package/components/maps/components/GpsMap/slots/GpsMapSlots.d.ts +0 -4
- package/components/maps/components/GpsMap/slots/GpsMapSlots.js +0 -24
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/index.js +0 -13
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/index.d.ts +0 -10
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/index.js +0 -58
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useCheckedLayers.d.ts +0 -9
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useCheckedLayers.js +0 -17
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useColumns.d.ts +0 -18
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useColumns.js +0 -139
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useMaster.d.ts +0 -12
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useMaster.js +0 -52
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.d.ts +0 -8
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.js +0 -43
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/index.d.ts +0 -4
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/index.js +0 -30
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/model.d.ts +0 -26
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.js +0 -133
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/bing.d.ts +0 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/bing.js +0 -39
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/google.d.ts +0 -4
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/google.js +0 -73
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/osm.d.ts +0 -2
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/osm.js +0 -25
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/utils.d.ts +0 -4
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/types.d.ts +0 -4
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/index.js +0 -40
- /package/components/{maps/components/GpsMap/contexts/MapContext/helper.js → Device/index.js} +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → BottomRigthTools}/subcomponents/ZoomButtons/index.d.ts +0 -0
- /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/{index.d.ts → MeasureTool.d.ts} +0 -0
package/@types/deviceData.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Maybe } from '@m4l/core';
|
|
2
2
|
import { GNSSEnumMotionStatus, GNSSEnumSignal } from './constants';
|
|
3
3
|
import { OperationalRoles, PropertyValue, PropertyValueWithTrack } from './general';
|
|
4
|
-
import {
|
|
4
|
+
import { VPTMultiple, VPTCurrentADCPower, VPTCurrentDIX, VPTCurrentModem, VPTSettingsDIX, VPTCurrentOWTempX, VPTSettingsModem } from './vpts';
|
|
5
|
+
import { HexColor } from '@m4l/graphics';
|
|
5
6
|
export type DeviceDataGeofence = {
|
|
6
7
|
id: number;
|
|
7
8
|
name: string;
|
|
@@ -18,7 +19,7 @@ export type DeviceCurrentVPTGnss = {
|
|
|
18
19
|
gnssHdop: PropertyValue<number>;
|
|
19
20
|
gnssLatitude: PropertyValue<number>;
|
|
20
21
|
gnssLongitude: PropertyValue<number>;
|
|
21
|
-
|
|
22
|
+
gnssSatellitesInUse: PropertyValue<number>;
|
|
22
23
|
gnssSpeed: PropertyValue<number>;
|
|
23
24
|
gnssAddress: PropertyValue<string>;
|
|
24
25
|
gnssMotionStatus: PropertyValueWithTrack<GNSSEnumMotionStatus>;
|
|
@@ -33,15 +34,15 @@ export type DeviceCurrentVPTGnss = {
|
|
|
33
34
|
export type DeviceCurrent = {
|
|
34
35
|
reportProfiles?: {
|
|
35
36
|
trackerEvents?: {
|
|
36
|
-
|
|
37
|
+
modemLastEvent?: {
|
|
37
38
|
date: string;
|
|
38
39
|
};
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
42
|
vpts?: {
|
|
42
43
|
vptGnss?: DeviceCurrentVPTGnss;
|
|
43
|
-
vptDiX?:
|
|
44
|
-
vptOWTempX?:
|
|
44
|
+
vptDiX?: VPTMultiple<VPTCurrentDIX>;
|
|
45
|
+
vptOWTempX?: VPTMultiple<VPTCurrentOWTempX>;
|
|
45
46
|
vptModem?: VPTCurrentModem;
|
|
46
47
|
vptADCPower?: VPTCurrentADCPower;
|
|
47
48
|
};
|
|
@@ -49,8 +50,7 @@ export type DeviceCurrent = {
|
|
|
49
50
|
export type SettingsGroup = {
|
|
50
51
|
id: number;
|
|
51
52
|
name: string;
|
|
52
|
-
bgColor:
|
|
53
|
-
color: string;
|
|
53
|
+
bgColor: HexColor;
|
|
54
54
|
};
|
|
55
55
|
export type PropertyType = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'datetime' | 'array' | 'object' | 'function' | 'symbol' | 'undefined' | 'null' | 'unknown';
|
|
56
56
|
export type Property = {
|
|
@@ -65,16 +65,19 @@ export type Properties = {
|
|
|
65
65
|
*/
|
|
66
66
|
export type DeviceSettings = {
|
|
67
67
|
name: string;
|
|
68
|
+
alias?: string;
|
|
68
69
|
inTechinalOrder: PropertyValue<boolean>;
|
|
69
70
|
adminStatus: PropertyValue<string>;
|
|
70
71
|
active: boolean;
|
|
71
72
|
blocked?: boolean;
|
|
72
|
-
|
|
73
|
+
iconId: string;
|
|
73
74
|
operationalRoles?: OperationalRoles;
|
|
74
75
|
group?: Maybe<SettingsGroup>;
|
|
76
|
+
iconBgColor?: HexColor;
|
|
75
77
|
properties?: Properties;
|
|
76
78
|
vpts?: {
|
|
77
|
-
|
|
79
|
+
vptModem?: VPTSettingsModem;
|
|
80
|
+
vptDix?: VPTMultiple<VPTSettingsDIX>;
|
|
78
81
|
};
|
|
79
82
|
};
|
|
80
83
|
export type DeviceDataType = {
|
package/@types/general.d.ts
CHANGED
package/@types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { DeviceDataType, SettingsGroup } from './deviceData';
|
|
2
|
-
export { GNSSEnumMotionStatus
|
|
1
|
+
export type { DeviceDataType, SettingsGroup, DeviceCurrent, DeviceCurrentVPTGnss } from './deviceData';
|
|
2
|
+
export { GNSSEnumMotionStatus, GNSSEnumSignal } from './constants';
|
package/@types/types.d.ts
CHANGED
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
import { ComponentsOverrides, ComponentsVariants } from '@mui/material/styles';
|
|
2
2
|
import { MapPopupDeviceGpsOwnerState, MapPopupDeviceGpsSlotsType } from '../components/maps/components/GpsMap/popups/MapPopupDevice/types';
|
|
3
3
|
import { CourseFormatterOwnerState, CourseFormatterSlotsType } from '../formatters/CourseFormatter/types';
|
|
4
|
+
import { DeviceOwnerState, DeviceSlotsType } from '../components/Device/types';
|
|
4
5
|
import { IndicatorCSQOwnerState, IndicatorCSQSlotsType } from '../components/indicators/IndicatorCSQ/types';
|
|
5
6
|
import { IndicatorBatteryOwnerState, IndicatorBatterySlotsType } from '../components/indicators/IndicatorBattery/types';
|
|
6
7
|
import { IndicatorValueStatusSlotsType } from '../components/indicators/IndicatorValueStatus/types';
|
|
8
|
+
import { MapOwnerState, MapSlotsType } from '../components/maps/components/GpsMap/types';
|
|
7
9
|
declare module '@mui/material/styles' {
|
|
8
10
|
// Define the slots in the theme
|
|
9
11
|
interface ComponentNameToClassKey {
|
|
12
|
+
M4LMap: MapSlotsType;
|
|
10
13
|
M4LMapPopupDevice: MapPopupDeviceGpsSlotsType;
|
|
11
14
|
M4LCourseFormatter: CourseFormatterSlotsType;
|
|
15
|
+
M4LDevice: DeviceSlotsType;
|
|
16
|
+
|
|
12
17
|
M4LCSQSignal: IndicatorCSQSlotsType;
|
|
13
18
|
M4LIndicatorBattery: IndicatorBatterySlotsType;
|
|
14
19
|
M4LIndicatorValueStatus: IndicatorValueStatusSlotsType;
|
|
20
|
+
M4LIndicatorValueAndMagnitude: IndicatorValueAndMagnitudeSlotsType;
|
|
15
21
|
}
|
|
16
22
|
interface ComponentsPropsList {
|
|
17
23
|
// Extend ComponentsProps or ComponentsOwnerState(this extend ComponentProps)
|
|
24
|
+
M4LMap: Partial<MapOwnerState>;
|
|
18
25
|
M4LMapPopupDevice: Partial<MapPopupDeviceGpsOwnerState>;
|
|
19
26
|
M4LCourseFormatter: Partial<CourseFormatterOwnerState>;
|
|
27
|
+
M4LDevice: Partial<DeviceOwnerState>;
|
|
20
28
|
M4LCSQSignal: Partial<IndicatorCSQOwnerState>;
|
|
21
29
|
M4LIndicatorBattery: Partial<IndicatorBatteryOwnerState>;
|
|
22
30
|
M4LIndicatorValueStatus: Partial<IndicatorValueStatusOwnerState>;
|
|
31
|
+
M4LIndicatorValueAndMagnitude: Partial<IndicatorValueAndMagnitudeOwnerState>;
|
|
23
32
|
}
|
|
24
33
|
interface Components {
|
|
34
|
+
M4LMap?: {
|
|
35
|
+
defaultProps?: ComponentsPropsList['M4LMap'];
|
|
36
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LMap'];
|
|
37
|
+
variants?: ComponentsVariants['M4LMap'];
|
|
38
|
+
};
|
|
25
39
|
M4LMapPopupDevice?: {
|
|
26
40
|
defaultProps?: ComponentsPropsList['M4LMapPopupDevice'];
|
|
27
41
|
styleOverrides?: ComponentsOverrides<Theme>['M4LMapPopupDevice'];
|
|
@@ -32,6 +46,11 @@ declare module '@mui/material/styles' {
|
|
|
32
46
|
styleOverrides?: ComponentsOverrides<Theme>['M4LCourseFormatter'];
|
|
33
47
|
variants?: ComponentsVariants['M4LCourseFormatter'];
|
|
34
48
|
};
|
|
49
|
+
M4LDevice?: {
|
|
50
|
+
defaultProps?: ComponentsPropsList['M4LDevice'];
|
|
51
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LDevice'];
|
|
52
|
+
variants?: ComponentsVariants['M4LDevice'];
|
|
53
|
+
};
|
|
35
54
|
M4LCSQSignal?: {
|
|
36
55
|
defaultProps?: ComponentsPropsList['M4LCSQSignal'];
|
|
37
56
|
styleOverrides?: ComponentsOverrides<Theme>['M4LCSQSignal'];
|
|
@@ -47,5 +66,10 @@ declare module '@mui/material/styles' {
|
|
|
47
66
|
styleOverrides?: ComponentsOverrides<Theme>['M4LIndicatorValueStatus'];
|
|
48
67
|
variants?: ComponentsVariants['M4LIndicatorValueStatus'];
|
|
49
68
|
};
|
|
50
|
-
|
|
69
|
+
M4LIndicatorValueAndMagnitude?: {
|
|
70
|
+
defaultProps?: ComponentsPropsList['M4LIndicatorValueAndMagnitude'];
|
|
71
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LIndicatorValueAndMagnitude'];
|
|
72
|
+
variants?: ComponentsVariants['M4LIndicatorValueAndMagnitude'];
|
|
73
|
+
};
|
|
74
|
+
}
|
|
51
75
|
}
|
package/@types/vpts.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type VPTCurrentDIX = {
|
|
|
8
8
|
diXValue: PropertyValueWithTrack<boolean>;
|
|
9
9
|
diXStatus: PropertyValueWithTrack<boolean>;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type VPTMultiple<T> = {
|
|
12
12
|
[key: number]: T;
|
|
13
13
|
};
|
|
14
14
|
export type VPTSettingsDIX = {
|
|
@@ -42,8 +42,11 @@ export type VPTCurrentADCPower = {
|
|
|
42
42
|
backupChargeLevel: PropertyValue<number>;
|
|
43
43
|
};
|
|
44
44
|
export type VPTCurrentModem = {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
modemLastConnection: string;
|
|
46
|
+
modemLastEvent: string;
|
|
47
47
|
modemCsq: PropertyValue<number>;
|
|
48
48
|
callActive: PropertyValue<boolean>;
|
|
49
49
|
};
|
|
50
|
+
export type VPTSettingsModem = {
|
|
51
|
+
modemLineNumber?: string;
|
|
52
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DeviceProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente que muestra un dispositivo con su icono y descripción, basada en las propiedades del dispositivo que son
|
|
4
|
+
* reemplazadas de acuerdo a la etiqueta de visualización que normalmente viene de las preferencias del usuario autenticado.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Device: (props: DeviceProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEnvironment } from "@m4l/core";
|
|
3
|
+
import { D as DeviceRootStyled, a as DeviceStatusIconStyled, b as DeviceStatusRigthContainerStyled, c as DeviceTitleContainerStyled, d as DeviceStatusLabelStyled } from "./slots/DeviceSlots.js";
|
|
4
|
+
import { useComponentSize, Typography } from "@m4l/components";
|
|
5
|
+
import { u as useDevice } from "./hooks/useDevice.js";
|
|
6
|
+
const Device = (props) => {
|
|
7
|
+
const { deviceData, size, variant = "withStatus" } = props;
|
|
8
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
9
|
+
const { iconKey, color, palletColor, name, alias, stausOrIdLabel } = useDevice({ deviceData, variant });
|
|
10
|
+
const { currentSize } = useComponentSize(size);
|
|
11
|
+
const src = `${host_static_assets}/${environment_assets}/frontend/components/device_status/assets/icons/${iconKey}.svg`;
|
|
12
|
+
const ownerState = {
|
|
13
|
+
iconKey,
|
|
14
|
+
size: currentSize,
|
|
15
|
+
color,
|
|
16
|
+
palletColor,
|
|
17
|
+
variant
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ jsxs(DeviceRootStyled, { ownerState, children: [
|
|
20
|
+
/* @__PURE__ */ jsx(DeviceStatusIconStyled, { src, color, ownerState }),
|
|
21
|
+
/* @__PURE__ */ jsxs(DeviceStatusRigthContainerStyled, { ownerState, children: [
|
|
22
|
+
/* @__PURE__ */ jsxs(DeviceTitleContainerStyled, { ownerState, children: [
|
|
23
|
+
alias && /* @__PURE__ */ jsx(Typography, { variant: "bodyDens", color: "text.secondary", children: alias }),
|
|
24
|
+
/* @__PURE__ */ jsx(Typography, { variant: alias ? "body" : "bodyDens", color: "text.secondary", children: name })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx(DeviceStatusLabelStyled, { ownerState, variant: variant === "withStatus" ? "bodyDens" : "body", children: stausOrIdLabel })
|
|
27
|
+
] })
|
|
28
|
+
] });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
Device as D
|
|
32
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { getSizeStyles } from "@m4l/components";
|
|
2
|
+
import { g as getColors } from "./helpers.js";
|
|
3
|
+
const deviceStatusStyles = {
|
|
4
|
+
/**
|
|
5
|
+
* TODO: Documentar
|
|
6
|
+
*/
|
|
7
|
+
root: ({ theme }) => ({
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexGrow: 1,
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "flex-start",
|
|
12
|
+
height: "32px",
|
|
13
|
+
gap: `${theme.vars.size.baseSpacings["sp2-5"]}`,
|
|
14
|
+
overflow: "hidden"
|
|
15
|
+
}),
|
|
16
|
+
/**
|
|
17
|
+
* Estilos del icono del estado del dispositivo
|
|
18
|
+
*/
|
|
19
|
+
statusIcon: ({ theme, ownerState }) => {
|
|
20
|
+
const { colorIcon, colorBackground, colorBackgroundHover } = getColors(theme, ownerState);
|
|
21
|
+
return {
|
|
22
|
+
...getSizeStyles(
|
|
23
|
+
theme,
|
|
24
|
+
ownerState?.size || "medium",
|
|
25
|
+
"box",
|
|
26
|
+
(size) => {
|
|
27
|
+
return {
|
|
28
|
+
width: size,
|
|
29
|
+
height: size
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
flexShrink: 0,
|
|
34
|
+
boxShadow: `0 2px 6px 0 ${colorBackgroundHover}`,
|
|
35
|
+
borderRadius: `${theme.vars.size.borderRadius["r2"]}`,
|
|
36
|
+
backgroundColor: colorBackground,
|
|
37
|
+
"& .M4LIcon-icon": {
|
|
38
|
+
backgroundColor: `${colorIcon} !important`,
|
|
39
|
+
height: "20px",
|
|
40
|
+
width: "20px"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Estilos del contenedor del nombre y el alias del dispositivo
|
|
46
|
+
*/
|
|
47
|
+
statusRigthContainer: () => ({
|
|
48
|
+
display: "flex",
|
|
49
|
+
flexDirection: "column",
|
|
50
|
+
alignItems: "flex-start",
|
|
51
|
+
overflow: "hidden"
|
|
52
|
+
}),
|
|
53
|
+
/**
|
|
54
|
+
* Contenedor del nombre y el alias del dispositivo
|
|
55
|
+
*/
|
|
56
|
+
titleContainer: ({ theme }) => ({
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
gap: `${theme.vars.size.baseSpacings["sp2"]}`
|
|
60
|
+
}),
|
|
61
|
+
// /**
|
|
62
|
+
// *
|
|
63
|
+
// */
|
|
64
|
+
// titleName: () => ({
|
|
65
|
+
// fontSize: '14px',
|
|
66
|
+
// fontWeight: 'bold',
|
|
67
|
+
// }),
|
|
68
|
+
// /**
|
|
69
|
+
// *
|
|
70
|
+
// */
|
|
71
|
+
// titleAlias: () => ({
|
|
72
|
+
// fontSize: '12px',
|
|
73
|
+
// fontWeight: 'normal',
|
|
74
|
+
// }),
|
|
75
|
+
/**
|
|
76
|
+
* Estilos del label del estado del dispositivo
|
|
77
|
+
*/
|
|
78
|
+
statusLabel: ({ theme, ownerState }) => {
|
|
79
|
+
const { colorText } = getColors(theme, ownerState);
|
|
80
|
+
return {
|
|
81
|
+
whiteSpace: "nowrap",
|
|
82
|
+
width: "100%",
|
|
83
|
+
overflow: "hidden",
|
|
84
|
+
textOverflow: "ellipsis",
|
|
85
|
+
fontSize: "12px",
|
|
86
|
+
fontWeight: "normal",
|
|
87
|
+
...ownerState?.variant === "withStatus" && {
|
|
88
|
+
color: `${colorText} !important`
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
deviceStatusStyles as d
|
|
95
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChipColorOptions } from '@m4l/styles';
|
|
2
|
+
import { GNSSEnumMotionStatus } from '../../@types/constants';
|
|
3
|
+
import { IconColorDeep } from '@m4l/components';
|
|
4
|
+
export declare const COMPONENT_DEVICE_TEST_ID = "M4LDevice";
|
|
5
|
+
export declare const COMPONET_DEVICE_KEY_COMPONENT = "M4LDevice";
|
|
6
|
+
export type DeviceData = {
|
|
7
|
+
id: GNSSEnumMotionStatus;
|
|
8
|
+
statusLabelId: string;
|
|
9
|
+
iconKey: string;
|
|
10
|
+
color: IconColorDeep;
|
|
11
|
+
palletColor: ChipColorOptions;
|
|
12
|
+
name: string;
|
|
13
|
+
alias?: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const MDS_DICTIONARY_ID = "device";
|
|
2
|
+
export declare function getDeviceComponentsDictionary(): string[];
|
|
3
|
+
export declare const MDS_DICTIONARY: {
|
|
4
|
+
readonly LABEL_OFF: "device.label_off";
|
|
5
|
+
readonly LABEL_MOVING: "device.label_moving";
|
|
6
|
+
readonly LABEL_STOPPED: "device.label_stopped";
|
|
7
|
+
readonly LABEL_STOPPED_RALENTI: "device.label_stopped_ralenti";
|
|
8
|
+
readonly LABEL_STOPPED_E_RALENTI: "device.label_stopped_e_ralenti";
|
|
9
|
+
readonly LABEL_TOWING: "device.label_towing";
|
|
10
|
+
readonly LABEL_NO_GPS_SIGNAL: "device.label_no_gps_signal";
|
|
11
|
+
readonly LABEL_POWER_SAVING: "device.label_power_saving";
|
|
12
|
+
readonly LABEL_MAX_SPEED: "device.label_max_speed";
|
|
13
|
+
readonly LABEL_ID: "device.label_id";
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const MDS_DICTIONARY_ID = "device";
|
|
2
|
+
function getDeviceComponentsDictionary() {
|
|
3
|
+
return [MDS_DICTIONARY_ID].concat();
|
|
4
|
+
}
|
|
5
|
+
const MDS_DICTIONARY = {
|
|
6
|
+
LABEL_OFF: `${MDS_DICTIONARY_ID}.label_off`,
|
|
7
|
+
LABEL_MOVING: `${MDS_DICTIONARY_ID}.label_moving`,
|
|
8
|
+
LABEL_STOPPED: `${MDS_DICTIONARY_ID}.label_stopped`,
|
|
9
|
+
LABEL_STOPPED_RALENTI: `${MDS_DICTIONARY_ID}.label_stopped_ralenti`,
|
|
10
|
+
LABEL_STOPPED_E_RALENTI: `${MDS_DICTIONARY_ID}.label_stopped_e_ralenti`,
|
|
11
|
+
LABEL_TOWING: `${MDS_DICTIONARY_ID}.label_towing`,
|
|
12
|
+
LABEL_POWER_SAVING: `${MDS_DICTIONARY_ID}.label_power_saving`,
|
|
13
|
+
LABEL_MAX_SPEED: `${MDS_DICTIONARY_ID}.label_max_speed`,
|
|
14
|
+
LABEL_ID: `${MDS_DICTIONARY_ID}.label_id`
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
MDS_DICTIONARY as M,
|
|
18
|
+
getDeviceComponentsDictionary as g
|
|
19
|
+
};
|
package/components/{DeviceStatus/hooks/helper.d.ts → Device/helpers/helperDeviceStatus.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeviceDataType } from '../../../@types';
|
|
2
|
-
import { StatusDeviceData } from '
|
|
2
|
+
import { StatusDeviceData } from '../hooks/constants';
|
|
3
3
|
/**
|
|
4
4
|
* Hook encargado de memonizar y obtener el id del icono, el color y el label, y como usa speed para tomar decisiones,
|
|
5
5
|
* tambien lo devuelve para ser usado en partes donde lo necesiten
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getPropertyByString } from "@m4l/core";
|
|
2
1
|
import { G as GNSSEnumMotionStatus } from "../../../@types/constants.js";
|
|
3
|
-
import { D as DEVICE_STATUSES_CONFIG } from "
|
|
2
|
+
import { D as DEVICE_STATUSES_CONFIG } from "../hooks/constants.js";
|
|
3
|
+
import { g as getVptValueWithGuard } from "../../../utils/getVptValueWithGuard.js";
|
|
4
4
|
const getDeviceStatusByData = (deviceData) => {
|
|
5
|
-
const status = deviceData?.current?.vpts?.vptGnss?.gnssMotionStatus
|
|
6
|
-
const course =
|
|
7
|
-
const speed =
|
|
5
|
+
const status = getVptValueWithGuard(deviceData?.current?.vpts?.vptGnss?.gnssMotionStatus, GNSSEnumMotionStatus.off);
|
|
6
|
+
const course = getVptValueWithGuard(deviceData?.current?.vpts?.vptGnss?.gnssCourse, 0);
|
|
7
|
+
const speed = getVptValueWithGuard(deviceData?.current?.vpts?.vptGnss?.gnssSpeed, 0);
|
|
8
8
|
let statusData;
|
|
9
9
|
try {
|
|
10
10
|
statusData = { course, speed, ...DEVICE_STATUSES_CONFIG[status] };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DeviceDataType } from '../../@types';
|
|
2
|
+
import { DeviceData } from './constants';
|
|
3
|
+
import { Theme } from '@mui/material/styles';
|
|
4
|
+
import { DeviceOwnerState } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Hook encargado de memonizar y obtener el id del icono, el color y el label, y como usa speed para tomar decisiones,
|
|
7
|
+
* tambien lo devuelve para ser usado en partes donde lo necesiten
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDeviceByData: (deviceData: DeviceDataType) => DeviceData;
|
|
10
|
+
/**
|
|
11
|
+
* Obtiene los colores del chip
|
|
12
|
+
*/
|
|
13
|
+
export declare const getColors: (theme: Theme, ownerState: Partial<DeviceOwnerState>) => {
|
|
14
|
+
colorText: string;
|
|
15
|
+
colorIcon: string;
|
|
16
|
+
colorBackground: string;
|
|
17
|
+
colorBackgroundHover: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getPropertyByString } from "@m4l/core";
|
|
2
|
+
import { G as GNSSEnumMotionStatus } from "../../@types/constants.js";
|
|
3
|
+
import { D as DEVICE_STATUSES_CONFIG } from "./hooks/constants.js";
|
|
4
|
+
const getDeviceByData = (deviceData) => {
|
|
5
|
+
const status = deviceData?.current?.vpts?.vptGnss?.gnssMotionStatus?.value || GNSSEnumMotionStatus.off;
|
|
6
|
+
const name = getPropertyByString(deviceData, "settings.name", "");
|
|
7
|
+
const alias = getPropertyByString(deviceData, "settings.alias", void 0);
|
|
8
|
+
let statusDeviceData;
|
|
9
|
+
try {
|
|
10
|
+
statusDeviceData = { name, alias, ...DEVICE_STATUSES_CONFIG[status] };
|
|
11
|
+
} catch (_error) {
|
|
12
|
+
statusDeviceData = { name, alias, ...DEVICE_STATUSES_CONFIG[GNSSEnumMotionStatus.stopped] };
|
|
13
|
+
}
|
|
14
|
+
return statusDeviceData;
|
|
15
|
+
};
|
|
16
|
+
const getColors = (theme, ownerState) => {
|
|
17
|
+
const finalPalette = theme.vars.palette.chips[ownerState?.palletColor ?? "default"]["contained"];
|
|
18
|
+
const colorBackground = finalPalette.backgroundColorTone;
|
|
19
|
+
const colorText = finalPalette.color;
|
|
20
|
+
const colorIcon = finalPalette.colorTone;
|
|
21
|
+
const colorBackgroundHover = finalPalette.backgroundHover;
|
|
22
|
+
return { colorText, colorIcon, colorBackground, colorBackgroundHover };
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
getDeviceByData as a,
|
|
26
|
+
getColors as g
|
|
27
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChipColorOptions } from '@m4l/styles';
|
|
2
|
+
import { GNSSEnumMotionStatus } from '../../../@types/constants';
|
|
3
|
+
import { IconProps } from '@m4l/components';
|
|
4
|
+
export type BaseStatusDeviceData = {
|
|
5
|
+
id: GNSSEnumMotionStatus;
|
|
6
|
+
statusLabelId: string;
|
|
7
|
+
iconKey: string;
|
|
8
|
+
color: Required<IconProps>['color'];
|
|
9
|
+
palletColor: ChipColorOptions;
|
|
10
|
+
course?: number;
|
|
11
|
+
};
|
|
12
|
+
export type StatusDeviceData = BaseStatusDeviceData & {
|
|
13
|
+
course?: number;
|
|
14
|
+
speed?: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const DEVICE_STATUSES_CONFIG: Record<GNSSEnumMotionStatus, BaseStatusDeviceData>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { G as GNSSEnumMotionStatus } from "../../../@types/constants.js";
|
|
2
2
|
import { M as MDS_DICTIONARY } from "../dictionary.js";
|
|
3
|
-
import {
|
|
3
|
+
import { D as DEVICE_ICONS } from "../icons.js";
|
|
4
4
|
const DEVICE_STATUSES_CONFIG = {
|
|
5
5
|
[GNSSEnumMotionStatus.moving]: {
|
|
6
6
|
id: GNSSEnumMotionStatus.moving,
|
|
7
7
|
statusLabelId: MDS_DICTIONARY.LABEL_MOVING,
|
|
8
|
-
iconKey:
|
|
8
|
+
iconKey: DEVICE_ICONS.MOVING,
|
|
9
9
|
color: "success.main",
|
|
10
10
|
//Ready
|
|
11
11
|
palletColor: "success"
|
|
@@ -13,27 +13,25 @@ const DEVICE_STATUSES_CONFIG = {
|
|
|
13
13
|
[GNSSEnumMotionStatus.off]: {
|
|
14
14
|
id: GNSSEnumMotionStatus.off,
|
|
15
15
|
statusLabelId: MDS_DICTIONARY.LABEL_OFF,
|
|
16
|
-
iconKey:
|
|
16
|
+
iconKey: DEVICE_ICONS.OFF,
|
|
17
17
|
color: "info.main",
|
|
18
18
|
//Ready
|
|
19
19
|
palletColor: "info",
|
|
20
|
-
course: 0
|
|
21
|
-
speed: 0
|
|
20
|
+
course: 0
|
|
22
21
|
},
|
|
23
22
|
[GNSSEnumMotionStatus.stopped]: {
|
|
24
23
|
id: GNSSEnumMotionStatus.stopped,
|
|
25
24
|
statusLabelId: MDS_DICTIONARY.LABEL_STOPPED,
|
|
26
|
-
iconKey:
|
|
25
|
+
iconKey: DEVICE_ICONS.STOPPED,
|
|
27
26
|
color: "text.secondary",
|
|
28
27
|
//Ready
|
|
29
28
|
palletColor: "default",
|
|
30
|
-
course: 0
|
|
31
|
-
speed: 0
|
|
29
|
+
course: 0
|
|
32
30
|
},
|
|
33
31
|
[GNSSEnumMotionStatus.stoppedRalenti]: {
|
|
34
32
|
id: GNSSEnumMotionStatus.stoppedRalenti,
|
|
35
33
|
statusLabelId: MDS_DICTIONARY.LABEL_STOPPED_RALENTI,
|
|
36
|
-
iconKey:
|
|
34
|
+
iconKey: DEVICE_ICONS.STOPPED_RALENTI,
|
|
37
35
|
color: "warning.active",
|
|
38
36
|
//Ready
|
|
39
37
|
palletColor: "warning",
|
|
@@ -42,24 +40,24 @@ const DEVICE_STATUSES_CONFIG = {
|
|
|
42
40
|
[GNSSEnumMotionStatus.stoppedExcesiveRalenti]: {
|
|
43
41
|
id: GNSSEnumMotionStatus.stoppedExcesiveRalenti,
|
|
44
42
|
statusLabelId: MDS_DICTIONARY.LABEL_STOPPED_E_RALENTI,
|
|
45
|
-
iconKey:
|
|
43
|
+
iconKey: DEVICE_ICONS.STOPPED_E_RALENTI,
|
|
46
44
|
color: "error.enabled",
|
|
47
45
|
//Ready
|
|
48
|
-
palletColor: "
|
|
46
|
+
palletColor: "orange",
|
|
49
47
|
course: 0
|
|
50
48
|
},
|
|
51
49
|
[GNSSEnumMotionStatus.towing]: {
|
|
52
50
|
id: GNSSEnumMotionStatus.towing,
|
|
53
51
|
statusLabelId: MDS_DICTIONARY.LABEL_TOWING,
|
|
54
|
-
iconKey:
|
|
52
|
+
iconKey: DEVICE_ICONS.TOWING,
|
|
55
53
|
color: "success.active",
|
|
56
54
|
//Ready
|
|
57
|
-
palletColor: "
|
|
55
|
+
palletColor: "forest"
|
|
58
56
|
},
|
|
59
57
|
[GNSSEnumMotionStatus.powerSaving]: {
|
|
60
58
|
id: GNSSEnumMotionStatus.powerSaving,
|
|
61
59
|
statusLabelId: MDS_DICTIONARY.LABEL_POWER_SAVING,
|
|
62
|
-
iconKey:
|
|
60
|
+
iconKey: DEVICE_ICONS.POWER_SAVING,
|
|
63
61
|
color: "text.secondary",
|
|
64
62
|
//Ready
|
|
65
63
|
palletColor: "default",
|
|
@@ -68,7 +66,7 @@ const DEVICE_STATUSES_CONFIG = {
|
|
|
68
66
|
[GNSSEnumMotionStatus.maxSpeed]: {
|
|
69
67
|
id: GNSSEnumMotionStatus.maxSpeed,
|
|
70
68
|
statusLabelId: MDS_DICTIONARY.LABEL_MAX_SPEED,
|
|
71
|
-
iconKey:
|
|
69
|
+
iconKey: DEVICE_ICONS.MAX_SPEED,
|
|
72
70
|
color: "error.enabled",
|
|
73
71
|
//Ready
|
|
74
72
|
palletColor: "error"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useDeviceProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook encargado de memonizar y obtener el id del icono, el color y el label
|
|
4
|
+
*/
|
|
5
|
+
export declare const useDevice: (props: useDeviceProps) => {
|
|
6
|
+
name: string;
|
|
7
|
+
alias: string | undefined;
|
|
8
|
+
iconKey: string;
|
|
9
|
+
stausOrIdLabel: string;
|
|
10
|
+
color: string;
|
|
11
|
+
palletColor: import('@m4l/styles').ChipColorOptions;
|
|
12
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { a as getDeviceByData } from "../helpers.js";
|
|
4
|
+
import { M as MDS_DICTIONARY } from "../dictionary.js";
|
|
5
|
+
const useDevice = (props) => {
|
|
6
|
+
const { deviceData, variant = "withStatus" } = props;
|
|
7
|
+
const { getLabel } = useModuleDictionary();
|
|
8
|
+
return useMemo(() => {
|
|
9
|
+
const { iconKey, statusLabelId, color, palletColor, name, alias } = getDeviceByData(deviceData);
|
|
10
|
+
const stausOrIdLabel = variant === "withStatus" ? getLabel(statusLabelId) : `${getLabel(MDS_DICTIONARY.LABEL_ID, deviceData.resourceSerialId)}`;
|
|
11
|
+
return {
|
|
12
|
+
name,
|
|
13
|
+
alias,
|
|
14
|
+
iconKey,
|
|
15
|
+
stausOrIdLabel,
|
|
16
|
+
color,
|
|
17
|
+
palletColor
|
|
18
|
+
};
|
|
19
|
+
}, [deviceData, getLabel, variant]);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
useDevice as u
|
|
23
|
+
};
|
|
@@ -6,7 +6,7 @@ export declare const useDeviceStatus: (props: useDeviceStatusProps) => {
|
|
|
6
6
|
iconKey: string;
|
|
7
7
|
label: string | undefined;
|
|
8
8
|
color: string;
|
|
9
|
-
|
|
10
|
-
palletColor:
|
|
9
|
+
course: number | undefined;
|
|
10
|
+
palletColor: import('@m4l/styles').ChipColorOptions;
|
|
11
11
|
speed: number | undefined;
|
|
12
12
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { useModuleDictionary } from "@m4l/core";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { g as getDeviceStatusByData } from "
|
|
3
|
+
import { g as getDeviceStatusByData } from "../helpers/helperDeviceStatus.js";
|
|
4
4
|
const useDeviceStatus = (props) => {
|
|
5
5
|
const { deviceData, withLabel = false } = props;
|
|
6
6
|
const { getLabel } = useModuleDictionary();
|
|
7
7
|
return useMemo(() => {
|
|
8
|
-
const { iconKey, statusLabelId
|
|
8
|
+
const { iconKey, statusLabelId, color, course, palletColor, speed } = getDeviceStatusByData(deviceData);
|
|
9
9
|
let label;
|
|
10
10
|
if (withLabel) {
|
|
11
|
-
label = getLabel(
|
|
11
|
+
label = getLabel(statusLabelId);
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
14
|
iconKey,
|
|
15
15
|
label,
|
|
16
16
|
color,
|
|
17
|
-
|
|
17
|
+
course,
|
|
18
18
|
palletColor,
|
|
19
19
|
speed
|
|
20
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const DEVICE_ICONS = {
|
|
2
2
|
OFF: "i_cmp_device_status_main_off",
|
|
3
3
|
MOVING: "i_cmp_device_status_main_movement",
|
|
4
4
|
STOPPED: "i_cmp_device_status_main_stopped",
|
|
@@ -9,5 +9,5 @@ const MDS_ICONS = {
|
|
|
9
9
|
MAX_SPEED: "i_cmp_device_status_main_max_speed"
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
DEVICE_ICONS as D
|
|
13
13
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './Device';
|
|
2
|
+
export { getDeviceComponentsDictionary } from './dictionary';
|
|
3
|
+
export { getDeviceByData } from './helpers';
|
|
4
|
+
export { getDeviceStatusByData } from './helpers/helperDeviceStatus';
|
|
5
|
+
export { DEVICE_STATUSES_CONFIG } from '../Device/hooks/constants';
|
|
6
|
+
export { useDeviceStatus } from '../Device/hooks/useDeviceStatus';
|