@opengeoweb/core 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/index.esm.js +2154 -1200
  2. package/index.umd.js +2209 -1217
  3. package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +3 -3
  4. package/lib/components/CustomToggleButton/CustomToggleButton.d.ts +9 -0
  5. package/lib/components/{ToggleIconButton/ToggleIconButton.spec.d.ts → CustomToggleButton/CustomToggleButton.spec.d.ts} +0 -0
  6. package/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +13 -0
  7. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.d.ts +1 -3
  8. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItem.d.ts +4 -5
  9. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItemConnect.d.ts +6 -0
  10. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItemConnect.spec.d.ts +1 -0
  11. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterSelectAllSwitchConnect.d.ts +3 -0
  12. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterSelectAllSwitchConnect.spec.d.ts +1 -0
  13. package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.d.ts +2 -2
  14. package/lib/components/LayerManager/LayerSelect/LayerList/LayerListUtils.d.ts +1 -2
  15. package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.d.ts +4 -1
  16. package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialogConnect.d.ts +3 -0
  17. package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialogConnect.spec.d.ts +1 -0
  18. package/lib/components/LayerManager/LayerSelect/ServicePopup/ServicePopup.d.ts +3 -0
  19. package/lib/components/LayerManager/LayerSelect/ServicePopup/ServicePopupConnect.d.ts +10 -0
  20. package/lib/components/MapControls/MapControlButton.d.ts +2 -2
  21. package/lib/components/MultiMapView/HarmoniePresets/HarmRefTimePreset.d.ts +2 -2
  22. package/lib/components/MultiMapView/HarmoniePresets/HarmonieTempAndPrecipPreset.d.ts +4 -4
  23. package/lib/components/MultiMapView/MultiMapViewConnect.d.ts +2 -1
  24. package/lib/components/MultiMapView/storyUtils/mapPresets.d.ts +81 -0
  25. package/lib/components/ToolButton/ToolButton.d.ts +12 -0
  26. package/lib/components/ToolButton/ToolButton.spec.d.ts +1 -0
  27. package/lib/components/{ToggleIconButton/ToggleIconButton.stories.d.ts → ToolButton/ToolButton.stories.d.ts} +2 -2
  28. package/lib/components/ToolButton/index.d.ts +1 -0
  29. package/lib/index.d.ts +2 -0
  30. package/lib/store/generic/synchronizationGroups/types.d.ts +1 -0
  31. package/lib/store/layerSelect/actions.d.ts +4 -2
  32. package/lib/store/layerSelect/constants.d.ts +3 -1
  33. package/lib/store/layerSelect/sagas.d.ts +1 -0
  34. package/lib/store/layerSelect/selectors.d.ts +59 -9
  35. package/lib/store/layerSelect/types.d.ts +33 -12
  36. package/lib/store/mapStore/layers/selectors.d.ts +24 -12
  37. package/lib/store/mapStore/map/selectors.d.ts +38 -26
  38. package/lib/store/mapStore/service/actions.d.ts +8 -1
  39. package/lib/store/mapStore/service/constants.d.ts +1 -0
  40. package/lib/store/mapStore/service/selectors.d.ts +34 -6
  41. package/lib/store/mapStore/service/types.d.ts +9 -2
  42. package/lib/store/ui/selectors.d.ts +2 -2
  43. package/lib/store/utils.d.ts +6 -0
  44. package/lib/utils/defaultConfigurations.d.ts +3 -21
  45. package/lib/utils/getCapabilities.d.ts +1 -0
  46. package/lib/utils/jsonPresetFilter.d.ts +10 -0
  47. package/lib/utils/jsonPresetFilter.spec.d.ts +1 -0
  48. package/lib/utils/types.d.ts +52 -0
  49. package/package.json +5 -5
  50. package/lib/components/ToggleIconButton/ToggleIconButton.d.ts +0 -12
  51. package/lib/components/ToggleIconButton/index.d.ts +0 -1
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Bbox, Layer } from '../../store/mapStore/types';
3
3
  import { AnimationPayloadType } from '../ConfigurableConnectedMap';
4
4
  import { InitialHarmRefTimeProps, InitialHarmTempAndPrecipProps } from '../MultiMapView/HarmoniePresets';
5
- export interface MapPreset {
5
+ export interface TSMapPreset {
6
6
  layers?: Layer[];
7
7
  activeLayerId?: string;
8
8
  baseLayer?: Layer;
@@ -16,12 +16,12 @@ export interface MapPreset {
16
16
  displayMapPin?: boolean;
17
17
  }
18
18
  interface InitialMultiMapProps {
19
- mapPreset: MapPreset[];
19
+ mapPreset: TSMapPreset[];
20
20
  syncGroupsIds: string[];
21
21
  shouldShowZoomControls?: boolean;
22
22
  }
23
23
  interface InitialMapProps {
24
- mapPreset: MapPreset;
24
+ mapPreset: TSMapPreset;
25
25
  syncGroupsIds: string[];
26
26
  shouldShowZoomControls?: boolean;
27
27
  }
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { ToggleButtonProps } from '@mui/material';
3
+ import { ButtonVariant } from '@opengeoweb/theme';
4
+ export interface CustomToggleButtonProps extends Omit<ToggleButtonProps, 'value'> {
5
+ variant?: ButtonVariant;
6
+ value?: unknown;
7
+ }
8
+ declare const CustomToggleButton: React.FC<CustomToggleButtonProps>;
9
+ export default CustomToggleButton;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const CustomToggleButtonLight: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
10
+ export declare const CustomToggleButtonDark: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ };
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
- import { KeywordObject } from '../../../../store/layerSelect/types';
3
2
  import { Source } from '../../../../store/ui/types';
4
3
  interface KeywordFilterResultsProps {
5
- keywordObjects: KeywordObject[];
4
+ allKeywordIds: string[];
6
5
  mapId: string;
7
6
  bounds?: string;
8
7
  showTitle?: boolean;
@@ -11,7 +10,6 @@ interface KeywordFilterResultsProps {
11
10
  isOpen: boolean;
12
11
  order?: number;
13
12
  source?: Source;
14
- updateKeywords: (keywords: KeywordObject[]) => void;
15
13
  }
16
14
  declare const KeywordFilterResults: React.FC<KeywordFilterResultsProps>;
17
15
  export default KeywordFilterResults;
@@ -1,10 +1,9 @@
1
1
  import * as React from 'react';
2
+ import { KeywordObject } from '../../../../store/layerSelect/types';
2
3
  interface FilterListItemProps {
3
- index: number;
4
- text: string;
5
- checked: boolean;
6
- toggleCheckbox: (index: number) => void;
7
- selectOnlyOne: (index: number) => void;
4
+ keyword: KeywordObject;
5
+ toggleKeywords: (keywords: string[]) => void;
6
+ enableOnlyOneKeyword: (keyword: string) => void;
8
7
  }
9
8
  declare const FilterListItem: React.FC<FilterListItemProps>;
10
9
  export default FilterListItem;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ interface KeywordFilterResultsListItemConnectProps {
3
+ keyword: string;
4
+ }
5
+ declare const KeywordFilterResultsListItemConnect: React.FC<KeywordFilterResultsListItemConnectProps>;
6
+ export default KeywordFilterResultsListItemConnect;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const KeywordFilterSelectAllSwitchConnect: React.FC;
3
+ export default KeywordFilterSelectAllSwitchConnect;
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { Services } from '../../../../store/mapStore/service/types';
3
- import { KeywordObject } from '../../../../store/layerSelect/types';
4
3
  interface LayerListProps {
5
4
  services: Services;
6
5
  serviceIds: string[];
7
6
  layerSelectHeight: number;
8
7
  searchString: string;
9
- keywords: KeywordObject[];
8
+ keywordIds: string[];
9
+ allKeywordsActive: boolean;
10
10
  }
11
11
  declare const LayerList: React.FC<LayerListProps>;
12
12
  export default LayerList;
@@ -1,3 +1,2 @@
1
1
  import { ServiceLayer, Services } from '../../../../store/mapStore/service/types';
2
- import { KeywordObject } from '../../../../store/layerSelect/types';
3
- export declare const filterLayersFromService: (serviceId: string, services: Services, keywords: KeywordObject[], searchString: string) => ServiceLayer[];
2
+ export declare const filterLayersFromService: (serviceId: string, services: Services, keywordIds: string[], allKeywordsActive: boolean, searchString: string) => ServiceLayer[];
@@ -1,6 +1,9 @@
1
1
  import * as React from 'react';
2
+ import { ReduxLayer } from '../../../../store/mapStore/layers/types';
2
3
  interface ServiceOptionsDialogProps {
3
- services: string[];
4
+ services: Record<string, string>[];
5
+ mapStoreRemoveService?: (service: string) => void;
6
+ layers?: ReduxLayer[];
4
7
  }
5
8
  declare const ServiceOptionsDialog: React.FC<ServiceOptionsDialogProps>;
6
9
  export default ServiceOptionsDialog;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const ServiceOptionsDialogConnect: React.FC;
3
+ export default ServiceOptionsDialogConnect;
@@ -1,10 +1,13 @@
1
1
  import * as React from 'react';
2
+ import { SetLayersForServicePayload } from '../../../../store/mapStore/types';
2
3
  interface ServicePopupProps {
3
4
  servicePopupVariant: 'edit' | 'add' | 'save';
4
5
  hideBackdrop?: boolean;
5
6
  isOpen?: boolean;
6
7
  closePopup?: () => void;
7
8
  url?: string;
9
+ services?: any;
10
+ serviceSetLayers: (payload: SetLayersForServicePayload) => void;
8
11
  }
9
12
  export declare const ADD_HEADING = "Add a new service";
10
13
  export declare const EDIT_HEADING = "Edit service";
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface ServicePopupConnectProps {
3
+ servicePopupVariant: 'edit' | 'add' | 'save';
4
+ hideBackdrop?: boolean;
5
+ isOpen?: boolean;
6
+ closePopup?: () => void;
7
+ url?: string;
8
+ }
9
+ declare const ServicePopupConnect: React.FC<ServicePopupConnectProps>;
10
+ export default ServicePopupConnect;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { TooltipProps } from '@mui/material';
3
- import { ToggleIconButtonProps } from '../ToggleIconButton/ToggleIconButton';
4
- interface MapControlButtonProps extends ToggleIconButtonProps {
3
+ import { ToolButtonProps } from '../ToolButton/ToolButton';
4
+ interface MapControlButtonProps extends ToolButtonProps {
5
5
  onClick: () => void;
6
6
  isActive?: boolean;
7
7
  placement?: TooltipProps['placement'];
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { Layer } from '../../../store/mapStore/types';
3
3
  import { MultiMapPreset } from '../MultiMapViewConnect';
4
- export declare const makeMapPreset: (timeIncrement: number, uniqueId: string, referenceTime: string, layers: Layer[], layerSyncGroupId: string, displayLayerManagerButtonInMap: boolean, displayDimensionSelectButtonInMap: boolean) => MultiMapPreset;
4
+ export declare const makeMapPreset: (timeIncrement: number, uniqueId: string, referenceTime: string, layers: Layer[], syncGroupsIds: string[], displayLayerManagerButtonInMap: boolean, displayDimensionSelectButtonInMap: boolean) => MultiMapPreset;
5
5
  export interface InitialHarmRefTimeProps {
6
6
  layers?: Layer[];
7
- layerSyncGroupId: string;
7
+ syncGroupsIds: string[];
8
8
  }
9
9
  export declare const HarmRefTimePreset: React.FC<InitialHarmRefTimeProps>;
@@ -2,10 +2,10 @@ import * as React from 'react';
2
2
  import { Layer } from '../../../store/mapStore/types';
3
3
  export interface InitialHarmTempAndPrecipProps {
4
4
  layers: {
5
- toprow: Layer;
6
- bottomrow: Layer;
7
- toprowGroup?: string;
8
- bottomrowGroup?: string;
5
+ topRow: Layer;
6
+ bottomRow: Layer;
7
+ topRowSyncGroups?: string[];
8
+ bottomRowSyncGroups?: string[];
9
9
  };
10
10
  }
11
11
  export declare const HarmonieTempAndPrecipPreset: React.FC<InitialHarmTempAndPrecipProps>;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Bbox, Layer } from '../../store/mapStore/types';
3
3
  export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"box" | "zoomControls">;
4
4
  export interface MultiMapPreset {
5
+ id: string;
5
6
  title?: string;
6
7
  layers: Layer[];
7
8
  activeLayerId?: string;
@@ -9,9 +10,9 @@ export interface MultiMapPreset {
9
10
  bbox?: Bbox;
10
11
  srs?: string;
11
12
  displayTimeInMap?: boolean;
12
- layerSyncGroupId?: string;
13
13
  displayLayerManagerButtonInMap?: boolean;
14
14
  displayDimensionSelectButtonInMap?: boolean;
15
+ syncGroupsIds?: string[];
15
16
  }
16
17
  export interface MultiMapViewProps {
17
18
  rows: number;
@@ -8,6 +8,15 @@ export declare const mapPresetRadar: {
8
8
  id: string;
9
9
  layerType: import("../../../store/mapStore/types").LayerType;
10
10
  }[];
11
+ proj: {
12
+ bbox: {
13
+ left: number;
14
+ bottom: number;
15
+ right: number;
16
+ top: number;
17
+ };
18
+ srs: string;
19
+ };
11
20
  };
12
21
  export declare const mapPresetObsTA: {
13
22
  layers: {
@@ -16,6 +25,15 @@ export declare const mapPresetObsTA: {
16
25
  id: string;
17
26
  layerType: import("../../../store/mapStore/types").LayerType;
18
27
  }[];
28
+ proj: {
29
+ bbox: {
30
+ left: number;
31
+ bottom: number;
32
+ right: number;
33
+ top: number;
34
+ };
35
+ srs: string;
36
+ };
19
37
  };
20
38
  export declare const mapPresetObsWind: {
21
39
  layers: {
@@ -24,6 +42,15 @@ export declare const mapPresetObsWind: {
24
42
  id: string;
25
43
  layerType: import("../../../store/mapStore/types").LayerType;
26
44
  }[];
45
+ proj: {
46
+ bbox: {
47
+ left: number;
48
+ bottom: number;
49
+ right: number;
50
+ top: number;
51
+ };
52
+ srs: string;
53
+ };
27
54
  };
28
55
  export declare const mapPresetObsPP: {
29
56
  layers: {
@@ -32,6 +59,15 @@ export declare const mapPresetObsPP: {
32
59
  id: string;
33
60
  layerType: import("../../../store/mapStore/types").LayerType;
34
61
  }[];
62
+ proj: {
63
+ bbox: {
64
+ left: number;
65
+ bottom: number;
66
+ right: number;
67
+ top: number;
68
+ };
69
+ srs: string;
70
+ };
35
71
  };
36
72
  export declare const mapPresetObsRH: {
37
73
  layers: {
@@ -40,6 +76,15 @@ export declare const mapPresetObsRH: {
40
76
  id: string;
41
77
  layerType: import("../../../store/mapStore/types").LayerType;
42
78
  }[];
79
+ proj: {
80
+ bbox: {
81
+ left: number;
82
+ bottom: number;
83
+ right: number;
84
+ top: number;
85
+ };
86
+ srs: string;
87
+ };
43
88
  };
44
89
  export declare const mapPresetObsQG: {
45
90
  layers: {
@@ -48,6 +93,15 @@ export declare const mapPresetObsQG: {
48
93
  id: string;
49
94
  layerType: import("../../../store/mapStore/types").LayerType;
50
95
  }[];
96
+ proj: {
97
+ bbox: {
98
+ left: number;
99
+ bottom: number;
100
+ right: number;
101
+ top: number;
102
+ };
103
+ srs: string;
104
+ };
51
105
  };
52
106
  export declare const mapPresetEumetsat: {
53
107
  layers: {
@@ -75,6 +129,15 @@ export declare const mapPresetHarmoniePrecipitationFlux: {
75
129
  layerType: import("../../../store/mapStore/types").LayerType;
76
130
  enabled: boolean;
77
131
  }[];
132
+ proj: {
133
+ bbox: {
134
+ left: number;
135
+ bottom: number;
136
+ right: number;
137
+ top: number;
138
+ };
139
+ srs: string;
140
+ };
78
141
  };
79
142
  export declare const mapPresetHarmonieTemperature2m: {
80
143
  layers: {
@@ -84,6 +147,15 @@ export declare const mapPresetHarmonieTemperature2m: {
84
147
  layerType: import("../../../store/mapStore/types").LayerType;
85
148
  enabled: boolean;
86
149
  }[];
150
+ proj: {
151
+ bbox: {
152
+ left: number;
153
+ bottom: number;
154
+ right: number;
155
+ top: number;
156
+ };
157
+ srs: string;
158
+ };
87
159
  };
88
160
  export declare const mapPresetHarmoniePressureMSL: {
89
161
  layers: {
@@ -93,4 +165,13 @@ export declare const mapPresetHarmoniePressureMSL: {
93
165
  layerType: import("../../../store/mapStore/types").LayerType;
94
166
  enabled: boolean;
95
167
  }[];
168
+ proj: {
169
+ bbox: {
170
+ left: number;
171
+ bottom: number;
172
+ right: number;
173
+ top: number;
174
+ };
175
+ srs: string;
176
+ };
96
177
  };
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { Theme, SxProps } from '@mui/material';
3
+ import { CustomToggleButtonProps } from '../CustomToggleButton/CustomToggleButton';
4
+ export interface ToolButtonProps extends CustomToggleButtonProps {
5
+ active?: boolean;
6
+ width?: string;
7
+ height?: string;
8
+ value?: unknown;
9
+ sx?: SxProps<Theme>;
10
+ }
11
+ declare const ToolButton: React.FC<ToolButtonProps>;
12
+ export default ToolButton;
@@ -0,0 +1 @@
1
+ export {};
@@ -3,11 +3,11 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const ToggleIconButtonLight: {
6
+ export declare const ToolButtonLight: {
7
7
  (): React.ReactElement;
8
8
  storyName: string;
9
9
  };
10
- export declare const ToggleIconButtonDark: {
10
+ export declare const ToolButtonDark: {
11
11
  (): React.ReactElement;
12
12
  storyName: string;
13
13
  };
@@ -0,0 +1 @@
1
+ export { default as ToolButton } from './ToolButton';
package/lib/index.d.ts CHANGED
@@ -38,5 +38,7 @@ export { MultiDimensionSelectMapButtonsConnect, MultiMapDimensionSelectConnect,
38
38
  export * as publicLayers from './utils/publicLayers';
39
39
  export * as publicServices from './utils/publicServices';
40
40
  export * as testLayers from './utils/testLayers';
41
+ export * from './utils/jsonPresetFilter';
42
+ export * from './utils/types';
41
43
  export * as defaultConfigurations from './utils/defaultConfigurations';
42
44
  export * from './components/Providers/Providers';
@@ -94,4 +94,5 @@ export interface SyncGroupRemoveGroup extends Action {
94
94
  export interface SyncGroupClear extends Action {
95
95
  type: typeof SYNCGROUPS_CLEAR;
96
96
  }
97
+ export declare const SyncGroupTypeList: string[];
97
98
  export declare type SynchronizationGroupActions = SyncGroupsAddSource | SyncGroupsRemoveSource | SyncGroupAddTarget | SyncGroupRemoveTarget | SyncGroupLinkTarget | SyncGroupAddGroup | SyncGroupRemoveGroup | SyncGroupClear;
@@ -1,4 +1,4 @@
1
- import { LayerSelectActions, SetSearchFilterPayload, DisableActiveServicePayload, EnableActiveServicePayload, AddKeywordsAndActiveServicesPayload, UpdateKeywordsPayload } from './types';
1
+ import { LayerSelectActions, SetSearchFilterPayload, DisableActiveServicePayload, EnableActiveServicePayload, AddKeywordsAndActiveServicesPayload, LayerSelectServiceRemovedPayload, ToggleKeywordsPayload, EnableOnlyOneKeywordPayload } from './types';
2
2
  /**
3
3
  * Sets the given text to the searchFilter
4
4
  *
@@ -21,4 +21,6 @@ export declare const enableActiveService: (payload: EnableActiveServicePayload)
21
21
  */
22
22
  export declare const disableActiveService: (payload: DisableActiveServicePayload) => LayerSelectActions;
23
23
  export declare const addKeywordsAndActiveServices: (payload: AddKeywordsAndActiveServicesPayload) => LayerSelectActions;
24
- export declare const updateKeywords: (payload: UpdateKeywordsPayload) => LayerSelectActions;
24
+ export declare const layerSelectServiceRemoved: (payload: LayerSelectServiceRemovedPayload) => LayerSelectActions;
25
+ export declare const toggleKeywords: (payload: ToggleKeywordsPayload) => LayerSelectActions;
26
+ export declare const enableOnlyOneKeyword: (payload: EnableOnlyOneKeywordPayload) => LayerSelectActions;
@@ -2,4 +2,6 @@ export declare const LAYER_SELECT_SET_SEARCH_FILTER = "LAYER_SELECT_SET_SEARCH_F
2
2
  export declare const LAYER_SELECT_DISABLE_ACTIVE_SERVICE = "LAYER_SELECT_DISABLE_ACTIVE_SERVICE";
3
3
  export declare const LAYER_SELECT_ENABLE_ACTIVE_SERVICE = "LAYER_SELECT_ENABLE_ACTIVE_SERVICE";
4
4
  export declare const LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES = "LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES";
5
- export declare const LAYER_SELECT_UPDATE_KEYWORDS = "LAYER_SELECT_UPDATE_KEYWORDS";
5
+ export declare const LAYER_SELECT_SERVICE_REMOVED = "LAYER_SELECT_SERVICE_REMOVED";
6
+ export declare const LAYER_SELECT_TOGGLE_KEYWORDS = "LAYER_SELECT_TOGGLE_KEYWORDS";
7
+ export declare const LAYER_SELECT_ENABLE_ONLY_ONE_KEYWORD = "LAYER_SELECT_ENABLE_ONLY_ONE_KEYWORD";
@@ -1,5 +1,6 @@
1
1
  import { SagaIterator } from 'redux-saga';
2
2
  import { ServiceActions } from '../mapStore/types';
3
3
  export declare function newServiceAddedSaga(capturedAction: ServiceActions): SagaIterator;
4
+ export declare function layerSelectServiceRemovedSaga(capturedAction: ServiceActions): SagaIterator;
4
5
  export declare function rootSaga(): SagaIterator;
5
6
  export default rootSaga;
@@ -1,4 +1,5 @@
1
- import { KeywordObject, LayerSelectStoreType, ActiveServices } from './types';
1
+ import { AppStore } from '../../types/types';
2
+ import { LayerSelectStoreType, ActiveServices, KeywordObject } from './types';
2
3
  /**
3
4
  * Returns search filter string
4
5
  *
@@ -24,7 +25,7 @@ export declare const getSearchFilter: ((state: {
24
25
  *
25
26
  * Example getActiveServices(store);
26
27
  * @param {object} store store: object - store object
27
- * @returns {array} returnType: array of active services
28
+ * @returns {object} returnType: object of active services
28
29
  */
29
30
  export declare const getActiveServices: ((state: {
30
31
  advancedLayerStore?: import("../advancedLayerStore/types").AdvancedLayerStoreState;
@@ -34,7 +35,7 @@ export declare const getActiveServices: ((state: {
34
35
  services?: import("../mapStore/types").ServiceState;
35
36
  layers?: import("../mapStore/types").LayerState;
36
37
  layerSelect?: LayerSelectStoreType;
37
- }) => ActiveServices) & import("reselect").OutputSelectorFields<(args_0: LayerSelectStoreType) => ActiveServices & {
38
+ }) => ActiveServices) & import("reselect").OutputSelectorFields<((args_0: LayerSelectStoreType) => ActiveServices) & {
38
39
  clearCache: () => void;
39
40
  }> & {
40
41
  clearCache: () => void;
@@ -54,19 +55,19 @@ export declare const getEnabledServiceIds: ((state: {
54
55
  services?: import("../mapStore/types").ServiceState;
55
56
  layers?: import("../mapStore/types").LayerState;
56
57
  layerSelect?: LayerSelectStoreType;
57
- }) => string[]) & import("reselect").OutputSelectorFields<(args_0: LayerSelectStoreType) => string[] & {
58
+ }) => string[]) & import("reselect").OutputSelectorFields<((args_0: LayerSelectStoreType) => string[]) & {
58
59
  clearCache: () => void;
59
60
  }> & {
60
61
  clearCache: () => void;
61
62
  };
62
63
  /**
63
- * Returns all keywords
64
+ * Returns all ids of checked keywords
64
65
  *
65
- * Example getKeywords(store);
66
+ * Example getCheckedKeywordIds(store);
66
67
  * @param {object} store store: object - store object
67
- * @returns {array} returnType: array of keyword objects
68
+ * @returns {array} returnType: array of keyword ids that are checked
68
69
  */
69
- export declare const getKeywords: ((state: {
70
+ export declare const getCheckedKeywordIds: ((state: {
70
71
  advancedLayerStore?: import("../advancedLayerStore/types").AdvancedLayerStoreState;
71
72
  syncronizationGroupStore?: import("../generic/synchronizationGroups/types").SynchronizationGroupState;
72
73
  ui?: import("../ui/types").UIStoreType;
@@ -74,8 +75,57 @@ export declare const getKeywords: ((state: {
74
75
  services?: import("../mapStore/types").ServiceState;
75
76
  layers?: import("../mapStore/types").LayerState;
76
77
  layerSelect?: LayerSelectStoreType;
77
- }) => KeywordObject[]) & import("reselect").OutputSelectorFields<(args_0: LayerSelectStoreType) => KeywordObject[] & {
78
+ }) => string[]) & import("reselect").OutputSelectorFields<((args_0: LayerSelectStoreType) => string[]) & {
78
79
  clearCache: () => void;
79
80
  }> & {
80
81
  clearCache: () => void;
81
82
  };
83
+ /**
84
+ * Returns ids of all keywords
85
+ *
86
+ * Example getAllKeywordIds(store);
87
+ * @param {object} store store: object - store object
88
+ * @returns {array} returnType: array of all keyword ids
89
+ */
90
+ export declare const getAllKeywordIds: ((state: {
91
+ advancedLayerStore?: import("../advancedLayerStore/types").AdvancedLayerStoreState;
92
+ syncronizationGroupStore?: import("../generic/synchronizationGroups/types").SynchronizationGroupState;
93
+ ui?: import("../ui/types").UIStoreType;
94
+ webmap?: import("../mapStore/types").WebMapState;
95
+ services?: import("../mapStore/types").ServiceState;
96
+ layers?: import("../mapStore/types").LayerState;
97
+ layerSelect?: LayerSelectStoreType;
98
+ }) => string[]) & import("reselect").OutputSelectorFields<((args_0: LayerSelectStoreType) => string[]) & {
99
+ clearCache: () => void;
100
+ }> & {
101
+ clearCache: () => void;
102
+ };
103
+ /**
104
+ * Returns if all keywords are checked
105
+ *
106
+ * Example isAllKeywordsChecked(store);
107
+ * @param {object} store store: object - store object
108
+ * @returns {array} returnType: boolean if all keywords are checked
109
+ */
110
+ export declare const isAllKeywordsChecked: ((state: {
111
+ advancedLayerStore?: import("../advancedLayerStore/types").AdvancedLayerStoreState;
112
+ syncronizationGroupStore?: import("../generic/synchronizationGroups/types").SynchronizationGroupState;
113
+ ui?: import("../ui/types").UIStoreType;
114
+ webmap?: import("../mapStore/types").WebMapState;
115
+ services?: import("../mapStore/types").ServiceState;
116
+ layers?: import("../mapStore/types").LayerState;
117
+ layerSelect?: LayerSelectStoreType;
118
+ }) => boolean) & import("reselect").OutputSelectorFields<(args_0: LayerSelectStoreType) => boolean & {
119
+ clearCache: () => void;
120
+ }> & {
121
+ clearCache: () => void;
122
+ };
123
+ /**
124
+ * Gets a KeywordObject by its id
125
+ *
126
+ * Example: keywordObject = getKeywordObjectById(store, 'keywordId')
127
+ * @param {object} store object from which the keyword state will be extracted
128
+ * @param {string} keywordId Id of the keyword
129
+ * @returns {object} object containing keyword information (id, amount, amountVisible, checked)
130
+ */
131
+ export declare const getKeywordObjectById: (store: AppStore, keywordId: string) => KeywordObject;
@@ -1,5 +1,5 @@
1
1
  import { Action } from 'redux';
2
- import { LAYER_SELECT_SET_SEARCH_FILTER, LAYER_SELECT_ENABLE_ACTIVE_SERVICE, LAYER_SELECT_DISABLE_ACTIVE_SERVICE, LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES, LAYER_SELECT_UPDATE_KEYWORDS } from './constants';
2
+ import { LAYER_SELECT_SET_SEARCH_FILTER, LAYER_SELECT_ENABLE_ACTIVE_SERVICE, LAYER_SELECT_DISABLE_ACTIVE_SERVICE, LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES, LAYER_SELECT_SERVICE_REMOVED, LAYER_SELECT_TOGGLE_KEYWORDS, LAYER_SELECT_ENABLE_ONLY_ONE_KEYWORD } from './constants';
3
3
  export interface ActiveServiceObject {
4
4
  id?: string;
5
5
  enabled?: boolean;
@@ -13,10 +13,17 @@ export interface ActiveServiceType {
13
13
  allIds: string[];
14
14
  }
15
15
  export interface KeywordObject {
16
- id: string;
17
- amount: number;
18
- amountVisible: number;
19
- checked: boolean;
16
+ id?: string;
17
+ amount?: number;
18
+ amountVisible?: number;
19
+ checked?: boolean;
20
+ }
21
+ export interface Keywords {
22
+ [key: string]: KeywordObject;
23
+ }
24
+ export interface KeywordType {
25
+ byId: Keywords;
26
+ allIds: string[];
20
27
  }
21
28
  export interface LayerSelectModuleState {
22
29
  layerSelect?: LayerSelectStoreType;
@@ -27,7 +34,7 @@ export interface LayerSelectStoreType {
27
34
  export interface FiltersType {
28
35
  searchFilter: string;
29
36
  activeServices: ActiveServiceType;
30
- keywords: KeywordObject[];
37
+ keywords: KeywordType;
31
38
  }
32
39
  export interface SetSearchFilterPayload {
33
40
  filterText: string;
@@ -60,11 +67,25 @@ export interface AddKeywordsAndActiveServices extends Action {
60
67
  type: typeof LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES;
61
68
  payload: AddKeywordsAndActiveServicesPayload;
62
69
  }
63
- export interface UpdateKeywordsPayload {
64
- keywords: KeywordObject[];
70
+ export interface LayerSelectServiceRemovedPayload {
71
+ serviceUrl: string;
72
+ }
73
+ export interface LayerSelectServiceRemoved extends Action {
74
+ type: typeof LAYER_SELECT_SERVICE_REMOVED;
75
+ payload: LayerSelectServiceRemovedPayload;
76
+ }
77
+ export interface ToggleKeywordsPayload {
78
+ keywords: string[];
79
+ }
80
+ export interface ToggleKeywords extends Action {
81
+ type: typeof LAYER_SELECT_TOGGLE_KEYWORDS;
82
+ payload: ToggleKeywordsPayload;
83
+ }
84
+ export interface EnableOnlyOneKeywordPayload {
85
+ keyword: string;
65
86
  }
66
- export interface UpdateKeywords extends Action {
67
- type: typeof LAYER_SELECT_UPDATE_KEYWORDS;
68
- payload: UpdateKeywordsPayload;
87
+ export interface EnableOnlyOneKeyword extends Action {
88
+ type: typeof LAYER_SELECT_ENABLE_ONLY_ONE_KEYWORD;
89
+ payload: EnableOnlyOneKeywordPayload;
69
90
  }
70
- export declare type LayerSelectActions = SetSearchFilter | AddKeywordsAndActiveServices | EnableActiveService | DisableActiveService | DisableActiveService | UpdateKeywords;
91
+ export declare type LayerSelectActions = SetSearchFilter | AddKeywordsAndActiveServices | EnableActiveService | LayerSelectServiceRemoved | DisableActiveService | ToggleKeywords | EnableOnlyOneKeyword;