@opengeoweb/layer-select 19.0.0 → 19.1.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 (55) hide show
  1. package/dist/README.md +11 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.esm.js +3477 -0
  4. package/dist/src/index.d.ts +4 -0
  5. package/dist/src/lib/components/DataExplorerButtonConnect/DataExplorerButtonConnect.d.ts +8 -0
  6. package/dist/src/lib/components/DataExplorerButtonConnect/index.d.ts +1 -0
  7. package/dist/src/lib/components/KeywordFilterButton/KeywordFilterButtonConnect.d.ts +9 -0
  8. package/dist/src/lib/components/KeywordFilterButton/index.d.ts +1 -0
  9. package/dist/src/lib/components/KeywordFilterResults/KeywordFilterResults.d.ts +13 -0
  10. package/dist/src/lib/components/KeywordFilterResults/KeywordFilterResultsConnect.d.ts +8 -0
  11. package/dist/src/lib/components/KeywordFilterResults/KeywordFilterResultsListItemConnect.d.ts +6 -0
  12. package/dist/src/lib/components/KeywordFilterResults/KeywordFilterSelectAllSwitchConnect.d.ts +2 -0
  13. package/dist/src/lib/components/KeywordFilterResults/index.d.ts +4 -0
  14. package/dist/src/lib/components/LayerList/LayerAddRemoveButton.d.ts +26 -0
  15. package/dist/src/lib/components/LayerList/LayerList.d.ts +32 -0
  16. package/dist/src/lib/components/LayerList/LayerListConnect.d.ts +9 -0
  17. package/dist/src/lib/components/LayerList/LayerListDimensions.d.ts +7 -0
  18. package/dist/src/lib/components/LayerList/LayerListRow.d.ts +27 -0
  19. package/dist/src/lib/components/LayerList/index.d.ts +5 -0
  20. package/dist/src/lib/components/LayerSelect/LayerSelect.d.ts +21 -0
  21. package/dist/src/lib/components/LayerSelect/LayerSelectButtonConnect.d.ts +11 -0
  22. package/dist/src/lib/components/LayerSelect/LayerSelectConnect.d.ts +16 -0
  23. package/dist/src/lib/components/LayerSelect/LayerSelectUtils.d.ts +77 -0
  24. package/dist/src/lib/components/LayerSelect/index.d.ts +2 -0
  25. package/dist/src/lib/components/Providers/Providers.d.ts +22 -0
  26. package/dist/src/lib/components/Providers/index.d.ts +1 -0
  27. package/dist/src/lib/components/SearchField/SearchFieldConnect.d.ts +2 -0
  28. package/dist/src/lib/components/SearchField/index.d.ts +1 -0
  29. package/dist/src/lib/components/ServiceList/ServiceChip.d.ts +12 -0
  30. package/dist/src/lib/components/ServiceList/ServiceChipConnect.d.ts +10 -0
  31. package/dist/src/lib/components/ServiceList/ServiceList.d.ts +8 -0
  32. package/dist/src/lib/components/ServiceList/ServiceListConnect.d.ts +6 -0
  33. package/dist/src/lib/components/ServiceList/index.d.ts +4 -0
  34. package/dist/src/lib/components/ServiceOptionsButton/ServiceOptionsButton.d.ts +6 -0
  35. package/dist/src/lib/components/ServiceOptionsButton/index.d.ts +1 -0
  36. package/dist/src/lib/components/ServiceOptionsDialog/ServiceOptionsDialog.d.ts +20 -0
  37. package/dist/src/lib/components/ServiceOptionsDialog/ServiceOptionsDialogConnect.d.ts +8 -0
  38. package/dist/src/lib/components/ServiceOptionsDialog/index.d.ts +2 -0
  39. package/dist/src/lib/components/ServicePopup/ServicePopup.d.ts +21 -0
  40. package/dist/src/lib/components/ServicePopup/ServicePopupConnect.d.ts +2 -0
  41. package/dist/src/lib/components/ServicePopup/ServicePopupDialogConnect.d.ts +11 -0
  42. package/dist/src/lib/components/ServicePopup/index.d.ts +3 -0
  43. package/dist/src/lib/components/ServicePopup/utils.d.ts +14 -0
  44. package/dist/src/lib/components/index.d.ts +10 -0
  45. package/dist/src/lib/index.d.ts +2 -0
  46. package/dist/src/lib/store/index.d.ts +7 -0
  47. package/dist/src/lib/store/listeners.d.ts +2 -0
  48. package/dist/src/lib/store/reducer.d.ts +26 -0
  49. package/dist/src/lib/store/selectors.d.ts +200 -0
  50. package/dist/src/lib/store/store.d.ts +6 -0
  51. package/dist/src/lib/store/testData.d.ts +17 -0
  52. package/dist/src/lib/store/types.d.ts +72 -0
  53. package/dist/src/lib/store/utils.d.ts +9 -0
  54. package/dist/src/lib/utils/i18n.d.ts +7 -0
  55. package/package.json +2 -1
@@ -0,0 +1,200 @@
1
+ import type { TypedUseSelectorHook } from 'react-redux';
2
+ import type { LayerSelectStoreType, ActiveServiceObjectEntities, ServicePopupObject, LayerSelectModuleState, RootState, Filter, LayerWithServiceName } from './types';
3
+ export declare const useAppSelector: TypedUseSelectorHook<RootState>;
4
+ /**
5
+ * Returns search filter string
6
+ *
7
+ * Example getSearchFilter(store);
8
+ * @param {object} store store: object - store object
9
+ * @returns {array} returnType: string
10
+ */
11
+ export declare const getSearchFilter: ((state: LayerSelectModuleState) => string) & {
12
+ clearCache: () => void;
13
+ resultsCount: () => number;
14
+ resetResultsCount: () => void;
15
+ } & {
16
+ resultFunc: (resultFuncArgs_0: LayerSelectStoreType) => string;
17
+ memoizedResultFunc: ((resultFuncArgs_0: LayerSelectStoreType) => string) & {
18
+ clearCache: () => void;
19
+ resultsCount: () => number;
20
+ resetResultsCount: () => void;
21
+ };
22
+ lastResult: () => string;
23
+ dependencies: [(store: LayerSelectModuleState) => LayerSelectStoreType];
24
+ recomputations: () => number;
25
+ resetRecomputations: () => void;
26
+ dependencyRecomputations: () => number;
27
+ resetDependencyRecomputations: () => void;
28
+ } & {
29
+ argsMemoize: typeof import("reselect").weakMapMemoize;
30
+ memoize: typeof import("reselect").weakMapMemoize;
31
+ };
32
+ /**
33
+ * Returns active services array
34
+ *
35
+ * Example getActiveServices(store);
36
+ * @param {object} store store: object - store object
37
+ * @returns {ActiveServiceObjectEntities} returnType: ActiveServiceObjectEntitiesobject of active services
38
+ */
39
+ export declare const getActiveServices: (store: LayerSelectModuleState) => ActiveServiceObjectEntities;
40
+ export declare const getActiveServicesDictionary: (state: LayerSelectModuleState) => Record<string, import("./types").ActiveServiceObject>, getActiveServiceById: (state: LayerSelectModuleState, id: string) => {
41
+ serviceId?: string | undefined;
42
+ serviceName?: string | undefined;
43
+ serviceUrl?: string | undefined;
44
+ abstract?: string | undefined;
45
+ enabled?: boolean | undefined;
46
+ filterIds?: string[] | undefined;
47
+ scope?: import("@opengeoweb/shared").SystemScope | undefined;
48
+ isLoading?: boolean | undefined;
49
+ keywords?: string[] | undefined;
50
+ groups?: string[] | undefined;
51
+ isInSearch?: boolean | undefined;
52
+ type?: import("@opengeoweb/shared").ServiceInterface | undefined;
53
+ }, getAllActiveServices: (state: LayerSelectModuleState) => import("./types").ActiveServiceObject[];
54
+ /**
55
+ * Returns all ids of enabled services
56
+ *
57
+ * Example getEnabledServiceIds(store);
58
+ * @param {object} store store: object - store object
59
+ * @returns {array} returnType: array of service ids that are enabled
60
+ */
61
+ export declare const getEnabledServiceIds: ((state: LayerSelectModuleState) => string[]) & {
62
+ clearCache: () => void;
63
+ resultsCount: () => number;
64
+ resetResultsCount: () => void;
65
+ } & {
66
+ resultFunc: (resultFuncArgs_0: import("./types").ActiveServiceObject[]) => string[];
67
+ memoizedResultFunc: ((resultFuncArgs_0: import("./types").ActiveServiceObject[]) => string[]) & {
68
+ clearCache: () => void;
69
+ resultsCount: () => number;
70
+ resetResultsCount: () => void;
71
+ };
72
+ lastResult: () => string[];
73
+ dependencies: [(state: LayerSelectModuleState) => import("./types").ActiveServiceObject[]];
74
+ recomputations: () => number;
75
+ resetRecomputations: () => void;
76
+ dependencyRecomputations: () => number;
77
+ resetDependencyRecomputations: () => void;
78
+ } & {
79
+ argsMemoize: typeof import("reselect").weakMapMemoize;
80
+ memoize: typeof import("reselect").weakMapMemoize;
81
+ };
82
+ /**
83
+ * Returns ids of all keywords
84
+ *
85
+ * Example getAllKeywordIds(store);
86
+ * @param {object} store store: object - store object
87
+ * @returns {array} returnType: array of all keyword ids
88
+ */
89
+ export declare const getAllFilterIds: (store: LayerSelectModuleState) => string[];
90
+ export declare const getAllFilters: (state: LayerSelectModuleState) => Filter[], getAllFilterIdsEntity: (state: LayerSelectModuleState) => string[], getFilterById: (state: LayerSelectModuleState, id: string) => {
91
+ id: string;
92
+ name: string;
93
+ checked?: boolean | undefined;
94
+ amountVisible?: number | undefined;
95
+ type: import("./types").FilterType;
96
+ };
97
+ /**
98
+ * Returns all ids of checked keywords
99
+ *
100
+ * Example getCheckedKeywordIds(store);
101
+ * @param {object} store store: object - store object
102
+ * @returns {array} returnType: array of keyword ids that are checked
103
+ */
104
+ export declare const getCheckedFilterIds: ((state: LayerSelectModuleState) => string[]) & {
105
+ clearCache: () => void;
106
+ resultsCount: () => number;
107
+ resetResultsCount: () => void;
108
+ } & {
109
+ resultFunc: (resultFuncArgs_0: Filter[]) => string[];
110
+ memoizedResultFunc: ((resultFuncArgs_0: Filter[]) => string[]) & {
111
+ clearCache: () => void;
112
+ resultsCount: () => number;
113
+ resetResultsCount: () => void;
114
+ };
115
+ lastResult: () => string[];
116
+ dependencies: [(state: LayerSelectModuleState) => Filter[]];
117
+ recomputations: () => number;
118
+ resetRecomputations: () => void;
119
+ dependencyRecomputations: () => number;
120
+ resetDependencyRecomputations: () => void;
121
+ } & {
122
+ argsMemoize: typeof import("reselect").weakMapMemoize;
123
+ memoize: typeof import("reselect").weakMapMemoize;
124
+ };
125
+ export interface FiltersGrouped {
126
+ groups: Filter[];
127
+ keywords: Filter[];
128
+ }
129
+ export declare const getFilters: ((state: LayerSelectModuleState) => FiltersGrouped) & {
130
+ clearCache: () => void;
131
+ resultsCount: () => number;
132
+ resetResultsCount: () => void;
133
+ } & {
134
+ resultFunc: (resultFuncArgs_0: import("./types").ActiveServiceObject[], resultFuncArgs_1: Filter[]) => FiltersGrouped;
135
+ memoizedResultFunc: ((resultFuncArgs_0: import("./types").ActiveServiceObject[], resultFuncArgs_1: Filter[]) => FiltersGrouped) & {
136
+ clearCache: () => void;
137
+ resultsCount: () => number;
138
+ resetResultsCount: () => void;
139
+ };
140
+ lastResult: () => FiltersGrouped;
141
+ dependencies: [(state: LayerSelectModuleState) => import("./types").ActiveServiceObject[], (state: LayerSelectModuleState) => Filter[]];
142
+ recomputations: () => number;
143
+ resetRecomputations: () => void;
144
+ dependencyRecomputations: () => number;
145
+ resetDependencyRecomputations: () => void;
146
+ } & {
147
+ argsMemoize: typeof import("reselect").weakMapMemoize;
148
+ memoize: typeof import("reselect").weakMapMemoize;
149
+ };
150
+ /**
151
+ * Returns if all keywords are checked
152
+ *
153
+ * Example isAllKeywordsChecked(store);
154
+ * @param {object} store store: object - store object
155
+ * @returns {array} returnType: boolean if all keywords are checked
156
+ */
157
+ export declare const isAllFiltersChecked: ((state: LayerSelectModuleState) => boolean) & {
158
+ clearCache: () => void;
159
+ resultsCount: () => number;
160
+ resetResultsCount: () => void;
161
+ } & {
162
+ resultFunc: (resultFuncArgs_0: LayerSelectStoreType) => boolean;
163
+ memoizedResultFunc: ((resultFuncArgs_0: LayerSelectStoreType) => boolean) & {
164
+ clearCache: () => void;
165
+ resultsCount: () => number;
166
+ resetResultsCount: () => void;
167
+ };
168
+ lastResult: () => boolean;
169
+ dependencies: [(store: LayerSelectModuleState) => LayerSelectStoreType];
170
+ recomputations: () => number;
171
+ resetRecomputations: () => void;
172
+ dependencyRecomputations: () => number;
173
+ resetDependencyRecomputations: () => void;
174
+ } & {
175
+ argsMemoize: typeof import("reselect").weakMapMemoize;
176
+ memoize: typeof import("reselect").weakMapMemoize;
177
+ };
178
+ /**
179
+ * Returns a filtered active layer object based on the given filter settings
180
+ * Example: layerSelectSelectors.getFilteredLayers(store, filteredSettings);
181
+ * @param {object} store store: object - object from which the service state will be extracted
182
+ * @returns {array} returnType: LayerWithServiceName - an array of all filtered activelayers
183
+ */
184
+ export declare const getFilteredLayers: (store: RootState) => LayerWithServiceName[];
185
+ /**
186
+ * Returns service popup details
187
+ *
188
+ * Example getServicePopupDetails(store, 'server-id');
189
+ * @param {object} store store: object - store object
190
+ * @returns {object} returnType: object of active service
191
+ */
192
+ export declare const getServicePopupDetails: (store: LayerSelectModuleState) => ServicePopupObject;
193
+ /**
194
+ * Returns service with active filtered layers from seaerch
195
+ *
196
+ * Example getFilteredActiveServices(store);
197
+ * @param {object} store store: object - store object
198
+ * @returns {object} returnType: object of active service
199
+ */
200
+ export declare const getFilteredActiveServices: (store: RootState) => ActiveServiceObjectEntities;
@@ -0,0 +1,6 @@
1
+ import type { Middleware, Store } from '@reduxjs/toolkit';
2
+ import type { ReducerMap, WebMapStateModuleState, UIModuleState } from '@opengeoweb/store';
3
+ import type { LayerSelectModuleState } from './types';
4
+ export declare const layerSelectReducersMap: ReducerMap;
5
+ export declare const layerSelectMiddlewares: Middleware[];
6
+ export declare const createMockStore: (mockState?: WebMapStateModuleState | LayerSelectModuleState | UIModuleState) => Store;
@@ -0,0 +1,17 @@
1
+ export declare const savedStacService: {
2
+ id: string;
3
+ name: string;
4
+ scope: "user";
5
+ serviceUrl: string;
6
+ abstract: string;
7
+ type: "STAC";
8
+ layers: never[];
9
+ };
10
+ export declare const savedStacServiceInLocalStorage: {
11
+ [x: string]: {
12
+ name: string;
13
+ url: string;
14
+ abstract: string;
15
+ type: "STAC";
16
+ };
17
+ };
@@ -0,0 +1,72 @@
1
+ import type { EntityState } from '@reduxjs/toolkit';
2
+ import type { ServiceInterface, SystemScope } from '@opengeoweb/shared';
3
+ import type { CoreAppStore, serviceTypes } from '@opengeoweb/store';
4
+ export type RootState = CoreAppStore & LayerSelectModuleState;
5
+ export interface LayerWithServiceName extends serviceTypes.ServiceLayer {
6
+ serviceName: string;
7
+ }
8
+ export interface ActiveServiceObject {
9
+ serviceId?: string;
10
+ serviceName?: string;
11
+ serviceUrl?: string;
12
+ abstract?: string;
13
+ enabled?: boolean;
14
+ filterIds?: string[];
15
+ scope?: SystemScope;
16
+ isLoading?: boolean;
17
+ keywords?: string[];
18
+ groups?: string[];
19
+ isInSearch?: boolean;
20
+ type?: ServiceInterface;
21
+ }
22
+ export type FilterType = 'keywords' | 'groups';
23
+ export interface Filter {
24
+ id: string;
25
+ name: string;
26
+ checked?: boolean;
27
+ amountVisible?: number;
28
+ type: FilterType;
29
+ }
30
+ export type ActiveServiceObjectEntities = Record<string, ActiveServiceObject>;
31
+ export type Filters = EntityState<Filter, string>;
32
+ export type ActiveServiceType = EntityState<ActiveServiceObject, string>;
33
+ export interface FiltersType {
34
+ searchFilter: string;
35
+ activeServices: ActiveServiceType;
36
+ filters: Filters;
37
+ }
38
+ export type PopupVariant = 'edit' | 'add' | 'save' | 'show';
39
+ export interface ServicePopupObject {
40
+ isOpen: boolean;
41
+ variant: PopupVariant;
42
+ url?: string;
43
+ serviceId?: string;
44
+ }
45
+ export interface LayerSelectStoreType {
46
+ filters: FiltersType;
47
+ allServicesEnabled: boolean;
48
+ servicePopup: ServicePopupObject;
49
+ }
50
+ export interface LayerSelectModuleState {
51
+ layerSelect?: LayerSelectStoreType;
52
+ }
53
+ export interface SetSearchFilterPayload {
54
+ filterText: string;
55
+ }
56
+ export interface SetAllServicesEnabledPayload {
57
+ allServicesEnabled: boolean;
58
+ }
59
+ export interface ToggleServicePopupPayload {
60
+ url?: string;
61
+ variant: PopupVariant;
62
+ serviceId?: string;
63
+ isOpen: boolean;
64
+ }
65
+ export interface LayerSelectRemoveServicePayload {
66
+ serviceId: string;
67
+ serviceUrl?: string;
68
+ }
69
+ export interface ToggleKeywordsPayload {
70
+ filterId: string;
71
+ only?: boolean;
72
+ }
@@ -0,0 +1,9 @@
1
+ import type { Draft, EntityAdapter } from '@reduxjs/toolkit';
2
+ import type { SystemScope } from '@opengeoweb/shared';
3
+ import type { serviceTypes } from '@opengeoweb/store';
4
+ import type { LayerProps } from '@opengeoweb/webmap';
5
+ import type { Filter, FilterType, LayerSelectStoreType } from './types';
6
+ export declare const getFilterId: (filterType: FilterType, filterName: string) => string;
7
+ export declare const produceFilters: (filterNames: string[], filterType: FilterType, draft: Draft<LayerSelectStoreType>, layerSelectFilterAdapter: EntityAdapter<Filter, string>) => void;
8
+ export declare const filterLayersFromService: (serviceId: string, services: serviceTypes.Services, filterIds: string[], allFiltersActive: boolean, searchString: string) => LayerProps[];
9
+ export declare const isUserAddedService: (scope: SystemScope) => boolean;
@@ -0,0 +1,7 @@
1
+ import i18n from 'i18next';
2
+ import type { UseTranslationResponse } from 'react-i18next';
3
+ export declare const LAYER_SELECT_NAMESPACE = "layerselect";
4
+ export declare const initLayerSelectI18n: () => typeof i18n;
5
+ export declare const useLayerSelectTranslation: () => UseTranslationResponse<typeof LAYER_SELECT_NAMESPACE, typeof i18n>;
6
+ export declare const translateInTestsAndStories: (key: string, params?: Record<string, string | number> | undefined) => string;
7
+ export { i18n };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/layer-select",
3
- "version": "19.0.0",
3
+ "version": "19.1.1",
4
4
  "description": "GeoWeb layer select library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -46,6 +46,7 @@
46
46
  },
47
47
  "files": [
48
48
  "dist",
49
+ "!dist/package.json",
49
50
  "README.md",
50
51
  "package.json"
51
52
  ]