@m4l/components 0.2.35 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/export.d.ts +274 -441
- package/@types/types.d.ts +25 -0
- package/components/AccountPopover/classes/types.d.ts +1 -1
- package/components/AccountPopover/index.efc74d5c.js +330 -0
- package/components/AccountPopover/style.d.ts +2 -0
- package/components/AccountPopover/subcomponents/MyAvatar/types.d.ts +6 -6
- package/components/AccountPopover/subcomponents/PopOver/types.d.ts +8 -8
- package/components/AccountPopover/types.d.ts +3 -3
- package/components/AppBar/classes/types.d.ts +1 -1
- package/components/AppBar/index.fc126a22.js +94 -0
- package/components/AppBar/styles.d.ts +2 -0
- package/components/AppBar/tests/utils.d.ts +1 -1
- package/components/AppBar/types.d.ts +9 -9
- package/components/CommonActions/classes/types.d.ts +1 -1
- package/components/CommonActions/components/Actions/index.d.ts +2 -1
- package/components/CommonActions/components/Actions/styles.d.ts +2 -0
- package/components/CommonActions/components/Actions/types.d.ts +2 -2
- package/components/CommonActions/tests/utils.d.ts +1 -1
- package/components/DataGrid/assets/icons/datagrid.svg +4 -4
- package/components/DataGrid/classes/types.d.ts +1 -1
- package/components/DataGrid/styles.d.ts +2 -0
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +8 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/styles.d.ts +2 -0
- package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +6 -0
- package/components/DragResizeWindow/DragResizeWindow.d.ts +3 -3
- package/components/DragResizeWindow/classes/types.d.ts +1 -1
- package/components/DragResizeWindow/index.46b380e1.js +477 -0
- package/components/DragResizeWindow/styled.d.ts +2 -0
- package/components/DragResizeWindow/types.d.ts +4 -5
- package/components/DragResizeWindow/utils.d.ts +1 -1
- package/components/DynamicFilter/DynamicFilter.d.ts +1 -7
- package/components/DynamicFilter/constants.d.ts +3 -11
- package/components/DynamicFilter/dictionary.d.ts +1 -2
- package/components/DynamicFilter/dynamicFilterSlots.d.ts +87 -0
- package/components/DynamicFilter/helpers/formatToInitialFilters.d.ts +7 -0
- package/components/DynamicFilter/helpers/formatToRowFilter.d.ts +7 -0
- package/components/DynamicFilter/helpers/getPurgedInitialFiltersApplied.d.ts +11 -0
- package/components/DynamicFilter/index.d.ts +1 -2
- package/components/DynamicFilter/index.d9168c12.js +2012 -0
- package/components/DynamicFilter/store/DynamicFilterContext.d.ts +16 -0
- package/components/DynamicFilter/{contexts/DynamicFilterContext/store.d.ts → store/DynamicFilterStore.d.ts} +28 -60
- package/components/DynamicFilter/store/useDynamicFilterStore.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts +3 -0
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/index.d.ts +1 -0
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/useAppliedFilterChip.d.ts +10 -0
- package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/AppliedFilters/index.d.ts +1 -0
- package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.d.ts +5 -0
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/index.d.ts +1 -0
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/useDynamicFilterBase.d.ts +4 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/helpers.d.ts +14 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index.d.ts +1 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/DataTypeComponent.d.ts +7 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.d.ts +14 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/FieldTypeInterface.d.ts +21 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.d.ts +14 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.d.ts +21 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/helpers.d.ts +14 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/fieldFactory.d.ts +7 -0
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActionsSkeleton.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/FilterActions/index.d.ts +1 -0
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts +18 -0
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilterSkeleton.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/InputFilter/index.d.ts +1 -7
- package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.d.ts +40 -0
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/PopoverFilter/index.d.ts +1 -14
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +24 -0
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts +7 -0
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index.d.ts +1 -11
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/usePopoverMenuFields.d.ts +9 -0
- package/components/DynamicFilter/types.d.ts +101 -30
- package/components/FieldLabel/classes/types.d.ts +1 -1
- package/components/FieldLabel/index.f9cdcc27.js +54 -0
- package/components/FieldLabel/styles.d.ts +2 -0
- package/components/GridLayout/{index.65470f01.js → index.bb3b7769.js} +526 -501
- package/components/GridLayout/styles.d.ts +2 -0
- package/components/GridLayout/subcomponents/Griditem/index.bb23f651.js +398 -0
- package/components/GridLayout/subcomponents/Responsive/{index.5b3e0521.js → index.b8a2a121.js} +51 -31
- package/components/GridLayout/subcomponents/SizeProvider/index.094bc6b5.js +65 -0
- package/components/HamburgerMenu/index.5997af31.js +82 -0
- package/components/HelperText/{index.7d2afdb3.js → index.be949cdf.js} +14 -22
- package/components/HelperText/styles.d.ts +2 -0
- package/components/Icon/index.d5fed418.js +420 -0
- package/components/Icon/styles.d.ts +4 -0
- package/components/Image/index.36a3d440.js +459 -0
- package/components/Image/styles.d.ts +2 -0
- package/components/Image/tests/utils.d.ts +1 -1
- package/components/Image/utils/getRatioValues.d.ts +1 -1
- package/components/LanguagePopover/index.e6fa2336.js +184 -0
- package/components/LanguagePopover/styles.d.ts +6 -0
- package/components/LanguagePopover/tests/utils.d.ts +1 -1
- package/components/LinearProgressIndeterminate/classes/types.d.ts +1 -1
- package/components/LinearProgressIndeterminate/index.de9d447c.js +53 -0
- package/components/LinearProgressIndeterminate/styles.d.ts +2 -0
- package/components/Loadable/{index.e994fc3e.js → index.e83cdb4e.js} +3 -8
- package/components/LoadingError/classes/types.d.ts +1 -1
- package/components/LoadingError/{index.ee29dd48.js → index.9f00c83c.js} +34 -55
- package/components/LoadingError/styles.d.ts +2 -0
- package/components/LoadingError/types.d.ts +1 -1
- package/components/MFLoader/classes/types.d.ts +1 -1
- package/components/MFLoader/{index.3a37407c.js → index.402c1acc.js} +55 -75
- package/components/MFLoader/styles.d.ts +2 -0
- package/components/MFLoader/types.d.ts +4 -4
- package/components/ModalDialog/index.ea9189c3.js +68 -0
- package/components/NavLink/index.4e548cee.js +55 -0
- package/components/NavLink/styles.d.ts +2 -0
- package/components/NavLink/tests/utils.d.ts +1 -1
- package/components/NavLink/types.d.ts +2 -2
- package/components/NoItemSelected/classes/types.d.ts +1 -1
- package/components/NoItemSelected/{index.3a479c64.js → index.418c8316.js} +22 -57
- package/components/NoItemSelected/styles.d.ts +5 -0
- package/components/ObjectLogs/index.bfa7dad3.js +236 -0
- package/components/ObjectLogs/styles.d.ts +4 -0
- package/components/PDFViewer/classes/types.d.ts +1 -1
- package/components/PDFViewer/{index.88c6ff6a.js → index.bb2eca5a.js} +8 -19
- package/components/PDFViewer/styles.d.ts +2 -0
- package/components/Page/index.fdf04592.js +364 -0
- package/components/PaperForm/classes/types.d.ts +1 -1
- package/components/PaperForm/index.8121e3da.js +96 -0
- package/components/PaperForm/styles.d.ts +7 -0
- package/components/PaperForm/types.d.ts +1 -2
- package/components/Period/classes/types.d.ts +1 -1
- package/components/Period/index.5233694b.js +424 -0
- package/components/Period/styles.d.ts +7 -0
- package/components/PrintingSystem/classes/types.d.ts +1 -1
- package/components/PrintingSystem/{index.27f1f209.js → index.fb176a93.js} +46 -58
- package/components/PrintingSystem/styles.d.ts +2 -0
- package/components/PrintingSystem/subcomponents/BodyNode/index.c1d61038.js +49 -0
- package/components/PrintingSystem/subcomponents/BodyNode/types.d.ts +1 -1
- package/components/PrintingSystem/subcomponents/ChartNode/{index.990e164c.js → index.18bd9bad.js} +28 -32
- package/components/PrintingSystem/subcomponents/ChartNode/types.d.ts +1 -2
- package/components/PrintingSystem/subcomponents/DividerNode/index.67d9f1b4.js +20 -0
- package/components/PrintingSystem/subcomponents/DividerNode/types.d.ts +2 -3
- package/components/PrintingSystem/subcomponents/FooterNode/index.eaee152a.js +49 -0
- package/components/PrintingSystem/subcomponents/FooterNode/types.d.ts +1 -1
- package/components/PrintingSystem/subcomponents/GridNode/index.f5f63a2a.js +70 -0
- package/components/PrintingSystem/subcomponents/GridNode/types.d.ts +2 -2
- package/components/PrintingSystem/subcomponents/HeaderNode/index.7de4e411.js +49 -0
- package/components/PrintingSystem/subcomponents/HeaderNode/types.d.ts +1 -1
- package/components/PrintingSystem/subcomponents/ImageNode/types.d.ts +2 -3
- package/components/PrintingSystem/subcomponents/Pager/types.d.ts +2 -2
- package/components/PrintingSystem/subcomponents/PaperNode/index.f9ccf22b.js +30 -0
- package/components/PrintingSystem/subcomponents/PaperNode/types.d.ts +2 -2
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index.f2f2e903.js +47 -0
- package/components/PrintingSystem/subcomponents/PropertyValueNode/types.d.ts +2 -2
- package/components/PrintingSystem/subcomponents/QRImageNode/types.d.ts +2 -3
- package/components/PrintingSystem/subcomponents/SectionNode/index.540a4b19.js +49 -0
- package/components/PrintingSystem/subcomponents/SectionNode/types.d.ts +1 -1
- package/components/PrintingSystem/subcomponents/TextBoxNode/index.41e7fcb0.js +24 -0
- package/components/PrintingSystem/subcomponents/TextBoxNode/types.d.ts +2 -3
- package/components/PrintingSystem/utils/FactoryRender/types.d.ts +1 -1
- package/components/PrintingSystem/utils/PageRender/types.d.ts +1 -1
- package/components/PropertyValue/classes/types.d.ts +1 -1
- package/components/PropertyValue/index.9572c347.js +261 -0
- package/components/PropertyValue/styles.d.ts +2 -0
- package/components/Resizeable/{index.cb5aad75.js → index.1f0c1359.js} +21 -28
- package/components/ResizeableWindow/styles.d.ts +5 -0
- package/components/ScrollBar/classes/types.d.ts +1 -1
- package/components/ScrollBar/{index.7dfc2f29.js → index.adf0eade.js} +32 -54
- package/components/ScrollBar/styles.d.ts +9 -0
- package/components/SideBar/classes/index.d.ts +1 -1
- package/components/SideBar/context/sideBarContext/index.d.ts +4 -4
- package/components/SideBar/index.629ba840.js +849 -0
- package/components/SideBar/styles.d.ts +20 -0
- package/components/SideBar/subcomponents/ContentDesktop/subcomponents/CollapseButton/styles.d.ts +3 -0
- package/components/SideBar/subcomponents/ContentGroups/styles.d.ts +4 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/styles.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/ArrowIcon/styles.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/styles.d.ts +9 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/type.d.ts +2 -2
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/styles.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +6 -0
- package/components/SideBar/subcomponents/ContentMobile/styles.d.ts +3 -0
- package/components/SideBar/subcomponents/ContentMobile/subcomponents/types.d.ts +4 -4
- package/components/SideBar/tests/constants.d.ts +1 -1
- package/components/SideBar/tests/utils.d.ts +1 -1
- package/components/SideBar/types.d.ts +2 -2
- package/components/SplitLayout/SplitLayout.d.ts +1 -1
- package/components/SplitLayout/classes/types.d.ts +1 -1
- package/components/SplitLayout/{index.7302ceb3.js → index.74091a81.js} +41 -32
- package/components/SplitLayout/styles.d.ts +4 -0
- package/components/SplitLayout/tests/utils.d.ts +1 -1
- package/components/ToastContainer/ToastContainer.d.ts +1 -1
- package/components/ToastContainer/classes/types.d.ts +1 -1
- package/components/ToastContainer/{index.4d44ce53.js → index.f9b507b9.js} +15 -31
- package/components/ToastContainer/styles.d.ts +2 -0
- package/components/ToastContainer/subcomponents/ToastMessage/index.d.ts +1 -1
- package/components/ToastContainer/subcomponents/ToastMessage/types.d.ts +1 -1
- package/components/ToastContainer/types.d.ts +1 -1
- package/components/WrapperComponent/index.57964195.js +14 -0
- package/components/animate/AnimatedScroll/styles.d.ts +6 -0
- package/components/animate/AnimatedScroll/types.d.ts +3 -3
- package/components/animate/LoadingScreen/{index.1d0c4307.js → index.779690a7.js} +26 -42
- package/components/animate/LoadingScreen/styles.d.ts +7 -0
- package/components/animate/MotionContainer/index.3032bd8f.js +34 -0
- package/components/animate/MotionContainer/index.d.ts +9 -9
- package/components/animate/MotionLazyContainer/index.d.ts +2 -2
- package/components/animate/MotionLazyContainer/{index.572dd012.js → index.d2902a6c.js} +3 -9
- package/components/animate/PropagateLoader/index.a9da8d00.js +23 -0
- package/components/animate/PropagateLoader/syles.d.ts +2 -0
- package/components/animate/{index.5d4575bc.js → index.b8497385.js} +38 -58
- package/components/areas/components/AreasAdmin/styles.d.ts +5 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +4 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/types.d.ts +1 -1
- package/components/areas/components/AreasAdmin/subcomponents/PanelWindowPopUp/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/styles.d.ts +2 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/subcomponents/ResizeHandle/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.d.ts +2 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/styles.d.ts +3 -0
- package/components/areas/constants.5387d83e.js +412 -0
- package/components/areas/contexts/AreasContext/{index.c5a3b322.js → index.bb316000.js} +32 -78
- package/components/areas/contexts/DynamicMFParmsContext/{index.1607c78e.js → index.37d1d444.js} +5 -11
- package/components/areas/contexts/DynamicMFParmsContext/types.d.ts +2 -2
- package/components/areas/contexts/WindowToolsMFContext/{index.8f3e2a04.js → index.69d95c15.js} +5 -13
- package/components/areas/contexts/WindowToolsMFContext/types.d.ts +29 -29
- package/components/areas/dictionary.7e74022a.js +286 -0
- package/components/areas/hooks/useAreas/{index.caa92660.js → index.e24bd74d.js} +1 -1
- package/components/areas/hooks/useDynamicMFParameters/{index.e52c5392.js → index.03ce6078.js} +2 -4
- package/components/areas/hooks/useWindowToolsMF/{index.b7afaf88.js → index.09801b66.js} +1 -1
- package/components/areas/icons.504ec098.js +83 -0
- package/components/areas/types.d.ts +17 -17
- package/components/commercial/AppBarCommercial/classes/types.d.ts +1 -1
- package/components/commercial/AppBarCommercial/styles.d.ts +2 -0
- package/components/commercial/AppBarCommercial/types.d.ts +1 -1
- package/components/commercial/HamburgerMenu/classes/type.d.ts +1 -1
- package/components/commercial/HamburgerMenu/styles.d.ts +13 -0
- package/components/commercial/HamburgerMenu/test/utils.d.ts +1 -1
- package/components/commercial/HamburgerMenu/types.d.ts +1 -1
- package/components/commercial/SectionCommercial/classes/types.d.ts +1 -1
- package/components/commercial/SectionCommercial/styles.d.ts +6 -0
- package/components/commercial/SectionCommercial/types.d.ts +3 -4
- package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/index.d.ts +1 -1
- package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/subcomponents/ArrowIcon/styles.d.ts +2 -0
- package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/types.d.ts +1 -1
- package/components/commercial/TopBar/context/index.d.ts +1 -1
- package/components/commercial/TopBar/context/type.d.ts +2 -2
- package/components/commercial/TopBar/style.d.ts +2 -0
- package/components/commercial/TopBar/type.d.ts +2 -2
- package/components/commercial/TopBar/utils/isActive/index.d.ts +1 -1
- package/components/formatters/FormatterRoot/styles.d.ts +2 -0
- package/components/formatters/FormatterRoot/types.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/classes/index.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/styles.d.ts +2 -0
- package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +2 -0
- package/components/hook-form/RHFAutocompleteAsync/styles.d.ts +5 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/utils.d.ts +1 -1
- package/components/hook-form/RHFCheckbox/styles.d.ts +7 -0
- package/components/hook-form/RHFCheckbox/test/utils.d.ts +1 -1
- package/components/hook-form/RHFColorPicker/classes/types.d.ts +1 -1
- package/components/hook-form/RHFColorPicker/styles.d.ts +2 -0
- package/components/hook-form/RHFColorPicker/subcomponents/Skeleton/types.d.ts +2 -3
- package/components/hook-form/RHFColorPicker/types.d.ts +7 -7
- package/components/hook-form/RHFDateTime/classes/types.d.ts +1 -1
- package/components/hook-form/RHFDateTime/styles.d.ts +2 -0
- package/components/hook-form/RHFDateTime/types.d.ts +1 -1
- package/components/hook-form/RHFPeriod/classes/types.d.ts +1 -1
- package/components/hook-form/RHFPeriod/styles.d.ts +2 -0
- package/components/hook-form/RHFRadioGroup/types.d.ts +1 -1
- package/components/hook-form/RHFTextField/styles.d.ts +3 -0
- package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +3 -0
- package/components/hook-form/RHFTextField/tests/utils.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/styles.d.ts +2 -0
- package/components/hook-form/RHFTextFieldPassword/tests/utils.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/types.d.ts +1 -2
- package/components/hook-form/RHFUpload/RHFUploadImage/classes/types.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/styles.d.ts +2 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +2 -0
- package/components/maps/components/GpsTools/constants.d.ts +1 -1
- package/components/maps/components/GpsTools/contexts/GpsToolsContext/types.d.ts +3 -3
- package/components/maps/components/GpsTools/{index.d93188ad.js → index.75880ce0.js} +740 -881
- package/components/maps/components/GpsTools/styles.d.ts +2 -0
- package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/styles.d.ts +1 -0
- package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/types.d.ts +2 -2
- package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/types.d.ts +1 -1
- package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/types.d.ts +2 -2
- package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useColumns.d.ts +1 -1
- package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.d.ts +6 -0
- package/components/maps/components/GpsTools/types.d.ts +1 -1
- package/components/maps/components/Map/contexts/MapContext/helper.d.ts +1 -1
- package/components/maps/components/Map/contexts/MapContext/index.d.ts +1 -1
- package/components/maps/components/Map/contexts/MapContext/types.d.ts +6 -6
- package/components/maps/components/Map/external/googleMutant/index.d.ts +94 -94
- package/components/maps/components/Map/featureRenders/CommonFeatureRender/index.d.ts +1 -1
- package/components/maps/components/Map/featureRenders/CommonFeatureRender/subcomponents/FeatureDivIconLabel/types.d.ts +1 -1
- package/components/maps/components/Map/featureRenders/CommonFeatureRender/subcomponents/MarkerIconLabel/types.d.ts +2 -2
- package/components/maps/components/Map/featureRenders/MarkerFeatureRender/index.d.ts +1 -1
- package/components/maps/components/Map/hooks/useAutoFocus/types.d.ts +2 -2
- package/components/maps/components/Map/index.d.ts +1 -1
- package/components/maps/components/Map/styled.d.ts +2 -0
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/bing.d.ts +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/google.d.ts +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/osm.d.ts +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/helpers.d.ts +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/types.d.ts +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/types.d.ts +1 -1
- package/components/maps/components/Map/subcomponents/Controls/types.d.ts +1 -1
- package/components/maps/components/Map/subcomponents/LayersContainer/subcomponents/MyLayer/subcomponents/MarkerClusterGroup/types.d.ts +2 -2
- package/components/maps/components/Map/types.d.ts +2 -2
- package/components/maps/{components/Map/index.accb1f77.js → index.8ec46ce4.js} +726 -940
- package/components/maps/index.d.ts +2 -2
- package/components/maps/leaflet-geoman.d.ts +1476 -1633
- package/components/modal/WindowBase.a3ac7adc.js +43 -0
- package/components/modal/WindowConfirm/types.d.ts +4 -4
- package/components/modal/WindowConfirm.e35da619.js +62 -0
- package/components/modal/classes/types.d.ts +1 -1
- package/components/modal/{index.61389369.js → index.a0e30c8b.js} +8 -6
- package/components/mui_extended/Accordion/classes/types.d.ts +1 -1
- package/components/mui_extended/Accordion/styles.d.ts +4 -0
- package/components/mui_extended/Avatar/classes/types.d.ts +1 -1
- package/components/mui_extended/Avatar/styles.d.ts +2 -0
- package/components/mui_extended/Avatar/tests/utils.d.ts +1 -1
- package/components/mui_extended/Badge/Badge.d.ts +1 -1
- package/components/mui_extended/Badge/classes/types.d.ts +1 -1
- package/components/mui_extended/Badge/styles.d.ts +2 -0
- package/components/mui_extended/Badge/types.d.ts +1 -1
- package/components/mui_extended/Button/classes/types.d.ts +2 -2
- package/components/mui_extended/Button/styles.d.ts +5 -0
- package/components/mui_extended/CheckBox/classes/types.d.ts +1 -1
- package/components/mui_extended/CheckBox/styles.d.ts +2 -0
- package/components/mui_extended/CheckBox/subcomponents/Skeleton/types.d.ts +1 -1
- package/components/mui_extended/CheckBox/types.d.ts +2 -2
- package/components/mui_extended/IconButton/styles.d.ts +2 -0
- package/components/mui_extended/ImageButton/styles.d.ts +2 -0
- package/components/mui_extended/ImageButton/tests/utils.d.ts +1 -1
- package/components/mui_extended/LoadingButton/styles.d.ts +2 -0
- package/components/mui_extended/LoadingButton/tests/utils.d.ts +1 -1
- package/components/mui_extended/MenuActions/classes/types.d.ts +1 -1
- package/components/mui_extended/MenuActions/styles.d.ts +5 -0
- package/components/mui_extended/Pager/classes/types.d.ts +1 -1
- package/components/mui_extended/Pager/styles.d.ts +2 -0
- package/components/mui_extended/Pager/subcomponents/CustomTablePagination/types.d.ts +2 -2
- package/components/mui_extended/Pager/subcomponents/PagerActions/types.d.ts +1 -1
- package/components/mui_extended/Popover/styles.d.ts +1 -0
- package/components/mui_extended/Popover/subcomponts/ArrowIcon/index.d.ts +3 -0
- package/components/mui_extended/Stack/Stack.d.ts +1 -1
- package/components/mui_extended/Stack/classes/types.d.ts +1 -1
- package/components/mui_extended/Stack/styles.d.ts +4 -0
- package/components/mui_extended/Stack/types.d.ts +1 -1
- package/components/mui_extended/Tab/classes/types.d.ts +1 -1
- package/components/mui_extended/Tab/styles.d.ts +3 -0
- package/components/mui_extended/TabContent/TabContent.d.ts +1 -1
- package/components/mui_extended/TabContent/classes/types.d.ts +1 -1
- package/components/mui_extended/TabContent/styles.d.ts +2 -0
- package/components/mui_extended/TabContent/types.d.ts +1 -1
- package/components/mui_extended/Tabs/classes/types.d.ts +1 -1
- package/components/mui_extended/Tabs/styles.d.ts +4 -0
- package/components/mui_extended/ToggleButton/ToggleButton.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/ToggleIconButton.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/types.d.ts +2 -2
- package/components/mui_extended/Tooltip/classes/types.d.ts +1 -1
- package/components/mui_extended/Tooltip/types.d.ts +3 -3
- package/components/mui_extended/Typography/styles.d.ts +2 -0
- package/components/mui_extended/Typography/tests/utils.d.ts +1 -1
- package/components/popups/PopupsProvider/{index.d7409f48.js → index.18669fb4.js} +12 -26
- package/components/popups/PopupsViewer/index.ba354267.js +166 -0
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +4 -4
- package/components/popups/components/PopupsViewer/classes/types.d.ts +1 -1
- package/components/popups/components/PopupsViewer/styled.d.ts +2 -0
- package/components/popups/components/PopupsViewer/subcomponents/Popup/types.d.ts +1 -1
- package/contexts/ModalContext/{index.2368bb19.js → index.cf02e6bd.js} +18 -19
- package/contexts/RHFormContext/classes/types.d.ts +1 -1
- package/contexts/RHFormContext/{index.7b2a8723.js → index.dc955a09.js} +16 -26
- package/contexts/RHFormContext/styles.d.ts +2 -0
- package/hocs/index.d.ts +1 -0
- package/hocs/withToggle/{index.50aec5e4.js → index.548aeace.js} +3 -11
- package/hooks/useFormAddEdit/index.f156a2cd.js +86 -0
- package/hooks/useFormFocus/index.d.ts +2 -2
- package/hooks/useFormFocus/types.d.ts +1 -1
- package/hooks/useModal/index.ef54bcf2.js +66 -0
- package/hooks/useSizeContainer/{index.62b4e0c4.js → index.3c48670c.js} +1 -1
- package/hooks/useTab/{index.976d5e1e.js → index.bce8b99e.js} +1 -1
- package/index.d.ts +1 -1
- package/index.js +278 -362
- package/package.json +13 -2
- package/{react-draggable.e4725f3a.js → react-draggable.5331add7.js} +1 -1
- package/{react-resizable.c07d63fb.js → react-resizable.37bfb965.js} +3 -5
- package/styles/DynamicFilter.styles.d.ts +2 -0
- package/test/getNameDataTestId.aee44365.js +10 -0
- package/test/getNameDataTestId.d.ts +10 -0
- package/test/index.6d4b98b9.js +4 -0
- package/utils/containerQuery.d.ts +2 -0
- package/utils/{index.6469f148.js → index.9ee4c99a.js} +117 -3
- package/utils/index.d.ts +1 -1
- package/vendor.a1ce6777.js +6352 -0
- package/vite-env.d.ts +4 -4
- package/assets/Logo/index.228dcb5a.js +0 -93
- package/assets/Logo.d.ts +0 -6
- package/components/AccountPopover/index.39efc8f0.js +0 -302
- package/components/AppBar/index.c8850b99.js +0 -109
- package/components/CommonActions/components/ActionCancel/index.416cbf9b.js +0 -20
- package/components/CommonActions/components/ActionFormCancel/index.78267f7c.js +0 -61
- package/components/CommonActions/components/ActionFormIntro/index.dcb4d280.js +0 -40
- package/components/CommonActions/components/ActionIntro/index.094290fd.js +0 -26
- package/components/CommonActions/components/Actions/index.fa7ab18c.js +0 -66
- package/components/DataGrid/constants.e334cd50.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index.cd6e553a.js +0 -27
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.0c439ac3.js +0 -30
- package/components/DataGrid/formatters/ColumnDateFormatter/index.704db1ca.js +0 -27
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.867b8745.js +0 -26
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.925387d2.js +0 -19
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.4335c26b.js +0 -13
- package/components/DataGrid/formatters/ColumnPriceFormatter/index.d717405e.js +0 -13
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.0b23ba88.js +0 -40
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.aeea65aa.js +0 -13
- package/components/DataGrid/formatters/index.2c2f0ae4.js +0 -1
- package/components/DataGrid/index.abe0f9b9.js +0 -979
- package/components/DataGrid/subcomponents/Actions/index.4f2071ee.js +0 -663
- package/components/DataGrid/subcomponents/editors/TextEditor/index.eac1749c.js +0 -75
- package/components/DragResizeWindow/index.13ef022e.js +0 -489
- package/components/DynamicFilter/classes/index.d.ts +0 -5
- package/components/DynamicFilter/classes/types.d.ts +0 -35
- package/components/DynamicFilter/contexts/DynamicFilterContext/helpers.d.ts +0 -23
- package/components/DynamicFilter/contexts/DynamicFilterContext/index.d.ts +0 -18
- package/components/DynamicFilter/contexts/DynamicFilterContext/types.d.ts +0 -5
- package/components/DynamicFilter/hooks/useDynamicFilter.d.ts +0 -2
- package/components/DynamicFilter/index.c52a8e96.js +0 -1954
- package/components/DynamicFilter/subcomponents/ApplyedFilters/index.d.ts +0 -6
- package/components/DynamicFilter/subcomponents/ApplyedFilters/subcomponents/ApplyedFilter/index.d.ts +0 -2
- package/components/DynamicFilter/subcomponents/ClearFilters/index.d.ts +0 -1
- package/components/DynamicFilter/subcomponents/FilterButton/index.d.ts +0 -11
- package/components/DynamicFilter/subcomponents/InnerForHooks/index.d.ts +0 -5
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/types.d.ts +0 -6
- package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/helpers.d.ts +0 -39
- package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/index.d.ts +0 -5
- package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/helpers.d.ts +0 -42
- package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/helpers.d.ts +0 -36
- package/components/DynamicFilter/subcomponents/fieldstypes/SelectFilter/helpers.d.ts +0 -51
- package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/helpers.d.ts +0 -39
- package/components/DynamicFilter/subcomponents/fieldstypes/factory.d.ts +0 -82
- package/components/DynamicFilter/subcomponents/fieldstypes/validations.d.ts +0 -32
- package/components/DynamicFilter/tests/contants.d.ts +0 -5
- package/components/FieldLabel/index.0412576c.js +0 -82
- package/components/GridLayout/subcomponents/Griditem/index.30016fc1.js +0 -366
- package/components/GridLayout/subcomponents/SizeProvider/index.0328ad0a.js +0 -62
- package/components/Icon/index.ad330e78.js +0 -184
- package/components/Image/index.b799c514.js +0 -203
- package/components/LanguagePopover/index.93c48ec5.js +0 -196
- package/components/LinearProgressIndeterminate/index.c46da124.js +0 -43
- package/components/ModalDialog/index.78c9650a.js +0 -92
- package/components/NavLink/index.b75c91e1.js +0 -59
- package/components/ObjectLogs/index.1d85a021.js +0 -293
- package/components/Page/index.5d34dc4d.js +0 -127
- package/components/PaperForm/index.d08b43f6.js +0 -138
- package/components/Period/index.3f89d8a4.js +0 -306
- package/components/PrintingSystem/subcomponents/BodyNode/index.319a3bb9.js +0 -48
- package/components/PrintingSystem/subcomponents/DividerNode/index.e504dbd2.js +0 -19
- package/components/PrintingSystem/subcomponents/FooterNode/index.9a19a7cb.js +0 -48
- package/components/PrintingSystem/subcomponents/GridNode/index.8d14e1b6.js +0 -71
- package/components/PrintingSystem/subcomponents/HeaderNode/index.89e4eaab.js +0 -48
- package/components/PrintingSystem/subcomponents/PaperNode/index.dd4ca449.js +0 -46
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index.048d7ebf.js +0 -41
- package/components/PrintingSystem/subcomponents/SectionNode/index.83f1efea.js +0 -48
- package/components/PrintingSystem/subcomponents/TextBoxNode/index.5427cb75.js +0 -28
- package/components/PropertyValue/index.15c61a4b.js +0 -209
- package/components/SideBar/index.b0359a2b.js +0 -916
- package/components/SplitLayout/index.d.ts +0 -2
- package/components/WrapperComponent/index.5e872594.js +0 -18
- package/components/animate/MotionContainer/index.8d9f9d80.js +0 -33
- package/components/animate/PropagateLoader/index.7fab43c8.js +0 -30
- package/components/animate/variants/index.7a912140.js +0 -1
- package/components/areas/components/AreasAdmin/index.820a00ab.js +0 -737
- package/components/areas/components/AreasViewer/index.6d7194e2.js +0 -1086
- package/components/areas/components/index.558684b3.js +0 -1
- package/components/areas/constants.66529246.js +0 -6
- package/components/areas/contexts/index.24025b97.js +0 -1
- package/components/areas/dictionary.08cfc4c9.js +0 -36
- package/components/areas/hooks/index.d9dc1e21.js +0 -1
- package/components/areas/icons.8266ccc8.js +0 -26
- package/components/areas/index.4cc6a221.js +0 -22
- package/components/commercial/AppBarCommercial/index.9cf586a2.js +0 -30
- package/components/commercial/SectionCommercial/index.4dbfc0a7.js +0 -48
- package/components/commercial/TopBar/index.93a7d26a.js +0 -275
- package/components/commercial/index.89ad149c.js +0 -82
- package/components/formatters/BooleanFormatter/index.9ccf9298.js +0 -54
- package/components/formatters/DateFormatter/index.578a9f53.js +0 -52
- package/components/formatters/PointsFormatter/index.8a4fa393.js +0 -32
- package/components/formatters/PriceFormatter/index.83cbe7be.js +0 -43
- package/components/formatters/UncertaintyFormatter/index.08e1b79f.js +0 -34
- package/components/formatters/index.03471e3f.js +0 -140
- package/components/hook-form/HelperError/index.66bbcac3.js +0 -30
- package/components/hook-form/RHFAutocomplete/index.1f2afb6b.js +0 -429
- package/components/hook-form/RHFAutocompleteAsync/index.bc278965.js +0 -156
- package/components/hook-form/RHFCheckbox/index.eca64469.js +0 -143
- package/components/hook-form/RHFColorPicker/index.dc13d5a3.js +0 -204
- package/components/hook-form/RHFDateTime/index.e554b068.js +0 -203
- package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +0 -34
- package/components/hook-form/RHFPeriod/index.e4e4530f.js +0 -112
- package/components/hook-form/RHFRadioGroup/index.1ddb3d93.js +0 -45
- package/components/hook-form/RHFSelect/index.b6ca8bb2.js +0 -36
- package/components/hook-form/RHFTextField/index.1bfa601f.js +0 -358
- package/components/hook-form/RHFUpload/index.6e98b291.js +0 -242
- package/components/maps/index.34ab6a68.js +0 -7
- package/components/modal/WindowBase.fd86f575.js +0 -74
- package/components/modal/WindowConfirm.ee6de236.js +0 -105
- package/components/mui_extended/Accordion/index.7dcdfd3a.js +0 -126
- package/components/mui_extended/Avatar/index.75e6ed57.js +0 -71
- package/components/mui_extended/Badge/index.09f5aee5.js +0 -36
- package/components/mui_extended/BoxIcon/index.e638ecc8.js +0 -22
- package/components/mui_extended/Breadcrumbs/index.5e37d903.js +0 -94
- package/components/mui_extended/Button/index.c3084916.js +0 -221
- package/components/mui_extended/CheckBox.2a3b86c5.js +0 -86
- package/components/mui_extended/CircularProgress/index.ad569afd.js +0 -10
- package/components/mui_extended/IconButton/index.f8a3021b.js +0 -125
- package/components/mui_extended/LinearProgress/index.c92b9ba9.js +0 -13
- package/components/mui_extended/LinkWithRoute/index.16436ab8.js +0 -30
- package/components/mui_extended/MenuActions/index.90f53670.js +0 -175
- package/components/mui_extended/Pager/index.ea2a4f3e.js +0 -254
- package/components/mui_extended/Popover/index.d85de73b.js +0 -179
- package/components/mui_extended/Stack/index.0e53197c.js +0 -39
- package/components/mui_extended/Tab/index.9214d9cc.js +0 -156
- package/components/mui_extended/ToggleButton/index.191711f3.js +0 -19
- package/components/mui_extended/ToggleIconButton/index.d9dbf650.js +0 -19
- package/components/mui_extended/Tooltip/index.24a2bc3f.js +0 -43
- package/components/mui_extended/Typography/index.379dd374.js +0 -68
- package/components/mui_extended/index.b606cd9d.js +0 -1
- package/components/popups/PopupsViewer/index.1500ce72.js +0 -186
- package/hooks/useFormAddEdit/index.000ce60b.js +0 -94
- package/hooks/useModal/index.f73d7e42.js +0 -11
- package/style.css +0 -65
- package/test/constants_no_mock.86c553a9.js +0 -4
- package/test/getNameDataTestId.14875ec7.js +0 -6
- /package/components/DynamicFilter/subcomponents/{fieldstypes → FieldTypes}/DateTimeFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/subcomponents/{fieldstypes → FieldTypes}/NumberFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/subcomponents/{fieldstypes → FieldTypes}/SelectFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/subcomponents/{fieldstypes → FieldTypes}/StringFilter/index.d.ts +0 -0
|
@@ -1,32 +1,26 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { useMap, LayerGroup, MapContainer, Marker, Polyline, Circle, Polygon } from "react-leaflet";
|
|
2
3
|
import { shallow } from "zustand/shallow";
|
|
3
4
|
import React__default, { createContext, useRef, useEffect, useContext, useMemo, useState, useCallback } from "react";
|
|
4
5
|
import * as L from "leaflet";
|
|
5
6
|
import L__default from "leaflet";
|
|
6
7
|
import { Loader } from "@googlemaps/js-api-loader";
|
|
7
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
import { useModuleDictionary, useModuleSkeleton, useEnvironment, useModulePrivileges } from "@m4l/core";
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
12
|
-
import {
|
|
13
|
-
import { B as Button } from "
|
|
12
|
+
import { M as MAP_DICCTIONARY } from "../areas/dictionary.7e74022a.js";
|
|
13
|
+
import { d as Actions, B as Button, c as RHFAutocompleteAsync, S as Stack, r as ColumnSetCheckFormatter, g as DataGrid, s as CheckBox, P as Popover } from "../../vendor.a1ce6777.js";
|
|
14
14
|
import * as Yup from "yup";
|
|
15
|
-
import { u as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { u as usePopupsStore, P as PopupsProvider } from "
|
|
21
|
-
import { T as ToggleIconButton } from "../../../mui_extended/ToggleIconButton/index.d9dbf650.js";
|
|
22
|
-
import { c as DataGrid } from "../../../DataGrid/index.abe0f9b9.js";
|
|
15
|
+
import { ao as COMPONENT_CLASS_NAME, ap as STYLE_MEASURE_OPTIONS, aq as MAP_ZINDEX_DEFAULT, ar as INITIAL_FORM_VALUES, as as GPS_TOOLS_POPUP_DEFAULT_POSITION, at as MESURE_POPUP_DEFAULT_POSITION, au as TIME_DOUBLE_CLICK, av as MARKER_COLOR_DEFAULT, L as LABEL_BK_COLOR_DEFAULT, u as LABEL_COLOR_DEFAULT, aw as SVG_ICON_DEFAULT } from "../areas/constants.5387d83e.js";
|
|
16
|
+
import { u as useFormReadyForUpdate } from "../../hooks/useFormReadyForUpdate/index.f60f500e.js";
|
|
17
|
+
import { R as RHFormProvider } from "../../contexts/RHFormContext/index.dc955a09.js";
|
|
18
|
+
import { M as MAP_ICONS } from "../areas/icons.504ec098.js";
|
|
19
|
+
import { a as IconButton, T as ToggleIconButton, I as Icon, M as MarkerIconLabel } from "../Icon/index.d5fed418.js";
|
|
20
|
+
import { u as usePopupsStore, P as PopupsProvider } from "../popups/PopupsProvider/index.18669fb4.js";
|
|
23
21
|
import { generateUtilityClasses, Tooltip, FormControl, RadioGroup, FormControlLabel, Radio, useTheme } from "@mui/material";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { u as useStateRef } from "../../../../hooks/useStateRef/index.538edb89.js";
|
|
27
|
-
import { C as CheckBox } from "../../../mui_extended/CheckBox.2a3b86c5.js";
|
|
28
|
-
import { P as Popover } from "../../../mui_extended/Popover/index.d85de73b.js";
|
|
29
|
-
import { P as PopupsViewer } from "../../../popups/PopupsViewer/index.1500ce72.js";
|
|
22
|
+
import { u as useStateRef } from "../../hooks/useStateRef/index.538edb89.js";
|
|
23
|
+
import { P as PopupsViewer } from "../popups/PopupsViewer/index.ba354267.js";
|
|
30
24
|
import { createPathComponent } from "@react-leaflet/core";
|
|
31
25
|
import "leaflet.markercluster";
|
|
32
26
|
import { cloneDeep, throttle } from "lodash";
|
|
@@ -37,45 +31,9 @@ import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
|
|
|
37
31
|
import { devtools } from "zustand/middleware";
|
|
38
32
|
import { immer } from "zustand/middleware/immer";
|
|
39
33
|
import { unstable_composeClasses } from "@mui/base";
|
|
40
|
-
import { g as getComponentUtilityClass } from "
|
|
41
|
-
import { b as bearingRawToCSS } from "../../index.34ab6a68.js";
|
|
34
|
+
import { g as getComponentUtilityClass } from "../../utils/index.9ee4c99a.js";
|
|
42
35
|
import "leaflet-polylinedecorator";
|
|
43
|
-
const
|
|
44
|
-
const MAP_ZINDEX_DEFAULT = 0;
|
|
45
|
-
const MAP_ZINDEX_OVER_MAP = 1100;
|
|
46
|
-
const TIME_DOUBLE_CLICK = 250;
|
|
47
|
-
const MARKER_COLOR_DEFAULT = "#1E96DC";
|
|
48
|
-
const LABEL_BK_COLOR_DEFAULT = "#1E96DC";
|
|
49
|
-
const LABEL_COLOR_DEFAULT = "#FFFFFF";
|
|
50
|
-
const GPS_TOOLS_POPUP_DEFAULT_POSITION = {
|
|
51
|
-
vertical: { top: 50, bottom: 50 },
|
|
52
|
-
horizontal: { right: 50, width: 380 }
|
|
53
|
-
};
|
|
54
|
-
const MESURE_POPUP_DEFAULT_POSITION = {
|
|
55
|
-
vertical: { top: 50, height: 250 },
|
|
56
|
-
horizontal: { right: 50, width: 300 }
|
|
57
|
-
};
|
|
58
|
-
const SVG_ICON_DEFAULT = `<svg viewBox="0 0 640 640" height="32" width="32" xmlns="http://www.w3.org/2000/svg">
|
|
59
|
-
<g>
|
|
60
|
-
<circle
|
|
61
|
-
cx="320"
|
|
62
|
-
cy="320"
|
|
63
|
-
r="280"
|
|
64
|
-
fill="#1E96DC"
|
|
65
|
-
/>
|
|
66
|
-
<text
|
|
67
|
-
x="320"
|
|
68
|
-
y="320"
|
|
69
|
-
font-size="320"
|
|
70
|
-
font-family="sans-serif"
|
|
71
|
-
fill="#FFFFFF"
|
|
72
|
-
text-anchor="middle"
|
|
73
|
-
alignment-baseline="central"
|
|
74
|
-
dominant-baseline="central"
|
|
75
|
-
>P</text>
|
|
76
|
-
</g>
|
|
77
|
-
</svg>`;
|
|
78
|
-
const updateOwnerStateClasses = (state) => {
|
|
36
|
+
const updateOwnerStateClasses = (_state) => {
|
|
79
37
|
};
|
|
80
38
|
const mapClasses = generateUtilityClasses(COMPONENT_CLASS_NAME, [
|
|
81
39
|
"root",
|
|
@@ -152,113 +110,6 @@ const useMapUtilityClasses = (_ownerState) => {
|
|
|
152
110
|
};
|
|
153
111
|
return unstable_composeClasses(slots, getComponentUtilityClass(COMPONENT_CLASS_NAME), {});
|
|
154
112
|
};
|
|
155
|
-
const MAP_DICCTIONARY = {
|
|
156
|
-
LABEL_GPSTOOLS_NAME: "label_gpstools_name",
|
|
157
|
-
LABEL_TAB_GEO: "label_tab_geo",
|
|
158
|
-
TAB_GENERAL_CONFIG_TOOLTIP: "tab_general_config_tooltip",
|
|
159
|
-
PAPER_GENERAL: "paper_general",
|
|
160
|
-
LABEL_ID: "label_id",
|
|
161
|
-
LABEL_NAME: "label_name",
|
|
162
|
-
LABEL_GEOMETRY_TYPE: "label_geometry_type",
|
|
163
|
-
LABEL_GEOMETRY_CIRCLE: "label_geometry_circle",
|
|
164
|
-
LABEL_GEOMETRY_RECTANGLE: "label_geometry_rectangle",
|
|
165
|
-
LABEL_GEOMETRY_POLYGON: "label_geometry_polygon",
|
|
166
|
-
LABEL_DRAW: "label_draw",
|
|
167
|
-
LABEL_FINISH: "label_finish",
|
|
168
|
-
PAPER_CONFIG: "paper_config",
|
|
169
|
-
LABEL_ALIAS: "label_alias",
|
|
170
|
-
LABEL_CUSTOMER_ID: "label_customer_id",
|
|
171
|
-
LABEL_TIME_MIN_IN_SECONDS: "label_time_min_in_seconds",
|
|
172
|
-
LABEL_TIME_MIN_OUT_SECONDS: "label_time_min_out_seconds",
|
|
173
|
-
TAB_STYLE_CONFIG_TOOLTIP: "tab_style_tooltip",
|
|
174
|
-
PAPER_STROKE: "paper_stroke",
|
|
175
|
-
LABEL_COLOR: "label_color",
|
|
176
|
-
LABEL_OPACITY: "label_opacity",
|
|
177
|
-
LABEL_WEIGHT: "label_weight",
|
|
178
|
-
LABEL_DASH_ARRAY: "label_dash_array",
|
|
179
|
-
LABEL_DASH_OFFSET: "label_dash_offset",
|
|
180
|
-
LABEL_RADIUS: "label_radius",
|
|
181
|
-
LABEL_LAT: "label_lat",
|
|
182
|
-
LABEL_LON: "label_lon",
|
|
183
|
-
LABEL_PLACE_MARKER: "label_place_marker",
|
|
184
|
-
LABEL_FIRST_VERTEX: "label_first_vertex",
|
|
185
|
-
LABEL_CONTINUE_LINE: "label_continue_line",
|
|
186
|
-
LABEL_FINISH_LINE: "label_finish_line",
|
|
187
|
-
LABEL_FINISH_POLY: "label_finish_poly",
|
|
188
|
-
LABEL_FINISH_RECT: "label_finish_rect",
|
|
189
|
-
LABEL_START_CIRCLE: "label_start_circle",
|
|
190
|
-
LABEL_FINISH_CIRCLE: "label_finish_circle",
|
|
191
|
-
LABEL_PLACE_CIRCLE_MARKER: "label_place_circle_marker",
|
|
192
|
-
VALIDATION_GEOMETRY_REQUIRED: "validation_geometry_required",
|
|
193
|
-
VALIDATION_FIELD_REQUIRED: "validation_field_required",
|
|
194
|
-
VALIDATION_FIELD_TYPE_NUMBER_ERROR: "validation_field_type_number_error",
|
|
195
|
-
LABEL_VIEW_TRANSIT_FEATURES: "label_view_crossing_features",
|
|
196
|
-
LABEL_VIEW_INTERNAL_FEATURES: "label_view_internal_features",
|
|
197
|
-
LABEL_CREATED_AT: "label_created_at",
|
|
198
|
-
LABEL_UPDATED_AT: "label_updated_at",
|
|
199
|
-
MODAL_DELETE_GEO_TITLE: "modal_delete_geo_title",
|
|
200
|
-
MODAL_DELETE_GEO_MESSAGE: "modal_delete_geo_message",
|
|
201
|
-
MODAL_DISABLE_GEO_TITLE: "modal_disable_geo_title",
|
|
202
|
-
MODAL_DISABLE_MESSAGE: "modal_disable_geo_message",
|
|
203
|
-
ROW_ACTION_GEO_EDIT: "row_action_geo_edit",
|
|
204
|
-
ROW_ACTION_GEO_ENABLE: "row_action_geo_enable",
|
|
205
|
-
ROW_ACTION_GEO_DISABLE: "row_action_geo_disable",
|
|
206
|
-
ROW_ACTION_GEO_DELETE: "row_action_geo_delete",
|
|
207
|
-
LABEL_TAB_MEASURE: "label_tab_measure",
|
|
208
|
-
PAPER_MEASURE: "paper_measure",
|
|
209
|
-
LABEL_MEASURE_START: "label_measure_start",
|
|
210
|
-
LABEL_MEASURE_CANCEL: "label_measure_cancel",
|
|
211
|
-
LABEL_MEASURE_DISTANCE: "label_measure_distance",
|
|
212
|
-
LABEL_MEASURE_AREA: "label_measure_area",
|
|
213
|
-
LABEL_MEASURE_UNIT: "label_measure_unit",
|
|
214
|
-
LABEL_MEASURE_UNIT_BASE_KILOMETERS: "label_measure_unit_base_kilometers",
|
|
215
|
-
LABEL_MEASURE_REMOVE_POINT: "label_measure_remove_point",
|
|
216
|
-
LABEL_LAYERS: "label_layes",
|
|
217
|
-
LABEL_LAYER_NAME: "label_layer_name",
|
|
218
|
-
LABEL_LAYER_VISIBLE: "label_layer_visible",
|
|
219
|
-
LABEL_LAYER_AUTOFOCUS: "label_layer_autofocus",
|
|
220
|
-
LABEL_LAYER_CLUSTER: "label_layer_cluster",
|
|
221
|
-
LABEL_LAYER_DELETE: "label_layer_delete",
|
|
222
|
-
ROW_ACTION_LAYER_DELETE: "row_action_layer_delete",
|
|
223
|
-
LABEL_MAP_SOURCES: "label_map_sources",
|
|
224
|
-
LABEL_TILE_OSM: "label_tile_osm",
|
|
225
|
-
LABEL_TILE_GOOGLE: "label_tile_google",
|
|
226
|
-
LABEL_TILE_GOOGLE_SATELLITE: "label_tile_google_satellite",
|
|
227
|
-
LABEL_TILE_GOOGLE_HYBRID: "label_tile_google_hybrid",
|
|
228
|
-
LABEL_TILE_BING: "label_tile_bing"
|
|
229
|
-
};
|
|
230
|
-
const MAP_ICONS = {
|
|
231
|
-
MAP_ZOOM_IN: "cmp_map_zoom_in.svg",
|
|
232
|
-
MAP_ZOOM_OUT: "cmp_map_zoom_out.svg",
|
|
233
|
-
MAP_SOURCES_TOOL: "cmp_map_mapsources_tool.svg",
|
|
234
|
-
MAP_SOURCE_OSM: "cmp_map_mapsources_osm.svg",
|
|
235
|
-
MAP_SOURCE_GOOGLE_ROADS: "cmp_map_mapsources_google.svg",
|
|
236
|
-
MAP_SOURCE_GOOGLE_HYBRID: "cmp_map_mapsources_googlehybrid.svg",
|
|
237
|
-
MAP_SOURCE_GOOGLE_SATELLITE: "cmp_map_mapsources_googlesatelite.svg",
|
|
238
|
-
MAP_SOURCE_BING: "cmp_map_mapsources_ bing.svg",
|
|
239
|
-
MAP_SOURCE_ROAD_TRAFFIC: "cmp_map_mapsources_layer-traffic.svg",
|
|
240
|
-
MAP_SOURCE_ROAD_TRANSIT: "cmp_map_mapsources_layer-transit.svg",
|
|
241
|
-
MAP_SOURCE_ROAD_BICYCLING: "cmp_map_mapsources_layer-bicycle.svg",
|
|
242
|
-
MAP_LAYERS_TOOL: "cmp_map_layers_tool.svg",
|
|
243
|
-
MAP_LAYER_VISIBLE: "cmp_map_layers_view.svg",
|
|
244
|
-
MAP_LAYER_AUTOFOCUS: "cmp_map_layers_zoom_fit.svg",
|
|
245
|
-
MAP_LAYER_CLUSTER: "cmp_map_layers_cluster.svg",
|
|
246
|
-
MAP_LAYER_DELETE: "cmp_map_layers_delete.svg",
|
|
247
|
-
MAP_GPS_TOOLS_TOOL: "cmp_map_gpstools_tool.svg",
|
|
248
|
-
GEOMETRY_CIRCLE: "geometry_circle.svg",
|
|
249
|
-
GEOMETRY_RECTANGLE: "geometry_rectangle.svg",
|
|
250
|
-
GEOMETRY_POLYGON: "geometry_polygon.svg",
|
|
251
|
-
ADD: "add.svg",
|
|
252
|
-
MAP_MEASURE_TOOL: "cmp_map_measure_tool.svg",
|
|
253
|
-
GENERAL: "general.svg",
|
|
254
|
-
CONFIG: "config.svg",
|
|
255
|
-
STROKE: "stroke.svg",
|
|
256
|
-
FILL: "fill.svg",
|
|
257
|
-
EDIT: "edit.svg",
|
|
258
|
-
DELETE: "delete.svg",
|
|
259
|
-
ACTIVE: "active.svg",
|
|
260
|
-
NAME: "name.svg"
|
|
261
|
-
};
|
|
262
113
|
const TILE_LAYER_OSM = {
|
|
263
114
|
id: "osm_roadmap",
|
|
264
115
|
sourceType: "OSM",
|
|
@@ -349,7 +200,7 @@ function toQuadKey(x, y, z) {
|
|
|
349
200
|
let quadKey = "";
|
|
350
201
|
for (let i = z; i > 0; i--) {
|
|
351
202
|
let digit = 0;
|
|
352
|
-
|
|
203
|
+
const mask = 1 << i - 1;
|
|
353
204
|
if ((x & mask) !== 0) {
|
|
354
205
|
digit++;
|
|
355
206
|
}
|
|
@@ -418,12 +269,16 @@ const createMapStore = (initProps) => {
|
|
|
418
269
|
google_hybrid: TILE_LAYER_GOOGLE_HYBRID,
|
|
419
270
|
bing_rodmap: TILE_LAYER_BING
|
|
420
271
|
};
|
|
421
|
-
state.mapSourcesIds = [
|
|
272
|
+
state.mapSourcesIds = [
|
|
273
|
+
"osm_roadmap",
|
|
274
|
+
"google_rodmap",
|
|
275
|
+
"google_satellite",
|
|
276
|
+
"google_hybrid",
|
|
277
|
+
"bing_rodmap"
|
|
278
|
+
];
|
|
422
279
|
state.currentMapSourceId = "osm_roadmap";
|
|
423
280
|
for (let index = 0; index < layersStore.length; index++) {
|
|
424
|
-
state.hashLayers[layersStore[index].layerId] = cloneDeep(
|
|
425
|
-
layersStore[index]
|
|
426
|
-
);
|
|
281
|
+
state.hashLayers[layersStore[index].layerId] = cloneDeep(layersStore[index]);
|
|
427
282
|
state.layersIds.push(layersStore[index].layerId);
|
|
428
283
|
if (layersStore[index].visible !== false) {
|
|
429
284
|
state.visibleCheckedLayers.add(layersStore[index].layerId);
|
|
@@ -542,7 +397,9 @@ const createMapStore = (initProps) => {
|
|
|
542
397
|
if (state.hashLayers[layerId]) {
|
|
543
398
|
if (state.hashLayers[layerId].geoJsonObject?.object.type === "FeatureCollection") {
|
|
544
399
|
const layer = state.hashLayers[layerId].geoJsonObject?.object;
|
|
545
|
-
const feature = layer.features.find(
|
|
400
|
+
const feature = layer.features.find(
|
|
401
|
+
(currentFeature) => currentFeature.id === featureId
|
|
402
|
+
);
|
|
546
403
|
if (feature) {
|
|
547
404
|
feature.layerData = layerData;
|
|
548
405
|
}
|
|
@@ -615,15 +472,8 @@ const createMapStore = (initProps) => {
|
|
|
615
472
|
};
|
|
616
473
|
const MapContext = createContext(null);
|
|
617
474
|
function MapProvider(props) {
|
|
618
|
-
const {
|
|
619
|
-
|
|
620
|
-
initialLayers,
|
|
621
|
-
googleApiKey: apiKey,
|
|
622
|
-
googleMapVersion = "weekly"
|
|
623
|
-
} = props;
|
|
624
|
-
const {
|
|
625
|
-
getLabel
|
|
626
|
-
} = useModuleDictionary();
|
|
475
|
+
const { children, initialLayers, googleApiKey: apiKey, googleMapVersion = "weekly" } = props;
|
|
476
|
+
const { getLabel } = useModuleDictionary();
|
|
627
477
|
const isDesktop = useResponsiveDesktop();
|
|
628
478
|
const isSkeleton = useModuleSkeleton();
|
|
629
479
|
const isFirstRender = useFirstRender([getLabel]);
|
|
@@ -642,10 +492,11 @@ function MapProvider(props) {
|
|
|
642
492
|
});
|
|
643
493
|
mapStoreRef.current?.getState().mapActions.init(initialLayers || []);
|
|
644
494
|
}
|
|
645
|
-
const {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
495
|
+
const { setHandlerGetLabel, setExternalState } = useStore(
|
|
496
|
+
mapStoreRef.current,
|
|
497
|
+
(state) => state.mapActions,
|
|
498
|
+
shallow
|
|
499
|
+
);
|
|
649
500
|
useEffect(() => {
|
|
650
501
|
if (!isFirstRender) {
|
|
651
502
|
setHandlerGetLabel(getLabel);
|
|
@@ -655,15 +506,9 @@ function MapProvider(props) {
|
|
|
655
506
|
if (isFirstRender) {
|
|
656
507
|
return;
|
|
657
508
|
}
|
|
658
|
-
setExternalState({
|
|
659
|
-
isMobile: !isDesktop,
|
|
660
|
-
isSkeleton
|
|
661
|
-
});
|
|
509
|
+
setExternalState({ isMobile: !isDesktop, isSkeleton });
|
|
662
510
|
}, [isDesktop, isSkeleton]);
|
|
663
|
-
return /* @__PURE__ */ jsx(MapContext.Provider, {
|
|
664
|
-
value: mapStoreRef.current,
|
|
665
|
-
children
|
|
666
|
-
});
|
|
511
|
+
return /* @__PURE__ */ jsx(MapContext.Provider, { value: mapStoreRef.current, children });
|
|
667
512
|
}
|
|
668
513
|
function useMapStore(selector, equalityFn) {
|
|
669
514
|
const context = useContext(MapContext);
|
|
@@ -673,13 +518,10 @@ function useMapStore(selector, equalityFn) {
|
|
|
673
518
|
}
|
|
674
519
|
const TileLayerOthers = () => {
|
|
675
520
|
const map = useMap();
|
|
676
|
-
const {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
getTileUrl,
|
|
681
|
-
sourceType
|
|
682
|
-
} = useMapStore((state) => state.hashMapSources[state.currentMapSourceId], shallow);
|
|
521
|
+
const { urlTemplate, dictionaryId, options, getTileUrl, sourceType } = useMapStore(
|
|
522
|
+
(state) => state.hashMapSources[state.currentMapSourceId],
|
|
523
|
+
shallow
|
|
524
|
+
);
|
|
683
525
|
useEffect(() => {
|
|
684
526
|
let layer;
|
|
685
527
|
if (sourceType === "Google") {
|
|
@@ -704,13 +546,18 @@ const TileLayerOthers = () => {
|
|
|
704
546
|
function TileLayerGoogle() {
|
|
705
547
|
const map = useMap();
|
|
706
548
|
const mutantRefLayer = React__default.useRef(null);
|
|
707
|
-
const {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
549
|
+
const { options, sourceType, mapTypeTile } = useMapStore(
|
|
550
|
+
(state) => state.hashMapSources[state.currentMapSourceId],
|
|
551
|
+
shallow
|
|
552
|
+
);
|
|
553
|
+
const roadOptions = useMapStore(
|
|
554
|
+
(state) => state.hashMapSources[state.currentMapSourceId].roadSelectedOptions,
|
|
555
|
+
shallow
|
|
556
|
+
);
|
|
557
|
+
const [googleApiKey, googleMapVersion] = useMapStore(
|
|
558
|
+
(state) => [state.googleApiKey, state.googleMapVersion],
|
|
559
|
+
shallow
|
|
560
|
+
);
|
|
714
561
|
React__default.useEffect(() => {
|
|
715
562
|
if (sourceType !== "Google") {
|
|
716
563
|
return;
|
|
@@ -750,7 +597,6 @@ function TileLayerGoogle() {
|
|
|
750
597
|
return;
|
|
751
598
|
}
|
|
752
599
|
if (mutantRefLayer.current && roadOptions) {
|
|
753
|
-
console.log("roadOptions.trafficLayer", roadOptions.trafficLayer);
|
|
754
600
|
if (roadOptions.trafficLayer) {
|
|
755
601
|
mutantRefLayer.current.addGoogleLayer("TrafficLayer");
|
|
756
602
|
} else if (roadOptions.trafficLayer === false) {
|
|
@@ -785,9 +631,10 @@ function TileLayerGoogle() {
|
|
|
785
631
|
return null;
|
|
786
632
|
}
|
|
787
633
|
function TileLayers() {
|
|
788
|
-
return /* @__PURE__ */ jsxs(React__default.Fragment, {
|
|
789
|
-
|
|
790
|
-
|
|
634
|
+
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
635
|
+
/* @__PURE__ */ jsx(TileLayerOthers, {}),
|
|
636
|
+
/* @__PURE__ */ jsx(TileLayerGoogle, {})
|
|
637
|
+
] });
|
|
791
638
|
}
|
|
792
639
|
const POSITION_CLASSES = {
|
|
793
640
|
bottomleft: "leaflet-bottom leaflet-left",
|
|
@@ -801,7 +648,6 @@ const Control = (props) => {
|
|
|
801
648
|
const controlContainerRef = React__default.createRef();
|
|
802
649
|
const map = useMap();
|
|
803
650
|
React__default.useEffect(() => {
|
|
804
|
-
console.log("useEffect, controlContainerRef", controlContainerRef);
|
|
805
651
|
if (controlContainerRef.current !== null) {
|
|
806
652
|
L__default.DomEvent.disableClickPropagation(controlContainerRef.current);
|
|
807
653
|
L__default.DomEvent.disableScrollPropagation(controlContainerRef.current);
|
|
@@ -822,22 +668,11 @@ const Control = (props) => {
|
|
|
822
668
|
}
|
|
823
669
|
}, [portalRoot, props.prepend, controlContainerRef]);
|
|
824
670
|
const className = clsx(props.container?.className, "leaflet-control", props.className);
|
|
825
|
-
|
|
826
|
-
return /* @__PURE__ */ jsx("div", {
|
|
827
|
-
...props.container,
|
|
828
|
-
ref: controlContainerRef,
|
|
829
|
-
className,
|
|
830
|
-
children: props.children
|
|
831
|
-
});
|
|
671
|
+
return /* @__PURE__ */ jsx("div", { ...props.container, ref: controlContainerRef, className, children: props.children });
|
|
832
672
|
};
|
|
833
673
|
function MyActions() {
|
|
834
|
-
const {
|
|
835
|
-
|
|
836
|
-
setValue
|
|
837
|
-
} = useFormContext();
|
|
838
|
-
const {
|
|
839
|
-
getLabel
|
|
840
|
-
} = useModuleDictionary();
|
|
674
|
+
const { control, setValue } = useFormContext();
|
|
675
|
+
const { getLabel } = useModuleDictionary();
|
|
841
676
|
const fieldsWatch = useWatch({
|
|
842
677
|
control,
|
|
843
678
|
name: ["statusEdition", "reInits"]
|
|
@@ -850,12 +685,7 @@ function MyActions() {
|
|
|
850
685
|
setValue("statusEdition", "initial");
|
|
851
686
|
}
|
|
852
687
|
};
|
|
853
|
-
return /* @__PURE__ */ jsx(Actions, {
|
|
854
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
855
|
-
onClick: initCancelDraw,
|
|
856
|
-
children: statusEdition === "initial" ? getLabel(MAP_DICCTIONARY.LABEL_MEASURE_START) : getLabel(MAP_DICCTIONARY.LABEL_MEASURE_CANCEL)
|
|
857
|
-
})
|
|
858
|
-
});
|
|
688
|
+
return /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(Button, { onClick: initCancelDraw, children: statusEdition === "initial" ? getLabel(MAP_DICCTIONARY.LABEL_MEASURE_START) : getLabel(MAP_DICCTIONARY.LABEL_MEASURE_CANCEL) }) });
|
|
859
689
|
}
|
|
860
690
|
function MeasureDataValidation(_getLabel) {
|
|
861
691
|
return {};
|
|
@@ -870,25 +700,6 @@ function useValidation() {
|
|
|
870
700
|
);
|
|
871
701
|
return { validationSchema };
|
|
872
702
|
}
|
|
873
|
-
const INITIAL_FORM_VALUES = {
|
|
874
|
-
statusLoad: "ready",
|
|
875
|
-
reInits: 0,
|
|
876
|
-
value: "0",
|
|
877
|
-
measureTypeId: "distance",
|
|
878
|
-
magnitudFactor: { id: "m_kilometers", name: "Kilometers", symbol: "k", factor_x0: 0, factor_x1: 1, factor_x2: 0 },
|
|
879
|
-
unitArea: null,
|
|
880
|
-
statusEdition: "initial"
|
|
881
|
-
};
|
|
882
|
-
const STYLE_MEASURE_OPTIONS = {
|
|
883
|
-
strokeLineColor: "#1E96DC",
|
|
884
|
-
strokeLineWeight: 5,
|
|
885
|
-
markerHeight: 37,
|
|
886
|
-
markerWidth: 26,
|
|
887
|
-
labelMarkerHeight: 0,
|
|
888
|
-
labelMarkerWidth: 0,
|
|
889
|
-
labelMarkerAnchorY: 0,
|
|
890
|
-
labelMarkerAnchorX: 0
|
|
891
|
-
};
|
|
892
703
|
const getMarkerPointIcon = (position) => {
|
|
893
704
|
return L__default.divIcon({
|
|
894
705
|
className: mapClasses.measureMarkerRoot,
|
|
@@ -911,10 +722,15 @@ const getMarkerPointLabel = (distance, getLabel) => {
|
|
|
911
722
|
className: mapClasses.measureLabelMarkerRoot,
|
|
912
723
|
html: `<div class="${mapClasses.measureLabelMarkerContainer}">
|
|
913
724
|
${distance ? `<span class="${mapClasses.measureLabelMarkerDistance}">${distance}</span>` : ""}
|
|
914
|
-
<div class="${mapClasses.measureLabelMarkerRemove}">${getLabel(
|
|
725
|
+
<div class="${mapClasses.measureLabelMarkerRemove}">${getLabel(
|
|
726
|
+
MAP_DICCTIONARY.LABEL_MEASURE_REMOVE_POINT
|
|
727
|
+
)}</div>
|
|
915
728
|
</div>`,
|
|
916
729
|
iconSize: [STYLE_MEASURE_OPTIONS.labelMarkerWidth, STYLE_MEASURE_OPTIONS.labelMarkerHeight],
|
|
917
|
-
iconAnchor: [
|
|
730
|
+
iconAnchor: [
|
|
731
|
+
STYLE_MEASURE_OPTIONS.labelMarkerAnchorX,
|
|
732
|
+
STYLE_MEASURE_OPTIONS.labelMarkerAnchorY
|
|
733
|
+
]
|
|
918
734
|
});
|
|
919
735
|
};
|
|
920
736
|
function useMeasure() {
|
|
@@ -924,17 +740,18 @@ function useMeasure() {
|
|
|
924
740
|
const { control, setValue } = useFormContext();
|
|
925
741
|
const fieldsWatch = useWatch({
|
|
926
742
|
control,
|
|
927
|
-
name: [
|
|
928
|
-
"statusEdition",
|
|
929
|
-
"value",
|
|
930
|
-
"magnitudFactor"
|
|
931
|
-
]
|
|
743
|
+
name: ["statusEdition", "value", "magnitudFactor"]
|
|
932
744
|
});
|
|
933
745
|
const statusEdition = fieldsWatch[0];
|
|
934
746
|
const value = fieldsWatch[1];
|
|
935
747
|
const magnitudFactor = fieldsWatch[2];
|
|
936
748
|
const [magnitudFactorCached, setMagnitudFactorCached] = useState(magnitudFactor);
|
|
937
|
-
const currentMeasure = useRef({
|
|
749
|
+
const currentMeasure = useRef({
|
|
750
|
+
measurePoints: [],
|
|
751
|
+
addMarker: false,
|
|
752
|
+
magnitudFactor,
|
|
753
|
+
dragging: false
|
|
754
|
+
});
|
|
938
755
|
const clearMeasure = useCallback(() => {
|
|
939
756
|
currentMeasure.current.measurePoints.forEach((measurePoint) => {
|
|
940
757
|
measurePoint.marker.remove();
|
|
@@ -943,22 +760,27 @@ function useMeasure() {
|
|
|
943
760
|
currentMeasure.current.measurePoints = [];
|
|
944
761
|
setValue("value", measureDistante());
|
|
945
762
|
}, []);
|
|
946
|
-
const getFormatFactorDistance = useCallback(
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
763
|
+
const getFormatFactorDistance = useCallback(
|
|
764
|
+
(distance, withSymbol = false) => {
|
|
765
|
+
if (distance === void 0) {
|
|
766
|
+
return void 0;
|
|
767
|
+
}
|
|
768
|
+
const cMagnitudeFactor = currentMeasure.current.magnitudFactor;
|
|
769
|
+
return (cMagnitudeFactor.factor_x0 + distance * cMagnitudeFactor.factor_x1 + (distance ^ 2 * cMagnitudeFactor.factor_x2)).toFixed(2) + (withSymbol ? ` ${cMagnitudeFactor.symbol}` : "");
|
|
770
|
+
},
|
|
771
|
+
[]
|
|
772
|
+
);
|
|
953
773
|
const measureDistante = useCallback(() => {
|
|
954
|
-
|
|
774
|
+
let totalDistance = 0;
|
|
955
775
|
const measurePoints = currentMeasure.current.measurePoints;
|
|
956
776
|
if (currentMeasure.current.layerLine) {
|
|
957
777
|
if (measurePoints.length < 2) {
|
|
958
778
|
currentMeasure.current.layerLine.remove();
|
|
959
779
|
currentMeasure.current.layerLine = void 0;
|
|
960
780
|
} else {
|
|
961
|
-
currentMeasure.current.layerLine.setLatLngs(
|
|
781
|
+
currentMeasure.current.layerLine.setLatLngs(
|
|
782
|
+
measurePoints.map((measurePoint) => measurePoint.marker.getLatLng())
|
|
783
|
+
);
|
|
962
784
|
}
|
|
963
785
|
} else {
|
|
964
786
|
if (measurePoints.length > 1) {
|
|
@@ -981,10 +803,15 @@ function useMeasure() {
|
|
|
981
803
|
addClickListenerForRemove(measurePoints[0].labelMarker);
|
|
982
804
|
}
|
|
983
805
|
for (let i = 1; i < measurePoints.length; i++) {
|
|
984
|
-
const formatDistanceFromPrevious = getFormatFactorDistance(
|
|
806
|
+
const formatDistanceFromPrevious = getFormatFactorDistance(
|
|
807
|
+
measurePoints[i - 1].marker.getLatLng().distanceTo(measurePoints[i].marker.getLatLng()),
|
|
808
|
+
true
|
|
809
|
+
);
|
|
985
810
|
if (measurePoints[i].formatDistanceFromPrevious !== formatDistanceFromPrevious) {
|
|
986
811
|
measurePoints[i].formatDistanceFromPrevious = formatDistanceFromPrevious;
|
|
987
|
-
measurePoints[i].labelMarker.setIcon(
|
|
812
|
+
measurePoints[i].labelMarker.setIcon(
|
|
813
|
+
getMarkerPointLabelMemo(formatDistanceFromPrevious, getLabel)
|
|
814
|
+
);
|
|
988
815
|
addClickListenerForRemove(measurePoints[i].labelMarker);
|
|
989
816
|
}
|
|
990
817
|
}
|
|
@@ -996,96 +823,103 @@ function useMeasure() {
|
|
|
996
823
|
return (e) => {
|
|
997
824
|
e.stopPropagation();
|
|
998
825
|
if (!currentMeasure.current.dragging) {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
826
|
+
const markIndex = currentMeasure.current.measurePoints.findIndex(
|
|
827
|
+
(searchElement) => {
|
|
828
|
+
return searchElement.labelMarker === labelMarker;
|
|
829
|
+
}
|
|
830
|
+
);
|
|
1002
831
|
if (markIndex !== -1) {
|
|
1003
|
-
|
|
832
|
+
const measurePoint = currentMeasure.current.measurePoints[markIndex];
|
|
1004
833
|
measurePoint.marker.remove();
|
|
1005
834
|
measurePoint.labelMarker.remove();
|
|
1006
835
|
currentMeasure.current.measurePoints.splice(markIndex, 1);
|
|
1007
836
|
setValue("value", measureDistante());
|
|
1008
837
|
currentMeasure.current.addMarker = true;
|
|
1009
838
|
}
|
|
1010
|
-
currentMeasure.current.measurePoints.forEach((
|
|
1011
|
-
|
|
839
|
+
currentMeasure.current.measurePoints.forEach((measurePoint, index) => {
|
|
840
|
+
measurePoint.marker.setIcon(getMarkerPointIconMemo(index + 1));
|
|
1012
841
|
});
|
|
1013
842
|
}
|
|
1014
843
|
};
|
|
1015
844
|
}, []);
|
|
1016
845
|
const addClickListenerForRemove = useCallback((labelMarker) => {
|
|
1017
|
-
|
|
846
|
+
let element = labelMarker.getElement();
|
|
1018
847
|
if (element) {
|
|
1019
|
-
|
|
848
|
+
const elements = element.getElementsByClassName(
|
|
849
|
+
mapClasses.measureLabelMarkerRemove
|
|
850
|
+
);
|
|
1020
851
|
element = elements[0];
|
|
1021
|
-
console.log("addClickListenerForRemove event", element);
|
|
1022
852
|
if (element) {
|
|
1023
853
|
element.addEventListener("click", onClickRemovePoint(labelMarker));
|
|
1024
854
|
}
|
|
1025
855
|
}
|
|
1026
856
|
}, []);
|
|
1027
|
-
const onClickMap = useCallback(
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
857
|
+
const onClickMap = useCallback(
|
|
858
|
+
(e) => {
|
|
859
|
+
const lat = e.latlng.lat;
|
|
860
|
+
const lng = e.latlng.lng;
|
|
861
|
+
let formatDistanceFromPrevious = void 0;
|
|
862
|
+
if (currentMeasure.current.addMarker === false) {
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
if (currentMeasure.current.measurePoints.length > 0) {
|
|
866
|
+
formatDistanceFromPrevious = getFormatFactorDistance(
|
|
867
|
+
currentMeasure.current.measurePoints[currentMeasure.current.measurePoints.length - 1].marker.getLatLng().distanceTo(e.latlng)
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
const marker = L.marker([lat, lng], {
|
|
871
|
+
draggable: true,
|
|
872
|
+
riseOnHover: true,
|
|
873
|
+
autoPan: true,
|
|
874
|
+
icon: getMarkerPointIconMemo(currentMeasure.current.measurePoints.length + 1),
|
|
875
|
+
zIndexOffset: MAP_ZINDEX_DEFAULT
|
|
876
|
+
}).addTo(map);
|
|
877
|
+
marker.on("moveend", function(_e) {
|
|
878
|
+
const latlng = marker.getLatLng();
|
|
879
|
+
labelMarker.setLatLng(latlng);
|
|
880
|
+
setValue("value", measureDistante());
|
|
881
|
+
});
|
|
882
|
+
marker.on("mouseover", function() {
|
|
883
|
+
currentMeasure.current.addMarker = false;
|
|
884
|
+
});
|
|
885
|
+
marker.on("mouseout", function() {
|
|
886
|
+
currentMeasure.current.addMarker = true;
|
|
887
|
+
});
|
|
888
|
+
var labelMarker = L.marker([lat, lng], {
|
|
889
|
+
draggable: true,
|
|
890
|
+
riseOnHover: true,
|
|
891
|
+
icon: getMarkerPointLabelMemo(formatDistanceFromPrevious, getLabel),
|
|
892
|
+
zIndexOffset: MAP_ZINDEX_DEFAULT
|
|
893
|
+
}).addTo(map);
|
|
894
|
+
labelMarker.on("moveend", function(_e) {
|
|
895
|
+
const latlng = labelMarker.getLatLng();
|
|
896
|
+
marker.setLatLng(latlng);
|
|
897
|
+
setValue("value", measureDistante());
|
|
898
|
+
});
|
|
899
|
+
labelMarker.on("mouseover", function(_e) {
|
|
900
|
+
currentMeasure.current.addMarker = false;
|
|
901
|
+
});
|
|
902
|
+
labelMarker.on("mouseout", function(_e) {
|
|
903
|
+
currentMeasure.current.addMarker = true;
|
|
904
|
+
});
|
|
905
|
+
labelMarker.on("dragstart", function(_e) {
|
|
906
|
+
currentMeasure.current.dragging = true;
|
|
907
|
+
});
|
|
908
|
+
labelMarker.on("dragend", function(_e) {
|
|
909
|
+
setTimeout(function() {
|
|
910
|
+
currentMeasure.current.dragging = false;
|
|
911
|
+
}, 10);
|
|
912
|
+
});
|
|
913
|
+
addClickListenerForRemove(labelMarker);
|
|
914
|
+
currentMeasure.current.measurePoints.push({
|
|
915
|
+
marker,
|
|
916
|
+
labelMarker,
|
|
917
|
+
formatDistanceFromPrevious
|
|
918
|
+
});
|
|
1065
919
|
setValue("value", measureDistante());
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
});
|
|
1070
|
-
labelMarker.on("mouseout", function(_e) {
|
|
1071
|
-
currentMeasure.current.addMarker = true;
|
|
1072
|
-
});
|
|
1073
|
-
labelMarker.on("dragstart", function(_e) {
|
|
1074
|
-
currentMeasure.current.dragging = true;
|
|
1075
|
-
});
|
|
1076
|
-
labelMarker.on("dragend", function(_e) {
|
|
1077
|
-
setTimeout(function() {
|
|
1078
|
-
currentMeasure.current.dragging = false;
|
|
1079
|
-
}, 10);
|
|
1080
|
-
});
|
|
1081
|
-
addClickListenerForRemove(labelMarker);
|
|
1082
|
-
currentMeasure.current.measurePoints.push({
|
|
1083
|
-
marker,
|
|
1084
|
-
labelMarker,
|
|
1085
|
-
formatDistanceFromPrevious
|
|
1086
|
-
});
|
|
1087
|
-
setValue("value", measureDistante());
|
|
1088
|
-
}, [map, measureDistante, setValue, getLabel]);
|
|
920
|
+
},
|
|
921
|
+
[map, measureDistante, setValue, getLabel]
|
|
922
|
+
);
|
|
1089
923
|
const onMouseMoveMap = useCallback(() => {
|
|
1090
924
|
map.getContainer().style.cursor = "crosshair";
|
|
1091
925
|
}, [map]);
|
|
@@ -1107,11 +941,9 @@ function useMeasure() {
|
|
|
1107
941
|
}
|
|
1108
942
|
}, [map, statusEdition]);
|
|
1109
943
|
useEffect(() => {
|
|
1110
|
-
console.log("useEffect magnitudFactor", readyToUpdate, magnitudFactor);
|
|
1111
944
|
if (!readyToUpdate)
|
|
1112
945
|
return;
|
|
1113
946
|
if (magnitudFactor.id !== magnitudFactorCached.id) {
|
|
1114
|
-
console.log("useEffect magnitudFactor CAMBIO");
|
|
1115
947
|
setMagnitudFactorCached({ ...magnitudFactor });
|
|
1116
948
|
currentMeasure.current.magnitudFactor = magnitudFactor;
|
|
1117
949
|
setValue("value", measureDistante());
|
|
@@ -1129,69 +961,58 @@ function useMeasure() {
|
|
|
1129
961
|
return { statusEdition, magnitudFactor, value };
|
|
1130
962
|
}
|
|
1131
963
|
function MeasureData() {
|
|
1132
|
-
const {
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
1153
|
-
className: mapClasses.measureToolFormValueDistance,
|
|
1154
|
-
children: value
|
|
1155
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
1156
|
-
className: mapClasses.measureToolFormValueSymbol,
|
|
1157
|
-
children: magnitudFactor.symbol
|
|
1158
|
-
})]
|
|
1159
|
-
})]
|
|
1160
|
-
});
|
|
964
|
+
const { getLabel } = useModuleDictionary();
|
|
965
|
+
const { value, magnitudFactor } = useMeasure();
|
|
966
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
967
|
+
/* @__PURE__ */ jsx(
|
|
968
|
+
RHFAutocompleteAsync,
|
|
969
|
+
{
|
|
970
|
+
endPoint: "magnitudes/factors?origin_unit_reference_id=m_kilometers",
|
|
971
|
+
name: "magnitudFactor",
|
|
972
|
+
autoComplete: "off",
|
|
973
|
+
getOptionLabel: (option) => option.name,
|
|
974
|
+
isOptionEqualToValue: (option, measureItemValue) => option.id === measureItemValue.id,
|
|
975
|
+
label: getLabel(MAP_DICCTIONARY.LABEL_MEASURE_UNIT),
|
|
976
|
+
isRemote: false
|
|
977
|
+
}
|
|
978
|
+
),
|
|
979
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 2, className: mapClasses.measureToolFormValue, children: [
|
|
980
|
+
/* @__PURE__ */ jsx("span", { className: mapClasses.measureToolFormValueDistance, children: value }),
|
|
981
|
+
/* @__PURE__ */ jsx("span", { className: mapClasses.measureToolFormValueSymbol, children: magnitudFactor.symbol })
|
|
982
|
+
] })
|
|
983
|
+
] });
|
|
1161
984
|
}
|
|
1162
985
|
function MeasureTool() {
|
|
1163
|
-
const {
|
|
1164
|
-
getLabel
|
|
1165
|
-
} = useModuleDictionary();
|
|
986
|
+
const { getLabel } = useModuleDictionary();
|
|
1166
987
|
const finalInitalValues = {
|
|
1167
988
|
...INITIAL_FORM_VALUES
|
|
1168
989
|
};
|
|
1169
990
|
if (finalInitalValues?.magnitudFactor?.name) {
|
|
1170
|
-
finalInitalValues.magnitudFactor.name = getLabel(
|
|
991
|
+
finalInitalValues.magnitudFactor.name = getLabel(
|
|
992
|
+
MAP_DICCTIONARY.LABEL_MEASURE_UNIT_BASE_KILOMETERS
|
|
993
|
+
);
|
|
1171
994
|
}
|
|
1172
|
-
const {
|
|
1173
|
-
validationSchema
|
|
1174
|
-
} = useValidation();
|
|
995
|
+
const { validationSchema } = useValidation();
|
|
1175
996
|
const onSubmit = () => {
|
|
1176
997
|
};
|
|
1177
|
-
return /* @__PURE__ */ jsxs(
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
children:
|
|
1186
|
-
|
|
1187
|
-
|
|
998
|
+
return /* @__PURE__ */ jsxs(
|
|
999
|
+
RHFormProvider,
|
|
1000
|
+
{
|
|
1001
|
+
className: mapClasses.meaureToolRoot,
|
|
1002
|
+
statusLoad: INITIAL_FORM_VALUES.statusLoad,
|
|
1003
|
+
onSubmit,
|
|
1004
|
+
values: finalInitalValues,
|
|
1005
|
+
validationSchema,
|
|
1006
|
+
children: [
|
|
1007
|
+
/* @__PURE__ */ jsx(Stack, { direction: "column", children: /* @__PURE__ */ jsx(MeasureData, {}) }),
|
|
1008
|
+
/* @__PURE__ */ jsx(MyActions, {})
|
|
1009
|
+
]
|
|
1010
|
+
}
|
|
1011
|
+
);
|
|
1188
1012
|
}
|
|
1189
1013
|
function ZoomButtons() {
|
|
1190
1014
|
const map = useMap();
|
|
1191
|
-
const {
|
|
1192
|
-
host_static_assets,
|
|
1193
|
-
environment_assets
|
|
1194
|
-
} = useEnvironment();
|
|
1015
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1195
1016
|
const [, setZoomInDisabled] = useState(false);
|
|
1196
1017
|
const [, setZoomOutDisabled] = useState(false);
|
|
1197
1018
|
useEffect(() => {
|
|
@@ -1214,35 +1035,34 @@ function ZoomButtons() {
|
|
|
1214
1035
|
const handleZoomOut = () => {
|
|
1215
1036
|
map.zoomOut();
|
|
1216
1037
|
};
|
|
1217
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1038
|
+
return /* @__PURE__ */ jsxs("div", { className: mapClasses.zoomButtons, children: [
|
|
1039
|
+
/* @__PURE__ */ jsx(
|
|
1040
|
+
IconButton,
|
|
1041
|
+
{
|
|
1042
|
+
onClick: handleZoomIn,
|
|
1043
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_ZOOM_IN}`
|
|
1044
|
+
}
|
|
1045
|
+
),
|
|
1046
|
+
/* @__PURE__ */ jsx(
|
|
1047
|
+
IconButton,
|
|
1048
|
+
{
|
|
1049
|
+
onClick: handleZoomOut,
|
|
1050
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_ZOOM_OUT}`
|
|
1051
|
+
}
|
|
1052
|
+
)
|
|
1053
|
+
] });
|
|
1227
1054
|
}
|
|
1228
1055
|
function TopRightTools(props) {
|
|
1229
|
-
const {
|
|
1230
|
-
|
|
1231
|
-
} =
|
|
1232
|
-
const {
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
} = useEnvironment();
|
|
1240
|
-
const {
|
|
1241
|
-
getLabel
|
|
1242
|
-
} = useModuleDictionary();
|
|
1243
|
-
const openPopupsIds = usePopupsStore((state) => state.popupsIds.filter((pId) => {
|
|
1244
|
-
return state.hashPopups[pId].status === "init";
|
|
1245
|
-
}), shallow);
|
|
1056
|
+
const { gpsTools } = props;
|
|
1057
|
+
const { addPopup, closePopup } = usePopupsStore((state) => state.popupsActions);
|
|
1058
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1059
|
+
const { getLabel } = useModuleDictionary();
|
|
1060
|
+
const openPopupsIds = usePopupsStore(
|
|
1061
|
+
(state) => state.popupsIds.filter((pId) => {
|
|
1062
|
+
return state.hashPopups[pId].status === "init";
|
|
1063
|
+
}),
|
|
1064
|
+
shallow
|
|
1065
|
+
);
|
|
1246
1066
|
const popupsIds = usePopupsStore((state) => state.popupsIds, shallow);
|
|
1247
1067
|
const map = useMap();
|
|
1248
1068
|
const isToggledGpsTools = openPopupsIds.indexOf("gpsTools") > -1;
|
|
@@ -1261,16 +1081,17 @@ function TopRightTools(props) {
|
|
|
1261
1081
|
};
|
|
1262
1082
|
const onGpsToolsClick = (e) => {
|
|
1263
1083
|
if (!isToggledGpsTools) {
|
|
1264
|
-
addPopup(
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1084
|
+
addPopup(
|
|
1085
|
+
{
|
|
1086
|
+
popupId: "gpsTools",
|
|
1087
|
+
title: getLabel(MAP_DICCTIONARY.LABEL_GPSTOOLS_NAME),
|
|
1088
|
+
iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_GPS_TOOLS_TOOL}`,
|
|
1089
|
+
functionComponent: gpsTools,
|
|
1090
|
+
onMouseDown,
|
|
1091
|
+
defaultPosition: GPS_TOOLS_POPUP_DEFAULT_POSITION
|
|
1092
|
+
},
|
|
1093
|
+
{ closeOthers: true }
|
|
1094
|
+
);
|
|
1274
1095
|
} else {
|
|
1275
1096
|
closePopup("gpsTools");
|
|
1276
1097
|
}
|
|
@@ -1278,37 +1099,43 @@ function TopRightTools(props) {
|
|
|
1278
1099
|
};
|
|
1279
1100
|
const onMeasureToolClick = (e) => {
|
|
1280
1101
|
if (!isToggledMeasureTool) {
|
|
1281
|
-
addPopup(
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1102
|
+
addPopup(
|
|
1103
|
+
{
|
|
1104
|
+
popupId: "measureTool",
|
|
1105
|
+
iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_MEASURE_TOOL}`,
|
|
1106
|
+
title: "Measure Tool",
|
|
1107
|
+
functionComponent: MeasureTool,
|
|
1108
|
+
onMouseDown,
|
|
1109
|
+
defaultPosition: MESURE_POPUP_DEFAULT_POSITION
|
|
1110
|
+
},
|
|
1111
|
+
{ closeOthers: true }
|
|
1112
|
+
);
|
|
1291
1113
|
} else {
|
|
1292
1114
|
closePopup("measureTool");
|
|
1293
1115
|
}
|
|
1294
1116
|
e.stopPropagation();
|
|
1295
1117
|
};
|
|
1296
|
-
return /* @__PURE__ */ jsxs(Control, {
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1118
|
+
return /* @__PURE__ */ jsxs(Control, { position: "topright", prepend: true, className: mapClasses.topRigthToolsRoot, children: [
|
|
1119
|
+
/* @__PURE__ */ jsx(
|
|
1120
|
+
ToggleIconButton,
|
|
1121
|
+
{
|
|
1122
|
+
isToggled: isToggledGpsTools,
|
|
1123
|
+
disabled: isDisabledGpsTools,
|
|
1124
|
+
onToggle: onGpsToolsClick,
|
|
1125
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_GPS_TOOLS_TOOL}`
|
|
1126
|
+
}
|
|
1127
|
+
),
|
|
1128
|
+
/* @__PURE__ */ jsx(
|
|
1129
|
+
ToggleIconButton,
|
|
1130
|
+
{
|
|
1131
|
+
isToggled: isToggledMeasureTool,
|
|
1132
|
+
disabled: isDisabledMeasureTool,
|
|
1133
|
+
onToggle: onMeasureToolClick,
|
|
1134
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_MEASURE_TOOL}`
|
|
1135
|
+
}
|
|
1136
|
+
),
|
|
1137
|
+
/* @__PURE__ */ jsx(ZoomButtons, {})
|
|
1138
|
+
] });
|
|
1312
1139
|
}
|
|
1313
1140
|
function useColumns(props) {
|
|
1314
1141
|
const {
|
|
@@ -1320,138 +1147,143 @@ function useColumns(props) {
|
|
|
1320
1147
|
clusterLayers,
|
|
1321
1148
|
setClusterLayers
|
|
1322
1149
|
} = props;
|
|
1323
|
-
const {
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
return [autoFocusLayers, setAutoFocusLayers];
|
|
1335
|
-
} else {
|
|
1336
|
-
return [clusterLayers, setClusterLayers];
|
|
1337
|
-
}
|
|
1338
|
-
}, [visibleLayers, autoFocusLayers, clusterLayers]);
|
|
1339
|
-
const columns = useMemo(() => [
|
|
1340
|
-
{
|
|
1341
|
-
key: "name",
|
|
1342
|
-
name: getLabel(MAP_DICCTIONARY.LABEL_NAME),
|
|
1343
|
-
type: "string",
|
|
1344
|
-
width: 150,
|
|
1345
|
-
frozen: true
|
|
1346
|
-
},
|
|
1347
|
-
{
|
|
1348
|
-
key: "visible",
|
|
1349
|
-
name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_VISIBLE),
|
|
1350
|
-
width: 50,
|
|
1351
|
-
minWidth: 20,
|
|
1352
|
-
type: "boolean",
|
|
1353
|
-
formatter: ColumnSetCheckFormatter({
|
|
1354
|
-
field: "visible",
|
|
1355
|
-
rowKeyGetter,
|
|
1356
|
-
useHook
|
|
1357
|
-
}),
|
|
1358
|
-
cellClass: "rdg-cell-align-center",
|
|
1359
|
-
headerRenderer: (p) => /* @__PURE__ */ jsx(Tooltip, {
|
|
1360
|
-
title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_VISIBLE),
|
|
1361
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
1362
|
-
size: "medium",
|
|
1363
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_VISIBLE}`
|
|
1364
|
-
})
|
|
1365
|
-
})
|
|
1366
|
-
},
|
|
1367
|
-
{
|
|
1368
|
-
key: "autoFocus",
|
|
1369
|
-
name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_AUTOFOCUS),
|
|
1370
|
-
minWidth: 20,
|
|
1371
|
-
width: 50,
|
|
1372
|
-
type: "boolean",
|
|
1373
|
-
formatter: ColumnSetCheckFormatter({
|
|
1374
|
-
field: "autoFocus",
|
|
1375
|
-
rowKeyGetter,
|
|
1376
|
-
useHook
|
|
1377
|
-
}),
|
|
1378
|
-
cellClass: "rdg-cell-align-center",
|
|
1379
|
-
headerRenderer: (p) => /* @__PURE__ */ jsx(Tooltip, {
|
|
1380
|
-
title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_AUTOFOCUS),
|
|
1381
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
1382
|
-
size: "medium",
|
|
1383
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_AUTOFOCUS}`
|
|
1384
|
-
})
|
|
1385
|
-
})
|
|
1150
|
+
const { getLabel } = useModuleDictionary();
|
|
1151
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1152
|
+
const useHook = useCallback(
|
|
1153
|
+
(field) => {
|
|
1154
|
+
if (field === "visible") {
|
|
1155
|
+
return [visibleLayers, setVisibleLayers];
|
|
1156
|
+
} else if (field === "autoFocus") {
|
|
1157
|
+
return [autoFocusLayers, setAutoFocusLayers];
|
|
1158
|
+
} else {
|
|
1159
|
+
return [clusterLayers, setClusterLayers];
|
|
1160
|
+
}
|
|
1386
1161
|
},
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1162
|
+
[visibleLayers, autoFocusLayers, clusterLayers]
|
|
1163
|
+
);
|
|
1164
|
+
const columns = useMemo(
|
|
1165
|
+
() => [
|
|
1166
|
+
{
|
|
1167
|
+
key: "name",
|
|
1168
|
+
name: getLabel(MAP_DICCTIONARY.LABEL_NAME),
|
|
1169
|
+
type: "string",
|
|
1170
|
+
width: 150,
|
|
1171
|
+
frozen: true
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
key: "visible",
|
|
1175
|
+
name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_VISIBLE),
|
|
1176
|
+
width: 50,
|
|
1177
|
+
minWidth: 20,
|
|
1178
|
+
type: "boolean",
|
|
1179
|
+
formatter: ColumnSetCheckFormatter({
|
|
1180
|
+
field: "visible",
|
|
1181
|
+
rowKeyGetter,
|
|
1182
|
+
useHook
|
|
1183
|
+
}),
|
|
1184
|
+
cellClass: "rdg-cell-align-center",
|
|
1185
|
+
headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_VISIBLE), children: /* @__PURE__ */ jsx(
|
|
1186
|
+
Icon,
|
|
1187
|
+
{
|
|
1188
|
+
size: "medium",
|
|
1189
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_VISIBLE}`
|
|
1190
|
+
}
|
|
1191
|
+
) })
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
key: "autoFocus",
|
|
1195
|
+
name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_AUTOFOCUS),
|
|
1196
|
+
minWidth: 20,
|
|
1197
|
+
width: 50,
|
|
1198
|
+
type: "boolean",
|
|
1199
|
+
formatter: ColumnSetCheckFormatter({
|
|
1200
|
+
field: "autoFocus",
|
|
1201
|
+
rowKeyGetter,
|
|
1202
|
+
useHook
|
|
1203
|
+
}),
|
|
1204
|
+
cellClass: "rdg-cell-align-center",
|
|
1205
|
+
headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_AUTOFOCUS), children: /* @__PURE__ */ jsx(
|
|
1206
|
+
Icon,
|
|
1207
|
+
{
|
|
1208
|
+
size: "medium",
|
|
1209
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_AUTOFOCUS}`
|
|
1210
|
+
}
|
|
1211
|
+
) })
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
key: "cluster",
|
|
1215
|
+
name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_CLUSTER),
|
|
1216
|
+
minWidth: 20,
|
|
1217
|
+
width: 50,
|
|
1218
|
+
type: "boolean",
|
|
1219
|
+
formatter: ColumnSetCheckFormatter({
|
|
1220
|
+
field: "cluster",
|
|
1221
|
+
disabledGetter: (row) => !row.clusterAble,
|
|
1222
|
+
rowKeyGetter,
|
|
1223
|
+
useHook
|
|
1224
|
+
}),
|
|
1225
|
+
cellClass: "rdg-cell-align-center",
|
|
1226
|
+
headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_CLUSTER), children: /* @__PURE__ */ jsx(
|
|
1227
|
+
Icon,
|
|
1228
|
+
{
|
|
1229
|
+
size: "medium",
|
|
1230
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_CLUSTER}`
|
|
1231
|
+
}
|
|
1232
|
+
) })
|
|
1233
|
+
}
|
|
1234
|
+
],
|
|
1235
|
+
[getLabel, useHook]
|
|
1236
|
+
);
|
|
1237
|
+
return { columns };
|
|
1412
1238
|
}
|
|
1413
1239
|
function useCheckedLayers(checkedNameSet) {
|
|
1414
|
-
const [checkedLayers, setCheckedLayers] = useMapStore(
|
|
1415
|
-
state
|
|
1416
|
-
|
|
1240
|
+
const [checkedLayers, setCheckedLayers] = useMapStore(
|
|
1241
|
+
(state) => [
|
|
1242
|
+
state[`${checkedNameSet}CheckedLayers`],
|
|
1243
|
+
(newSet) => {
|
|
1244
|
+
state.mapActions.setCheckedLayers(checkedNameSet, newSet);
|
|
1245
|
+
}
|
|
1246
|
+
],
|
|
1247
|
+
shallow
|
|
1248
|
+
);
|
|
1417
1249
|
return [checkedLayers, setCheckedLayers];
|
|
1418
1250
|
}
|
|
1419
1251
|
function useRowActionsGetter() {
|
|
1420
|
-
const {
|
|
1421
|
-
|
|
1422
|
-
} =
|
|
1423
|
-
const {
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
return {
|
|
1450
|
-
rowActionsGetter
|
|
1451
|
-
};
|
|
1252
|
+
const { getLabel } = useModuleDictionary();
|
|
1253
|
+
const { hasPrivilege } = useModulePrivileges();
|
|
1254
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1255
|
+
const { removeLayer } = useMapStore((state) => state.mapActions, shallow);
|
|
1256
|
+
const [urlIconDelete] = useState(
|
|
1257
|
+
`${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_DELETE}`
|
|
1258
|
+
);
|
|
1259
|
+
const onDelete = useCallback(
|
|
1260
|
+
(row) => {
|
|
1261
|
+
removeLayer(row.id);
|
|
1262
|
+
},
|
|
1263
|
+
[getLabel]
|
|
1264
|
+
);
|
|
1265
|
+
const rowActionsGetter = useCallback(
|
|
1266
|
+
(row) => {
|
|
1267
|
+
const conditionalItems = [];
|
|
1268
|
+
conditionalItems.push({
|
|
1269
|
+
urlIcon: urlIconDelete,
|
|
1270
|
+
dictionaryId: MAP_DICCTIONARY.ROW_ACTION_LAYER_DELETE,
|
|
1271
|
+
onClick: () => {
|
|
1272
|
+
onDelete(row);
|
|
1273
|
+
},
|
|
1274
|
+
disabled: !row.deleteAble
|
|
1275
|
+
});
|
|
1276
|
+
return conditionalItems;
|
|
1277
|
+
},
|
|
1278
|
+
[hasPrivilege, onDelete, urlIconDelete]
|
|
1279
|
+
);
|
|
1280
|
+
return { rowActionsGetter };
|
|
1452
1281
|
}
|
|
1453
1282
|
function useMaster() {
|
|
1454
|
-
const [hashLayers, layersIds] = useMapStore(
|
|
1283
|
+
const [hashLayers, layersIds] = useMapStore(
|
|
1284
|
+
(state) => [state.hashLayers, state.layersIds],
|
|
1285
|
+
shallow
|
|
1286
|
+
);
|
|
1455
1287
|
const rowKeyGetter = useCallback((row) => row.id, []);
|
|
1456
1288
|
const [visibleLayers, setVisibleLayers] = useCheckedLayers("visible");
|
|
1457
1289
|
const [autoFocusLayers, setAutoFocusLayers] = useCheckedLayers("autoFocus");
|
|
@@ -1471,12 +1303,8 @@ function useMaster() {
|
|
|
1471
1303
|
});
|
|
1472
1304
|
return rows2;
|
|
1473
1305
|
}, [hashLayers, layersIds]);
|
|
1474
|
-
const {
|
|
1475
|
-
|
|
1476
|
-
} = useRowActionsGetter();
|
|
1477
|
-
const {
|
|
1478
|
-
columns
|
|
1479
|
-
} = useColumns({
|
|
1306
|
+
const { rowActionsGetter } = useRowActionsGetter();
|
|
1307
|
+
const { columns } = useColumns({
|
|
1480
1308
|
rowKeyGetter,
|
|
1481
1309
|
visibleLayers,
|
|
1482
1310
|
setVisibleLayers,
|
|
@@ -1500,33 +1328,22 @@ function useDisableZoomEvents(node) {
|
|
|
1500
1328
|
if (!map || !node)
|
|
1501
1329
|
return;
|
|
1502
1330
|
node.addEventListener("mouseover", function() {
|
|
1503
|
-
console.log("Desactivar zoom");
|
|
1504
1331
|
map.doubleClickZoom.disable();
|
|
1505
1332
|
map.scrollWheelZoom.disable();
|
|
1506
1333
|
});
|
|
1507
1334
|
node.addEventListener("mouseleave", function() {
|
|
1508
|
-
console.log("Activar zoom");
|
|
1509
1335
|
map.scrollWheelZoom.enable();
|
|
1510
1336
|
map.doubleClickZoom.enable();
|
|
1511
1337
|
});
|
|
1512
1338
|
}, [map, node]);
|
|
1513
1339
|
}
|
|
1514
1340
|
function LayersTool() {
|
|
1515
|
-
const {
|
|
1516
|
-
columns,
|
|
1517
|
-
rows,
|
|
1518
|
-
rowKeyGetter,
|
|
1519
|
-
rowActionsGetter
|
|
1520
|
-
} = useMaster();
|
|
1341
|
+
const { columns, rows, rowKeyGetter, rowActionsGetter } = useMaster();
|
|
1521
1342
|
const [divRef, setDivRef] = useStateRef(null);
|
|
1522
1343
|
useDisableZoomEvents(divRef);
|
|
1523
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
position: "relative",
|
|
1527
|
-
height: "100%"
|
|
1528
|
-
},
|
|
1529
|
-
children: /* @__PURE__ */ jsx(DataGrid, {
|
|
1344
|
+
return /* @__PURE__ */ jsx("div", { ref: setDivRef, style: { position: "relative", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
1345
|
+
DataGrid,
|
|
1346
|
+
{
|
|
1530
1347
|
id: "layers",
|
|
1531
1348
|
columns,
|
|
1532
1349
|
rows,
|
|
@@ -1539,17 +1356,12 @@ function LayersTool() {
|
|
|
1539
1356
|
withPager: false,
|
|
1540
1357
|
withLocalFilters: false
|
|
1541
1358
|
}
|
|
1542
|
-
}
|
|
1543
|
-
});
|
|
1359
|
+
}
|
|
1360
|
+
) });
|
|
1544
1361
|
}
|
|
1545
1362
|
function MapSourcesTool() {
|
|
1546
|
-
const {
|
|
1547
|
-
|
|
1548
|
-
} = useModuleDictionary();
|
|
1549
|
-
const {
|
|
1550
|
-
host_static_assets,
|
|
1551
|
-
environment_assets
|
|
1552
|
-
} = useEnvironment();
|
|
1363
|
+
const { getLabel } = useModuleDictionary();
|
|
1364
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1553
1365
|
const currentMapSourceId = useMapStore((state) => state.currentMapSourceId, shallow);
|
|
1554
1366
|
const mapSources = useMapStore((state) => {
|
|
1555
1367
|
return state.mapSourcesIds.map((id) => ({
|
|
@@ -1562,144 +1374,157 @@ function MapSourcesTool() {
|
|
|
1562
1374
|
roadSeletedOptions: state.hashMapSources[id].roadSelectedOptions
|
|
1563
1375
|
}));
|
|
1564
1376
|
}, shallow);
|
|
1565
|
-
const {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1377
|
+
const { setCurrentMapSource, setMapSourceRoadOptions: setMapSourceRoadMapOptions } = useMapStore(
|
|
1378
|
+
(state) => state.mapActions,
|
|
1379
|
+
shallow
|
|
1380
|
+
);
|
|
1569
1381
|
const [divRef, setDivRef] = useStateRef(null);
|
|
1570
1382
|
useDisableZoomEvents(divRef);
|
|
1571
1383
|
const handleChange = (event) => {
|
|
1572
1384
|
setCurrentMapSource(event.target.value);
|
|
1573
1385
|
};
|
|
1574
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
children: [/* @__PURE__ */ jsx(FormControlLabel, {
|
|
1386
|
+
return /* @__PURE__ */ jsx("div", { className: mapClasses.mapSourcesRoot, ref: setDivRef, children: /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
1387
|
+
RadioGroup,
|
|
1388
|
+
{
|
|
1389
|
+
"aria-labelledby": "demo-controlled-radio-buttons-group",
|
|
1390
|
+
name: "controlled-radio-buttons-group",
|
|
1391
|
+
value: currentMapSourceId,
|
|
1392
|
+
onChange: handleChange,
|
|
1393
|
+
children: mapSources.map((mapSourceOption) => /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOption, children: [
|
|
1394
|
+
/* @__PURE__ */ jsx(
|
|
1395
|
+
FormControlLabel,
|
|
1396
|
+
{
|
|
1586
1397
|
className: "",
|
|
1587
1398
|
value: mapSourceOption.id,
|
|
1588
1399
|
control: /* @__PURE__ */ jsx(Radio, {}),
|
|
1589
|
-
label: /* @__PURE__ */ jsxs("div", {
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
children: getLabel(mapSourceOption.dictionaryId)
|
|
1595
|
-
})]
|
|
1596
|
-
})
|
|
1597
|
-
}), (mapSourceOption.hasBicyclingLayer || mapSourceOption.hasTrafficLayer || mapSourceOption.hasTransitLayer) && /* @__PURE__ */ jsxs("div", {
|
|
1598
|
-
className: clsx(mapClasses.mapSourcesOptionRoadOptions, currentMapSourceId !== mapSourceOption.id ? mapClasses.disabled : mapClasses.active),
|
|
1599
|
-
children: [mapSourceOption.hasTrafficLayer && /* @__PURE__ */ jsxs("div", {
|
|
1600
|
-
className: mapClasses.mapSourcesOptionRoadOptionsCheck,
|
|
1601
|
-
children: [/* @__PURE__ */ jsx(CheckBox, {
|
|
1602
|
-
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
1603
|
-
checked: mapSourceOption.roadSeletedOptions?.trafficLayer || false,
|
|
1604
|
-
onChange: (e, checked) => {
|
|
1605
|
-
setMapSourceRoadMapOptions({
|
|
1606
|
-
trafficLayer: checked
|
|
1607
|
-
});
|
|
1608
|
-
}
|
|
1609
|
-
}), /* @__PURE__ */ jsx(Icon, {
|
|
1610
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_TRAFFIC}`
|
|
1611
|
-
})]
|
|
1612
|
-
}), mapSourceOption.hasTransitLayer && /* @__PURE__ */ jsxs("div", {
|
|
1613
|
-
className: mapClasses.mapSourcesOptionRoadOptionsCheck,
|
|
1614
|
-
children: [/* @__PURE__ */ jsx(CheckBox, {
|
|
1615
|
-
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
1616
|
-
checked: mapSourceOption.roadSeletedOptions?.transitLayer || false,
|
|
1617
|
-
onChange: (e, checked) => {
|
|
1618
|
-
setMapSourceRoadMapOptions({
|
|
1619
|
-
transitLayer: checked
|
|
1620
|
-
});
|
|
1400
|
+
label: /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionIconLabel, children: [
|
|
1401
|
+
/* @__PURE__ */ jsx(
|
|
1402
|
+
Icon,
|
|
1403
|
+
{
|
|
1404
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${mapSourceOption.iconUrl}`
|
|
1621
1405
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1406
|
+
),
|
|
1407
|
+
/* @__PURE__ */ jsx("span", { children: getLabel(mapSourceOption.dictionaryId) })
|
|
1408
|
+
] })
|
|
1409
|
+
}
|
|
1410
|
+
),
|
|
1411
|
+
(mapSourceOption.hasBicyclingLayer || mapSourceOption.hasTrafficLayer || mapSourceOption.hasTransitLayer) && /* @__PURE__ */ jsxs(
|
|
1412
|
+
"div",
|
|
1413
|
+
{
|
|
1414
|
+
className: clsx(
|
|
1415
|
+
mapClasses.mapSourcesOptionRoadOptions,
|
|
1416
|
+
currentMapSourceId !== mapSourceOption.id ? mapClasses.disabled : mapClasses.active
|
|
1417
|
+
),
|
|
1418
|
+
children: [
|
|
1419
|
+
mapSourceOption.hasTrafficLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
|
|
1420
|
+
/* @__PURE__ */ jsx(
|
|
1421
|
+
CheckBox,
|
|
1422
|
+
{
|
|
1423
|
+
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
1424
|
+
checked: mapSourceOption.roadSeletedOptions?.trafficLayer || false,
|
|
1425
|
+
onChange: (_e, checked) => {
|
|
1426
|
+
setMapSourceRoadMapOptions({ trafficLayer: checked });
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
),
|
|
1430
|
+
/* @__PURE__ */ jsx(
|
|
1431
|
+
Icon,
|
|
1432
|
+
{
|
|
1433
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_TRAFFIC}`
|
|
1434
|
+
}
|
|
1435
|
+
)
|
|
1436
|
+
] }),
|
|
1437
|
+
mapSourceOption.hasTransitLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
|
|
1438
|
+
/* @__PURE__ */ jsx(
|
|
1439
|
+
CheckBox,
|
|
1440
|
+
{
|
|
1441
|
+
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
1442
|
+
checked: mapSourceOption.roadSeletedOptions?.transitLayer || false,
|
|
1443
|
+
onChange: (_e, checked) => {
|
|
1444
|
+
setMapSourceRoadMapOptions({ transitLayer: checked });
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
),
|
|
1448
|
+
/* @__PURE__ */ jsx(
|
|
1449
|
+
Icon,
|
|
1450
|
+
{
|
|
1451
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_TRANSIT}`
|
|
1452
|
+
}
|
|
1453
|
+
)
|
|
1454
|
+
] }),
|
|
1455
|
+
mapSourceOption.hasBicyclingLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
|
|
1456
|
+
/* @__PURE__ */ jsx(
|
|
1457
|
+
CheckBox,
|
|
1458
|
+
{
|
|
1459
|
+
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
1460
|
+
checked: mapSourceOption.roadSeletedOptions?.bicyclingLayer || false,
|
|
1461
|
+
label: "Bycicle",
|
|
1462
|
+
onChange: (_e, checked) => {
|
|
1463
|
+
setMapSourceRoadMapOptions({ bicyclingLayer: checked });
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
),
|
|
1467
|
+
/* @__PURE__ */ jsx(
|
|
1468
|
+
Icon,
|
|
1469
|
+
{
|
|
1470
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_BICYCLING}`
|
|
1471
|
+
}
|
|
1472
|
+
)
|
|
1473
|
+
] })
|
|
1474
|
+
]
|
|
1475
|
+
}
|
|
1476
|
+
)
|
|
1477
|
+
] }, mapSourceOption.dictionaryId))
|
|
1478
|
+
}
|
|
1479
|
+
) }) });
|
|
1645
1480
|
}
|
|
1646
1481
|
function LayersButton(props) {
|
|
1647
|
-
const {
|
|
1648
|
-
type
|
|
1649
|
-
} = props;
|
|
1482
|
+
const { type } = props;
|
|
1650
1483
|
const [open, setOpen] = useState(null);
|
|
1651
|
-
const {
|
|
1652
|
-
host_static_assets,
|
|
1653
|
-
environment_assets
|
|
1654
|
-
} = useEnvironment();
|
|
1484
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1655
1485
|
const theme = useTheme();
|
|
1656
1486
|
const handleOpen = (event) => {
|
|
1657
1487
|
setOpen(event.currentTarget);
|
|
1658
|
-
console.log("open", event.currentTarget);
|
|
1659
1488
|
};
|
|
1660
1489
|
const handleClose = () => {
|
|
1661
1490
|
setOpen(null);
|
|
1662
1491
|
};
|
|
1663
|
-
return /* @__PURE__ */ jsxs(React__default.Fragment, {
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1492
|
+
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
1493
|
+
/* @__PURE__ */ jsx(
|
|
1494
|
+
IconButton,
|
|
1495
|
+
{
|
|
1496
|
+
onClick: handleOpen,
|
|
1497
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${type === "MapSources" ? MAP_ICONS.MAP_SOURCES_TOOL : MAP_ICONS.MAP_LAYERS_TOOL}`
|
|
1498
|
+
}
|
|
1499
|
+
),
|
|
1500
|
+
/* @__PURE__ */ jsx(
|
|
1501
|
+
Popover,
|
|
1502
|
+
{
|
|
1503
|
+
className: type === "MapSources" ? mapClasses.mapSourcesPopoverRoot : mapClasses.layersPopoverRoot,
|
|
1504
|
+
arrowType: "no-arrow",
|
|
1505
|
+
open: Boolean(open),
|
|
1506
|
+
anchorEl: open,
|
|
1507
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1508
|
+
onClose: handleClose,
|
|
1509
|
+
sx: {
|
|
1510
|
+
...type === "MapSources" ? theme.components?.M4LMapMapSources?.styleOverrides : theme.components?.M4LMapLayers?.styleOverrides
|
|
1511
|
+
},
|
|
1512
|
+
disableAutoFocus: true,
|
|
1513
|
+
disableRestoreFocus: true,
|
|
1514
|
+
disableEnforceFocus: true,
|
|
1515
|
+
children: type === "MapSources" ? /* @__PURE__ */ jsx(MapSourcesTool, {}) : /* @__PURE__ */ jsx(LayersTool, {})
|
|
1516
|
+
}
|
|
1517
|
+
)
|
|
1518
|
+
] });
|
|
1686
1519
|
}
|
|
1687
1520
|
function TopLeftTools() {
|
|
1688
|
-
return /* @__PURE__ */ jsxs(Control, {
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
children: [/* @__PURE__ */ jsx(LayersButton, {
|
|
1693
|
-
type: "MapSources"
|
|
1694
|
-
}), /* @__PURE__ */ jsx(LayersButton, {
|
|
1695
|
-
type: "Layers"
|
|
1696
|
-
})]
|
|
1697
|
-
});
|
|
1521
|
+
return /* @__PURE__ */ jsxs(Control, { position: "topleft", prepend: true, className: mapClasses.topLeftToolsRoot, children: [
|
|
1522
|
+
/* @__PURE__ */ jsx(LayersButton, { type: "MapSources" }),
|
|
1523
|
+
/* @__PURE__ */ jsx(LayersButton, { type: "Layers" })
|
|
1524
|
+
] });
|
|
1698
1525
|
}
|
|
1699
1526
|
function Controls(props) {
|
|
1700
|
-
const {
|
|
1701
|
-
gpsTools
|
|
1702
|
-
} = props;
|
|
1527
|
+
const { gpsTools } = props;
|
|
1703
1528
|
const map = useMap();
|
|
1704
1529
|
const [controlContainer, setControlContainer] = useState(null);
|
|
1705
1530
|
useEffect(() => {
|
|
@@ -1710,18 +1535,13 @@ function Controls(props) {
|
|
|
1710
1535
|
L__default.DomEvent.disableScrollPropagation(cContainer);
|
|
1711
1536
|
}
|
|
1712
1537
|
}, [map]);
|
|
1713
|
-
return /* @__PURE__ */ jsxs(PopupsProvider, {
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
}), controlContainer)]
|
|
1719
|
-
});
|
|
1538
|
+
return /* @__PURE__ */ jsxs(PopupsProvider, { children: [
|
|
1539
|
+
/* @__PURE__ */ jsx(TopLeftTools, {}),
|
|
1540
|
+
/* @__PURE__ */ jsx(TopRightTools, { gpsTools }),
|
|
1541
|
+
controlContainer && createPortal(/* @__PURE__ */ jsx(PopupsViewer, { containerElement: map.getContainer() }), controlContainer)
|
|
1542
|
+
] });
|
|
1720
1543
|
}
|
|
1721
|
-
const MarkerClusterGroup = createPathComponent(({
|
|
1722
|
-
children: _c,
|
|
1723
|
-
...props
|
|
1724
|
-
}, ctx) => {
|
|
1544
|
+
const MarkerClusterGroup = createPathComponent(({ children: _c, ...props }, ctx) => {
|
|
1725
1545
|
const clusterProps = {};
|
|
1726
1546
|
const clusterEvents = {};
|
|
1727
1547
|
Object.entries(props).forEach(([propName, prop]) => {
|
|
@@ -1736,10 +1556,7 @@ const MarkerClusterGroup = createPathComponent(({
|
|
|
1736
1556
|
});
|
|
1737
1557
|
return {
|
|
1738
1558
|
instance: markerClusterGroup,
|
|
1739
|
-
context: {
|
|
1740
|
-
...ctx,
|
|
1741
|
-
layerContainer: markerClusterGroup
|
|
1742
|
-
}
|
|
1559
|
+
context: { ...ctx, layerContainer: markerClusterGroup }
|
|
1743
1560
|
};
|
|
1744
1561
|
});
|
|
1745
1562
|
const RenderByEachFeatureComponent = ({
|
|
@@ -1747,15 +1564,11 @@ const RenderByEachFeatureComponent = ({
|
|
|
1747
1564
|
...props
|
|
1748
1565
|
}) => {
|
|
1749
1566
|
const feature = renderFeature(props);
|
|
1750
|
-
return feature ? /* @__PURE__ */ jsx(Fragment, {
|
|
1751
|
-
children: feature
|
|
1752
|
-
}) : null;
|
|
1567
|
+
return feature ? /* @__PURE__ */ jsx(Fragment, { children: feature }) : null;
|
|
1753
1568
|
};
|
|
1754
1569
|
const MemonizedRenderByEachFeatureComponent = React__default.memo(RenderByEachFeatureComponent);
|
|
1755
1570
|
const MyLayer = (props) => {
|
|
1756
|
-
const {
|
|
1757
|
-
layerId
|
|
1758
|
-
} = props;
|
|
1571
|
+
const { layerId } = props;
|
|
1759
1572
|
const map = useMap();
|
|
1760
1573
|
const popupRef = useRef(null);
|
|
1761
1574
|
const lefaletLayerRef = useRef({
|
|
@@ -1772,13 +1585,15 @@ const MyLayer = (props) => {
|
|
|
1772
1585
|
}
|
|
1773
1586
|
}, shallow);
|
|
1774
1587
|
const renderFeature = useMapStore((state) => state.hashLayers[layerId]?.renderFeature, shallow);
|
|
1775
|
-
const [visible, cluster = false] = useMapStore(
|
|
1588
|
+
const [visible, cluster = false] = useMapStore(
|
|
1589
|
+
(state) => [state.hashLayers[layerId]?.visible, state.hashLayers[layerId]?.cluster],
|
|
1590
|
+
shallow
|
|
1591
|
+
);
|
|
1776
1592
|
const markerClusterGroupRef = useRef(null);
|
|
1777
1593
|
const handleClick = (a) => {
|
|
1778
1594
|
lefaletLayerRef.current.clickCount++;
|
|
1779
1595
|
if (lefaletLayerRef.current.clickCount === 1) {
|
|
1780
1596
|
lefaletLayerRef.current.clickTimeout = setTimeout(() => {
|
|
1781
|
-
console.log("cluster clicked", a, popupRef.current);
|
|
1782
1597
|
const cluster2 = a.propagatedFrom;
|
|
1783
1598
|
if (cluster2 && cluster2 instanceof L__default.MarkerCluster) {
|
|
1784
1599
|
const childMarkers = cluster2.getAllChildMarkers();
|
|
@@ -1793,8 +1608,9 @@ const MyLayer = (props) => {
|
|
|
1793
1608
|
lefaletLayerRef.current.clickCount = 0;
|
|
1794
1609
|
}, TIME_DOUBLE_CLICK);
|
|
1795
1610
|
} else if (lefaletLayerRef.current.clickCount === 2) {
|
|
1796
|
-
|
|
1797
|
-
|
|
1611
|
+
if (lefaletLayerRef.current?.clickTimeout) {
|
|
1612
|
+
clearTimeout(lefaletLayerRef.current.clickTimeout);
|
|
1613
|
+
}
|
|
1798
1614
|
lefaletLayerRef.current.clickCount = 0;
|
|
1799
1615
|
}
|
|
1800
1616
|
};
|
|
@@ -1803,7 +1619,6 @@ const MyLayer = (props) => {
|
|
|
1803
1619
|
markerClusterGroupRef.current.on("clusterclick", handleClick);
|
|
1804
1620
|
}
|
|
1805
1621
|
}, [markerClusterGroupRef.current]);
|
|
1806
|
-
console.log("Render MyLayer", layerId, featureIdOrCollection, visible, cluster);
|
|
1807
1622
|
if (!featureIdOrCollection || !renderFeature) {
|
|
1808
1623
|
return null;
|
|
1809
1624
|
}
|
|
@@ -1812,15 +1627,18 @@ const MyLayer = (props) => {
|
|
|
1812
1627
|
}
|
|
1813
1628
|
const isFeaturCollection = Array.isArray(featureIdOrCollection);
|
|
1814
1629
|
if (!isFeaturCollection) {
|
|
1815
|
-
return /* @__PURE__ */ jsx(
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1630
|
+
return /* @__PURE__ */ jsx(
|
|
1631
|
+
RenderByEachFeatureComponent,
|
|
1632
|
+
{
|
|
1633
|
+
renderFeature,
|
|
1634
|
+
id: featureIdOrCollection,
|
|
1635
|
+
layerId
|
|
1636
|
+
}
|
|
1637
|
+
);
|
|
1820
1638
|
} else {
|
|
1821
1639
|
const createClusterCustomIcon = (cluster2) => {
|
|
1822
|
-
|
|
1823
|
-
|
|
1640
|
+
const childCount = cluster2.getChildCount();
|
|
1641
|
+
let c = " marker-cluster-";
|
|
1824
1642
|
if (childCount < 10) {
|
|
1825
1643
|
c += "small";
|
|
1826
1644
|
} else if (childCount < 100) {
|
|
@@ -1836,15 +1654,17 @@ const MyLayer = (props) => {
|
|
|
1836
1654
|
return DivIcon2;
|
|
1837
1655
|
};
|
|
1838
1656
|
if (!cluster) {
|
|
1839
|
-
return /* @__PURE__ */ jsx(LayerGroup, {
|
|
1840
|
-
|
|
1841
|
-
|
|
1657
|
+
return /* @__PURE__ */ jsx(LayerGroup, { children: featureIdOrCollection.map((featureId) => {
|
|
1658
|
+
return /* @__PURE__ */ jsx(
|
|
1659
|
+
MemonizedRenderByEachFeatureComponent,
|
|
1660
|
+
{
|
|
1842
1661
|
renderFeature,
|
|
1843
1662
|
id: featureId,
|
|
1844
1663
|
layerId
|
|
1845
|
-
},
|
|
1846
|
-
|
|
1847
|
-
|
|
1664
|
+
},
|
|
1665
|
+
`k_${featureId}`
|
|
1666
|
+
);
|
|
1667
|
+
}) });
|
|
1848
1668
|
} else {
|
|
1849
1669
|
return /* @__PURE__ */ jsx(
|
|
1850
1670
|
MarkerClusterGroup,
|
|
@@ -1855,11 +1675,15 @@ const MyLayer = (props) => {
|
|
|
1855
1675
|
spiderfyOnMaxZoom: false,
|
|
1856
1676
|
iconCreateFunction: createClusterCustomIcon,
|
|
1857
1677
|
children: featureIdOrCollection.map((featureId) => {
|
|
1858
|
-
return /* @__PURE__ */ jsx(
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1678
|
+
return /* @__PURE__ */ jsx(
|
|
1679
|
+
MemonizedRenderByEachFeatureComponent,
|
|
1680
|
+
{
|
|
1681
|
+
renderFeature,
|
|
1682
|
+
id: featureId,
|
|
1683
|
+
layerId
|
|
1684
|
+
},
|
|
1685
|
+
`k_${featureId}`
|
|
1686
|
+
);
|
|
1863
1687
|
})
|
|
1864
1688
|
}
|
|
1865
1689
|
);
|
|
@@ -1879,17 +1703,11 @@ function useAutoFocus() {
|
|
|
1879
1703
|
features: function() {
|
|
1880
1704
|
if (state.hashLayers[layerId].geoJsonObject?.object.type === "FeatureCollection") {
|
|
1881
1705
|
const layer = state.hashLayers[layerId].geoJsonObject?.object;
|
|
1882
|
-
return layer.features.filter((feature) => feature.layerData !== void 0).map((feature) => ({
|
|
1883
|
-
featureId: feature.id,
|
|
1884
|
-
layerData: feature.layerData
|
|
1885
|
-
}));
|
|
1706
|
+
return layer.features.filter((feature) => feature.layerData !== void 0).map((feature) => ({ featureId: feature.id, layerData: feature.layerData }));
|
|
1886
1707
|
} else {
|
|
1887
1708
|
const feature = state.hashLayers[layerId].geoJsonObject?.object;
|
|
1888
1709
|
if (feature.layerData !== void 0) {
|
|
1889
|
-
return [{
|
|
1890
|
-
featureId: feature.id,
|
|
1891
|
-
layerData: feature.layerData
|
|
1892
|
-
}];
|
|
1710
|
+
return [{ featureId: feature.id, layerData: feature.layerData }];
|
|
1893
1711
|
}
|
|
1894
1712
|
}
|
|
1895
1713
|
return [];
|
|
@@ -1917,17 +1735,19 @@ function useAutoFocus() {
|
|
|
1917
1735
|
}
|
|
1918
1736
|
if (layersToFitBounds.length > 0) {
|
|
1919
1737
|
let featureForBounds = layersToFitBounds[0];
|
|
1920
|
-
let bounds = L__default.latLngBounds(
|
|
1738
|
+
let bounds = L__default.latLngBounds(
|
|
1739
|
+
featureForBounds.layerData.boundsNW,
|
|
1740
|
+
featureForBounds.layerData.boundsSE
|
|
1741
|
+
);
|
|
1921
1742
|
for (let i = 1; i < layersToFitBounds.length; i++) {
|
|
1922
1743
|
featureForBounds = layersToFitBounds[i];
|
|
1923
|
-
const newBounds = L__default.latLngBounds(
|
|
1744
|
+
const newBounds = L__default.latLngBounds(
|
|
1745
|
+
featureForBounds.layerData.boundsNW,
|
|
1746
|
+
featureForBounds.layerData.boundsSE
|
|
1747
|
+
);
|
|
1924
1748
|
bounds = bounds.extend(newBounds);
|
|
1925
1749
|
}
|
|
1926
|
-
map.fitBounds(bounds, {
|
|
1927
|
-
animate: false,
|
|
1928
|
-
maxZoom: 22,
|
|
1929
|
-
padding: [50, 50]
|
|
1930
|
-
});
|
|
1750
|
+
map.fitBounds(bounds, { animate: false, maxZoom: 22, padding: [50, 50] });
|
|
1931
1751
|
}
|
|
1932
1752
|
};
|
|
1933
1753
|
const throttleBounds = throttle(proccesLayerWithAutoFocus, 300, {
|
|
@@ -1957,35 +1777,12 @@ const LayersContainer = () => {
|
|
|
1957
1777
|
if (!map) {
|
|
1958
1778
|
return null;
|
|
1959
1779
|
}
|
|
1960
|
-
return /* @__PURE__ */ jsx(React__default.Fragment, {
|
|
1961
|
-
children: layersId.map((l) => /* @__PURE__ */ jsx(MyLayer, {
|
|
1962
|
-
layerId: l
|
|
1963
|
-
}, l))
|
|
1964
|
-
});
|
|
1780
|
+
return /* @__PURE__ */ jsx(React__default.Fragment, { children: layersId.map((l) => /* @__PURE__ */ jsx(MyLayer, { layerId: l }, l)) });
|
|
1965
1781
|
};
|
|
1966
1782
|
const MapRootContainer = styled(MapContainer)`
|
|
1783
|
+
${leaflet_css}
|
|
1967
1784
|
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
${leaflet_css}
|
|
1986
|
-
|
|
1987
|
-
${(props) => props.theme.components?.M4LMap?.styleOverrides}
|
|
1988
|
-
|
|
1785
|
+
${(props) => props.theme.components?.M4LMap?.styleOverrides}
|
|
1989
1786
|
`;
|
|
1990
1787
|
function Map$1(props) {
|
|
1991
1788
|
const {
|
|
@@ -1994,28 +1791,26 @@ function Map$1(props) {
|
|
|
1994
1791
|
initalZoom = 16,
|
|
1995
1792
|
maxZoom = 22
|
|
1996
1793
|
} = props;
|
|
1997
|
-
return /* @__PURE__ */ jsxs(
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
1794
|
+
return /* @__PURE__ */ jsxs(
|
|
1795
|
+
MapRootContainer,
|
|
1796
|
+
{
|
|
1797
|
+
className: mapClasses.root,
|
|
1798
|
+
center,
|
|
1799
|
+
zoom: initalZoom,
|
|
1800
|
+
maxZoom,
|
|
1801
|
+
boxZoom: true,
|
|
1802
|
+
preferCanvas: true,
|
|
1803
|
+
zoomControl: false,
|
|
1804
|
+
children: [
|
|
1805
|
+
/* @__PURE__ */ jsx(TileLayers, {}),
|
|
1806
|
+
/* @__PURE__ */ jsx(LayersContainer, {}),
|
|
1807
|
+
/* @__PURE__ */ jsx(Controls, { gpsTools })
|
|
1808
|
+
]
|
|
1809
|
+
}
|
|
1810
|
+
);
|
|
2009
1811
|
}
|
|
2010
1812
|
function CustomMarker(props) {
|
|
2011
|
-
const {
|
|
2012
|
-
position,
|
|
2013
|
-
width,
|
|
2014
|
-
height,
|
|
2015
|
-
iconForm,
|
|
2016
|
-
bearing,
|
|
2017
|
-
...other
|
|
2018
|
-
} = props;
|
|
1813
|
+
const { position, width, height, iconForm, bearing, ...other } = props;
|
|
2019
1814
|
const html = useMemo(() => {
|
|
2020
1815
|
}, [bearing]);
|
|
2021
1816
|
const customIcon = useMemo(() => {
|
|
@@ -2025,17 +1820,17 @@ function CustomMarker(props) {
|
|
|
2025
1820
|
html: `<div>Hola</div>`
|
|
2026
1821
|
});
|
|
2027
1822
|
}, [html]);
|
|
2028
|
-
return /* @__PURE__ */ jsx(
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
1823
|
+
return /* @__PURE__ */ jsx(
|
|
1824
|
+
Marker,
|
|
1825
|
+
{
|
|
1826
|
+
position,
|
|
1827
|
+
icon: customIcon,
|
|
1828
|
+
...other
|
|
1829
|
+
}
|
|
1830
|
+
);
|
|
2033
1831
|
}
|
|
2034
1832
|
const MarkerFeatureRender = (props) => {
|
|
2035
|
-
const {
|
|
2036
|
-
id,
|
|
2037
|
-
layerId
|
|
2038
|
-
} = props;
|
|
1833
|
+
const { id, layerId } = props;
|
|
2039
1834
|
const feature = useMapStore((state) => {
|
|
2040
1835
|
const gObject = state.hashLayers[layerId].geoJsonObject;
|
|
2041
1836
|
if (!gObject) {
|
|
@@ -2065,17 +1860,17 @@ const MarkerFeatureRender = (props) => {
|
|
|
2065
1860
|
if (feature.geometry.type === "Point") {
|
|
2066
1861
|
const [lat, lng] = feature.geometry.coordinates;
|
|
2067
1862
|
const bearing = feature.properties?.iconBearing ?? 0;
|
|
2068
|
-
return /* @__PURE__ */ jsx(
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
lng
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
1863
|
+
return /* @__PURE__ */ jsx(
|
|
1864
|
+
CustomMarker,
|
|
1865
|
+
{
|
|
1866
|
+
position: { lat, lng },
|
|
1867
|
+
width: 32,
|
|
1868
|
+
height: 32,
|
|
1869
|
+
bearing,
|
|
1870
|
+
iconForm: "grua",
|
|
1871
|
+
id: feature.id
|
|
1872
|
+
}
|
|
1873
|
+
);
|
|
2079
1874
|
}
|
|
2080
1875
|
return null;
|
|
2081
1876
|
};
|
|
@@ -2090,18 +1885,20 @@ const PolylineWithArrows = ({
|
|
|
2090
1885
|
useEffect(() => {
|
|
2091
1886
|
if (polylineRef.current) {
|
|
2092
1887
|
const decorator = L__default.polylineDecorator(polylineRef.current, {
|
|
2093
|
-
patterns: [
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
1888
|
+
patterns: [
|
|
1889
|
+
{
|
|
1890
|
+
repeat: 50,
|
|
1891
|
+
symbol: L__default.Symbol.arrowHead({
|
|
1892
|
+
pixelSize: 4,
|
|
1893
|
+
polygon: false,
|
|
1894
|
+
pathOptions: {
|
|
1895
|
+
stroke: true,
|
|
1896
|
+
color: "#ffffff",
|
|
1897
|
+
weight: 2
|
|
1898
|
+
}
|
|
1899
|
+
})
|
|
1900
|
+
}
|
|
1901
|
+
]
|
|
2105
1902
|
}).addTo(map);
|
|
2106
1903
|
decoratorRef.current = decorator;
|
|
2107
1904
|
if (enableEdit) {
|
|
@@ -2115,18 +1912,20 @@ const PolylineWithArrows = ({
|
|
|
2115
1912
|
}
|
|
2116
1913
|
if (polylineRef.current) {
|
|
2117
1914
|
decoratorRef.current = L__default.polylineDecorator(polylineRef.current, {
|
|
2118
|
-
patterns: [
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
1915
|
+
patterns: [
|
|
1916
|
+
{
|
|
1917
|
+
repeat: 40,
|
|
1918
|
+
symbol: L__default.Symbol.arrowHead({
|
|
1919
|
+
pixelSize: 4,
|
|
1920
|
+
polygon: false,
|
|
1921
|
+
pathOptions: {
|
|
1922
|
+
stroke: true,
|
|
1923
|
+
color: "#cc0000",
|
|
1924
|
+
weight: 2
|
|
1925
|
+
}
|
|
1926
|
+
})
|
|
1927
|
+
}
|
|
1928
|
+
]
|
|
2130
1929
|
}).addTo(map);
|
|
2131
1930
|
}
|
|
2132
1931
|
});
|
|
@@ -2137,17 +1936,14 @@ const PolylineWithArrows = ({
|
|
|
2137
1936
|
};
|
|
2138
1937
|
}
|
|
2139
1938
|
}, [map, enableEdit]);
|
|
2140
|
-
return /* @__PURE__ */ jsx(Polyline, {
|
|
2141
|
-
positions,
|
|
2142
|
-
ref: polylineRef,
|
|
2143
|
-
...other
|
|
2144
|
-
});
|
|
1939
|
+
return /* @__PURE__ */ jsx(Polyline, { positions, ref: polylineRef, ...other });
|
|
2145
1940
|
};
|
|
1941
|
+
function bearingRawToCSS(gpsBearing, offsetRotate) {
|
|
1942
|
+
const rotation = -((360 + offsetRotate - gpsBearing) % 360);
|
|
1943
|
+
return rotation;
|
|
1944
|
+
}
|
|
2146
1945
|
const CommonFeatureRender = (props) => {
|
|
2147
|
-
const {
|
|
2148
|
-
id,
|
|
2149
|
-
layerId
|
|
2150
|
-
} = props;
|
|
1946
|
+
const { id, layerId } = props;
|
|
2151
1947
|
const feature = useMapStore((state) => {
|
|
2152
1948
|
const gObject = state.hashLayers[layerId].geoJsonObject;
|
|
2153
1949
|
if (!gObject) {
|
|
@@ -2173,19 +1969,14 @@ const CommonFeatureRender = (props) => {
|
|
|
2173
1969
|
return null;
|
|
2174
1970
|
}
|
|
2175
1971
|
}, shallow);
|
|
2176
|
-
const {
|
|
2177
|
-
addLayerDataToFeature
|
|
2178
|
-
} = useMapStore((state) => state.mapActions, shallow);
|
|
1972
|
+
const { addLayerDataToFeature } = useMapStore((state) => state.mapActions, shallow);
|
|
2179
1973
|
const [svg, setSvg] = useState(null);
|
|
2180
1974
|
useEffect(() => {
|
|
2181
1975
|
if (!feature) {
|
|
2182
1976
|
return;
|
|
2183
1977
|
}
|
|
2184
1978
|
if (feature.geometry?.type === "Point" && (feature.properties?.subType === "Marker" || feature.properties?.subType === void 0)) {
|
|
2185
|
-
const {
|
|
2186
|
-
iconUrl,
|
|
2187
|
-
markerColor = MARKER_COLOR_DEFAULT
|
|
2188
|
-
} = feature?.properties;
|
|
1979
|
+
const { iconUrl, markerColor = MARKER_COLOR_DEFAULT } = feature?.properties;
|
|
2189
1980
|
const fetchData = async () => {
|
|
2190
1981
|
if (svg && svg.path === iconUrl && svg.color === markerColor) {
|
|
2191
1982
|
return;
|
|
@@ -2255,23 +2046,22 @@ const CommonFeatureRender = (props) => {
|
|
|
2255
2046
|
return /* @__PURE__ */ jsx(
|
|
2256
2047
|
MarkerIconLabel,
|
|
2257
2048
|
{
|
|
2258
|
-
position: {
|
|
2259
|
-
|
|
2260
|
-
|
|
2049
|
+
position: { lat, lng },
|
|
2050
|
+
...{
|
|
2051
|
+
label,
|
|
2052
|
+
iconSrc: svg?.data,
|
|
2053
|
+
iconScale: scaleIcon,
|
|
2054
|
+
iconRotate: bearingRawToCSS(iconBearing, iconOffsetRotate),
|
|
2055
|
+
iconWidth,
|
|
2056
|
+
iconHeight,
|
|
2057
|
+
labelBkColor,
|
|
2058
|
+
labelColor,
|
|
2059
|
+
offsetLeftTop
|
|
2261
2060
|
},
|
|
2262
|
-
label,
|
|
2263
|
-
iconSrc: svg?.data,
|
|
2264
|
-
iconScale: scaleIcon,
|
|
2265
|
-
iconRotate: bearingRawToCSS(iconBearing, iconOffsetRotate),
|
|
2266
|
-
iconWidth,
|
|
2267
|
-
iconHeight,
|
|
2268
|
-
labelBkColor,
|
|
2269
|
-
labelColor,
|
|
2270
|
-
offsetLeftTop,
|
|
2271
2061
|
draggable: false,
|
|
2272
2062
|
eventHandlers: {
|
|
2273
2063
|
add: onAddPointLayer,
|
|
2274
|
-
click: (
|
|
2064
|
+
click: (_e) => {
|
|
2275
2065
|
}
|
|
2276
2066
|
},
|
|
2277
2067
|
...styleProperties,
|
|
@@ -2280,31 +2070,34 @@ const CommonFeatureRender = (props) => {
|
|
|
2280
2070
|
Math.random()
|
|
2281
2071
|
);
|
|
2282
2072
|
} else if (feature.properties?.subType === "Circle" && feature.properties?.radius) {
|
|
2283
|
-
const {
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
eventHandlers: {
|
|
2296
|
-
add: onAddMultipointLayer
|
|
2073
|
+
const { subType, radius, ...styleProperties } = feature.properties;
|
|
2074
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2075
|
+
/* @__PURE__ */ jsx(
|
|
2076
|
+
Circle,
|
|
2077
|
+
{
|
|
2078
|
+
center: { lat, lng },
|
|
2079
|
+
radius: feature.properties?.radius,
|
|
2080
|
+
eventHandlers: {
|
|
2081
|
+
add: onAddMultipointLayer
|
|
2082
|
+
},
|
|
2083
|
+
...styleProperties,
|
|
2084
|
+
...propFeature
|
|
2297
2085
|
},
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2086
|
+
Math.random()
|
|
2087
|
+
),
|
|
2088
|
+
feature?.featureLabel && /* @__PURE__ */ jsx(
|
|
2089
|
+
MarkerIconLabel,
|
|
2090
|
+
{
|
|
2091
|
+
position: [lat + feature.properties.radius / 111319, lng],
|
|
2092
|
+
...feature?.featureLabel
|
|
2093
|
+
}
|
|
2094
|
+
)
|
|
2095
|
+
] });
|
|
2305
2096
|
}
|
|
2306
2097
|
} else if (feature.geometry?.type === "LineString") {
|
|
2307
|
-
const polylinePositions = feature.geometry.coordinates.map(
|
|
2098
|
+
const polylinePositions = feature.geometry.coordinates.map(
|
|
2099
|
+
(coord) => [coord[1], coord[0]]
|
|
2100
|
+
);
|
|
2308
2101
|
if (feature.properties?.subType === "PolylineWithArrows") {
|
|
2309
2102
|
return /* @__PURE__ */ jsx(
|
|
2310
2103
|
PolylineWithArrows,
|
|
@@ -2339,20 +2132,19 @@ const CommonFeatureRender = (props) => {
|
|
|
2339
2132
|
);
|
|
2340
2133
|
}
|
|
2341
2134
|
} else if (feature.geometry?.type === "Polygon") {
|
|
2342
|
-
const polygonPositions = feature.geometry.coordinates.map(
|
|
2135
|
+
const polygonPositions = feature.geometry.coordinates.map(
|
|
2136
|
+
(ring) => ring.map(([lng, lat]) => [lat, lng])
|
|
2137
|
+
);
|
|
2343
2138
|
let topRightPoint = null;
|
|
2344
2139
|
polygonPositions[0].forEach((coord) => {
|
|
2345
|
-
console.log("coord", coord);
|
|
2346
2140
|
const [lat, lng] = coord;
|
|
2347
2141
|
if (!topRightPoint || lat >= topRightPoint[0] && lng >= topRightPoint[1]) {
|
|
2348
|
-
console.log("coord elegida", coord);
|
|
2349
2142
|
topRightPoint = coord;
|
|
2350
2143
|
}
|
|
2351
2144
|
});
|
|
2352
2145
|
topRightPoint = topRightPoint || polygonPositions[0][0];
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
children: [/* @__PURE__ */ jsx(
|
|
2146
|
+
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
2147
|
+
/* @__PURE__ */ jsx(
|
|
2356
2148
|
Polygon,
|
|
2357
2149
|
{
|
|
2358
2150
|
positions: polygonPositions,
|
|
@@ -2363,24 +2155,18 @@ const CommonFeatureRender = (props) => {
|
|
|
2363
2155
|
...feature.properties,
|
|
2364
2156
|
...propFeature
|
|
2365
2157
|
}
|
|
2366
|
-
),
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
})]
|
|
2370
|
-
});
|
|
2158
|
+
),
|
|
2159
|
+
feature?.featureLabel && /* @__PURE__ */ jsx(MarkerIconLabel, { position: topRightPoint, ...feature?.featureLabel })
|
|
2160
|
+
] });
|
|
2371
2161
|
}
|
|
2372
2162
|
return null;
|
|
2373
2163
|
};
|
|
2374
2164
|
export {
|
|
2375
2165
|
CommonFeatureRender as C,
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
Map$1 as c,
|
|
2381
|
-
MapProvider as d,
|
|
2382
|
-
MapContext as e,
|
|
2383
|
-
MarkerFeatureRender as f,
|
|
2166
|
+
Map$1 as M,
|
|
2167
|
+
MapProvider as a,
|
|
2168
|
+
MapContext as b,
|
|
2169
|
+
MarkerFeatureRender as c,
|
|
2384
2170
|
mapClasses as m,
|
|
2385
2171
|
useMapStore as u
|
|
2386
2172
|
};
|