@opengeoweb/core 2.1.2 → 2.1.3
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/core.esm.js +1469 -452
- package/core.umd.js +1674 -542
- package/lib/components/ConfigurableConnectedMap/ConfigurableConnectedMap.d.ts +1 -0
- package/lib/components/ConfigurableMapWithSlider/ConfigurableMapWithSliderConnect.d.ts +1 -0
- package/lib/components/CustomSwitch/CustomSwitch.d.ts +1 -1
- package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButtonConnect.d.ts +8 -0
- package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/{KeywordFilterButton.spec.d.ts → KeywordFilterButtonConnect.spec.d.ts} +0 -0
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.d.ts +10 -5
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.stories.d.ts +13 -0
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsConnect.d.ts +5 -1
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItem.d.ts +1 -1
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.d.ts +9 -0
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerListConnect.d.ts +6 -0
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerListConnect.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchField.d.ts +5 -1
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchFieldButtonContainer.d.ts +8 -0
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchFieldButtonContainer.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchFieldConnect.d.ts +3 -0
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchFieldConnect.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.d.ts +6 -0
- package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.stories.d.ts +13 -0
- package/lib/components/LayerManager/LayerSelect/ServicePopup/ServicePopup.d.ts +3 -0
- package/lib/components/Legend/LegendConnect.d.ts +3 -0
- package/lib/components/Legend/LegendDialog.d.ts +2 -0
- package/lib/components/Legend/LegendMapButtonConnect.d.ts +2 -0
- package/lib/components/MultiMapDimensionSelect/DimensionSelectButtonConnect.d.ts +2 -0
- package/lib/components/MultiMapDimensionSelect/DimensionSelectDialogConnect.d.ts +2 -0
- package/lib/components/MultiMapDimensionSelect/MultiDimensionSelectMapButtonsConnect.d.ts +2 -0
- package/lib/components/MultiMapView/MultiMapView.stories.d.ts +2 -0
- package/lib/components/MultiMapView/MultiMapView10x10.stories.d.ts +2 -0
- package/lib/components/ReactMapView/ReactMapView.d.ts +0 -1
- package/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +1 -1
- package/lib/components/ReactMapView/types.d.ts +0 -1
- package/lib/components/TimeSlider/TimeSliderUtils.d.ts +1 -1
- package/lib/store/coreModuleConfig.d.ts +1 -1
- package/lib/store/layerSelect/actions.d.ts +8 -1
- package/lib/store/layerSelect/config.d.ts +2 -2
- package/lib/store/layerSelect/constants.d.ts +1 -0
- package/lib/store/layerSelect/sagas.d.ts +5 -0
- package/lib/store/layerSelect/sagas.spec.d.ts +1 -0
- package/lib/store/layerSelect/selectors.d.ts +3 -1
- package/lib/store/layerSelect/types.d.ts +18 -2
- package/lib/store/mapStore/map/selectors.d.ts +1 -1
- package/lib/store/mapStore/service/selectors.d.ts +0 -8
- package/lib/store/mapStore/service/types.d.ts +1 -0
- package/lib/store/ui/actions.d.ts +2 -2
- package/lib/store/ui/types.d.ts +2 -1
- package/lib/storybookUtils/HelperComponents.d.ts +1 -1
- package/lib/utils/defaultTestSettings.d.ts +11 -2
- package/lib/utils/testUtils.d.ts +2 -2
- package/package.json +5 -5
- package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButton.d.ts +0 -3
- package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButton.stories.d.ts +0 -7
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsConnect.stories.d.ts +0 -7
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/mockServices.d.ts +0 -42
package/core.esm.js
CHANGED
|
@@ -3,16 +3,16 @@ import moment from 'moment';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useState, Component, useRef, useEffect } from 'react';
|
|
5
5
|
import produce, { produce as produce$1 } from 'immer';
|
|
6
|
-
import { takeLatest, put, select, call } from 'redux-saga/effects';
|
|
6
|
+
import { takeLatest, put, select, call, takeEvery } from 'redux-saga/effects';
|
|
7
7
|
import { WMGetServiceFromStore, getMapImageStore, WMBBOX, debug, DebugType, WMJSMap, WMLayer, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer } from '@opengeoweb/webmap';
|
|
8
|
-
import { makeStyles, Tooltip, Select, Grid, InputLabel, IconButton, Paper, Box, Typography, CircularProgress, List, ListSubheader, ListItem, ListItemText, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, Button, createStyles, MenuItem, Checkbox, SvgIcon, ListItemIcon, Menu, FormControl, InputAdornment, withStyles,
|
|
8
|
+
import { makeStyles, Tooltip, Select, Grid, InputLabel, IconButton, Paper, Box, Typography, CircularProgress, List, ListSubheader, ListItem, ListItemText, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, Button, createStyles, MenuItem, Checkbox, SvgIcon, ListItemIcon, Menu, FormControl, InputAdornment, withStyles, Switch, ListItemSecondaryAction, Slider, FormControlLabel, Popover, useMediaQuery, useTheme } from '@material-ui/core';
|
|
9
9
|
import { connect, useDispatch, useSelector, Provider } from 'react-redux';
|
|
10
10
|
import { sliderStyles, CustomSlider, ToolContainerDraggable, useIsMounted } from '@opengeoweb/shared';
|
|
11
|
-
import _ from 'lodash';
|
|
12
|
-
import { Cached, Add, MoreVert, FileCopy, Delete, DragIndicator, ChevronLeft, ChevronRight, Link, LinkOff, DeleteForever } from '@material-ui/icons';
|
|
11
|
+
import _, { debounce } from 'lodash';
|
|
12
|
+
import { Cached, Add, MoreVert, FileCopy, Delete, DragIndicator, Close, ChevronLeft, ChevronRight, Link, LinkOff, DeleteForever } from '@material-ui/icons';
|
|
13
13
|
import { Sortable, ReactSortable } from 'react-sortablejs';
|
|
14
14
|
import { ToggleButton } from '@material-ui/lab';
|
|
15
|
-
import { debounce } from 'throttle-debounce';
|
|
15
|
+
import { debounce as debounce$1 } from 'throttle-debounce';
|
|
16
16
|
import cloneDeep from 'lodash.clonedeep';
|
|
17
17
|
import proj4 from 'proj4';
|
|
18
18
|
import { createStore, DynamicModuleLoader } from 'redux-dynamic-modules';
|
|
@@ -1680,12 +1680,30 @@ var getPreviousTimeStepvalue = function getPreviousTimeStepvalue(value, min) {
|
|
|
1680
1680
|
return newValue < min ? min : newValue;
|
|
1681
1681
|
};
|
|
1682
1682
|
var getValueFromKeyboardEvent = function getValueFromKeyboardEvent(event, value, min, max) {
|
|
1683
|
-
|
|
1683
|
+
var supportFourDirectionNavigation = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
1684
|
+
|
|
1685
|
+
if (!supportFourDirectionNavigation) {
|
|
1686
|
+
if (event.ctrlKey || event.metaKey) {
|
|
1687
|
+
switch (event.key) {
|
|
1688
|
+
case 'ArrowDown':
|
|
1689
|
+
return getPreviousTimeStepvalue(value, min);
|
|
1690
|
+
|
|
1691
|
+
case 'ArrowUp':
|
|
1692
|
+
return getNextTimeStepvalue(value, max);
|
|
1693
|
+
|
|
1694
|
+
default:
|
|
1695
|
+
return null;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
} else {
|
|
1699
|
+
// currently supportFourDirectionNavigation (left/right/up/down) is only used in horizontal slider TimeSliderScaleSlider
|
|
1684
1700
|
switch (event.key) {
|
|
1685
1701
|
case 'ArrowDown':
|
|
1702
|
+
case 'ArrowLeft':
|
|
1686
1703
|
return getPreviousTimeStepvalue(value, min);
|
|
1687
1704
|
|
|
1688
1705
|
case 'ArrowUp':
|
|
1706
|
+
case 'ArrowRight':
|
|
1689
1707
|
return getNextTimeStepvalue(value, max);
|
|
1690
1708
|
|
|
1691
1709
|
default:
|
|
@@ -2588,9 +2606,26 @@ var getAllUniqueDimensions = createSelector(getAllMapIds, function (store) {
|
|
|
2588
2606
|
*/
|
|
2589
2607
|
|
|
2590
2608
|
var getPinLocation = createSelector(getMapById, function (store) {
|
|
2591
|
-
return store ? store.mapPinLocation :
|
|
2609
|
+
return store ? store.mapPinLocation : undefined;
|
|
2592
2610
|
});
|
|
2593
2611
|
|
|
2612
|
+
/* *
|
|
2613
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2614
|
+
* you may not use this file except in compliance with the License.
|
|
2615
|
+
* You may obtain a copy of the License at
|
|
2616
|
+
*
|
|
2617
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2618
|
+
*
|
|
2619
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2620
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2621
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2622
|
+
* See the License for the specific language governing permissions and
|
|
2623
|
+
* limitations under the License.
|
|
2624
|
+
*
|
|
2625
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2626
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
2627
|
+
* */
|
|
2628
|
+
|
|
2594
2629
|
var servicesStore = function servicesStore(store) {
|
|
2595
2630
|
return store && store.services ? store.services : null;
|
|
2596
2631
|
};
|
|
@@ -2632,25 +2667,6 @@ var getServiceLayersByName = function getServiceLayersByName(store, serviceName)
|
|
|
2632
2667
|
|
|
2633
2668
|
return null;
|
|
2634
2669
|
};
|
|
2635
|
-
/**
|
|
2636
|
-
* Gets all keywords from services
|
|
2637
|
-
*
|
|
2638
|
-
* const keywords = useSelector((store) => mapSelectors.getKeywords(store));
|
|
2639
|
-
* @param {object} store store: object - Store object
|
|
2640
|
-
* @returns {array} returnType: Keyword[]
|
|
2641
|
-
*/
|
|
2642
|
-
|
|
2643
|
-
var getKeywords = createSelector(servicesStore, function (store) {
|
|
2644
|
-
var keywords = store ? store.allIds.flatMap(function (id) {
|
|
2645
|
-
return store.byId[id].layers.flatMap(function (layer) {
|
|
2646
|
-
return layer.keywords;
|
|
2647
|
-
});
|
|
2648
|
-
}) : null;
|
|
2649
|
-
|
|
2650
|
-
var uniqueKeywords = _toConsumableArray(new Set(keywords));
|
|
2651
|
-
|
|
2652
|
-
return uniqueKeywords;
|
|
2653
|
-
});
|
|
2654
2670
|
|
|
2655
2671
|
/* *
|
|
2656
2672
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -2728,8 +2744,7 @@ var selectors = /*#__PURE__*/Object.freeze({
|
|
|
2728
2744
|
getAvailableBaseLayersForMap: getAvailableBaseLayersForMap,
|
|
2729
2745
|
getServiceIds: getServiceIds,
|
|
2730
2746
|
getServices: getServices,
|
|
2731
|
-
getServiceLayersByName: getServiceLayersByName
|
|
2732
|
-
getKeywords: getKeywords
|
|
2747
|
+
getServiceLayersByName: getServiceLayersByName
|
|
2733
2748
|
});
|
|
2734
2749
|
|
|
2735
2750
|
/* *
|
|
@@ -2833,8 +2848,8 @@ var UI_ORDER_DIALOG = 'UI_ORDER_DIALOG';
|
|
|
2833
2848
|
/**
|
|
2834
2849
|
* Registers the dialog in the store and creates the dialog state
|
|
2835
2850
|
*
|
|
2836
|
-
* Example: registerDialog({'dialogId1', type: 'legend}) you can optionally specify the activeMapId
|
|
2837
|
-
* @param {string} payload {type: 'legend' | 'layerManager' | 'dimensionSelect-elevation', activeMapId?: string, setOpen?: boolean}
|
|
2851
|
+
* Example: registerDialog({'dialogId1', type: 'legend}) you can optionally specify the activeMapId, whether the dialog is open and the souce ('app' or 'module', default is 'app')
|
|
2852
|
+
* @param {string} payload {type: 'legend' | 'layerManager' | 'dimensionSelect-elevation', activeMapId?: string, setOpen?: boolean, source?: Source}
|
|
2838
2853
|
*/
|
|
2839
2854
|
|
|
2840
2855
|
var registerDialog = function registerDialog(payload) {
|
|
@@ -4463,9 +4478,9 @@ var getMapBaseLayerActionsTargets = function getMapBaseLayerActionsTargets(state
|
|
|
4463
4478
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
4464
4479
|
* */
|
|
4465
4480
|
var ORIGIN_REACTMAPVIEWPARSELAYER = 'ReactMapViewParseLayer';
|
|
4466
|
-
var setServiceMetadata = function setServiceMetadata(wmLayer, mapId,
|
|
4481
|
+
var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, webMapJSInstance, mapProperties, onMapUpdateAllDimensions, onLayerChangeStyle, onServiceSetLayers, onLayerSetStyles, onLayerSetDimensions) {
|
|
4467
4482
|
var origin = ORIGIN_REACTMAPVIEWPARSELAYER;
|
|
4468
|
-
var service = WMGetServiceFromStore(wmLayer.service
|
|
4483
|
+
var service = WMGetServiceFromStore(wmLayer.service);
|
|
4469
4484
|
/* Update list of layers for service */
|
|
4470
4485
|
|
|
4471
4486
|
var done = function done(layers) {
|
|
@@ -4542,20 +4557,20 @@ var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, xml2jsonreq
|
|
|
4542
4557
|
};
|
|
4543
4558
|
|
|
4544
4559
|
service.getLayerObjectsFlat(done, function () {// do nothing
|
|
4545
|
-
}, false,
|
|
4560
|
+
}, false, {
|
|
4546
4561
|
headers: wmLayer.headers
|
|
4547
4562
|
});
|
|
4548
4563
|
};
|
|
4549
4564
|
|
|
4550
|
-
var _marked$
|
|
4551
|
-
_marked2$
|
|
4565
|
+
var _marked$4 = /*#__PURE__*/regeneratorRuntime.mark(setTimeSaga),
|
|
4566
|
+
_marked2$4 = /*#__PURE__*/regeneratorRuntime.mark(setBBoxSaga),
|
|
4552
4567
|
_marked3$3 = /*#__PURE__*/regeneratorRuntime.mark(layerActionsSaga),
|
|
4553
4568
|
_marked4$2 = /*#__PURE__*/regeneratorRuntime.mark(addLayerActionsSaga),
|
|
4554
4569
|
_marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
|
|
4555
4570
|
_marked6$1 = /*#__PURE__*/regeneratorRuntime.mark(moveLayerActionsSaga),
|
|
4556
4571
|
_marked7$1 = /*#__PURE__*/regeneratorRuntime.mark(setActiveLayerIdActionsSaga),
|
|
4557
4572
|
_marked8 = /*#__PURE__*/regeneratorRuntime.mark(mapBaseLayerActionsSaga),
|
|
4558
|
-
_marked9 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$
|
|
4573
|
+
_marked9 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$4);
|
|
4559
4574
|
var setTimeValidatorRexexp = new RegExp('^(19|20)\\d\\d-(0[1-9]|1[012])-([012]\\d|3[01])T([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d)Z$');
|
|
4560
4575
|
function setTimeSaga(_ref) {
|
|
4561
4576
|
var payload, value, origin, targets, groups;
|
|
@@ -4595,7 +4610,7 @@ function setTimeSaga(_ref) {
|
|
|
4595
4610
|
return _context.stop();
|
|
4596
4611
|
}
|
|
4597
4612
|
}
|
|
4598
|
-
}, _marked$
|
|
4613
|
+
}, _marked$4);
|
|
4599
4614
|
}
|
|
4600
4615
|
function setBBoxSaga(_ref2) {
|
|
4601
4616
|
var payload, targets, groups;
|
|
@@ -4622,7 +4637,7 @@ function setBBoxSaga(_ref2) {
|
|
|
4622
4637
|
return _context2.stop();
|
|
4623
4638
|
}
|
|
4624
4639
|
}
|
|
4625
|
-
}, _marked2$
|
|
4640
|
+
}, _marked2$4);
|
|
4626
4641
|
}
|
|
4627
4642
|
function layerActionsSaga(_ref3) {
|
|
4628
4643
|
var payload, type, targets;
|
|
@@ -4837,7 +4852,7 @@ function mapBaseLayerActionsSaga(_ref8) {
|
|
|
4837
4852
|
}
|
|
4838
4853
|
}, _marked8);
|
|
4839
4854
|
}
|
|
4840
|
-
function rootSaga$
|
|
4855
|
+
function rootSaga$4() {
|
|
4841
4856
|
return regeneratorRuntime.wrap(function rootSaga$(_context9) {
|
|
4842
4857
|
while (1) {
|
|
4843
4858
|
switch (_context9.prev = _context9.next) {
|
|
@@ -4897,10 +4912,10 @@ function rootSaga$3() {
|
|
|
4897
4912
|
}, _marked9);
|
|
4898
4913
|
}
|
|
4899
4914
|
|
|
4900
|
-
var _marked$
|
|
4901
|
-
_marked2$
|
|
4915
|
+
var _marked$3 = /*#__PURE__*/regeneratorRuntime.mark(updateSourceValueWhenLinkingComponentToGroupSaga),
|
|
4916
|
+
_marked2$3 = /*#__PURE__*/regeneratorRuntime.mark(addGroupTargetSaga),
|
|
4902
4917
|
_marked3$2 = /*#__PURE__*/regeneratorRuntime.mark(linkGroupTargetSaga),
|
|
4903
|
-
_marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$
|
|
4918
|
+
_marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
|
|
4904
4919
|
function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdate) {
|
|
4905
4920
|
var group;
|
|
4906
4921
|
return regeneratorRuntime.wrap(function updateSourceValueWhenLinkingComponentToGroupSaga$(_context) {
|
|
@@ -4967,7 +4982,7 @@ function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdat
|
|
|
4967
4982
|
return _context.stop();
|
|
4968
4983
|
}
|
|
4969
4984
|
}
|
|
4970
|
-
}, _marked$
|
|
4985
|
+
}, _marked$3);
|
|
4971
4986
|
}
|
|
4972
4987
|
function addGroupTargetSaga(_ref) {
|
|
4973
4988
|
var payload, groupId, linked, targetToUpdate;
|
|
@@ -4991,7 +5006,7 @@ function addGroupTargetSaga(_ref) {
|
|
|
4991
5006
|
return _context2.stop();
|
|
4992
5007
|
}
|
|
4993
5008
|
}
|
|
4994
|
-
}, _marked2$
|
|
5009
|
+
}, _marked2$3);
|
|
4995
5010
|
}
|
|
4996
5011
|
function linkGroupTargetSaga(_ref2) {
|
|
4997
5012
|
var payload, groupId, linked, targetToUpdate;
|
|
@@ -5018,7 +5033,7 @@ function linkGroupTargetSaga(_ref2) {
|
|
|
5018
5033
|
}, _marked3$2);
|
|
5019
5034
|
}
|
|
5020
5035
|
|
|
5021
|
-
function rootSaga$
|
|
5036
|
+
function rootSaga$3() {
|
|
5022
5037
|
return regeneratorRuntime.wrap(function rootSaga$(_context4) {
|
|
5023
5038
|
while (1) {
|
|
5024
5039
|
switch (_context4.prev = _context4.next) {
|
|
@@ -5059,10 +5074,10 @@ var synchronizationGroupConfig = {
|
|
|
5059
5074
|
reducerMap: {
|
|
5060
5075
|
syncronizationGroupStore: reducer$4
|
|
5061
5076
|
},
|
|
5062
|
-
sagas: [rootSaga$
|
|
5077
|
+
sagas: [rootSaga$4, rootSaga$3]
|
|
5063
5078
|
};
|
|
5064
5079
|
|
|
5065
|
-
var useStyles$
|
|
5080
|
+
var useStyles$J = makeStyles(function (theme) {
|
|
5066
5081
|
return {
|
|
5067
5082
|
select: {
|
|
5068
5083
|
'& ul': {
|
|
@@ -5117,7 +5132,7 @@ var TooltipSelect = function TooltipSelect(_a) {
|
|
|
5117
5132
|
tooltipOpen = _React$useState4[0],
|
|
5118
5133
|
setTooltipOpen = _React$useState4[1];
|
|
5119
5134
|
|
|
5120
|
-
var classes = useStyles$
|
|
5135
|
+
var classes = useStyles$J();
|
|
5121
5136
|
|
|
5122
5137
|
var preventDefault = function preventDefault(event) {
|
|
5123
5138
|
event.preventDefault();
|
|
@@ -5261,12 +5276,14 @@ var reducer$3 = function reducer() {
|
|
|
5261
5276
|
var type = action.payload.type;
|
|
5262
5277
|
var activeMapId = action.payload.activeMapId ? action.payload.activeMapId : '';
|
|
5263
5278
|
var setOpen = action.payload.setOpen ? action.payload.setOpen : false;
|
|
5279
|
+
var source = action.payload.source ? action.payload.source : 'app';
|
|
5264
5280
|
return produce$1(state, function (draft) {
|
|
5265
5281
|
if (!Object.keys(draft.dialogs).includes(type)) {
|
|
5266
5282
|
draft.dialogs[type] = createUIDialogElement({
|
|
5267
5283
|
activeMapId: activeMapId,
|
|
5268
5284
|
type: type,
|
|
5269
|
-
setOpen: setOpen
|
|
5285
|
+
setOpen: setOpen,
|
|
5286
|
+
source: source
|
|
5270
5287
|
});
|
|
5271
5288
|
} // // register dialog to order
|
|
5272
5289
|
|
|
@@ -5295,7 +5312,7 @@ var reducer$3 = function reducer() {
|
|
|
5295
5312
|
var _action$payload = action.payload,
|
|
5296
5313
|
_type2 = _action$payload.type,
|
|
5297
5314
|
_activeMapId = _action$payload.activeMapId,
|
|
5298
|
-
|
|
5315
|
+
_source = _action$payload.source;
|
|
5299
5316
|
|
|
5300
5317
|
if (!state.dialogs[_type2]) {
|
|
5301
5318
|
return state;
|
|
@@ -5305,7 +5322,7 @@ var reducer$3 = function reducer() {
|
|
|
5305
5322
|
var isOpen = action.payload.setOpen !== undefined ? action.payload.setOpen : draft.dialogs[_type2].isOpen;
|
|
5306
5323
|
draft.dialogs[_type2].activeMapId = _activeMapId;
|
|
5307
5324
|
draft.dialogs[_type2].isOpen = isOpen;
|
|
5308
|
-
draft.dialogs[_type2].source =
|
|
5325
|
+
draft.dialogs[_type2].source = _source;
|
|
5309
5326
|
|
|
5310
5327
|
if (isOpen) {
|
|
5311
5328
|
draft.order = moveToTop(state.order, _type2);
|
|
@@ -5452,18 +5469,18 @@ var getDialogIsOrderedOnTop = createSelector(function (store, dialogType) {
|
|
|
5452
5469
|
return isOrderedOnTop;
|
|
5453
5470
|
});
|
|
5454
5471
|
var getDialogSource = createSelector(getDialogDetailsByType, function (details) {
|
|
5455
|
-
if (details) {
|
|
5472
|
+
if (details && details.source) {
|
|
5456
5473
|
return details.source;
|
|
5457
5474
|
}
|
|
5458
5475
|
|
|
5459
5476
|
return 'app';
|
|
5460
5477
|
});
|
|
5461
5478
|
|
|
5462
|
-
var _marked$
|
|
5463
|
-
_marked2$
|
|
5464
|
-
_marked3$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$
|
|
5479
|
+
var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(registerMapUISaga),
|
|
5480
|
+
_marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(unregisterUIMapSaga),
|
|
5481
|
+
_marked3$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
|
|
5465
5482
|
function registerMapUISaga() {
|
|
5466
|
-
var fields;
|
|
5483
|
+
var fields, source;
|
|
5467
5484
|
return regeneratorRuntime.wrap(function registerMapUISaga$(_context) {
|
|
5468
5485
|
while (1) {
|
|
5469
5486
|
switch (_context.prev = _context.next) {
|
|
@@ -5475,23 +5492,29 @@ function registerMapUISaga() {
|
|
|
5475
5492
|
fields = _context.sent;
|
|
5476
5493
|
|
|
5477
5494
|
if (!(fields.length === 1)) {
|
|
5478
|
-
_context.next =
|
|
5495
|
+
_context.next = 9;
|
|
5479
5496
|
break;
|
|
5480
5497
|
}
|
|
5481
5498
|
|
|
5482
5499
|
_context.next = 6;
|
|
5500
|
+
return select(getDialogSource, 'legend');
|
|
5501
|
+
|
|
5502
|
+
case 6:
|
|
5503
|
+
source = _context.sent;
|
|
5504
|
+
_context.next = 9;
|
|
5483
5505
|
return put(setActiveMapIdForDialog({
|
|
5484
5506
|
type: 'legend',
|
|
5485
5507
|
activeMapId: fields[0],
|
|
5486
|
-
setOpen: true
|
|
5508
|
+
setOpen: true,
|
|
5509
|
+
source: source
|
|
5487
5510
|
}));
|
|
5488
5511
|
|
|
5489
|
-
case
|
|
5512
|
+
case 9:
|
|
5490
5513
|
case "end":
|
|
5491
5514
|
return _context.stop();
|
|
5492
5515
|
}
|
|
5493
5516
|
}
|
|
5494
|
-
}, _marked$
|
|
5517
|
+
}, _marked$2);
|
|
5495
5518
|
}
|
|
5496
5519
|
function unregisterUIMapSaga() {
|
|
5497
5520
|
var fields, activeUI;
|
|
@@ -5543,9 +5566,9 @@ function unregisterUIMapSaga() {
|
|
|
5543
5566
|
return _context2.stop();
|
|
5544
5567
|
}
|
|
5545
5568
|
}
|
|
5546
|
-
}, _marked2$
|
|
5569
|
+
}, _marked2$2);
|
|
5547
5570
|
}
|
|
5548
|
-
function rootSaga$
|
|
5571
|
+
function rootSaga$2() {
|
|
5549
5572
|
return regeneratorRuntime.wrap(function rootSaga$(_context3) {
|
|
5550
5573
|
while (1) {
|
|
5551
5574
|
switch (_context3.prev = _context3.next) {
|
|
@@ -5586,7 +5609,7 @@ var uiModuleConfig = {
|
|
|
5586
5609
|
reducerMap: {
|
|
5587
5610
|
ui: reducer$3
|
|
5588
5611
|
},
|
|
5589
|
-
sagas: [rootSaga$
|
|
5612
|
+
sagas: [rootSaga$2]
|
|
5590
5613
|
};
|
|
5591
5614
|
|
|
5592
5615
|
/**
|
|
@@ -6280,13 +6303,13 @@ var reducer$1 = function reducer() {
|
|
|
6280
6303
|
}
|
|
6281
6304
|
};
|
|
6282
6305
|
|
|
6283
|
-
var _marked = /*#__PURE__*/regeneratorRuntime.mark(startAnimationSaga),
|
|
6284
|
-
_marked2 = /*#__PURE__*/regeneratorRuntime.mark(stopAnimationSaga),
|
|
6306
|
+
var _marked$1 = /*#__PURE__*/regeneratorRuntime.mark(startAnimationSaga),
|
|
6307
|
+
_marked2$1 = /*#__PURE__*/regeneratorRuntime.mark(stopAnimationSaga),
|
|
6285
6308
|
_marked3 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerSaga),
|
|
6286
6309
|
_marked4 = /*#__PURE__*/regeneratorRuntime.mark(updateAnimation),
|
|
6287
6310
|
_marked5 = /*#__PURE__*/regeneratorRuntime.mark(setLayerDimensionsSaga),
|
|
6288
6311
|
_marked6 = /*#__PURE__*/regeneratorRuntime.mark(toggleAutoUpdateSaga),
|
|
6289
|
-
_marked7 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga);
|
|
6312
|
+
_marked7 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$1);
|
|
6290
6313
|
|
|
6291
6314
|
var generateTimeList = function generateTimeList(start, end, interval) {
|
|
6292
6315
|
var timeList = [];
|
|
@@ -6336,7 +6359,7 @@ function startAnimationSaga(_ref) {
|
|
|
6336
6359
|
return _context.stop();
|
|
6337
6360
|
}
|
|
6338
6361
|
}
|
|
6339
|
-
}, _marked);
|
|
6362
|
+
}, _marked$1);
|
|
6340
6363
|
}
|
|
6341
6364
|
function stopAnimationSaga(_ref2) {
|
|
6342
6365
|
var payload, mapId;
|
|
@@ -6354,7 +6377,7 @@ function stopAnimationSaga(_ref2) {
|
|
|
6354
6377
|
return _context2.stop();
|
|
6355
6378
|
}
|
|
6356
6379
|
}
|
|
6357
|
-
}, _marked2);
|
|
6380
|
+
}, _marked2$1);
|
|
6358
6381
|
}
|
|
6359
6382
|
function deleteLayerSaga(_ref3) {
|
|
6360
6383
|
var payload, mapId, layers;
|
|
@@ -6620,7 +6643,7 @@ function toggleAutoUpdateSaga(_ref5) {
|
|
|
6620
6643
|
}
|
|
6621
6644
|
}, _marked6, null, [[1, 17]]);
|
|
6622
6645
|
}
|
|
6623
|
-
function rootSaga() {
|
|
6646
|
+
function rootSaga$1() {
|
|
6624
6647
|
return regeneratorRuntime.wrap(function rootSaga$(_context7) {
|
|
6625
6648
|
while (1) {
|
|
6626
6649
|
switch (_context7.prev = _context7.next) {
|
|
@@ -6675,28 +6698,14 @@ var moduleConfig = {
|
|
|
6675
6698
|
services: reducer$1,
|
|
6676
6699
|
layers: reducer$5
|
|
6677
6700
|
},
|
|
6678
|
-
sagas: [rootSaga]
|
|
6701
|
+
sagas: [rootSaga$1]
|
|
6679
6702
|
};
|
|
6680
6703
|
|
|
6681
|
-
/* *
|
|
6682
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6683
|
-
* you may not use this file except in compliance with the License.
|
|
6684
|
-
* You may obtain a copy of the License at
|
|
6685
|
-
*
|
|
6686
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6687
|
-
*
|
|
6688
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6689
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6690
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6691
|
-
* See the License for the specific language governing permissions and
|
|
6692
|
-
* limitations under the License.
|
|
6693
|
-
*
|
|
6694
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6695
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6696
|
-
* */
|
|
6697
6704
|
var initialState = {
|
|
6698
6705
|
filters: {
|
|
6699
|
-
searchFilter: ''
|
|
6706
|
+
searchFilter: '',
|
|
6707
|
+
keywords: [],
|
|
6708
|
+
addedServices: []
|
|
6700
6709
|
}
|
|
6701
6710
|
};
|
|
6702
6711
|
var reducer = function reducer() {
|
|
@@ -6712,11 +6721,171 @@ var reducer = function reducer() {
|
|
|
6712
6721
|
});
|
|
6713
6722
|
}
|
|
6714
6723
|
|
|
6724
|
+
case 'LAYER_SELECT_ADD_NEW_KEYWORDS':
|
|
6725
|
+
{
|
|
6726
|
+
return produce(state, function (draft) {
|
|
6727
|
+
var _action$payload = action.payload,
|
|
6728
|
+
serviceName = _action$payload.serviceName,
|
|
6729
|
+
keywords = _action$payload.keywords; // If store does not contain keywords from a service, add keywords and service Name
|
|
6730
|
+
|
|
6731
|
+
if (!draft.filters.addedServices.includes(serviceName)) {
|
|
6732
|
+
draft.filters.addedServices.push(serviceName);
|
|
6733
|
+
|
|
6734
|
+
var _iterator = _createForOfIteratorHelper(keywords),
|
|
6735
|
+
_step;
|
|
6736
|
+
|
|
6737
|
+
try {
|
|
6738
|
+
var _loop = function _loop() {
|
|
6739
|
+
var keyword = _step.value;
|
|
6740
|
+
var foundObject = draft.filters.keywords.find(function (object) {
|
|
6741
|
+
return object.id === keyword;
|
|
6742
|
+
});
|
|
6743
|
+
|
|
6744
|
+
if (foundObject) {
|
|
6745
|
+
foundObject.amount += 1;
|
|
6746
|
+
foundObject.amountVisible += 1;
|
|
6747
|
+
} else {
|
|
6748
|
+
var newKeywordObject = {
|
|
6749
|
+
id: keyword,
|
|
6750
|
+
amount: 1,
|
|
6751
|
+
amountVisible: 1,
|
|
6752
|
+
checked: true
|
|
6753
|
+
};
|
|
6754
|
+
draft.filters.keywords.push(newKeywordObject);
|
|
6755
|
+
}
|
|
6756
|
+
};
|
|
6757
|
+
|
|
6758
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6759
|
+
_loop();
|
|
6760
|
+
}
|
|
6761
|
+
} catch (err) {
|
|
6762
|
+
_iterator.e(err);
|
|
6763
|
+
} finally {
|
|
6764
|
+
_iterator.f();
|
|
6765
|
+
}
|
|
6766
|
+
}
|
|
6767
|
+
});
|
|
6768
|
+
}
|
|
6769
|
+
|
|
6715
6770
|
default:
|
|
6716
6771
|
return state;
|
|
6717
6772
|
}
|
|
6718
6773
|
};
|
|
6719
6774
|
|
|
6775
|
+
/* *
|
|
6776
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6777
|
+
* you may not use this file except in compliance with the License.
|
|
6778
|
+
* You may obtain a copy of the License at
|
|
6779
|
+
*
|
|
6780
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6781
|
+
*
|
|
6782
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6783
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6784
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6785
|
+
* See the License for the specific language governing permissions and
|
|
6786
|
+
* limitations under the License.
|
|
6787
|
+
*
|
|
6788
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6789
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6790
|
+
* */
|
|
6791
|
+
var LAYER_SELECT_SET_SEARCH_FILTER = 'LAYER_SELECT_SET_SEARCH_FILTER';
|
|
6792
|
+
var LAYER_SELECT_ADD_NEW_KEYWORDS = 'LAYER_SELECT_ADD_NEW_KEYWORDS';
|
|
6793
|
+
|
|
6794
|
+
/* *
|
|
6795
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6796
|
+
* you may not use this file except in compliance with the License.
|
|
6797
|
+
* You may obtain a copy of the License at
|
|
6798
|
+
*
|
|
6799
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6800
|
+
*
|
|
6801
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6802
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6803
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6804
|
+
* See the License for the specific language governing permissions and
|
|
6805
|
+
* limitations under the License.
|
|
6806
|
+
*
|
|
6807
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6808
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6809
|
+
* */
|
|
6810
|
+
/**
|
|
6811
|
+
* Sets the given text to the searchFilter
|
|
6812
|
+
*
|
|
6813
|
+
* Example: setSearchFilter({ filterText: 'hello world' })
|
|
6814
|
+
* @param {string} payload { filterText: string }
|
|
6815
|
+
*/
|
|
6816
|
+
|
|
6817
|
+
var setSearchFilter = function setSearchFilter(payload) {
|
|
6818
|
+
return {
|
|
6819
|
+
type: LAYER_SELECT_SET_SEARCH_FILTER,
|
|
6820
|
+
payload: payload
|
|
6821
|
+
};
|
|
6822
|
+
};
|
|
6823
|
+
/**
|
|
6824
|
+
* Sets the given keywords to Layer Select store
|
|
6825
|
+
*
|
|
6826
|
+
* Example: addNewKeywords({ keywords: ['keyword1', 'keyword2'] })
|
|
6827
|
+
* @param {string[]} payload { keywords: string[] }
|
|
6828
|
+
*/
|
|
6829
|
+
|
|
6830
|
+
var addNewKeywords = function addNewKeywords(payload) {
|
|
6831
|
+
return {
|
|
6832
|
+
type: LAYER_SELECT_ADD_NEW_KEYWORDS,
|
|
6833
|
+
payload: payload
|
|
6834
|
+
};
|
|
6835
|
+
};
|
|
6836
|
+
|
|
6837
|
+
var _marked = /*#__PURE__*/regeneratorRuntime.mark(newServiceAddedSaga),
|
|
6838
|
+
_marked2 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga);
|
|
6839
|
+
function newServiceAddedSaga(capturedAction) {
|
|
6840
|
+
var addedService, serviceName, keywords;
|
|
6841
|
+
return regeneratorRuntime.wrap(function newServiceAddedSaga$(_context) {
|
|
6842
|
+
while (1) {
|
|
6843
|
+
switch (_context.prev = _context.next) {
|
|
6844
|
+
case 0:
|
|
6845
|
+
addedService = capturedAction.payload;
|
|
6846
|
+
serviceName = addedService.name;
|
|
6847
|
+
keywords = addedService.layers.reduce(function (keywordAccumulator, layer) {
|
|
6848
|
+
if (!layer.keywords) {
|
|
6849
|
+
return keywordAccumulator;
|
|
6850
|
+
}
|
|
6851
|
+
|
|
6852
|
+
return keywordAccumulator.concat(layer.keywords);
|
|
6853
|
+
}, []);
|
|
6854
|
+
|
|
6855
|
+
if (!(keywords.length > 0)) {
|
|
6856
|
+
_context.next = 6;
|
|
6857
|
+
break;
|
|
6858
|
+
}
|
|
6859
|
+
|
|
6860
|
+
_context.next = 6;
|
|
6861
|
+
return put(addNewKeywords({
|
|
6862
|
+
serviceName: serviceName,
|
|
6863
|
+
keywords: keywords
|
|
6864
|
+
}));
|
|
6865
|
+
|
|
6866
|
+
case 6:
|
|
6867
|
+
case "end":
|
|
6868
|
+
return _context.stop();
|
|
6869
|
+
}
|
|
6870
|
+
}
|
|
6871
|
+
}, _marked);
|
|
6872
|
+
}
|
|
6873
|
+
function rootSaga() {
|
|
6874
|
+
return regeneratorRuntime.wrap(function rootSaga$(_context2) {
|
|
6875
|
+
while (1) {
|
|
6876
|
+
switch (_context2.prev = _context2.next) {
|
|
6877
|
+
case 0:
|
|
6878
|
+
_context2.next = 2;
|
|
6879
|
+
return takeEvery(MAP_SERVICES_SET_LAYERS, newServiceAddedSaga);
|
|
6880
|
+
|
|
6881
|
+
case 2:
|
|
6882
|
+
case "end":
|
|
6883
|
+
return _context2.stop();
|
|
6884
|
+
}
|
|
6885
|
+
}
|
|
6886
|
+
}, _marked2);
|
|
6887
|
+
}
|
|
6888
|
+
|
|
6720
6889
|
/* *
|
|
6721
6890
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6722
6891
|
* you may not use this file except in compliance with the License.
|
|
@@ -6737,7 +6906,8 @@ var layerSelectConfig = {
|
|
|
6737
6906
|
id: 'layerSelect-module',
|
|
6738
6907
|
reducerMap: {
|
|
6739
6908
|
layerSelect: reducer
|
|
6740
|
-
}
|
|
6909
|
+
},
|
|
6910
|
+
sagas: [rootSaga]
|
|
6741
6911
|
};
|
|
6742
6912
|
|
|
6743
6913
|
/* *
|
|
@@ -7737,7 +7907,7 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
|
|
|
7737
7907
|
preloadedDefaultMapServices: preloadedDefaultMapServices
|
|
7738
7908
|
});
|
|
7739
7909
|
|
|
7740
|
-
var useStyles$
|
|
7910
|
+
var useStyles$I = makeStyles({
|
|
7741
7911
|
buttonDiv: {
|
|
7742
7912
|
position: 'relative'
|
|
7743
7913
|
},
|
|
@@ -7773,7 +7943,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
|
|
|
7773
7943
|
handleClose = _ref.handleClose,
|
|
7774
7944
|
_ref$layerType = _ref.layerType,
|
|
7775
7945
|
layerType = _ref$layerType === void 0 ? LayerType.mapLayer : _ref$layerType;
|
|
7776
|
-
var classes = useStyles$
|
|
7946
|
+
var classes = useStyles$I();
|
|
7777
7947
|
|
|
7778
7948
|
var _React$useState = React.useState(''),
|
|
7779
7949
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -7925,7 +8095,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
|
|
|
7925
8095
|
}, "Close")));
|
|
7926
8096
|
};
|
|
7927
8097
|
|
|
7928
|
-
var useStyles$
|
|
8098
|
+
var useStyles$H = makeStyles(function (theme) {
|
|
7929
8099
|
return {
|
|
7930
8100
|
buttonDiv: {
|
|
7931
8101
|
position: 'relative'
|
|
@@ -7960,7 +8130,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
|
|
|
7960
8130
|
_ref$shouldFocus = _ref.shouldFocus,
|
|
7961
8131
|
shouldFocus = _ref$shouldFocus === void 0 ? false : _ref$shouldFocus;
|
|
7962
8132
|
var ref = React.useRef(null);
|
|
7963
|
-
var classes = useStyles$
|
|
8133
|
+
var classes = useStyles$H();
|
|
7964
8134
|
|
|
7965
8135
|
var _React$useState = React.useState(false),
|
|
7966
8136
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -8085,7 +8255,7 @@ var widthToWidthClass = function widthToWidthClass(w) {
|
|
|
8085
8255
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8086
8256
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8087
8257
|
* */
|
|
8088
|
-
var useStyles$
|
|
8258
|
+
var useStyles$G = makeStyles(function (theme) {
|
|
8089
8259
|
return {
|
|
8090
8260
|
button: {
|
|
8091
8261
|
width: '24px',
|
|
@@ -8102,7 +8272,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
|
|
|
8102
8272
|
_ref$source = _ref.source,
|
|
8103
8273
|
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
8104
8274
|
var dispatch = useDispatch();
|
|
8105
|
-
var classes = useStyles$
|
|
8275
|
+
var classes = useStyles$G();
|
|
8106
8276
|
var currentActiveMapId = useSelector(function (store) {
|
|
8107
8277
|
return getDialogMapId(store, 'layerSelect');
|
|
8108
8278
|
});
|
|
@@ -8144,7 +8314,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
|
|
|
8144
8314
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8145
8315
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8146
8316
|
* */
|
|
8147
|
-
var useStyles$
|
|
8317
|
+
var useStyles$F = makeStyles({
|
|
8148
8318
|
row: {
|
|
8149
8319
|
height: '32px'
|
|
8150
8320
|
},
|
|
@@ -8168,7 +8338,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
|
|
|
8168
8338
|
layerManagerWidth = _ref.layerManagerWidth,
|
|
8169
8339
|
_ref$layerSelect = _ref.layerSelect,
|
|
8170
8340
|
layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect;
|
|
8171
|
-
var classes = useStyles$
|
|
8341
|
+
var classes = useStyles$F();
|
|
8172
8342
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
8173
8343
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
8174
8344
|
container: true,
|
|
@@ -8420,7 +8590,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
|
|
|
8420
8590
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8421
8591
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8422
8592
|
* */
|
|
8423
|
-
var useStyles$
|
|
8593
|
+
var useStyles$E = makeStyles(function (theme) {
|
|
8424
8594
|
return createStyles({
|
|
8425
8595
|
button: {
|
|
8426
8596
|
height: 28,
|
|
@@ -8479,7 +8649,7 @@ var LayerManagerButton = function LayerManagerButton(_a) {
|
|
|
8479
8649
|
testId = _a.testId,
|
|
8480
8650
|
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId"]);
|
|
8481
8651
|
|
|
8482
|
-
var classes = useStyles$
|
|
8652
|
+
var classes = useStyles$E({
|
|
8483
8653
|
isActive: isActive,
|
|
8484
8654
|
isEnabled: isEnabled
|
|
8485
8655
|
});
|
|
@@ -8516,7 +8686,7 @@ var LayerManagerButton = function LayerManagerButton(_a) {
|
|
|
8516
8686
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8517
8687
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8518
8688
|
* */
|
|
8519
|
-
var useStyles$
|
|
8689
|
+
var useStyles$D = makeStyles(function (theme) {
|
|
8520
8690
|
return createStyles({
|
|
8521
8691
|
checkbox: {
|
|
8522
8692
|
color: 'inherit',
|
|
@@ -8539,7 +8709,7 @@ var EnableLayer = function EnableLayer(_ref) {
|
|
|
8539
8709
|
var isEnabled = _ref.isEnabled,
|
|
8540
8710
|
title = _ref.title,
|
|
8541
8711
|
onChangeEnableLayer = _ref.onChangeEnableLayer;
|
|
8542
|
-
var classes = useStyles$
|
|
8712
|
+
var classes = useStyles$D(isEnabled);
|
|
8543
8713
|
|
|
8544
8714
|
var onClick = function onClick() {
|
|
8545
8715
|
onChangeEnableLayer(!isEnabled);
|
|
@@ -8595,7 +8765,7 @@ var EnableLayer = function EnableLayer(_ref) {
|
|
|
8595
8765
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8596
8766
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8597
8767
|
* */
|
|
8598
|
-
var useStyles$
|
|
8768
|
+
var useStyles$C = makeStyles(function (theme) {
|
|
8599
8769
|
return createStyles({
|
|
8600
8770
|
dropdownEmpty: {
|
|
8601
8771
|
paddingLeft: 8,
|
|
@@ -8618,7 +8788,7 @@ var RenderLayers = function RenderLayers(_ref) {
|
|
|
8618
8788
|
layers = _ref$layers === void 0 ? [] : _ref$layers,
|
|
8619
8789
|
_ref$isEnabled = _ref.isEnabled,
|
|
8620
8790
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
8621
|
-
var classes = useStyles$
|
|
8791
|
+
var classes = useStyles$C();
|
|
8622
8792
|
var containerClass = useTooltipContainerStyles(isEnabled);
|
|
8623
8793
|
|
|
8624
8794
|
if (!layers || !layers.length) {
|
|
@@ -8675,7 +8845,7 @@ var RenderLayers = function RenderLayers(_ref) {
|
|
|
8675
8845
|
}));
|
|
8676
8846
|
};
|
|
8677
8847
|
|
|
8678
|
-
var useStyles$
|
|
8848
|
+
var useStyles$B = makeStyles(function (theme) {
|
|
8679
8849
|
return {
|
|
8680
8850
|
opacityDiv: {
|
|
8681
8851
|
height: 'calc(100% - 5px)',
|
|
@@ -8736,7 +8906,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
|
|
|
8736
8906
|
onLayerChangeOpacity = _ref.onLayerChangeOpacity,
|
|
8737
8907
|
_ref$isEnabled = _ref.isEnabled,
|
|
8738
8908
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
8739
|
-
var classes = useStyles$
|
|
8909
|
+
var classes = useStyles$B();
|
|
8740
8910
|
var sliderClasses = sliderStyles();
|
|
8741
8911
|
var containerClass = useTooltipContainerStyles(isEnabled);
|
|
8742
8912
|
|
|
@@ -8848,7 +9018,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
|
|
|
8848
9018
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8849
9019
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8850
9020
|
* */
|
|
8851
|
-
var useStyles$
|
|
9021
|
+
var useStyles$A = makeStyles(function (theme) {
|
|
8852
9022
|
return createStyles({
|
|
8853
9023
|
icon: {
|
|
8854
9024
|
minWidth: 32,
|
|
@@ -8865,7 +9035,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
8865
9035
|
var title = _ref.title,
|
|
8866
9036
|
tooltipTitle = _ref.tooltipTitle,
|
|
8867
9037
|
icon = _ref.icon;
|
|
8868
|
-
var classes = useStyles$
|
|
9038
|
+
var classes = useStyles$A();
|
|
8869
9039
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItemIcon, {
|
|
8870
9040
|
className: "".concat(classes.icon, " icon")
|
|
8871
9041
|
}, icon), /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -8877,7 +9047,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
8877
9047
|
}, title)));
|
|
8878
9048
|
};
|
|
8879
9049
|
|
|
8880
|
-
var useStyles$
|
|
9050
|
+
var useStyles$z = makeStyles(function (theme) {
|
|
8881
9051
|
return {
|
|
8882
9052
|
menu: {
|
|
8883
9053
|
backgroundColor: theme.palette.geowebColors.background.surface,
|
|
@@ -8895,7 +9065,7 @@ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
|
|
|
8895
9065
|
onLayerDuplicate = _ref.onLayerDuplicate,
|
|
8896
9066
|
_ref$isEnabled = _ref.isEnabled,
|
|
8897
9067
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
8898
|
-
var classes = useStyles$
|
|
9068
|
+
var classes = useStyles$z();
|
|
8899
9069
|
|
|
8900
9070
|
var _React$useState = React.useState(null),
|
|
8901
9071
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -9020,7 +9190,7 @@ var RenderStyles = function RenderStyles(_ref) {
|
|
|
9020
9190
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9021
9191
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9022
9192
|
* */
|
|
9023
|
-
var useStyles$
|
|
9193
|
+
var useStyles$y = makeStyles(function () {
|
|
9024
9194
|
return createStyles({
|
|
9025
9195
|
icon: {
|
|
9026
9196
|
width: 20,
|
|
@@ -9034,7 +9204,7 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
9034
9204
|
onClickDelete = _ref.onClickDelete,
|
|
9035
9205
|
_ref$isEnabled = _ref.isEnabled,
|
|
9036
9206
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
9037
|
-
var classes = useStyles$
|
|
9207
|
+
var classes = useStyles$y();
|
|
9038
9208
|
return /*#__PURE__*/React.createElement(LayerManagerButton, {
|
|
9039
9209
|
tooltipTitle: tooltipTitle,
|
|
9040
9210
|
onClick: onClickDelete,
|
|
@@ -9062,7 +9232,7 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
9062
9232
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9063
9233
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9064
9234
|
* */
|
|
9065
|
-
var useStyles$
|
|
9235
|
+
var useStyles$x = makeStyles(function (theme) {
|
|
9066
9236
|
return createStyles({
|
|
9067
9237
|
icon: {
|
|
9068
9238
|
width: 18,
|
|
@@ -9099,7 +9269,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
|
|
|
9099
9269
|
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive,
|
|
9100
9270
|
_ref2$isEnabled = _ref2.isEnabled,
|
|
9101
9271
|
isEnabled = _ref2$isEnabled === void 0 ? true : _ref2$isEnabled;
|
|
9102
|
-
var classes = useStyles$
|
|
9272
|
+
var classes = useStyles$x({
|
|
9103
9273
|
isActive: isActive,
|
|
9104
9274
|
isEnabled: isEnabled
|
|
9105
9275
|
});
|
|
@@ -9148,7 +9318,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
|
|
|
9148
9318
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9149
9319
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9150
9320
|
* */
|
|
9151
|
-
var useStyles$
|
|
9321
|
+
var useStyles$w = makeStyles(function (theme) {
|
|
9152
9322
|
return createStyles({
|
|
9153
9323
|
row: {
|
|
9154
9324
|
background: function background(isEnabled) {
|
|
@@ -9199,7 +9369,7 @@ var LayerRow = function LayerRow(_ref) {
|
|
|
9199
9369
|
layerActiveLayout = _ref.layerActiveLayout,
|
|
9200
9370
|
layerManagerWidth = _ref.layerManagerWidth,
|
|
9201
9371
|
dragHandle = _ref.dragHandle;
|
|
9202
|
-
var classes = useStyles$
|
|
9372
|
+
var classes = useStyles$w(isEnabled);
|
|
9203
9373
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
9204
9374
|
|
|
9205
9375
|
var onClickRow = function onClickRow() {
|
|
@@ -9778,7 +9948,7 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
|
|
|
9778
9948
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9779
9949
|
* */
|
|
9780
9950
|
var TOOLTIP_TITLE = 'Drag a layer up or down';
|
|
9781
|
-
var useStyles$
|
|
9951
|
+
var useStyles$v = makeStyles(function (theme) {
|
|
9782
9952
|
return {
|
|
9783
9953
|
dragHandle: {
|
|
9784
9954
|
cursor: 'grab',
|
|
@@ -9801,7 +9971,7 @@ var DragHandle = function DragHandle(_ref2) {
|
|
|
9801
9971
|
index = _ref2$index === void 0 ? undefined : _ref2$index,
|
|
9802
9972
|
_ref2$hideTooltip = _ref2.hideTooltip,
|
|
9803
9973
|
hideTooltip = _ref2$hideTooltip === void 0 ? false : _ref2$hideTooltip;
|
|
9804
|
-
var classes = useStyles$
|
|
9974
|
+
var classes = useStyles$v({
|
|
9805
9975
|
isDisabled: isDisabled
|
|
9806
9976
|
});
|
|
9807
9977
|
var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
|
|
@@ -9818,7 +9988,7 @@ var DragHandle = function DragHandle(_ref2) {
|
|
|
9818
9988
|
});
|
|
9819
9989
|
};
|
|
9820
9990
|
|
|
9821
|
-
var useStyles$
|
|
9991
|
+
var useStyles$u = makeStyles(function () {
|
|
9822
9992
|
return {
|
|
9823
9993
|
layerRows: {
|
|
9824
9994
|
width: '100%',
|
|
@@ -9885,7 +10055,7 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
|
|
|
9885
10055
|
|
|
9886
10056
|
var isSorting = activeDragIndex !== null;
|
|
9887
10057
|
var isDragDisabled = layerIds.length === 1;
|
|
9888
|
-
var classes = useStyles$
|
|
10058
|
+
var classes = useStyles$u(isSorting);
|
|
9889
10059
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
9890
10060
|
container: true,
|
|
9891
10061
|
item: true,
|
|
@@ -10095,7 +10265,7 @@ var BaseLayersConnect = function BaseLayersConnect(_ref) {
|
|
|
10095
10265
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10096
10266
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10097
10267
|
* */
|
|
10098
|
-
var useStyles$
|
|
10268
|
+
var useStyles$t = makeStyles({
|
|
10099
10269
|
layerRow: {
|
|
10100
10270
|
width: '100%',
|
|
10101
10271
|
height: '36px'
|
|
@@ -10118,7 +10288,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
|
|
|
10118
10288
|
layerManagerWidth = _ref.layerManagerWidth,
|
|
10119
10289
|
_ref$tooltip = _ref.tooltip,
|
|
10120
10290
|
tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip;
|
|
10121
|
-
var classes = useStyles$
|
|
10291
|
+
var classes = useStyles$t();
|
|
10122
10292
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
10123
10293
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
10124
10294
|
container: true,
|
|
@@ -10147,7 +10317,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
|
|
|
10147
10317
|
})));
|
|
10148
10318
|
};
|
|
10149
10319
|
|
|
10150
|
-
var useStyles$
|
|
10320
|
+
var useStyles$s = makeStyles({
|
|
10151
10321
|
layerRowContainer: {
|
|
10152
10322
|
position: 'relative',
|
|
10153
10323
|
width: '100%',
|
|
@@ -10182,7 +10352,7 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
10182
10352
|
layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect,
|
|
10183
10353
|
_ref$showAddLayersToo = _ref.showAddLayersTooltip,
|
|
10184
10354
|
showAddLayersTooltip = _ref$showAddLayersToo === void 0 ? true : _ref$showAddLayersToo;
|
|
10185
|
-
var classes = useStyles$
|
|
10355
|
+
var classes = useStyles$s();
|
|
10186
10356
|
|
|
10187
10357
|
var _React$useState = React.useState(LayerManagerWidth.lg),
|
|
10188
10358
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -10239,73 +10409,551 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
10239
10409
|
}))));
|
|
10240
10410
|
};
|
|
10241
10411
|
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10412
|
+
/* *
|
|
10413
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10414
|
+
* you may not use this file except in compliance with the License.
|
|
10415
|
+
* You may obtain a copy of the License at
|
|
10416
|
+
*
|
|
10417
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10418
|
+
*
|
|
10419
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10420
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10421
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10422
|
+
* See the License for the specific language governing permissions and
|
|
10423
|
+
* limitations under the License.
|
|
10424
|
+
*
|
|
10425
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10426
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10427
|
+
* */
|
|
10428
|
+
var useButtonStyles = makeStyles(function (theme) {
|
|
10429
|
+
return createStyles({
|
|
10430
|
+
button: {
|
|
10431
|
+
height: '24px',
|
|
10432
|
+
width: function width(_ref) {
|
|
10433
|
+
var _width = _ref.width;
|
|
10434
|
+
return _width ? "".concat(_width, "px") : '24px';
|
|
10435
|
+
},
|
|
10436
|
+
border: 0,
|
|
10437
|
+
backgroundColor: theme.palette.geowebColors.buttons.surfaceIconDefault.fill,
|
|
10438
|
+
borderRadius: '4.5px',
|
|
10439
|
+
textTransform: 'none',
|
|
10440
|
+
'& svg path, svg text': {
|
|
10441
|
+
fill: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10442
|
+
},
|
|
10443
|
+
'&:hover': {
|
|
10444
|
+
backgroundColor: theme.palette.geowebColors.buttons.flatMouseover.fill
|
|
10445
|
+
},
|
|
10446
|
+
'&:disabled': {
|
|
10447
|
+
backgroundColor: theme.palette.geowebColors.buttons.disabled.fill,
|
|
10448
|
+
'& svg path, svg text': {
|
|
10449
|
+
fill: theme.palette.geowebColors.typographyAndIcons.iconLinkDisabled
|
|
10450
|
+
}
|
|
10451
|
+
},
|
|
10452
|
+
'&.Mui-selected': {
|
|
10453
|
+
backgroundColor: theme.palette.geowebColors.buttons.primaryActive.fill,
|
|
10454
|
+
'&:hover': {
|
|
10455
|
+
backgroundColor: theme.palette.geowebColors.buttons.primaryMouseover.fill
|
|
10456
|
+
},
|
|
10457
|
+
'& svg': {
|
|
10458
|
+
backgroundColor: 'transparent'
|
|
10459
|
+
},
|
|
10460
|
+
'& svg path, svg text': {
|
|
10461
|
+
fill: theme.palette.geowebColors.typographyAndIcons.buttonIcon
|
|
10462
|
+
}
|
|
10463
|
+
}
|
|
10464
|
+
}
|
|
10465
|
+
});
|
|
10466
|
+
});
|
|
10467
|
+
|
|
10468
|
+
var ToggleIconButton = function ToggleIconButton(_a) {
|
|
10469
|
+
var active = _a.active,
|
|
10470
|
+
width = _a.width,
|
|
10471
|
+
children = _a.children,
|
|
10472
|
+
props = __rest(_a, ["active", "width", "children"]);
|
|
10473
|
+
|
|
10474
|
+
var classes = useButtonStyles({
|
|
10475
|
+
width: width
|
|
10476
|
+
});
|
|
10477
|
+
return /*#__PURE__*/React.createElement(ToggleButton, Object.assign({
|
|
10478
|
+
className: classes.button,
|
|
10479
|
+
disableRipple: true,
|
|
10480
|
+
selected: active,
|
|
10481
|
+
value: 0
|
|
10482
|
+
}, props), children);
|
|
10483
|
+
};
|
|
10484
|
+
|
|
10485
|
+
/* *
|
|
10486
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10487
|
+
* you may not use this file except in compliance with the License.
|
|
10488
|
+
* You may obtain a copy of the License at
|
|
10489
|
+
*
|
|
10490
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10491
|
+
*
|
|
10492
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10493
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10494
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10495
|
+
* See the License for the specific language governing permissions and
|
|
10496
|
+
* limitations under the License.
|
|
10497
|
+
*
|
|
10498
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10499
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10500
|
+
* */
|
|
10501
|
+
|
|
10502
|
+
var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_ref) {
|
|
10503
|
+
var mapId = _ref.mapId,
|
|
10504
|
+
_ref$source = _ref.source,
|
|
10505
|
+
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
10506
|
+
var dispatch = useDispatch();
|
|
10507
|
+
var currentActiveMapId = useSelector(function (store) {
|
|
10508
|
+
return getDialogMapId(store, 'keywordFilter');
|
|
10509
|
+
});
|
|
10510
|
+
var isOpenInStore = useSelector(function (store) {
|
|
10511
|
+
return getisDialogOpen(store, 'keywordFilter');
|
|
10512
|
+
});
|
|
10513
|
+
var openFilterResultsDialog = React.useCallback(function () {
|
|
10514
|
+
dispatch(setActiveMapIdForDialog({
|
|
10515
|
+
type: 'keywordFilter',
|
|
10516
|
+
activeMapId: mapId,
|
|
10517
|
+
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
|
|
10518
|
+
source: source
|
|
10519
|
+
}));
|
|
10520
|
+
}, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
|
|
10521
|
+
return /*#__PURE__*/React.createElement(ToggleIconButton, {
|
|
10522
|
+
onClick: openFilterResultsDialog,
|
|
10523
|
+
active: isOpenInStore,
|
|
10524
|
+
id: "keywordFilterButton",
|
|
10525
|
+
"data-testid": "keywordFilterButton",
|
|
10526
|
+
disableRipple: true
|
|
10527
|
+
}, /*#__PURE__*/React.createElement(SvgIcon, {
|
|
10528
|
+
viewBox: "0 0 24 24",
|
|
10529
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10530
|
+
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
|
|
10531
|
+
d: "M14.155 12.567c1.362 0 2.523.848 2.992 2.043h1.895a1.173 1.173 0 0 1 0 2.346h-1.895A3.213 3.213 0 0 1 14.155 19a3.213 3.213 0 0 1-2.992-2.044h-5.99a1.172 1.172 0 1 1 0-2.346h5.99a3.214 3.214 0 0 1 2.992-2.043zm0 1.755a1.461 1.461 0 1 0 0 2.922 1.461 1.461 0 0 0 0-2.922zM10.06 5c1.362 0 2.524.848 2.992 2.044h5.99a1.173 1.173 0 1 1 0 2.344h-5.99a3.214 3.214 0 0 1-2.992 2.044 3.216 3.216 0 0 1-2.992-2.044H5.173a1.172 1.172 0 1 1 0-2.344h1.895A3.216 3.216 0 0 1 10.06 5zm0 1.754a1.461 1.461 0 1 0 0 2.922 1.461 1.461 0 0 0 0-2.922z",
|
|
10532
|
+
fill: "#FFF",
|
|
10533
|
+
fillRule: "evenodd"
|
|
10534
|
+
}))));
|
|
10535
|
+
};
|
|
10536
|
+
|
|
10537
|
+
/* *
|
|
10538
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10539
|
+
* you may not use this file except in compliance with the License.
|
|
10540
|
+
* You may obtain a copy of the License at
|
|
10541
|
+
*
|
|
10542
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10543
|
+
*
|
|
10544
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10545
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10546
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10547
|
+
* See the License for the specific language governing permissions and
|
|
10548
|
+
* limitations under the License.
|
|
10549
|
+
*
|
|
10550
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10551
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10552
|
+
* */
|
|
10553
|
+
|
|
10554
|
+
var layerSelectStore = function layerSelectStore(store) {
|
|
10555
|
+
return store && store.layerSelect ? store.layerSelect : null;
|
|
10556
|
+
};
|
|
10557
|
+
|
|
10558
|
+
var getSearchFilter = createSelector(layerSelectStore, function (store) {
|
|
10559
|
+
return store ? store.filters.searchFilter : '';
|
|
10560
|
+
});
|
|
10561
|
+
var getKeywords = createSelector(layerSelectStore, function (store) {
|
|
10562
|
+
return store ? store.filters.keywords : [];
|
|
10563
|
+
});
|
|
10564
|
+
|
|
10565
|
+
/* *
|
|
10566
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10567
|
+
* you may not use this file except in compliance with the License.
|
|
10568
|
+
* You may obtain a copy of the License at
|
|
10569
|
+
*
|
|
10570
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10571
|
+
*
|
|
10572
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10573
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10574
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10575
|
+
* See the License for the specific language governing permissions and
|
|
10576
|
+
* limitations under the License.
|
|
10577
|
+
*
|
|
10578
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10579
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10580
|
+
* */
|
|
10581
|
+
var useStyles$r = makeStyles(function (theme) {
|
|
10582
|
+
return createStyles({
|
|
10583
|
+
dialogTitle: {
|
|
10584
|
+
display: 'flex',
|
|
10585
|
+
justifyContent: 'space-between'
|
|
10586
|
+
},
|
|
10587
|
+
textField: {
|
|
10588
|
+
width: '100%'
|
|
10589
|
+
},
|
|
10590
|
+
button: {
|
|
10591
|
+
'&.MuiButton-containedPrimary': {
|
|
10592
|
+
backgroundColor: theme.palette.geowebColors.buttons.primary.fill
|
|
10593
|
+
},
|
|
10594
|
+
'&.MuiButton-outlined': {
|
|
10595
|
+
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10596
|
+
}
|
|
10597
|
+
},
|
|
10598
|
+
container: {
|
|
10599
|
+
'& .MuiDialog-paper': {
|
|
10600
|
+
backgroundColor: theme.palette.geowebColors.cards.cardContainer
|
|
10601
|
+
}
|
|
10602
|
+
}
|
|
10603
|
+
});
|
|
10604
|
+
});
|
|
10605
|
+
var ADD_HEADING = 'Add a new service';
|
|
10606
|
+
var EDIT_HEADING = 'Edit service';
|
|
10607
|
+
var SAVE_HEADING = 'Save service';
|
|
10608
|
+
|
|
10609
|
+
var getTitleForVariant = function getTitleForVariant(variant) {
|
|
10610
|
+
switch (variant) {
|
|
10611
|
+
case 'add':
|
|
10612
|
+
return ADD_HEADING;
|
|
10613
|
+
|
|
10614
|
+
case 'edit':
|
|
10615
|
+
return EDIT_HEADING;
|
|
10616
|
+
|
|
10617
|
+
default:
|
|
10618
|
+
return SAVE_HEADING;
|
|
10619
|
+
}
|
|
10620
|
+
};
|
|
10621
|
+
|
|
10622
|
+
var ServicePopup = function ServicePopup(_ref) {
|
|
10623
|
+
var servicePopupVariant = _ref.servicePopupVariant,
|
|
10624
|
+
_ref$hideBackdrop = _ref.hideBackdrop,
|
|
10625
|
+
hideBackdrop = _ref$hideBackdrop === void 0 ? false : _ref$hideBackdrop,
|
|
10626
|
+
isOpen = _ref.isOpen,
|
|
10627
|
+
closePopup = _ref.closePopup,
|
|
10628
|
+
_ref$url = _ref.url,
|
|
10629
|
+
url = _ref$url === void 0 ? '' : _ref$url;
|
|
10630
|
+
var classes = useStyles$r();
|
|
10631
|
+
return /*#__PURE__*/React.createElement(Dialog, {
|
|
10632
|
+
open: isOpen,
|
|
10633
|
+
disableBackdropClick: true,
|
|
10634
|
+
hideBackdrop: hideBackdrop,
|
|
10635
|
+
fullWidth: true,
|
|
10636
|
+
maxWidth: "xs",
|
|
10637
|
+
className: classes.container
|
|
10638
|
+
}, /*#__PURE__*/React.createElement(DialogTitle, {
|
|
10639
|
+
className: classes.dialogTitle,
|
|
10640
|
+
disableTypography: true
|
|
10641
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
10642
|
+
variant: "h5"
|
|
10643
|
+
}, getTitleForVariant(servicePopupVariant)), /*#__PURE__*/React.createElement(IconButton, {
|
|
10644
|
+
size: "small",
|
|
10645
|
+
onClick: closePopup,
|
|
10646
|
+
"data-testid": "ClosePopupButtonCross"
|
|
10647
|
+
}, /*#__PURE__*/React.createElement(Close, null))), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement(TextField, {
|
|
10648
|
+
className: classes.textField,
|
|
10649
|
+
variant: "filled",
|
|
10650
|
+
label: "Service name"
|
|
10651
|
+
})), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement(TextField, {
|
|
10652
|
+
className: classes.textField,
|
|
10653
|
+
variant: "filled",
|
|
10654
|
+
label: "Service URL",
|
|
10655
|
+
defaultValue: url,
|
|
10656
|
+
id: "service-url"
|
|
10657
|
+
})), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement(TextField, {
|
|
10658
|
+
className: classes.textField,
|
|
10659
|
+
variant: "filled",
|
|
10660
|
+
multiline: true,
|
|
10661
|
+
rows: 4,
|
|
10662
|
+
label: "Abstracts",
|
|
10663
|
+
helperText: "Short description of what this service does"
|
|
10664
|
+
})), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button, {
|
|
10665
|
+
variant: "outlined",
|
|
10666
|
+
className: classes.button,
|
|
10667
|
+
onClick: closePopup,
|
|
10668
|
+
"data-testid": "ClosePopupButtonCancel"
|
|
10669
|
+
}, "cancel"), /*#__PURE__*/React.createElement(Button, {
|
|
10670
|
+
variant: "contained",
|
|
10671
|
+
color: "primary",
|
|
10672
|
+
className: classes.button
|
|
10673
|
+
}, "save")));
|
|
10674
|
+
};
|
|
10675
|
+
|
|
10676
|
+
var isURL = function isURL(string) {
|
|
10677
|
+
return /^https?:\/\//.test(string);
|
|
10678
|
+
};
|
|
10679
|
+
var useStyles$q = makeStyles(function (theme) {
|
|
10680
|
+
return {
|
|
10681
|
+
iconButton: {
|
|
10682
|
+
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10683
|
+
},
|
|
10684
|
+
saveButton: {
|
|
10685
|
+
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
|
|
10686
|
+
textTransform: 'none',
|
|
10687
|
+
border: "1px solid ".concat(theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat)
|
|
10688
|
+
}
|
|
10689
|
+
};
|
|
10690
|
+
});
|
|
10691
|
+
var clearIconPath = 'M12,2 C17.5228475,2 22,6.4771525 22,12 C22,17.5228475 17.5228475,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M15.44426,7.26697571 L12.0002861,10.7110482 L8.55573996,7.26697571 C8.19978253,6.9110081 7.62292549,6.9110081 7.26696807,7.26697571 C6.91101064,7.62294331 6.91101064,8.19981687 7.26696807,8.55578447 L10.7115142,11.9998569 L7.26696807,15.4445017 C6.91101064,15.8004693 6.91101064,16.3767705 7.26696807,16.7333104 C7.44494678,16.910722 7.67843653,17 7.91192629,17 C8.14484377,17 8.37776125,16.910722 8.55573996,16.7333104 L12.0002861,13.289238 L15.44426,16.7333104 C15.6222388,16.910722 15.8551562,17 16.088646,17 C16.3221357,17 16.5550532,16.910722 16.7330319,16.7333104 C17.0889894,16.3767705 17.0889894,15.8004693 16.7330319,15.4445017 L13.289058,11.9998569 L16.7330319,8.55578447 C17.0889894,8.19981687 17.0889894,7.62294331 16.7330319,7.26697571 C16.3770745,6.9110081 15.8002175,6.9110081 15.44426,7.26697571 Z';
|
|
10692
|
+
var clearIcon = /*#__PURE__*/React__default.createElement(SvgIcon, {
|
|
10693
|
+
style: {
|
|
10694
|
+
width: '24px',
|
|
10695
|
+
height: '24px'
|
|
10696
|
+
},
|
|
10697
|
+
viewBox: "0 0 24 24",
|
|
10698
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10699
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
10700
|
+
d: clearIconPath
|
|
10701
|
+
}));
|
|
10702
|
+
var searchIconPath = 'M7.81701445,12.5845372 L7.81701445,12.5845372 C7.17924024,11.946763 6.82932049,11.100321 6.82932049,10.1993044 C6.82932049,9.29828785 7.17924024,8.45077582 7.81701445,7.8140717 C8.47405029,7.15703585 9.3376137,6.82851792 10.2022472,6.82851792 C11.0658106,6.82851792 11.929374,7.15703585 12.5874799,7.8140717 C13.9026217,9.12921348 13.9026217,11.2693954 12.5874799,12.5845372 C11.9497057,13.2212413 11.1021937,13.5722311 10.2022472,13.5722311 C9.3012306,13.5722311 8.45371857,13.2212413 7.81701445,12.5845372 M19.5858748,17.581862 L15.4681648,13.465222 C16.9513109,11.0735688 16.6613162,7.88683788 14.5874799,5.81300161 C12.1690744,3.39566613 8.23434992,3.39566613 5.81594436,5.81300161 C4.64419476,6.9847512 4,8.54280364 4,10.1993044 C4,11.8558052 4.64419476,13.4138577 5.81594436,14.5845372 C6.98769395,15.7562868 8.5446763,16.4015516 10.2022472,16.4015516 C11.376137,16.4015516 12.4965222,16.0719636 13.4681648,15.4662921 L17.5837346,19.582932 C17.8608882,19.8590155 18.2225789,19.9970572 18.5853398,19.9970572 C18.9470305,19.9970572 19.3087212,19.8590155 19.5858748,19.582932 C20.1380417,19.029695 20.1380417,18.135099 19.5858748,17.581862';
|
|
10703
|
+
var searchIcon = /*#__PURE__*/React__default.createElement(SvgIcon, {
|
|
10704
|
+
style: {
|
|
10705
|
+
width: '24px',
|
|
10706
|
+
height: '24px'
|
|
10707
|
+
},
|
|
10708
|
+
viewBox: "0 0 24 24",
|
|
10709
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10710
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
10711
|
+
d: searchIconPath
|
|
10712
|
+
}));
|
|
10713
|
+
|
|
10714
|
+
var SearchFieldButtonContainer = function SearchFieldButtonContainer(_ref) {
|
|
10715
|
+
var localSearchString = _ref.localSearchString,
|
|
10716
|
+
onClickClear = _ref.onClickClear;
|
|
10717
|
+
|
|
10718
|
+
var _React$useState = React__default.useState(false),
|
|
10719
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10720
|
+
isPopupOpen = _React$useState2[0],
|
|
10721
|
+
setPopupOpen = _React$useState2[1];
|
|
10722
|
+
|
|
10723
|
+
var classes = useStyles$q();
|
|
10724
|
+
var ClearButton = /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
10725
|
+
title: "Clear",
|
|
10726
|
+
placement: "top"
|
|
10727
|
+
}, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
10728
|
+
className: classes.iconButton,
|
|
10729
|
+
edge: "end",
|
|
10730
|
+
onClick: function onClick() {
|
|
10731
|
+
onClickClear();
|
|
10732
|
+
}
|
|
10733
|
+
}, clearIcon));
|
|
10734
|
+
if (isURL(localSearchString)) return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10735
|
+
style: {
|
|
10736
|
+
marginRight: '15px'
|
|
10737
|
+
}
|
|
10738
|
+
}, ClearButton), /*#__PURE__*/React__default.createElement(Button, {
|
|
10739
|
+
variant: "outlined",
|
|
10740
|
+
onClick: function onClick() {
|
|
10741
|
+
return setPopupOpen(true);
|
|
10742
|
+
},
|
|
10743
|
+
className: classes.saveButton
|
|
10744
|
+
}, "Save"), /*#__PURE__*/React__default.createElement(ServicePopup, {
|
|
10745
|
+
servicePopupVariant: "save",
|
|
10746
|
+
isOpen: isPopupOpen,
|
|
10747
|
+
closePopup: function closePopup() {
|
|
10748
|
+
return setPopupOpen(false);
|
|
10749
|
+
},
|
|
10750
|
+
url: localSearchString
|
|
10751
|
+
}));
|
|
10752
|
+
if (localSearchString) return ClearButton;
|
|
10753
|
+
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
10754
|
+
title: "Search",
|
|
10755
|
+
placement: "top"
|
|
10756
|
+
}, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
10757
|
+
className: classes.iconButton,
|
|
10758
|
+
edge: "end"
|
|
10759
|
+
}, searchIcon));
|
|
10760
|
+
};
|
|
10761
|
+
|
|
10762
|
+
var SearchField = function SearchField(_ref) {
|
|
10763
|
+
var searchFilter = _ref.searchFilter,
|
|
10764
|
+
setSearchFilter = _ref.setSearchFilter;
|
|
10765
|
+
|
|
10766
|
+
var _React$useState = React.useState(''),
|
|
10767
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10768
|
+
localSearchString = _React$useState2[0],
|
|
10769
|
+
setLocalSearchString = _React$useState2[1]; // mirror store unless typing a URL
|
|
10770
|
+
|
|
10771
|
+
|
|
10772
|
+
React.useEffect(function () {
|
|
10773
|
+
if (isURL(localSearchString)) return;
|
|
10774
|
+
setLocalSearchString(searchFilter); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10775
|
+
}, [searchFilter]); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10776
|
+
|
|
10777
|
+
var setSearchFilterDebounced = React.useCallback(debounce(setSearchFilter, 300), []);
|
|
10778
|
+
|
|
10779
|
+
var handleChange = function handleChange(text) {
|
|
10780
|
+
setLocalSearchString(text);
|
|
10781
|
+
if (!isURL(text)) setSearchFilterDebounced(text);else if (searchFilter) setSearchFilterDebounced('');
|
|
10782
|
+
};
|
|
10783
|
+
|
|
10784
|
+
return /*#__PURE__*/React.createElement(TextField, {
|
|
10785
|
+
variant: "filled",
|
|
10786
|
+
label: "Search through services or enter a service URL",
|
|
10787
|
+
value: localSearchString,
|
|
10788
|
+
onChange: function onChange(e) {
|
|
10789
|
+
handleChange(e.target.value);
|
|
10790
|
+
},
|
|
10791
|
+
autoFocus: true,
|
|
10792
|
+
fullWidth: true,
|
|
10793
|
+
InputProps: {
|
|
10794
|
+
endAdornment: /*#__PURE__*/React.createElement(InputAdornment, {
|
|
10795
|
+
position: "end"
|
|
10796
|
+
}, /*#__PURE__*/React.createElement(SearchFieldButtonContainer, {
|
|
10797
|
+
localSearchString: localSearchString,
|
|
10798
|
+
onClickClear: function onClickClear() {
|
|
10799
|
+
setLocalSearchString('');
|
|
10800
|
+
setSearchFilterDebounced('');
|
|
10801
|
+
}
|
|
10802
|
+
}))
|
|
10803
|
+
}
|
|
10804
|
+
});
|
|
10805
|
+
};
|
|
10806
|
+
|
|
10807
|
+
/* *
|
|
10808
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10809
|
+
* you may not use this file except in compliance with the License.
|
|
10810
|
+
* You may obtain a copy of the License at
|
|
10811
|
+
*
|
|
10812
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10813
|
+
*
|
|
10814
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10815
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10816
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10817
|
+
* See the License for the specific language governing permissions and
|
|
10818
|
+
* limitations under the License.
|
|
10819
|
+
*
|
|
10820
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10821
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10822
|
+
* */
|
|
10823
|
+
|
|
10824
|
+
var SearchFieldConnect = function SearchFieldConnect() {
|
|
10825
|
+
var dispatch = useDispatch();
|
|
10826
|
+
var searchFilter = useSelector(function (store) {
|
|
10827
|
+
return getSearchFilter(store);
|
|
10828
|
+
});
|
|
10829
|
+
return /*#__PURE__*/React.createElement(SearchField, {
|
|
10830
|
+
setSearchFilter: function setSearchFilter$1(filterText) {
|
|
10831
|
+
return dispatch(setSearchFilter({
|
|
10832
|
+
filterText: filterText
|
|
10833
|
+
}));
|
|
10834
|
+
},
|
|
10835
|
+
searchFilter: searchFilter
|
|
10836
|
+
});
|
|
10837
|
+
};
|
|
10838
|
+
|
|
10839
|
+
var useStyles$p = makeStyles(function (theme) {
|
|
10840
|
+
return {
|
|
10841
|
+
layerRow: {
|
|
10842
|
+
background: theme.palette.geowebColors.background.surface,
|
|
10843
|
+
padding: '8px 0px 8px 12px',
|
|
10844
|
+
marginBottom: '4px',
|
|
10845
|
+
height: '64px',
|
|
10846
|
+
border: "solid 1px ".concat(theme.palette.geowebColors.cards.cardContainerBorder)
|
|
10847
|
+
},
|
|
10848
|
+
layerText: {
|
|
10849
|
+
fontSize: '12px',
|
|
10850
|
+
fontWeight: 500,
|
|
10851
|
+
overflow: 'clip',
|
|
10852
|
+
height: '20px',
|
|
10853
|
+
textOverflow: 'ellipsis',
|
|
10854
|
+
whiteSpace: 'nowrap'
|
|
10855
|
+
},
|
|
10856
|
+
layerName: {
|
|
10857
|
+
fontSize: '12px',
|
|
10858
|
+
height: '24px',
|
|
10859
|
+
maxWidth: '100%',
|
|
10860
|
+
overflow: 'clip',
|
|
10861
|
+
"float": 'left',
|
|
10862
|
+
paddingTop: '6px',
|
|
10863
|
+
textOverflow: 'ellipsis',
|
|
10864
|
+
whiteSpace: 'nowrap'
|
|
10865
|
+
},
|
|
10866
|
+
layerNameMaxWidth: {
|
|
10867
|
+
maxWidth: '196px'
|
|
10868
|
+
},
|
|
10869
|
+
layerAbstract: {
|
|
10870
|
+
fontSize: '10px',
|
|
10871
|
+
paddingLeft: '200px',
|
|
10872
|
+
overflow: 'clip',
|
|
10873
|
+
height: '30px'
|
|
10874
|
+
},
|
|
10875
|
+
resultCount: {
|
|
10876
|
+
marginBottom: '4px',
|
|
10877
|
+
fontSize: '12px'
|
|
10878
|
+
}
|
|
10879
|
+
};
|
|
10880
|
+
});
|
|
10881
|
+
|
|
10882
|
+
var LayerList = function LayerList(_ref) {
|
|
10883
|
+
var services = _ref.services,
|
|
10884
|
+
serviceIds = _ref.serviceIds,
|
|
10885
|
+
layerSelectHeight = _ref.layerSelectHeight;
|
|
10886
|
+
var classes = useStyles$p();
|
|
10887
|
+
|
|
10888
|
+
var _React$useState = React.useState(0),
|
|
10889
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10890
|
+
numberOfLayers = _React$useState2[0],
|
|
10891
|
+
setNumberOfLayers = _React$useState2[1];
|
|
10892
|
+
|
|
10893
|
+
React.useEffect(function () {
|
|
10894
|
+
setNumberOfLayers(serviceIds.reduce(function (totalNumberOfLayers, serviceId) {
|
|
10895
|
+
return totalNumberOfLayers + services[serviceId].layers.length;
|
|
10896
|
+
}, 0));
|
|
10897
|
+
}, [serviceIds, services]);
|
|
10898
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10899
|
+
"data-testid": "layerList"
|
|
10900
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
10901
|
+
className: classes.resultCount
|
|
10902
|
+
}, numberOfLayers, " results"), /*#__PURE__*/React.createElement("div", {
|
|
10903
|
+
style: {
|
|
10904
|
+
height: layerSelectHeight - 199,
|
|
10905
|
+
overflow: 'auto'
|
|
10906
|
+
}
|
|
10907
|
+
}, serviceIds.map(function (serviceId) {
|
|
10908
|
+
return services[serviceId].layers.map(function (layer) {
|
|
10909
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10910
|
+
key: "".concat(serviceId, "-").concat(layer.name),
|
|
10911
|
+
className: classes.layerRow,
|
|
10912
|
+
"data-testid": "layerListLayerRow"
|
|
10913
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
10914
|
+
className: classes.layerText
|
|
10915
|
+
}, layer.text), /*#__PURE__*/React.createElement("div", null, layer["abstract"] ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
10916
|
+
className: "".concat(classes.layerName, " ").concat(classes.layerNameMaxWidth)
|
|
10917
|
+
}, layer.name), /*#__PURE__*/React.createElement("div", {
|
|
10918
|
+
className: classes.layerAbstract,
|
|
10919
|
+
"data-testid": "layerAbstract"
|
|
10920
|
+
}, layer["abstract"])) : /*#__PURE__*/React.createElement("div", {
|
|
10921
|
+
className: classes.layerName
|
|
10922
|
+
}, layer.name)));
|
|
10923
|
+
});
|
|
10924
|
+
})));
|
|
10925
|
+
};
|
|
10926
|
+
|
|
10927
|
+
/* *
|
|
10928
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10929
|
+
* you may not use this file except in compliance with the License.
|
|
10930
|
+
* You may obtain a copy of the License at
|
|
10931
|
+
*
|
|
10932
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10933
|
+
*
|
|
10934
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10935
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10936
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10937
|
+
* See the License for the specific language governing permissions and
|
|
10938
|
+
* limitations under the License.
|
|
10939
|
+
*
|
|
10940
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10941
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10942
|
+
* */
|
|
10943
|
+
|
|
10944
|
+
var LayerListConnect = function LayerListConnect(_ref) {
|
|
10945
|
+
var layerSelectHeight = _ref.layerSelectHeight;
|
|
10946
|
+
var allServiceIds = useSelector(function (store) {
|
|
10947
|
+
return getServiceIds(store);
|
|
10948
|
+
});
|
|
10949
|
+
var allServices = useSelector(function (store) {
|
|
10950
|
+
return getServices(store);
|
|
10951
|
+
});
|
|
10952
|
+
return /*#__PURE__*/React.createElement(LayerList, {
|
|
10953
|
+
services: allServices,
|
|
10954
|
+
serviceIds: allServiceIds,
|
|
10955
|
+
layerSelectHeight: layerSelectHeight
|
|
10956
|
+
});
|
|
10309
10957
|
};
|
|
10310
10958
|
|
|
10311
10959
|
/* *
|
|
@@ -10324,7 +10972,7 @@ var SearchField = function SearchField() {
|
|
|
10324
10972
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10325
10973
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10326
10974
|
* */
|
|
10327
|
-
var useStyles$
|
|
10975
|
+
var useStyles$o = makeStyles(function (theme) {
|
|
10328
10976
|
return createStyles({
|
|
10329
10977
|
chip: {
|
|
10330
10978
|
height: '32px',
|
|
@@ -10348,7 +10996,7 @@ var ServiceChip = function ServiceChip(_ref) {
|
|
|
10348
10996
|
var _ref$all = _ref.all,
|
|
10349
10997
|
all = _ref$all === void 0 ? false : _ref$all,
|
|
10350
10998
|
service = _ref.service;
|
|
10351
|
-
var classes = useStyles$
|
|
10999
|
+
var classes = useStyles$o();
|
|
10352
11000
|
|
|
10353
11001
|
if (all) {
|
|
10354
11002
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -10369,7 +11017,7 @@ var ServiceChip = function ServiceChip(_ref) {
|
|
|
10369
11017
|
});
|
|
10370
11018
|
};
|
|
10371
11019
|
|
|
10372
|
-
var useStyles$
|
|
11020
|
+
var useStyles$n = makeStyles(function (theme) {
|
|
10373
11021
|
return createStyles({
|
|
10374
11022
|
serviceChips: {
|
|
10375
11023
|
width: '100%',
|
|
@@ -10377,22 +11025,36 @@ var useStyles$k = makeStyles(function (theme) {
|
|
|
10377
11025
|
alignItems: 'center',
|
|
10378
11026
|
overflowX: 'visible',
|
|
10379
11027
|
"float": 'left',
|
|
10380
|
-
paddingLeft: '
|
|
11028
|
+
paddingLeft: '40px',
|
|
11029
|
+
marginRight: function marginRight(_ref) {
|
|
11030
|
+
var margin = _ref.margin;
|
|
11031
|
+
return margin;
|
|
11032
|
+
},
|
|
11033
|
+
marginLeft: function marginLeft(_ref2) {
|
|
11034
|
+
var margin = _ref2.margin;
|
|
11035
|
+
return -margin;
|
|
11036
|
+
},
|
|
11037
|
+
maxWidth: function maxWidth(_ref3) {
|
|
11038
|
+
var maxWidthValue = _ref3.maxWidthValue;
|
|
11039
|
+
return maxWidthValue;
|
|
11040
|
+
}
|
|
10381
11041
|
},
|
|
10382
11042
|
scrollArrowLeft: {
|
|
10383
11043
|
width: '120px',
|
|
10384
11044
|
marginBottom: '-12px',
|
|
10385
11045
|
height: '34px',
|
|
10386
11046
|
backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
|
|
10387
|
-
|
|
10388
|
-
|
|
11047
|
+
cursor: 'pointer',
|
|
11048
|
+
marginRight: '-120px',
|
|
11049
|
+
"float": 'left',
|
|
11050
|
+
zIndex: 1,
|
|
11051
|
+
position: 'relative'
|
|
10389
11052
|
},
|
|
10390
11053
|
serviceList: {
|
|
10391
11054
|
height: '32px',
|
|
10392
11055
|
marginTop: '8px',
|
|
10393
11056
|
width: '100%',
|
|
10394
|
-
|
|
10395
|
-
marginRight: '-120px'
|
|
11057
|
+
overflow: 'hidden'
|
|
10396
11058
|
},
|
|
10397
11059
|
scrollArrowRight: {
|
|
10398
11060
|
width: '120px',
|
|
@@ -10406,10 +11068,9 @@ var useStyles$k = makeStyles(function (theme) {
|
|
|
10406
11068
|
});
|
|
10407
11069
|
});
|
|
10408
11070
|
|
|
10409
|
-
var ServiceList = function ServiceList(
|
|
10410
|
-
var layerSelectWidth =
|
|
10411
|
-
services =
|
|
10412
|
-
var classes = useStyles$k();
|
|
11071
|
+
var ServiceList = function ServiceList(_ref4) {
|
|
11072
|
+
var layerSelectWidth = _ref4.layerSelectWidth,
|
|
11073
|
+
services = _ref4.services;
|
|
10413
11074
|
|
|
10414
11075
|
var _React$useState = React.useState(0),
|
|
10415
11076
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -10422,16 +11083,21 @@ var ServiceList = function ServiceList(_ref) {
|
|
|
10422
11083
|
setWidth = _React$useState4[1];
|
|
10423
11084
|
|
|
10424
11085
|
var ref = React.useRef(null);
|
|
11086
|
+
var maxWidthValue = ref && ref.current && ref.current.scrollWidth && ref.current.scrollWidth >= layerSelectWidth - margin && ref.current.scrollWidth || layerSelectWidth - 50;
|
|
11087
|
+
var classes = useStyles$n({
|
|
11088
|
+
margin: margin,
|
|
11089
|
+
maxWidthValue: maxWidthValue
|
|
11090
|
+
});
|
|
10425
11091
|
var onLeftArrowClick = React.useCallback(function () {
|
|
10426
11092
|
setMargin(Math.max(0, margin - 100));
|
|
10427
11093
|
}, [margin]);
|
|
10428
11094
|
var onRightArrowClick = React.useCallback(function () {
|
|
10429
11095
|
setMargin(Math.min(width - layerSelectWidth, margin + 100));
|
|
10430
11096
|
}, [margin, layerSelectWidth, width]);
|
|
10431
|
-
var gapRight = 35;
|
|
10432
11097
|
React.useEffect(function () {
|
|
10433
|
-
setWidth(ref.current.scrollWidth +
|
|
10434
|
-
|
|
11098
|
+
setWidth(ref.current.scrollWidth + 50);
|
|
11099
|
+
setMargin(Math.max(0, Math.min(width - layerSelectWidth, margin)));
|
|
11100
|
+
}, [services, layerSelectWidth, width, margin]);
|
|
10435
11101
|
return /*#__PURE__*/React.createElement("div", {
|
|
10436
11102
|
className: classes.serviceList,
|
|
10437
11103
|
"data-testid": "serviceList"
|
|
@@ -10441,10 +11107,6 @@ var ServiceList = function ServiceList(_ref) {
|
|
|
10441
11107
|
"data-testid": "leftScrollArrow"
|
|
10442
11108
|
}), /*#__PURE__*/React.createElement("div", {
|
|
10443
11109
|
className: classes.serviceChips,
|
|
10444
|
-
style: {
|
|
10445
|
-
marginLeft: "".concat(-margin, "px"),
|
|
10446
|
-
marginRight: "".concat(margin, "px")
|
|
10447
|
-
},
|
|
10448
11110
|
ref: ref
|
|
10449
11111
|
}, services && Object.keys(services) && Object.keys(services).length > 0 && /*#__PURE__*/React.createElement(ServiceChip, {
|
|
10450
11112
|
key: "All",
|
|
@@ -10454,7 +11116,7 @@ var ServiceList = function ServiceList(_ref) {
|
|
|
10454
11116
|
key: services[service].id,
|
|
10455
11117
|
service: services[service]
|
|
10456
11118
|
});
|
|
10457
|
-
})), margin < width
|
|
11119
|
+
})), layerSelectWidth + margin < width && /*#__PURE__*/React.createElement(ChevronRight, {
|
|
10458
11120
|
className: classes.scrollArrowRight,
|
|
10459
11121
|
onClick: onRightArrowClick,
|
|
10460
11122
|
"data-testid": "rightScrollArrow"
|
|
@@ -10489,9 +11151,72 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
|
|
|
10489
11151
|
});
|
|
10490
11152
|
};
|
|
10491
11153
|
|
|
10492
|
-
var useStyles$
|
|
11154
|
+
var useStyles$m = makeStyles(function (theme) {
|
|
11155
|
+
return createStyles({
|
|
11156
|
+
servicesContainer: {
|
|
11157
|
+
width: '300px',
|
|
11158
|
+
height: '380px',
|
|
11159
|
+
position: 'fixed',
|
|
11160
|
+
top: '140px',
|
|
11161
|
+
right: '-72px',
|
|
11162
|
+
backgroundColor: theme.palette.geowebColors.background.surface,
|
|
11163
|
+
boxShadow: theme.shadows[6]
|
|
11164
|
+
},
|
|
11165
|
+
servicesText: {
|
|
11166
|
+
paddingTop: '12px',
|
|
11167
|
+
paddingLeft: '12px'
|
|
11168
|
+
}
|
|
11169
|
+
});
|
|
11170
|
+
});
|
|
11171
|
+
|
|
11172
|
+
var ServiceOptionsButton = function ServiceOptionsButton() {
|
|
11173
|
+
var classes = useStyles$m();
|
|
11174
|
+
|
|
11175
|
+
var _React$useState = React.useState(false),
|
|
11176
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
11177
|
+
containerOpen = _React$useState2[0],
|
|
11178
|
+
setContainerOpen = _React$useState2[1];
|
|
11179
|
+
|
|
11180
|
+
var toggleContainer = function toggleContainer() {
|
|
11181
|
+
setContainerOpen(!containerOpen);
|
|
11182
|
+
};
|
|
11183
|
+
|
|
11184
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ToggleIconButton, {
|
|
11185
|
+
onClick: toggleContainer,
|
|
11186
|
+
active: containerOpen,
|
|
11187
|
+
"data-testid": "serviceOptionsButton"
|
|
11188
|
+
}, /*#__PURE__*/React.createElement(SvgIcon, {
|
|
11189
|
+
viewBox: "0 0 24 24",
|
|
11190
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11191
|
+
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
|
|
11192
|
+
d: "M12 16c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0-2c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm0-6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z",
|
|
11193
|
+
fill: "#FFF",
|
|
11194
|
+
fillRule: "evenodd"
|
|
11195
|
+
})))), containerOpen ? /*#__PURE__*/React.createElement(Box, {
|
|
11196
|
+
className: classes.servicesContainer,
|
|
11197
|
+
"data-testid": "container"
|
|
11198
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
11199
|
+
className: classes.servicesText
|
|
11200
|
+
}, "Services")) : null);
|
|
11201
|
+
};
|
|
11202
|
+
|
|
11203
|
+
var useStyles$l = makeStyles({
|
|
10493
11204
|
serviceList: {
|
|
10494
11205
|
height: '48px'
|
|
11206
|
+
},
|
|
11207
|
+
keywordFilterButton: {
|
|
11208
|
+
"float": 'left',
|
|
11209
|
+
position: 'absolute',
|
|
11210
|
+
margin: '12px 0 0 8px',
|
|
11211
|
+
zIndex: 2
|
|
11212
|
+
},
|
|
11213
|
+
serviceOptionsButton: {
|
|
11214
|
+
position: 'absolute',
|
|
11215
|
+
margin: '12px 0 0 calc(100% - 36px)',
|
|
11216
|
+
zIndex: 2
|
|
11217
|
+
},
|
|
11218
|
+
layerSelectContainer: {
|
|
11219
|
+
padding: '0 8px'
|
|
10495
11220
|
}
|
|
10496
11221
|
});
|
|
10497
11222
|
|
|
@@ -10508,48 +11233,421 @@ var LayerSelect = function LayerSelect(_ref) {
|
|
|
10508
11233
|
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
10509
11234
|
_ref$source = _ref.source,
|
|
10510
11235
|
source = _ref$source === void 0 ? 'module' : _ref$source;
|
|
11236
|
+
var classes = useStyles$l();
|
|
11237
|
+
|
|
11238
|
+
var _React$useState = React.useState(500),
|
|
11239
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
11240
|
+
height = _React$useState2[0],
|
|
11241
|
+
setHeight = _React$useState2[1];
|
|
11242
|
+
|
|
11243
|
+
var _React$useState3 = React.useState(750),
|
|
11244
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
11245
|
+
width = _React$useState4[0],
|
|
11246
|
+
setWidth = _React$useState4[1];
|
|
11247
|
+
|
|
11248
|
+
var onChangeSize = function onChangeSize(_ref2) {
|
|
11249
|
+
var height = _ref2.height,
|
|
11250
|
+
width = _ref2.width;
|
|
11251
|
+
setHeight(height);
|
|
11252
|
+
setWidth(width);
|
|
11253
|
+
};
|
|
11254
|
+
|
|
11255
|
+
return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
|
|
11256
|
+
title: showTitle ? "Layer Select ".concat(mapId) : 'Layer Select',
|
|
11257
|
+
startSize: {
|
|
11258
|
+
width: width,
|
|
11259
|
+
height: height
|
|
11260
|
+
},
|
|
11261
|
+
minWidth: 390,
|
|
11262
|
+
minHeight: 126,
|
|
11263
|
+
startPosition: {
|
|
11264
|
+
top: 150,
|
|
11265
|
+
left: 100
|
|
11266
|
+
},
|
|
11267
|
+
isOpen: isOpen,
|
|
11268
|
+
onChangeSize: onChangeSize,
|
|
11269
|
+
onClose: onClose,
|
|
11270
|
+
headerSize: "small",
|
|
11271
|
+
bounds: bounds,
|
|
11272
|
+
"data-testid": "layerSelectWindow",
|
|
11273
|
+
onMouseDown: onMouseDown,
|
|
11274
|
+
order: order,
|
|
11275
|
+
source: source
|
|
11276
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11277
|
+
style: {
|
|
11278
|
+
padding: '6px'
|
|
11279
|
+
}
|
|
11280
|
+
}, /*#__PURE__*/React.createElement(SearchFieldConnect, null)), /*#__PURE__*/React.createElement("div", {
|
|
11281
|
+
className: classes.keywordFilterButton
|
|
11282
|
+
}, /*#__PURE__*/React.createElement(KeywordFilterButtonConnect, {
|
|
11283
|
+
mapId: mapId
|
|
11284
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
11285
|
+
className: classes.serviceOptionsButton
|
|
11286
|
+
}, /*#__PURE__*/React.createElement(ServiceOptionsButton, null)), /*#__PURE__*/React.createElement("div", {
|
|
11287
|
+
className: classes.serviceList
|
|
11288
|
+
}, /*#__PURE__*/React.createElement(ServiceListConnect, {
|
|
11289
|
+
layerSelectWidth: width
|
|
11290
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
11291
|
+
className: classes.layerSelectContainer
|
|
11292
|
+
}, /*#__PURE__*/React.createElement(LayerListConnect, {
|
|
11293
|
+
layerSelectHeight: height
|
|
11294
|
+
})));
|
|
11295
|
+
};
|
|
11296
|
+
|
|
11297
|
+
/* *
|
|
11298
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11299
|
+
* you may not use this file except in compliance with the License.
|
|
11300
|
+
* You may obtain a copy of the License at
|
|
11301
|
+
*
|
|
11302
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11303
|
+
*
|
|
11304
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11305
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11306
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11307
|
+
* See the License for the specific language governing permissions and
|
|
11308
|
+
* limitations under the License.
|
|
11309
|
+
*
|
|
11310
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11311
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11312
|
+
* */
|
|
11313
|
+
var CustomSwitch = withStyles(function (theme) {
|
|
11314
|
+
return {
|
|
11315
|
+
switchBase: {
|
|
11316
|
+
'&$checked': {
|
|
11317
|
+
color: theme.palette.geowebColors.customSlider.thumb
|
|
11318
|
+
},
|
|
11319
|
+
'&$checked + $track': {
|
|
11320
|
+
backgroundColor: theme.palette.geowebColors.buttons.primary.fill
|
|
11321
|
+
}
|
|
11322
|
+
},
|
|
11323
|
+
checked: {},
|
|
11324
|
+
track: {
|
|
11325
|
+
backgroundColor: theme.palette.geowebColors.customSlider.switchTrackDisabled,
|
|
11326
|
+
opacity: '1 !important'
|
|
11327
|
+
}
|
|
11328
|
+
};
|
|
11329
|
+
})(Switch);
|
|
11330
|
+
|
|
11331
|
+
var useStyles$k = makeStyles(function (theme) {
|
|
11332
|
+
return createStyles({
|
|
11333
|
+
listItem: {
|
|
11334
|
+
width: '100%',
|
|
11335
|
+
minWidth: '300px',
|
|
11336
|
+
padding: '0px',
|
|
11337
|
+
paddingLeft: '10px',
|
|
11338
|
+
paddingRight: '50px',
|
|
11339
|
+
fontSize: '12px'
|
|
11340
|
+
},
|
|
11341
|
+
onlyByttonText: {
|
|
11342
|
+
color: theme.palette.geowebColors.buttons.primary.fill,
|
|
11343
|
+
fontSize: '14px',
|
|
11344
|
+
fontWeight: 500
|
|
11345
|
+
},
|
|
11346
|
+
checkbox: {
|
|
11347
|
+
paddingTop: '6px',
|
|
11348
|
+
paddingBottom: '7px',
|
|
11349
|
+
'&&:hover': {
|
|
11350
|
+
backgroundColor: 'transparent'
|
|
11351
|
+
}
|
|
11352
|
+
},
|
|
11353
|
+
listItemIcon: {
|
|
11354
|
+
minWidth: '42px'
|
|
11355
|
+
},
|
|
11356
|
+
listItemText: {
|
|
11357
|
+
textOverflow: 'ellipsis',
|
|
11358
|
+
whiteSpace: 'nowrap',
|
|
11359
|
+
overflow: 'hidden'
|
|
11360
|
+
}
|
|
11361
|
+
});
|
|
11362
|
+
});
|
|
11363
|
+
|
|
11364
|
+
var FilterListItem = function FilterListItem(_ref) {
|
|
11365
|
+
var index = _ref.index,
|
|
11366
|
+
text = _ref.text,
|
|
11367
|
+
checked = _ref.checked,
|
|
11368
|
+
toggleCheckbox = _ref.toggleCheckbox,
|
|
11369
|
+
selectOnlyOne = _ref.selectOnlyOne;
|
|
11370
|
+
var classes = useStyles$k();
|
|
11371
|
+
|
|
11372
|
+
var _React$useState = React.useState(false),
|
|
11373
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
11374
|
+
hovering = _React$useState2[0],
|
|
11375
|
+
setHovering = _React$useState2[1];
|
|
11376
|
+
|
|
11377
|
+
var handleMouseOver = React.useCallback(function () {
|
|
11378
|
+
setHovering(true);
|
|
11379
|
+
}, []);
|
|
11380
|
+
var handleMouseLeave = React.useCallback(function () {
|
|
11381
|
+
setHovering(false);
|
|
11382
|
+
}, []);
|
|
11383
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11384
|
+
onMouseOver: handleMouseOver,
|
|
11385
|
+
onMouseLeave: handleMouseLeave,
|
|
11386
|
+
onFocus: handleMouseOver,
|
|
11387
|
+
onBlur: handleMouseLeave,
|
|
11388
|
+
"data-testid": "filterResultListItem"
|
|
11389
|
+
}, /*#__PURE__*/React.createElement(ListItem, {
|
|
11390
|
+
className: classes.listItem
|
|
11391
|
+
}, /*#__PURE__*/React.createElement(ListItemIcon, {
|
|
11392
|
+
className: classes.listItemIcon
|
|
11393
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
11394
|
+
checked: checked,
|
|
11395
|
+
onChange: function onChange() {
|
|
11396
|
+
return toggleCheckbox(index);
|
|
11397
|
+
},
|
|
11398
|
+
className: classes.checkbox
|
|
11399
|
+
})), /*#__PURE__*/React.createElement(Typography, {
|
|
11400
|
+
variant: "body2",
|
|
11401
|
+
className: classes.listItemText
|
|
11402
|
+
}, text), hovering ? /*#__PURE__*/React.createElement(ListItemSecondaryAction, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
11403
|
+
style: {
|
|
11404
|
+
backgroundColor: 'transparent'
|
|
11405
|
+
},
|
|
11406
|
+
edge: "end",
|
|
11407
|
+
size: "small",
|
|
11408
|
+
onClick: function onClick() {
|
|
11409
|
+
return selectOnlyOne(index);
|
|
11410
|
+
}
|
|
11411
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
11412
|
+
className: classes.onlyByttonText
|
|
11413
|
+
}, "ONLY"))) : null));
|
|
11414
|
+
};
|
|
11415
|
+
|
|
11416
|
+
var useStyles$j = makeStyles(function (theme) {
|
|
11417
|
+
return createStyles({
|
|
11418
|
+
selectAll: {
|
|
11419
|
+
padding: '15px',
|
|
11420
|
+
paddingLeft: '20px'
|
|
11421
|
+
},
|
|
11422
|
+
"switch": {
|
|
11423
|
+
padding: '15px'
|
|
11424
|
+
},
|
|
11425
|
+
selectAllContainer: {
|
|
11426
|
+
backgroundColor: theme.palette.background.paper,
|
|
11427
|
+
position: 'sticky',
|
|
11428
|
+
top: 0,
|
|
11429
|
+
zIndex: 100
|
|
11430
|
+
}
|
|
11431
|
+
});
|
|
11432
|
+
});
|
|
11433
|
+
|
|
11434
|
+
var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
11435
|
+
var arrayOfKeywordObjects = _ref.arrayOfKeywordObjects,
|
|
11436
|
+
mapId = _ref.mapId,
|
|
11437
|
+
bounds = _ref.bounds,
|
|
11438
|
+
_ref$onClose = _ref.onClose,
|
|
11439
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
11440
|
+
showTitle = _ref.showTitle,
|
|
11441
|
+
isOpen = _ref.isOpen,
|
|
11442
|
+
_ref$onMouseDown = _ref.onMouseDown,
|
|
11443
|
+
onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
|
|
11444
|
+
_ref$order = _ref.order,
|
|
11445
|
+
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
11446
|
+
_ref$source = _ref.source,
|
|
11447
|
+
source = _ref$source === void 0 ? 'module' : _ref$source;
|
|
10511
11448
|
var classes = useStyles$j();
|
|
10512
11449
|
|
|
10513
|
-
var _React$useState = React.useState(
|
|
11450
|
+
var _React$useState = React.useState(true),
|
|
10514
11451
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10515
|
-
|
|
10516
|
-
|
|
11452
|
+
allSelected = _React$useState2[0],
|
|
11453
|
+
setAllSelected = _React$useState2[1];
|
|
11454
|
+
|
|
11455
|
+
var _React$useState3 = React.useState(arrayOfKeywordObjects),
|
|
11456
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
11457
|
+
keywordObjects = _React$useState4[0],
|
|
11458
|
+
setKeywordObjects = _React$useState4[1];
|
|
11459
|
+
|
|
11460
|
+
var toggleSelectAll = function toggleSelectAll() {
|
|
11461
|
+
var editedKeywords = keywordObjects.map(function (object) {
|
|
11462
|
+
return Object.assign(Object.assign({}, object), {
|
|
11463
|
+
checked: !allSelected
|
|
11464
|
+
});
|
|
11465
|
+
});
|
|
11466
|
+
setKeywordObjects(editedKeywords);
|
|
11467
|
+
setAllSelected(!allSelected);
|
|
11468
|
+
};
|
|
11469
|
+
|
|
11470
|
+
var toggleCheckbox = function toggleCheckbox(listIndex) {
|
|
11471
|
+
var editedKeywords = keywordObjects.map(function (object, index) {
|
|
11472
|
+
return listIndex === index ? Object.assign(Object.assign({}, object), {
|
|
11473
|
+
checked: !object.checked
|
|
11474
|
+
}) : object;
|
|
11475
|
+
});
|
|
11476
|
+
setKeywordObjects(editedKeywords);
|
|
11477
|
+
};
|
|
11478
|
+
|
|
11479
|
+
var selectOnlyOne = function selectOnlyOne(listIndex) {
|
|
11480
|
+
var editedKeywords = keywordObjects.map(function (object, index) {
|
|
11481
|
+
return listIndex === index ? Object.assign(Object.assign({}, object), {
|
|
11482
|
+
checked: true
|
|
11483
|
+
}) : Object.assign(Object.assign({}, object), {
|
|
11484
|
+
checked: false
|
|
11485
|
+
});
|
|
11486
|
+
});
|
|
11487
|
+
setKeywordObjects(editedKeywords);
|
|
11488
|
+
}; // If even one checkbox is unchecked, switch toggleAll off
|
|
11489
|
+
// If all checkboxes becomes checked, switch toggleAll on
|
|
11490
|
+
|
|
11491
|
+
|
|
11492
|
+
React.useEffect(function () {
|
|
11493
|
+
var checked = keywordObjects.every(function (object) {
|
|
11494
|
+
return object.checked === true;
|
|
11495
|
+
});
|
|
11496
|
+
setAllSelected(checked);
|
|
11497
|
+
}, [keywordObjects]);
|
|
11498
|
+
React.useEffect(function () {
|
|
11499
|
+
setKeywordObjects(arrayOfKeywordObjects);
|
|
11500
|
+
}, [arrayOfKeywordObjects]);
|
|
11501
|
+
return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
|
|
11502
|
+
title: showTitle ? "Filter Results ".concat(mapId) : 'Filter Results',
|
|
11503
|
+
"data-testid": "keywordFilterResults",
|
|
11504
|
+
startSize: {
|
|
11505
|
+
width: 349,
|
|
11506
|
+
height: 600
|
|
11507
|
+
},
|
|
11508
|
+
minWidth: 312,
|
|
11509
|
+
minHeight: 192,
|
|
11510
|
+
isOpen: isOpen,
|
|
11511
|
+
onClose: onClose,
|
|
11512
|
+
headerSize: "small",
|
|
11513
|
+
bounds: bounds,
|
|
11514
|
+
onMouseDown: onMouseDown,
|
|
11515
|
+
order: order,
|
|
11516
|
+
source: source
|
|
11517
|
+
}, /*#__PURE__*/React.createElement(Grid, {
|
|
11518
|
+
container: true,
|
|
11519
|
+
item: true,
|
|
11520
|
+
xs: 12,
|
|
11521
|
+
justify: "space-between",
|
|
11522
|
+
alignItems: "center",
|
|
11523
|
+
className: classes.selectAllContainer
|
|
11524
|
+
}, /*#__PURE__*/React.createElement(Grid, {
|
|
11525
|
+
container: true,
|
|
11526
|
+
item: true,
|
|
11527
|
+
xs: 6,
|
|
11528
|
+
justify: "flex-start",
|
|
11529
|
+
alignItems: "center",
|
|
11530
|
+
className: classes.selectAll
|
|
11531
|
+
}, "Select all"), /*#__PURE__*/React.createElement(Grid, {
|
|
11532
|
+
container: true,
|
|
11533
|
+
item: true,
|
|
11534
|
+
xs: 6,
|
|
11535
|
+
justify: "flex-end",
|
|
11536
|
+
alignContent: "center",
|
|
11537
|
+
className: classes["switch"]
|
|
11538
|
+
}, /*#__PURE__*/React.createElement(CustomSwitch, {
|
|
11539
|
+
checked: allSelected,
|
|
11540
|
+
onChange: toggleSelectAll
|
|
11541
|
+
}))), /*#__PURE__*/React.createElement(List, {
|
|
11542
|
+
dense: true,
|
|
11543
|
+
style: {
|
|
11544
|
+
padding: '0px'
|
|
11545
|
+
}
|
|
11546
|
+
}, keywordObjects.map(function (_ref2, index) {
|
|
11547
|
+
var id = _ref2.id,
|
|
11548
|
+
checked = _ref2.checked;
|
|
11549
|
+
return /*#__PURE__*/React.createElement(FilterListItem, {
|
|
11550
|
+
key: "".concat(id, "-").concat(index),
|
|
11551
|
+
index: index,
|
|
11552
|
+
text: id,
|
|
11553
|
+
checked: checked,
|
|
11554
|
+
toggleCheckbox: toggleCheckbox,
|
|
11555
|
+
selectOnlyOne: selectOnlyOne
|
|
11556
|
+
});
|
|
11557
|
+
})));
|
|
11558
|
+
};
|
|
11559
|
+
|
|
11560
|
+
/* *
|
|
11561
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11562
|
+
* you may not use this file except in compliance with the License.
|
|
11563
|
+
* You may obtain a copy of the License at
|
|
11564
|
+
*
|
|
11565
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11566
|
+
*
|
|
11567
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11568
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11569
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11570
|
+
* See the License for the specific language governing permissions and
|
|
11571
|
+
* limitations under the License.
|
|
11572
|
+
*
|
|
11573
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11574
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11575
|
+
* */
|
|
11576
|
+
|
|
11577
|
+
var KeywordFilterResultsConnect = function KeywordFilterResultsConnect(_ref) {
|
|
11578
|
+
var bounds = _ref.bounds,
|
|
11579
|
+
_ref$showTitle = _ref.showTitle,
|
|
11580
|
+
showTitle = _ref$showTitle === void 0 ? false : _ref$showTitle;
|
|
11581
|
+
var dispatch = useDispatch();
|
|
11582
|
+
var mapId = useSelector(function (store) {
|
|
11583
|
+
return getDialogMapId(store, 'keywordFilter');
|
|
11584
|
+
});
|
|
11585
|
+
var isOpenInStore = useSelector(function (store) {
|
|
11586
|
+
return getisDialogOpen(store, 'keywordFilter');
|
|
11587
|
+
});
|
|
11588
|
+
var onClose = React.useCallback(function () {
|
|
11589
|
+
return dispatch(setToggleOpenDialog({
|
|
11590
|
+
type: 'keywordFilter',
|
|
11591
|
+
setOpen: false
|
|
11592
|
+
}));
|
|
11593
|
+
}, [dispatch]);
|
|
11594
|
+
var isMapPresent = useSelector(function (store) {
|
|
11595
|
+
return getIsMapPresent(store, mapId);
|
|
11596
|
+
});
|
|
11597
|
+
var uiOrder = useSelector(function (store) {
|
|
11598
|
+
return getDialogOrder(store, 'keywordFilter');
|
|
11599
|
+
});
|
|
11600
|
+
var uiSource = useSelector(function (store) {
|
|
11601
|
+
return getDialogSource(store, 'keywordFilter');
|
|
11602
|
+
});
|
|
11603
|
+
var uiIsOrderedOnTop = useSelector(function (store) {
|
|
11604
|
+
return getDialogIsOrderedOnTop(store, 'keywordFilter');
|
|
11605
|
+
}); // Check to ensure the currently active map is still present on screen - if not, close the dialog
|
|
10517
11606
|
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
11607
|
+
React.useEffect(function () {
|
|
11608
|
+
if (mapId !== '' && !isMapPresent) {
|
|
11609
|
+
onClose();
|
|
11610
|
+
}
|
|
11611
|
+
}, [mapId, isMapPresent, onClose]);
|
|
11612
|
+
var registerDialog$1 = React.useCallback(function () {
|
|
11613
|
+
return dispatch(registerDialog({
|
|
11614
|
+
type: 'keywordFilter',
|
|
11615
|
+
setOpen: false
|
|
11616
|
+
}));
|
|
11617
|
+
}, [dispatch]);
|
|
11618
|
+
var unregisterDialog$1 = React.useCallback(function () {
|
|
11619
|
+
return dispatch(unregisterDialog({
|
|
11620
|
+
type: 'keywordFilter'
|
|
11621
|
+
}));
|
|
11622
|
+
}, [dispatch]);
|
|
11623
|
+
var onOrderDialog = React.useCallback(function () {
|
|
11624
|
+
if (!uiIsOrderedOnTop) {
|
|
11625
|
+
dispatch(orderDialog({
|
|
11626
|
+
type: 'keywordFilter'
|
|
11627
|
+
}));
|
|
11628
|
+
}
|
|
11629
|
+
}, [dispatch, uiIsOrderedOnTop]); // Register this dialog in the store
|
|
10522
11630
|
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
isOpen: isOpen,
|
|
10536
|
-
onChangeSize: onChangeSize,
|
|
10537
|
-
onClose: onClose,
|
|
10538
|
-
headerSize: "small",
|
|
11631
|
+
React.useEffect(function () {
|
|
11632
|
+
registerDialog$1();
|
|
11633
|
+
return function () {
|
|
11634
|
+
unregisterDialog$1();
|
|
11635
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11636
|
+
}, []);
|
|
11637
|
+
var keywords = useSelector(function (store) {
|
|
11638
|
+
return getKeywords(store);
|
|
11639
|
+
});
|
|
11640
|
+
return /*#__PURE__*/React.createElement(KeywordFilterResults, {
|
|
11641
|
+
arrayOfKeywordObjects: keywords,
|
|
11642
|
+
mapId: mapId,
|
|
10539
11643
|
bounds: bounds,
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
}
|
|
10548
|
-
}, /*#__PURE__*/React.createElement(SearchField, null), /*#__PURE__*/React.createElement("div", {
|
|
10549
|
-
className: classes.serviceList
|
|
10550
|
-
}, /*#__PURE__*/React.createElement(ServiceListConnect, {
|
|
10551
|
-
layerSelectWidth: width
|
|
10552
|
-
}))));
|
|
11644
|
+
isOpen: isOpenInStore,
|
|
11645
|
+
onClose: onClose,
|
|
11646
|
+
showTitle: showTitle,
|
|
11647
|
+
onMouseDown: onOrderDialog,
|
|
11648
|
+
order: uiOrder,
|
|
11649
|
+
source: uiSource
|
|
11650
|
+
});
|
|
10553
11651
|
};
|
|
10554
11652
|
|
|
10555
11653
|
/* *
|
|
@@ -10664,7 +11762,7 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
|
|
|
10664
11762
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10665
11763
|
|
|
10666
11764
|
}, [isOpenInStore, preloadedServices, serviceSetLayers$1]);
|
|
10667
|
-
return /*#__PURE__*/React.createElement(LayerSelect, {
|
|
11765
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LayerSelect, {
|
|
10668
11766
|
mapId: mapId,
|
|
10669
11767
|
bounds: bounds,
|
|
10670
11768
|
isOpen: isOpenInStore,
|
|
@@ -10673,7 +11771,7 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
|
|
|
10673
11771
|
onMouseDown: onOrderDialog,
|
|
10674
11772
|
order: uiOrder,
|
|
10675
11773
|
source: uiSource
|
|
10676
|
-
});
|
|
11774
|
+
}), /*#__PURE__*/React.createElement(KeywordFilterResultsConnect, null));
|
|
10677
11775
|
};
|
|
10678
11776
|
|
|
10679
11777
|
/* *
|
|
@@ -10785,79 +11883,6 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
|
|
|
10785
11883
|
}), layerSelect && /*#__PURE__*/React.createElement(LayerSelectConnect, null));
|
|
10786
11884
|
};
|
|
10787
11885
|
|
|
10788
|
-
/* *
|
|
10789
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10790
|
-
* you may not use this file except in compliance with the License.
|
|
10791
|
-
* You may obtain a copy of the License at
|
|
10792
|
-
*
|
|
10793
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10794
|
-
*
|
|
10795
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
10796
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10797
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10798
|
-
* See the License for the specific language governing permissions and
|
|
10799
|
-
* limitations under the License.
|
|
10800
|
-
*
|
|
10801
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10802
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10803
|
-
* */
|
|
10804
|
-
var useButtonStyles = makeStyles(function (theme) {
|
|
10805
|
-
return createStyles({
|
|
10806
|
-
button: {
|
|
10807
|
-
height: '24px',
|
|
10808
|
-
width: function width(_ref) {
|
|
10809
|
-
var _width = _ref.width;
|
|
10810
|
-
return _width ? "".concat(_width, "px") : '24px';
|
|
10811
|
-
},
|
|
10812
|
-
border: 0,
|
|
10813
|
-
backgroundColor: theme.palette.geowebColors.buttons.surfaceIconDefault.fill,
|
|
10814
|
-
borderRadius: '4.5px',
|
|
10815
|
-
textTransform: 'none',
|
|
10816
|
-
'& svg path, svg text': {
|
|
10817
|
-
fill: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10818
|
-
},
|
|
10819
|
-
'&:hover': {
|
|
10820
|
-
backgroundColor: theme.palette.geowebColors.buttons.flatMouseover.fill
|
|
10821
|
-
},
|
|
10822
|
-
'&:disabled': {
|
|
10823
|
-
backgroundColor: theme.palette.geowebColors.buttons.disabled.fill,
|
|
10824
|
-
'& svg path, svg text': {
|
|
10825
|
-
fill: theme.palette.geowebColors.typographyAndIcons.iconLinkDisabled
|
|
10826
|
-
}
|
|
10827
|
-
},
|
|
10828
|
-
'&.Mui-selected': {
|
|
10829
|
-
backgroundColor: theme.palette.geowebColors.buttons.primaryActive.fill,
|
|
10830
|
-
'&:hover': {
|
|
10831
|
-
backgroundColor: theme.palette.geowebColors.buttons.primaryMouseover.fill
|
|
10832
|
-
},
|
|
10833
|
-
'& svg': {
|
|
10834
|
-
backgroundColor: 'transparent'
|
|
10835
|
-
},
|
|
10836
|
-
'& svg path, svg text': {
|
|
10837
|
-
fill: theme.palette.geowebColors.typographyAndIcons.buttonIcon
|
|
10838
|
-
}
|
|
10839
|
-
}
|
|
10840
|
-
}
|
|
10841
|
-
});
|
|
10842
|
-
});
|
|
10843
|
-
|
|
10844
|
-
var ToggleIconButton = function ToggleIconButton(_a) {
|
|
10845
|
-
var active = _a.active,
|
|
10846
|
-
width = _a.width,
|
|
10847
|
-
children = _a.children,
|
|
10848
|
-
props = __rest(_a, ["active", "width", "children"]);
|
|
10849
|
-
|
|
10850
|
-
var classes = useButtonStyles({
|
|
10851
|
-
width: width
|
|
10852
|
-
});
|
|
10853
|
-
return /*#__PURE__*/React.createElement(ToggleButton, Object.assign({
|
|
10854
|
-
className: classes.button,
|
|
10855
|
-
disableRipple: true,
|
|
10856
|
-
selected: active,
|
|
10857
|
-
value: 0
|
|
10858
|
-
}, props), children);
|
|
10859
|
-
};
|
|
10860
|
-
|
|
10861
11886
|
/* *
|
|
10862
11887
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10863
11888
|
* you may not use this file except in compliance with the License.
|
|
@@ -11467,7 +12492,9 @@ var DimensionSelectDialogConnect = function DimensionSelectDialogConnect(_ref) {
|
|
|
11467
12492
|
onMouseDown = _ref.onMouseDown,
|
|
11468
12493
|
onToggleDialog = _ref.onToggleDialog,
|
|
11469
12494
|
_ref$index = _ref.index,
|
|
11470
|
-
index = _ref$index === void 0 ? 0 : _ref$index
|
|
12495
|
+
index = _ref$index === void 0 ? 0 : _ref$index,
|
|
12496
|
+
_ref$source = _ref.source,
|
|
12497
|
+
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
11471
12498
|
var dispatch = useDispatch();
|
|
11472
12499
|
var mapDimension = useSelector(function (store) {
|
|
11473
12500
|
return getMapDimension(store, mapId, dimensionName);
|
|
@@ -11522,7 +12549,8 @@ var DimensionSelectDialogConnect = function DimensionSelectDialogConnect(_ref) {
|
|
|
11522
12549
|
},
|
|
11523
12550
|
bounds: "parent",
|
|
11524
12551
|
onMouseDown: onMouseDown,
|
|
11525
|
-
order: order
|
|
12552
|
+
order: order,
|
|
12553
|
+
source: source
|
|
11526
12554
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11527
12555
|
style: {
|
|
11528
12556
|
padding: 4
|
|
@@ -11573,6 +12601,9 @@ var MultiMapSingleDimensionSelectConnect = function MultiMapSingleDimensionSelec
|
|
|
11573
12601
|
var uiOrder = useSelector(function (store) {
|
|
11574
12602
|
return getDialogOrder(store, uiDialogType);
|
|
11575
12603
|
});
|
|
12604
|
+
var uiSource = useSelector(function (store) {
|
|
12605
|
+
return getDialogSource(store, uiDialogType);
|
|
12606
|
+
});
|
|
11576
12607
|
var uiIsOrderedOnTop = useSelector(function (store) {
|
|
11577
12608
|
return getDialogIsOrderedOnTop(store, uiDialogType);
|
|
11578
12609
|
});
|
|
@@ -11625,6 +12656,7 @@ var MultiMapSingleDimensionSelectConnect = function MultiMapSingleDimensionSelec
|
|
|
11625
12656
|
onMouseDown: onOrderDialog,
|
|
11626
12657
|
onToggleDialog: onToggleDialog,
|
|
11627
12658
|
order: uiOrder,
|
|
12659
|
+
source: uiSource,
|
|
11628
12660
|
isOpen: isOpen,
|
|
11629
12661
|
index: index
|
|
11630
12662
|
});
|
|
@@ -11649,7 +12681,9 @@ var MultiMapSingleDimensionSelectConnect = function MultiMapSingleDimensionSelec
|
|
|
11649
12681
|
|
|
11650
12682
|
var DimensionSelectMapButtonConnect = function DimensionSelectMapButtonConnect(_ref) {
|
|
11651
12683
|
var mapId = _ref.mapId,
|
|
11652
|
-
dimension = _ref.dimension
|
|
12684
|
+
dimension = _ref.dimension,
|
|
12685
|
+
_ref$source = _ref.source,
|
|
12686
|
+
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
11653
12687
|
var dispatch = useDispatch();
|
|
11654
12688
|
var uiDialogType = getDimensionType(dimension);
|
|
11655
12689
|
var currentActiveMapId = useSelector(function (store) {
|
|
@@ -11663,9 +12697,10 @@ var DimensionSelectMapButtonConnect = function DimensionSelectMapButtonConnect(_
|
|
|
11663
12697
|
dispatch(setActiveMapIdForDialog({
|
|
11664
12698
|
type: uiDialogType,
|
|
11665
12699
|
activeMapId: mapId,
|
|
11666
|
-
setOpen: setOpen
|
|
12700
|
+
setOpen: setOpen,
|
|
12701
|
+
source: source
|
|
11667
12702
|
}));
|
|
11668
|
-
}, [currentActiveMapId, dispatch, isOpenInStore, uiDialogType, mapId]);
|
|
12703
|
+
}, [currentActiveMapId, dispatch, isOpenInStore, uiDialogType, mapId, source]);
|
|
11669
12704
|
var isOpen = currentActiveMapId === mapId && isOpenInStore;
|
|
11670
12705
|
return /*#__PURE__*/React.createElement(DimensionSelectButton, {
|
|
11671
12706
|
dimension: dimension,
|
|
@@ -11692,7 +12727,9 @@ var DimensionSelectMapButtonConnect = function DimensionSelectMapButtonConnect(_
|
|
|
11692
12727
|
* */
|
|
11693
12728
|
|
|
11694
12729
|
var MultiDimensionSelectMapButtonsConnect = function MultiDimensionSelectMapButtonsConnect(_ref) {
|
|
11695
|
-
var mapId = _ref.mapId
|
|
12730
|
+
var mapId = _ref.mapId,
|
|
12731
|
+
_ref$source = _ref.source,
|
|
12732
|
+
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
11696
12733
|
var dimensions = useSelector(function (store) {
|
|
11697
12734
|
return getMapDimensions(store, mapId);
|
|
11698
12735
|
});
|
|
@@ -11708,7 +12745,8 @@ var MultiDimensionSelectMapButtonsConnect = function MultiDimensionSelectMapButt
|
|
|
11708
12745
|
return /*#__PURE__*/React.createElement(DimensionSelectMapButtonConnect, {
|
|
11709
12746
|
mapId: mapId,
|
|
11710
12747
|
dimension: dimension.name,
|
|
11711
|
-
key: dimension.name
|
|
12748
|
+
key: dimension.name,
|
|
12749
|
+
source: source
|
|
11712
12750
|
});
|
|
11713
12751
|
}));
|
|
11714
12752
|
};
|
|
@@ -13735,41 +14773,41 @@ var thumbComponent = function thumbComponent(props) {
|
|
|
13735
14773
|
};
|
|
13736
14774
|
|
|
13737
14775
|
var marks = [{
|
|
13738
|
-
value: 0.1,
|
|
13739
14776
|
text: '5 min scale',
|
|
13740
|
-
paddingLeft: '2px'
|
|
14777
|
+
paddingLeft: '2px',
|
|
14778
|
+
value: Scale.Minutes5
|
|
13741
14779
|
}, {
|
|
13742
|
-
value: 0.35,
|
|
13743
14780
|
text: '1 h scale',
|
|
13744
|
-
paddingLeft: '25px'
|
|
14781
|
+
paddingLeft: '25px',
|
|
14782
|
+
value: Scale.Hour
|
|
13745
14783
|
}, {
|
|
13746
|
-
value: 0.6,
|
|
13747
14784
|
text: '3 h scale',
|
|
13748
|
-
paddingLeft: '45px'
|
|
14785
|
+
paddingLeft: '45px',
|
|
14786
|
+
value: Scale.Hours3
|
|
13749
14787
|
}, {
|
|
13750
|
-
value: 0.85,
|
|
13751
14788
|
text: '6 h scale',
|
|
13752
|
-
paddingLeft: '65px'
|
|
14789
|
+
paddingLeft: '65px',
|
|
14790
|
+
value: Scale.Hours6
|
|
13753
14791
|
}, {
|
|
13754
|
-
value: 1.1,
|
|
13755
14792
|
text: 'day scale',
|
|
13756
|
-
paddingLeft: '80px'
|
|
14793
|
+
paddingLeft: '80px',
|
|
14794
|
+
value: Scale.Day
|
|
13757
14795
|
}, {
|
|
13758
|
-
value: 1.35,
|
|
13759
14796
|
text: 'week scale',
|
|
13760
|
-
paddingLeft: '92px'
|
|
14797
|
+
paddingLeft: '92px',
|
|
14798
|
+
value: Scale.Week
|
|
13761
14799
|
}, {
|
|
13762
|
-
value: 1.6,
|
|
13763
14800
|
text: 'month scale',
|
|
13764
|
-
paddingLeft: '107px'
|
|
14801
|
+
paddingLeft: '107px',
|
|
14802
|
+
value: Scale.Month
|
|
13765
14803
|
}, {
|
|
13766
|
-
value: 1.85,
|
|
13767
14804
|
text: 'year scale',
|
|
13768
|
-
paddingLeft: '130px'
|
|
14805
|
+
paddingLeft: '130px',
|
|
14806
|
+
value: Scale.Year
|
|
13769
14807
|
}, {
|
|
13770
|
-
value: 2.1,
|
|
13771
14808
|
text: 'data scale',
|
|
13772
|
-
paddingLeft: '140px'
|
|
14809
|
+
paddingLeft: '140px',
|
|
14810
|
+
value: Scale.DataScale
|
|
13773
14811
|
}];
|
|
13774
14812
|
|
|
13775
14813
|
var valueLabelFormat = function valueLabelFormat(value) {
|
|
@@ -13832,77 +14870,59 @@ var GeoWebScaleSlider = withStyles(function (theme) {
|
|
|
13832
14870
|
}
|
|
13833
14871
|
};
|
|
13834
14872
|
})(Slider);
|
|
13835
|
-
|
|
13836
|
-
var getScaleSliderValue = function getScaleSliderValue(value) {
|
|
13837
|
-
if (Math.abs(value - marks[0].value) < 0.0001) {
|
|
13838
|
-
return Scale.Minutes5;
|
|
13839
|
-
}
|
|
13840
|
-
|
|
13841
|
-
if (Math.abs(value - marks[1].value) < 0.0001) {
|
|
13842
|
-
return Scale.Hour;
|
|
13843
|
-
}
|
|
13844
|
-
|
|
13845
|
-
if (Math.abs(value - marks[2].value) < 0.0001) {
|
|
13846
|
-
return Scale.Hours3;
|
|
13847
|
-
}
|
|
13848
|
-
|
|
13849
|
-
if (Math.abs(value - marks[3].value) < 0.0001) {
|
|
13850
|
-
return Scale.Hours6;
|
|
13851
|
-
}
|
|
13852
|
-
|
|
13853
|
-
if (Math.abs(value - marks[4].value) < 0.0001) {
|
|
13854
|
-
return Scale.Day;
|
|
13855
|
-
}
|
|
13856
|
-
|
|
13857
|
-
if (Math.abs(value - marks[5].value) < 0.0001) {
|
|
13858
|
-
return Scale.Week;
|
|
13859
|
-
}
|
|
13860
|
-
|
|
13861
|
-
if (Math.abs(value - marks[6].value) < 0.0001) {
|
|
13862
|
-
return Scale.Month;
|
|
13863
|
-
}
|
|
13864
|
-
|
|
13865
|
-
if (Math.abs(value - marks[7].value) < 0.0001) {
|
|
13866
|
-
return Scale.Year;
|
|
13867
|
-
}
|
|
13868
|
-
|
|
13869
|
-
if (Math.abs(value - marks[8].value) < 0.0001) {
|
|
13870
|
-
return Scale.DataScale;
|
|
13871
|
-
}
|
|
13872
|
-
|
|
13873
|
-
return Scale.Hour;
|
|
13874
|
-
};
|
|
13875
|
-
|
|
13876
|
-
var scaleValues = Object.keys(Scale).map(function (scale) {
|
|
13877
|
-
return Number(scale);
|
|
13878
|
-
});
|
|
14873
|
+
var RAIL_GUTTER_OFFSET = 0.4;
|
|
13879
14874
|
|
|
13880
14875
|
var TimeSliderScaleSlider = function TimeSliderScaleSlider(_ref) {
|
|
13881
14876
|
var layers = _ref.layers,
|
|
13882
|
-
timeSliderScale = _ref.timeSliderScale,
|
|
14877
|
+
_ref$timeSliderScale = _ref.timeSliderScale,
|
|
14878
|
+
timeSliderScale = _ref$timeSliderScale === void 0 ? Scale.Hour : _ref$timeSliderScale,
|
|
13883
14879
|
centerTime = _ref.centerTime,
|
|
13884
14880
|
secondsPerPx = _ref.secondsPerPx,
|
|
13885
14881
|
selectedTime = _ref.selectedTime,
|
|
13886
14882
|
onChangeTimeSliderScale = _ref.onChangeTimeSliderScale;
|
|
13887
14883
|
var classes = useStyles$c();
|
|
13888
|
-
var
|
|
13889
|
-
var
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
};
|
|
13893
|
-
var newScaleObjectIndex = scaleObjectIndex !== -1 ? scaleObjectIndex : 1;
|
|
13894
|
-
var value = newScaleObject.value,
|
|
13895
|
-
text = newScaleObject.text;
|
|
14884
|
+
var min = 0;
|
|
14885
|
+
var max = marks.length - 1;
|
|
14886
|
+
var value = marks.findIndex(function (mark) {
|
|
14887
|
+
return mark.value === timeSliderScale;
|
|
14888
|
+
});
|
|
13896
14889
|
|
|
13897
|
-
var
|
|
13898
|
-
var
|
|
13899
|
-
var
|
|
14890
|
+
var onChangeSliderValue = function onChangeSliderValue(newSliderValue) {
|
|
14891
|
+
var newValue = newSliderValue ? Math.round(newSliderValue) : 0;
|
|
14892
|
+
var newScale = marks.find(function (el) {
|
|
14893
|
+
return el.value === newValue;
|
|
14894
|
+
}).value;
|
|
14895
|
+
var scaleToSecPerPx = newScale === Scale.DataScale ? getScaleToSecondsPerPxForDataScale(layers) : scaleToSecondsPerPx[newScale];
|
|
13900
14896
|
var newCenterTime = getNewCenterOfFixedPointZoom(selectedTime, secondsPerPx, scaleToSecPerPx, centerTime);
|
|
13901
14897
|
onChangeTimeSliderScale(newScale, newCenterTime, scaleToSecPerPx);
|
|
13902
14898
|
};
|
|
13903
14899
|
|
|
14900
|
+
var onChange = function onChange(event, value) {
|
|
14901
|
+
if (event.type !== 'keydown') {
|
|
14902
|
+
onChangeSliderValue(value);
|
|
14903
|
+
}
|
|
14904
|
+
};
|
|
14905
|
+
|
|
14906
|
+
var onKeyDown = function onKeyDown(event) {
|
|
14907
|
+
// disable default Slider behavior
|
|
14908
|
+
event.preventDefault();
|
|
14909
|
+
event.stopPropagation(); // custom logic
|
|
14910
|
+
|
|
14911
|
+
var newValue = getValueFromKeyboardEvent(event, value, min, max, true);
|
|
14912
|
+
|
|
14913
|
+
if (newValue !== null) {
|
|
14914
|
+
onChangeSliderValue(newValue);
|
|
14915
|
+
}
|
|
14916
|
+
};
|
|
14917
|
+
|
|
14918
|
+
var _marks$find = marks.find(function (mark) {
|
|
14919
|
+
return mark.value === value;
|
|
14920
|
+
}),
|
|
14921
|
+
paddingLeft = _marks$find.paddingLeft,
|
|
14922
|
+
text = _marks$find.text;
|
|
14923
|
+
|
|
13904
14924
|
var scaleTextPadding = {
|
|
13905
|
-
paddingLeft:
|
|
14925
|
+
paddingLeft: paddingLeft
|
|
13906
14926
|
};
|
|
13907
14927
|
return /*#__PURE__*/React.createElement("div", {
|
|
13908
14928
|
className: classes.Background,
|
|
@@ -13913,14 +14933,14 @@ var TimeSliderScaleSlider = function TimeSliderScaleSlider(_ref) {
|
|
|
13913
14933
|
style: scaleTextPadding
|
|
13914
14934
|
}, text)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(GeoWebScaleSlider, {
|
|
13915
14935
|
"data-testid": "scaleSliderSlider",
|
|
13916
|
-
defaultValue:
|
|
14936
|
+
defaultValue: Scale.Hour,
|
|
13917
14937
|
value: value,
|
|
13918
|
-
min:
|
|
13919
|
-
step:
|
|
13920
|
-
max:
|
|
14938
|
+
min: min - RAIL_GUTTER_OFFSET,
|
|
14939
|
+
step: 1,
|
|
14940
|
+
max: max + RAIL_GUTTER_OFFSET,
|
|
13921
14941
|
getAriaValueText: valueLabelFormat,
|
|
13922
|
-
onChange:
|
|
13923
|
-
|
|
14942
|
+
onChange: onChange,
|
|
14943
|
+
onKeyDown: onKeyDown,
|
|
13924
14944
|
"aria-labelledby": "scale-slider",
|
|
13925
14945
|
ThumbComponent: thumbComponent,
|
|
13926
14946
|
marks: marks,
|
|
@@ -14495,7 +15515,7 @@ var TimeSlider = function TimeSlider(_ref) {
|
|
|
14495
15515
|
className: styles.scaleSlider
|
|
14496
15516
|
}, scaleSlider || /*#__PURE__*/React.createElement(TimeSliderScaleSlider, Object.assign({}, defaultProps, {
|
|
14497
15517
|
selectedTime: defaultProps.selectedTime.unix(),
|
|
14498
|
-
timeSliderScale:
|
|
15518
|
+
timeSliderScale: Scale.Hour,
|
|
14499
15519
|
onChangeTimeSliderScale: function onChangeTimeSliderScale() {
|
|
14500
15520
|
return null;
|
|
14501
15521
|
}
|
|
@@ -17965,7 +18985,6 @@ var getDisplayText = function getDisplayText(currentAdagucTime) {
|
|
|
17965
18985
|
};
|
|
17966
18986
|
|
|
17967
18987
|
var ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION = 'ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION';
|
|
17968
|
-
var defaultxml2jsonrequestURL = 'http://localhost:10000/XML2JSON?';
|
|
17969
18988
|
|
|
17970
18989
|
var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
17971
18990
|
_inherits(ReactMapView, _React$Component);
|
|
@@ -18032,17 +19051,15 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
18032
19051
|
onLayerSetDimensions = _this$props.onLayerSetDimensions,
|
|
18033
19052
|
onServiceSetLayers = _this$props.onServiceSetLayers,
|
|
18034
19053
|
onLayerSetStyles = _this$props.onLayerSetStyles,
|
|
18035
|
-
_xml2jsonrequestURL = _this$props.xml2jsonrequestURL,
|
|
18036
19054
|
mapId = _this$props.mapId;
|
|
18037
|
-
setServiceMetadata(wmLayer, mapId,
|
|
19055
|
+
setServiceMetadata(wmLayer, mapId, _this.adaguc.webMapJS, _this.props, onMapUpdateAllDimensions, onLayerChangeStyle, onServiceSetLayers, onLayerSetStyles, onLayerSetDimensions);
|
|
18038
19056
|
}
|
|
18039
19057
|
|
|
18040
19058
|
if (updateStrategy === 'onlydims') {
|
|
18041
19059
|
var _this$props2 = _this.props,
|
|
18042
19060
|
_onLayerSetDimensions = _this$props2.onLayerSetDimensions,
|
|
18043
|
-
_xml2jsonrequestURL2 = _this$props2.xml2jsonrequestURL,
|
|
18044
19061
|
_mapId = _this$props2.mapId;
|
|
18045
|
-
setServiceMetadata(wmLayer, _mapId,
|
|
19062
|
+
setServiceMetadata(wmLayer, _mapId, _this.adaguc.webMapJS, _this.props, null, null, null, null, _onLayerSetDimensions);
|
|
18046
19063
|
}
|
|
18047
19064
|
|
|
18048
19065
|
if (child) {
|
|
@@ -18056,8 +19073,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
18056
19073
|
}
|
|
18057
19074
|
};
|
|
18058
19075
|
|
|
18059
|
-
|
|
18060
|
-
wmLayer.parseLayer(callback, forceReload, xml2jsonrequestURL);
|
|
19076
|
+
wmLayer.parseLayer(callback, forceReload);
|
|
18061
19077
|
};
|
|
18062
19078
|
|
|
18063
19079
|
_this.state = {
|
|
@@ -18065,7 +19081,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
18065
19081
|
};
|
|
18066
19082
|
_this.resize = _this.resize.bind(_assertThisInitialized(_this));
|
|
18067
19083
|
_this.handleWindowResize = _this.handleWindowResize.bind(_assertThisInitialized(_this));
|
|
18068
|
-
_this.drawDebounced = debounce(600, _this.drawDebounced);
|
|
19084
|
+
_this.drawDebounced = debounce$1(600, _this.drawDebounced);
|
|
18069
19085
|
_this.checkNewProps = _this.checkNewProps.bind(_assertThisInitialized(_this));
|
|
18070
19086
|
_this.checkAdaguc = _this.checkAdaguc.bind(_assertThisInitialized(_this));
|
|
18071
19087
|
_this.onAfterSetBBoxListener = _this.onAfterSetBBoxListener.bind(_assertThisInitialized(_this));
|
|
@@ -18478,8 +19494,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
18478
19494
|
}
|
|
18479
19495
|
|
|
18480
19496
|
if (!isBaselayer) {
|
|
18481
|
-
newWMLayer.reactWebMapJSLayer = child;
|
|
18482
|
-
|
|
18483
19497
|
_this3.parseWMJSLayer(newWMLayer, false, 'all', child);
|
|
18484
19498
|
}
|
|
18485
19499
|
|
|
@@ -18595,7 +19609,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
18595
19609
|
var _this$props7 = this.props,
|
|
18596
19610
|
mapId = _this$props7.mapId,
|
|
18597
19611
|
listeners = _this$props7.listeners,
|
|
18598
|
-
xml2jsonrequestURL = _this$props7.xml2jsonrequestURL,
|
|
18599
19612
|
srs = _this$props7.srs,
|
|
18600
19613
|
bbox = _this$props7.bbox,
|
|
18601
19614
|
onMapPinChangeLocation = _this$props7.onMapPinChangeLocation;
|
|
@@ -18611,7 +19624,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
18611
19624
|
|
|
18612
19625
|
registerWMJSMap(this.adaguc.webMapJS, mapId);
|
|
18613
19626
|
this.adaguc.webMapJS.removeAllLayers();
|
|
18614
|
-
this.adaguc.webMapJS.setXML2JSONURL(xml2jsonrequestURL);
|
|
18615
19627
|
this.adaguc.webMapJS.setProjection(srs, new WMBBOX(bbox));
|
|
18616
19628
|
this.adaguc.webMapJS.setWMTileRendererTileSettings(tileRenderSettings);
|
|
18617
19629
|
|
|
@@ -18744,7 +19756,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
18744
19756
|
}(React.Component);
|
|
18745
19757
|
|
|
18746
19758
|
ReactMapView.defaultProps = {
|
|
18747
|
-
xml2jsonrequestURL: defaultxml2jsonrequestURL,
|
|
18748
19759
|
srs: 'EPSG:3857',
|
|
18749
19760
|
bbox: {
|
|
18750
19761
|
left: -2324980.5498391856,
|
|
@@ -19046,7 +20057,7 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
19046
20057
|
},
|
|
19047
20058
|
srs: srs,
|
|
19048
20059
|
bbox: bbox,
|
|
19049
|
-
mapPinLocation: displayMapPin &&
|
|
20060
|
+
mapPinLocation: displayMapPin && mapPinLocation,
|
|
19050
20061
|
dimensions: mapDimensions,
|
|
19051
20062
|
activeLayerId: activeLayerId,
|
|
19052
20063
|
animationDelay: animationDelay,
|
|
@@ -19377,7 +20388,9 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
19377
20388
|
_ref$showMapId = _ref.showMapId,
|
|
19378
20389
|
showMapId = _ref$showMapId === void 0 ? false : _ref$showMapId,
|
|
19379
20390
|
_ref$order = _ref.order,
|
|
19380
|
-
order = _ref$order === void 0 ? 0 : _ref$order
|
|
20391
|
+
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
20392
|
+
_ref$source = _ref.source,
|
|
20393
|
+
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
19381
20394
|
var classes = useStyles$5();
|
|
19382
20395
|
return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
|
|
19383
20396
|
startPosition: {
|
|
@@ -19393,7 +20406,8 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
19393
20406
|
"data-testid": "moveable-legend",
|
|
19394
20407
|
bounds: "parent",
|
|
19395
20408
|
onMouseDown: onMouseDown,
|
|
19396
|
-
order: order
|
|
20409
|
+
order: order,
|
|
20410
|
+
source: source
|
|
19397
20411
|
}, /*#__PURE__*/React.createElement("div", {
|
|
19398
20412
|
className: classes.legendContainer
|
|
19399
20413
|
}, layers && layers.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -19433,7 +20447,9 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
19433
20447
|
|
|
19434
20448
|
var LegendConnectComponent = function LegendConnectComponent(_ref) {
|
|
19435
20449
|
var _ref$showMapId = _ref.showMapId,
|
|
19436
|
-
showMapId = _ref$showMapId === void 0 ? false : _ref$showMapId
|
|
20450
|
+
showMapId = _ref$showMapId === void 0 ? false : _ref$showMapId,
|
|
20451
|
+
_ref$source = _ref.source,
|
|
20452
|
+
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
19437
20453
|
var dispatch = useDispatch();
|
|
19438
20454
|
var initialActiveMapId = useSelector(function (store) {
|
|
19439
20455
|
return getFirstMapId(store);
|
|
@@ -19451,6 +20467,9 @@ var LegendConnectComponent = function LegendConnectComponent(_ref) {
|
|
|
19451
20467
|
var uiOrder = useSelector(function (store) {
|
|
19452
20468
|
return getDialogOrder(store, 'legend');
|
|
19453
20469
|
});
|
|
20470
|
+
var uiSource = useSelector(function (store) {
|
|
20471
|
+
return getDialogSource(store, 'legend');
|
|
20472
|
+
});
|
|
19454
20473
|
var uiIsOrderedOnTop = useSelector(function (store) {
|
|
19455
20474
|
return getDialogIsOrderedOnTop(store, 'legend');
|
|
19456
20475
|
});
|
|
@@ -19465,9 +20484,10 @@ var LegendConnectComponent = function LegendConnectComponent(_ref) {
|
|
|
19465
20484
|
var registerDialog$1 = React.useCallback(function (setOpen) {
|
|
19466
20485
|
return dispatch(registerDialog({
|
|
19467
20486
|
type: 'legend',
|
|
19468
|
-
setOpen: setOpen
|
|
20487
|
+
setOpen: setOpen,
|
|
20488
|
+
source: source
|
|
19469
20489
|
}));
|
|
19470
|
-
}, [dispatch]);
|
|
20490
|
+
}, [dispatch, source]);
|
|
19471
20491
|
var unregisterDialog$1 = React.useCallback(function () {
|
|
19472
20492
|
return dispatch(unregisterDialog({
|
|
19473
20493
|
type: 'legend'
|
|
@@ -19494,7 +20514,8 @@ var LegendConnectComponent = function LegendConnectComponent(_ref) {
|
|
|
19494
20514
|
mapId: mapId,
|
|
19495
20515
|
showMapId: showMapId,
|
|
19496
20516
|
onMouseDown: onOrderDialog,
|
|
19497
|
-
order: uiOrder
|
|
20517
|
+
order: uiOrder,
|
|
20518
|
+
source: uiSource
|
|
19498
20519
|
});
|
|
19499
20520
|
};
|
|
19500
20521
|
/**
|
|
@@ -19504,6 +20525,7 @@ var LegendConnectComponent = function LegendConnectComponent(_ref) {
|
|
|
19504
20525
|
*
|
|
19505
20526
|
* Expects the following props:
|
|
19506
20527
|
* @param {boolean} showMapId (optional) showMapId: boolean - show the id of the map in the dialog title of which the legend is shown in te dialog
|
|
20528
|
+
* @param {Source} source (optional) source: Source - default is 'app', 'module' makes sure it will be shown on top of the module
|
|
19507
20529
|
|
|
19508
20530
|
* ``` <LegendConnect legendDialogId={legendDialogId} />```
|
|
19509
20531
|
*/
|
|
@@ -19537,7 +20559,9 @@ var LegendConnect = function LegendConnect(_a) {
|
|
|
19537
20559
|
* */
|
|
19538
20560
|
|
|
19539
20561
|
var LegendMapButtonConnect = function LegendMapButtonConnect(_ref) {
|
|
19540
|
-
var mapId = _ref.mapId
|
|
20562
|
+
var mapId = _ref.mapId,
|
|
20563
|
+
_ref$source = _ref.source,
|
|
20564
|
+
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
19541
20565
|
var dispatch = useDispatch();
|
|
19542
20566
|
var currentActiveMapId = useSelector(function (store) {
|
|
19543
20567
|
return getDialogMapId(store, 'legend');
|
|
@@ -19549,9 +20573,10 @@ var LegendMapButtonConnect = function LegendMapButtonConnect(_ref) {
|
|
|
19549
20573
|
dispatch(setActiveMapIdForDialog({
|
|
19550
20574
|
type: 'legend',
|
|
19551
20575
|
activeMapId: mapId,
|
|
19552
|
-
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore
|
|
20576
|
+
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
|
|
20577
|
+
source: source
|
|
19553
20578
|
}));
|
|
19554
|
-
}, [currentActiveMapId, dispatch, isOpenInStore, mapId]);
|
|
20579
|
+
}, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
|
|
19555
20580
|
var isOpen = currentActiveMapId === mapId && isOpenInStore;
|
|
19556
20581
|
return /*#__PURE__*/React.createElement(MapControlButton, {
|
|
19557
20582
|
title: "Legend",
|
|
@@ -19608,22 +20633,6 @@ var generateUniqueLayerIds = function generateUniqueLayerIds(layers, activeLayer
|
|
|
19608
20633
|
};
|
|
19609
20634
|
};
|
|
19610
20635
|
|
|
19611
|
-
/* *
|
|
19612
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19613
|
-
* you may not use this file except in compliance with the License.
|
|
19614
|
-
* You may obtain a copy of the License at
|
|
19615
|
-
*
|
|
19616
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19617
|
-
*
|
|
19618
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19619
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19620
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19621
|
-
* See the License for the specific language governing permissions and
|
|
19622
|
-
* limitations under the License.
|
|
19623
|
-
*
|
|
19624
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
19625
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
19626
|
-
* */
|
|
19627
20636
|
var useStyles$4 = makeStyles(function (theme) {
|
|
19628
20637
|
return {
|
|
19629
20638
|
mapTitle: {
|
|
@@ -19658,6 +20667,8 @@ var ConfigurableConnectedMap = function ConfigurableConnectedMap(_ref) {
|
|
|
19658
20667
|
activeLayerId = _ref.activeLayerId,
|
|
19659
20668
|
_ref$baseLayer = _ref.baseLayer,
|
|
19660
20669
|
baseLayer = _ref$baseLayer === void 0 ? baseLayerGrey$1 : _ref$baseLayer,
|
|
20670
|
+
_ref$overLayers = _ref.overLayers,
|
|
20671
|
+
overLayers = _ref$overLayers === void 0 ? [overLayer$1] : _ref$overLayers,
|
|
19661
20672
|
bbox = _ref.bbox,
|
|
19662
20673
|
srs = _ref.srs,
|
|
19663
20674
|
_ref$displayTimeInMap = _ref.displayTimeInMap,
|
|
@@ -19681,6 +20692,11 @@ var ConfigurableConnectedMap = function ConfigurableConnectedMap(_ref) {
|
|
|
19681
20692
|
var mapId = React__default.useRef(id || generateMapId()).current;
|
|
19682
20693
|
var baseLayerWithUniqueId = Object.assign(Object.assign({}, baseLayer), {
|
|
19683
20694
|
id: "baseLayer-".concat(mapId)
|
|
20695
|
+
});
|
|
20696
|
+
var overLayersWithUniqueId = overLayers.map(function (layer) {
|
|
20697
|
+
return Object.assign(Object.assign({}, layer), {
|
|
20698
|
+
id: generateLayerId()
|
|
20699
|
+
});
|
|
19684
20700
|
}); // make sure all layers have a unique id before going forward
|
|
19685
20701
|
|
|
19686
20702
|
var _generateUniqueLayerI = generateUniqueLayerIds(layers, activeLayerId),
|
|
@@ -19701,9 +20717,7 @@ var ConfigurableConnectedMap = function ConfigurableConnectedMap(_ref) {
|
|
|
19701
20717
|
|
|
19702
20718
|
dispatch(setBaseLayers({
|
|
19703
20719
|
mapId: mapId,
|
|
19704
|
-
layers: [baseLayerWithUniqueId
|
|
19705
|
-
id: generateLayerId()
|
|
19706
|
-
})]
|
|
20720
|
+
layers: [baseLayerWithUniqueId].concat(_toConsumableArray(overLayersWithUniqueId))
|
|
19707
20721
|
})); // bbox
|
|
19708
20722
|
|
|
19709
20723
|
dispatch(setBbox$1({
|
|
@@ -20113,6 +21127,8 @@ var ConfigurableMapWithSliderConnect = function ConfigurableMapWithSliderConnect
|
|
|
20113
21127
|
layers = _ref.layers,
|
|
20114
21128
|
_ref$baseLayer = _ref.baseLayer,
|
|
20115
21129
|
baseLayer = _ref$baseLayer === void 0 ? undefined : _ref$baseLayer,
|
|
21130
|
+
_ref$overLayers = _ref.overLayers,
|
|
21131
|
+
overLayers = _ref$overLayers === void 0 ? undefined : _ref$overLayers,
|
|
20116
21132
|
_ref$activeLayerId = _ref.activeLayerId,
|
|
20117
21133
|
activeLayerId = _ref$activeLayerId === void 0 ? undefined : _ref$activeLayerId,
|
|
20118
21134
|
_ref$shouldAutoUpdate = _ref.shouldAutoUpdate,
|
|
@@ -20146,6 +21162,7 @@ var ConfigurableMapWithSliderConnect = function ConfigurableMapWithSliderConnect
|
|
|
20146
21162
|
layers: layers || [],
|
|
20147
21163
|
activeLayerId: activeLayerId,
|
|
20148
21164
|
baseLayer: baseLayer,
|
|
21165
|
+
overLayers: overLayers,
|
|
20149
21166
|
bbox: bbox,
|
|
20150
21167
|
srs: srs,
|
|
20151
21168
|
shouldAutoUpdate: shouldAutoUpdate,
|