@mapsight/ui 7.0.2 → 7.1.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/dist/components/app.d.ts +2 -2
- package/dist/components/app.d.ts.map +1 -1
- package/dist/components/app.js +7 -7
- package/dist/components/app.js.map +1 -1
- package/dist/components/feature-details-content/feature-details-content.js +2 -2
- package/dist/components/feature-details-content/feature-details-content.js.map +1 -1
- package/dist/components/feature-details-content/index.d.ts +3 -5
- package/dist/components/feature-details-content/index.js +6 -7
- package/dist/components/feature-details-content/index.js.map +1 -1
- package/dist/components/feature-list/filter.js +2 -2
- package/dist/components/feature-list/filter.js.map +1 -1
- package/dist/components/feature-list/hooks/useFeatureListState.d.ts.map +1 -1
- package/dist/components/feature-list/hooks/useFeatureListState.js +7 -2
- package/dist/components/feature-list/hooks/useFeatureListState.js.map +1 -1
- package/dist/components/feature-list/hooks/useRestoreDocumentScroll.js +1 -1
- package/dist/components/feature-list/hooks/useRestoreDocumentScroll.js.map +1 -1
- package/dist/components/feature-list/hooks/useSelectFeature.js +6 -6
- package/dist/components/feature-list/hooks/useSelectFeature.js.map +1 -1
- package/dist/components/feature-list/index.js +4 -4
- package/dist/components/feature-list/index.js.map +1 -1
- package/dist/components/feature-list-cycling/index.d.ts +3 -5
- package/dist/components/feature-list-cycling/index.js +1 -1
- package/dist/components/feature-list-cycling/index.js.map +1 -1
- package/dist/components/feature-list-sorting/index.d.ts +4 -16
- package/dist/components/feature-list-sorting/index.d.ts.map +1 -1
- package/dist/components/feature-list-sorting/index.js +6 -7
- package/dist/components/feature-list-sorting/index.js.map +1 -1
- package/dist/components/feature-selection-info/index.js +2 -2
- package/dist/components/feature-selection-info/index.js.map +1 -1
- package/dist/components/feature-selection-info/with-sticky-header.d.ts +10 -7
- package/dist/components/feature-selection-info/with-sticky-header.d.ts.map +1 -1
- package/dist/components/feature-selection-info/with-sticky-header.js +4 -4
- package/dist/components/feature-selection-info/with-sticky-header.js.map +1 -1
- package/dist/components/helping/app-context.d.ts +1 -1
- package/dist/components/helping/app-context.d.ts.map +1 -1
- package/dist/components/layer-switcher/GroupedLayerSwitcher.js +1 -1
- package/dist/components/layer-switcher/GroupedLayerSwitcher.js.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcher.d.ts +12 -11
- package/dist/components/layer-switcher/LayerSwitcher.d.ts.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcher.js +1 -1
- package/dist/components/layer-switcher/LayerSwitcher.js.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts +15 -0
- package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts.map +1 -0
- package/dist/components/layer-switcher/{LayerSwticherContainer.js → LayerSwitcherContainer.js} +5 -9
- package/dist/components/layer-switcher/LayerSwitcherContainer.js.map +1 -0
- package/dist/components/layer-switcher/LayerSwitcherEntry.d.ts +28 -12
- package/dist/components/layer-switcher/LayerSwitcherEntry.d.ts.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcherEntry.js +33 -35
- package/dist/components/layer-switcher/LayerSwitcherEntry.js.map +1 -1
- package/dist/components/layer-switcher/index.d.ts +9 -2
- package/dist/components/layer-switcher/index.d.ts.map +1 -1
- package/dist/components/layer-switcher/index.js +12 -21
- package/dist/components/layer-switcher/index.js.map +1 -1
- package/dist/components/layout/wrapper.js +1 -1
- package/dist/components/layout/wrapper.js.map +1 -1
- package/dist/components/main-panel/context.d.ts +6 -5
- package/dist/components/main-panel/context.d.ts.map +1 -1
- package/dist/components/main-panel/context.js +5 -13
- package/dist/components/main-panel/context.js.map +1 -1
- package/dist/components/main-panel/list-toggle-button.js +2 -2
- package/dist/components/main-panel/list-toggle-button.js.map +1 -1
- package/dist/components/map-overlay/attribution.js +1 -1
- package/dist/components/map-overlay/attribution.js.map +1 -1
- package/dist/components/map-overlay/info-overlay-left.js +2 -2
- package/dist/components/map-overlay/info-overlay-left.js.map +1 -1
- package/dist/components/map-overlay/info-overlay-right.js +2 -2
- package/dist/components/map-overlay/info-overlay-right.js.map +1 -1
- package/dist/components/map-overlay/legend.js +1 -1
- package/dist/components/map-overlay/legend.js.map +1 -1
- package/dist/components/map-overlay/measure-distance-button.js +1 -1
- package/dist/components/map-overlay/measure-distance-button.js.map +1 -1
- package/dist/components/map-overlay/mini-legend.js +2 -2
- package/dist/components/map-overlay/mini-legend.js.map +1 -1
- package/dist/components/map-overlay/region-selector.js +2 -2
- package/dist/components/map-overlay/region-selector.js.map +1 -1
- package/dist/components/map-overlay/search-overlay.js +1 -1
- package/dist/components/map-overlay/search-overlay.js.map +1 -1
- package/dist/components/map-overlay/share-position-link-button.js +1 -1
- package/dist/components/map-overlay/share-position-link-button.js.map +1 -1
- package/dist/components/map-synced-interlay/index.d.ts +2 -5
- package/dist/components/map-synced-interlay/index.d.ts.map +1 -1
- package/dist/components/map-synced-interlay/index.js +5 -6
- package/dist/components/map-synced-interlay/index.js.map +1 -1
- package/dist/components/map-synced-interlay/map-synced-interlay.js +1 -1
- package/dist/components/map-synced-interlay/map-synced-interlay.js.map +1 -1
- package/dist/components/map-synced-interlay/tooltip.js +1 -1
- package/dist/components/map-synced-interlay/tooltip.js.map +1 -1
- package/dist/components/map.d.ts +6 -5
- package/dist/components/map.d.ts.map +1 -1
- package/dist/components/map.js +15 -5
- package/dist/components/map.js.map +1 -1
- package/dist/components/search/index.js +2 -2
- package/dist/components/search/index.js.map +1 -1
- package/dist/components/search/result-entry.js +1 -1
- package/dist/components/search/result-entry.js.map +1 -1
- package/dist/components/search/result.js +1 -1
- package/dist/components/search/result.js.map +1 -1
- package/dist/components/switcher/SwitcherEntry.d.ts +21 -3
- package/dist/components/switcher/SwitcherEntry.d.ts.map +1 -1
- package/dist/components/switcher/SwitcherEntry.js +8 -9
- package/dist/components/switcher/SwitcherEntry.js.map +1 -1
- package/dist/components/tag-switcher/TagSwitcher.d.ts +2 -2
- package/dist/components/tag-switcher/TagSwitcher.d.ts.map +1 -1
- package/dist/components/tag-switcher/TagSwitcher.js.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherEntry.d.ts +13 -11
- package/dist/components/tag-switcher/createTagSwitcherEntry.d.ts.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherEntry.js +6 -12
- package/dist/components/tag-switcher/createTagSwitcherEntry.js.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherHeader.d.ts +12 -10
- package/dist/components/tag-switcher/createTagSwitcherHeader.d.ts.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherHeader.js +5 -5
- package/dist/components/tag-switcher/createTagSwitcherHeader.js.map +1 -1
- package/dist/components/tag-switcher/index.d.ts +2 -5
- package/dist/components/tag-switcher/index.d.ts.map +1 -1
- package/dist/components/tag-switcher/index.js +6 -7
- package/dist/components/tag-switcher/index.js.map +1 -1
- package/dist/components/view-toggle-button/index.d.ts +6 -5
- package/dist/components/view-toggle-button/index.d.ts.map +1 -1
- package/dist/components/view-toggle-button/index.js +8 -8
- package/dist/components/view-toggle-button/index.js.map +1 -1
- package/dist/components/view-toggle-button/mobile-button.d.ts +1 -1
- package/dist/components/view-toggle-button/mobile-button.d.ts.map +1 -1
- package/dist/components/view-toggle-button/mobile-button.js.map +1 -1
- package/dist/components/view-toggle-button/view-toggle-button.js +1 -1
- package/dist/components/view-toggle-button/view-toggle-button.js.map +1 -1
- package/dist/components/view-toggle-button/viewport-button.d.ts +1 -1
- package/dist/components/view-toggle-button/viewport-button.d.ts.map +1 -1
- package/dist/components/view-toggle-button/viewport-button.js.map +1 -1
- package/dist/helpers/components.d.ts +1 -1
- package/dist/helpers/components.d.ts.map +1 -1
- package/dist/helpers/create-action-watcher.d.ts +1 -1
- package/dist/helpers/create-action-watcher.d.ts.map +1 -1
- package/dist/helpers/create-action-watcher.js +1 -1
- package/dist/helpers/create-action-watcher.js.map +1 -1
- package/dist/hooks/useMountable.d.ts +2 -2
- package/dist/hooks/useMountable.d.ts.map +1 -1
- package/dist/hooks/useMountable.js +6 -0
- package/dist/hooks/useMountable.js.map +1 -1
- package/dist/hooks/useStickyHeader.d.ts +3 -3
- package/dist/hooks/useStickyHeader.d.ts.map +1 -1
- package/dist/hooks/useStickyHeader.js +3 -3
- package/dist/hooks/useStickyHeader.js.map +1 -1
- package/dist/hooks/useUpdateMapSizeCallback.d.ts +1 -1
- package/dist/hooks/useUpdateMapSizeCallback.d.ts.map +1 -1
- package/dist/hooks/useUpdateMapSizeOnRender.d.ts +1 -1
- package/dist/hooks/useUpdateMapSizeOnRender.d.ts.map +1 -1
- package/dist/hooks/useUpdateMapSizeOnTransitionEnd.d.ts +1 -1
- package/dist/hooks/useUpdateMapSizeOnTransitionEnd.d.ts.map +1 -1
- package/dist/hooks/useUpdateMapSizeOnViewChange.d.ts +1 -1
- package/dist/hooks/useUpdateMapSizeOnViewChange.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/browser/app-title.d.ts +1 -1
- package/dist/plugins/browser/app-title.d.ts.map +1 -1
- package/dist/plugins/browser/feature-deep-link.d.ts +1 -1
- package/dist/plugins/browser/feature-deep-link.d.ts.map +1 -1
- package/dist/plugins/browser/feature-deep-link.js.map +1 -1
- package/dist/plugins/browser/local-storage.d.ts +1 -1
- package/dist/plugins/browser/local-storage.d.ts.map +1 -1
- package/dist/plugins/browser/native-fullscreen.d.ts +2 -2
- package/dist/plugins/browser/native-fullscreen.d.ts.map +1 -1
- package/dist/plugins/browser/no-scroll.d.ts +3 -4
- package/dist/plugins/browser/no-scroll.d.ts.map +1 -1
- package/dist/plugins/browser/no-scroll.js.map +1 -1
- package/dist/plugins/browser/partial-content-changed-event.d.ts +1 -1
- package/dist/plugins/browser/partial-content-changed-event.d.ts.map +1 -1
- package/dist/plugins/browser/piwik-track-feature-selection-event.d.ts +1 -1
- package/dist/plugins/browser/piwik-track-feature-selection-event.d.ts.map +1 -1
- package/dist/plugins/browser/piwik-track-fullscreen-toggle-event.d.ts +1 -1
- package/dist/plugins/browser/piwik-track-fullscreen-toggle-event.d.ts.map +1 -1
- package/dist/plugins/browser/search.d.ts +1 -1
- package/dist/plugins/browser/search.d.ts.map +1 -1
- package/dist/plugins/browser/share-position-link.d.ts +1 -1
- package/dist/plugins/browser/share-position-link.d.ts.map +1 -1
- package/dist/plugins/browser/share-position-link.js +1 -1
- package/dist/plugins/browser/share-position-link.js.map +1 -1
- package/dist/plugins/browser/toggle-mobile-views.d.ts +1 -1
- package/dist/plugins/browser/toggle-mobile-views.d.ts.map +1 -1
- package/dist/plugins/browser/user-geolocation.d.ts +1 -1
- package/dist/plugins/browser/user-geolocation.d.ts.map +1 -1
- package/dist/plugins/browser/user-geolocation.js +7 -6
- package/dist/plugins/browser/user-geolocation.js.map +1 -1
- package/dist/plugins/browser/views.d.ts +1 -1
- package/dist/plugins/browser/views.d.ts.map +1 -1
- package/dist/plugins/browser-defaults.d.ts +13 -13
- package/dist/plugins/browser-defaults.d.ts.map +1 -1
- package/dist/plugins/browser-defaults.js +13 -13
- package/dist/plugins/browser-defaults.js.map +1 -1
- package/dist/plugins/common/feature-selection-details-url.d.ts +1 -1
- package/dist/plugins/common/feature-selection-details-url.d.ts.map +1 -1
- package/dist/plugins/common/measure-distance.d.ts +1 -1
- package/dist/plugins/common/measure-distance.d.ts.map +1 -1
- package/dist/plugins/common/measure-distance.js +1 -1
- package/dist/plugins/common/measure-distance.js.map +1 -1
- package/dist/plugins/common/ol-proxy.d.ts +1 -1
- package/dist/plugins/common/ol-proxy.d.ts.map +1 -1
- package/dist/plugins/common/render-await-feature-details-loaded.d.ts +1 -1
- package/dist/plugins/common/render-await-feature-details-loaded.d.ts.map +1 -1
- package/dist/plugins/common/render-await-feature-details-loaded.js +2 -1
- package/dist/plugins/common/render-await-feature-details-loaded.js.map +1 -1
- package/dist/plugins/common/render-await-list-feature-sources-loaded.d.ts +1 -1
- package/dist/plugins/common/render-await-list-feature-sources-loaded.d.ts.map +1 -1
- package/dist/plugins/common/render-await-list-feature-sources-loaded.js +2 -1
- package/dist/plugins/common/render-await-list-feature-sources-loaded.js.map +1 -1
- package/dist/plugins/server/feature-deep-link.d.ts +1 -1
- package/dist/plugins/server/feature-deep-link.d.ts.map +1 -1
- package/dist/plugins/server-defaults.d.ts +4 -4
- package/dist/plugins/server-defaults.d.ts.map +1 -1
- package/dist/plugins/server-defaults.js +4 -4
- package/dist/plugins/server-defaults.js.map +1 -1
- package/dist/renderer/browser-dom.d.ts.map +1 -1
- package/dist/renderer/browser-dom.js +6 -2
- package/dist/renderer/browser-dom.js.map +1 -1
- package/dist/renderer/server-string.js +2 -2
- package/dist/renderer/server-string.js.map +1 -1
- package/dist/store/actions.d.ts +4 -2
- package/dist/store/actions.d.ts.map +1 -1
- package/dist/store/actions.js +1 -1
- package/dist/store/actions.js.map +1 -1
- package/dist/store/reducers.d.ts +222 -9
- package/dist/store/reducers.d.ts.map +1 -1
- package/dist/store/reducers.js +1 -1
- package/dist/store/reducers.js.map +1 -1
- package/dist/store/selectors.d.ts +274 -243
- package/dist/store/selectors.d.ts.map +1 -1
- package/dist/store/selectors.js +49 -68
- package/dist/store/selectors.js.map +1 -1
- package/dist/types.d.ts +50 -35
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -9
- package/src/js/components/{app.jsx → app.tsx} +9 -14
- package/src/js/components/feature-details-content/feature-details-content.jsx +2 -2
- package/src/js/components/feature-details-content/index.js +7 -11
- package/src/js/components/feature-list/filter.jsx +2 -2
- package/src/js/components/feature-list/hooks/useAutoloadFeatureSource.ts +1 -1
- package/src/js/components/feature-list/hooks/useFeatureListState.ts +17 -9
- package/src/js/components/feature-list/hooks/useRestoreDocumentScroll.js +1 -1
- package/src/js/components/feature-list/hooks/useSelectFeature.js +6 -6
- package/src/js/components/feature-list/index.jsx +4 -4
- package/src/js/components/feature-list-cycling/index.js +1 -1
- package/src/js/components/feature-list-sorting/index.js +6 -9
- package/src/js/components/feature-selection-info/index.tsx +3 -3
- package/src/js/components/feature-selection-info/{with-sticky-header.jsx → with-sticky-header.tsx} +23 -8
- package/src/js/components/helping/app-context.tsx +1 -1
- package/src/js/components/layer-switcher/GroupedLayerSwitcher.js +1 -1
- package/src/js/components/layer-switcher/{LayerSwitcher.js → LayerSwitcher.ts} +11 -4
- package/src/js/components/layer-switcher/{LayerSwticherContainer.jsx → LayerSwitcherContainer.tsx} +22 -14
- package/src/js/components/layer-switcher/LayerSwitcherEntry.ts +152 -0
- package/src/js/components/layer-switcher/index.ts +42 -0
- package/src/js/components/layout/wrapper.jsx +1 -1
- package/src/js/components/main-panel/context.tsx +71 -0
- package/src/js/components/main-panel/list-toggle-button.jsx +2 -2
- package/src/js/components/map-overlay/attribution.tsx +1 -1
- package/src/js/components/map-overlay/info-overlay-left.jsx +2 -2
- package/src/js/components/map-overlay/info-overlay-right.jsx +2 -2
- package/src/js/components/map-overlay/legend.tsx +1 -1
- package/src/js/components/map-overlay/measure-distance-button.tsx +1 -1
- package/src/js/components/map-overlay/mini-legend.jsx +2 -2
- package/src/js/components/map-overlay/region-selector.jsx +2 -2
- package/src/js/components/map-overlay/search-overlay.jsx +1 -1
- package/src/js/components/map-overlay/share-position-link-button.tsx +1 -1
- package/src/js/components/map-synced-interlay/index.ts +15 -0
- package/src/js/components/map-synced-interlay/map-synced-interlay.jsx +1 -1
- package/src/js/components/map-synced-interlay/tooltip.tsx +1 -1
- package/src/js/components/map.tsx +55 -0
- package/src/js/components/search/index.jsx +2 -2
- package/src/js/components/search/result-entry.jsx +1 -1
- package/src/js/components/search/result.jsx +1 -1
- package/src/js/components/switcher/{SwitcherEntry.jsx → SwitcherEntry.tsx} +47 -26
- package/src/js/components/tag-switcher/{TagSwitcher.jsx → TagSwitcher.tsx} +1 -2
- package/src/js/components/tag-switcher/{createTagSwitcherEntry.js → createTagSwitcherEntry.ts} +14 -16
- package/src/js/components/tag-switcher/createTagSwitcherHeader.ts +47 -0
- package/src/js/components/tag-switcher/index.ts +17 -0
- package/src/js/components/view-toggle-button/{index.js → index.ts} +13 -10
- package/src/js/components/view-toggle-button/view-toggle-button.jsx +1 -1
- package/src/js/helpers/components.ts +1 -1
- package/src/js/helpers/create-action-watcher.ts +3 -3
- package/src/js/hooks/useMountable.ts +10 -1
- package/src/js/hooks/useStickyHeader.ts +7 -8
- package/src/js/hooks/useUpdateMapSizeCallback.ts +1 -1
- package/src/js/hooks/useUpdateMapSizeOnRender.ts +1 -1
- package/src/js/hooks/useUpdateMapSizeOnTransitionEnd.ts +1 -1
- package/src/js/hooks/useUpdateMapSizeOnViewChange.ts +1 -1
- package/src/js/index.ts +4 -3
- package/src/js/plugins/browser/app-title.ts +1 -1
- package/src/js/plugins/browser/feature-deep-link.ts +4 -3
- package/src/js/plugins/browser/local-storage.ts +1 -1
- package/src/js/plugins/browser/native-fullscreen.ts +2 -2
- package/src/js/plugins/browser/no-scroll.ts +3 -2
- package/src/js/plugins/browser/partial-content-changed-event.ts +1 -1
- package/src/js/plugins/browser/piwik-track-feature-selection-event.ts +1 -1
- package/src/js/plugins/browser/piwik-track-fullscreen-toggle-event.ts +1 -1
- package/src/js/plugins/browser/search.ts +1 -1
- package/src/js/plugins/browser/share-position-link.ts +2 -2
- package/src/js/plugins/browser/toggle-mobile-views.ts +1 -1
- package/src/js/plugins/browser/user-geolocation.ts +20 -12
- package/src/js/plugins/browser/views.ts +1 -1
- package/src/js/plugins/browser-defaults.ts +14 -14
- package/src/js/plugins/common/feature-selection-details-url.ts +1 -1
- package/src/js/plugins/common/measure-distance.ts +4 -4
- package/src/js/plugins/common/ol-proxy.ts +1 -1
- package/src/js/plugins/common/render-await-feature-details-loaded.ts +3 -2
- package/src/js/plugins/common/render-await-list-feature-sources-loaded.ts +3 -2
- package/src/js/plugins/server/feature-deep-link.ts +1 -1
- package/src/js/plugins/server-defaults.ts +5 -5
- package/src/js/renderer/browser-dom.tsx +8 -4
- package/src/js/renderer/server-string.tsx +2 -2
- package/src/js/store/actions.ts +24 -10
- package/src/js/store/reducers.ts +3 -3
- package/src/js/store/selectors.ts +192 -158
- package/src/js/types.ts +65 -41
- package/dist/components/layer-switcher/LayerSwticherContainer.d.ts +0 -4
- package/dist/components/layer-switcher/LayerSwticherContainer.d.ts.map +0 -1
- package/dist/components/layer-switcher/LayerSwticherContainer.js.map +0 -1
- package/src/js/components/layer-switcher/LayerSwitcherEntry.js +0 -132
- package/src/js/components/layer-switcher/index.js +0 -47
- package/src/js/components/main-panel/context.jsx +0 -62
- package/src/js/components/map-synced-interlay/index.js +0 -17
- package/src/js/components/map.jsx +0 -37
- package/src/js/components/tag-switcher/createTagSwitcherHeader.js +0 -34
- package/src/js/components/tag-switcher/index.js +0 -20
- package/src/js/global.d.ts +0 -7
- /package/src/js/components/view-toggle-button/{mobile-button.jsx → mobile-button.tsx} +0 -0
- /package/src/js/components/view-toggle-button/{viewport-button.jsx → viewport-button.tsx} +0 -0
|
@@ -8,7 +8,14 @@ import {
|
|
|
8
8
|
} from "@mapsight/core/lib/feature-sources/selectors";
|
|
9
9
|
|
|
10
10
|
import {FEATURE_LIST} from "../../../config/constants/controllers";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
highlightSelectionSelector,
|
|
13
|
+
lastListScrollPositionSelector,
|
|
14
|
+
layerSwitcherShowExternalSelector,
|
|
15
|
+
preselectSelectionSelector,
|
|
16
|
+
selectSelectionSelector,
|
|
17
|
+
tagSwitcherShowSelector,
|
|
18
|
+
} from "../../../store/selectors";
|
|
12
19
|
import type {FullUiState} from "../../../types";
|
|
13
20
|
import useFeatureListFeatureSource from "./useFeatureListFeatureSource";
|
|
14
21
|
import type {PaginatedFilteredFeaturesState} from "./usePaginatedFilteredFeatures";
|
|
@@ -35,14 +42,15 @@ export default function useFeatureListState(
|
|
|
35
42
|
) {
|
|
36
43
|
const {featureSourceId, featureSource} =
|
|
37
44
|
useFeatureListFeatureSource(listControllerName);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
const tagSwitcherShow = useSelector(tagSwitcherShowSelector);
|
|
46
|
+
const layerSwitcherShowExternal = useSelector(
|
|
47
|
+
layerSwitcherShowExternalSelector,
|
|
48
|
+
);
|
|
49
|
+
const scrollPosition = useSelector(lastListScrollPositionSelector);
|
|
50
|
+
const selectSelection = useSelector(selectSelectionSelector);
|
|
51
|
+
const preselectSelection = useSelector(preselectSelectionSelector);
|
|
52
|
+
const highlightSelection = useSelector(highlightSelectionSelector);
|
|
53
|
+
|
|
46
54
|
const paginatedFilteredFeaturesState = usePaginatedFilteredFeatures(
|
|
47
55
|
featureSource,
|
|
48
56
|
listUiOptions,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {useEffect} from "react";
|
|
2
2
|
|
|
3
|
-
import {isViewFullscreen, isViewMobile} from "../../../store/selectors
|
|
3
|
+
import {isViewFullscreen, isViewMobile} from "../../../store/selectors";
|
|
4
4
|
|
|
5
5
|
export default function useRestoreDocumentScroll(view, scrollPosition) {
|
|
6
6
|
useEffect(() => {
|
|
@@ -8,20 +8,20 @@ import {
|
|
|
8
8
|
selectExclusively,
|
|
9
9
|
} from "@mapsight/core/lib/feature-selections/actions";
|
|
10
10
|
|
|
11
|
-
import {VIEW_MAP_ONLY} from "../../../config/constants/app
|
|
12
|
-
import {FEATURE_SELECTIONS} from "../../../config/constants/controllers
|
|
13
|
-
import {FEATURE_SELECTION_HIGHLIGHT} from "../../../config/feature/selections
|
|
14
|
-
import {setLastListScrollPosition, setView} from "../../../store/actions
|
|
11
|
+
import {VIEW_MAP_ONLY} from "../../../config/constants/app";
|
|
12
|
+
import {FEATURE_SELECTIONS} from "../../../config/constants/controllers";
|
|
13
|
+
import {FEATURE_SELECTION_HIGHLIGHT} from "../../../config/feature/selections";
|
|
14
|
+
import {setLastListScrollPosition, setView} from "../../../store/actions";
|
|
15
15
|
import {
|
|
16
16
|
listUiOptionSelectedOnlySelector,
|
|
17
17
|
listUiOptionSelectionBehaviorSelector,
|
|
18
18
|
listUiOptionSelectionSelectionSelector,
|
|
19
19
|
viewSelector,
|
|
20
|
-
} from "../../../store/selectors
|
|
20
|
+
} from "../../../store/selectors";
|
|
21
21
|
import {
|
|
22
22
|
APP_EVENT_SCROLL_TO_MAP,
|
|
23
23
|
useAppChannelDispatchEvent,
|
|
24
|
-
} from "../../helping/app-channel
|
|
24
|
+
} from "../../helping/app-channel";
|
|
25
25
|
|
|
26
26
|
const getDocumentScroll = () =>
|
|
27
27
|
window.document.documentElement.scrollTop ||
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
layerSwitcherConfigExternalSelector,
|
|
9
9
|
listUiOptionsSelector,
|
|
10
10
|
viewSelector,
|
|
11
|
-
} from "../../store/selectors
|
|
11
|
+
} from "../../store/selectors";
|
|
12
12
|
import FeatureCycling from "../feature-list-cycling";
|
|
13
13
|
|
|
14
14
|
import FeatureSorter from "../feature-list-sorting";
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
APP_EVENT_SCROLL_TO_FEATURE_LIST,
|
|
18
18
|
useAppChannelEventListener,
|
|
19
19
|
} from "../helping/app-channel";
|
|
20
|
-
import LayerSwitcher from "../layer-switcher";
|
|
21
|
-
import TagSwitcher from "../tag-switcher";
|
|
20
|
+
import LayerSwitcher from "../layer-switcher/index";
|
|
21
|
+
import TagSwitcher from "../tag-switcher/index";
|
|
22
22
|
|
|
23
23
|
import {FeatureListContextProvider} from "./context";
|
|
24
24
|
|
|
@@ -31,7 +31,7 @@ import useFeatureListState from "./hooks/useFeatureListState";
|
|
|
31
31
|
import {useMakeHeaderSticky} from "./hooks/useMakeHeaderSticky";
|
|
32
32
|
import useRestoreDocumentScroll from "./hooks/useRestoreDocumentScroll";
|
|
33
33
|
import useSelectFeature from "./hooks/useSelectFeature";
|
|
34
|
-
import Pagination from "./pagination
|
|
34
|
+
import Pagination from "./pagination";
|
|
35
35
|
|
|
36
36
|
export const DEFAULT_LIST_RENDER_AS = "ul";
|
|
37
37
|
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import {connect} from "react-redux";
|
|
2
2
|
|
|
3
|
-
import {createStructuredSelector} from "reselect";
|
|
4
|
-
|
|
5
3
|
import {getGeolocation} from "@mapsight/core/lib/user-geolocation/actions";
|
|
6
4
|
import {geolocationStatusSelector} from "@mapsight/core/lib/user-geolocation/selectors";
|
|
7
5
|
|
|
8
6
|
import {USER_GEOLOCATION} from "../../config/constants/controllers";
|
|
9
|
-
import {sortList} from "../../store/actions
|
|
10
|
-
import {listSortingSelector, placesSelector} from "../../store/selectors
|
|
7
|
+
import {sortList} from "../../store/actions";
|
|
8
|
+
import {listSortingSelector, placesSelector} from "../../store/selectors";
|
|
11
9
|
import FeatureSorter from "./feature-list-sorting";
|
|
12
10
|
|
|
13
11
|
export default connect(
|
|
14
|
-
|
|
15
|
-
sorting: listSortingSelector,
|
|
16
|
-
places: placesSelector,
|
|
17
|
-
geolocationStatus: (state)
|
|
18
|
-
geolocationStatusSelector(state[USER_GEOLOCATION]),
|
|
12
|
+
(state) => ({
|
|
13
|
+
sorting: listSortingSelector(state),
|
|
14
|
+
places: placesSelector(state),
|
|
15
|
+
geolocationStatus: geolocationStatusSelector(state[USER_GEOLOCATION]),
|
|
19
16
|
}),
|
|
20
17
|
// dispatch map:
|
|
21
18
|
{
|
|
@@ -7,7 +7,7 @@ import {removeFrom} from "@mapsight/core/lib/base/actions";
|
|
|
7
7
|
|
|
8
8
|
import {FEATURE_SELECTIONS} from "../../config/constants/controllers";
|
|
9
9
|
import {FEATURE_SELECTION_SELECT} from "../../config/feature/selections";
|
|
10
|
-
import {
|
|
10
|
+
import {featureSelectionInfoUiOptionsSelector} from "../../store/selectors";
|
|
11
11
|
import type {MapsightUiFeature} from "../../types";
|
|
12
12
|
import FeatureDetailsContent from "../feature-details-content";
|
|
13
13
|
import CloseButton from "./close-button";
|
|
@@ -25,8 +25,8 @@ export default function FeatureSelectionInfo({
|
|
|
25
25
|
}) {
|
|
26
26
|
const dispatch = useDispatch();
|
|
27
27
|
const hasStickyHeader = useSelector(
|
|
28
|
-
|
|
29
|
-
);
|
|
28
|
+
featureSelectionInfoUiOptionsSelector,
|
|
29
|
+
).stickyHeader;
|
|
30
30
|
const renderWrapper = useCallback(
|
|
31
31
|
(attrs) => (
|
|
32
32
|
<Wrapper
|
package/src/js/components/feature-selection-info/{with-sticky-header.jsx → with-sticky-header.tsx}
RENAMED
|
@@ -1,19 +1,34 @@
|
|
|
1
|
+
import type {ReactNode} from "react";
|
|
1
2
|
import {useSelector} from "react-redux";
|
|
2
|
-
import useStickyHeader from "../../hooks/useStickyHeader";
|
|
3
|
-
|
|
4
|
-
import {featureSelectionInfoStuckHeaderHeightSelector} from "../../store/selectors.ts";
|
|
5
3
|
|
|
4
|
+
import useStickyHeader from "../../hooks/useStickyHeader";
|
|
5
|
+
import {featureSelectionInfoUiOptionsSelector} from "../../store/selectors";
|
|
6
|
+
import type {MapsightUiFeature} from "../../types";
|
|
6
7
|
import Container from "./container";
|
|
7
8
|
|
|
8
9
|
const stopEventPropagation = (e) => e.stopPropagation();
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
type WithStickyHeaderProps = {
|
|
12
|
+
header: ReactNode;
|
|
13
|
+
feature: MapsightUiFeature;
|
|
14
|
+
content: ReactNode;
|
|
15
|
+
close: ReactNode;
|
|
16
|
+
renderWrapper: (props: any) => ReactNode;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function WithStickyHeader({
|
|
20
|
+
header,
|
|
21
|
+
content,
|
|
22
|
+
feature,
|
|
23
|
+
close,
|
|
24
|
+
renderWrapper,
|
|
25
|
+
}: WithStickyHeaderProps) {
|
|
26
|
+
const {stuckHeaderHeight} = useSelector(
|
|
27
|
+
featureSelectionInfoUiOptionsSelector,
|
|
13
28
|
);
|
|
14
29
|
const {isHeaderStuck, stickyHeaderRef, stickyScrollAreaRef, onScroll} =
|
|
15
|
-
useStickyHeader({
|
|
16
|
-
|
|
30
|
+
useStickyHeader<HTMLDivElement>({
|
|
31
|
+
stuckHeaderHeight,
|
|
17
32
|
resetDeps: [feature.id],
|
|
18
33
|
});
|
|
19
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Provider as ReduxProvider} from "react-redux";
|
|
2
2
|
|
|
3
|
-
import type {Store} from "
|
|
3
|
+
import type {Store} from "@reduxjs/toolkit";
|
|
4
4
|
|
|
5
5
|
import type {MapsightUiComponents} from "../../helpers/components";
|
|
6
6
|
import {ComponentsContext} from "../../helpers/components";
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import {connect} from "react-redux";
|
|
2
2
|
|
|
3
|
+
import type {MapState} from "@mapsight/core/lib/map/types";
|
|
4
|
+
import type {State} from "@mapsight/core/types";
|
|
5
|
+
|
|
3
6
|
import {MAP} from "../../config/constants/controllers";
|
|
4
7
|
import Switcher from "../switcher/Switcher";
|
|
5
8
|
|
|
6
|
-
const selector = (
|
|
7
|
-
|
|
8
|
-
})
|
|
9
|
+
const selector = (
|
|
10
|
+
state: State,
|
|
11
|
+
{layerIdsSelector}: {layerIdsSelector: (state: MapState) => string[]},
|
|
12
|
+
) =>
|
|
13
|
+
({
|
|
14
|
+
ids: layerIdsSelector(state[MAP] as MapState),
|
|
15
|
+
}) as const;
|
|
9
16
|
|
|
10
17
|
export default connect(
|
|
11
18
|
selector,
|
|
12
19
|
null,
|
|
13
20
|
(
|
|
14
21
|
stateProps,
|
|
15
|
-
|
|
22
|
+
_,
|
|
16
23
|
{
|
|
17
24
|
// Need to list the selectors here so they do not get passed as attribute props to the element but get filtered:
|
|
18
25
|
layerIdsSelector: _layerIdsSelector,
|
package/src/js/components/layer-switcher/{LayerSwticherContainer.jsx → LayerSwitcherContainer.tsx}
RENAMED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type {ElementType} from "react";
|
|
2
|
+
import {memo, useCallback} from "react";
|
|
3
|
+
|
|
1
4
|
import {
|
|
2
5
|
layerIdsIntegratedSwitcherSelector,
|
|
3
6
|
makeFeatureSourceFromLayerIdSelector,
|
|
@@ -6,10 +9,9 @@ import {
|
|
|
6
9
|
makeLayerTitleSelector,
|
|
7
10
|
makeLayerVisibleSelector,
|
|
8
11
|
} from "@mapsight/core/lib/map/selectors";
|
|
9
|
-
import {
|
|
12
|
+
import type {MapState} from "@mapsight/core/lib/map/types";
|
|
10
13
|
|
|
11
14
|
import {translate} from "../../helpers/i18n";
|
|
12
|
-
|
|
13
15
|
import GroupedLayerSwitcher from "./GroupedLayerSwitcher";
|
|
14
16
|
import LayerSwitcher from "./LayerSwitcher";
|
|
15
17
|
import LayerSwitcherEntry from "./LayerSwitcherEntry";
|
|
@@ -18,17 +20,24 @@ import LayerSwitcherEntry from "./LayerSwitcherEntry";
|
|
|
18
20
|
// damit diese Berechnung nur bei Änderungen am store berechnet neu wird
|
|
19
21
|
// TODO für das visible eine eigenes connect, damit der Tree nicht dauernd neu berechnet wird
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...attributes
|
|
30
|
-
} = props;
|
|
23
|
+
export type LayerSwitcherContainerProps = {
|
|
24
|
+
as?: ElementType;
|
|
25
|
+
baseClassName?: string;
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
layerIdsSelector?: (state: MapState) => string[];
|
|
28
|
+
grouped?: boolean;
|
|
29
|
+
setFeatureSourceIdPath?: unknown;
|
|
30
|
+
};
|
|
31
31
|
|
|
32
|
+
function LayerSwitcherContainer({
|
|
33
|
+
as: T = "div",
|
|
34
|
+
baseClassName = "ms3-layer-switcher-container", // TODO: Use generic class name
|
|
35
|
+
onClose,
|
|
36
|
+
layerIdsSelector = layerIdsIntegratedSwitcherSelector,
|
|
37
|
+
grouped = false,
|
|
38
|
+
setFeatureSourceIdPath: _,
|
|
39
|
+
...attributes
|
|
40
|
+
}: LayerSwitcherContainerProps) {
|
|
32
41
|
const renderLayerEntry = useCallback(
|
|
33
42
|
(id) => (
|
|
34
43
|
// TODO: memo comp instance & selectors
|
|
@@ -42,10 +51,9 @@ function LayerSwitcherContainer(props) {
|
|
|
42
51
|
featureSourceIdSelector={makeFeatureSourceIdFromLayerIdSelector(
|
|
43
52
|
id,
|
|
44
53
|
)}
|
|
45
|
-
setFeatureSourceIdPath={setFeatureSourceIdPath}
|
|
46
54
|
/>
|
|
47
55
|
),
|
|
48
|
-
[
|
|
56
|
+
[],
|
|
49
57
|
);
|
|
50
58
|
|
|
51
59
|
const Switcher = grouped ? GroupedLayerSwitcher : LayerSwitcher;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {connect} from "react-redux";
|
|
2
|
+
|
|
3
|
+
import type {Dispatch} from "@reduxjs/toolkit";
|
|
4
|
+
|
|
5
|
+
import type {ActionPath} from "@mapsight/core/lib/base/actions";
|
|
6
|
+
import {set as makeSetAction} from "@mapsight/core/lib/base/actions";
|
|
7
|
+
import {getFeatureSourceStatus} from "@mapsight/core/lib/feature-sources/selectors";
|
|
8
|
+
import type {FeatureSourceState} from "@mapsight/core/lib/feature-sources/types";
|
|
9
|
+
import {setLayerVisibility} from "@mapsight/core/lib/map/actions";
|
|
10
|
+
import type {MapState} from "@mapsight/core/lib/map/types";
|
|
11
|
+
import type {State} from "@mapsight/core/types";
|
|
12
|
+
|
|
13
|
+
import getPath from "@mapsight/lib-js/object/getPath";
|
|
14
|
+
|
|
15
|
+
import {MAP} from "../../config/constants/controllers";
|
|
16
|
+
import SwitcherEntry from "../switcher/SwitcherEntry";
|
|
17
|
+
|
|
18
|
+
function getActiveProps({
|
|
19
|
+
setFeatureSourceIdPath,
|
|
20
|
+
currentlySetFeatureSourceId,
|
|
21
|
+
featureSourceId,
|
|
22
|
+
dispatch,
|
|
23
|
+
layerId,
|
|
24
|
+
visibility,
|
|
25
|
+
locked,
|
|
26
|
+
}: {
|
|
27
|
+
locked: boolean;
|
|
28
|
+
visibility: boolean;
|
|
29
|
+
featureSourceId: string | undefined;
|
|
30
|
+
currentlySetFeatureSourceId: string | undefined;
|
|
31
|
+
dispatch: Dispatch;
|
|
32
|
+
layerId: string;
|
|
33
|
+
setFeatureSourceIdPath?: ActionPath | null;
|
|
34
|
+
}) {
|
|
35
|
+
if (setFeatureSourceIdPath) {
|
|
36
|
+
const isCurrentFeatureSource =
|
|
37
|
+
currentlySetFeatureSourceId === featureSourceId;
|
|
38
|
+
|
|
39
|
+
// this will match in intermediate state; use batching?
|
|
40
|
+
//if (!visibility && isFeatureSourceCurrent) {
|
|
41
|
+
// throw new Error('illegal state');
|
|
42
|
+
//}
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
activeCheckbox: visibility,
|
|
46
|
+
activeText: isCurrentFeatureSource,
|
|
47
|
+
toggleActiveCheckbox: function toggleActiveCheckbox() {
|
|
48
|
+
dispatch(setLayerVisibility(MAP, layerId, !visibility));
|
|
49
|
+
if (isCurrentFeatureSource) {
|
|
50
|
+
dispatch(makeSetAction(setFeatureSourceIdPath, undefined));
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
toggleActiveText: function toggleActiveText() {
|
|
54
|
+
if (featureSourceId) {
|
|
55
|
+
dispatch(
|
|
56
|
+
makeSetAction(setFeatureSourceIdPath, featureSourceId),
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
dispatch(setLayerVisibility(MAP, layerId, true));
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
active: visibility,
|
|
66
|
+
toggleActive: function toggleActive() {
|
|
67
|
+
if (!locked) {
|
|
68
|
+
dispatch(setLayerVisibility(MAP, layerId, !visibility));
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type LayerSwitcherEntryProps = {
|
|
75
|
+
layerId: string;
|
|
76
|
+
titleSelector: (state: MapState) => string;
|
|
77
|
+
lockedSelector: (state: MapState) => boolean;
|
|
78
|
+
layerVisibilitySelector: (state: MapState) => boolean;
|
|
79
|
+
featureSourceSelector: (
|
|
80
|
+
mapState: MapState,
|
|
81
|
+
state: State,
|
|
82
|
+
) => FeatureSourceState | null;
|
|
83
|
+
featureSourceIdSelector: (state: MapState) => string | undefined;
|
|
84
|
+
setFeatureSourceIdPath?: ActionPath | null;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const mapStateToProps = (
|
|
88
|
+
state: State,
|
|
89
|
+
{
|
|
90
|
+
titleSelector,
|
|
91
|
+
lockedSelector,
|
|
92
|
+
layerVisibilitySelector,
|
|
93
|
+
featureSourceSelector,
|
|
94
|
+
featureSourceIdSelector,
|
|
95
|
+
setFeatureSourceIdPath,
|
|
96
|
+
}: LayerSwitcherEntryProps,
|
|
97
|
+
) => {
|
|
98
|
+
const mapState = state[MAP] as MapState;
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
title: titleSelector(mapState),
|
|
102
|
+
locked: lockedSelector(mapState),
|
|
103
|
+
visibility: layerVisibilitySelector(mapState),
|
|
104
|
+
featureSource: featureSourceSelector(mapState, state),
|
|
105
|
+
featureSourceId: featureSourceIdSelector(mapState),
|
|
106
|
+
currentlySetFeatureSourceId: Array.isArray(setFeatureSourceIdPath)
|
|
107
|
+
? (getPath(state, setFeatureSourceIdPath) as string | undefined)
|
|
108
|
+
: undefined,
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const LayerSwitcherEntry = connect(
|
|
113
|
+
mapStateToProps,
|
|
114
|
+
null,
|
|
115
|
+
// mergeProps:
|
|
116
|
+
(
|
|
117
|
+
stateProps,
|
|
118
|
+
{dispatch},
|
|
119
|
+
{
|
|
120
|
+
// used for active props:
|
|
121
|
+
layerId,
|
|
122
|
+
setFeatureSourceIdPath,
|
|
123
|
+
|
|
124
|
+
// Need to list the selectors here so they do not get passed as attribute props to the element but get filtered:
|
|
125
|
+
lockedSelector: _1,
|
|
126
|
+
titleSelector: _2,
|
|
127
|
+
layerVisibilitySelector: _3,
|
|
128
|
+
featureSourceSelector: _4,
|
|
129
|
+
featureSourceIdSelector: _5,
|
|
130
|
+
|
|
131
|
+
...attributes
|
|
132
|
+
},
|
|
133
|
+
) => ({
|
|
134
|
+
title: stateProps.title,
|
|
135
|
+
status: stateProps.featureSource
|
|
136
|
+
? getFeatureSourceStatus(stateProps.featureSource)
|
|
137
|
+
: undefined,
|
|
138
|
+
locked: stateProps.locked,
|
|
139
|
+
...getActiveProps({
|
|
140
|
+
visibility: stateProps.visibility,
|
|
141
|
+
featureSourceId: stateProps.featureSourceId ?? "",
|
|
142
|
+
currentlySetFeatureSourceId: stateProps.currentlySetFeatureSourceId,
|
|
143
|
+
locked: stateProps.locked,
|
|
144
|
+
dispatch,
|
|
145
|
+
layerId,
|
|
146
|
+
setFeatureSourceIdPath,
|
|
147
|
+
}),
|
|
148
|
+
...attributes,
|
|
149
|
+
}),
|
|
150
|
+
)(SwitcherEntry);
|
|
151
|
+
|
|
152
|
+
export default LayerSwitcherEntry;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {connect} from "react-redux";
|
|
2
|
+
|
|
3
|
+
import type {Selector} from "@mapsight/core/types";
|
|
4
|
+
|
|
5
|
+
import {FEATURE_LIST} from "../../config/constants/controllers";
|
|
6
|
+
import type {RootStateSlice} from "../../store/selectors";
|
|
7
|
+
import {layerSwitcherConfigInternalSelector} from "../../store/selectors";
|
|
8
|
+
import type {LayerSwitcherConfigState} from "../../types";
|
|
9
|
+
import LayerSwitcherContainer from "./LayerSwitcherContainer";
|
|
10
|
+
|
|
11
|
+
const TRUE_SET_FEATURE_SOURCE_PATH = [FEATURE_LIST, "featureSource"] as const;
|
|
12
|
+
|
|
13
|
+
type Props = {
|
|
14
|
+
configSelector?: Selector<LayerSwitcherConfigState | undefined>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default connect(
|
|
18
|
+
(
|
|
19
|
+
state: RootStateSlice,
|
|
20
|
+
{configSelector = layerSwitcherConfigInternalSelector}: Props,
|
|
21
|
+
) => {
|
|
22
|
+
const setFeatureSourceId = configSelector(state)?.setFeatureSourceId;
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
layerIdsSelector: configSelector(state)?.layerIdsSelector,
|
|
26
|
+
grouped: configSelector(state)?.grouped,
|
|
27
|
+
setFeatureSourceIdPath:
|
|
28
|
+
setFeatureSourceId === true
|
|
29
|
+
? TRUE_SET_FEATURE_SOURCE_PATH
|
|
30
|
+
: setFeatureSourceId,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
null,
|
|
34
|
+
(
|
|
35
|
+
stateProps,
|
|
36
|
+
_dispatchProps,
|
|
37
|
+
{configSelector: _configSelector, ...ownProps},
|
|
38
|
+
) => ({
|
|
39
|
+
...ownProps,
|
|
40
|
+
...stateProps,
|
|
41
|
+
}),
|
|
42
|
+
)(LayerSwitcherContainer);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type {PropsWithChildren} from "react";
|
|
2
|
+
import {createContext, useContext, useMemo} from "react";
|
|
3
|
+
import {useSelector} from "react-redux";
|
|
4
|
+
|
|
5
|
+
import {createMainPanelContentTypeSelector} from "../../store/selectors";
|
|
6
|
+
import type {MainPanelContextOptions, MainPanelContextValue} from "../../types";
|
|
7
|
+
|
|
8
|
+
const MainPanelContext = createContext<MainPanelContextValue>({
|
|
9
|
+
showSelectionInfo: false,
|
|
10
|
+
showList: false,
|
|
11
|
+
collapsible: false,
|
|
12
|
+
panelPosition: "left",
|
|
13
|
+
|
|
14
|
+
feature: null,
|
|
15
|
+
contentType: null,
|
|
16
|
+
collapsed: false,
|
|
17
|
+
});
|
|
18
|
+
MainPanelContext.displayName = "MainPanelContext";
|
|
19
|
+
|
|
20
|
+
export function useMainPanelContext() {
|
|
21
|
+
return useContext(MainPanelContext);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type MainPanelStateProps = Pick<
|
|
25
|
+
MainPanelContextOptions,
|
|
26
|
+
"showSelectionInfo" | "showList" | "collapsible"
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
function useMainPanelState({
|
|
30
|
+
showSelectionInfo,
|
|
31
|
+
showList,
|
|
32
|
+
collapsible,
|
|
33
|
+
}: MainPanelStateProps) {
|
|
34
|
+
const selector = useMemo(
|
|
35
|
+
() =>
|
|
36
|
+
createMainPanelContentTypeSelector({
|
|
37
|
+
showSelectionInfo: showSelectionInfo,
|
|
38
|
+
showList: showList,
|
|
39
|
+
collapsible: collapsible,
|
|
40
|
+
}),
|
|
41
|
+
[showSelectionInfo, showList, collapsible],
|
|
42
|
+
);
|
|
43
|
+
return useSelector(selector);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type MainPanelContextProps = PropsWithChildren<
|
|
47
|
+
Partial<MainPanelContextOptions>
|
|
48
|
+
>;
|
|
49
|
+
|
|
50
|
+
export function MainPanelContextProvider({
|
|
51
|
+
showSelectionInfo = false,
|
|
52
|
+
showList = false,
|
|
53
|
+
collapsible = false,
|
|
54
|
+
panelPosition = "left",
|
|
55
|
+
children,
|
|
56
|
+
}: MainPanelContextProps) {
|
|
57
|
+
const options = {
|
|
58
|
+
showSelectionInfo: showSelectionInfo,
|
|
59
|
+
showList: showList,
|
|
60
|
+
collapsible: collapsible,
|
|
61
|
+
panelPosition: panelPosition,
|
|
62
|
+
};
|
|
63
|
+
const state = useMainPanelState(options);
|
|
64
|
+
const value = {...options, ...state};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<MainPanelContext.Provider value={value}>
|
|
68
|
+
{children}
|
|
69
|
+
</MainPanelContext.Provider>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {useCallback} from "react";
|
|
2
2
|
import {useDispatch, useSelector} from "react-redux";
|
|
3
3
|
import {translate} from "../../helpers/i18n";
|
|
4
|
-
import {toggleUserPreferenceListVisible} from "../../store/actions
|
|
4
|
+
import {toggleUserPreferenceListVisible} from "../../store/actions";
|
|
5
5
|
|
|
6
|
-
import {userPreferenceListVisibleSelector} from "../../store/selectors
|
|
6
|
+
import {userPreferenceListVisibleSelector} from "../../store/selectors";
|
|
7
7
|
|
|
8
8
|
import {useMainPanelContext} from "./context";
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ function Attribution({children}: PropsWithChildren) {
|
|
|
16
16
|
const attributions = useSelector(selectVisibleLayerAttributions);
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<AttributionEntries attributions={attributions}>
|
|
19
|
+
<AttributionEntries attributions={attributions ?? undefined}>
|
|
20
20
|
{children}
|
|
21
21
|
</AttributionEntries>
|
|
22
22
|
);
|
|
@@ -3,12 +3,12 @@ import {useDispatch, useSelector} from "react-redux";
|
|
|
3
3
|
|
|
4
4
|
import {translate} from "../../helpers/i18n";
|
|
5
5
|
|
|
6
|
-
import {setOverlayModalVisible} from "../../store/actions
|
|
6
|
+
import {setOverlayModalVisible} from "../../store/actions";
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
isOverlayModalVisibleSelector,
|
|
10
10
|
isViewMobileOrMapOnlySelector,
|
|
11
|
-
} from "../../store/selectors
|
|
11
|
+
} from "../../store/selectors";
|
|
12
12
|
|
|
13
13
|
import Logo from "./logo";
|
|
14
14
|
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "@mapsight/core/lib/map/selectors";
|
|
5
5
|
import {memo, useCallback} from "react";
|
|
6
6
|
import {useDispatch, useSelector} from "react-redux";
|
|
7
|
-
import {createSelector} from "
|
|
7
|
+
import {createSelector} from "@reduxjs/toolkit";
|
|
8
8
|
|
|
9
9
|
import {MAP} from "../../config/constants/controllers";
|
|
10
10
|
|
|
11
11
|
import {translate} from "../../helpers/i18n";
|
|
12
|
-
import {setOverlayModalVisible} from "../../store/actions
|
|
12
|
+
import {setOverlayModalVisible} from "../../store/actions";
|
|
13
13
|
|
|
14
14
|
import Attribution from "./attribution";
|
|
15
15
|
|