@opengeoweb/layer-select 9.22.0 → 9.24.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/index.esm.js +166 -313
- package/package.json +1 -4
- package/src/lib/components/KeywordFilterResults/index.d.ts +0 -1
- package/src/lib/store/listeners.d.ts +2 -0
- package/src/lib/store/listeners.spec.d.ts +1 -0
- package/src/lib/store/types.d.ts +2 -5
- package/src/lib/components/KeywordFilterResults/KeywordFilterResultsListItem.d.ts +0 -8
- package/src/lib/store/sagas.d.ts +0 -8
- /package/src/lib/{store/sagas.spec.d.ts → components/LayerSelect/LayerSelectConnect.integration.spec.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -2,15 +2,12 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { useSelector, useDispatch } from 'react-redux';
|
|
5
|
-
import { CustomIconButton, ToolContainerDraggable, CustomAccordion, CustomToggleButton, CustomTooltip, SearchHighlight, SearchField, ToggleMenu } from '@opengeoweb/shared';
|
|
5
|
+
import { CustomIconButton, FilterListItem, ToolContainerDraggable, CustomAccordion, CustomToggleButton, CustomTooltip, SearchHighlight, SearchField, ToggleMenu } from '@opengeoweb/shared';
|
|
6
6
|
import { Filter, LayersAdd, Add, Cached, Edit, Visibility, Delete, Close, Copy } from '@opengeoweb/theme';
|
|
7
|
-
import { uiTypes, serviceActions, selectorMemoizationOptions, serviceSelectors, uiActions,
|
|
8
|
-
import { createEntityAdapter, createSlice, createSelector } from '@reduxjs/toolkit';
|
|
7
|
+
import { uiTypes, serviceActions, selectorMemoizationOptions, serviceSelectors, uiActions, getUserAddedServices, setUserAddedServices, layerActions, uiSelectors, layerSelectors, useSetupDialog, mapSelectors, layerTypes } from '@opengeoweb/store';
|
|
8
|
+
import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit';
|
|
9
9
|
import { compact, countBy, partition } from 'lodash';
|
|
10
|
-
import {
|
|
11
|
-
import { getSagaExtension } from '@redux-eggs/saga-extension';
|
|
12
|
-
import { takeEvery, select, put, all } from 'redux-saga/effects';
|
|
13
|
-
import { ListItem, ListItemIcon, Checkbox, Typography, ListItemSecondaryAction, Switch, Grid, List, Box, Backdrop, CircularProgress, Button, ListItemText, Dialog, DialogTitle, LinearProgress, DialogContent, InputAdornment, DialogActions } from '@mui/material';
|
|
10
|
+
import { Switch, Grid, List, Box, Typography, Backdrop, CircularProgress, Button, ListItem, ListItemText, ListItemSecondaryAction, Dialog, DialogTitle, LinearProgress, DialogContent, InputAdornment, DialogActions } from '@mui/material';
|
|
14
11
|
import i18n from 'i18next';
|
|
15
12
|
import { useTranslation } from 'react-i18next';
|
|
16
13
|
import { FixedSizeList } from 'react-window';
|
|
@@ -24,7 +21,6 @@ var en = {
|
|
|
24
21
|
"layer-select": "Layer Select",
|
|
25
22
|
"select-all": "Select all",
|
|
26
23
|
"groups-and-keywords-dialog-title": "Groups & Keywords",
|
|
27
|
-
only: "ONLY",
|
|
28
24
|
add: "add",
|
|
29
25
|
remove: "remove",
|
|
30
26
|
"layer-list-results": "results",
|
|
@@ -60,47 +56,45 @@ var en = {
|
|
|
60
56
|
};
|
|
61
57
|
var fi = {
|
|
62
58
|
"layer-select": "Layer Select",
|
|
63
|
-
"select-all": "
|
|
64
|
-
"groups-and-keywords-dialog-title": "
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"service
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"validations-
|
|
88
|
-
"validations-service-
|
|
89
|
-
"validations-
|
|
90
|
-
"validations-
|
|
91
|
-
"
|
|
92
|
-
"service-
|
|
93
|
-
"service-
|
|
94
|
-
"service-
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"service-has-been-deleted": "Ei käännetty"
|
|
59
|
+
"select-all": "Valitse kaikki",
|
|
60
|
+
"groups-and-keywords-dialog-title": "Ryhmät ja Avainsanat",
|
|
61
|
+
add: "lisää",
|
|
62
|
+
remove: "poista",
|
|
63
|
+
"layer-list-results": "tulosta",
|
|
64
|
+
groups: "Ryhmät",
|
|
65
|
+
keywords: "Avainsanat",
|
|
66
|
+
"layer-select-button-tooltip": "Avaa Layer Select",
|
|
67
|
+
all: "Kaikki",
|
|
68
|
+
services: "Palvelut",
|
|
69
|
+
"add-a-new-service": "Lisää uusi pavelu",
|
|
70
|
+
"update-service-title": "Päivitä karttatasot WMS palvelusta",
|
|
71
|
+
"edit-service-title": "Muokkaa palvelua",
|
|
72
|
+
"save-service-title": "Tallenna palvelu",
|
|
73
|
+
"show-service-title": "Näytä palvelu",
|
|
74
|
+
"service-has-active-layers-error": "Palvelu sisältää aktiivisia karttatasoja. Palvelua ei voi poistaa",
|
|
75
|
+
"delete-service": "Poista palvelu",
|
|
76
|
+
"copy-url-message": "Palvelun osoite kopioitu leikepöydälle",
|
|
77
|
+
"get-success-message": "Palvelu \"{{serviceName}}\" tallennettu onnistuneesti",
|
|
78
|
+
"service-popup-helper-text": "Lyhyt kuvaus siitä mitä palvelu tekee",
|
|
79
|
+
close: "sulje",
|
|
80
|
+
cancel: "peruuta",
|
|
81
|
+
save: "tallenna",
|
|
82
|
+
"validations-name-existing": "Nimi on jo käytössä. Valitse toinen nimi.",
|
|
83
|
+
"validations-service-existing": "Osoite on jo käytössä.",
|
|
84
|
+
"validations-service-valid-url": "Epäkelpo URL-osoite",
|
|
85
|
+
"validations-request-failed": "Lataus epäonnistui. Tarkista URL-osoite",
|
|
86
|
+
"validations-field-required": "Kenttä tulee täyttää",
|
|
87
|
+
"service-url-label": "Tämä palvelu viittaa tähän URL-osoitteeseen",
|
|
88
|
+
"service-name-label": "Palvelun nimi",
|
|
89
|
+
"service-abstracts-label": "Tiivistelmä",
|
|
90
|
+
"service-successfully-updated": "Palvelu \"{{serviceName}}\" päivitetty onnistuunnesti",
|
|
91
|
+
"unable-to-update-service": "Palvelun päivitys epäonnistui. Syy: \"{{message}}\"",
|
|
92
|
+
"service-has-been-deleted": "Palvelu \"{{serviceName}}\" poistettu"
|
|
98
93
|
};
|
|
99
94
|
var no = {
|
|
100
95
|
"layer-select": "Lagvalg",
|
|
101
96
|
"select-all": "Velg alle",
|
|
102
97
|
"groups-and-keywords-dialog-title": "Grupper & Nøkkelord",
|
|
103
|
-
only: "BARE",
|
|
104
98
|
add: "legg til",
|
|
105
99
|
remove: "fjern",
|
|
106
100
|
"layer-list-results": "resultat",
|
|
@@ -138,7 +132,6 @@ var nl = {
|
|
|
138
132
|
"layer-select": "Layer Select",
|
|
139
133
|
"select-all": "Selecteer alles",
|
|
140
134
|
"groups-and-keywords-dialog-title": "Groepen & Trefwoorden",
|
|
141
|
-
only: "ALLEEN",
|
|
142
135
|
add: "toevoegen",
|
|
143
136
|
remove: "verwijderen",
|
|
144
137
|
"layer-list-results": "resultaten",
|
|
@@ -2798,117 +2791,137 @@ var types = /*#__PURE__*/Object.freeze({
|
|
|
2798
2791
|
__proto__: null
|
|
2799
2792
|
});
|
|
2800
2793
|
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
}
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
}
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2794
|
+
/******************************************************************************
|
|
2795
|
+
Copyright (c) Microsoft Corporation.
|
|
2796
|
+
|
|
2797
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
2798
|
+
purpose with or without fee is hereby granted.
|
|
2799
|
+
|
|
2800
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2801
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2802
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2803
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2804
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2805
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2806
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
2807
|
+
***************************************************************************** */
|
|
2808
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
2809
|
+
|
|
2810
|
+
|
|
2811
|
+
function __rest(s, e) {
|
|
2812
|
+
var t = {};
|
|
2813
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2814
|
+
t[p] = s[p];
|
|
2815
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2816
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2817
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2818
|
+
t[p[i]] = s[p[i]];
|
|
2819
|
+
}
|
|
2820
|
+
return t;
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2824
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2825
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2826
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2827
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2828
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2829
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2830
|
+
});
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2834
|
+
var e = new Error(message);
|
|
2835
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2836
|
+
};
|
|
2837
|
+
|
|
2838
|
+
const layerSelectListener = createListenerMiddleware();
|
|
2839
|
+
layerSelectListener.startListening({
|
|
2840
|
+
actionCreator: serviceActions.mapStoreRemoveService,
|
|
2841
|
+
effect: action => __awaiter(void 0, void 0, void 0, function* () {
|
|
2842
|
+
const {
|
|
2843
|
+
serviceUrl
|
|
2844
|
+
} = action.payload;
|
|
2845
|
+
const localStorageServices = getUserAddedServices();
|
|
2846
|
+
delete localStorageServices[serviceUrl];
|
|
2847
|
+
setUserAddedServices(localStorageServices);
|
|
2848
|
+
})
|
|
2849
|
+
});
|
|
2850
|
+
layerSelectListener.startListening({
|
|
2851
|
+
actionCreator: layerSelectActions.layerSelectRemoveService,
|
|
2852
|
+
effect: (action, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2853
|
+
const removedService = action.payload;
|
|
2854
|
+
const {
|
|
2855
|
+
serviceId,
|
|
2856
|
+
serviceUrl
|
|
2857
|
+
} = removedService;
|
|
2858
|
+
const services = getActiveServices(listenerApi.getState());
|
|
2859
|
+
const servicesEnabled = Object.values(services).find(service => service === null || service === void 0 ? void 0 : service.enabled);
|
|
2860
|
+
if (servicesEnabled === undefined) {
|
|
2861
|
+
Object.entries(services).map(([entryServiceId]) => {
|
|
2862
|
+
return listenerApi.dispatch(layerSelectActions.enableActiveService({
|
|
2863
|
+
serviceId: entryServiceId
|
|
2864
|
+
}));
|
|
2865
|
+
});
|
|
2866
|
+
}
|
|
2867
|
+
listenerApi.dispatch(serviceActions.mapStoreRemoveService({
|
|
2868
|
+
id: serviceId,
|
|
2869
|
+
serviceUrl: serviceUrl
|
|
2853
2870
|
}));
|
|
2854
|
-
}
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
payload
|
|
2862
|
-
}) {
|
|
2863
|
-
const {
|
|
2864
|
-
scope,
|
|
2865
|
-
name,
|
|
2866
|
-
serviceUrl,
|
|
2867
|
-
abstract
|
|
2868
|
-
} = payload;
|
|
2869
|
-
if (!isUserAddedService(scope)) {
|
|
2870
|
-
return;
|
|
2871
|
-
}
|
|
2872
|
-
const localStorageServices = getUserAddedServices();
|
|
2873
|
-
setUserAddedServices(Object.assign(Object.assign({}, localStorageServices), {
|
|
2874
|
-
[serviceUrl]: {
|
|
2871
|
+
})
|
|
2872
|
+
});
|
|
2873
|
+
layerSelectListener.startListening({
|
|
2874
|
+
actionCreator: serviceActions.serviceSetLayers,
|
|
2875
|
+
effect: action => __awaiter(void 0, void 0, void 0, function* () {
|
|
2876
|
+
const {
|
|
2877
|
+
scope,
|
|
2875
2878
|
name,
|
|
2876
|
-
|
|
2879
|
+
serviceUrl,
|
|
2877
2880
|
abstract
|
|
2881
|
+
} = action.payload;
|
|
2882
|
+
if (isUserAddedService(scope)) {
|
|
2883
|
+
const localStorageServices = getUserAddedServices();
|
|
2884
|
+
setUserAddedServices(Object.assign(Object.assign({}, localStorageServices), {
|
|
2885
|
+
[serviceUrl]: {
|
|
2886
|
+
name,
|
|
2887
|
+
url: serviceUrl,
|
|
2888
|
+
abstract
|
|
2889
|
+
}
|
|
2890
|
+
}));
|
|
2878
2891
|
}
|
|
2879
|
-
})
|
|
2880
|
-
}
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
}
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
extensions: [getSagaExtension()]
|
|
2892
|
+
})
|
|
2893
|
+
});
|
|
2894
|
+
layerSelectListener.startListening({
|
|
2895
|
+
matcher: isAnyOf(uiActions.setToggleOpenDialog, uiActions.setActiveMapIdForDialog),
|
|
2896
|
+
effect: (action, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2897
|
+
const {
|
|
2898
|
+
payload
|
|
2899
|
+
} = action;
|
|
2900
|
+
if (!payload.setOpen && payload.type === uiTypes.DialogTypes.LayerSelect) {
|
|
2901
|
+
listenerApi.dispatch(layerActions.hideLayerInfo());
|
|
2902
|
+
}
|
|
2903
|
+
})
|
|
2904
|
+
});
|
|
2905
|
+
layerSelectListener.startListening({
|
|
2906
|
+
matcher: isAnyOf(layerSelectActions.disableActiveService, layerSelectActions.onlyThisServiceEnabled, layerSelectActions.toggleFilter, layerSelectActions.setSearchFilter),
|
|
2907
|
+
effect: (action, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2908
|
+
if (uiSelectors.getisDialogOpen(listenerApi.getState(), uiTypes.DialogTypes.LayerInfo)) {
|
|
2909
|
+
const filteredLayers = getFilteredLayers(listenerApi.getState());
|
|
2910
|
+
const dialogInfo = layerSelectors.getActiveLayerInfo(listenerApi.getState());
|
|
2911
|
+
const layerWithData = dialogInfo && serviceSelectors.getLayerFromService(listenerApi.getState(), dialogInfo.serviceUrl, dialogInfo.layerName);
|
|
2912
|
+
if (!filteredLayers.map(layer => layer.title).includes((layerWithData === null || layerWithData === void 0 ? void 0 : layerWithData.title) || '')) {
|
|
2913
|
+
listenerApi.dispatch(layerActions.hideLayerInfo());
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
})
|
|
2905
2917
|
});
|
|
2918
|
+
|
|
2906
2919
|
const layerSelectConfig = {
|
|
2907
2920
|
id: 'layerSelect-module',
|
|
2908
2921
|
reducersMap: {
|
|
2909
2922
|
layerSelect: reducer
|
|
2910
2923
|
},
|
|
2911
|
-
|
|
2924
|
+
middlewares: [layerSelectListener.middleware]
|
|
2912
2925
|
};
|
|
2913
2926
|
|
|
2914
2927
|
const KeywordFilterButtonConnect = ({
|
|
@@ -2939,128 +2952,6 @@ const KeywordFilterButtonConnect = ({
|
|
|
2939
2952
|
}));
|
|
2940
2953
|
};
|
|
2941
2954
|
|
|
2942
|
-
const LAYER_SELECT_NAMESPACE = 'layerselect';
|
|
2943
|
-
const useLayerSelectTranslation = () => useTranslation(LAYER_SELECT_NAMESPACE);
|
|
2944
|
-
const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, Object.assign({
|
|
2945
|
-
ns: [LAYER_SELECT_NAMESPACE]
|
|
2946
|
-
}, params));
|
|
2947
|
-
|
|
2948
|
-
const FilterListItem = ({
|
|
2949
|
-
filter,
|
|
2950
|
-
toggleFilter,
|
|
2951
|
-
enableOnlyOneFilter
|
|
2952
|
-
}) => {
|
|
2953
|
-
const {
|
|
2954
|
-
t
|
|
2955
|
-
} = useLayerSelectTranslation();
|
|
2956
|
-
const [isHovering, setIsHovering] = React.useState(false);
|
|
2957
|
-
const handleMouseEnter = React.useCallback(() => {
|
|
2958
|
-
setIsHovering(true);
|
|
2959
|
-
}, []);
|
|
2960
|
-
const handleMouseLeave = React.useCallback(() => {
|
|
2961
|
-
setIsHovering(false);
|
|
2962
|
-
}, []);
|
|
2963
|
-
const selectOnlyOne = filterId => {
|
|
2964
|
-
enableOnlyOneFilter(filterId);
|
|
2965
|
-
};
|
|
2966
|
-
const toggleCheckbox = filterId => {
|
|
2967
|
-
toggleFilter([filterId]);
|
|
2968
|
-
};
|
|
2969
|
-
const mouseMoveRef = React.useRef(null);
|
|
2970
|
-
React.useEffect(() => {
|
|
2971
|
-
window.addEventListener('mousemove', checkHover, true);
|
|
2972
|
-
return () => {
|
|
2973
|
-
window.removeEventListener('mousemove', checkHover, true);
|
|
2974
|
-
};
|
|
2975
|
-
});
|
|
2976
|
-
const checkHover = e => {
|
|
2977
|
-
if (mouseMoveRef.current) {
|
|
2978
|
-
const mouseOver = mouseMoveRef.current.contains(e.target);
|
|
2979
|
-
if (!isHovering && mouseOver) {
|
|
2980
|
-
handleMouseEnter();
|
|
2981
|
-
}
|
|
2982
|
-
if (isHovering && !mouseOver) {
|
|
2983
|
-
handleMouseLeave();
|
|
2984
|
-
}
|
|
2985
|
-
}
|
|
2986
|
-
};
|
|
2987
|
-
if (filter.amountVisible !== 0) {
|
|
2988
|
-
return jsx("div", Object.assign({
|
|
2989
|
-
ref: mouseMoveRef,
|
|
2990
|
-
onMouseEnter: handleMouseEnter,
|
|
2991
|
-
onMouseLeave: handleMouseLeave,
|
|
2992
|
-
onFocus: handleMouseEnter,
|
|
2993
|
-
onBlur: handleMouseLeave
|
|
2994
|
-
}, {
|
|
2995
|
-
children: jsxs(ListItem, Object.assign({
|
|
2996
|
-
sx: {
|
|
2997
|
-
width: '100%',
|
|
2998
|
-
minWidth: '300px',
|
|
2999
|
-
padding: '0px',
|
|
3000
|
-
paddingLeft: '0px',
|
|
3001
|
-
paddingRight: '50px',
|
|
3002
|
-
fontSize: '12px'
|
|
3003
|
-
}
|
|
3004
|
-
}, {
|
|
3005
|
-
children: [jsx(ListItemIcon, Object.assign({
|
|
3006
|
-
sx: {
|
|
3007
|
-
minWidth: '42px'
|
|
3008
|
-
}
|
|
3009
|
-
}, {
|
|
3010
|
-
children: jsx(Checkbox, {
|
|
3011
|
-
inputProps: {
|
|
3012
|
-
'aria-label': filter.name
|
|
3013
|
-
},
|
|
3014
|
-
color: "secondary",
|
|
3015
|
-
checked: filter.checked,
|
|
3016
|
-
onChange: () => {
|
|
3017
|
-
toggleCheckbox(filter.id);
|
|
3018
|
-
},
|
|
3019
|
-
sx: {
|
|
3020
|
-
paddingTop: '6px',
|
|
3021
|
-
paddingBottom: '7px',
|
|
3022
|
-
'&&:hover': {
|
|
3023
|
-
backgroundColor: 'transparent'
|
|
3024
|
-
}
|
|
3025
|
-
}
|
|
3026
|
-
})
|
|
3027
|
-
})), jsxs(Typography, Object.assign({
|
|
3028
|
-
variant: "body2",
|
|
3029
|
-
sx: {
|
|
3030
|
-
fontSize: '16px',
|
|
3031
|
-
textOverflow: 'ellipsis',
|
|
3032
|
-
whiteSpace: 'nowrap',
|
|
3033
|
-
overflow: 'hidden'
|
|
3034
|
-
}
|
|
3035
|
-
}, {
|
|
3036
|
-
children: [filter.name, " (", filter.amountVisible, ")"]
|
|
3037
|
-
})), isHovering ? jsx(ListItemSecondaryAction, {
|
|
3038
|
-
children: jsx(CustomIconButton, Object.assign({
|
|
3039
|
-
"aria-label": `Only ${filter.name}`,
|
|
3040
|
-
style: {
|
|
3041
|
-
backgroundColor: 'transparent',
|
|
3042
|
-
width: 'auto'
|
|
3043
|
-
},
|
|
3044
|
-
edge: "end",
|
|
3045
|
-
onClick: () => selectOnlyOne(filter.id)
|
|
3046
|
-
}, {
|
|
3047
|
-
children: jsx(Typography, Object.assign({
|
|
3048
|
-
sx: {
|
|
3049
|
-
color: 'geowebColors.buttons.primary.default.fill',
|
|
3050
|
-
fontSize: '14px',
|
|
3051
|
-
fontWeight: 500
|
|
3052
|
-
}
|
|
3053
|
-
}, {
|
|
3054
|
-
children: t('only')
|
|
3055
|
-
}))
|
|
3056
|
-
}))
|
|
3057
|
-
}) : null]
|
|
3058
|
-
}))
|
|
3059
|
-
}));
|
|
3060
|
-
}
|
|
3061
|
-
return null;
|
|
3062
|
-
};
|
|
3063
|
-
|
|
3064
2955
|
const KeywordFilterResultsListItemConnect = ({
|
|
3065
2956
|
filter
|
|
3066
2957
|
}) => {
|
|
@@ -3103,6 +2994,12 @@ const KeywordFilterSelectAllSwitchConnect = () => {
|
|
|
3103
2994
|
});
|
|
3104
2995
|
};
|
|
3105
2996
|
|
|
2997
|
+
const LAYER_SELECT_NAMESPACE = 'layerselect';
|
|
2998
|
+
const useLayerSelectTranslation = () => useTranslation(LAYER_SELECT_NAMESPACE);
|
|
2999
|
+
const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, Object.assign({
|
|
3000
|
+
ns: [LAYER_SELECT_NAMESPACE]
|
|
3001
|
+
}, params));
|
|
3002
|
+
|
|
3106
3003
|
const listStyle = {
|
|
3107
3004
|
padding: '0px'
|
|
3108
3005
|
};
|
|
@@ -3911,50 +3808,6 @@ const ServiceListConnect = ({
|
|
|
3911
3808
|
});
|
|
3912
3809
|
};
|
|
3913
3810
|
|
|
3914
|
-
/******************************************************************************
|
|
3915
|
-
Copyright (c) Microsoft Corporation.
|
|
3916
|
-
|
|
3917
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
3918
|
-
purpose with or without fee is hereby granted.
|
|
3919
|
-
|
|
3920
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3921
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3922
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3923
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3924
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3925
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3926
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
3927
|
-
***************************************************************************** */
|
|
3928
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
function __rest(s, e) {
|
|
3932
|
-
var t = {};
|
|
3933
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3934
|
-
t[p] = s[p];
|
|
3935
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3936
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3937
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3938
|
-
t[p[i]] = s[p[i]];
|
|
3939
|
-
}
|
|
3940
|
-
return t;
|
|
3941
|
-
}
|
|
3942
|
-
|
|
3943
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
3944
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3945
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3946
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
3947
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
3948
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
3949
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
3950
|
-
});
|
|
3951
|
-
}
|
|
3952
|
-
|
|
3953
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
3954
|
-
var e = new Error(message);
|
|
3955
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
3956
|
-
};
|
|
3957
|
-
|
|
3958
3811
|
const styles = {
|
|
3959
3812
|
servicesContainer: {
|
|
3960
3813
|
width: '360px',
|
|
@@ -5177,4 +5030,4 @@ const LayerSelectConnect = ({
|
|
|
5177
5030
|
});
|
|
5178
5031
|
};
|
|
5179
5032
|
|
|
5180
|
-
export { AllChipConnect,
|
|
5033
|
+
export { AllChipConnect, KeywordFilterButtonConnect, KeywordFilterResults, KeywordFilterResultsConnect, KeywordFilterResultsListItemConnect, KeywordFilterSelectAllSwitchConnect, LAYER_SELECT_NAMESPACE, LayerAddRemoveButton, LayerList, LayerListConnect, LayerListDimensions, LayerListRow, LayerSelectButtonConnect, LayerSelectConnect, SearchFieldConnect, ServiceChip, ServiceChipConnect, ServiceList, ServiceListConnect, ServiceOptionsButton, ServiceOptionsDialog, ServiceOptionsDialogConnect, ServicePopup, ServicePopupConnect, ServicePopupDialogConnect, getServiceFailedUpdateMessage, getServiceSuccesUpdateMessage, getSuccesMessage, isUserAddedService, layerSelectActions, layerSelectConfig, initialState as layerSelectInitialState, reducer as layerSelectReducer, selectors as layerSelectSelectors, layerSelectTranslations, types as layerSelectTypes, useAppSelector };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/layer-select",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.24.0",
|
|
4
4
|
"description": "GeoWeb layer select library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -21,10 +21,7 @@
|
|
|
21
21
|
"react-hook-form": "^7.50.1",
|
|
22
22
|
"@reduxjs/toolkit": "^1.9.7",
|
|
23
23
|
"@redux-eggs/core": "^2.2.0",
|
|
24
|
-
"@redux-eggs/redux-toolkit": "^2.2.0",
|
|
25
|
-
"@redux-eggs/saga-extension": "^2.2.0",
|
|
26
24
|
"lodash": "^4.17.21",
|
|
27
|
-
"redux-saga": "^1.2.3",
|
|
28
25
|
"i18next": "^23.11.5",
|
|
29
26
|
"react-i18next": "^14.1.2"
|
|
30
27
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/src/lib/store/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FilterListItemFilter } from '@opengeoweb/shared';
|
|
1
2
|
import { CoreAppStore, serviceTypes } from '@opengeoweb/store';
|
|
2
3
|
import { EntityState } from '@reduxjs/toolkit';
|
|
3
4
|
export type RootState = CoreAppStore & LayerSelectModuleState;
|
|
@@ -17,12 +18,8 @@ export interface ActiveServiceObject {
|
|
|
17
18
|
groups?: string[];
|
|
18
19
|
}
|
|
19
20
|
export type FilterType = 'keywords' | 'groups';
|
|
20
|
-
export interface Filter {
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
checked?: boolean;
|
|
21
|
+
export interface Filter extends FilterListItemFilter {
|
|
24
22
|
type: FilterType;
|
|
25
|
-
amountVisible?: number;
|
|
26
23
|
}
|
|
27
24
|
export type ActiveServiceObjectEntities = Record<string, ActiveServiceObject>;
|
|
28
25
|
export type Filters = EntityState<Filter>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { layerSelectTypes } from '../../store';
|
|
3
|
-
export interface FilterListItemProps {
|
|
4
|
-
filter: layerSelectTypes.Filter;
|
|
5
|
-
toggleFilter: (filterIds: string[]) => void;
|
|
6
|
-
enableOnlyOneFilter: (filterId: string) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const FilterListItem: React.FC<FilterListItemProps>;
|
package/src/lib/store/sagas.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SagaIterator } from 'redux-saga';
|
|
2
|
-
import { serviceActions, uiActions } from '@opengeoweb/store';
|
|
3
|
-
import { layerSelectActions, LayerSelectActions } from './reducer';
|
|
4
|
-
export declare function layerSelectCloseInfoDialogSaga({ type, payload, }: ReturnType<typeof uiActions.setToggleOpenDialog | typeof uiActions.setActiveMapIdForDialog | typeof layerSelectActions.disableActiveService | typeof layerSelectActions.toggleFilter | typeof layerSelectActions.setSearchFilter>): SagaIterator;
|
|
5
|
-
export declare function layerSelectRemoveServiceSaga(capturedAction: LayerSelectActions): SagaIterator;
|
|
6
|
-
export declare function addServiceToLocalStorageSaga({ payload, }: ReturnType<typeof serviceActions.serviceSetLayers>): void;
|
|
7
|
-
export declare function removeServiceFromLocalStorageSaga({ payload, }: ReturnType<typeof serviceActions.mapStoreRemoveService>): void;
|
|
8
|
-
export declare function rootSaga(): SagaIterator;
|
|
File without changes
|