@m4l/gclick 0.0.2
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/.storybook/constants.d.ts +30 -0
- package/.storybook/decorators/StorybookWithMapProvider/constants.d.ts +2 -0
- package/.storybook/decorators/StorybookWithMapProvider/index.d.ts +1 -0
- package/.storybook/decorators/WithContexts/constants.d.ts +10 -0
- package/.storybook/decorators/WithContexts/index.d.ts +1 -0
- package/.storybook/decorators/WithContexts/types.d.ts +7 -0
- package/.storybook/decorators/WithWindowsContainer/index.d.ts +2 -0
- package/.storybook/decorators/WithWindowsContainer/subcomponents/WindowsContainer/index.d.ts +1 -0
- package/.storybook/decorators/WithWindowsContainer/subcomponents/WindowsContainer/types.d.ts +4 -0
- package/.storybook/main.d.ts +3 -0
- package/.storybook/mocks/config-msw.d.ts +21 -0
- package/.storybook/mocks/index.d.ts +2 -0
- package/.storybook/mocks/network-mocks.d.ts +1 -0
- package/.storybook/storybook.vite.d.ts +2 -0
- package/@types/augmentations.d.ts +38 -0
- package/@types/constants.d.ts +26 -0
- package/@types/constants.js +21 -0
- package/@types/deviceData.d.ts +90 -0
- package/@types/general.d.ts +21 -0
- package/@types/index.d.ts +2 -0
- package/@types/index.js +1 -0
- package/@types/types.d.js +1 -0
- package/@types/types.d.ts +43 -0
- package/@types/vpts.d.ts +49 -0
- package/components/DataGrid/assets/icons/datagrid.svg +4 -0
- package/components/DeviceLabel/DeviceLabel.d.ts +6 -0
- package/components/DeviceLabel/DeviceLabel.js +32 -0
- package/components/DeviceLabel/DeviceLabel.styles.d.ts +2 -0
- package/components/DeviceLabel/DeviceLabel.styles.js +33 -0
- package/components/DeviceLabel/constants.d.ts +2 -0
- package/components/DeviceLabel/constants.js +4 -0
- package/components/DeviceLabel/index.d.ts +1 -0
- package/components/DeviceLabel/index.js +1 -0
- package/components/DeviceLabel/slots/DeviceLabelSlots.d.ts +3 -0
- package/components/DeviceLabel/slots/DeviceLabelSlots.js +22 -0
- package/components/DeviceLabel/slots/slots.d.ts +5 -0
- package/components/DeviceLabel/slots/slots.js +9 -0
- package/components/DeviceLabel/types.d.ts +26 -0
- package/components/DeviceStatus/DeviceStatus.d.ts +6 -0
- package/components/DeviceStatus/DeviceStatus.js +15 -0
- package/components/DeviceStatus/DeviceStatus.styles.d.ts +2 -0
- package/components/DeviceStatus/DeviceStatus.styles.js +13 -0
- package/components/DeviceStatus/constants.d.ts +2 -0
- package/components/DeviceStatus/constants.js +4 -0
- package/components/DeviceStatus/dictionary.d.ts +13 -0
- package/components/DeviceStatus/dictionary.js +18 -0
- package/components/DeviceStatus/hooks/constants.d.ts +11 -0
- package/components/DeviceStatus/hooks/constants.js +79 -0
- package/components/DeviceStatus/hooks/helper.d.ts +7 -0
- package/components/DeviceStatus/hooks/helper.js +22 -0
- package/components/DeviceStatus/hooks/useDeviceStatus.d.ts +12 -0
- package/components/DeviceStatus/hooks/useDeviceStatus.js +25 -0
- package/components/DeviceStatus/icons.d.ts +11 -0
- package/components/DeviceStatus/icons.js +13 -0
- package/components/DeviceStatus/index.d.ts +4 -0
- package/components/DeviceStatus/index.js +1 -0
- package/components/DeviceStatus/slots/DeviceStatusSlots.d.ts +1 -0
- package/components/DeviceStatus/slots/DeviceStatusSlots.js +11 -0
- package/components/DeviceStatus/slots/slots.d.ts +3 -0
- package/components/DeviceStatus/slots/slots.js +7 -0
- package/components/DeviceStatus/types.d.ts +16 -0
- package/components/gauges/Gauge/Gauge.d.ts +22 -0
- package/components/gauges/Gauge/Gauge.js +25 -0
- package/components/gauges/Gauge/Gauge.styles.d.ts +2 -0
- package/components/gauges/Gauge/Gauge.styles.js +9 -0
- package/components/gauges/Gauge/constants.d.ts +2 -0
- package/components/gauges/Gauge/constants.js +8 -0
- package/components/gauges/Gauge/index.d.ts +1 -0
- package/components/gauges/Gauge/index.js +1 -0
- package/components/gauges/Gauge/slots/GaugeEnum.d.ts +3 -0
- package/components/gauges/Gauge/slots/GaugeEnum.js +7 -0
- package/components/gauges/Gauge/slots/GaugeSlots.d.ts +3 -0
- package/components/gauges/Gauge/slots/GaugeSlots.js +12 -0
- package/components/gauges/Gauge/types.d.ts +16 -0
- package/components/gauges/index.d.ts +1 -0
- package/components/gauges/index.js +1 -0
- package/components/index.d.ts +4 -0
- package/components/index.js +1 -0
- package/components/indicators/IndicatorCSQ/IndicatorCSQ.d.ts +7 -0
- package/components/indicators/IndicatorCSQ/IndicatorCSQ.styles.d.ts +2 -0
- package/components/indicators/IndicatorCSQ/constants.d.ts +8 -0
- package/components/indicators/IndicatorCSQ/dictionary.d.ts +9 -0
- package/components/indicators/IndicatorCSQ/helpers/getQualityLabel/getQualityLabel.d.ts +40 -0
- package/components/indicators/IndicatorCSQ/helpers/getQualityLabel/index.d.ts +0 -0
- package/components/indicators/IndicatorCSQ/helpers/getQualityLabel/types.d.ts +11 -0
- package/components/indicators/IndicatorCSQ/icons.d.ts +1 -0
- package/components/indicators/IndicatorCSQ/index.d.ts +3 -0
- package/components/indicators/IndicatorCSQ/slots/IndicatorCSQEnum.d.ts +7 -0
- package/components/indicators/IndicatorCSQ/slots/IndicatorCSQSlots.d.ts +15 -0
- package/components/indicators/IndicatorCSQ/subcomponents/SignalIcon/SignalIcon.d.ts +7 -0
- package/components/indicators/IndicatorCSQ/subcomponents/SignalIcon/index.d.ts +1 -0
- package/components/indicators/IndicatorCSQ/subcomponents/SignalIcon/types.d.ts +5 -0
- package/components/indicators/IndicatorCSQ/tests/IndicatorCSQ.test.d.ts +1 -0
- package/components/indicators/IndicatorCSQ/types.d.ts +21 -0
- package/components/maps/components/GpsMap/GpsMap.d.ts +8 -0
- package/components/maps/components/GpsMap/GpsMap.js +34 -0
- package/components/maps/components/GpsMap/GpsMap.styles.d.ts +2 -0
- package/components/maps/components/GpsMap/GpsMap.styles.js +228 -0
- package/components/maps/components/GpsMap/classes/index.d.ts +8 -0
- package/components/maps/components/GpsMap/classes/index.js +110 -0
- package/components/maps/components/GpsMap/classes/types.d.ts +69 -0
- package/components/maps/components/GpsMap/constants.d.ts +36 -0
- package/components/maps/components/GpsMap/constants.js +49 -0
- package/components/maps/components/GpsMap/contexts/MapContext/MapContext.d.ts +13 -0
- package/components/maps/components/GpsMap/contexts/MapContext/MapContext.js +59 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helper.d.ts +8 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helper.js +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts +2 -0
- package/components/maps/components/GpsMap/contexts/MapContext/index.js +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/store.d.ts +6 -0
- package/components/maps/components/GpsMap/contexts/MapContext/store.js +375 -0
- package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts +569 -0
- package/components/maps/components/GpsMap/dictionary.d.ts +32 -0
- package/components/maps/components/GpsMap/dictionary.js +32 -0
- package/components/maps/components/GpsMap/external/Control/index.d.ts +9 -0
- package/components/maps/components/GpsMap/external/Control/index.js +42 -0
- package/components/maps/components/GpsMap/external/Control/types.d.ts +7 -0
- package/components/maps/components/GpsMap/external/Popup/component.d.ts +4 -0
- package/components/maps/components/GpsMap/external/Popup/div-overlay.d.ts +4 -0
- package/components/maps/components/GpsMap/external/Popup/element.d.ts +4 -0
- package/components/maps/components/GpsMap/external/Popup/generic.d.ts +4 -0
- package/components/maps/components/GpsMap/external/Popup/index.d.ts +4 -0
- package/components/maps/components/GpsMap/external/googleMutant/LRUMap.d.ts +99 -0
- package/components/maps/components/GpsMap/external/googleMutant/LRUMap.js +1 -0
- package/components/maps/components/GpsMap/external/googleMutant/googleMutant.d.ts +1 -0
- package/components/maps/components/GpsMap/external/googleMutant/googleMutant.js +1 -0
- package/components/maps/components/GpsMap/external/googleMutant/googleMutantNoDelete.d.ts +1 -0
- package/components/maps/components/GpsMap/external/googleMutant/index.d.ts +132 -0
- package/components/maps/components/GpsMap/external/googleMutant/index.js +1 -0
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/constants.d.ts +1 -0
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/constants.js +4 -0
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.d.ts +8 -0
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.js +263 -0
- package/components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/constants.d.ts +1 -0
- package/components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/constants.js +4 -0
- package/components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/index.d.ts +8 -0
- package/components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/index.js +112 -0
- package/components/maps/components/GpsMap/featureRenders/FeatureDivIconLabel/index.d.ts +6 -0
- package/components/maps/components/GpsMap/featureRenders/FeatureDivIconLabel/index.js +33 -0
- package/components/maps/components/GpsMap/featureRenders/FeatureDivIconLabel/types.d.ts +7 -0
- package/components/maps/components/GpsMap/featureRenders/MarkerFeatureRender/IconMarker.d.ts +9 -0
- package/components/maps/components/GpsMap/featureRenders/MarkerFeatureRender/IconMarkerGrua.d.ts +4 -0
- package/components/maps/components/GpsMap/featureRenders/MarkerFeatureRender/IconMarkerTaxi.d.ts +4 -0
- package/components/maps/components/GpsMap/featureRenders/MarkerFeatureRender/index.d.ts +5 -0
- package/components/maps/components/GpsMap/featureRenders/MarkerFeatureRender/index.js +80 -0
- package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/index.d.ts +5 -0
- package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/index.js +83 -0
- package/components/maps/components/GpsMap/featureRenders/MarkerIconLabel/types.d.ts +15 -0
- package/components/maps/components/GpsMap/featureRenders/index.d.ts +3 -0
- package/components/maps/components/GpsMap/featureRenders/index.js +1 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.d.ts +7 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.js +78 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/types.d.ts +15 -0
- package/components/maps/components/GpsMap/hooks/useDisableClickEvents/index.d.ts +6 -0
- package/components/maps/components/GpsMap/hooks/useDisableZoomEvents/index.d.ts +6 -0
- package/components/maps/components/GpsMap/hooks/useDisableZoomEvents/index.js +21 -0
- package/components/maps/components/GpsMap/hooks/useMapStore/index.d.ts +6 -0
- package/components/maps/components/GpsMap/hooks/useMapStore/index.js +13 -0
- package/components/maps/components/GpsMap/icons.d.ts +45 -0
- package/components/maps/components/GpsMap/icons.js +39 -0
- package/components/maps/components/GpsMap/index.d.ts +9 -0
- package/components/maps/components/GpsMap/index.js +1 -0
- package/components/maps/components/GpsMap/pluginLayers/PolylineWithArrows/index.d.ts +11 -0
- package/components/maps/components/GpsMap/pluginLayers/PolylineWithArrows/index.js +74 -0
- package/components/maps/components/GpsMap/pluginLayers/index.d.ts +1 -0
- package/components/maps/components/GpsMap/pluginLayers/index.js +1 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/MapPopupDevice.d.ts +7 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/MapPopupDevice.js +30 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/MapPopupDevice.styles.d.ts +2 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/MapPopupDevice.styles.js +146 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/constants.d.ts +5 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/constants.js +8 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/dictionary.d.ts +16 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/dictionary.js +20 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/index.d.ts +2 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/index.js +1 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/slots/MapPopupDeviceSlots.d.ts +33 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/slots/MapPopupDeviceSlots.js +63 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/slots/slots.d.ts +13 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/slots/slots.js +17 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/subcomponents/Content/GpsDeviceContent.d.ts +6 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/subcomponents/Content/GpsDeviceContent.js +122 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/subcomponents/Header/GpsDeviceHeader.d.ts +5 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/subcomponents/Header/GpsDeviceHeader.js +22 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/subcomponents/PropertyValue/index.d.ts +5 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/subcomponents/PropertyValue/types.d.ts +6 -0
- package/components/maps/components/GpsMap/popups/MapPopupDevice/types.d.ts +10 -0
- package/components/maps/components/GpsMap/popups/index.d.ts +1 -0
- package/components/maps/components/GpsMap/popups/index.js +1 -0
- package/components/maps/components/GpsMap/popups/types.d.ts +10 -0
- package/components/maps/components/GpsMap/slots/GpsMapSlots.d.ts +4 -0
- package/components/maps/components/GpsMap/slots/GpsMapSlots.js +24 -0
- package/components/maps/components/GpsMap/slots/slots.d.ts +6 -0
- package/components/maps/components/GpsMap/slots/slots.js +10 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/index.d.ts +17 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/index.js +32 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/index.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/index.js +13 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/index.d.ts +10 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/index.js +58 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useCheckedLayers.d.ts +9 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useCheckedLayers.js +17 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useColumns.d.ts +18 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useColumns.js +139 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useMaster.d.ts +12 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useMaster.js +52 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.d.ts +8 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.js +43 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/index.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/index.js +30 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/model.d.ts +26 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.js +133 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/bing.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/bing.js +39 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/google.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/google.js +73 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/osm.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/osm.js +25 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/utils.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/utils.js +19 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/types.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopLeftTools/types.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/index.d.ts +11 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/index.js +103 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/constants.d.ts +30 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/constants.js +34 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/helpers.d.ts +11 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/helpers.js +45 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts +13 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/index.js +245 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts +13 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useValidation.d.ts +13 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useValidation.js +17 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/index.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/index.js +40 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/model.d.ts +17 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/index.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/index.js +32 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/types.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/validations.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/validations.js +6 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MyActions/index.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MyActions/index.js +31 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/types.d.ts +9 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ZoomButtons/index.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/ZoomButtons/index.js +52 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/TopRigthTools/types.d.ts +7 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/types.d.ts +22 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/index.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/index.js +33 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/index.d.ts +14 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/index.js +132 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/subcomponents/MarkerClusterGroup/index.d.ts +9 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/subcomponents/MarkerClusterGroup/index.js +24 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/subcomponents/MarkerClusterGroup/types.d.ts +11 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/subcomponents/RenderByEachFeatureComponent/index.d.ts +11 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/subcomponents/RenderByEachFeatureComponent/index.js +13 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/subcomponents/RenderByEachFeatureComponent/types.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/MyLayer/types.d.ts +2 -0
- package/components/maps/components/GpsMap/subcomponents/TileLayers/index.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/TileLayers/index.js +27 -0
- package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerGoogle/index.d.ts +4 -0
- package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerGoogle/index.js +100 -0
- package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerOthers/index.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/TileLayers/subcomponents/TileLayerOthers/index.js +35 -0
- package/components/maps/components/GpsMap/types.d.ts +56 -0
- package/components/maps/components/GpsMapTools/GpsMapTools.d.ts +4 -0
- package/components/maps/components/GpsMapTools/GpsMapTools.js +10 -0
- package/components/maps/components/GpsMapTools/classes/index.d.ts +7 -0
- package/components/maps/components/GpsMapTools/classes/index.js +21 -0
- package/components/maps/components/GpsMapTools/classes/types.d.ts +14 -0
- package/components/maps/components/GpsMapTools/constants.d.ts +8 -0
- package/components/maps/components/GpsMapTools/constants.js +71 -0
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/index.d.ts +21 -0
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/index.js +48 -0
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/store.d.ts +19 -0
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/store.js +155 -0
- package/components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/types.d.ts +160 -0
- package/components/maps/components/GpsMapTools/dictionary.d.ts +62 -0
- package/components/maps/components/GpsMapTools/dictionary.js +66 -0
- package/components/maps/components/GpsMapTools/hooks/useGpsMapToolsStore/index.d.ts +5 -0
- package/components/maps/components/GpsMapTools/hooks/useGpsMapToolsStore/index.js +13 -0
- package/components/maps/components/GpsMapTools/hooks/useLayers/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/hooks/useLayers/index.js +57 -0
- package/components/maps/components/GpsMapTools/icons.d.ts +23 -0
- package/components/maps/components/GpsMapTools/icons.js +22 -0
- package/components/maps/components/GpsMapTools/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/index.js +1 -0
- package/components/maps/components/GpsMapTools/styles.d.ts +1 -0
- package/components/maps/components/GpsMapTools/styles.js +18 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/index.d.ts +9 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/index.js +84 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/constants.d.ts +20 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/constants.js +40 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/helpers.d.ts +34 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/helpers.js +77 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useDrawing.d.ts +14 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useDrawing.js +216 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useSubmit.d.ts +11 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useSubmit.js +63 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useSumbitErrorsFocus.d.ts +5 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useSumbitErrorsFocus.js +36 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useValidation.d.ts +25 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/hooks/useValidation.js +19 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/index.d.ts +5 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/index.js +71 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/styles.d.ts +1 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/styles.js +8 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/index.js +51 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/types.d.ts +6 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/validations.d.ts +8 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/ConfigData/validations.js +11 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/index.js +128 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/types.d.ts +7 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/validations.d.ts +9 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/validations.js +12 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/index.d.ts +5 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/index.js +55 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/types.d.ts +2 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/index.js +76 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/types.d.ts +7 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/index.js +12 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/FillData/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/FillData/index.js +46 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/StrokeData/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/subcomponents/StrokeData/index.js +86 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/types.d.ts +10 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/types.d.ts +27 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useCheckedFeatures.d.ts +9 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useCheckedFeatures.js +86 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useCheckedGeofences.d.ts +7 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useCheckedGeofences.js +85 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useColumns.d.ts +12 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useColumns.js +114 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useMaster.d.ts +22 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useMaster.js +164 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useRowActionsGetter.d.ts +12 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useRowActionsGetter.js +113 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/index.d.ts +4 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/index.js +73 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.d.ts +1 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.js +8 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/subcomponents/Filter/index.d.ts +9 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/subcomponents/Filter/index.js +49 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/constants.d.ts +7 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/constants.js +13 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/subcomponents/model.d.ts +114 -0
- package/components/maps/components/GpsMapTools/subcomponents/TabsGpsTools/types.d.ts +7 -0
- package/components/maps/components/GpsMapTools/types.d.ts +34 -0
- package/components/maps/index.d.ts +4 -0
- package/components/maps/index.js +1 -0
- package/components/maps/utils/courseToCartesianAngle.d.ts +6 -0
- package/components/maps/utils/courseToCartesianAngle.js +8 -0
- package/components/maps/utils/courseToCssAngle.d.ts +9 -0
- package/components/maps/utils/courseToCssAngle.js +13 -0
- package/components/maps/utils/index.d.ts +6 -0
- package/components/maps/utils/index.js +1 -0
- package/components/maps/utils/isFeature.d.ts +2 -0
- package/components/maps/utils/isFeature.js +6 -0
- package/components/maps/utils/isFeatureCollection.d.ts +2 -0
- package/components/maps/utils/isFeatureCollection.js +6 -0
- package/components/maps/utils/isFeatureCollectionDraft.d.ts +6 -0
- package/components/maps/utils/isFeatureCollectionDraft.js +6 -0
- package/components/maps/utils/isGeometry.d.ts +2 -0
- package/components/maps/utils/isGeometry.js +6 -0
- package/contexts/RealTimeConsumerContext/RealTimeConsumerContext.d.ts +11 -0
- package/contexts/RealTimeConsumerContext/RealTimeConsumerContext.js +39 -0
- package/contexts/RealTimeConsumerContext/constants.d.ts +3 -0
- package/contexts/RealTimeConsumerContext/constants.js +8 -0
- package/contexts/RealTimeConsumerContext/index.d.ts +3 -0
- package/contexts/RealTimeConsumerContext/index.js +1 -0
- package/contexts/RealTimeConsumerContext/store.d.ts +6 -0
- package/contexts/RealTimeConsumerContext/store.js +115 -0
- package/contexts/RealTimeConsumerContext/types.d.ts +64 -0
- package/contexts/RealTimeProducerContext/RealTimeProducerContext.d.ts +11 -0
- package/contexts/RealTimeProducerContext/RealTimeProducerContext.js +20 -0
- package/contexts/RealTimeProducerContext/constants.d.ts +6 -0
- package/contexts/RealTimeProducerContext/constants.js +12 -0
- package/contexts/RealTimeProducerContext/index.d.ts +4 -0
- package/contexts/RealTimeProducerContext/index.js +1 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/athmospherejs/index.d.ts +33 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/athmospherejs/index.js +140 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/athmospherejs/types.d.ts +28 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/base.d.ts +15 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/base.js +14 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/constants.d.ts +23 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/constants.js +136 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/dummy.d.ts +23 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/dummy.js +66 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/group.d.ts +36 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/group.js +45 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/helpers.d.ts +10 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/helpers.js +15 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/factory.d.ts +12 -0
- package/contexts/RealTimeProducerContext/sourceDataMechanisms/factory.js +20 -0
- package/contexts/RealTimeProducerContext/store.d.ts +6 -0
- package/contexts/RealTimeProducerContext/store.js +136 -0
- package/contexts/RealTimeProducerContext/types.d.ts +196 -0
- package/contexts/index.d.ts +2 -0
- package/contexts/index.js +1 -0
- package/formatters/CourseFormatter/CourseFormatter.d.ts +14 -0
- package/formatters/CourseFormatter/CourseFormatter.js +33 -0
- package/formatters/CourseFormatter/CourseFormatter.styles.d.ts +2 -0
- package/formatters/CourseFormatter/CourseFormatter.styles.js +23 -0
- package/formatters/CourseFormatter/constants.d.ts +3 -0
- package/formatters/CourseFormatter/constants.js +6 -0
- package/formatters/CourseFormatter/dictionary.d.ts +12 -0
- package/formatters/CourseFormatter/dictionary.js +18 -0
- package/formatters/CourseFormatter/helper.d.ts +4 -0
- package/formatters/CourseFormatter/helper.js +28 -0
- package/formatters/CourseFormatter/index.d.ts +2 -0
- package/formatters/CourseFormatter/index.js +1 -0
- package/formatters/CourseFormatter/slots/CourseFormatterEnum.d.ts +3 -0
- package/formatters/CourseFormatter/slots/CourseFormatterEnum.js +7 -0
- package/formatters/CourseFormatter/slots/CourseFormatterSlots.d.ts +3 -0
- package/formatters/CourseFormatter/slots/CourseFormatterSlots.js +12 -0
- package/formatters/CourseFormatter/test/CourserFormatter.test.d.ts +1 -0
- package/formatters/CourseFormatter/types.d.ts +24 -0
- package/formatters/index.d.ts +1 -0
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +1 -0
- package/hooks/useRealTimeConsumer/index.d.ts +6 -0
- package/hooks/useRealTimeConsumer/index.js +13 -0
- package/hooks/useRealTimeProducer/index.d.ts +6 -0
- package/hooks/useRealTimeProducer/index.js +13 -0
- package/index.d.ts +9 -0
- package/index.js +90 -0
- package/mockServiceWorker.js +307 -0
- package/not_recognized/index.js +406 -0
- package/package.json +93 -0
- package/test/HostThemeProviderMock.d.ts +10 -0
- package/test/TestAppWrapper.d.ts +29 -0
- package/test/TestFormAutoValidation.d.ts +4 -0
- package/test/constants.d.ts +69 -0
- package/test/constants_no_mock.d.ts +1 -0
- package/test/getNameDataTestId.d.ts +15 -0
- package/test/getNameDataTestId.js +16 -0
- package/test/index.d.ts +4 -0
- package/test/mocks.d.ts +27 -0
- package/test/setup.d.ts +0 -0
- package/test/types.d.ts +4 -0
- package/test/utils.d.ts +29 -0
- package/utils/ObjectQueue.d.ts +18 -0
- package/utils/ObjectQueue.js +33 -0
- package/utils/capitalizeFirstLetter.d.ts +4 -0
- package/utils/capitalizeFirstLetter.js +10 -0
- package/utils/containerQuery.d.ts +5 -0
- package/utils/formatDistanceToNow/formatDistanteToNow.d.ts +5 -0
- package/utils/formatDistanceToNow/index.d.ts +2 -0
- package/utils/formatDistanceToNow/types.d.ts +21 -0
- package/utils/getComponentSlotRoot.d.ts +9 -0
- package/utils/getComponentSlotRoot.js +13 -0
- package/utils/getComponentUtilityClass.d.ts +1 -0
- package/utils/getComponentUtilityClass.js +7 -0
- package/utils/getPaletteColor.d.ts +5 -0
- package/utils/getPaletteColor.js +18 -0
- package/utils/getSizeStyles/_test_/getSizeStyles.test.d.ts +1 -0
- package/utils/getSizeStyles/getSizeStyles.d.ts +28 -0
- package/utils/getSizeStyles/getSizeStyles.js +13 -0
- package/utils/getSizeStyles/index.d.ts +1 -0
- package/utils/getSizeStyles/index.js +1 -0
- package/utils/getThemeVariantColor.d.ts +6 -0
- package/utils/getTransformXY.d.ts +7 -0
- package/utils/getTypographyStyles.d.ts +11 -0
- package/utils/getTypographyStyles.js +8 -0
- package/utils/index.d.ts +8 -0
- package/utils/index.js +1 -0
- package/utils/isValidDate.d.ts +1 -0
- package/utils/isValidDate.js +6 -0
- package/utils/types.d.ts +23 -0
- package/vite-env.d.ts +4 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const CF_DICTIONARY_ID = "course_formatter";
|
|
2
|
+
function getCourseFormatterComponentsDictionary() {
|
|
3
|
+
return [CF_DICTIONARY_ID];
|
|
4
|
+
}
|
|
5
|
+
const CF_DICCTIONARY = {
|
|
6
|
+
LABEL_NORTH: `${CF_DICTIONARY_ID}.label_north`,
|
|
7
|
+
LABEL_SOUTH: `${CF_DICTIONARY_ID}.label_south`,
|
|
8
|
+
LABEL_EAST: `${CF_DICTIONARY_ID}.label_east`,
|
|
9
|
+
LABEL_WEST: `${CF_DICTIONARY_ID}.label_west`,
|
|
10
|
+
LABEL_NORTH_EAST: `${CF_DICTIONARY_ID}.label_north_east`,
|
|
11
|
+
LABEL_NORTH_WEST: `${CF_DICTIONARY_ID}.label_north_west`,
|
|
12
|
+
LABEL_SOUTH_EAST: `${CF_DICTIONARY_ID}.label_south_east`,
|
|
13
|
+
LABEL_SOUTH_WEST: `${CF_DICTIONARY_ID}.label_south_west`
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
CF_DICCTIONARY as C,
|
|
17
|
+
getCourseFormatterComponentsDictionary as g
|
|
18
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
+
import { C as CF_DICCTIONARY } from "./dictionary.js";
|
|
3
|
+
import { D as DEFAULT_GAP_ANGLE } from "./constants.js";
|
|
4
|
+
const getCardinalDirection = (angle, gap = DEFAULT_GAP_ANGLE) => {
|
|
5
|
+
const { getLabel } = useModuleDictionary();
|
|
6
|
+
let ret;
|
|
7
|
+
if (angle >= 0 + gap && angle < 90 - gap) {
|
|
8
|
+
ret = getLabel(CF_DICCTIONARY.LABEL_NORTH_EAST);
|
|
9
|
+
} else if (angle >= 90 - gap && angle < 90 + gap) {
|
|
10
|
+
ret = getLabel(CF_DICCTIONARY.LABEL_NORTH);
|
|
11
|
+
} else if (angle >= 90 + gap && angle < 180 - gap) {
|
|
12
|
+
ret = getLabel(CF_DICCTIONARY.LABEL_NORTH_WEST);
|
|
13
|
+
} else if (angle >= 180 - gap && angle < 180 + gap) {
|
|
14
|
+
ret = getLabel(CF_DICCTIONARY.LABEL_WEST);
|
|
15
|
+
} else if (angle >= 180 + gap && angle < 270 - gap) {
|
|
16
|
+
ret = getLabel(CF_DICCTIONARY.LABEL_SOUTH_WEST);
|
|
17
|
+
} else if (angle >= 270 - gap && angle < 270 + gap) {
|
|
18
|
+
ret = getLabel(CF_DICCTIONARY.LABEL_SOUTH);
|
|
19
|
+
} else if (angle >= 270 + gap && angle < 360 - gap) {
|
|
20
|
+
ret = getLabel(CF_DICCTIONARY.LABEL_SOUTH_EAST);
|
|
21
|
+
} else {
|
|
22
|
+
ret = getLabel(CF_DICCTIONARY.LABEL_EAST);
|
|
23
|
+
}
|
|
24
|
+
return ret;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
getCardinalDirection as g
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const CFRootStyled: import('@emotion/styled').StyledComponent<Pick<import('@m4l/components/src/components/mui_extended/Typography/types').TypographyProps, keyof import('@m4l/components/src/components/mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').CourseFormatterOwnerState> & Record<string, unknown> & {
|
|
2
|
+
ownerState: Partial<import('../types').CourseFormatterOwnerState> & Record<string, unknown>;
|
|
3
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { C as COMPONET_KEY_COMPONENT } from "../constants.js";
|
|
3
|
+
import { c as courseFormatterStyles } from "../CourseFormatter.styles.js";
|
|
4
|
+
import { C as CourseFormatterSlots } from "./CourseFormatterEnum.js";
|
|
5
|
+
import { Typography } from "@m4l/components";
|
|
6
|
+
const CFRootStyled = styled(Typography, {
|
|
7
|
+
name: COMPONET_KEY_COMPONENT,
|
|
8
|
+
slot: CourseFormatterSlots.root
|
|
9
|
+
})(courseFormatterStyles?.root);
|
|
10
|
+
export {
|
|
11
|
+
CFRootStyled as C
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Theme } from '@mui/material/styles';
|
|
2
|
+
import { COMPONET_KEY_COMPONENT } from './constants';
|
|
3
|
+
import { CourseFormatterSlots } from './slots/CourseFormatterEnum';
|
|
4
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
5
|
+
import { Sizes } from '@m4l/styles';
|
|
6
|
+
export type CourseFormatterProps = {
|
|
7
|
+
/** "course" curso sobre tierra donde el norte es 0 grados, y el sur es 180 grados en sentido horario */
|
|
8
|
+
course: number;
|
|
9
|
+
/** "gapAngle" es el angulo que permite definir un estado Norte,Este,Oeste,etc no necesariamente por que el valor es exacto, si no por que se encuentra en un rango de valores, dado por el gap. */
|
|
10
|
+
gapAngle?: number;
|
|
11
|
+
/** Define el tamaño de la etiqueta. Puede ser 'small' o 'medium'. Por defecto es 'medium'. */
|
|
12
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
13
|
+
/** Define el tamaño del skeleton. */
|
|
14
|
+
skeletonWidth?: string | number;
|
|
15
|
+
/** data-testid para pruebas unitarias. */
|
|
16
|
+
dataTestId?: string;
|
|
17
|
+
};
|
|
18
|
+
export type CourseFormatterSlotsType = keyof typeof CourseFormatterSlots;
|
|
19
|
+
export type CourseFormatterOwnerState = {
|
|
20
|
+
variant: 'standard';
|
|
21
|
+
color?: 'default';
|
|
22
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
23
|
+
};
|
|
24
|
+
export type CourseFormatterStyles = OverridesStyleRules<CourseFormatterSlotsType, typeof COMPONET_KEY_COMPONENT, Theme>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CourseFormatter';
|
package/hooks/index.d.ts
ADDED
package/hooks/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RealTimeConsumerStoreStateWithActions } from '../../contexts/RealTimeConsumerContext/types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook para suscribirse a cambios del consumer de tiempo real.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useRealTimeConsumer<T>(selector: (state: RealTimeConsumerStoreStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
6
|
+
export default useRealTimeConsumer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useStore } from "zustand";
|
|
3
|
+
import { R as RealTimeConsumerContext } from "../../contexts/RealTimeConsumerContext/RealTimeConsumerContext.js";
|
|
4
|
+
function useRealTimeConsumer(selector, equalityFn) {
|
|
5
|
+
const context = useContext(RealTimeConsumerContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error("useRealTimeConsumer context must be use inside RealTimeConsumerContext");
|
|
8
|
+
}
|
|
9
|
+
return useStore(context, selector, equalityFn);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
useRealTimeConsumer as u
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RealTimeProducerStoreStateWithActions } from '../../contexts/RealTimeProducerContext/types';
|
|
2
|
+
/**
|
|
3
|
+
* TODO: Documentar
|
|
4
|
+
*/
|
|
5
|
+
export declare function useRealTimeProducer<T>(selector: (state: RealTimeProducerStoreStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
6
|
+
export default useRealTimeProducer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useStore } from "zustand";
|
|
3
|
+
import { R as RealTimeProducerContext } from "../../contexts/RealTimeProducerContext/RealTimeProducerContext.js";
|
|
4
|
+
function useRealTimeProducer(selector, equalityFn) {
|
|
5
|
+
const context = useContext(RealTimeProducerContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error("useRealTime context must be use inside RealTimeContext");
|
|
8
|
+
}
|
|
9
|
+
return useStore(context, selector, equalityFn);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
useRealTimeProducer as u
|
|
13
|
+
};
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { D } from "./components/DeviceLabel/DeviceLabel.js";
|
|
2
|
+
import { g } from "./components/DeviceStatus/dictionary.js";
|
|
3
|
+
import { g as g2 } from "./components/DeviceStatus/hooks/helper.js";
|
|
4
|
+
import { D as D2 } from "./components/DeviceStatus/hooks/constants.js";
|
|
5
|
+
import { D as D3 } from "./components/DeviceStatus/DeviceStatus.js";
|
|
6
|
+
import { G } from "./components/maps/components/GpsMapTools/GpsMapTools.js";
|
|
7
|
+
import { u } from "./components/maps/components/GpsMapTools/hooks/useGpsMapToolsStore/index.js";
|
|
8
|
+
import { a } from "./components/maps/components/GpsMapTools/contexts/GpsMapToolsContext/index.js";
|
|
9
|
+
import { g as g3 } from "./components/maps/components/GpsMapTools/dictionary.js";
|
|
10
|
+
import { G as G2 } from "./components/maps/components/GpsMap/GpsMap.js";
|
|
11
|
+
import { M, a as a2 } from "./components/maps/components/GpsMap/contexts/MapContext/MapContext.js";
|
|
12
|
+
import { u as u2 } from "./components/maps/components/GpsMap/hooks/useMapStore/index.js";
|
|
13
|
+
import { g as g4 } from "./components/maps/components/GpsMap/dictionary.js";
|
|
14
|
+
import { M as M2 } from "./components/maps/components/GpsMap/featureRenders/MarkerFeatureRender/index.js";
|
|
15
|
+
import { C } from "./components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.js";
|
|
16
|
+
import { D as D4 } from "./components/maps/components/GpsMap/featureRenders/DeviceFeatureRender/index.js";
|
|
17
|
+
import { g as g5 } from "./components/maps/components/GpsMap/popups/MapPopupDevice/dictionary.js";
|
|
18
|
+
import { M as M3 } from "./components/maps/components/GpsMap/popups/MapPopupDevice/MapPopupDevice.js";
|
|
19
|
+
import { P } from "./components/maps/components/GpsMap/pluginLayers/PolylineWithArrows/index.js";
|
|
20
|
+
import { c } from "./components/maps/utils/courseToCartesianAngle.js";
|
|
21
|
+
import { c as c2 } from "./components/maps/utils/courseToCssAngle.js";
|
|
22
|
+
import { i } from "./components/maps/utils/isFeature.js";
|
|
23
|
+
import { i as i2 } from "./components/maps/utils/isFeatureCollection.js";
|
|
24
|
+
import { i as i3 } from "./components/maps/utils/isFeatureCollectionDraft.js";
|
|
25
|
+
import { i as i4 } from "./components/maps/utils/isGeometry.js";
|
|
26
|
+
import { G as G3 } from "./components/gauges/Gauge/Gauge.js";
|
|
27
|
+
import { E } from "./contexts/RealTimeProducerContext/constants.js";
|
|
28
|
+
import { R } from "./contexts/RealTimeProducerContext/sourceDataMechanisms/dummy/constants.js";
|
|
29
|
+
import { R as R2, a as a3 } from "./contexts/RealTimeProducerContext/RealTimeProducerContext.js";
|
|
30
|
+
import { R as R3 } from "./contexts/RealTimeConsumerContext/constants.js";
|
|
31
|
+
import { R as R4, a as a4 } from "./contexts/RealTimeConsumerContext/RealTimeConsumerContext.js";
|
|
32
|
+
import { u as u3 } from "./hooks/useRealTimeProducer/index.js";
|
|
33
|
+
import { u as u4 } from "./hooks/useRealTimeConsumer/index.js";
|
|
34
|
+
import { c as c3 } from "./utils/capitalizeFirstLetter.js";
|
|
35
|
+
import { i as i5 } from "./utils/isValidDate.js";
|
|
36
|
+
import { g as g6 } from "./utils/getComponentUtilityClass.js";
|
|
37
|
+
import { g as g7 } from "./utils/getPaletteColor.js";
|
|
38
|
+
import { g as g8 } from "./utils/getTypographyStyles.js";
|
|
39
|
+
import { g as g9 } from "./utils/getSizeStyles/getSizeStyles.js";
|
|
40
|
+
import { O } from "./utils/ObjectQueue.js";
|
|
41
|
+
import { a as a5, g as g10 } from "./utils/getComponentSlotRoot.js";
|
|
42
|
+
import { G as G4 } from "./@types/constants.js";
|
|
43
|
+
export {
|
|
44
|
+
C as CommonFeatureRender,
|
|
45
|
+
D2 as DEVICE_STATUSES_CONFIG,
|
|
46
|
+
D4 as DeviceFeatureRender,
|
|
47
|
+
D as DeviceLabel,
|
|
48
|
+
D3 as DeviceStatus,
|
|
49
|
+
E as EnumResourceTypesIds,
|
|
50
|
+
G4 as GNSSEnumStatus,
|
|
51
|
+
G3 as GaugeContainer,
|
|
52
|
+
G2 as GpsMap,
|
|
53
|
+
G as GpsMapTools,
|
|
54
|
+
a as GpsMapToolsProvider,
|
|
55
|
+
M as MapContext,
|
|
56
|
+
M3 as MapPopupDevice,
|
|
57
|
+
a2 as MapProvider,
|
|
58
|
+
M2 as MarkerFeatureRender,
|
|
59
|
+
O as ObjectQueue,
|
|
60
|
+
P as PolylineWithArrows,
|
|
61
|
+
R as REAL_TIME_RT_DEVICES_DUMMMY_INITIAL,
|
|
62
|
+
R3 as RESOURCE_TYPE_DEVICES,
|
|
63
|
+
R4 as RealTimeConsumerContext,
|
|
64
|
+
a4 as RealTimeConsumerProvider,
|
|
65
|
+
R2 as RealTimeProducerContext,
|
|
66
|
+
a3 as RealTimeProducerProvider,
|
|
67
|
+
c3 as capitalizeFirstLetter,
|
|
68
|
+
c as courseToCartesianAngle,
|
|
69
|
+
c2 as courseToCssAngle,
|
|
70
|
+
a5 as getComponentClasses,
|
|
71
|
+
g10 as getComponentSlotRoot,
|
|
72
|
+
g6 as getComponentUtilityClass,
|
|
73
|
+
g2 as getDeviceStatusByData,
|
|
74
|
+
g as getDeviceStatusComponentsDictionary,
|
|
75
|
+
g3 as getGpsMapToolsComponentsDictionary,
|
|
76
|
+
g9 as getHeightSizeStyles,
|
|
77
|
+
g4 as getMapComponentsDictionary,
|
|
78
|
+
g5 as getMapPopupDeviceComponentsDictionary,
|
|
79
|
+
g7 as getPaletteColor,
|
|
80
|
+
g8 as getTypographyStyles,
|
|
81
|
+
i as isFeature,
|
|
82
|
+
i2 as isFeatureCollection,
|
|
83
|
+
i3 as isFeatureCollectionDraft,
|
|
84
|
+
i4 as isGeometry,
|
|
85
|
+
i5 as isValidDate,
|
|
86
|
+
u as useGpsMapToolsStore,
|
|
87
|
+
u2 as useMapStore,
|
|
88
|
+
u4 as useRealTimeConsumer,
|
|
89
|
+
u3 as useRealTimeProducer
|
|
90
|
+
};
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Mock Service Worker.
|
|
6
|
+
* @see https://github.com/mswjs/msw
|
|
7
|
+
* - Please do NOT modify this file.
|
|
8
|
+
* - Please do NOT serve this file on production.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const PACKAGE_VERSION = '2.7.3'
|
|
12
|
+
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
|
|
13
|
+
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
14
|
+
const activeClientIds = new Set()
|
|
15
|
+
|
|
16
|
+
self.addEventListener('install', function () {
|
|
17
|
+
self.skipWaiting()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
self.addEventListener('activate', function (event) {
|
|
21
|
+
event.waitUntil(self.clients.claim())
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
self.addEventListener('message', async function (event) {
|
|
25
|
+
const clientId = event.source.id
|
|
26
|
+
|
|
27
|
+
if (!clientId || !self.clients) {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const client = await self.clients.get(clientId)
|
|
32
|
+
|
|
33
|
+
if (!client) {
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const allClients = await self.clients.matchAll({
|
|
38
|
+
type: 'window',
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
switch (event.data) {
|
|
42
|
+
case 'KEEPALIVE_REQUEST': {
|
|
43
|
+
sendToClient(client, {
|
|
44
|
+
type: 'KEEPALIVE_RESPONSE',
|
|
45
|
+
})
|
|
46
|
+
break
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
case 'INTEGRITY_CHECK_REQUEST': {
|
|
50
|
+
sendToClient(client, {
|
|
51
|
+
type: 'INTEGRITY_CHECK_RESPONSE',
|
|
52
|
+
payload: {
|
|
53
|
+
packageVersion: PACKAGE_VERSION,
|
|
54
|
+
checksum: INTEGRITY_CHECKSUM,
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
break
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
case 'MOCK_ACTIVATE': {
|
|
61
|
+
activeClientIds.add(clientId)
|
|
62
|
+
|
|
63
|
+
sendToClient(client, {
|
|
64
|
+
type: 'MOCKING_ENABLED',
|
|
65
|
+
payload: {
|
|
66
|
+
client: {
|
|
67
|
+
id: client.id,
|
|
68
|
+
frameType: client.frameType,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
break
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
case 'MOCK_DEACTIVATE': {
|
|
76
|
+
activeClientIds.delete(clientId)
|
|
77
|
+
break
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
case 'CLIENT_CLOSED': {
|
|
81
|
+
activeClientIds.delete(clientId)
|
|
82
|
+
|
|
83
|
+
const remainingClients = allClients.filter((client) => {
|
|
84
|
+
return client.id !== clientId
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
// Unregister itself when there are no more clients
|
|
88
|
+
if (remainingClients.length === 0) {
|
|
89
|
+
self.registration.unregister()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
break
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
self.addEventListener('fetch', function (event) {
|
|
98
|
+
const { request } = event
|
|
99
|
+
|
|
100
|
+
// Bypass navigation requests.
|
|
101
|
+
if (request.mode === 'navigate') {
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Opening the DevTools triggers the "only-if-cached" request
|
|
106
|
+
// that cannot be handled by the worker. Bypass such requests.
|
|
107
|
+
if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Bypass all requests when there are no active clients.
|
|
112
|
+
// Prevents the self-unregistered worked from handling requests
|
|
113
|
+
// after it's been deleted (still remains active until the next reload).
|
|
114
|
+
if (activeClientIds.size === 0) {
|
|
115
|
+
return
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Generate unique request ID.
|
|
119
|
+
const requestId = crypto.randomUUID()
|
|
120
|
+
event.respondWith(handleRequest(event, requestId))
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
async function handleRequest(event, requestId) {
|
|
124
|
+
const client = await resolveMainClient(event)
|
|
125
|
+
const response = await getResponse(event, client, requestId)
|
|
126
|
+
|
|
127
|
+
// Send back the response clone for the "response:*" life-cycle events.
|
|
128
|
+
// Ensure MSW is active and ready to handle the message, otherwise
|
|
129
|
+
// this message will pend indefinitely.
|
|
130
|
+
if (client && activeClientIds.has(client.id)) {
|
|
131
|
+
;(async function () {
|
|
132
|
+
const responseClone = response.clone()
|
|
133
|
+
|
|
134
|
+
sendToClient(
|
|
135
|
+
client,
|
|
136
|
+
{
|
|
137
|
+
type: 'RESPONSE',
|
|
138
|
+
payload: {
|
|
139
|
+
requestId,
|
|
140
|
+
isMockedResponse: IS_MOCKED_RESPONSE in response,
|
|
141
|
+
type: responseClone.type,
|
|
142
|
+
status: responseClone.status,
|
|
143
|
+
statusText: responseClone.statusText,
|
|
144
|
+
body: responseClone.body,
|
|
145
|
+
headers: Object.fromEntries(responseClone.headers.entries()),
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
[responseClone.body],
|
|
149
|
+
)
|
|
150
|
+
})()
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return response
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Resolve the main client for the given event.
|
|
157
|
+
// Client that issues a request doesn't necessarily equal the client
|
|
158
|
+
// that registered the worker. It's with the latter the worker should
|
|
159
|
+
// communicate with during the response resolving phase.
|
|
160
|
+
async function resolveMainClient(event) {
|
|
161
|
+
const client = await self.clients.get(event.clientId)
|
|
162
|
+
|
|
163
|
+
if (activeClientIds.has(event.clientId)) {
|
|
164
|
+
return client
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (client?.frameType === 'top-level') {
|
|
168
|
+
return client
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const allClients = await self.clients.matchAll({
|
|
172
|
+
type: 'window',
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
return allClients
|
|
176
|
+
.filter((client) => {
|
|
177
|
+
// Get only those clients that are currently visible.
|
|
178
|
+
return client.visibilityState === 'visible'
|
|
179
|
+
})
|
|
180
|
+
.find((client) => {
|
|
181
|
+
// Find the client ID that's recorded in the
|
|
182
|
+
// set of clients that have registered the worker.
|
|
183
|
+
return activeClientIds.has(client.id)
|
|
184
|
+
})
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
async function getResponse(event, client, requestId) {
|
|
188
|
+
const { request } = event
|
|
189
|
+
|
|
190
|
+
// Clone the request because it might've been already used
|
|
191
|
+
// (i.e. its body has been read and sent to the client).
|
|
192
|
+
const requestClone = request.clone()
|
|
193
|
+
|
|
194
|
+
function passthrough() {
|
|
195
|
+
// Cast the request headers to a new Headers instance
|
|
196
|
+
// so the headers can be manipulated with.
|
|
197
|
+
const headers = new Headers(requestClone.headers)
|
|
198
|
+
|
|
199
|
+
// Remove the "accept" header value that marked this request as passthrough.
|
|
200
|
+
// This prevents request alteration and also keeps it compliant with the
|
|
201
|
+
// user-defined CORS policies.
|
|
202
|
+
const acceptHeader = headers.get('accept')
|
|
203
|
+
if (acceptHeader) {
|
|
204
|
+
const values = acceptHeader.split(',').map((value) => value.trim())
|
|
205
|
+
const filteredValues = values.filter(
|
|
206
|
+
(value) => value !== 'msw/passthrough',
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
if (filteredValues.length > 0) {
|
|
210
|
+
headers.set('accept', filteredValues.join(', '))
|
|
211
|
+
} else {
|
|
212
|
+
headers.delete('accept')
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return fetch(requestClone, { headers })
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Bypass mocking when the client is not active.
|
|
220
|
+
if (!client) {
|
|
221
|
+
return passthrough()
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Bypass initial page load requests (i.e. static assets).
|
|
225
|
+
// The absence of the immediate/parent client in the map of the active clients
|
|
226
|
+
// means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
|
|
227
|
+
// and is not ready to handle requests.
|
|
228
|
+
if (!activeClientIds.has(client.id)) {
|
|
229
|
+
return passthrough()
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Notify the client that a request has been intercepted.
|
|
233
|
+
const requestBuffer = await request.arrayBuffer()
|
|
234
|
+
const clientMessage = await sendToClient(
|
|
235
|
+
client,
|
|
236
|
+
{
|
|
237
|
+
type: 'REQUEST',
|
|
238
|
+
payload: {
|
|
239
|
+
id: requestId,
|
|
240
|
+
url: request.url,
|
|
241
|
+
mode: request.mode,
|
|
242
|
+
method: request.method,
|
|
243
|
+
headers: Object.fromEntries(request.headers.entries()),
|
|
244
|
+
cache: request.cache,
|
|
245
|
+
credentials: request.credentials,
|
|
246
|
+
destination: request.destination,
|
|
247
|
+
integrity: request.integrity,
|
|
248
|
+
redirect: request.redirect,
|
|
249
|
+
referrer: request.referrer,
|
|
250
|
+
referrerPolicy: request.referrerPolicy,
|
|
251
|
+
body: requestBuffer,
|
|
252
|
+
keepalive: request.keepalive,
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
[requestBuffer],
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
switch (clientMessage.type) {
|
|
259
|
+
case 'MOCK_RESPONSE': {
|
|
260
|
+
return respondWithMock(clientMessage.data)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
case 'PASSTHROUGH': {
|
|
264
|
+
return passthrough()
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return passthrough()
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function sendToClient(client, message, transferrables = []) {
|
|
272
|
+
return new Promise((resolve, reject) => {
|
|
273
|
+
const channel = new MessageChannel()
|
|
274
|
+
|
|
275
|
+
channel.port1.onmessage = (event) => {
|
|
276
|
+
if (event.data && event.data.error) {
|
|
277
|
+
return reject(event.data.error)
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
resolve(event.data)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
client.postMessage(
|
|
284
|
+
message,
|
|
285
|
+
[channel.port2].concat(transferrables.filter(Boolean)),
|
|
286
|
+
)
|
|
287
|
+
})
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
async function respondWithMock(response) {
|
|
291
|
+
// Setting response status code to 0 is a no-op.
|
|
292
|
+
// However, when responding with a "Response.error()", the produced Response
|
|
293
|
+
// instance will have status code set to 0. Since it's not possible to create
|
|
294
|
+
// a Response instance with status code 0, handle that use-case separately.
|
|
295
|
+
if (response.status === 0) {
|
|
296
|
+
return Response.error()
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const mockedResponse = new Response(response.body, response)
|
|
300
|
+
|
|
301
|
+
Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, {
|
|
302
|
+
value: true,
|
|
303
|
+
enumerable: true,
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
return mockedResponse
|
|
307
|
+
}
|