@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.
Files changed (267) hide show
  1. package/@types/deviceData.d.ts +12 -9
  2. package/@types/general.d.ts +1 -1
  3. package/@types/index.d.ts +2 -2
  4. package/@types/types.d.ts +25 -1
  5. package/@types/vpts.d.ts +6 -3
  6. package/components/Device/Device.d.ts +6 -0
  7. package/components/Device/Device.js +32 -0
  8. package/components/Device/Device.styles.d.ts +2 -0
  9. package/components/Device/Device.styles.js +95 -0
  10. package/components/Device/constants.d.ts +14 -0
  11. package/components/Device/constants.js +4 -0
  12. package/components/Device/dictionary.d.ts +14 -0
  13. package/components/Device/dictionary.js +19 -0
  14. package/components/{DeviceStatus/hooks/helper.d.ts → Device/helpers/helperDeviceStatus.d.ts} +1 -1
  15. package/components/{DeviceStatus/hooks/helper.js → Device/helpers/helperDeviceStatus.js} +5 -5
  16. package/components/Device/helpers.d.ts +18 -0
  17. package/components/Device/helpers.js +27 -0
  18. package/components/Device/hooks/constants.d.ts +16 -0
  19. package/components/{DeviceStatus → Device}/hooks/constants.js +13 -15
  20. package/components/Device/hooks/useDevice.d.ts +12 -0
  21. package/components/Device/hooks/useDevice.js +23 -0
  22. package/components/{DeviceStatus → Device}/hooks/useDeviceStatus.d.ts +2 -2
  23. package/components/{DeviceStatus → Device}/hooks/useDeviceStatus.js +4 -4
  24. package/components/Device/icons.d.ts +11 -0
  25. package/components/{DeviceStatus → Device}/icons.js +2 -2
  26. package/components/Device/index.d.ts +6 -0
  27. package/components/Device/slots/DeviceSlots.d.ts +15 -0
  28. package/components/Device/slots/DeviceSlots.js +32 -0
  29. package/components/Device/slots/slots.d.ts +7 -0
  30. package/components/Device/slots/slots.js +11 -0
  31. package/components/Device/types.d.ts +30 -0
  32. package/components/DeviceLabel/DeviceLabel.js +1 -1
  33. package/components/DeviceLabel/slots/DeviceLabelSlots.d.ts +9 -3
  34. package/components/DeviceLabel/types.d.ts +2 -2
  35. package/components/DeviceStatus/DeviceStatus.js +3 -15
  36. package/components/DeviceStatus/DeviceStatus.styles.js +1 -13
  37. package/components/DeviceStatus/constants.js +1 -4
  38. package/components/DeviceStatus/dictionary.d.ts +10 -10
  39. package/components/DeviceStatus/dictionary.js +1 -12
  40. package/components/DeviceStatus/icons.d.ts +1 -1
  41. package/components/DeviceStatus/index.d.ts +3 -2
  42. package/components/DeviceStatus/slots/DeviceStatusSlots.js +1 -11
  43. package/components/DeviceStatus/slots/slots.js +1 -7
  44. package/components/index.d.ts +1 -1
  45. package/components/indicators/IndicatorBattery/IndicatorBattery.styles.js +2 -2
  46. package/components/indicators/IndicatorBattery/dictionary.js +5 -1
  47. package/components/indicators/IndicatorBattery/index.d.ts +1 -0
  48. package/components/indicators/IndicatorCSQ/IndicatorCSQ.js +7 -5
  49. package/components/indicators/IndicatorCSQ/constants.d.ts +2 -2
  50. package/components/indicators/IndicatorCSQ/constants.js +4 -3
  51. package/components/indicators/IndicatorCSQ/dictionary.d.ts +5 -2
  52. package/components/indicators/IndicatorCSQ/dictionary.js +15 -12
  53. package/components/indicators/IndicatorCSQ/helpers/getQualityLabel/getQualityLabel.d.ts +22 -2
  54. package/components/indicators/IndicatorCSQ/helpers/getQualityLabel/getQualityLabel.js +15 -29
  55. package/components/indicators/IndicatorCSQ/index.d.ts +3 -3
  56. package/components/indicators/IndicatorCSQ/slots/IndicatorCSQSlots.js +6 -6
  57. package/components/indicators/IndicatorCSQ/types.d.ts +6 -2
  58. package/components/indicators/IndicatorValueAndMagnitude/IndicatorValueAndMagnitude.d.ts +5 -0
  59. package/components/indicators/IndicatorValueAndMagnitude/IndicatorValueAndMagnitude.js +15 -0
  60. package/components/indicators/IndicatorValueAndMagnitude/IndicatorValueAndMagnitude.styles.d.ts +2 -0
  61. package/components/indicators/IndicatorValueAndMagnitude/IndicatorValueAndMagnitude.styles.js +41 -0
  62. package/components/indicators/IndicatorValueAndMagnitude/constants.d.ts +2 -0
  63. package/components/indicators/IndicatorValueAndMagnitude/constants.js +7 -0
  64. package/components/indicators/IndicatorValueAndMagnitude/index.d.ts +1 -0
  65. package/components/indicators/IndicatorValueAndMagnitude/index.js +1 -0
  66. package/components/indicators/IndicatorValueAndMagnitude/slots/slots.d.ts +6 -0
  67. package/components/indicators/IndicatorValueAndMagnitude/slots/slots.js +10 -0
  68. package/components/indicators/IndicatorValueAndMagnitude/slots/styled.d.ts +12 -0
  69. package/components/indicators/IndicatorValueAndMagnitude/slots/styled.js +27 -0
  70. package/components/indicators/IndicatorValueAndMagnitude/types.d.ts +14 -0
  71. package/components/indicators/IndicatorValueStatus/IndicatorValueStatus.js +25 -0
  72. package/components/indicators/IndicatorValueStatus/IndicatorValueStatus.styles.js +76 -0
  73. package/components/indicators/IndicatorValueStatus/constants.js +8 -0
  74. package/components/indicators/IndicatorValueStatus/index.js +1 -0
  75. package/components/indicators/IndicatorValueStatus/slots/IndicatorValueStatusEnum.js +11 -0
  76. package/components/indicators/IndicatorValueStatus/slots/IndicatorValueStatusSlots.js +32 -0
  77. package/components/indicators/IndicatorValueStatus/types.d.ts +4 -0
  78. package/components/indicators/index.d.ts +2 -0
  79. package/components/maps/components/GpsMap/GpsMap.js +26 -9
  80. package/components/maps/components/GpsMap/GpsMap.styles.js +81 -93
  81. package/components/maps/components/GpsMap/classes/index.d.ts +1 -1
  82. package/components/maps/components/GpsMap/classes/index.js +6 -76
  83. package/components/maps/components/GpsMap/classes/types.d.ts +5 -16
  84. package/components/maps/components/GpsMap/constants.d.ts +9 -3
  85. package/components/maps/components/GpsMap/constants.js +25 -13
  86. package/components/maps/components/GpsMap/contexts/MapContext/MapContext.js +4 -26
  87. package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts +1 -1
  88. package/components/maps/components/GpsMap/contexts/MapContext/store.js +50 -75
  89. package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts +98 -87
  90. package/components/maps/components/GpsMap/dictionary.d.ts +19 -8
  91. package/components/maps/components/GpsMap/dictionary.js +30 -17
  92. package/components/maps/components/GpsMap/external/{Control → MapControl}/index.d.ts +3 -3
  93. package/components/maps/components/GpsMap/external/{Control → MapControl}/index.js +9 -7
  94. package/components/maps/components/GpsMap/external/MapControl/types.d.ts +26 -0
  95. package/components/maps/components/GpsMap/external/googleMutant/index.d.ts +1 -1
  96. package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.js +3 -3
  97. package/components/maps/components/GpsMap/featureRenders/FeatureDivIconLabel/index.js +1 -1
  98. package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/types.d.ts +3 -2
  99. package/components/maps/components/GpsMap/featureRenders/index.d.ts +0 -1
  100. package/components/maps/components/GpsMap/hooks/index.d.ts +3 -0
  101. package/components/maps/components/GpsMap/hooks/index.js +1 -0
  102. package/components/maps/components/GpsMap/hooks/useDisableMapEventsOnFlag/index.d.ts +6 -0
  103. package/components/maps/components/GpsMap/hooks/useDisableMapEventsOnFlag/index.js +31 -0
  104. package/components/maps/components/GpsMap/hooks/useDisableMapEventsOnMouseOver/index.d.ts +6 -0
  105. package/components/maps/components/GpsMap/hooks/{useDisableZoomEvents → useDisableMapEventsOnMouseOver}/index.js +10 -2
  106. package/components/maps/components/GpsMap/icons.d.ts +10 -7
  107. package/components/maps/components/GpsMap/icons.js +17 -16
  108. package/components/maps/components/GpsMap/index.d.ts +2 -1
  109. package/components/maps/components/GpsMap/leaflet.styles.d.ts +6 -0
  110. package/components/maps/components/GpsMap/popups/MapPopupDevice/MapPopupDevice.js +9 -1
  111. package/components/maps/components/GpsMap/popups/index.d.ts +1 -0
  112. package/components/maps/components/GpsMap/slots/slots.d.ts +27 -4
  113. package/components/maps/components/GpsMap/slots/slots.js +16 -7
  114. package/components/maps/components/GpsMap/slots/styled.d.ts +18 -0
  115. package/components/maps/components/GpsMap/slots/styled.js +37 -0
  116. package/components/maps/components/GpsMap/subcomponents/Controls/index.js +8 -7
  117. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/index.d.ts +10 -0
  118. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/index.js +10 -0
  119. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → BottomRigthTools}/subcomponents/ZoomButtons/index.js +3 -3
  120. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/BottomRigthTools/types.d.ts +2 -0
  121. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/hooks/types.d.ts +8 -0
  122. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/hooks/useTool.d.ts +13 -0
  123. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/hooks/useTool.js +64 -0
  124. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/index.d.ts +0 -2
  125. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/index.js +42 -87
  126. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ButtonTool/index.d.ts +9 -0
  127. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ButtonTool/index.js +24 -0
  128. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ButtonTool/types.d.ts +2 -0
  129. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/MapLayersTool.d.ts +4 -0
  130. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/MapLayersTool.js +30 -0
  131. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/MapLayersTool.styles.d.ts +2 -0
  132. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/MapLayersTool.styles.js +45 -0
  133. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/hooks/types.d.ts +11 -0
  134. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/hooks/useMapLayersTool.d.ts +9 -0
  135. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/hooks/useMapLayersTool.js +37 -0
  136. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/slots/slots.d.ts +6 -0
  137. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/slots/slots.js +10 -0
  138. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/slots/styled.d.ts +12 -0
  139. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/slots/styled.js +26 -0
  140. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/subcomponents/MapLayerRow.d.ts +5 -0
  141. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/subcomponents/MapLayerRow.js +71 -0
  142. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/subcomponents/types.d.ts +6 -0
  143. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapLayersTool/types.d.ts +9 -0
  144. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.d.ts → TopRigthTools/subcomponents/MapSourcesTool/MapSourcesTool.d.ts} +1 -1
  145. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/MapSourcesTool.js +38 -0
  146. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/MapSourcesTool.styles.d.ts +2 -0
  147. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/MapSourcesTool.styles.js +87 -0
  148. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/hooks/useMapSourcesTool.d.ts +12 -0
  149. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/hooks/useMapSourcesTool.js +22 -0
  150. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/slots/slots.d.ts +9 -0
  151. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/slots/slots.js +13 -0
  152. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/slots/styled.d.ts +21 -0
  153. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/slots/styled.js +41 -0
  154. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/bing.d.ts +2 -0
  155. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/bing.js +47 -0
  156. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/google.d.ts +2 -0
  157. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/google.js +107 -0
  158. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/others.d.ts +2 -0
  159. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/sourceTypes/others.js +33 -0
  160. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/subcomponents/MapSourceCard.d.ts +6 -0
  161. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/subcomponents/MapSourceCard.js +88 -0
  162. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/subcomponents/types.d.ts +7 -0
  163. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MapSourcesTool/types.d.ts +9 -0
  164. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/MeasureTool.js +31 -0
  165. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/MeasureTool.styles.d.ts +7 -0
  166. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/MeasureTool.styles.js +154 -0
  167. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/constants.d.ts +25 -0
  168. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/constants.js +37 -14
  169. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/helpers.d.ts +29 -0
  170. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/helpers.js +14 -6
  171. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts +2 -2
  172. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/index.js +26 -20
  173. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts +1 -2
  174. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/slots/slots.d.ts +8 -0
  175. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/slots/slots.js +12 -0
  176. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/slots/styled.d.ts +18 -0
  177. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/slots/styled.js +37 -0
  178. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/index.js +19 -17
  179. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/types.d.ts +18 -2
  180. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/types.d.ts +9 -1
  181. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/types.d.ts +2 -5
  182. package/components/maps/components/GpsMap/subcomponents/Controls/types.d.ts +1 -1
  183. package/components/maps/components/GpsMap/subcomponents/LayersContainer/index.js +2 -1
  184. package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/index.js +2 -1
  185. package/components/maps/components/GpsMap/subcomponents/MapEventController/MapEventController.d.ts +6 -0
  186. package/components/maps/components/GpsMap/subcomponents/MapEventController/MapEventController.js +8 -0
  187. package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerGoogle/darkStyles.d.ts +13 -0
  188. package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerGoogle/index.js +82 -59
  189. package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerOthers/index.js +25 -15
  190. package/components/maps/components/GpsMap/types.d.ts +24 -5
  191. package/components/maps/components/GpsMapTools/GpsMapTools.d.ts +1 -0
  192. package/components/maps/components/GpsMapTools/index.d.ts +1 -0
  193. package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/index.js +1 -1
  194. package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useColumns.js +29 -32
  195. package/components/maps/components/GpsMapTools/types.d.ts +0 -16
  196. package/components/maps/index.d.ts +1 -0
  197. package/components/maps/utils/coordsToQuadKey.d.ts +4 -0
  198. package/components/maps/{components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/utils.js → utils/coordsToQuadKey.js} +2 -2
  199. package/components/maps/utils/index.d.ts +1 -0
  200. package/contexts/RealTimeConsumerContext/RealTimeConsumerContext.js +1 -1
  201. package/contexts/RealTimeProducerContext/sourceDataMechanisms/athmospherejs/index.d.ts +1 -1
  202. package/contexts/RealTimeProducerContext/sourceDataMechanisms/athmospherejs/index.js +1 -1
  203. package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/constants.d.ts +67 -2
  204. package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/constants.js +115 -30
  205. package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/dummy.js +5 -38
  206. package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/group.d.ts +9 -36
  207. package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/group.js +27 -19
  208. package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/helpers.d.ts +3 -2
  209. package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/helpers.js +9 -2
  210. package/contexts/RealTimeProducerContext/sourceDataMechanisms/factory.js +1 -1
  211. package/formatters/CourseFormatter/CourseFormatter.js +6 -4
  212. package/formatters/CourseFormatter/helper.d.ts +2 -1
  213. package/formatters/CourseFormatter/helper.js +2 -4
  214. package/formatters/CourseFormatter/index.d.ts +1 -0
  215. package/formatters/CourseFormatter/slots/CourseFormatterSlots.d.ts +1 -1
  216. package/formatters/CourseFormatter/slots/CourseFormatterSlots.js +2 -2
  217. package/formatters/index.js +1 -0
  218. package/index.d.ts +1 -0
  219. package/index.js +94 -59
  220. package/package.json +16 -3
  221. package/utils/cssToCSSProperties.d.ts +37 -0
  222. package/utils/getPrecisionFromHdop/constants.d.ts +13 -0
  223. package/utils/getPrecisionFromHdop/constants.js +73 -0
  224. package/utils/getPrecisionFromHdop/getPrecisionFromHdop.d.ts +31 -0
  225. package/utils/getPrecisionFromHdop/getPrecisionFromHdop.js +59 -0
  226. package/utils/getPrecisionFromHdop/index.d.ts +3 -0
  227. package/utils/getPrecisionFromHdop/index.js +1 -0
  228. package/utils/getPrecisionFromHdop/types.d.ts +42 -0
  229. package/utils/getVptUpdatedAtWithGuard.d.ts +4 -0
  230. package/utils/getVptUpdatedAtWithGuard.js +13 -0
  231. package/utils/getVptValueWithGuard.d.ts +9 -0
  232. package/utils/getVptValueWithGuard.js +18 -0
  233. package/utils/index.d.ts +3 -0
  234. package/components/DeviceStatus/hooks/constants.d.ts +0 -11
  235. package/components/maps/components/GpsMap/external/Control/types.d.ts +0 -7
  236. package/components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/constants.js +0 -4
  237. package/components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/index.js +0 -112
  238. package/components/maps/components/GpsMap/hooks/useDisableZoomEvents/index.d.ts +0 -6
  239. package/components/maps/components/GpsMap/slots/GpsMapSlots.d.ts +0 -4
  240. package/components/maps/components/GpsMap/slots/GpsMapSlots.js +0 -24
  241. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/index.js +0 -13
  242. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/index.d.ts +0 -10
  243. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/index.js +0 -58
  244. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useCheckedLayers.d.ts +0 -9
  245. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useCheckedLayers.js +0 -17
  246. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useColumns.d.ts +0 -18
  247. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useColumns.js +0 -139
  248. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useMaster.d.ts +0 -12
  249. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useMaster.js +0 -52
  250. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.d.ts +0 -8
  251. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.js +0 -43
  252. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/index.d.ts +0 -4
  253. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/index.js +0 -30
  254. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/model.d.ts +0 -26
  255. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.js +0 -133
  256. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/bing.d.ts +0 -2
  257. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/bing.js +0 -39
  258. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/google.d.ts +0 -4
  259. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/google.js +0 -73
  260. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/osm.d.ts +0 -2
  261. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/osm.js +0 -25
  262. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/utils.d.ts +0 -4
  263. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/types.d.ts +0 -4
  264. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/index.js +0 -40
  265. /package/components/{maps/components/GpsMap/contexts/MapContext/helper.js → Device/index.js} +0 -0
  266. /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/{TopRigthTools → BottomRigthTools}/subcomponents/ZoomButtons/index.d.ts +0 -0
  267. /package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/{index.d.ts → MeasureTool.d.ts} +0 -0
@@ -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 { VPTCurrentMultiple, VPTCurrentADCPower, VPTCurrentDIX, VPTCurrentModem, VPTSettingsDIX, VPTCurrentOWTempX } from './vpts';
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
- gnssSatelliteQuantity: PropertyValue<number>;
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
- lastEvent?: {
37
+ modemLastEvent?: {
37
38
  date: string;
38
39
  };
39
40
  };
40
41
  };
41
42
  vpts?: {
42
43
  vptGnss?: DeviceCurrentVPTGnss;
43
- vptDiX?: VPTCurrentMultiple<VPTCurrentDIX>;
44
- vptOWTempX?: VPTCurrentMultiple<VPTCurrentOWTempX>;
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: string;
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
- imageUrl: string;
73
+ iconId: string;
73
74
  operationalRoles?: OperationalRoles;
74
75
  group?: Maybe<SettingsGroup>;
76
+ iconBgColor?: HexColor;
75
77
  properties?: Properties;
76
78
  vpts?: {
77
- vptDix?: VPTSettingsDIX;
79
+ vptModem?: VPTSettingsModem;
80
+ vptDix?: VPTMultiple<VPTSettingsDIX>;
78
81
  };
79
82
  };
80
83
  export type DeviceDataType = {
@@ -1,7 +1,7 @@
1
1
  import { GNSSEnumMotionStatus } from './constants';
2
2
  export type PropertyValueWithTrack<T> = {
3
3
  value: T;
4
- udaptedAt?: string;
4
+ updatedAt?: string;
5
5
  };
6
6
  export type PropertyValue<T> = T;
7
7
  export type GNSSSatus = keyof typeof GNSSEnumMotionStatus;
package/@types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export type { DeviceDataType, SettingsGroup } from './deviceData';
2
- export { GNSSEnumMotionStatus as GNSSEnumStatus } from './constants';
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 VPTCurrentMultiple<T> = {
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
- lastConnection: string;
46
- lastEvent: string;
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,2 @@
1
+ import { DeviceStyles } from './types';
2
+ export declare const deviceStatusStyles: DeviceStyles;
@@ -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,4 @@
1
+ const COMPONET_DEVICE_KEY_COMPONENT = "M4LDevice";
2
+ export {
3
+ COMPONET_DEVICE_KEY_COMPONENT as C
4
+ };
@@ -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
+ };
@@ -1,5 +1,5 @@
1
1
  import { DeviceDataType } from '../../../@types';
2
- import { StatusDeviceData } from './constants';
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 "./constants.js";
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?.value || GNSSEnumMotionStatus.off;
6
- const course = getPropertyByString(deviceData, "current.vpts.vptGnss.course", 0);
7
- const speed = Number(getPropertyByString(deviceData, "current.vpts.vptGnss.speed", 0).toFixed(0));
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 { M as MDS_ICONS } from "../icons.js";
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: MDS_ICONS.MOVING,
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: MDS_ICONS.OFF,
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: MDS_ICONS.STOPPED,
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: MDS_ICONS.STOPPED_RALENTI,
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: MDS_ICONS.STOPPED_E_RALENTI,
43
+ iconKey: DEVICE_ICONS.STOPPED_E_RALENTI,
46
44
  color: "error.enabled",
47
45
  //Ready
48
- palletColor: "error",
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: MDS_ICONS.TOWING,
52
+ iconKey: DEVICE_ICONS.TOWING,
55
53
  color: "success.active",
56
54
  //Ready
57
- palletColor: "success"
55
+ palletColor: "forest"
58
56
  },
59
57
  [GNSSEnumMotionStatus.powerSaving]: {
60
58
  id: GNSSEnumMotionStatus.powerSaving,
61
59
  statusLabelId: MDS_DICTIONARY.LABEL_POWER_SAVING,
62
- iconKey: MDS_ICONS.POWER_SAVING,
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: MDS_ICONS.MAX_SPEED,
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
- filteredCourse: number | undefined;
10
- palletColor: string;
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 "./helper.js";
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: stutusLabelId, color, course, palletColor, speed } = getDeviceStatusByData(deviceData);
8
+ const { iconKey, statusLabelId, color, course, palletColor, speed } = getDeviceStatusByData(deviceData);
9
9
  let label;
10
10
  if (withLabel) {
11
- label = getLabel(stutusLabelId);
11
+ label = getLabel(statusLabelId);
12
12
  }
13
13
  return {
14
14
  iconKey,
15
15
  label,
16
16
  color,
17
- filteredCourse: course,
17
+ course,
18
18
  palletColor,
19
19
  speed
20
20
  };
@@ -0,0 +1,11 @@
1
+ export declare const DEVICE_ICONS: {
2
+ NO_GPS_SIGNAL: string;
3
+ OFF: string;
4
+ MOVING: string;
5
+ STOPPED: string;
6
+ STOPPED_RALENTI: string;
7
+ STOPPED_E_RALENTI: string;
8
+ TOWING: string;
9
+ POWER_SAVING: string;
10
+ MAX_SPEED: string;
11
+ };
@@ -1,4 +1,4 @@
1
- const MDS_ICONS = {
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
- MDS_ICONS as M
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';